diff --git a/github/config.go b/github/config.go index 37704311e..9593667fb 100644 --- a/github/config.go +++ b/github/config.go @@ -10,6 +10,7 @@ import ( "github.com/google/go-github/v62/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging" + "github.com/octokit/go-sdk/pkg" "github.com/shurcooL/githubv4" "golang.org/x/oauth2" ) @@ -32,6 +33,7 @@ type Owner struct { id int64 v3client *github.Client v4client *githubv4.Client + octokitClient *pkg.Client StopContext context.Context IsOrganization bool } @@ -110,6 +112,31 @@ func (c *Config) NewRESTClient(client *http.Client) (*github.Client, error) { return v3client, nil } +func (c *Config) NewOctokitClient() (*pkg.Client, error) { + + uv3, err := url.Parse(c.BaseURL) + if err != nil { + return nil, err + } + + if uv3.String() != "https://api.github.com/" { + uv3.Path = uv3.Path + "api/v3/" + } + + octokitClient, err := pkg.NewApiClient( + // pkg.WithUserAgent("my-user-agent"), // Should this be set to terraform-provider-github or similar? Doesn't look like the user-agent is set for the other clients + pkg.WithRequestTimeout(5*time.Second), + pkg.WithBaseUrl(strings.TrimSuffix(uv3.Path, "/")), // Drop the last `/` if it's there + pkg.WithTokenAuthentication(c.Token), + ) + + if err != nil { + return nil, err + } + + return octokitClient, nil +} + func (c *Config) ConfigureOwner(owner *Owner) (*Owner, error) { ctx := context.Background() owner.name = c.Owner @@ -152,6 +179,11 @@ func (c *Config) Meta() (interface{}, error) { return nil, err } + octokitClient, err := c.NewOctokitClient() + if err != nil { + return nil, err + } + v4client, err := c.NewGraphQLClient(client) if err != nil { return nil, err @@ -160,6 +192,7 @@ func (c *Config) Meta() (interface{}, error) { var owner Owner owner.v4client = v4client owner.v3client = v3client + owner.octokitClient = octokitClient owner.StopContext = context.Background() _, err = c.ConfigureOwner(&owner) diff --git a/github/data_source_github_repository_custom_property.go b/github/data_source_github_repository_custom_property.go new file mode 100644 index 000000000..4456e7700 --- /dev/null +++ b/github/data_source_github_repository_custom_property.go @@ -0,0 +1,103 @@ +package github + +import ( + "context" + "fmt" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + abs "github.com/microsoft/kiota-abstractions-go" + "github.com/octokit/go-sdk/pkg/github/models" +) + +func dataSourceGithubRepositoryCustomProperty() *schema.Resource { + return &schema.Resource{ + Read: dataSourceGithubOrgaRepositoryCustomProperty, + + Schema: map[string]*schema.Schema{ + "repository": { + Type: schema.TypeString, + Required: true, + Description: "Name of the repository which the custom properties should be on.", + }, + "property_name": { + Type: schema.TypeString, + Required: true, + Description: "Name of the repository which the custom properties should be on.", + }, + "property_value": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + } +} + +func parseRepositoryCustomProperties(repo models.FullRepositoryable) (map[string][]string, error) { + repoFullName := repo.GetFullName() + repoProps := repo.GetCustomProperties().GetAdditionalData() + + properties := make(map[string][]string) + for key, value := range repoProps { + + typeAssertionErr := fmt.Errorf("error reading custom property `%v` in %s. Value couldn't be parsed as a string, or a list of strings", key, *repoFullName) + + // The value of a custom property can be either a string, or a list of strings (https://docs.github.com/en/enterprise-cloud@latest/rest/repos/custom-properties?apiVersion=2022-11-28#get-all-custom-property-values-for-a-repository) + switch valueStringOrSlice := value.(type) { + case *string: + interfaceSlice := make([]string, 1) + interfaceSlice[0] = *valueStringOrSlice + properties[key] = interfaceSlice + + case []interface{}: + interfaceSlice := make([]string, len(valueStringOrSlice)) + for idx, valInterface := range valueStringOrSlice { + switch valString := valInterface.(type) { + case *string: + interfaceSlice[idx] = *valString + + default: + return nil, typeAssertionErr + } + } + properties[key] = interfaceSlice + + default: + return nil, typeAssertionErr + } + } + + return properties, nil +} + +func dataSourceGithubOrgaRepositoryCustomProperty(d *schema.ResourceData, meta interface{}) error { + + octokitClient := meta.(*Owner).octokitClient + ctx := context.Background() + + owner := meta.(*Owner).name + repoName := d.Get("repository").(string) + propertyName := d.Get("property_name").(string) + + repoRequestConfig := &abs.RequestConfiguration[abs.DefaultQueryParameters]{ + QueryParameters: &abs.DefaultQueryParameters{}, + } + repo, err := octokitClient.Repos().ByOwnerId(owner).ByRepoId(repoName).Get(ctx, repoRequestConfig) + if err != nil { + return err + } + + properties, err := parseRepositoryCustomProperties(repo) + if err != nil { + return err + } + + d.SetId(buildThreePartID(owner, repoName, propertyName)) + d.Set("repository", repoName) + d.Set("property_name", propertyName) + d.Set("property_value", properties[propertyName]) + + return nil +} diff --git a/github/provider.go b/github/provider.go index 39741a2c1..0f15dc6aa 100644 --- a/github/provider.go +++ b/github/provider.go @@ -242,6 +242,7 @@ func Provider() *schema.Provider { "github_repository": dataSourceGithubRepository(), "github_repository_autolink_references": dataSourceGithubRepositoryAutolinkReferences(), "github_repository_branches": dataSourceGithubRepositoryBranches(), + "github_repository_custom_property": dataSourceGithubRepositoryCustomProperty(), "github_repository_environments": dataSourceGithubRepositoryEnvironments(), "github_repository_deploy_keys": dataSourceGithubRepositoryDeployKeys(), "github_repository_deployment_branch_policies": dataSourceGithubRepositoryDeploymentBranchPolicies(), diff --git a/go.mod b/go.mod index a63ea9859..c1ae6cc14 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/integrations/terraform-provider-github/v6 -go 1.21 +go 1.21.5 -toolchain go1.22.0 +toolchain go1.22.3 require ( github.com/client9/misspell v0.3.4 @@ -54,6 +54,7 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/charithe/durationcheck v0.0.10 // indirect github.com/chavacava/garif v0.1.0 // indirect + github.com/cjlapao/common-go v0.0.39 // indirect github.com/ckaznocha/intrange v0.1.2 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/curioswitch/go-reassign v0.2.0 // indirect @@ -68,6 +69,8 @@ require ( github.com/fzipp/gocyclo v0.6.0 // indirect github.com/ghostiam/protogetter v0.3.6 // indirect github.com/go-critic/go-critic v0.11.4 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect github.com/go-toolsmith/astcopy v1.1.0 // indirect github.com/go-toolsmith/astequal v1.2.0 // indirect @@ -79,6 +82,7 @@ require ( github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/gofrs/flock v0.8.1 // indirect + github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e // indirect @@ -121,6 +125,7 @@ require ( github.com/jjti/go-spancheck v0.6.1 // indirect github.com/julz/importas v0.1.0 // indirect github.com/karamaru-alpha/copyloopvar v1.1.0 // indirect + github.com/kfcampbell/ghinstallation v0.0.6 // indirect github.com/kisielk/errcheck v1.7.0 // indirect github.com/kkHAIKE/contextcheck v1.1.5 // indirect github.com/kulti/thelper v0.6.3 // indirect @@ -141,6 +146,12 @@ require ( github.com/mattn/go-runewidth v0.0.9 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mgechev/revive v1.3.7 // indirect + github.com/microsoft/kiota-abstractions-go v1.6.0 // indirect + github.com/microsoft/kiota-http-go v1.3.3 // indirect + github.com/microsoft/kiota-serialization-form-go v1.0.0 // indirect + github.com/microsoft/kiota-serialization-json-go v1.0.7 // indirect + github.com/microsoft/kiota-serialization-multipart-go v1.0.0 // indirect + github.com/microsoft/kiota-serialization-text-go v1.0.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect @@ -153,6 +164,7 @@ require ( github.com/nishanths/exhaustive v0.12.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect github.com/nunnatsa/ginkgolinter v0.16.2 // indirect + github.com/octokit/go-sdk v0.0.20 // indirect github.com/oklog/run v1.0.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pelletier/go-toml v1.9.5 // indirect @@ -190,6 +202,7 @@ require ( github.com/spf13/viper v1.12.0 // indirect github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect + github.com/std-uritemplate/std-uritemplate/go v0.0.55 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.4.1 // indirect github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect @@ -213,6 +226,9 @@ require ( gitlab.com/bosi/decorder v0.4.2 // indirect go-simpler.org/musttag v0.12.2 // indirect go-simpler.org/sloglint v0.7.1 // 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 go.uber.org/atomic v1.7.0 // indirect go.uber.org/automaxprocs v1.5.3 // indirect go.uber.org/multierr v1.6.0 // indirect diff --git a/go.sum b/go.sum index e68358275..13d633671 100644 --- a/go.sum +++ b/go.sum @@ -129,6 +129,8 @@ github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+U github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cjlapao/common-go v0.0.39 h1:bAAUrj2B9v0kMzbAOhzjSmiyDy+rd56r2sy7oEiQLlA= +github.com/cjlapao/common-go v0.0.39/go.mod h1:M3dzazLjTjEtZJbbxoA5ZDiGCiHmpwqW9l4UWaddwOA= github.com/ckaznocha/intrange v0.1.2 h1:3Y4JAxcMntgb/wABQ6e8Q8leMd26JbX2790lIss9MTI= github.com/ckaznocha/intrange v0.1.2/go.mod h1:RWffCw/vKBwHeOEwWdCikAtY0q4gGt8VhJZEEA5n+RE= github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= @@ -188,8 +190,11 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= @@ -223,6 +228,8 @@ github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJA github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -401,6 +408,8 @@ github.com/karamaru-alpha/copyloopvar v1.1.0 h1:x7gNyKcC2vRBO1H2Mks5u1VxQtYvFiym github.com/karamaru-alpha/copyloopvar v1.1.0/go.mod h1:u7CIfztblY0jZLOQZgH3oYsJzpC2A7S6u/lfgSXHy0k= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kfcampbell/ghinstallation v0.0.6 h1:L4QkjRqNosJ6Kyetymq7FswY1wUxMQO+fyYXJAWl0WY= +github.com/kfcampbell/ghinstallation v0.0.6/go.mod h1:UXWfCKaLwF+AiyCo8gxE5oA0VMQsAmCdRXgTyyRdUnA= github.com/kisielk/errcheck v1.7.0 h1:+SbscKmWJ5mOK/bO1zS60F5I9WwZDWOfRsC4RwfwRV0= github.com/kisielk/errcheck v1.7.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/FqKluHJQ= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -459,6 +468,18 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0j github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mgechev/revive v1.3.7 h1:502QY0vQGe9KtYJ9FpxMz9rL+Fc/P13CI5POL4uHCcE= github.com/mgechev/revive v1.3.7/go.mod h1:RJ16jUbF0OWC3co/+XTxmFNgEpUPwnnA0BRllX2aDNA= +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.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/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -490,6 +511,8 @@ github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= github.com/nunnatsa/ginkgolinter v0.16.2 h1:8iLqHIZvN4fTLDC0Ke9tbSZVcyVHoBs0HIbnVSxfHJk= github.com/nunnatsa/ginkgolinter v0.16.2/go.mod h1:4tWRinDN1FeJgU+iJANW/kz7xKN5nYRAOfJDQUS9dOQ= +github.com/octokit/go-sdk v0.0.20 h1:fVfTMij67/UTE4Sa5aifNrmywHEaEX1NyF8izf+1IcM= +github.com/octokit/go-sdk v0.0.20/go.mod h1:PfWghwM9O7kxmkd1cUrSauEOw/s+Qn1jg8cJ5FV5ld0= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= @@ -612,6 +635,8 @@ github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YE github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= github.com/stbenjam/no-sprintf-host-port v0.1.1 h1:tYugd/yrm1O0dV+ThCbaKZh195Dfm07ysF0U6JQXczc= github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= +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/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -696,6 +721,12 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +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= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= diff --git a/vendor/github.com/cjlapao/common-go/LICENSE b/vendor/github.com/cjlapao/common-go/LICENSE new file mode 100644 index 000000000..b6a97c44e --- /dev/null +++ b/vendor/github.com/cjlapao/common-go/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Carlos Lapao + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/cjlapao/common-go/duration/main.go b/vendor/github.com/cjlapao/common-go/duration/main.go new file mode 100644 index 000000000..f93d27b95 --- /dev/null +++ b/vendor/github.com/cjlapao/common-go/duration/main.go @@ -0,0 +1,191 @@ +// Package duration provides a partial implementation of ISO8601 durations. (no months) +package duration + +import ( + "bytes" + "errors" + "fmt" + "math" + "regexp" + "strconv" + "text/template" + "time" +) + +var ( + // ErrBadFormat is returned when parsing fails + ErrBadFormat = errors.New("bad format string") + + ErrWeeksNotWithYearsOrMonth = errors.New("weeks are not allowed with years or months") + + ErrMonthsInDurationUseOverload = errors.New("months are not allowed with the ToDuration method, use the overload instead") + + tmpl = template.Must(template.New("duration").Parse(`P{{if .Years}}{{.Years}}Y{{end}}{{if .Months}}{{.Months}}M{{end}}{{if .Weeks}}{{.Weeks}}W{{end}}{{if .Days}}{{.Days}}D{{end}}{{if .HasTimePart}}T{{end }}{{if .Hours}}{{.Hours}}H{{end}}{{if .Minutes}}{{.Minutes}}M{{end}}{{if .Seconds}}{{.Seconds}}S{{end}}`)) + + full = regexp.MustCompile(`P((?P\d+)Y)?((?P\d+)M)?((?P\d+)D)?(T((?P\d+)H)?((?P\d+)M)?((?P\d+(?:\.\d+))S)?)?`) + week = regexp.MustCompile(`P((?P\d+)W)`) +) + +type Duration struct { + Years int + Months int + Weeks int + Days int + Hours int + Minutes int + Seconds int + MilliSeconds int +} + +func FromString(dur string) (*Duration, error) { + var ( + match []string + re *regexp.Regexp + ) + + if week.MatchString(dur) { + match = week.FindStringSubmatch(dur) + re = week + } else if full.MatchString(dur) { + match = full.FindStringSubmatch(dur) + re = full + } else { + return nil, ErrBadFormat + } + + d := &Duration{} + + for i, name := range re.SubexpNames() { + part := match[i] + if i == 0 || name == "" || part == "" { + continue + } + + val, err := strconv.ParseFloat(part, 10) + if err != nil { + return nil, err + } + switch name { + case "year": + d.Years = int(val) + case "month": + d.Months = int(val) + case "week": + d.Weeks = int(val) + case "day": + d.Days = int(val) + case "hour": + c := time.Duration(val) * time.Hour + d.Hours = int(c.Hours()) + case "minute": + c := time.Duration(val) * time.Minute + d.Minutes = int(c.Minutes()) + case "second": + s, milli := math.Modf(val) + d.Seconds = int(s) + d.MilliSeconds = int(milli * 1000) + default: + return nil, fmt.Errorf("unknown field %s", name) + } + } + + return d, nil +} + +// String prints out the value passed in. +func (d *Duration) String() string { + var s bytes.Buffer + + err := d.Normalize() + + if err != nil { + panic(err) + } + + err = tmpl.Execute(&s, d) + if err != nil { + panic(err) + } + + return s.String() +} + +// Normalize makes sure that all fields are represented as the smallest meaningful value possible by dividing them out by the conversion factor to the larger unit. +// e.g. if you have a duration of 10 day, 25 hour, and 61 minute, it will be normalized to 1 week 5 days, 2 hours, and 1 minute. +// this function does not normalize days to months, weeks to months or weeks to years as they do not always convert with the same value. +// it also won't normalize days to weeks if months or years are present, and will return an error if the value is invalid +func (d *Duration) Normalize() error { + msToS := 1000 + StoM := 60 + MtoH := 60 + HtoD := 24 + DtoW := 7 + MtoY := 12 + if d.MilliSeconds >= msToS { + d.Seconds += d.MilliSeconds / msToS + d.MilliSeconds %= msToS + } + if d.Seconds >= StoM { + d.Minutes += d.Seconds / StoM + d.Seconds %= StoM + } + if d.Minutes >= MtoH { + d.Hours += d.Minutes / MtoH + d.Minutes %= MtoH + } + if d.Hours >= HtoD { + d.Days += d.Hours / HtoD + d.Hours %= HtoD + } + if d.Days >= DtoW && d.Months == 0 && d.Years == 0 { + d.Weeks += d.Days / DtoW + d.Days %= DtoW + } + if d.Months > MtoY { + d.Years += d.Months / MtoY + d.Months %= MtoY + } + + if d.Weeks != 0 && (d.Years != 0 || d.Months != 0) { + return ErrWeeksNotWithYearsOrMonth + } + + return nil + // a month is not always 30 days, so we don't normalize that + // a month is not always 4 weeks, so we don't normalize that + // a year is not always 52 weeks, so we don't normalize that +} + +func (d *Duration) HasTimePart() bool { + return d.Hours != 0 || d.Minutes != 0 || d.Seconds != 0 +} + +func (d *Duration) ToDuration() (time.Duration, error) { + if d.Months != 0 { + return 0, ErrMonthsInDurationUseOverload + } + return d.ToDurationWithMonths(31) +} + +func (d *Duration) ToDurationWithMonths(daysInAMonth int) (time.Duration, error) { + day := time.Hour * 24 + year := day * 365 + month := day * time.Duration(daysInAMonth) + + tot := time.Duration(0) + + err := d.Normalize() + if err != nil { + return tot, err + } + + tot += year * time.Duration(d.Years) + tot += month * time.Duration(d.Months) + tot += day * 7 * time.Duration(d.Weeks) + tot += day * time.Duration(d.Days) + tot += time.Hour * time.Duration(d.Hours) + tot += time.Minute * time.Duration(d.Minutes) + tot += time.Second * time.Duration(d.Seconds) + + return tot, nil +} diff --git a/vendor/github.com/go-logr/logr/.golangci.yaml b/vendor/github.com/go-logr/logr/.golangci.yaml new file mode 100644 index 000000000..0cffafa7b --- /dev/null +++ b/vendor/github.com/go-logr/logr/.golangci.yaml @@ -0,0 +1,26 @@ +run: + timeout: 1m + tests: true + +linters: + disable-all: true + enable: + - asciicheck + - errcheck + - forcetypeassert + - gocritic + - gofmt + - goimports + - gosimple + - govet + - ineffassign + - misspell + - revive + - staticcheck + - typecheck + - unused + +issues: + exclude-use-default: false + max-issues-per-linter: 0 + max-same-issues: 10 diff --git a/vendor/github.com/go-logr/logr/CHANGELOG.md b/vendor/github.com/go-logr/logr/CHANGELOG.md new file mode 100644 index 000000000..c35696004 --- /dev/null +++ b/vendor/github.com/go-logr/logr/CHANGELOG.md @@ -0,0 +1,6 @@ +# CHANGELOG + +## v1.0.0-rc1 + +This is the first logged release. Major changes (including breaking changes) +have occurred since earlier tags. diff --git a/vendor/github.com/go-logr/logr/CONTRIBUTING.md b/vendor/github.com/go-logr/logr/CONTRIBUTING.md new file mode 100644 index 000000000..5d37e294c --- /dev/null +++ b/vendor/github.com/go-logr/logr/CONTRIBUTING.md @@ -0,0 +1,17 @@ +# Contributing + +Logr is open to pull-requests, provided they fit within the intended scope of +the project. Specifically, this library aims to be VERY small and minimalist, +with no external dependencies. + +## Compatibility + +This project intends to follow [semantic versioning](http://semver.org) and +is very strict about compatibility. Any proposed changes MUST follow those +rules. + +## Performance + +As a logging library, logr must be as light-weight as possible. Any proposed +code change must include results of running the [benchmark](./benchmark) +before and after the change. diff --git a/vendor/github.com/go-logr/logr/LICENSE b/vendor/github.com/go-logr/logr/LICENSE new file mode 100644 index 000000000..8dada3eda --- /dev/null +++ b/vendor/github.com/go-logr/logr/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/go-logr/logr/README.md b/vendor/github.com/go-logr/logr/README.md new file mode 100644 index 000000000..8969526a6 --- /dev/null +++ b/vendor/github.com/go-logr/logr/README.md @@ -0,0 +1,406 @@ +# A minimal logging API for Go + +[![Go Reference](https://pkg.go.dev/badge/github.com/go-logr/logr.svg)](https://pkg.go.dev/github.com/go-logr/logr) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/go-logr/logr/badge)](https://securityscorecards.dev/viewer/?platform=github.com&org=go-logr&repo=logr) + +logr offers an(other) opinion on how Go programs and libraries can do logging +without becoming coupled to a particular logging implementation. This is not +an implementation of logging - it is an API. In fact it is two APIs with two +different sets of users. + +The `Logger` type is intended for application and library authors. It provides +a relatively small API which can be used everywhere you want to emit logs. It +defers the actual act of writing logs (to files, to stdout, or whatever) to the +`LogSink` interface. + +The `LogSink` interface is intended for logging library implementers. It is a +pure interface which can be implemented by logging frameworks to provide the actual logging +functionality. + +This decoupling allows application and library developers to write code in +terms of `logr.Logger` (which has very low dependency fan-out) while the +implementation of logging is managed "up stack" (e.g. in or near `main()`.) +Application developers can then switch out implementations as necessary. + +Many people assert that libraries should not be logging, and as such efforts +like this are pointless. Those people are welcome to convince the authors of +the tens-of-thousands of libraries that *DO* write logs that they are all +wrong. In the meantime, logr takes a more practical approach. + +## Typical usage + +Somewhere, early in an application's life, it will make a decision about which +logging library (implementation) it actually wants to use. Something like: + +``` + func main() { + // ... other setup code ... + + // Create the "root" logger. We have chosen the "logimpl" implementation, + // which takes some initial parameters and returns a logr.Logger. + logger := logimpl.New(param1, param2) + + // ... other setup code ... +``` + +Most apps will call into other libraries, create structures to govern the flow, +etc. The `logr.Logger` object can be passed to these other libraries, stored +in structs, or even used as a package-global variable, if needed. For example: + +``` + app := createTheAppObject(logger) + app.Run() +``` + +Outside of this early setup, no other packages need to know about the choice of +implementation. They write logs in terms of the `logr.Logger` that they +received: + +``` + type appObject struct { + // ... other fields ... + logger logr.Logger + // ... other fields ... + } + + func (app *appObject) Run() { + app.logger.Info("starting up", "timestamp", time.Now()) + + // ... app code ... +``` + +## Background + +If the Go standard library had defined an interface for logging, this project +probably would not be needed. Alas, here we are. + +When the Go developers started developing such an interface with +[slog](https://github.com/golang/go/issues/56345), they adopted some of the +logr design but also left out some parts and changed others: + +| Feature | logr | slog | +|---------|------|------| +| High-level API | `Logger` (passed by value) | `Logger` (passed by [pointer](https://github.com/golang/go/issues/59126)) | +| Low-level API | `LogSink` | `Handler` | +| Stack unwinding | done by `LogSink` | done by `Logger` | +| Skipping helper functions | `WithCallDepth`, `WithCallStackHelper` | [not supported by Logger](https://github.com/golang/go/issues/59145) | +| Generating a value for logging on demand | `Marshaler` | `LogValuer` | +| Log levels | >= 0, higher meaning "less important" | positive and negative, with 0 for "info" and higher meaning "more important" | +| Error log entries | always logged, don't have a verbosity level | normal log entries with level >= `LevelError` | +| Passing logger via context | `NewContext`, `FromContext` | no API | +| Adding a name to a logger | `WithName` | no API | +| Modify verbosity of log entries in a call chain | `V` | no API | +| Grouping of key/value pairs | not supported | `WithGroup`, `GroupValue` | +| Pass context for extracting additional values | no API | API variants like `InfoCtx` | + +The high-level slog API is explicitly meant to be one of many different APIs +that can be layered on top of a shared `slog.Handler`. logr is one such +alternative API, with [interoperability](#slog-interoperability) provided by +some conversion functions. + +### Inspiration + +Before you consider this package, please read [this blog post by the +inimitable Dave Cheney][warning-makes-no-sense]. We really appreciate what +he has to say, and it largely aligns with our own experiences. + +### Differences from Dave's ideas + +The main differences are: + +1. Dave basically proposes doing away with the notion of a logging API in favor +of `fmt.Printf()`. We disagree, especially when you consider things like output +locations, timestamps, file and line decorations, and structured logging. This +package restricts the logging API to just 2 types of logs: info and error. + +Info logs are things you want to tell the user which are not errors. Error +logs are, well, errors. If your code receives an `error` from a subordinate +function call and is logging that `error` *and not returning it*, use error +logs. + +2. Verbosity-levels on info logs. This gives developers a chance to indicate +arbitrary grades of importance for info logs, without assigning names with +semantic meaning such as "warning", "trace", and "debug." Superficially this +may feel very similar, but the primary difference is the lack of semantics. +Because verbosity is a numerical value, it's safe to assume that an app running +with higher verbosity means more (and less important) logs will be generated. + +## Implementations (non-exhaustive) + +There are implementations for the following logging libraries: + +- **a function** (can bridge to non-structured libraries): [funcr](https://github.com/go-logr/logr/tree/master/funcr) +- **a testing.T** (for use in Go tests, with JSON-like output): [testr](https://github.com/go-logr/logr/tree/master/testr) +- **github.com/google/glog**: [glogr](https://github.com/go-logr/glogr) +- **k8s.io/klog** (for Kubernetes): [klogr](https://git.k8s.io/klog/klogr) +- **a testing.T** (with klog-like text output): [ktesting](https://git.k8s.io/klog/ktesting) +- **go.uber.org/zap**: [zapr](https://github.com/go-logr/zapr) +- **log** (the Go standard library logger): [stdr](https://github.com/go-logr/stdr) +- **github.com/sirupsen/logrus**: [logrusr](https://github.com/bombsimon/logrusr) +- **github.com/wojas/genericr**: [genericr](https://github.com/wojas/genericr) (makes it easy to implement your own backend) +- **logfmt** (Heroku style [logging](https://www.brandur.org/logfmt)): [logfmtr](https://github.com/iand/logfmtr) +- **github.com/rs/zerolog**: [zerologr](https://github.com/go-logr/zerologr) +- **github.com/go-kit/log**: [gokitlogr](https://github.com/tonglil/gokitlogr) (also compatible with github.com/go-kit/kit/log since v0.12.0) +- **bytes.Buffer** (writing to a buffer): [bufrlogr](https://github.com/tonglil/buflogr) (useful for ensuring values were logged, like during testing) + +## slog interoperability + +Interoperability goes both ways, using the `logr.Logger` API with a `slog.Handler` +and using the `slog.Logger` API with a `logr.LogSink`. `FromSlogHandler` and +`ToSlogHandler` convert between a `logr.Logger` and a `slog.Handler`. +As usual, `slog.New` can be used to wrap such a `slog.Handler` in the high-level +slog API. + +### Using a `logr.LogSink` as backend for slog + +Ideally, a logr sink implementation should support both logr and slog by +implementing both the normal logr interface(s) and `SlogSink`. Because +of a conflict in the parameters of the common `Enabled` method, it is [not +possible to implement both slog.Handler and logr.Sink in the same +type](https://github.com/golang/go/issues/59110). + +If both are supported, log calls can go from the high-level APIs to the backend +without the need to convert parameters. `FromSlogHandler` and `ToSlogHandler` can +convert back and forth without adding additional wrappers, with one exception: +when `Logger.V` was used to adjust the verbosity for a `slog.Handler`, then +`ToSlogHandler` has to use a wrapper which adjusts the verbosity for future +log calls. + +Such an implementation should also support values that implement specific +interfaces from both packages for logging (`logr.Marshaler`, `slog.LogValuer`, +`slog.GroupValue`). logr does not convert those. + +Not supporting slog has several drawbacks: +- Recording source code locations works correctly if the handler gets called + through `slog.Logger`, but may be wrong in other cases. That's because a + `logr.Sink` does its own stack unwinding instead of using the program counter + provided by the high-level API. +- slog levels <= 0 can be mapped to logr levels by negating the level without a + loss of information. But all slog levels > 0 (e.g. `slog.LevelWarning` as + used by `slog.Logger.Warn`) must be mapped to 0 before calling the sink + because logr does not support "more important than info" levels. +- The slog group concept is supported by prefixing each key in a key/value + pair with the group names, separated by a dot. For structured output like + JSON it would be better to group the key/value pairs inside an object. +- Special slog values and interfaces don't work as expected. +- The overhead is likely to be higher. + +These drawbacks are severe enough that applications using a mixture of slog and +logr should switch to a different backend. + +### Using a `slog.Handler` as backend for logr + +Using a plain `slog.Handler` without support for logr works better than the +other direction: +- All logr verbosity levels can be mapped 1:1 to their corresponding slog level + by negating them. +- Stack unwinding is done by the `SlogSink` and the resulting program + counter is passed to the `slog.Handler`. +- Names added via `Logger.WithName` are gathered and recorded in an additional + attribute with `logger` as key and the names separated by slash as value. +- `Logger.Error` is turned into a log record with `slog.LevelError` as level + and an additional attribute with `err` as key, if an error was provided. + +The main drawback is that `logr.Marshaler` will not be supported. Types should +ideally support both `logr.Marshaler` and `slog.Valuer`. If compatibility +with logr implementations without slog support is not important, then +`slog.Valuer` is sufficient. + +### Context support for slog + +Storing a logger in a `context.Context` is not supported by +slog. `NewContextWithSlogLogger` and `FromContextAsSlogLogger` can be +used to fill this gap. They store and retrieve a `slog.Logger` pointer +under the same context key that is also used by `NewContext` and +`FromContext` for `logr.Logger` value. + +When `NewContextWithSlogLogger` is followed by `FromContext`, the latter will +automatically convert the `slog.Logger` to a +`logr.Logger`. `FromContextAsSlogLogger` does the same for the other direction. + +With this approach, binaries which use either slog or logr are as efficient as +possible with no unnecessary allocations. This is also why the API stores a +`slog.Logger` pointer: when storing a `slog.Handler`, creating a `slog.Logger` +on retrieval would need to allocate one. + +The downside is that switching back and forth needs more allocations. Because +logr is the API that is already in use by different packages, in particular +Kubernetes, the recommendation is to use the `logr.Logger` API in code which +uses contextual logging. + +An alternative to adding values to a logger and storing that logger in the +context is to store the values in the context and to configure a logging +backend to extract those values when emitting log entries. This only works when +log calls are passed the context, which is not supported by the logr API. + +With the slog API, it is possible, but not +required. https://github.com/veqryn/slog-context is a package for slog which +provides additional support code for this approach. It also contains wrappers +for the context functions in logr, so developers who prefer to not use the logr +APIs directly can use those instead and the resulting code will still be +interoperable with logr. + +## FAQ + +### Conceptual + +#### Why structured logging? + +- **Structured logs are more easily queryable**: Since you've got + key-value pairs, it's much easier to query your structured logs for + particular values by filtering on the contents of a particular key -- + think searching request logs for error codes, Kubernetes reconcilers for + the name and namespace of the reconciled object, etc. + +- **Structured logging makes it easier to have cross-referenceable logs**: + Similarly to searchability, if you maintain conventions around your + keys, it becomes easy to gather all log lines related to a particular + concept. + +- **Structured logs allow better dimensions of filtering**: if you have + structure to your logs, you've got more precise control over how much + information is logged -- you might choose in a particular configuration + to log certain keys but not others, only log lines where a certain key + matches a certain value, etc., instead of just having v-levels and names + to key off of. + +- **Structured logs better represent structured data**: sometimes, the + data that you want to log is inherently structured (think tuple-link + objects.) Structured logs allow you to preserve that structure when + outputting. + +#### Why V-levels? + +**V-levels give operators an easy way to control the chattiness of log +operations**. V-levels provide a way for a given package to distinguish +the relative importance or verbosity of a given log message. Then, if +a particular logger or package is logging too many messages, the user +of the package can simply change the v-levels for that library. + +#### Why not named levels, like Info/Warning/Error? + +Read [Dave Cheney's post][warning-makes-no-sense]. Then read [Differences +from Dave's ideas](#differences-from-daves-ideas). + +#### Why not allow format strings, too? + +**Format strings negate many of the benefits of structured logs**: + +- They're not easily searchable without resorting to fuzzy searching, + regular expressions, etc. + +- They don't store structured data well, since contents are flattened into + a string. + +- They're not cross-referenceable. + +- They don't compress easily, since the message is not constant. + +(Unless you turn positional parameters into key-value pairs with numerical +keys, at which point you've gotten key-value logging with meaningless +keys.) + +### Practical + +#### Why key-value pairs, and not a map? + +Key-value pairs are *much* easier to optimize, especially around +allocations. Zap (a structured logger that inspired logr's interface) has +[performance measurements](https://github.com/uber-go/zap#performance) +that show this quite nicely. + +While the interface ends up being a little less obvious, you get +potentially better performance, plus avoid making users type +`map[string]string{}` every time they want to log. + +#### What if my V-levels differ between libraries? + +That's fine. Control your V-levels on a per-logger basis, and use the +`WithName` method to pass different loggers to different libraries. + +Generally, you should take care to ensure that you have relatively +consistent V-levels within a given logger, however, as this makes deciding +on what verbosity of logs to request easier. + +#### But I really want to use a format string! + +That's not actually a question. Assuming your question is "how do +I convert my mental model of logging with format strings to logging with +constant messages": + +1. Figure out what the error actually is, as you'd write in a TL;DR style, + and use that as a message. + +2. For every place you'd write a format specifier, look to the word before + it, and add that as a key value pair. + +For instance, consider the following examples (all taken from spots in the +Kubernetes codebase): + +- `klog.V(4).Infof("Client is returning errors: code %v, error %v", + responseCode, err)` becomes `logger.Error(err, "client returned an + error", "code", responseCode)` + +- `klog.V(4).Infof("Got a Retry-After %ds response for attempt %d to %v", + seconds, retries, url)` becomes `logger.V(4).Info("got a retry-after + response when requesting url", "attempt", retries, "after + seconds", seconds, "url", url)` + +If you *really* must use a format string, use it in a key's value, and +call `fmt.Sprintf` yourself. For instance: `log.Printf("unable to +reflect over type %T")` becomes `logger.Info("unable to reflect over +type", "type", fmt.Sprintf("%T"))`. In general though, the cases where +this is necessary should be few and far between. + +#### How do I choose my V-levels? + +This is basically the only hard constraint: increase V-levels to denote +more verbose or more debug-y logs. + +Otherwise, you can start out with `0` as "you always want to see this", +`1` as "common logging that you might *possibly* want to turn off", and +`10` as "I would like to performance-test your log collection stack." + +Then gradually choose levels in between as you need them, working your way +down from 10 (for debug and trace style logs) and up from 1 (for chattier +info-type logs). For reference, slog pre-defines -4 for debug logs +(corresponds to 4 in logr), which matches what is +[recommended for Kubernetes](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md#what-method-to-use). + +#### How do I choose my keys? + +Keys are fairly flexible, and can hold more or less any string +value. For best compatibility with implementations and consistency +with existing code in other projects, there are a few conventions you +should consider. + +- Make your keys human-readable. +- Constant keys are generally a good idea. +- Be consistent across your codebase. +- Keys should naturally match parts of the message string. +- Use lower case for simple keys and + [lowerCamelCase](https://en.wiktionary.org/wiki/lowerCamelCase) for + more complex ones. Kubernetes is one example of a project that has + [adopted that + convention](https://github.com/kubernetes/community/blob/HEAD/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#name-arguments). + +While key names are mostly unrestricted (and spaces are acceptable), +it's generally a good idea to stick to printable ascii characters, or at +least match the general character set of your log lines. + +#### Why should keys be constant values? + +The point of structured logging is to make later log processing easier. Your +keys are, effectively, the schema of each log message. If you use different +keys across instances of the same log line, you will make your structured logs +much harder to use. `Sprintf()` is for values, not for keys! + +#### Why is this not a pure interface? + +The Logger type is implemented as a struct in order to allow the Go compiler to +optimize things like high-V `Info` logs that are not triggered. Not all of +these implementations are implemented yet, but this structure was suggested as +a way to ensure they *can* be implemented. All of the real work is behind the +`LogSink` interface. + +[warning-makes-no-sense]: http://dave.cheney.net/2015/11/05/lets-talk-about-logging diff --git a/vendor/github.com/go-logr/logr/SECURITY.md b/vendor/github.com/go-logr/logr/SECURITY.md new file mode 100644 index 000000000..1ca756fc7 --- /dev/null +++ b/vendor/github.com/go-logr/logr/SECURITY.md @@ -0,0 +1,18 @@ +# Security Policy + +If you have discovered a security vulnerability in this project, please report it +privately. **Do not disclose it as a public issue.** This gives us time to work with you +to fix the issue before public exposure, reducing the chance that the exploit will be +used before a patch is released. + +You may submit the report in the following ways: + +- send an email to go-logr-security@googlegroups.com +- send us a [private vulnerability report](https://github.com/go-logr/logr/security/advisories/new) + +Please provide the following information in your report: + +- A description of the vulnerability and its impact +- How to reproduce the issue + +We ask that you give us 90 days to work on a fix before public exposure. diff --git a/vendor/github.com/go-logr/logr/context.go b/vendor/github.com/go-logr/logr/context.go new file mode 100644 index 000000000..de8bcc3ad --- /dev/null +++ b/vendor/github.com/go-logr/logr/context.go @@ -0,0 +1,33 @@ +/* +Copyright 2023 The logr Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package logr + +// contextKey is how we find Loggers in a context.Context. With Go < 1.21, +// the value is always a Logger value. With Go >= 1.21, the value can be a +// Logger value or a slog.Logger pointer. +type contextKey struct{} + +// notFoundError exists to carry an IsNotFound method. +type notFoundError struct{} + +func (notFoundError) Error() string { + return "no logr.Logger was present" +} + +func (notFoundError) IsNotFound() bool { + return true +} diff --git a/vendor/github.com/go-logr/logr/context_noslog.go b/vendor/github.com/go-logr/logr/context_noslog.go new file mode 100644 index 000000000..f012f9a18 --- /dev/null +++ b/vendor/github.com/go-logr/logr/context_noslog.go @@ -0,0 +1,49 @@ +//go:build !go1.21 +// +build !go1.21 + +/* +Copyright 2019 The logr Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package logr + +import ( + "context" +) + +// FromContext returns a Logger from ctx or an error if no Logger is found. +func FromContext(ctx context.Context) (Logger, error) { + if v, ok := ctx.Value(contextKey{}).(Logger); ok { + return v, nil + } + + return Logger{}, notFoundError{} +} + +// FromContextOrDiscard returns a Logger from ctx. If no Logger is found, this +// returns a Logger that discards all log messages. +func FromContextOrDiscard(ctx context.Context) Logger { + if v, ok := ctx.Value(contextKey{}).(Logger); ok { + return v + } + + return Discard() +} + +// NewContext returns a new Context, derived from ctx, which carries the +// provided Logger. +func NewContext(ctx context.Context, logger Logger) context.Context { + return context.WithValue(ctx, contextKey{}, logger) +} diff --git a/vendor/github.com/go-logr/logr/context_slog.go b/vendor/github.com/go-logr/logr/context_slog.go new file mode 100644 index 000000000..065ef0b82 --- /dev/null +++ b/vendor/github.com/go-logr/logr/context_slog.go @@ -0,0 +1,83 @@ +//go:build go1.21 +// +build go1.21 + +/* +Copyright 2019 The logr Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package logr + +import ( + "context" + "fmt" + "log/slog" +) + +// FromContext returns a Logger from ctx or an error if no Logger is found. +func FromContext(ctx context.Context) (Logger, error) { + v := ctx.Value(contextKey{}) + if v == nil { + return Logger{}, notFoundError{} + } + + switch v := v.(type) { + case Logger: + return v, nil + case *slog.Logger: + return FromSlogHandler(v.Handler()), nil + default: + // Not reached. + panic(fmt.Sprintf("unexpected value type for logr context key: %T", v)) + } +} + +// FromContextAsSlogLogger returns a slog.Logger from ctx or nil if no such Logger is found. +func FromContextAsSlogLogger(ctx context.Context) *slog.Logger { + v := ctx.Value(contextKey{}) + if v == nil { + return nil + } + + switch v := v.(type) { + case Logger: + return slog.New(ToSlogHandler(v)) + case *slog.Logger: + return v + default: + // Not reached. + panic(fmt.Sprintf("unexpected value type for logr context key: %T", v)) + } +} + +// FromContextOrDiscard returns a Logger from ctx. If no Logger is found, this +// returns a Logger that discards all log messages. +func FromContextOrDiscard(ctx context.Context) Logger { + if logger, err := FromContext(ctx); err == nil { + return logger + } + return Discard() +} + +// NewContext returns a new Context, derived from ctx, which carries the +// provided Logger. +func NewContext(ctx context.Context, logger Logger) context.Context { + return context.WithValue(ctx, contextKey{}, logger) +} + +// NewContextWithSlogLogger returns a new Context, derived from ctx, which carries the +// provided slog.Logger. +func NewContextWithSlogLogger(ctx context.Context, logger *slog.Logger) context.Context { + return context.WithValue(ctx, contextKey{}, logger) +} diff --git a/vendor/github.com/go-logr/logr/discard.go b/vendor/github.com/go-logr/logr/discard.go new file mode 100644 index 000000000..99fe8be93 --- /dev/null +++ b/vendor/github.com/go-logr/logr/discard.go @@ -0,0 +1,24 @@ +/* +Copyright 2020 The logr Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package logr + +// Discard returns a Logger that discards all messages logged to it. It can be +// used whenever the caller is not interested in the logs. Logger instances +// produced by this function always compare as equal. +func Discard() Logger { + return New(nil) +} diff --git a/vendor/github.com/go-logr/logr/funcr/funcr.go b/vendor/github.com/go-logr/logr/funcr/funcr.go new file mode 100644 index 000000000..fb2f866f4 --- /dev/null +++ b/vendor/github.com/go-logr/logr/funcr/funcr.go @@ -0,0 +1,911 @@ +/* +Copyright 2021 The logr Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package funcr implements formatting of structured log messages and +// optionally captures the call site and timestamp. +// +// The simplest way to use it is via its implementation of a +// github.com/go-logr/logr.LogSink with output through an arbitrary +// "write" function. See New and NewJSON for details. +// +// # Custom LogSinks +// +// For users who need more control, a funcr.Formatter can be embedded inside +// your own custom LogSink implementation. This is useful when the LogSink +// needs to implement additional methods, for example. +// +// # Formatting +// +// This will respect logr.Marshaler, fmt.Stringer, and error interfaces for +// values which are being logged. When rendering a struct, funcr will use Go's +// standard JSON tags (all except "string"). +package funcr + +import ( + "bytes" + "encoding" + "encoding/json" + "fmt" + "path/filepath" + "reflect" + "runtime" + "strconv" + "strings" + "time" + + "github.com/go-logr/logr" +) + +// New returns a logr.Logger which is implemented by an arbitrary function. +func New(fn func(prefix, args string), opts Options) logr.Logger { + return logr.New(newSink(fn, NewFormatter(opts))) +} + +// NewJSON returns a logr.Logger which is implemented by an arbitrary function +// and produces JSON output. +func NewJSON(fn func(obj string), opts Options) logr.Logger { + fnWrapper := func(_, obj string) { + fn(obj) + } + return logr.New(newSink(fnWrapper, NewFormatterJSON(opts))) +} + +// Underlier exposes access to the underlying logging function. Since +// callers only have a logr.Logger, they have to know which +// implementation is in use, so this interface is less of an +// abstraction and more of a way to test type conversion. +type Underlier interface { + GetUnderlying() func(prefix, args string) +} + +func newSink(fn func(prefix, args string), formatter Formatter) logr.LogSink { + l := &fnlogger{ + Formatter: formatter, + write: fn, + } + // For skipping fnlogger.Info and fnlogger.Error. + l.Formatter.AddCallDepth(1) + return l +} + +// Options carries parameters which influence the way logs are generated. +type Options struct { + // LogCaller tells funcr to add a "caller" key to some or all log lines. + // This has some overhead, so some users might not want it. + LogCaller MessageClass + + // LogCallerFunc tells funcr to also log the calling function name. This + // has no effect if caller logging is not enabled (see Options.LogCaller). + LogCallerFunc bool + + // LogTimestamp tells funcr to add a "ts" key to log lines. This has some + // overhead, so some users might not want it. + LogTimestamp bool + + // TimestampFormat tells funcr how to render timestamps when LogTimestamp + // is enabled. If not specified, a default format will be used. For more + // details, see docs for Go's time.Layout. + TimestampFormat string + + // LogInfoLevel tells funcr what key to use to log the info level. + // If not specified, the info level will be logged as "level". + // If this is set to "", the info level will not be logged at all. + LogInfoLevel *string + + // Verbosity tells funcr which V logs to produce. Higher values enable + // more logs. Info logs at or below this level will be written, while logs + // above this level will be discarded. + Verbosity int + + // RenderBuiltinsHook allows users to mutate the list of key-value pairs + // while a log line is being rendered. The kvList argument follows logr + // conventions - each pair of slice elements is comprised of a string key + // and an arbitrary value (verified and sanitized before calling this + // hook). The value returned must follow the same conventions. This hook + // can be used to audit or modify logged data. For example, you might want + // to prefix all of funcr's built-in keys with some string. This hook is + // only called for built-in (provided by funcr itself) key-value pairs. + // Equivalent hooks are offered for key-value pairs saved via + // logr.Logger.WithValues or Formatter.AddValues (see RenderValuesHook) and + // for user-provided pairs (see RenderArgsHook). + RenderBuiltinsHook func(kvList []any) []any + + // RenderValuesHook is the same as RenderBuiltinsHook, except that it is + // only called for key-value pairs saved via logr.Logger.WithValues. See + // RenderBuiltinsHook for more details. + RenderValuesHook func(kvList []any) []any + + // RenderArgsHook is the same as RenderBuiltinsHook, except that it is only + // called for key-value pairs passed directly to Info and Error. See + // RenderBuiltinsHook for more details. + RenderArgsHook func(kvList []any) []any + + // MaxLogDepth tells funcr how many levels of nested fields (e.g. a struct + // that contains a struct, etc.) it may log. Every time it finds a struct, + // slice, array, or map the depth is increased by one. When the maximum is + // reached, the value will be converted to a string indicating that the max + // depth has been exceeded. If this field is not specified, a default + // value will be used. + MaxLogDepth int +} + +// MessageClass indicates which category or categories of messages to consider. +type MessageClass int + +const ( + // None ignores all message classes. + None MessageClass = iota + // All considers all message classes. + All + // Info only considers info messages. + Info + // Error only considers error messages. + Error +) + +// fnlogger inherits some of its LogSink implementation from Formatter +// and just needs to add some glue code. +type fnlogger struct { + Formatter + write func(prefix, args string) +} + +func (l fnlogger) WithName(name string) logr.LogSink { + l.Formatter.AddName(name) + return &l +} + +func (l fnlogger) WithValues(kvList ...any) logr.LogSink { + l.Formatter.AddValues(kvList) + return &l +} + +func (l fnlogger) WithCallDepth(depth int) logr.LogSink { + l.Formatter.AddCallDepth(depth) + return &l +} + +func (l fnlogger) Info(level int, msg string, kvList ...any) { + prefix, args := l.FormatInfo(level, msg, kvList) + l.write(prefix, args) +} + +func (l fnlogger) Error(err error, msg string, kvList ...any) { + prefix, args := l.FormatError(err, msg, kvList) + l.write(prefix, args) +} + +func (l fnlogger) GetUnderlying() func(prefix, args string) { + return l.write +} + +// Assert conformance to the interfaces. +var _ logr.LogSink = &fnlogger{} +var _ logr.CallDepthLogSink = &fnlogger{} +var _ Underlier = &fnlogger{} + +// NewFormatter constructs a Formatter which emits a JSON-like key=value format. +func NewFormatter(opts Options) Formatter { + return newFormatter(opts, outputKeyValue) +} + +// NewFormatterJSON constructs a Formatter which emits strict JSON. +func NewFormatterJSON(opts Options) Formatter { + return newFormatter(opts, outputJSON) +} + +// Defaults for Options. +const defaultTimestampFormat = "2006-01-02 15:04:05.000000" +const defaultMaxLogDepth = 16 + +func newFormatter(opts Options, outfmt outputFormat) Formatter { + if opts.TimestampFormat == "" { + opts.TimestampFormat = defaultTimestampFormat + } + if opts.MaxLogDepth == 0 { + opts.MaxLogDepth = defaultMaxLogDepth + } + if opts.LogInfoLevel == nil { + opts.LogInfoLevel = new(string) + *opts.LogInfoLevel = "level" + } + f := Formatter{ + outputFormat: outfmt, + prefix: "", + values: nil, + depth: 0, + opts: &opts, + } + return f +} + +// Formatter is an opaque struct which can be embedded in a LogSink +// implementation. It should be constructed with NewFormatter. Some of +// its methods directly implement logr.LogSink. +type Formatter struct { + outputFormat outputFormat + prefix string + values []any + valuesStr string + parentValuesStr string + depth int + opts *Options + group string // for slog groups + groupDepth int +} + +// outputFormat indicates which outputFormat to use. +type outputFormat int + +const ( + // outputKeyValue emits a JSON-like key=value format, but not strict JSON. + outputKeyValue outputFormat = iota + // outputJSON emits strict JSON. + outputJSON +) + +// PseudoStruct is a list of key-value pairs that gets logged as a struct. +type PseudoStruct []any + +// render produces a log line, ready to use. +func (f Formatter) render(builtins, args []any) string { + // Empirically bytes.Buffer is faster than strings.Builder for this. + buf := bytes.NewBuffer(make([]byte, 0, 1024)) + if f.outputFormat == outputJSON { + buf.WriteByte('{') // for the whole line + } + + vals := builtins + if hook := f.opts.RenderBuiltinsHook; hook != nil { + vals = hook(f.sanitize(vals)) + } + f.flatten(buf, vals, false, false) // keys are ours, no need to escape + continuing := len(builtins) > 0 + + if f.parentValuesStr != "" { + if continuing { + buf.WriteByte(f.comma()) + } + buf.WriteString(f.parentValuesStr) + continuing = true + } + + groupDepth := f.groupDepth + if f.group != "" { + if f.valuesStr != "" || len(args) != 0 { + if continuing { + buf.WriteByte(f.comma()) + } + buf.WriteString(f.quoted(f.group, true)) // escape user-provided keys + buf.WriteByte(f.colon()) + buf.WriteByte('{') // for the group + continuing = false + } else { + // The group was empty + groupDepth-- + } + } + + if f.valuesStr != "" { + if continuing { + buf.WriteByte(f.comma()) + } + buf.WriteString(f.valuesStr) + continuing = true + } + + vals = args + if hook := f.opts.RenderArgsHook; hook != nil { + vals = hook(f.sanitize(vals)) + } + f.flatten(buf, vals, continuing, true) // escape user-provided keys + + for i := 0; i < groupDepth; i++ { + buf.WriteByte('}') // for the groups + } + + if f.outputFormat == outputJSON { + buf.WriteByte('}') // for the whole line + } + + return buf.String() +} + +// flatten renders a list of key-value pairs into a buffer. If continuing is +// true, it assumes that the buffer has previous values and will emit a +// separator (which depends on the output format) before the first pair it +// writes. If escapeKeys is true, the keys are assumed to have +// non-JSON-compatible characters in them and must be evaluated for escapes. +// +// This function returns a potentially modified version of kvList, which +// ensures that there is a value for every key (adding a value if needed) and +// that each key is a string (substituting a key if needed). +func (f Formatter) flatten(buf *bytes.Buffer, kvList []any, continuing bool, escapeKeys bool) []any { + // This logic overlaps with sanitize() but saves one type-cast per key, + // which can be measurable. + if len(kvList)%2 != 0 { + kvList = append(kvList, noValue) + } + copied := false + for i := 0; i < len(kvList); i += 2 { + k, ok := kvList[i].(string) + if !ok { + if !copied { + newList := make([]any, len(kvList)) + copy(newList, kvList) + kvList = newList + copied = true + } + k = f.nonStringKey(kvList[i]) + kvList[i] = k + } + v := kvList[i+1] + + if i > 0 || continuing { + if f.outputFormat == outputJSON { + buf.WriteByte(f.comma()) + } else { + // In theory the format could be something we don't understand. In + // practice, we control it, so it won't be. + buf.WriteByte(' ') + } + } + + buf.WriteString(f.quoted(k, escapeKeys)) + buf.WriteByte(f.colon()) + buf.WriteString(f.pretty(v)) + } + return kvList +} + +func (f Formatter) quoted(str string, escape bool) string { + if escape { + return prettyString(str) + } + // this is faster + return `"` + str + `"` +} + +func (f Formatter) comma() byte { + if f.outputFormat == outputJSON { + return ',' + } + return ' ' +} + +func (f Formatter) colon() byte { + if f.outputFormat == outputJSON { + return ':' + } + return '=' +} + +func (f Formatter) pretty(value any) string { + return f.prettyWithFlags(value, 0, 0) +} + +const ( + flagRawStruct = 0x1 // do not print braces on structs +) + +// TODO: This is not fast. Most of the overhead goes here. +func (f Formatter) prettyWithFlags(value any, flags uint32, depth int) string { + if depth > f.opts.MaxLogDepth { + return `""` + } + + // Handle types that take full control of logging. + if v, ok := value.(logr.Marshaler); ok { + // Replace the value with what the type wants to get logged. + // That then gets handled below via reflection. + value = invokeMarshaler(v) + } + + // Handle types that want to format themselves. + switch v := value.(type) { + case fmt.Stringer: + value = invokeStringer(v) + case error: + value = invokeError(v) + } + + // Handling the most common types without reflect is a small perf win. + switch v := value.(type) { + case bool: + return strconv.FormatBool(v) + case string: + return prettyString(v) + case int: + return strconv.FormatInt(int64(v), 10) + case int8: + return strconv.FormatInt(int64(v), 10) + case int16: + return strconv.FormatInt(int64(v), 10) + case int32: + return strconv.FormatInt(int64(v), 10) + case int64: + return strconv.FormatInt(int64(v), 10) + case uint: + return strconv.FormatUint(uint64(v), 10) + case uint8: + return strconv.FormatUint(uint64(v), 10) + case uint16: + return strconv.FormatUint(uint64(v), 10) + case uint32: + return strconv.FormatUint(uint64(v), 10) + case uint64: + return strconv.FormatUint(v, 10) + case uintptr: + return strconv.FormatUint(uint64(v), 10) + case float32: + return strconv.FormatFloat(float64(v), 'f', -1, 32) + case float64: + return strconv.FormatFloat(v, 'f', -1, 64) + case complex64: + return `"` + strconv.FormatComplex(complex128(v), 'f', -1, 64) + `"` + case complex128: + return `"` + strconv.FormatComplex(v, 'f', -1, 128) + `"` + case PseudoStruct: + buf := bytes.NewBuffer(make([]byte, 0, 1024)) + v = f.sanitize(v) + if flags&flagRawStruct == 0 { + buf.WriteByte('{') + } + for i := 0; i < len(v); i += 2 { + if i > 0 { + buf.WriteByte(f.comma()) + } + k, _ := v[i].(string) // sanitize() above means no need to check success + // arbitrary keys might need escaping + buf.WriteString(prettyString(k)) + buf.WriteByte(f.colon()) + buf.WriteString(f.prettyWithFlags(v[i+1], 0, depth+1)) + } + if flags&flagRawStruct == 0 { + buf.WriteByte('}') + } + return buf.String() + } + + buf := bytes.NewBuffer(make([]byte, 0, 256)) + t := reflect.TypeOf(value) + if t == nil { + return "null" + } + v := reflect.ValueOf(value) + switch t.Kind() { + case reflect.Bool: + return strconv.FormatBool(v.Bool()) + case reflect.String: + return prettyString(v.String()) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return strconv.FormatInt(int64(v.Int()), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return strconv.FormatUint(uint64(v.Uint()), 10) + case reflect.Float32: + return strconv.FormatFloat(float64(v.Float()), 'f', -1, 32) + case reflect.Float64: + return strconv.FormatFloat(v.Float(), 'f', -1, 64) + case reflect.Complex64: + return `"` + strconv.FormatComplex(complex128(v.Complex()), 'f', -1, 64) + `"` + case reflect.Complex128: + return `"` + strconv.FormatComplex(v.Complex(), 'f', -1, 128) + `"` + case reflect.Struct: + if flags&flagRawStruct == 0 { + buf.WriteByte('{') + } + printComma := false // testing i>0 is not enough because of JSON omitted fields + for i := 0; i < t.NumField(); i++ { + fld := t.Field(i) + if fld.PkgPath != "" { + // reflect says this field is only defined for non-exported fields. + continue + } + if !v.Field(i).CanInterface() { + // reflect isn't clear exactly what this means, but we can't use it. + continue + } + name := "" + omitempty := false + if tag, found := fld.Tag.Lookup("json"); found { + if tag == "-" { + continue + } + if comma := strings.Index(tag, ","); comma != -1 { + if n := tag[:comma]; n != "" { + name = n + } + rest := tag[comma:] + if strings.Contains(rest, ",omitempty,") || strings.HasSuffix(rest, ",omitempty") { + omitempty = true + } + } else { + name = tag + } + } + if omitempty && isEmpty(v.Field(i)) { + continue + } + if printComma { + buf.WriteByte(f.comma()) + } + printComma = true // if we got here, we are rendering a field + if fld.Anonymous && fld.Type.Kind() == reflect.Struct && name == "" { + buf.WriteString(f.prettyWithFlags(v.Field(i).Interface(), flags|flagRawStruct, depth+1)) + continue + } + if name == "" { + name = fld.Name + } + // field names can't contain characters which need escaping + buf.WriteString(f.quoted(name, false)) + buf.WriteByte(f.colon()) + buf.WriteString(f.prettyWithFlags(v.Field(i).Interface(), 0, depth+1)) + } + if flags&flagRawStruct == 0 { + buf.WriteByte('}') + } + return buf.String() + case reflect.Slice, reflect.Array: + // If this is outputing as JSON make sure this isn't really a json.RawMessage. + // If so just emit "as-is" and don't pretty it as that will just print + // it as [X,Y,Z,...] which isn't terribly useful vs the string form you really want. + if f.outputFormat == outputJSON { + if rm, ok := value.(json.RawMessage); ok { + // If it's empty make sure we emit an empty value as the array style would below. + if len(rm) > 0 { + buf.Write(rm) + } else { + buf.WriteString("null") + } + return buf.String() + } + } + buf.WriteByte('[') + for i := 0; i < v.Len(); i++ { + if i > 0 { + buf.WriteByte(f.comma()) + } + e := v.Index(i) + buf.WriteString(f.prettyWithFlags(e.Interface(), 0, depth+1)) + } + buf.WriteByte(']') + return buf.String() + case reflect.Map: + buf.WriteByte('{') + // This does not sort the map keys, for best perf. + it := v.MapRange() + i := 0 + for it.Next() { + if i > 0 { + buf.WriteByte(f.comma()) + } + // If a map key supports TextMarshaler, use it. + keystr := "" + if m, ok := it.Key().Interface().(encoding.TextMarshaler); ok { + txt, err := m.MarshalText() + if err != nil { + keystr = fmt.Sprintf("", err.Error()) + } else { + keystr = string(txt) + } + keystr = prettyString(keystr) + } else { + // prettyWithFlags will produce already-escaped values + keystr = f.prettyWithFlags(it.Key().Interface(), 0, depth+1) + if t.Key().Kind() != reflect.String { + // JSON only does string keys. Unlike Go's standard JSON, we'll + // convert just about anything to a string. + keystr = prettyString(keystr) + } + } + buf.WriteString(keystr) + buf.WriteByte(f.colon()) + buf.WriteString(f.prettyWithFlags(it.Value().Interface(), 0, depth+1)) + i++ + } + buf.WriteByte('}') + return buf.String() + case reflect.Ptr, reflect.Interface: + if v.IsNil() { + return "null" + } + return f.prettyWithFlags(v.Elem().Interface(), 0, depth) + } + return fmt.Sprintf(`""`, t.Kind().String()) +} + +func prettyString(s string) string { + // Avoid escaping (which does allocations) if we can. + if needsEscape(s) { + return strconv.Quote(s) + } + b := bytes.NewBuffer(make([]byte, 0, 1024)) + b.WriteByte('"') + b.WriteString(s) + b.WriteByte('"') + return b.String() +} + +// needsEscape determines whether the input string needs to be escaped or not, +// without doing any allocations. +func needsEscape(s string) bool { + for _, r := range s { + if !strconv.IsPrint(r) || r == '\\' || r == '"' { + return true + } + } + return false +} + +func isEmpty(v reflect.Value) bool { + switch v.Kind() { + case reflect.Array, reflect.Map, reflect.Slice, reflect.String: + return v.Len() == 0 + case reflect.Bool: + return !v.Bool() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.Complex64, reflect.Complex128: + return v.Complex() == 0 + case reflect.Interface, reflect.Ptr: + return v.IsNil() + } + return false +} + +func invokeMarshaler(m logr.Marshaler) (ret any) { + defer func() { + if r := recover(); r != nil { + ret = fmt.Sprintf("", r) + } + }() + return m.MarshalLog() +} + +func invokeStringer(s fmt.Stringer) (ret string) { + defer func() { + if r := recover(); r != nil { + ret = fmt.Sprintf("", r) + } + }() + return s.String() +} + +func invokeError(e error) (ret string) { + defer func() { + if r := recover(); r != nil { + ret = fmt.Sprintf("", r) + } + }() + return e.Error() +} + +// Caller represents the original call site for a log line, after considering +// logr.Logger.WithCallDepth and logr.Logger.WithCallStackHelper. The File and +// Line fields will always be provided, while the Func field is optional. +// Users can set the render hook fields in Options to examine logged key-value +// pairs, one of which will be {"caller", Caller} if the Options.LogCaller +// field is enabled for the given MessageClass. +type Caller struct { + // File is the basename of the file for this call site. + File string `json:"file"` + // Line is the line number in the file for this call site. + Line int `json:"line"` + // Func is the function name for this call site, or empty if + // Options.LogCallerFunc is not enabled. + Func string `json:"function,omitempty"` +} + +func (f Formatter) caller() Caller { + // +1 for this frame, +1 for Info/Error. + pc, file, line, ok := runtime.Caller(f.depth + 2) + if !ok { + return Caller{"", 0, ""} + } + fn := "" + if f.opts.LogCallerFunc { + if fp := runtime.FuncForPC(pc); fp != nil { + fn = fp.Name() + } + } + + return Caller{filepath.Base(file), line, fn} +} + +const noValue = "" + +func (f Formatter) nonStringKey(v any) string { + return fmt.Sprintf("", f.snippet(v)) +} + +// snippet produces a short snippet string of an arbitrary value. +func (f Formatter) snippet(v any) string { + const snipLen = 16 + + snip := f.pretty(v) + if len(snip) > snipLen { + snip = snip[:snipLen] + } + return snip +} + +// sanitize ensures that a list of key-value pairs has a value for every key +// (adding a value if needed) and that each key is a string (substituting a key +// if needed). +func (f Formatter) sanitize(kvList []any) []any { + if len(kvList)%2 != 0 { + kvList = append(kvList, noValue) + } + for i := 0; i < len(kvList); i += 2 { + _, ok := kvList[i].(string) + if !ok { + kvList[i] = f.nonStringKey(kvList[i]) + } + } + return kvList +} + +// startGroup opens a new group scope (basically a sub-struct), which locks all +// the current saved values and starts them anew. This is needed to satisfy +// slog. +func (f *Formatter) startGroup(group string) { + // Unnamed groups are just inlined. + if group == "" { + return + } + + // Any saved values can no longer be changed. + buf := bytes.NewBuffer(make([]byte, 0, 1024)) + continuing := false + + if f.parentValuesStr != "" { + buf.WriteString(f.parentValuesStr) + continuing = true + } + + if f.group != "" && f.valuesStr != "" { + if continuing { + buf.WriteByte(f.comma()) + } + buf.WriteString(f.quoted(f.group, true)) // escape user-provided keys + buf.WriteByte(f.colon()) + buf.WriteByte('{') // for the group + continuing = false + } + + if f.valuesStr != "" { + if continuing { + buf.WriteByte(f.comma()) + } + buf.WriteString(f.valuesStr) + } + + // NOTE: We don't close the scope here - that's done later, when a log line + // is actually rendered (because we have N scopes to close). + + f.parentValuesStr = buf.String() + + // Start collecting new values. + f.group = group + f.groupDepth++ + f.valuesStr = "" + f.values = nil +} + +// Init configures this Formatter from runtime info, such as the call depth +// imposed by logr itself. +// Note that this receiver is a pointer, so depth can be saved. +func (f *Formatter) Init(info logr.RuntimeInfo) { + f.depth += info.CallDepth +} + +// Enabled checks whether an info message at the given level should be logged. +func (f Formatter) Enabled(level int) bool { + return level <= f.opts.Verbosity +} + +// GetDepth returns the current depth of this Formatter. This is useful for +// implementations which do their own caller attribution. +func (f Formatter) GetDepth() int { + return f.depth +} + +// FormatInfo renders an Info log message into strings. The prefix will be +// empty when no names were set (via AddNames), or when the output is +// configured for JSON. +func (f Formatter) FormatInfo(level int, msg string, kvList []any) (prefix, argsStr string) { + args := make([]any, 0, 64) // using a constant here impacts perf + prefix = f.prefix + if f.outputFormat == outputJSON { + args = append(args, "logger", prefix) + prefix = "" + } + if f.opts.LogTimestamp { + args = append(args, "ts", time.Now().Format(f.opts.TimestampFormat)) + } + if policy := f.opts.LogCaller; policy == All || policy == Info { + args = append(args, "caller", f.caller()) + } + if key := *f.opts.LogInfoLevel; key != "" { + args = append(args, key, level) + } + args = append(args, "msg", msg) + return prefix, f.render(args, kvList) +} + +// FormatError renders an Error log message into strings. The prefix will be +// empty when no names were set (via AddNames), or when the output is +// configured for JSON. +func (f Formatter) FormatError(err error, msg string, kvList []any) (prefix, argsStr string) { + args := make([]any, 0, 64) // using a constant here impacts perf + prefix = f.prefix + if f.outputFormat == outputJSON { + args = append(args, "logger", prefix) + prefix = "" + } + if f.opts.LogTimestamp { + args = append(args, "ts", time.Now().Format(f.opts.TimestampFormat)) + } + if policy := f.opts.LogCaller; policy == All || policy == Error { + args = append(args, "caller", f.caller()) + } + args = append(args, "msg", msg) + var loggableErr any + if err != nil { + loggableErr = err.Error() + } + args = append(args, "error", loggableErr) + return prefix, f.render(args, kvList) +} + +// AddName appends the specified name. funcr uses '/' characters to separate +// name elements. Callers should not pass '/' in the provided name string, but +// this library does not actually enforce that. +func (f *Formatter) AddName(name string) { + if len(f.prefix) > 0 { + f.prefix += "/" + } + f.prefix += name +} + +// AddValues adds key-value pairs to the set of saved values to be logged with +// each log line. +func (f *Formatter) AddValues(kvList []any) { + // Three slice args forces a copy. + n := len(f.values) + f.values = append(f.values[:n:n], kvList...) + + vals := f.values + if hook := f.opts.RenderValuesHook; hook != nil { + vals = hook(f.sanitize(vals)) + } + + // Pre-render values, so we don't have to do it on each Info/Error call. + buf := bytes.NewBuffer(make([]byte, 0, 1024)) + f.flatten(buf, vals, false, true) // escape user-provided keys + f.valuesStr = buf.String() +} + +// AddCallDepth increases the number of stack-frames to skip when attributing +// the log line to a file and line. +func (f *Formatter) AddCallDepth(depth int) { + f.depth += depth +} diff --git a/vendor/github.com/go-logr/logr/funcr/slogsink.go b/vendor/github.com/go-logr/logr/funcr/slogsink.go new file mode 100644 index 000000000..7bd84761e --- /dev/null +++ b/vendor/github.com/go-logr/logr/funcr/slogsink.go @@ -0,0 +1,105 @@ +//go:build go1.21 +// +build go1.21 + +/* +Copyright 2023 The logr Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package funcr + +import ( + "context" + "log/slog" + + "github.com/go-logr/logr" +) + +var _ logr.SlogSink = &fnlogger{} + +const extraSlogSinkDepth = 3 // 2 for slog, 1 for SlogSink + +func (l fnlogger) Handle(_ context.Context, record slog.Record) error { + kvList := make([]any, 0, 2*record.NumAttrs()) + record.Attrs(func(attr slog.Attr) bool { + kvList = attrToKVs(attr, kvList) + return true + }) + + if record.Level >= slog.LevelError { + l.WithCallDepth(extraSlogSinkDepth).Error(nil, record.Message, kvList...) + } else { + level := l.levelFromSlog(record.Level) + l.WithCallDepth(extraSlogSinkDepth).Info(level, record.Message, kvList...) + } + return nil +} + +func (l fnlogger) WithAttrs(attrs []slog.Attr) logr.SlogSink { + kvList := make([]any, 0, 2*len(attrs)) + for _, attr := range attrs { + kvList = attrToKVs(attr, kvList) + } + l.AddValues(kvList) + return &l +} + +func (l fnlogger) WithGroup(name string) logr.SlogSink { + l.startGroup(name) + return &l +} + +// attrToKVs appends a slog.Attr to a logr-style kvList. It handle slog Groups +// and other details of slog. +func attrToKVs(attr slog.Attr, kvList []any) []any { + attrVal := attr.Value.Resolve() + if attrVal.Kind() == slog.KindGroup { + groupVal := attrVal.Group() + grpKVs := make([]any, 0, 2*len(groupVal)) + for _, attr := range groupVal { + grpKVs = attrToKVs(attr, grpKVs) + } + if attr.Key == "" { + // slog says we have to inline these + kvList = append(kvList, grpKVs...) + } else { + kvList = append(kvList, attr.Key, PseudoStruct(grpKVs)) + } + } else if attr.Key != "" { + kvList = append(kvList, attr.Key, attrVal.Any()) + } + + return kvList +} + +// levelFromSlog adjusts the level by the logger's verbosity and negates it. +// It ensures that the result is >= 0. This is necessary because the result is +// passed to a LogSink and that API did not historically document whether +// levels could be negative or what that meant. +// +// Some example usage: +// +// logrV0 := getMyLogger() +// logrV2 := logrV0.V(2) +// slogV2 := slog.New(logr.ToSlogHandler(logrV2)) +// slogV2.Debug("msg") // =~ logrV2.V(4) =~ logrV0.V(6) +// slogV2.Info("msg") // =~ logrV2.V(0) =~ logrV0.V(2) +// slogv2.Warn("msg") // =~ logrV2.V(-4) =~ logrV0.V(0) +func (l fnlogger) levelFromSlog(level slog.Level) int { + result := -level + if result < 0 { + result = 0 // because LogSink doesn't expect negative V levels + } + return int(result) +} diff --git a/vendor/github.com/go-logr/logr/logr.go b/vendor/github.com/go-logr/logr/logr.go new file mode 100644 index 000000000..b4428e105 --- /dev/null +++ b/vendor/github.com/go-logr/logr/logr.go @@ -0,0 +1,520 @@ +/* +Copyright 2019 The logr Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This design derives from Dave Cheney's blog: +// http://dave.cheney.net/2015/11/05/lets-talk-about-logging + +// Package logr defines a general-purpose logging API and abstract interfaces +// to back that API. Packages in the Go ecosystem can depend on this package, +// while callers can implement logging with whatever backend is appropriate. +// +// # Usage +// +// Logging is done using a Logger instance. Logger is a concrete type with +// methods, which defers the actual logging to a LogSink interface. The main +// methods of Logger are Info() and Error(). Arguments to Info() and Error() +// are key/value pairs rather than printf-style formatted strings, emphasizing +// "structured logging". +// +// With Go's standard log package, we might write: +// +// log.Printf("setting target value %s", targetValue) +// +// With logr's structured logging, we'd write: +// +// logger.Info("setting target", "value", targetValue) +// +// Errors are much the same. Instead of: +// +// log.Printf("failed to open the pod bay door for user %s: %v", user, err) +// +// We'd write: +// +// logger.Error(err, "failed to open the pod bay door", "user", user) +// +// Info() and Error() are very similar, but they are separate methods so that +// LogSink implementations can choose to do things like attach additional +// information (such as stack traces) on calls to Error(). Error() messages are +// always logged, regardless of the current verbosity. If there is no error +// instance available, passing nil is valid. +// +// # Verbosity +// +// Often we want to log information only when the application in "verbose +// mode". To write log lines that are more verbose, Logger has a V() method. +// The higher the V-level of a log line, the less critical it is considered. +// Log-lines with V-levels that are not enabled (as per the LogSink) will not +// be written. Level V(0) is the default, and logger.V(0).Info() has the same +// meaning as logger.Info(). Negative V-levels have the same meaning as V(0). +// Error messages do not have a verbosity level and are always logged. +// +// Where we might have written: +// +// if flVerbose >= 2 { +// log.Printf("an unusual thing happened") +// } +// +// We can write: +// +// logger.V(2).Info("an unusual thing happened") +// +// # Logger Names +// +// Logger instances can have name strings so that all messages logged through +// that instance have additional context. For example, you might want to add +// a subsystem name: +// +// logger.WithName("compactor").Info("started", "time", time.Now()) +// +// The WithName() method returns a new Logger, which can be passed to +// constructors or other functions for further use. Repeated use of WithName() +// will accumulate name "segments". These name segments will be joined in some +// way by the LogSink implementation. It is strongly recommended that name +// segments contain simple identifiers (letters, digits, and hyphen), and do +// not contain characters that could muddle the log output or confuse the +// joining operation (e.g. whitespace, commas, periods, slashes, brackets, +// quotes, etc). +// +// # Saved Values +// +// Logger instances can store any number of key/value pairs, which will be +// logged alongside all messages logged through that instance. For example, +// you might want to create a Logger instance per managed object: +// +// With the standard log package, we might write: +// +// log.Printf("decided to set field foo to value %q for object %s/%s", +// targetValue, object.Namespace, object.Name) +// +// With logr we'd write: +// +// // Elsewhere: set up the logger to log the object name. +// obj.logger = mainLogger.WithValues( +// "name", obj.name, "namespace", obj.namespace) +// +// // later on... +// obj.logger.Info("setting foo", "value", targetValue) +// +// # Best Practices +// +// Logger has very few hard rules, with the goal that LogSink implementations +// might have a lot of freedom to differentiate. There are, however, some +// things to consider. +// +// The log message consists of a constant message attached to the log line. +// This should generally be a simple description of what's occurring, and should +// never be a format string. Variable information can then be attached using +// named values. +// +// Keys are arbitrary strings, but should generally be constant values. Values +// may be any Go value, but how the value is formatted is determined by the +// LogSink implementation. +// +// Logger instances are meant to be passed around by value. Code that receives +// such a value can call its methods without having to check whether the +// instance is ready for use. +// +// The zero logger (= Logger{}) is identical to Discard() and discards all log +// entries. Code that receives a Logger by value can simply call it, the methods +// will never crash. For cases where passing a logger is optional, a pointer to Logger +// should be used. +// +// # Key Naming Conventions +// +// Keys are not strictly required to conform to any specification or regex, but +// it is recommended that they: +// - be human-readable and meaningful (not auto-generated or simple ordinals) +// - be constant (not dependent on input data) +// - contain only printable characters +// - not contain whitespace or punctuation +// - use lower case for simple keys and lowerCamelCase for more complex ones +// +// These guidelines help ensure that log data is processed properly regardless +// of the log implementation. For example, log implementations will try to +// output JSON data or will store data for later database (e.g. SQL) queries. +// +// While users are generally free to use key names of their choice, it's +// generally best to avoid using the following keys, as they're frequently used +// by implementations: +// - "caller": the calling information (file/line) of a particular log line +// - "error": the underlying error value in the `Error` method +// - "level": the log level +// - "logger": the name of the associated logger +// - "msg": the log message +// - "stacktrace": the stack trace associated with a particular log line or +// error (often from the `Error` message) +// - "ts": the timestamp for a log line +// +// Implementations are encouraged to make use of these keys to represent the +// above concepts, when necessary (for example, in a pure-JSON output form, it +// would be necessary to represent at least message and timestamp as ordinary +// named values). +// +// # Break Glass +// +// Implementations may choose to give callers access to the underlying +// logging implementation. The recommended pattern for this is: +// +// // Underlier exposes access to the underlying logging implementation. +// // Since callers only have a logr.Logger, they have to know which +// // implementation is in use, so this interface is less of an abstraction +// // and more of way to test type conversion. +// type Underlier interface { +// GetUnderlying() +// } +// +// Logger grants access to the sink to enable type assertions like this: +// +// func DoSomethingWithImpl(log logr.Logger) { +// if underlier, ok := log.GetSink().(impl.Underlier); ok { +// implLogger := underlier.GetUnderlying() +// ... +// } +// } +// +// Custom `With*` functions can be implemented by copying the complete +// Logger struct and replacing the sink in the copy: +// +// // WithFooBar changes the foobar parameter in the log sink and returns a +// // new logger with that modified sink. It does nothing for loggers where +// // the sink doesn't support that parameter. +// func WithFoobar(log logr.Logger, foobar int) logr.Logger { +// if foobarLogSink, ok := log.GetSink().(FoobarSink); ok { +// log = log.WithSink(foobarLogSink.WithFooBar(foobar)) +// } +// return log +// } +// +// Don't use New to construct a new Logger with a LogSink retrieved from an +// existing Logger. Source code attribution might not work correctly and +// unexported fields in Logger get lost. +// +// Beware that the same LogSink instance may be shared by different logger +// instances. Calling functions that modify the LogSink will affect all of +// those. +package logr + +// New returns a new Logger instance. This is primarily used by libraries +// implementing LogSink, rather than end users. Passing a nil sink will create +// a Logger which discards all log lines. +func New(sink LogSink) Logger { + logger := Logger{} + logger.setSink(sink) + if sink != nil { + sink.Init(runtimeInfo) + } + return logger +} + +// setSink stores the sink and updates any related fields. It mutates the +// logger and thus is only safe to use for loggers that are not currently being +// used concurrently. +func (l *Logger) setSink(sink LogSink) { + l.sink = sink +} + +// GetSink returns the stored sink. +func (l Logger) GetSink() LogSink { + return l.sink +} + +// WithSink returns a copy of the logger with the new sink. +func (l Logger) WithSink(sink LogSink) Logger { + l.setSink(sink) + return l +} + +// Logger is an interface to an abstract logging implementation. This is a +// concrete type for performance reasons, but all the real work is passed on to +// a LogSink. Implementations of LogSink should provide their own constructors +// that return Logger, not LogSink. +// +// The underlying sink can be accessed through GetSink and be modified through +// WithSink. This enables the implementation of custom extensions (see "Break +// Glass" in the package documentation). Normally the sink should be used only +// indirectly. +type Logger struct { + sink LogSink + level int +} + +// Enabled tests whether this Logger is enabled. For example, commandline +// flags might be used to set the logging verbosity and disable some info logs. +func (l Logger) Enabled() bool { + // Some implementations of LogSink look at the caller in Enabled (e.g. + // different verbosity levels per package or file), but we only pass one + // CallDepth in (via Init). This means that all calls from Logger to the + // LogSink's Enabled, Info, and Error methods must have the same number of + // frames. In other words, Logger methods can't call other Logger methods + // which call these LogSink methods unless we do it the same in all paths. + return l.sink != nil && l.sink.Enabled(l.level) +} + +// Info logs a non-error message with the given key/value pairs as context. +// +// The msg argument should be used to add some constant description to the log +// line. The key/value pairs can then be used to add additional variable +// information. The key/value pairs must alternate string keys and arbitrary +// values. +func (l Logger) Info(msg string, keysAndValues ...any) { + if l.sink == nil { + return + } + if l.sink.Enabled(l.level) { // see comment in Enabled + if withHelper, ok := l.sink.(CallStackHelperLogSink); ok { + withHelper.GetCallStackHelper()() + } + l.sink.Info(l.level, msg, keysAndValues...) + } +} + +// Error logs an error, with the given message and key/value pairs as context. +// It functions similarly to Info, but may have unique behavior, and should be +// preferred for logging errors (see the package documentations for more +// information). The log message will always be emitted, regardless of +// verbosity level. +// +// The msg argument should be used to add context to any underlying error, +// while the err argument should be used to attach the actual error that +// triggered this log line, if present. The err parameter is optional +// and nil may be passed instead of an error instance. +func (l Logger) Error(err error, msg string, keysAndValues ...any) { + if l.sink == nil { + return + } + if withHelper, ok := l.sink.(CallStackHelperLogSink); ok { + withHelper.GetCallStackHelper()() + } + l.sink.Error(err, msg, keysAndValues...) +} + +// V returns a new Logger instance for a specific verbosity level, relative to +// this Logger. In other words, V-levels are additive. A higher verbosity +// level means a log message is less important. Negative V-levels are treated +// as 0. +func (l Logger) V(level int) Logger { + if l.sink == nil { + return l + } + if level < 0 { + level = 0 + } + l.level += level + return l +} + +// GetV returns the verbosity level of the logger. If the logger's LogSink is +// nil as in the Discard logger, this will always return 0. +func (l Logger) GetV() int { + // 0 if l.sink nil because of the if check in V above. + return l.level +} + +// WithValues returns a new Logger instance with additional key/value pairs. +// See Info for documentation on how key/value pairs work. +func (l Logger) WithValues(keysAndValues ...any) Logger { + if l.sink == nil { + return l + } + l.setSink(l.sink.WithValues(keysAndValues...)) + return l +} + +// WithName returns a new Logger instance with the specified name element added +// to the Logger's name. Successive calls with WithName append additional +// suffixes to the Logger's name. It's strongly recommended that name segments +// contain only letters, digits, and hyphens (see the package documentation for +// more information). +func (l Logger) WithName(name string) Logger { + if l.sink == nil { + return l + } + l.setSink(l.sink.WithName(name)) + return l +} + +// WithCallDepth returns a Logger instance that offsets the call stack by the +// specified number of frames when logging call site information, if possible. +// This is useful for users who have helper functions between the "real" call +// site and the actual calls to Logger methods. If depth is 0 the attribution +// should be to the direct caller of this function. If depth is 1 the +// attribution should skip 1 call frame, and so on. Successive calls to this +// are additive. +// +// If the underlying log implementation supports a WithCallDepth(int) method, +// it will be called and the result returned. If the implementation does not +// support CallDepthLogSink, the original Logger will be returned. +// +// To skip one level, WithCallStackHelper() should be used instead of +// WithCallDepth(1) because it works with implementions that support the +// CallDepthLogSink and/or CallStackHelperLogSink interfaces. +func (l Logger) WithCallDepth(depth int) Logger { + if l.sink == nil { + return l + } + if withCallDepth, ok := l.sink.(CallDepthLogSink); ok { + l.setSink(withCallDepth.WithCallDepth(depth)) + } + return l +} + +// WithCallStackHelper returns a new Logger instance that skips the direct +// caller when logging call site information, if possible. This is useful for +// users who have helper functions between the "real" call site and the actual +// calls to Logger methods and want to support loggers which depend on marking +// each individual helper function, like loggers based on testing.T. +// +// In addition to using that new logger instance, callers also must call the +// returned function. +// +// If the underlying log implementation supports a WithCallDepth(int) method, +// WithCallDepth(1) will be called to produce a new logger. If it supports a +// WithCallStackHelper() method, that will be also called. If the +// implementation does not support either of these, the original Logger will be +// returned. +func (l Logger) WithCallStackHelper() (func(), Logger) { + if l.sink == nil { + return func() {}, l + } + var helper func() + if withCallDepth, ok := l.sink.(CallDepthLogSink); ok { + l.setSink(withCallDepth.WithCallDepth(1)) + } + if withHelper, ok := l.sink.(CallStackHelperLogSink); ok { + helper = withHelper.GetCallStackHelper() + } else { + helper = func() {} + } + return helper, l +} + +// IsZero returns true if this logger is an uninitialized zero value +func (l Logger) IsZero() bool { + return l.sink == nil +} + +// RuntimeInfo holds information that the logr "core" library knows which +// LogSinks might want to know. +type RuntimeInfo struct { + // CallDepth is the number of call frames the logr library adds between the + // end-user and the LogSink. LogSink implementations which choose to print + // the original logging site (e.g. file & line) should climb this many + // additional frames to find it. + CallDepth int +} + +// runtimeInfo is a static global. It must not be changed at run time. +var runtimeInfo = RuntimeInfo{ + CallDepth: 1, +} + +// LogSink represents a logging implementation. End-users will generally not +// interact with this type. +type LogSink interface { + // Init receives optional information about the logr library for LogSink + // implementations that need it. + Init(info RuntimeInfo) + + // Enabled tests whether this LogSink is enabled at the specified V-level. + // For example, commandline flags might be used to set the logging + // verbosity and disable some info logs. + Enabled(level int) bool + + // Info logs a non-error message with the given key/value pairs as context. + // The level argument is provided for optional logging. This method will + // only be called when Enabled(level) is true. See Logger.Info for more + // details. + Info(level int, msg string, keysAndValues ...any) + + // Error logs an error, with the given message and key/value pairs as + // context. See Logger.Error for more details. + Error(err error, msg string, keysAndValues ...any) + + // WithValues returns a new LogSink with additional key/value pairs. See + // Logger.WithValues for more details. + WithValues(keysAndValues ...any) LogSink + + // WithName returns a new LogSink with the specified name appended. See + // Logger.WithName for more details. + WithName(name string) LogSink +} + +// CallDepthLogSink represents a LogSink that knows how to climb the call stack +// to identify the original call site and can offset the depth by a specified +// number of frames. This is useful for users who have helper functions +// between the "real" call site and the actual calls to Logger methods. +// Implementations that log information about the call site (such as file, +// function, or line) would otherwise log information about the intermediate +// helper functions. +// +// This is an optional interface and implementations are not required to +// support it. +type CallDepthLogSink interface { + // WithCallDepth returns a LogSink that will offset the call + // stack by the specified number of frames when logging call + // site information. + // + // If depth is 0, the LogSink should skip exactly the number + // of call frames defined in RuntimeInfo.CallDepth when Info + // or Error are called, i.e. the attribution should be to the + // direct caller of Logger.Info or Logger.Error. + // + // If depth is 1 the attribution should skip 1 call frame, and so on. + // Successive calls to this are additive. + WithCallDepth(depth int) LogSink +} + +// CallStackHelperLogSink represents a LogSink that knows how to climb +// the call stack to identify the original call site and can skip +// intermediate helper functions if they mark themselves as +// helper. Go's testing package uses that approach. +// +// This is useful for users who have helper functions between the +// "real" call site and the actual calls to Logger methods. +// Implementations that log information about the call site (such as +// file, function, or line) would otherwise log information about the +// intermediate helper functions. +// +// This is an optional interface and implementations are not required +// to support it. Implementations that choose to support this must not +// simply implement it as WithCallDepth(1), because +// Logger.WithCallStackHelper will call both methods if they are +// present. This should only be implemented for LogSinks that actually +// need it, as with testing.T. +type CallStackHelperLogSink interface { + // GetCallStackHelper returns a function that must be called + // to mark the direct caller as helper function when logging + // call site information. + GetCallStackHelper() func() +} + +// Marshaler is an optional interface that logged values may choose to +// implement. Loggers with structured output, such as JSON, should +// log the object return by the MarshalLog method instead of the +// original value. +type Marshaler interface { + // MarshalLog can be used to: + // - ensure that structs are not logged as strings when the original + // value has a String method: return a different type without a + // String method + // - select which fields of a complex type should get logged: + // return a simpler struct with fewer fields + // - log unexported fields: return a different struct + // with exported fields + // + // It may return any value of any type. + MarshalLog() any +} diff --git a/vendor/github.com/go-logr/logr/sloghandler.go b/vendor/github.com/go-logr/logr/sloghandler.go new file mode 100644 index 000000000..82d1ba494 --- /dev/null +++ b/vendor/github.com/go-logr/logr/sloghandler.go @@ -0,0 +1,192 @@ +//go:build go1.21 +// +build go1.21 + +/* +Copyright 2023 The logr Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package logr + +import ( + "context" + "log/slog" +) + +type slogHandler struct { + // May be nil, in which case all logs get discarded. + sink LogSink + // Non-nil if sink is non-nil and implements SlogSink. + slogSink SlogSink + + // groupPrefix collects values from WithGroup calls. It gets added as + // prefix to value keys when handling a log record. + groupPrefix string + + // levelBias can be set when constructing the handler to influence the + // slog.Level of log records. A positive levelBias reduces the + // slog.Level value. slog has no API to influence this value after the + // handler got created, so it can only be set indirectly through + // Logger.V. + levelBias slog.Level +} + +var _ slog.Handler = &slogHandler{} + +// groupSeparator is used to concatenate WithGroup names and attribute keys. +const groupSeparator = "." + +// GetLevel is used for black box unit testing. +func (l *slogHandler) GetLevel() slog.Level { + return l.levelBias +} + +func (l *slogHandler) Enabled(_ context.Context, level slog.Level) bool { + return l.sink != nil && (level >= slog.LevelError || l.sink.Enabled(l.levelFromSlog(level))) +} + +func (l *slogHandler) Handle(ctx context.Context, record slog.Record) error { + if l.slogSink != nil { + // Only adjust verbosity level of log entries < slog.LevelError. + if record.Level < slog.LevelError { + record.Level -= l.levelBias + } + return l.slogSink.Handle(ctx, record) + } + + // No need to check for nil sink here because Handle will only be called + // when Enabled returned true. + + kvList := make([]any, 0, 2*record.NumAttrs()) + record.Attrs(func(attr slog.Attr) bool { + kvList = attrToKVs(attr, l.groupPrefix, kvList) + return true + }) + if record.Level >= slog.LevelError { + l.sinkWithCallDepth().Error(nil, record.Message, kvList...) + } else { + level := l.levelFromSlog(record.Level) + l.sinkWithCallDepth().Info(level, record.Message, kvList...) + } + return nil +} + +// sinkWithCallDepth adjusts the stack unwinding so that when Error or Info +// are called by Handle, code in slog gets skipped. +// +// This offset currently (Go 1.21.0) works for calls through +// slog.New(ToSlogHandler(...)). There's no guarantee that the call +// chain won't change. Wrapping the handler will also break unwinding. It's +// still better than not adjusting at all.... +// +// This cannot be done when constructing the handler because FromSlogHandler needs +// access to the original sink without this adjustment. A second copy would +// work, but then WithAttrs would have to be called for both of them. +func (l *slogHandler) sinkWithCallDepth() LogSink { + if sink, ok := l.sink.(CallDepthLogSink); ok { + return sink.WithCallDepth(2) + } + return l.sink +} + +func (l *slogHandler) WithAttrs(attrs []slog.Attr) slog.Handler { + if l.sink == nil || len(attrs) == 0 { + return l + } + + clone := *l + if l.slogSink != nil { + clone.slogSink = l.slogSink.WithAttrs(attrs) + clone.sink = clone.slogSink + } else { + kvList := make([]any, 0, 2*len(attrs)) + for _, attr := range attrs { + kvList = attrToKVs(attr, l.groupPrefix, kvList) + } + clone.sink = l.sink.WithValues(kvList...) + } + return &clone +} + +func (l *slogHandler) WithGroup(name string) slog.Handler { + if l.sink == nil { + return l + } + if name == "" { + // slog says to inline empty groups + return l + } + clone := *l + if l.slogSink != nil { + clone.slogSink = l.slogSink.WithGroup(name) + clone.sink = clone.slogSink + } else { + clone.groupPrefix = addPrefix(clone.groupPrefix, name) + } + return &clone +} + +// attrToKVs appends a slog.Attr to a logr-style kvList. It handle slog Groups +// and other details of slog. +func attrToKVs(attr slog.Attr, groupPrefix string, kvList []any) []any { + attrVal := attr.Value.Resolve() + if attrVal.Kind() == slog.KindGroup { + groupVal := attrVal.Group() + grpKVs := make([]any, 0, 2*len(groupVal)) + prefix := groupPrefix + if attr.Key != "" { + prefix = addPrefix(groupPrefix, attr.Key) + } + for _, attr := range groupVal { + grpKVs = attrToKVs(attr, prefix, grpKVs) + } + kvList = append(kvList, grpKVs...) + } else if attr.Key != "" { + kvList = append(kvList, addPrefix(groupPrefix, attr.Key), attrVal.Any()) + } + + return kvList +} + +func addPrefix(prefix, name string) string { + if prefix == "" { + return name + } + if name == "" { + return prefix + } + return prefix + groupSeparator + name +} + +// levelFromSlog adjusts the level by the logger's verbosity and negates it. +// It ensures that the result is >= 0. This is necessary because the result is +// passed to a LogSink and that API did not historically document whether +// levels could be negative or what that meant. +// +// Some example usage: +// +// logrV0 := getMyLogger() +// logrV2 := logrV0.V(2) +// slogV2 := slog.New(logr.ToSlogHandler(logrV2)) +// slogV2.Debug("msg") // =~ logrV2.V(4) =~ logrV0.V(6) +// slogV2.Info("msg") // =~ logrV2.V(0) =~ logrV0.V(2) +// slogv2.Warn("msg") // =~ logrV2.V(-4) =~ logrV0.V(0) +func (l *slogHandler) levelFromSlog(level slog.Level) int { + result := -level + result += l.levelBias // in case the original Logger had a V level + if result < 0 { + result = 0 // because LogSink doesn't expect negative V levels + } + return int(result) +} diff --git a/vendor/github.com/go-logr/logr/slogr.go b/vendor/github.com/go-logr/logr/slogr.go new file mode 100644 index 000000000..28a83d024 --- /dev/null +++ b/vendor/github.com/go-logr/logr/slogr.go @@ -0,0 +1,100 @@ +//go:build go1.21 +// +build go1.21 + +/* +Copyright 2023 The logr Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package logr + +import ( + "context" + "log/slog" +) + +// FromSlogHandler returns a Logger which writes to the slog.Handler. +// +// The logr verbosity level is mapped to slog levels such that V(0) becomes +// slog.LevelInfo and V(4) becomes slog.LevelDebug. +func FromSlogHandler(handler slog.Handler) Logger { + if handler, ok := handler.(*slogHandler); ok { + if handler.sink == nil { + return Discard() + } + return New(handler.sink).V(int(handler.levelBias)) + } + return New(&slogSink{handler: handler}) +} + +// ToSlogHandler returns a slog.Handler which writes to the same sink as the Logger. +// +// The returned logger writes all records with level >= slog.LevelError as +// error log entries with LogSink.Error, regardless of the verbosity level of +// the Logger: +// +// logger := +// slog.New(ToSlogHandler(logger.V(10))).Error(...) -> logSink.Error(...) +// +// The level of all other records gets reduced by the verbosity +// level of the Logger and the result is negated. If it happens +// to be negative, then it gets replaced by zero because a LogSink +// is not expected to handled negative levels: +// +// slog.New(ToSlogHandler(logger)).Debug(...) -> logger.GetSink().Info(level=4, ...) +// slog.New(ToSlogHandler(logger)).Warning(...) -> logger.GetSink().Info(level=0, ...) +// slog.New(ToSlogHandler(logger)).Info(...) -> logger.GetSink().Info(level=0, ...) +// slog.New(ToSlogHandler(logger.V(4))).Info(...) -> logger.GetSink().Info(level=4, ...) +func ToSlogHandler(logger Logger) slog.Handler { + if sink, ok := logger.GetSink().(*slogSink); ok && logger.GetV() == 0 { + return sink.handler + } + + handler := &slogHandler{sink: logger.GetSink(), levelBias: slog.Level(logger.GetV())} + if slogSink, ok := handler.sink.(SlogSink); ok { + handler.slogSink = slogSink + } + return handler +} + +// SlogSink is an optional interface that a LogSink can implement to support +// logging through the slog.Logger or slog.Handler APIs better. It then should +// also support special slog values like slog.Group. When used as a +// slog.Handler, the advantages are: +// +// - stack unwinding gets avoided in favor of logging the pre-recorded PC, +// as intended by slog +// - proper grouping of key/value pairs via WithGroup +// - verbosity levels > slog.LevelInfo can be recorded +// - less overhead +// +// Both APIs (Logger and slog.Logger/Handler) then are supported equally +// well. Developers can pick whatever API suits them better and/or mix +// packages which use either API in the same binary with a common logging +// implementation. +// +// This interface is necessary because the type implementing the LogSink +// interface cannot also implement the slog.Handler interface due to the +// different prototype of the common Enabled method. +// +// An implementation could support both interfaces in two different types, but then +// additional interfaces would be needed to convert between those types in FromSlogHandler +// and ToSlogHandler. +type SlogSink interface { + LogSink + + Handle(ctx context.Context, record slog.Record) error + WithAttrs(attrs []slog.Attr) SlogSink + WithGroup(name string) SlogSink +} diff --git a/vendor/github.com/go-logr/logr/slogsink.go b/vendor/github.com/go-logr/logr/slogsink.go new file mode 100644 index 000000000..4060fcbc2 --- /dev/null +++ b/vendor/github.com/go-logr/logr/slogsink.go @@ -0,0 +1,120 @@ +//go:build go1.21 +// +build go1.21 + +/* +Copyright 2023 The logr Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package logr + +import ( + "context" + "log/slog" + "runtime" + "time" +) + +var ( + _ LogSink = &slogSink{} + _ CallDepthLogSink = &slogSink{} + _ Underlier = &slogSink{} +) + +// Underlier is implemented by the LogSink returned by NewFromLogHandler. +type Underlier interface { + // GetUnderlying returns the Handler used by the LogSink. + GetUnderlying() slog.Handler +} + +const ( + // nameKey is used to log the `WithName` values as an additional attribute. + nameKey = "logger" + + // errKey is used to log the error parameter of Error as an additional attribute. + errKey = "err" +) + +type slogSink struct { + callDepth int + name string + handler slog.Handler +} + +func (l *slogSink) Init(info RuntimeInfo) { + l.callDepth = info.CallDepth +} + +func (l *slogSink) GetUnderlying() slog.Handler { + return l.handler +} + +func (l *slogSink) WithCallDepth(depth int) LogSink { + newLogger := *l + newLogger.callDepth += depth + return &newLogger +} + +func (l *slogSink) Enabled(level int) bool { + return l.handler.Enabled(context.Background(), slog.Level(-level)) +} + +func (l *slogSink) Info(level int, msg string, kvList ...interface{}) { + l.log(nil, msg, slog.Level(-level), kvList...) +} + +func (l *slogSink) Error(err error, msg string, kvList ...interface{}) { + l.log(err, msg, slog.LevelError, kvList...) +} + +func (l *slogSink) log(err error, msg string, level slog.Level, kvList ...interface{}) { + var pcs [1]uintptr + // skip runtime.Callers, this function, Info/Error, and all helper functions above that. + runtime.Callers(3+l.callDepth, pcs[:]) + + record := slog.NewRecord(time.Now(), level, msg, pcs[0]) + if l.name != "" { + record.AddAttrs(slog.String(nameKey, l.name)) + } + if err != nil { + record.AddAttrs(slog.Any(errKey, err)) + } + record.Add(kvList...) + _ = l.handler.Handle(context.Background(), record) +} + +func (l slogSink) WithName(name string) LogSink { + if l.name != "" { + l.name += "/" + } + l.name += name + return &l +} + +func (l slogSink) WithValues(kvList ...interface{}) LogSink { + l.handler = l.handler.WithAttrs(kvListToAttrs(kvList...)) + return &l +} + +func kvListToAttrs(kvList ...interface{}) []slog.Attr { + // We don't need the record itself, only its Add method. + record := slog.NewRecord(time.Time{}, 0, "", 0) + record.Add(kvList...) + attrs := make([]slog.Attr, 0, record.NumAttrs()) + record.Attrs(func(attr slog.Attr) bool { + attrs = append(attrs, attr) + return true + }) + return attrs +} diff --git a/vendor/github.com/go-logr/stdr/LICENSE b/vendor/github.com/go-logr/stdr/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/vendor/github.com/go-logr/stdr/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/go-logr/stdr/README.md b/vendor/github.com/go-logr/stdr/README.md new file mode 100644 index 000000000..515866789 --- /dev/null +++ b/vendor/github.com/go-logr/stdr/README.md @@ -0,0 +1,6 @@ +# Minimal Go logging using logr and Go's standard library + +[![Go Reference](https://pkg.go.dev/badge/github.com/go-logr/stdr.svg)](https://pkg.go.dev/github.com/go-logr/stdr) + +This package implements the [logr interface](https://github.com/go-logr/logr) +in terms of Go's standard log package(https://pkg.go.dev/log). diff --git a/vendor/github.com/go-logr/stdr/stdr.go b/vendor/github.com/go-logr/stdr/stdr.go new file mode 100644 index 000000000..93a8aab51 --- /dev/null +++ b/vendor/github.com/go-logr/stdr/stdr.go @@ -0,0 +1,170 @@ +/* +Copyright 2019 The logr Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package stdr implements github.com/go-logr/logr.Logger in terms of +// Go's standard log package. +package stdr + +import ( + "log" + "os" + + "github.com/go-logr/logr" + "github.com/go-logr/logr/funcr" +) + +// The global verbosity level. See SetVerbosity(). +var globalVerbosity int + +// SetVerbosity sets the global level against which all info logs will be +// compared. If this is greater than or equal to the "V" of the logger, the +// message will be logged. A higher value here means more logs will be written. +// The previous verbosity value is returned. This is not concurrent-safe - +// callers must be sure to call it from only one goroutine. +func SetVerbosity(v int) int { + old := globalVerbosity + globalVerbosity = v + return old +} + +// New returns a logr.Logger which is implemented by Go's standard log package, +// or something like it. If std is nil, this will use a default logger +// instead. +// +// Example: stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile))) +func New(std StdLogger) logr.Logger { + return NewWithOptions(std, Options{}) +} + +// NewWithOptions returns a logr.Logger which is implemented by Go's standard +// log package, or something like it. See New for details. +func NewWithOptions(std StdLogger, opts Options) logr.Logger { + if std == nil { + // Go's log.Default() is only available in 1.16 and higher. + std = log.New(os.Stderr, "", log.LstdFlags) + } + + if opts.Depth < 0 { + opts.Depth = 0 + } + + fopts := funcr.Options{ + LogCaller: funcr.MessageClass(opts.LogCaller), + } + + sl := &logger{ + Formatter: funcr.NewFormatter(fopts), + std: std, + } + + // For skipping our own logger.Info/Error. + sl.Formatter.AddCallDepth(1 + opts.Depth) + + return logr.New(sl) +} + +// Options carries parameters which influence the way logs are generated. +type Options struct { + // Depth biases the assumed number of call frames to the "true" caller. + // This is useful when the calling code calls a function which then calls + // stdr (e.g. a logging shim to another API). Values less than zero will + // be treated as zero. + Depth int + + // LogCaller tells stdr to add a "caller" key to some or all log lines. + // Go's log package has options to log this natively, too. + LogCaller MessageClass + + // TODO: add an option to log the date/time +} + +// MessageClass indicates which category or categories of messages to consider. +type MessageClass int + +const ( + // None ignores all message classes. + None MessageClass = iota + // All considers all message classes. + All + // Info only considers info messages. + Info + // Error only considers error messages. + Error +) + +// StdLogger is the subset of the Go stdlib log.Logger API that is needed for +// this adapter. +type StdLogger interface { + // Output is the same as log.Output and log.Logger.Output. + Output(calldepth int, logline string) error +} + +type logger struct { + funcr.Formatter + std StdLogger +} + +var _ logr.LogSink = &logger{} +var _ logr.CallDepthLogSink = &logger{} + +func (l logger) Enabled(level int) bool { + return globalVerbosity >= level +} + +func (l logger) Info(level int, msg string, kvList ...interface{}) { + prefix, args := l.FormatInfo(level, msg, kvList) + if prefix != "" { + args = prefix + ": " + args + } + _ = l.std.Output(l.Formatter.GetDepth()+1, args) +} + +func (l logger) Error(err error, msg string, kvList ...interface{}) { + prefix, args := l.FormatError(err, msg, kvList) + if prefix != "" { + args = prefix + ": " + args + } + _ = l.std.Output(l.Formatter.GetDepth()+1, args) +} + +func (l logger) WithName(name string) logr.LogSink { + l.Formatter.AddName(name) + return &l +} + +func (l logger) WithValues(kvList ...interface{}) logr.LogSink { + l.Formatter.AddValues(kvList) + return &l +} + +func (l logger) WithCallDepth(depth int) logr.LogSink { + l.Formatter.AddCallDepth(depth) + return &l +} + +// Underlier exposes access to the underlying logging implementation. Since +// callers only have a logr.Logger, they have to know which implementation is +// in use, so this interface is less of an abstraction and more of way to test +// type conversion. +type Underlier interface { + GetUnderlying() StdLogger +} + +// GetUnderlying returns the StdLogger underneath this logger. Since StdLogger +// is itself an interface, the result may or may not be a Go log.Logger. +func (l logger) GetUnderlying() StdLogger { + return l.std +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/.gitignore b/vendor/github.com/golang-jwt/jwt/v5/.gitignore new file mode 100644 index 000000000..09573e016 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/.gitignore @@ -0,0 +1,4 @@ +.DS_Store +bin +.idea/ + diff --git a/vendor/github.com/golang-jwt/jwt/v5/LICENSE b/vendor/github.com/golang-jwt/jwt/v5/LICENSE new file mode 100644 index 000000000..35dbc2520 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/LICENSE @@ -0,0 +1,9 @@ +Copyright (c) 2012 Dave Grijalva +Copyright (c) 2021 golang-jwt maintainers + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/vendor/github.com/golang-jwt/jwt/v5/MIGRATION_GUIDE.md b/vendor/github.com/golang-jwt/jwt/v5/MIGRATION_GUIDE.md new file mode 100644 index 000000000..ff9c57e1d --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/MIGRATION_GUIDE.md @@ -0,0 +1,195 @@ +# Migration Guide (v5.0.0) + +Version `v5` contains a major rework of core functionalities in the `jwt-go` +library. This includes support for several validation options as well as a +re-design of the `Claims` interface. Lastly, we reworked how errors work under +the hood, which should provide a better overall developer experience. + +Starting from [v5.0.0](https://github.com/golang-jwt/jwt/releases/tag/v5.0.0), +the import path will be: + + "github.com/golang-jwt/jwt/v5" + +For most users, changing the import path *should* suffice. However, since we +intentionally changed and cleaned some of the public API, existing programs +might need to be updated. The following sections describe significant changes +and corresponding updates for existing programs. + +## Parsing and Validation Options + +Under the hood, a new `Validator` struct takes care of validating the claims. A +long awaited feature has been the option to fine-tune the validation of tokens. +This is now possible with several `ParserOption` functions that can be appended +to most `Parse` functions, such as `ParseWithClaims`. The most important options +and changes are: + * Added `WithLeeway` to support specifying the leeway that is allowed when + validating time-based claims, such as `exp` or `nbf`. + * Changed default behavior to not check the `iat` claim. Usage of this claim + is OPTIONAL according to the JWT RFC. The claim itself is also purely + informational according to the RFC, so a strict validation failure is not + recommended. If you want to check for sensible values in these claims, + please use the `WithIssuedAt` parser option. + * Added `WithAudience`, `WithSubject` and `WithIssuer` to support checking for + expected `aud`, `sub` and `iss`. + * Added `WithStrictDecoding` and `WithPaddingAllowed` options to allow + previously global settings to enable base64 strict encoding and the parsing + of base64 strings with padding. The latter is strictly speaking against the + standard, but unfortunately some of the major identity providers issue some + of these incorrect tokens. Both options are disabled by default. + +## Changes to the `Claims` interface + +### Complete Restructuring + +Previously, the claims interface was satisfied with an implementation of a +`Valid() error` function. This had several issues: + * The different claim types (struct claims, map claims, etc.) then contained + similar (but not 100 % identical) code of how this validation was done. This + lead to a lot of (almost) duplicate code and was hard to maintain + * It was not really semantically close to what a "claim" (or a set of claims) + really is; which is a list of defined key/value pairs with a certain + semantic meaning. + +Since all the validation functionality is now extracted into the validator, all +`VerifyXXX` and `Valid` functions have been removed from the `Claims` interface. +Instead, the interface now represents a list of getters to retrieve values with +a specific meaning. This allows us to completely decouple the validation logic +with the underlying storage representation of the claim, which could be a +struct, a map or even something stored in a database. + +```go +type Claims interface { + GetExpirationTime() (*NumericDate, error) + GetIssuedAt() (*NumericDate, error) + GetNotBefore() (*NumericDate, error) + GetIssuer() (string, error) + GetSubject() (string, error) + GetAudience() (ClaimStrings, error) +} +``` + +Users that previously directly called the `Valid` function on their claims, +e.g., to perform validation independently of parsing/verifying a token, can now +use the `jwt.NewValidator` function to create a `Validator` independently of the +`Parser`. + +```go +var v = jwt.NewValidator(jwt.WithLeeway(5*time.Second)) +v.Validate(myClaims) +``` + +### Supported Claim Types and Removal of `StandardClaims` + +The two standard claim types supported by this library, `MapClaims` and +`RegisteredClaims` both implement the necessary functions of this interface. The +old `StandardClaims` struct, which has already been deprecated in `v4` is now +removed. + +Users using custom claims, in most cases, will not experience any changes in the +behavior as long as they embedded `RegisteredClaims`. If they created a new +claim type from scratch, they now need to implemented the proper getter +functions. + +### Migrating Application Specific Logic of the old `Valid` + +Previously, users could override the `Valid` method in a custom claim, for +example to extend the validation with application-specific claims. However, this +was always very dangerous, since once could easily disable the standard +validation and signature checking. + +In order to avoid that, while still supporting the use-case, a new +`ClaimsValidator` interface has been introduced. This interface consists of the +`Validate() error` function. If the validator sees, that a `Claims` struct +implements this interface, the errors returned to the `Validate` function will +be *appended* to the regular standard validation. It is not possible to disable +the standard validation anymore (even only by accident). + +Usage examples can be found in [example_test.go](./example_test.go), to build +claims structs like the following. + +```go +// MyCustomClaims includes all registered claims, plus Foo. +type MyCustomClaims struct { + Foo string `json:"foo"` + jwt.RegisteredClaims +} + +// Validate can be used to execute additional application-specific claims +// validation. +func (m MyCustomClaims) Validate() error { + if m.Foo != "bar" { + return errors.New("must be foobar") + } + + return nil +} +``` + +## Changes to the `Token` and `Parser` struct + +The previously global functions `DecodeSegment` and `EncodeSegment` were moved +to the `Parser` and `Token` struct respectively. This will allow us in the +future to configure the behavior of these two based on options supplied on the +parser or the token (creation). This also removes two previously global +variables and moves them to parser options `WithStrictDecoding` and +`WithPaddingAllowed`. + +In order to do that, we had to adjust the way signing methods work. Previously +they were given a base64 encoded signature in `Verify` and were expected to +return a base64 encoded version of the signature in `Sign`, both as a `string`. +However, this made it necessary to have `DecodeSegment` and `EncodeSegment` +global and was a less than perfect design because we were repeating +encoding/decoding steps for all signing methods. Now, `Sign` and `Verify` +operate on a decoded signature as a `[]byte`, which feels more natural for a +cryptographic operation anyway. Lastly, `Parse` and `SignedString` take care of +the final encoding/decoding part. + +In addition to that, we also changed the `Signature` field on `Token` from a +`string` to `[]byte` and this is also now populated with the decoded form. This +is also more consistent, because the other parts of the JWT, mainly `Header` and +`Claims` were already stored in decoded form in `Token`. Only the signature was +stored in base64 encoded form, which was redundant with the information in the +`Raw` field, which contains the complete token as base64. + +```go +type Token struct { + Raw string // Raw contains the raw token + Method SigningMethod // Method is the signing method used or to be used + Header map[string]interface{} // Header is the first segment of the token in decoded form + Claims Claims // Claims is the second segment of the token in decoded form + Signature []byte // Signature is the third segment of the token in decoded form + Valid bool // Valid specifies if the token is valid +} +``` + +Most (if not all) of these changes should not impact the normal usage of this +library. Only users directly accessing the `Signature` field as well as +developers of custom signing methods should be affected. + +# Migration Guide (v4.0.0) + +Starting from [v4.0.0](https://github.com/golang-jwt/jwt/releases/tag/v4.0.0), +the import path will be: + + "github.com/golang-jwt/jwt/v4" + +The `/v4` version will be backwards compatible with existing `v3.x.y` tags in +this repo, as well as `github.com/dgrijalva/jwt-go`. For most users this should +be a drop-in replacement, if you're having troubles migrating, please open an +issue. + +You can replace all occurrences of `github.com/dgrijalva/jwt-go` or +`github.com/golang-jwt/jwt` with `github.com/golang-jwt/jwt/v4`, either manually +or by using tools such as `sed` or `gofmt`. + +And then you'd typically run: + +``` +go get github.com/golang-jwt/jwt/v4 +go mod tidy +``` + +# Older releases (before v3.2.0) + +The original migration guide for older releases can be found at +https://github.com/dgrijalva/jwt-go/blob/master/MIGRATION_GUIDE.md. diff --git a/vendor/github.com/golang-jwt/jwt/v5/README.md b/vendor/github.com/golang-jwt/jwt/v5/README.md new file mode 100644 index 000000000..964598a31 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/README.md @@ -0,0 +1,167 @@ +# jwt-go + +[![build](https://github.com/golang-jwt/jwt/actions/workflows/build.yml/badge.svg)](https://github.com/golang-jwt/jwt/actions/workflows/build.yml) +[![Go +Reference](https://pkg.go.dev/badge/github.com/golang-jwt/jwt/v5.svg)](https://pkg.go.dev/github.com/golang-jwt/jwt/v5) +[![Coverage Status](https://coveralls.io/repos/github/golang-jwt/jwt/badge.svg?branch=main)](https://coveralls.io/github/golang-jwt/jwt?branch=main) + +A [go](http://www.golang.org) (or 'golang' for search engine friendliness) +implementation of [JSON Web +Tokens](https://datatracker.ietf.org/doc/html/rfc7519). + +Starting with [v4.0.0](https://github.com/golang-jwt/jwt/releases/tag/v4.0.0) +this project adds Go module support, but maintains backwards compatibility with +older `v3.x.y` tags and upstream `github.com/dgrijalva/jwt-go`. See the +[`MIGRATION_GUIDE.md`](./MIGRATION_GUIDE.md) for more information. Version +v5.0.0 introduces major improvements to the validation of tokens, but is not +entirely backwards compatible. + +> After the original author of the library suggested migrating the maintenance +> of `jwt-go`, a dedicated team of open source maintainers decided to clone the +> existing library into this repository. See +> [dgrijalva/jwt-go#462](https://github.com/dgrijalva/jwt-go/issues/462) for a +> detailed discussion on this topic. + + +**SECURITY NOTICE:** Some older versions of Go have a security issue in the +crypto/elliptic. Recommendation is to upgrade to at least 1.15 See issue +[dgrijalva/jwt-go#216](https://github.com/dgrijalva/jwt-go/issues/216) for more +detail. + +**SECURITY NOTICE:** It's important that you [validate the `alg` presented is +what you +expect](https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/). +This library attempts to make it easy to do the right thing by requiring key +types match the expected alg, but you should take the extra step to verify it in +your usage. See the examples provided. + +### Supported Go versions + +Our support of Go versions is aligned with Go's [version release +policy](https://golang.org/doc/devel/release#policy). So we will support a major +version of Go until there are two newer major releases. We no longer support +building jwt-go with unsupported Go versions, as these contain security +vulnerabilities which will not be fixed. + +## What the heck is a JWT? + +JWT.io has [a great introduction](https://jwt.io/introduction) to JSON Web +Tokens. + +In short, it's a signed JSON object that does something useful (for example, +authentication). It's commonly used for `Bearer` tokens in Oauth 2. A token is +made of three parts, separated by `.`'s. The first two parts are JSON objects, +that have been [base64url](https://datatracker.ietf.org/doc/html/rfc4648) +encoded. The last part is the signature, encoded the same way. + +The first part is called the header. It contains the necessary information for +verifying the last part, the signature. For example, which encryption method +was used for signing and what key was used. + +The part in the middle is the interesting bit. It's called the Claims and +contains the actual stuff you care about. Refer to [RFC +7519](https://datatracker.ietf.org/doc/html/rfc7519) for information about +reserved keys and the proper way to add your own. + +## What's in the box? + +This library supports the parsing and verification as well as the generation and +signing of JWTs. Current supported signing algorithms are HMAC SHA, RSA, +RSA-PSS, and ECDSA, though hooks are present for adding your own. + +## Installation Guidelines + +1. To install the jwt package, you first need to have + [Go](https://go.dev/doc/install) installed, then you can use the command + below to add `jwt-go` as a dependency in your Go program. + +```sh +go get -u github.com/golang-jwt/jwt/v5 +``` + +2. Import it in your code: + +```go +import "github.com/golang-jwt/jwt/v5" +``` + +## Usage + +A detailed usage guide, including how to sign and verify tokens can be found on +our [documentation website](https://golang-jwt.github.io/jwt/usage/create/). + +## Examples + +See [the project documentation](https://pkg.go.dev/github.com/golang-jwt/jwt/v5) +for examples of usage: + +* [Simple example of parsing and validating a + token](https://pkg.go.dev/github.com/golang-jwt/jwt/v5#example-Parse-Hmac) +* [Simple example of building and signing a + token](https://pkg.go.dev/github.com/golang-jwt/jwt/v5#example-New-Hmac) +* [Directory of + Examples](https://pkg.go.dev/github.com/golang-jwt/jwt/v5#pkg-examples) + +## Compliance + +This library was last reviewed to comply with [RFC +7519](https://datatracker.ietf.org/doc/html/rfc7519) dated May 2015 with a few +notable differences: + +* In order to protect against accidental use of [Unsecured + JWTs](https://datatracker.ietf.org/doc/html/rfc7519#section-6), tokens using + `alg=none` will only be accepted if the constant + `jwt.UnsafeAllowNoneSignatureType` is provided as the key. + +## Project Status & Versioning + +This library is considered production ready. Feedback and feature requests are +appreciated. The API should be considered stable. There should be very few +backwards-incompatible changes outside of major version updates (and only with +good reason). + +This project uses [Semantic Versioning 2.0.0](http://semver.org). Accepted pull +requests will land on `main`. Periodically, versions will be tagged from +`main`. You can find all the releases on [the project releases +page](https://github.com/golang-jwt/jwt/releases). + +**BREAKING CHANGES:*** A full list of breaking changes is available in +`VERSION_HISTORY.md`. See `MIGRATION_GUIDE.md` for more information on updating +your code. + +## Extensions + +This library publishes all the necessary components for adding your own signing +methods or key functions. Simply implement the `SigningMethod` interface and +register a factory method using `RegisterSigningMethod` or provide a +`jwt.Keyfunc`. + +A common use case would be integrating with different 3rd party signature +providers, like key management services from various cloud providers or Hardware +Security Modules (HSMs) or to implement additional standards. + +| Extension | Purpose | Repo | +| --------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------ | +| GCP | Integrates with multiple Google Cloud Platform signing tools (AppEngine, IAM API, Cloud KMS) | https://github.com/someone1/gcp-jwt-go | +| AWS | Integrates with AWS Key Management Service, KMS | https://github.com/matelang/jwt-go-aws-kms | +| JWKS | Provides support for JWKS ([RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517)) as a `jwt.Keyfunc` | https://github.com/MicahParks/keyfunc | + +*Disclaimer*: Unless otherwise specified, these integrations are maintained by +third parties and should not be considered as a primary offer by any of the +mentioned cloud providers + +## More + +Go package documentation can be found [on +pkg.go.dev](https://pkg.go.dev/github.com/golang-jwt/jwt/v5). Additional +documentation can be found on [our project +page](https://golang-jwt.github.io/jwt/). + +The command line utility included in this project (cmd/jwt) provides a +straightforward example of token creation and parsing as well as a useful tool +for debugging your own integration. You'll also find several implementation +examples in the documentation. + +[golang-jwt](https://github.com/orgs/golang-jwt) incorporates a modified version +of the JWT logo, which is distributed under the terms of the [MIT +License](https://github.com/jsonwebtoken/jsonwebtoken.github.io/blob/master/LICENSE.txt). diff --git a/vendor/github.com/golang-jwt/jwt/v5/SECURITY.md b/vendor/github.com/golang-jwt/jwt/v5/SECURITY.md new file mode 100644 index 000000000..b08402c34 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/SECURITY.md @@ -0,0 +1,19 @@ +# Security Policy + +## Supported Versions + +As of February 2022 (and until this document is updated), the latest version `v4` is supported. + +## Reporting a Vulnerability + +If you think you found a vulnerability, and even if you are not sure, please report it to jwt-go-security@googlegroups.com or one of the other [golang-jwt maintainers](https://github.com/orgs/golang-jwt/people). Please try be explicit, describe steps to reproduce the security issue with code example(s). + +You will receive a response within a timely manner. If the issue is confirmed, we will do our best to release a patch as soon as possible given the complexity of the problem. + +## Public Discussions + +Please avoid publicly discussing a potential security vulnerability. + +Let's take this offline and find a solution first, this limits the potential impact as much as possible. + +We appreciate your help! diff --git a/vendor/github.com/golang-jwt/jwt/v5/VERSION_HISTORY.md b/vendor/github.com/golang-jwt/jwt/v5/VERSION_HISTORY.md new file mode 100644 index 000000000..b5039e49c --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/VERSION_HISTORY.md @@ -0,0 +1,137 @@ +# `jwt-go` Version History + +The following version history is kept for historic purposes. To retrieve the current changes of each version, please refer to the change-log of the specific release versions on https://github.com/golang-jwt/jwt/releases. + +## 4.0.0 + +* Introduces support for Go modules. The `v4` version will be backwards compatible with `v3.x.y`. + +## 3.2.2 + +* Starting from this release, we are adopting the policy to support the most 2 recent versions of Go currently available. By the time of this release, this is Go 1.15 and 1.16 ([#28](https://github.com/golang-jwt/jwt/pull/28)). +* Fixed a potential issue that could occur when the verification of `exp`, `iat` or `nbf` was not required and contained invalid contents, i.e. non-numeric/date. Thanks for @thaJeztah for making us aware of that and @giorgos-f3 for originally reporting it to the formtech fork ([#40](https://github.com/golang-jwt/jwt/pull/40)). +* Added support for EdDSA / ED25519 ([#36](https://github.com/golang-jwt/jwt/pull/36)). +* Optimized allocations ([#33](https://github.com/golang-jwt/jwt/pull/33)). + +## 3.2.1 + +* **Import Path Change**: See MIGRATION_GUIDE.md for tips on updating your code + * Changed the import path from `github.com/dgrijalva/jwt-go` to `github.com/golang-jwt/jwt` +* Fixed type confusing issue between `string` and `[]string` in `VerifyAudience` ([#12](https://github.com/golang-jwt/jwt/pull/12)). This fixes CVE-2020-26160 + +#### 3.2.0 + +* Added method `ParseUnverified` to allow users to split up the tasks of parsing and validation +* HMAC signing method returns `ErrInvalidKeyType` instead of `ErrInvalidKey` where appropriate +* Added options to `request.ParseFromRequest`, which allows for an arbitrary list of modifiers to parsing behavior. Initial set include `WithClaims` and `WithParser`. Existing usage of this function will continue to work as before. +* Deprecated `ParseFromRequestWithClaims` to simplify API in the future. + +#### 3.1.0 + +* Improvements to `jwt` command line tool +* Added `SkipClaimsValidation` option to `Parser` +* Documentation updates + +#### 3.0.0 + +* **Compatibility Breaking Changes**: See MIGRATION_GUIDE.md for tips on updating your code + * Dropped support for `[]byte` keys when using RSA signing methods. This convenience feature could contribute to security vulnerabilities involving mismatched key types with signing methods. + * `ParseFromRequest` has been moved to `request` subpackage and usage has changed + * The `Claims` property on `Token` is now type `Claims` instead of `map[string]interface{}`. The default value is type `MapClaims`, which is an alias to `map[string]interface{}`. This makes it possible to use a custom type when decoding claims. +* Other Additions and Changes + * Added `Claims` interface type to allow users to decode the claims into a custom type + * Added `ParseWithClaims`, which takes a third argument of type `Claims`. Use this function instead of `Parse` if you have a custom type you'd like to decode into. + * Dramatically improved the functionality and flexibility of `ParseFromRequest`, which is now in the `request` subpackage + * Added `ParseFromRequestWithClaims` which is the `FromRequest` equivalent of `ParseWithClaims` + * Added new interface type `Extractor`, which is used for extracting JWT strings from http requests. Used with `ParseFromRequest` and `ParseFromRequestWithClaims`. + * Added several new, more specific, validation errors to error type bitmask + * Moved examples from README to executable example files + * Signing method registry is now thread safe + * Added new property to `ValidationError`, which contains the raw error returned by calls made by parse/verify (such as those returned by keyfunc or json parser) + +#### 2.7.0 + +This will likely be the last backwards compatible release before 3.0.0, excluding essential bug fixes. + +* Added new option `-show` to the `jwt` command that will just output the decoded token without verifying +* Error text for expired tokens includes how long it's been expired +* Fixed incorrect error returned from `ParseRSAPublicKeyFromPEM` +* Documentation updates + +#### 2.6.0 + +* Exposed inner error within ValidationError +* Fixed validation errors when using UseJSONNumber flag +* Added several unit tests + +#### 2.5.0 + +* Added support for signing method none. You shouldn't use this. The API tries to make this clear. +* Updated/fixed some documentation +* Added more helpful error message when trying to parse tokens that begin with `BEARER ` + +#### 2.4.0 + +* Added new type, Parser, to allow for configuration of various parsing parameters + * You can now specify a list of valid signing methods. Anything outside this set will be rejected. + * You can now opt to use the `json.Number` type instead of `float64` when parsing token JSON +* Added support for [Travis CI](https://travis-ci.org/dgrijalva/jwt-go) +* Fixed some bugs with ECDSA parsing + +#### 2.3.0 + +* Added support for ECDSA signing methods +* Added support for RSA PSS signing methods (requires go v1.4) + +#### 2.2.0 + +* Gracefully handle a `nil` `Keyfunc` being passed to `Parse`. Result will now be the parsed token and an error, instead of a panic. + +#### 2.1.0 + +Backwards compatible API change that was missed in 2.0.0. + +* The `SignedString` method on `Token` now takes `interface{}` instead of `[]byte` + +#### 2.0.0 + +There were two major reasons for breaking backwards compatibility with this update. The first was a refactor required to expand the width of the RSA and HMAC-SHA signing implementations. There will likely be no required code changes to support this change. + +The second update, while unfortunately requiring a small change in integration, is required to open up this library to other signing methods. Not all keys used for all signing methods have a single standard on-disk representation. Requiring `[]byte` as the type for all keys proved too limiting. Additionally, this implementation allows for pre-parsed tokens to be reused, which might matter in an application that parses a high volume of tokens with a small set of keys. Backwards compatibilty has been maintained for passing `[]byte` to the RSA signing methods, but they will also accept `*rsa.PublicKey` and `*rsa.PrivateKey`. + +It is likely the only integration change required here will be to change `func(t *jwt.Token) ([]byte, error)` to `func(t *jwt.Token) (interface{}, error)` when calling `Parse`. + +* **Compatibility Breaking Changes** + * `SigningMethodHS256` is now `*SigningMethodHMAC` instead of `type struct` + * `SigningMethodRS256` is now `*SigningMethodRSA` instead of `type struct` + * `KeyFunc` now returns `interface{}` instead of `[]byte` + * `SigningMethod.Sign` now takes `interface{}` instead of `[]byte` for the key + * `SigningMethod.Verify` now takes `interface{}` instead of `[]byte` for the key +* Renamed type `SigningMethodHS256` to `SigningMethodHMAC`. Specific sizes are now just instances of this type. + * Added public package global `SigningMethodHS256` + * Added public package global `SigningMethodHS384` + * Added public package global `SigningMethodHS512` +* Renamed type `SigningMethodRS256` to `SigningMethodRSA`. Specific sizes are now just instances of this type. + * Added public package global `SigningMethodRS256` + * Added public package global `SigningMethodRS384` + * Added public package global `SigningMethodRS512` +* Moved sample private key for HMAC tests from an inline value to a file on disk. Value is unchanged. +* Refactored the RSA implementation to be easier to read +* Exposed helper methods `ParseRSAPrivateKeyFromPEM` and `ParseRSAPublicKeyFromPEM` + +## 1.0.2 + +* Fixed bug in parsing public keys from certificates +* Added more tests around the parsing of keys for RS256 +* Code refactoring in RS256 implementation. No functional changes + +## 1.0.1 + +* Fixed panic if RS256 signing method was passed an invalid key + +## 1.0.0 + +* First versioned release +* API stabilized +* Supports creating, signing, parsing, and validating JWT tokens +* Supports RS256 and HS256 signing methods diff --git a/vendor/github.com/golang-jwt/jwt/v5/claims.go b/vendor/github.com/golang-jwt/jwt/v5/claims.go new file mode 100644 index 000000000..d50ff3dad --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/claims.go @@ -0,0 +1,16 @@ +package jwt + +// Claims represent any form of a JWT Claims Set according to +// https://datatracker.ietf.org/doc/html/rfc7519#section-4. In order to have a +// common basis for validation, it is required that an implementation is able to +// supply at least the claim names provided in +// https://datatracker.ietf.org/doc/html/rfc7519#section-4.1 namely `exp`, +// `iat`, `nbf`, `iss`, `sub` and `aud`. +type Claims interface { + GetExpirationTime() (*NumericDate, error) + GetIssuedAt() (*NumericDate, error) + GetNotBefore() (*NumericDate, error) + GetIssuer() (string, error) + GetSubject() (string, error) + GetAudience() (ClaimStrings, error) +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/doc.go b/vendor/github.com/golang-jwt/jwt/v5/doc.go new file mode 100644 index 000000000..a86dc1a3b --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/doc.go @@ -0,0 +1,4 @@ +// Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html +// +// See README.md for more info. +package jwt diff --git a/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go b/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go new file mode 100644 index 000000000..c929e4a02 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go @@ -0,0 +1,134 @@ +package jwt + +import ( + "crypto" + "crypto/ecdsa" + "crypto/rand" + "errors" + "math/big" +) + +var ( + // Sadly this is missing from crypto/ecdsa compared to crypto/rsa + ErrECDSAVerification = errors.New("crypto/ecdsa: verification error") +) + +// SigningMethodECDSA implements the ECDSA family of signing methods. +// Expects *ecdsa.PrivateKey for signing and *ecdsa.PublicKey for verification +type SigningMethodECDSA struct { + Name string + Hash crypto.Hash + KeySize int + CurveBits int +} + +// Specific instances for EC256 and company +var ( + SigningMethodES256 *SigningMethodECDSA + SigningMethodES384 *SigningMethodECDSA + SigningMethodES512 *SigningMethodECDSA +) + +func init() { + // ES256 + SigningMethodES256 = &SigningMethodECDSA{"ES256", crypto.SHA256, 32, 256} + RegisterSigningMethod(SigningMethodES256.Alg(), func() SigningMethod { + return SigningMethodES256 + }) + + // ES384 + SigningMethodES384 = &SigningMethodECDSA{"ES384", crypto.SHA384, 48, 384} + RegisterSigningMethod(SigningMethodES384.Alg(), func() SigningMethod { + return SigningMethodES384 + }) + + // ES512 + SigningMethodES512 = &SigningMethodECDSA{"ES512", crypto.SHA512, 66, 521} + RegisterSigningMethod(SigningMethodES512.Alg(), func() SigningMethod { + return SigningMethodES512 + }) +} + +func (m *SigningMethodECDSA) Alg() string { + return m.Name +} + +// Verify implements token verification for the SigningMethod. +// For this verify method, key must be an ecdsa.PublicKey struct +func (m *SigningMethodECDSA) Verify(signingString string, sig []byte, key interface{}) error { + // Get the key + var ecdsaKey *ecdsa.PublicKey + switch k := key.(type) { + case *ecdsa.PublicKey: + ecdsaKey = k + default: + return newError("ECDSA verify expects *ecdsa.PublicKey", ErrInvalidKeyType) + } + + if len(sig) != 2*m.KeySize { + return ErrECDSAVerification + } + + r := big.NewInt(0).SetBytes(sig[:m.KeySize]) + s := big.NewInt(0).SetBytes(sig[m.KeySize:]) + + // Create hasher + if !m.Hash.Available() { + return ErrHashUnavailable + } + hasher := m.Hash.New() + hasher.Write([]byte(signingString)) + + // Verify the signature + if verifystatus := ecdsa.Verify(ecdsaKey, hasher.Sum(nil), r, s); verifystatus { + return nil + } + + return ErrECDSAVerification +} + +// Sign implements token signing for the SigningMethod. +// For this signing method, key must be an ecdsa.PrivateKey struct +func (m *SigningMethodECDSA) Sign(signingString string, key interface{}) ([]byte, error) { + // Get the key + var ecdsaKey *ecdsa.PrivateKey + switch k := key.(type) { + case *ecdsa.PrivateKey: + ecdsaKey = k + default: + return nil, newError("ECDSA sign expects *ecdsa.PrivateKey", ErrInvalidKeyType) + } + + // Create the hasher + if !m.Hash.Available() { + return nil, ErrHashUnavailable + } + + hasher := m.Hash.New() + hasher.Write([]byte(signingString)) + + // Sign the string and return r, s + if r, s, err := ecdsa.Sign(rand.Reader, ecdsaKey, hasher.Sum(nil)); err == nil { + curveBits := ecdsaKey.Curve.Params().BitSize + + if m.CurveBits != curveBits { + return nil, ErrInvalidKey + } + + keyBytes := curveBits / 8 + if curveBits%8 > 0 { + keyBytes += 1 + } + + // We serialize the outputs (r and s) into big-endian byte arrays + // padded with zeros on the left to make sure the sizes work out. + // Output must be 2*keyBytes long. + out := make([]byte, 2*keyBytes) + r.FillBytes(out[0:keyBytes]) // r is assigned to the first half of output. + s.FillBytes(out[keyBytes:]) // s is assigned to the second half of output. + + return out, nil + } else { + return nil, err + } +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/ecdsa_utils.go b/vendor/github.com/golang-jwt/jwt/v5/ecdsa_utils.go new file mode 100644 index 000000000..5700636d3 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/ecdsa_utils.go @@ -0,0 +1,69 @@ +package jwt + +import ( + "crypto/ecdsa" + "crypto/x509" + "encoding/pem" + "errors" +) + +var ( + ErrNotECPublicKey = errors.New("key is not a valid ECDSA public key") + ErrNotECPrivateKey = errors.New("key is not a valid ECDSA private key") +) + +// ParseECPrivateKeyFromPEM parses a PEM encoded Elliptic Curve Private Key Structure +func ParseECPrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error) { + var err error + + // Parse PEM block + var block *pem.Block + if block, _ = pem.Decode(key); block == nil { + return nil, ErrKeyMustBePEMEncoded + } + + // Parse the key + var parsedKey interface{} + if parsedKey, err = x509.ParseECPrivateKey(block.Bytes); err != nil { + if parsedKey, err = x509.ParsePKCS8PrivateKey(block.Bytes); err != nil { + return nil, err + } + } + + var pkey *ecdsa.PrivateKey + var ok bool + if pkey, ok = parsedKey.(*ecdsa.PrivateKey); !ok { + return nil, ErrNotECPrivateKey + } + + return pkey, nil +} + +// ParseECPublicKeyFromPEM parses a PEM encoded PKCS1 or PKCS8 public key +func ParseECPublicKeyFromPEM(key []byte) (*ecdsa.PublicKey, error) { + var err error + + // Parse PEM block + var block *pem.Block + if block, _ = pem.Decode(key); block == nil { + return nil, ErrKeyMustBePEMEncoded + } + + // Parse the key + var parsedKey interface{} + if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil { + if cert, err := x509.ParseCertificate(block.Bytes); err == nil { + parsedKey = cert.PublicKey + } else { + return nil, err + } + } + + var pkey *ecdsa.PublicKey + var ok bool + if pkey, ok = parsedKey.(*ecdsa.PublicKey); !ok { + return nil, ErrNotECPublicKey + } + + return pkey, nil +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/ed25519.go b/vendor/github.com/golang-jwt/jwt/v5/ed25519.go new file mode 100644 index 000000000..c2138119e --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/ed25519.go @@ -0,0 +1,79 @@ +package jwt + +import ( + "crypto" + "crypto/ed25519" + "crypto/rand" + "errors" +) + +var ( + ErrEd25519Verification = errors.New("ed25519: verification error") +) + +// SigningMethodEd25519 implements the EdDSA family. +// Expects ed25519.PrivateKey for signing and ed25519.PublicKey for verification +type SigningMethodEd25519 struct{} + +// Specific instance for EdDSA +var ( + SigningMethodEdDSA *SigningMethodEd25519 +) + +func init() { + SigningMethodEdDSA = &SigningMethodEd25519{} + RegisterSigningMethod(SigningMethodEdDSA.Alg(), func() SigningMethod { + return SigningMethodEdDSA + }) +} + +func (m *SigningMethodEd25519) Alg() string { + return "EdDSA" +} + +// Verify implements token verification for the SigningMethod. +// For this verify method, key must be an ed25519.PublicKey +func (m *SigningMethodEd25519) Verify(signingString string, sig []byte, key interface{}) error { + var ed25519Key ed25519.PublicKey + var ok bool + + if ed25519Key, ok = key.(ed25519.PublicKey); !ok { + return newError("Ed25519 verify expects ed25519.PublicKey", ErrInvalidKeyType) + } + + if len(ed25519Key) != ed25519.PublicKeySize { + return ErrInvalidKey + } + + // Verify the signature + if !ed25519.Verify(ed25519Key, []byte(signingString), sig) { + return ErrEd25519Verification + } + + return nil +} + +// Sign implements token signing for the SigningMethod. +// For this signing method, key must be an ed25519.PrivateKey +func (m *SigningMethodEd25519) Sign(signingString string, key interface{}) ([]byte, error) { + var ed25519Key crypto.Signer + var ok bool + + if ed25519Key, ok = key.(crypto.Signer); !ok { + return nil, newError("Ed25519 sign expects crypto.Signer", ErrInvalidKeyType) + } + + if _, ok := ed25519Key.Public().(ed25519.PublicKey); !ok { + return nil, ErrInvalidKey + } + + // Sign the string and return the result. ed25519 performs a two-pass hash + // as part of its algorithm. Therefore, we need to pass a non-prehashed + // message into the Sign function, as indicated by crypto.Hash(0) + sig, err := ed25519Key.Sign(rand.Reader, []byte(signingString), crypto.Hash(0)) + if err != nil { + return nil, err + } + + return sig, nil +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/ed25519_utils.go b/vendor/github.com/golang-jwt/jwt/v5/ed25519_utils.go new file mode 100644 index 000000000..cdb5e68e8 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/ed25519_utils.go @@ -0,0 +1,64 @@ +package jwt + +import ( + "crypto" + "crypto/ed25519" + "crypto/x509" + "encoding/pem" + "errors" +) + +var ( + ErrNotEdPrivateKey = errors.New("key is not a valid Ed25519 private key") + ErrNotEdPublicKey = errors.New("key is not a valid Ed25519 public key") +) + +// ParseEdPrivateKeyFromPEM parses a PEM-encoded Edwards curve private key +func ParseEdPrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error) { + var err error + + // Parse PEM block + var block *pem.Block + if block, _ = pem.Decode(key); block == nil { + return nil, ErrKeyMustBePEMEncoded + } + + // Parse the key + var parsedKey interface{} + if parsedKey, err = x509.ParsePKCS8PrivateKey(block.Bytes); err != nil { + return nil, err + } + + var pkey ed25519.PrivateKey + var ok bool + if pkey, ok = parsedKey.(ed25519.PrivateKey); !ok { + return nil, ErrNotEdPrivateKey + } + + return pkey, nil +} + +// ParseEdPublicKeyFromPEM parses a PEM-encoded Edwards curve public key +func ParseEdPublicKeyFromPEM(key []byte) (crypto.PublicKey, error) { + var err error + + // Parse PEM block + var block *pem.Block + if block, _ = pem.Decode(key); block == nil { + return nil, ErrKeyMustBePEMEncoded + } + + // Parse the key + var parsedKey interface{} + if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil { + return nil, err + } + + var pkey ed25519.PublicKey + var ok bool + if pkey, ok = parsedKey.(ed25519.PublicKey); !ok { + return nil, ErrNotEdPublicKey + } + + return pkey, nil +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/errors.go b/vendor/github.com/golang-jwt/jwt/v5/errors.go new file mode 100644 index 000000000..23bb616dd --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/errors.go @@ -0,0 +1,49 @@ +package jwt + +import ( + "errors" + "strings" +) + +var ( + ErrInvalidKey = errors.New("key is invalid") + ErrInvalidKeyType = errors.New("key is of invalid type") + ErrHashUnavailable = errors.New("the requested hash function is unavailable") + ErrTokenMalformed = errors.New("token is malformed") + ErrTokenUnverifiable = errors.New("token is unverifiable") + ErrTokenSignatureInvalid = errors.New("token signature is invalid") + ErrTokenRequiredClaimMissing = errors.New("token is missing required claim") + ErrTokenInvalidAudience = errors.New("token has invalid audience") + ErrTokenExpired = errors.New("token is expired") + ErrTokenUsedBeforeIssued = errors.New("token used before issued") + ErrTokenInvalidIssuer = errors.New("token has invalid issuer") + ErrTokenInvalidSubject = errors.New("token has invalid subject") + ErrTokenNotValidYet = errors.New("token is not valid yet") + ErrTokenInvalidId = errors.New("token has invalid id") + ErrTokenInvalidClaims = errors.New("token has invalid claims") + ErrInvalidType = errors.New("invalid type for claim") +) + +// joinedError is an error type that works similar to what [errors.Join] +// produces, with the exception that it has a nice error string; mainly its +// error messages are concatenated using a comma, rather than a newline. +type joinedError struct { + errs []error +} + +func (je joinedError) Error() string { + msg := []string{} + for _, err := range je.errs { + msg = append(msg, err.Error()) + } + + return strings.Join(msg, ", ") +} + +// joinErrors joins together multiple errors. Useful for scenarios where +// multiple errors next to each other occur, e.g., in claims validation. +func joinErrors(errs ...error) error { + return &joinedError{ + errs: errs, + } +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/errors_go1_20.go b/vendor/github.com/golang-jwt/jwt/v5/errors_go1_20.go new file mode 100644 index 000000000..a893d355e --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/errors_go1_20.go @@ -0,0 +1,47 @@ +//go:build go1.20 +// +build go1.20 + +package jwt + +import ( + "fmt" +) + +// Unwrap implements the multiple error unwrapping for this error type, which is +// possible in Go 1.20. +func (je joinedError) Unwrap() []error { + return je.errs +} + +// newError creates a new error message with a detailed error message. The +// message will be prefixed with the contents of the supplied error type. +// Additionally, more errors, that provide more context can be supplied which +// will be appended to the message. This makes use of Go 1.20's possibility to +// include more than one %w formatting directive in [fmt.Errorf]. +// +// For example, +// +// newError("no keyfunc was provided", ErrTokenUnverifiable) +// +// will produce the error string +// +// "token is unverifiable: no keyfunc was provided" +func newError(message string, err error, more ...error) error { + var format string + var args []any + if message != "" { + format = "%w: %s" + args = []any{err, message} + } else { + format = "%w" + args = []any{err} + } + + for _, e := range more { + format += ": %w" + args = append(args, e) + } + + err = fmt.Errorf(format, args...) + return err +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/errors_go_other.go b/vendor/github.com/golang-jwt/jwt/v5/errors_go_other.go new file mode 100644 index 000000000..2ad542f00 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/errors_go_other.go @@ -0,0 +1,78 @@ +//go:build !go1.20 +// +build !go1.20 + +package jwt + +import ( + "errors" + "fmt" +) + +// Is implements checking for multiple errors using [errors.Is], since multiple +// error unwrapping is not possible in versions less than Go 1.20. +func (je joinedError) Is(err error) bool { + for _, e := range je.errs { + if errors.Is(e, err) { + return true + } + } + + return false +} + +// wrappedErrors is a workaround for wrapping multiple errors in environments +// where Go 1.20 is not available. It basically uses the already implemented +// functionality of joinedError to handle multiple errors with supplies a +// custom error message that is identical to the one we produce in Go 1.20 using +// multiple %w directives. +type wrappedErrors struct { + msg string + joinedError +} + +// Error returns the stored error string +func (we wrappedErrors) Error() string { + return we.msg +} + +// newError creates a new error message with a detailed error message. The +// message will be prefixed with the contents of the supplied error type. +// Additionally, more errors, that provide more context can be supplied which +// will be appended to the message. Since we cannot use of Go 1.20's possibility +// to include more than one %w formatting directive in [fmt.Errorf], we have to +// emulate that. +// +// For example, +// +// newError("no keyfunc was provided", ErrTokenUnverifiable) +// +// will produce the error string +// +// "token is unverifiable: no keyfunc was provided" +func newError(message string, err error, more ...error) error { + // We cannot wrap multiple errors here with %w, so we have to be a little + // bit creative. Basically, we are using %s instead of %w to produce the + // same error message and then throw the result into a custom error struct. + var format string + var args []any + if message != "" { + format = "%s: %s" + args = []any{err, message} + } else { + format = "%s" + args = []any{err} + } + errs := []error{err} + + for _, e := range more { + format += ": %s" + args = append(args, e) + errs = append(errs, e) + } + + err = &wrappedErrors{ + msg: fmt.Sprintf(format, args...), + joinedError: joinedError{errs: errs}, + } + return err +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/hmac.go b/vendor/github.com/golang-jwt/jwt/v5/hmac.go new file mode 100644 index 000000000..aca600ce1 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/hmac.go @@ -0,0 +1,104 @@ +package jwt + +import ( + "crypto" + "crypto/hmac" + "errors" +) + +// SigningMethodHMAC implements the HMAC-SHA family of signing methods. +// Expects key type of []byte for both signing and validation +type SigningMethodHMAC struct { + Name string + Hash crypto.Hash +} + +// Specific instances for HS256 and company +var ( + SigningMethodHS256 *SigningMethodHMAC + SigningMethodHS384 *SigningMethodHMAC + SigningMethodHS512 *SigningMethodHMAC + ErrSignatureInvalid = errors.New("signature is invalid") +) + +func init() { + // HS256 + SigningMethodHS256 = &SigningMethodHMAC{"HS256", crypto.SHA256} + RegisterSigningMethod(SigningMethodHS256.Alg(), func() SigningMethod { + return SigningMethodHS256 + }) + + // HS384 + SigningMethodHS384 = &SigningMethodHMAC{"HS384", crypto.SHA384} + RegisterSigningMethod(SigningMethodHS384.Alg(), func() SigningMethod { + return SigningMethodHS384 + }) + + // HS512 + SigningMethodHS512 = &SigningMethodHMAC{"HS512", crypto.SHA512} + RegisterSigningMethod(SigningMethodHS512.Alg(), func() SigningMethod { + return SigningMethodHS512 + }) +} + +func (m *SigningMethodHMAC) Alg() string { + return m.Name +} + +// Verify implements token verification for the SigningMethod. Returns nil if +// the signature is valid. Key must be []byte. +// +// Note it is not advised to provide a []byte which was converted from a 'human +// readable' string using a subset of ASCII characters. To maximize entropy, you +// should ideally be providing a []byte key which was produced from a +// cryptographically random source, e.g. crypto/rand. Additional information +// about this, and why we intentionally are not supporting string as a key can +// be found on our usage guide +// https://golang-jwt.github.io/jwt/usage/signing_methods/#signing-methods-and-key-types. +func (m *SigningMethodHMAC) Verify(signingString string, sig []byte, key interface{}) error { + // Verify the key is the right type + keyBytes, ok := key.([]byte) + if !ok { + return newError("HMAC verify expects []byte", ErrInvalidKeyType) + } + + // Can we use the specified hashing method? + if !m.Hash.Available() { + return ErrHashUnavailable + } + + // This signing method is symmetric, so we validate the signature + // by reproducing the signature from the signing string and key, then + // comparing that against the provided signature. + hasher := hmac.New(m.Hash.New, keyBytes) + hasher.Write([]byte(signingString)) + if !hmac.Equal(sig, hasher.Sum(nil)) { + return ErrSignatureInvalid + } + + // No validation errors. Signature is good. + return nil +} + +// Sign implements token signing for the SigningMethod. Key must be []byte. +// +// Note it is not advised to provide a []byte which was converted from a 'human +// readable' string using a subset of ASCII characters. To maximize entropy, you +// should ideally be providing a []byte key which was produced from a +// cryptographically random source, e.g. crypto/rand. Additional information +// about this, and why we intentionally are not supporting string as a key can +// be found on our usage guide https://golang-jwt.github.io/jwt/usage/signing_methods/. +func (m *SigningMethodHMAC) Sign(signingString string, key interface{}) ([]byte, error) { + if keyBytes, ok := key.([]byte); ok { + if !m.Hash.Available() { + return nil, ErrHashUnavailable + } + + hasher := hmac.New(m.Hash.New, keyBytes) + hasher.Write([]byte(signingString)) + + return hasher.Sum(nil), nil + } + + return nil, newError("HMAC sign expects []byte", ErrInvalidKeyType) +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/map_claims.go b/vendor/github.com/golang-jwt/jwt/v5/map_claims.go new file mode 100644 index 000000000..b2b51a1f8 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/map_claims.go @@ -0,0 +1,109 @@ +package jwt + +import ( + "encoding/json" + "fmt" +) + +// MapClaims is a claims type that uses the map[string]interface{} for JSON +// decoding. This is the default claims type if you don't supply one +type MapClaims map[string]interface{} + +// GetExpirationTime implements the Claims interface. +func (m MapClaims) GetExpirationTime() (*NumericDate, error) { + return m.parseNumericDate("exp") +} + +// GetNotBefore implements the Claims interface. +func (m MapClaims) GetNotBefore() (*NumericDate, error) { + return m.parseNumericDate("nbf") +} + +// GetIssuedAt implements the Claims interface. +func (m MapClaims) GetIssuedAt() (*NumericDate, error) { + return m.parseNumericDate("iat") +} + +// GetAudience implements the Claims interface. +func (m MapClaims) GetAudience() (ClaimStrings, error) { + return m.parseClaimsString("aud") +} + +// GetIssuer implements the Claims interface. +func (m MapClaims) GetIssuer() (string, error) { + return m.parseString("iss") +} + +// GetSubject implements the Claims interface. +func (m MapClaims) GetSubject() (string, error) { + return m.parseString("sub") +} + +// parseNumericDate tries to parse a key in the map claims type as a number +// date. This will succeed, if the underlying type is either a [float64] or a +// [json.Number]. Otherwise, nil will be returned. +func (m MapClaims) parseNumericDate(key string) (*NumericDate, error) { + v, ok := m[key] + if !ok { + return nil, nil + } + + switch exp := v.(type) { + case float64: + if exp == 0 { + return nil, nil + } + + return newNumericDateFromSeconds(exp), nil + case json.Number: + v, _ := exp.Float64() + + return newNumericDateFromSeconds(v), nil + } + + return nil, newError(fmt.Sprintf("%s is invalid", key), ErrInvalidType) +} + +// parseClaimsString tries to parse a key in the map claims type as a +// [ClaimsStrings] type, which can either be a string or an array of string. +func (m MapClaims) parseClaimsString(key string) (ClaimStrings, error) { + var cs []string + switch v := m[key].(type) { + case string: + cs = append(cs, v) + case []string: + cs = v + case []interface{}: + for _, a := range v { + vs, ok := a.(string) + if !ok { + return nil, newError(fmt.Sprintf("%s is invalid", key), ErrInvalidType) + } + cs = append(cs, vs) + } + } + + return cs, nil +} + +// parseString tries to parse a key in the map claims type as a [string] type. +// If the key does not exist, an empty string is returned. If the key has the +// wrong type, an error is returned. +func (m MapClaims) parseString(key string) (string, error) { + var ( + ok bool + raw interface{} + iss string + ) + raw, ok = m[key] + if !ok { + return "", nil + } + + iss, ok = raw.(string) + if !ok { + return "", newError(fmt.Sprintf("%s is invalid", key), ErrInvalidType) + } + + return iss, nil +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/none.go b/vendor/github.com/golang-jwt/jwt/v5/none.go new file mode 100644 index 000000000..685c2ea30 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/none.go @@ -0,0 +1,50 @@ +package jwt + +// SigningMethodNone implements the none signing method. This is required by the spec +// but you probably should never use it. +var SigningMethodNone *signingMethodNone + +const UnsafeAllowNoneSignatureType unsafeNoneMagicConstant = "none signing method allowed" + +var NoneSignatureTypeDisallowedError error + +type signingMethodNone struct{} +type unsafeNoneMagicConstant string + +func init() { + SigningMethodNone = &signingMethodNone{} + NoneSignatureTypeDisallowedError = newError("'none' signature type is not allowed", ErrTokenUnverifiable) + + RegisterSigningMethod(SigningMethodNone.Alg(), func() SigningMethod { + return SigningMethodNone + }) +} + +func (m *signingMethodNone) Alg() string { + return "none" +} + +// Only allow 'none' alg type if UnsafeAllowNoneSignatureType is specified as the key +func (m *signingMethodNone) Verify(signingString string, sig []byte, key interface{}) (err error) { + // Key must be UnsafeAllowNoneSignatureType to prevent accidentally + // accepting 'none' signing method + if _, ok := key.(unsafeNoneMagicConstant); !ok { + return NoneSignatureTypeDisallowedError + } + // If signing method is none, signature must be an empty string + if len(sig) != 0 { + return newError("'none' signing method with non-empty signature", ErrTokenUnverifiable) + } + + // Accept 'none' signing method. + return nil +} + +// Only allow 'none' signing if UnsafeAllowNoneSignatureType is specified as the key +func (m *signingMethodNone) Sign(signingString string, key interface{}) ([]byte, error) { + if _, ok := key.(unsafeNoneMagicConstant); ok { + return []byte{}, nil + } + + return nil, NoneSignatureTypeDisallowedError +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/parser.go b/vendor/github.com/golang-jwt/jwt/v5/parser.go new file mode 100644 index 000000000..ecf99af78 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/parser.go @@ -0,0 +1,238 @@ +package jwt + +import ( + "bytes" + "encoding/base64" + "encoding/json" + "fmt" + "strings" +) + +type Parser struct { + // If populated, only these methods will be considered valid. + validMethods []string + + // Use JSON Number format in JSON decoder. + useJSONNumber bool + + // Skip claims validation during token parsing. + skipClaimsValidation bool + + validator *Validator + + decodeStrict bool + + decodePaddingAllowed bool +} + +// NewParser creates a new Parser with the specified options +func NewParser(options ...ParserOption) *Parser { + p := &Parser{ + validator: &Validator{}, + } + + // Loop through our parsing options and apply them + for _, option := range options { + option(p) + } + + return p +} + +// Parse parses, validates, verifies the signature and returns the parsed token. +// keyFunc will receive the parsed token and should return the key for validating. +func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) { + return p.ParseWithClaims(tokenString, MapClaims{}, keyFunc) +} + +// ParseWithClaims parses, validates, and verifies like Parse, but supplies a default object implementing the Claims +// interface. This provides default values which can be overridden and allows a caller to use their own type, rather +// than the default MapClaims implementation of Claims. +// +// Note: If you provide a custom claim implementation that embeds one of the standard claims (such as RegisteredClaims), +// make sure that a) you either embed a non-pointer version of the claims or b) if you are using a pointer, allocate the +// proper memory for it before passing in the overall claims, otherwise you might run into a panic. +func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) { + token, parts, err := p.ParseUnverified(tokenString, claims) + if err != nil { + return token, err + } + + // Verify signing method is in the required set + if p.validMethods != nil { + var signingMethodValid = false + var alg = token.Method.Alg() + for _, m := range p.validMethods { + if m == alg { + signingMethodValid = true + break + } + } + if !signingMethodValid { + // signing method is not in the listed set + return token, newError(fmt.Sprintf("signing method %v is invalid", alg), ErrTokenSignatureInvalid) + } + } + + // Decode signature + token.Signature, err = p.DecodeSegment(parts[2]) + if err != nil { + return token, newError("could not base64 decode signature", ErrTokenMalformed, err) + } + text := strings.Join(parts[0:2], ".") + + // Lookup key(s) + if keyFunc == nil { + // keyFunc was not provided. short circuiting validation + return token, newError("no keyfunc was provided", ErrTokenUnverifiable) + } + + got, err := keyFunc(token) + if err != nil { + return token, newError("error while executing keyfunc", ErrTokenUnverifiable, err) + } + + switch have := got.(type) { + case VerificationKeySet: + if len(have.Keys) == 0 { + return token, newError("keyfunc returned empty verification key set", ErrTokenUnverifiable) + } + // Iterate through keys and verify signature, skipping the rest when a match is found. + // Return the last error if no match is found. + for _, key := range have.Keys { + if err = token.Method.Verify(text, token.Signature, key); err == nil { + break + } + } + default: + err = token.Method.Verify(text, token.Signature, have) + } + if err != nil { + return token, newError("", ErrTokenSignatureInvalid, err) + } + + // Validate Claims + if !p.skipClaimsValidation { + // Make sure we have at least a default validator + if p.validator == nil { + p.validator = NewValidator() + } + + if err := p.validator.Validate(claims); err != nil { + return token, newError("", ErrTokenInvalidClaims, err) + } + } + + // No errors so far, token is valid. + token.Valid = true + + return token, nil +} + +// ParseUnverified parses the token but doesn't validate the signature. +// +// WARNING: Don't use this method unless you know what you're doing. +// +// It's only ever useful in cases where you know the signature is valid (since it has already +// been or will be checked elsewhere in the stack) and you want to extract values from it. +func (p *Parser) ParseUnverified(tokenString string, claims Claims) (token *Token, parts []string, err error) { + parts = strings.Split(tokenString, ".") + if len(parts) != 3 { + return nil, parts, newError("token contains an invalid number of segments", ErrTokenMalformed) + } + + token = &Token{Raw: tokenString} + + // parse Header + var headerBytes []byte + if headerBytes, err = p.DecodeSegment(parts[0]); err != nil { + return token, parts, newError("could not base64 decode header", ErrTokenMalformed, err) + } + if err = json.Unmarshal(headerBytes, &token.Header); err != nil { + return token, parts, newError("could not JSON decode header", ErrTokenMalformed, err) + } + + // parse Claims + token.Claims = claims + + claimBytes, err := p.DecodeSegment(parts[1]) + if err != nil { + return token, parts, newError("could not base64 decode claim", ErrTokenMalformed, err) + } + + // If `useJSONNumber` is enabled then we must use *json.Decoder to decode + // the claims. However, this comes with a performance penalty so only use + // it if we must and, otherwise, simple use json.Unmarshal. + if !p.useJSONNumber { + // JSON Unmarshal. Special case for map type to avoid weird pointer behavior. + if c, ok := token.Claims.(MapClaims); ok { + err = json.Unmarshal(claimBytes, &c) + } else { + err = json.Unmarshal(claimBytes, &claims) + } + } else { + dec := json.NewDecoder(bytes.NewBuffer(claimBytes)) + dec.UseNumber() + // JSON Decode. Special case for map type to avoid weird pointer behavior. + if c, ok := token.Claims.(MapClaims); ok { + err = dec.Decode(&c) + } else { + err = dec.Decode(&claims) + } + } + if err != nil { + return token, parts, newError("could not JSON decode claim", ErrTokenMalformed, err) + } + + // Lookup signature method + if method, ok := token.Header["alg"].(string); ok { + if token.Method = GetSigningMethod(method); token.Method == nil { + return token, parts, newError("signing method (alg) is unavailable", ErrTokenUnverifiable) + } + } else { + return token, parts, newError("signing method (alg) is unspecified", ErrTokenUnverifiable) + } + + return token, parts, nil +} + +// DecodeSegment decodes a JWT specific base64url encoding. This function will +// take into account whether the [Parser] is configured with additional options, +// such as [WithStrictDecoding] or [WithPaddingAllowed]. +func (p *Parser) DecodeSegment(seg string) ([]byte, error) { + encoding := base64.RawURLEncoding + + if p.decodePaddingAllowed { + if l := len(seg) % 4; l > 0 { + seg += strings.Repeat("=", 4-l) + } + encoding = base64.URLEncoding + } + + if p.decodeStrict { + encoding = encoding.Strict() + } + return encoding.DecodeString(seg) +} + +// Parse parses, validates, verifies the signature and returns the parsed token. +// keyFunc will receive the parsed token and should return the cryptographic key +// for verifying the signature. The caller is strongly encouraged to set the +// WithValidMethods option to validate the 'alg' claim in the token matches the +// expected algorithm. For more details about the importance of validating the +// 'alg' claim, see +// https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/ +func Parse(tokenString string, keyFunc Keyfunc, options ...ParserOption) (*Token, error) { + return NewParser(options...).Parse(tokenString, keyFunc) +} + +// ParseWithClaims is a shortcut for NewParser().ParseWithClaims(). +// +// Note: If you provide a custom claim implementation that embeds one of the +// standard claims (such as RegisteredClaims), make sure that a) you either +// embed a non-pointer version of the claims or b) if you are using a pointer, +// allocate the proper memory for it before passing in the overall claims, +// otherwise you might run into a panic. +func ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc, options ...ParserOption) (*Token, error) { + return NewParser(options...).ParseWithClaims(tokenString, claims, keyFunc) +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/parser_option.go b/vendor/github.com/golang-jwt/jwt/v5/parser_option.go new file mode 100644 index 000000000..88a780fbd --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/parser_option.go @@ -0,0 +1,128 @@ +package jwt + +import "time" + +// ParserOption is used to implement functional-style options that modify the +// behavior of the parser. To add new options, just create a function (ideally +// beginning with With or Without) that returns an anonymous function that takes +// a *Parser type as input and manipulates its configuration accordingly. +type ParserOption func(*Parser) + +// WithValidMethods is an option to supply algorithm methods that the parser +// will check. Only those methods will be considered valid. It is heavily +// encouraged to use this option in order to prevent attacks such as +// https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/. +func WithValidMethods(methods []string) ParserOption { + return func(p *Parser) { + p.validMethods = methods + } +} + +// WithJSONNumber is an option to configure the underlying JSON parser with +// UseNumber. +func WithJSONNumber() ParserOption { + return func(p *Parser) { + p.useJSONNumber = true + } +} + +// WithoutClaimsValidation is an option to disable claims validation. This +// option should only be used if you exactly know what you are doing. +func WithoutClaimsValidation() ParserOption { + return func(p *Parser) { + p.skipClaimsValidation = true + } +} + +// WithLeeway returns the ParserOption for specifying the leeway window. +func WithLeeway(leeway time.Duration) ParserOption { + return func(p *Parser) { + p.validator.leeway = leeway + } +} + +// WithTimeFunc returns the ParserOption for specifying the time func. The +// primary use-case for this is testing. If you are looking for a way to account +// for clock-skew, WithLeeway should be used instead. +func WithTimeFunc(f func() time.Time) ParserOption { + return func(p *Parser) { + p.validator.timeFunc = f + } +} + +// WithIssuedAt returns the ParserOption to enable verification +// of issued-at. +func WithIssuedAt() ParserOption { + return func(p *Parser) { + p.validator.verifyIat = true + } +} + +// WithExpirationRequired returns the ParserOption to make exp claim required. +// By default exp claim is optional. +func WithExpirationRequired() ParserOption { + return func(p *Parser) { + p.validator.requireExp = true + } +} + +// WithAudience configures the validator to require the specified audience in +// the `aud` claim. Validation will fail if the audience is not listed in the +// token or the `aud` claim is missing. +// +// NOTE: While the `aud` claim is OPTIONAL in a JWT, the handling of it is +// application-specific. Since this validation API is helping developers in +// writing secure application, we decided to REQUIRE the existence of the claim, +// if an audience is expected. +func WithAudience(aud string) ParserOption { + return func(p *Parser) { + p.validator.expectedAud = aud + } +} + +// WithIssuer configures the validator to require the specified issuer in the +// `iss` claim. Validation will fail if a different issuer is specified in the +// token or the `iss` claim is missing. +// +// NOTE: While the `iss` claim is OPTIONAL in a JWT, the handling of it is +// application-specific. Since this validation API is helping developers in +// writing secure application, we decided to REQUIRE the existence of the claim, +// if an issuer is expected. +func WithIssuer(iss string) ParserOption { + return func(p *Parser) { + p.validator.expectedIss = iss + } +} + +// WithSubject configures the validator to require the specified subject in the +// `sub` claim. Validation will fail if a different subject is specified in the +// token or the `sub` claim is missing. +// +// NOTE: While the `sub` claim is OPTIONAL in a JWT, the handling of it is +// application-specific. Since this validation API is helping developers in +// writing secure application, we decided to REQUIRE the existence of the claim, +// if a subject is expected. +func WithSubject(sub string) ParserOption { + return func(p *Parser) { + p.validator.expectedSub = sub + } +} + +// WithPaddingAllowed will enable the codec used for decoding JWTs to allow +// padding. Note that the JWS RFC7515 states that the tokens will utilize a +// Base64url encoding with no padding. Unfortunately, some implementations of +// JWT are producing non-standard tokens, and thus require support for decoding. +func WithPaddingAllowed() ParserOption { + return func(p *Parser) { + p.decodePaddingAllowed = true + } +} + +// WithStrictDecoding will switch the codec used for decoding JWTs into strict +// mode. In this mode, the decoder requires that trailing padding bits are zero, +// as described in RFC 4648 section 3.5. +func WithStrictDecoding() ParserOption { + return func(p *Parser) { + p.decodeStrict = true + } +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/registered_claims.go b/vendor/github.com/golang-jwt/jwt/v5/registered_claims.go new file mode 100644 index 000000000..77951a531 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/registered_claims.go @@ -0,0 +1,63 @@ +package jwt + +// RegisteredClaims are a structured version of the JWT Claims Set, +// restricted to Registered Claim Names, as referenced at +// https://datatracker.ietf.org/doc/html/rfc7519#section-4.1 +// +// This type can be used on its own, but then additional private and +// public claims embedded in the JWT will not be parsed. The typical use-case +// therefore is to embedded this in a user-defined claim type. +// +// See examples for how to use this with your own claim types. +type RegisteredClaims struct { + // the `iss` (Issuer) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.1 + Issuer string `json:"iss,omitempty"` + + // the `sub` (Subject) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.2 + Subject string `json:"sub,omitempty"` + + // the `aud` (Audience) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.3 + Audience ClaimStrings `json:"aud,omitempty"` + + // the `exp` (Expiration Time) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4 + ExpiresAt *NumericDate `json:"exp,omitempty"` + + // the `nbf` (Not Before) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.5 + NotBefore *NumericDate `json:"nbf,omitempty"` + + // the `iat` (Issued At) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.6 + IssuedAt *NumericDate `json:"iat,omitempty"` + + // the `jti` (JWT ID) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.7 + ID string `json:"jti,omitempty"` +} + +// GetExpirationTime implements the Claims interface. +func (c RegisteredClaims) GetExpirationTime() (*NumericDate, error) { + return c.ExpiresAt, nil +} + +// GetNotBefore implements the Claims interface. +func (c RegisteredClaims) GetNotBefore() (*NumericDate, error) { + return c.NotBefore, nil +} + +// GetIssuedAt implements the Claims interface. +func (c RegisteredClaims) GetIssuedAt() (*NumericDate, error) { + return c.IssuedAt, nil +} + +// GetAudience implements the Claims interface. +func (c RegisteredClaims) GetAudience() (ClaimStrings, error) { + return c.Audience, nil +} + +// GetIssuer implements the Claims interface. +func (c RegisteredClaims) GetIssuer() (string, error) { + return c.Issuer, nil +} + +// GetSubject implements the Claims interface. +func (c RegisteredClaims) GetSubject() (string, error) { + return c.Subject, nil +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/rsa.go b/vendor/github.com/golang-jwt/jwt/v5/rsa.go new file mode 100644 index 000000000..83cbee6ae --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/rsa.go @@ -0,0 +1,93 @@ +package jwt + +import ( + "crypto" + "crypto/rand" + "crypto/rsa" +) + +// SigningMethodRSA implements the RSA family of signing methods. +// Expects *rsa.PrivateKey for signing and *rsa.PublicKey for validation +type SigningMethodRSA struct { + Name string + Hash crypto.Hash +} + +// Specific instances for RS256 and company +var ( + SigningMethodRS256 *SigningMethodRSA + SigningMethodRS384 *SigningMethodRSA + SigningMethodRS512 *SigningMethodRSA +) + +func init() { + // RS256 + SigningMethodRS256 = &SigningMethodRSA{"RS256", crypto.SHA256} + RegisterSigningMethod(SigningMethodRS256.Alg(), func() SigningMethod { + return SigningMethodRS256 + }) + + // RS384 + SigningMethodRS384 = &SigningMethodRSA{"RS384", crypto.SHA384} + RegisterSigningMethod(SigningMethodRS384.Alg(), func() SigningMethod { + return SigningMethodRS384 + }) + + // RS512 + SigningMethodRS512 = &SigningMethodRSA{"RS512", crypto.SHA512} + RegisterSigningMethod(SigningMethodRS512.Alg(), func() SigningMethod { + return SigningMethodRS512 + }) +} + +func (m *SigningMethodRSA) Alg() string { + return m.Name +} + +// Verify implements token verification for the SigningMethod +// For this signing method, must be an *rsa.PublicKey structure. +func (m *SigningMethodRSA) Verify(signingString string, sig []byte, key interface{}) error { + var rsaKey *rsa.PublicKey + var ok bool + + if rsaKey, ok = key.(*rsa.PublicKey); !ok { + return newError("RSA verify expects *rsa.PublicKey", ErrInvalidKeyType) + } + + // Create hasher + if !m.Hash.Available() { + return ErrHashUnavailable + } + hasher := m.Hash.New() + hasher.Write([]byte(signingString)) + + // Verify the signature + return rsa.VerifyPKCS1v15(rsaKey, m.Hash, hasher.Sum(nil), sig) +} + +// Sign implements token signing for the SigningMethod +// For this signing method, must be an *rsa.PrivateKey structure. +func (m *SigningMethodRSA) Sign(signingString string, key interface{}) ([]byte, error) { + var rsaKey *rsa.PrivateKey + var ok bool + + // Validate type of key + if rsaKey, ok = key.(*rsa.PrivateKey); !ok { + return nil, newError("RSA sign expects *rsa.PrivateKey", ErrInvalidKeyType) + } + + // Create the hasher + if !m.Hash.Available() { + return nil, ErrHashUnavailable + } + + hasher := m.Hash.New() + hasher.Write([]byte(signingString)) + + // Sign the string and return the encoded bytes + if sigBytes, err := rsa.SignPKCS1v15(rand.Reader, rsaKey, m.Hash, hasher.Sum(nil)); err == nil { + return sigBytes, nil + } else { + return nil, err + } +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/rsa_pss.go b/vendor/github.com/golang-jwt/jwt/v5/rsa_pss.go new file mode 100644 index 000000000..28c386ec4 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/rsa_pss.go @@ -0,0 +1,135 @@ +//go:build go1.4 +// +build go1.4 + +package jwt + +import ( + "crypto" + "crypto/rand" + "crypto/rsa" +) + +// SigningMethodRSAPSS implements the RSAPSS family of signing methods signing methods +type SigningMethodRSAPSS struct { + *SigningMethodRSA + Options *rsa.PSSOptions + // VerifyOptions is optional. If set overrides Options for rsa.VerifyPPS. + // Used to accept tokens signed with rsa.PSSSaltLengthAuto, what doesn't follow + // https://tools.ietf.org/html/rfc7518#section-3.5 but was used previously. + // See https://github.com/dgrijalva/jwt-go/issues/285#issuecomment-437451244 for details. + VerifyOptions *rsa.PSSOptions +} + +// Specific instances for RS/PS and company. +var ( + SigningMethodPS256 *SigningMethodRSAPSS + SigningMethodPS384 *SigningMethodRSAPSS + SigningMethodPS512 *SigningMethodRSAPSS +) + +func init() { + // PS256 + SigningMethodPS256 = &SigningMethodRSAPSS{ + SigningMethodRSA: &SigningMethodRSA{ + Name: "PS256", + Hash: crypto.SHA256, + }, + Options: &rsa.PSSOptions{ + SaltLength: rsa.PSSSaltLengthEqualsHash, + }, + VerifyOptions: &rsa.PSSOptions{ + SaltLength: rsa.PSSSaltLengthAuto, + }, + } + RegisterSigningMethod(SigningMethodPS256.Alg(), func() SigningMethod { + return SigningMethodPS256 + }) + + // PS384 + SigningMethodPS384 = &SigningMethodRSAPSS{ + SigningMethodRSA: &SigningMethodRSA{ + Name: "PS384", + Hash: crypto.SHA384, + }, + Options: &rsa.PSSOptions{ + SaltLength: rsa.PSSSaltLengthEqualsHash, + }, + VerifyOptions: &rsa.PSSOptions{ + SaltLength: rsa.PSSSaltLengthAuto, + }, + } + RegisterSigningMethod(SigningMethodPS384.Alg(), func() SigningMethod { + return SigningMethodPS384 + }) + + // PS512 + SigningMethodPS512 = &SigningMethodRSAPSS{ + SigningMethodRSA: &SigningMethodRSA{ + Name: "PS512", + Hash: crypto.SHA512, + }, + Options: &rsa.PSSOptions{ + SaltLength: rsa.PSSSaltLengthEqualsHash, + }, + VerifyOptions: &rsa.PSSOptions{ + SaltLength: rsa.PSSSaltLengthAuto, + }, + } + RegisterSigningMethod(SigningMethodPS512.Alg(), func() SigningMethod { + return SigningMethodPS512 + }) +} + +// Verify implements token verification for the SigningMethod. +// For this verify method, key must be an rsa.PublicKey struct +func (m *SigningMethodRSAPSS) Verify(signingString string, sig []byte, key interface{}) error { + var rsaKey *rsa.PublicKey + switch k := key.(type) { + case *rsa.PublicKey: + rsaKey = k + default: + return newError("RSA-PSS verify expects *rsa.PublicKey", ErrInvalidKeyType) + } + + // Create hasher + if !m.Hash.Available() { + return ErrHashUnavailable + } + hasher := m.Hash.New() + hasher.Write([]byte(signingString)) + + opts := m.Options + if m.VerifyOptions != nil { + opts = m.VerifyOptions + } + + return rsa.VerifyPSS(rsaKey, m.Hash, hasher.Sum(nil), sig, opts) +} + +// Sign implements token signing for the SigningMethod. +// For this signing method, key must be an rsa.PrivateKey struct +func (m *SigningMethodRSAPSS) Sign(signingString string, key interface{}) ([]byte, error) { + var rsaKey *rsa.PrivateKey + + switch k := key.(type) { + case *rsa.PrivateKey: + rsaKey = k + default: + return nil, newError("RSA-PSS sign expects *rsa.PrivateKey", ErrInvalidKeyType) + } + + // Create the hasher + if !m.Hash.Available() { + return nil, ErrHashUnavailable + } + + hasher := m.Hash.New() + hasher.Write([]byte(signingString)) + + // Sign the string and return the encoded bytes + if sigBytes, err := rsa.SignPSS(rand.Reader, rsaKey, m.Hash, hasher.Sum(nil), m.Options); err == nil { + return sigBytes, nil + } else { + return nil, err + } +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/rsa_utils.go b/vendor/github.com/golang-jwt/jwt/v5/rsa_utils.go new file mode 100644 index 000000000..b3aeebbe1 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/rsa_utils.go @@ -0,0 +1,107 @@ +package jwt + +import ( + "crypto/rsa" + "crypto/x509" + "encoding/pem" + "errors" +) + +var ( + ErrKeyMustBePEMEncoded = errors.New("invalid key: Key must be a PEM encoded PKCS1 or PKCS8 key") + ErrNotRSAPrivateKey = errors.New("key is not a valid RSA private key") + ErrNotRSAPublicKey = errors.New("key is not a valid RSA public key") +) + +// ParseRSAPrivateKeyFromPEM parses a PEM encoded PKCS1 or PKCS8 private key +func ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error) { + var err error + + // Parse PEM block + var block *pem.Block + if block, _ = pem.Decode(key); block == nil { + return nil, ErrKeyMustBePEMEncoded + } + + var parsedKey interface{} + if parsedKey, err = x509.ParsePKCS1PrivateKey(block.Bytes); err != nil { + if parsedKey, err = x509.ParsePKCS8PrivateKey(block.Bytes); err != nil { + return nil, err + } + } + + var pkey *rsa.PrivateKey + var ok bool + if pkey, ok = parsedKey.(*rsa.PrivateKey); !ok { + return nil, ErrNotRSAPrivateKey + } + + return pkey, nil +} + +// ParseRSAPrivateKeyFromPEMWithPassword parses a PEM encoded PKCS1 or PKCS8 private key protected with password +// +// Deprecated: This function is deprecated and should not be used anymore. It uses the deprecated x509.DecryptPEMBlock +// function, which was deprecated since RFC 1423 is regarded insecure by design. Unfortunately, there is no alternative +// in the Go standard library for now. See https://github.com/golang/go/issues/8860. +func ParseRSAPrivateKeyFromPEMWithPassword(key []byte, password string) (*rsa.PrivateKey, error) { + var err error + + // Parse PEM block + var block *pem.Block + if block, _ = pem.Decode(key); block == nil { + return nil, ErrKeyMustBePEMEncoded + } + + var parsedKey interface{} + + var blockDecrypted []byte + if blockDecrypted, err = x509.DecryptPEMBlock(block, []byte(password)); err != nil { + return nil, err + } + + if parsedKey, err = x509.ParsePKCS1PrivateKey(blockDecrypted); err != nil { + if parsedKey, err = x509.ParsePKCS8PrivateKey(blockDecrypted); err != nil { + return nil, err + } + } + + var pkey *rsa.PrivateKey + var ok bool + if pkey, ok = parsedKey.(*rsa.PrivateKey); !ok { + return nil, ErrNotRSAPrivateKey + } + + return pkey, nil +} + +// ParseRSAPublicKeyFromPEM parses a certificate or a PEM encoded PKCS1 or PKIX public key +func ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error) { + var err error + + // Parse PEM block + var block *pem.Block + if block, _ = pem.Decode(key); block == nil { + return nil, ErrKeyMustBePEMEncoded + } + + // Parse the key + var parsedKey interface{} + if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil { + if cert, err := x509.ParseCertificate(block.Bytes); err == nil { + parsedKey = cert.PublicKey + } else { + if parsedKey, err = x509.ParsePKCS1PublicKey(block.Bytes); err != nil { + return nil, err + } + } + } + + var pkey *rsa.PublicKey + var ok bool + if pkey, ok = parsedKey.(*rsa.PublicKey); !ok { + return nil, ErrNotRSAPublicKey + } + + return pkey, nil +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/signing_method.go b/vendor/github.com/golang-jwt/jwt/v5/signing_method.go new file mode 100644 index 000000000..0d73631c1 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/signing_method.go @@ -0,0 +1,49 @@ +package jwt + +import ( + "sync" +) + +var signingMethods = map[string]func() SigningMethod{} +var signingMethodLock = new(sync.RWMutex) + +// SigningMethod can be used add new methods for signing or verifying tokens. It +// takes a decoded signature as an input in the Verify function and produces a +// signature in Sign. The signature is then usually base64 encoded as part of a +// JWT. +type SigningMethod interface { + Verify(signingString string, sig []byte, key interface{}) error // Returns nil if signature is valid + Sign(signingString string, key interface{}) ([]byte, error) // Returns signature or error + Alg() string // returns the alg identifier for this method (example: 'HS256') +} + +// RegisterSigningMethod registers the "alg" name and a factory function for signing method. +// This is typically done during init() in the method's implementation +func RegisterSigningMethod(alg string, f func() SigningMethod) { + signingMethodLock.Lock() + defer signingMethodLock.Unlock() + + signingMethods[alg] = f +} + +// GetSigningMethod retrieves a signing method from an "alg" string +func GetSigningMethod(alg string) (method SigningMethod) { + signingMethodLock.RLock() + defer signingMethodLock.RUnlock() + + if methodF, ok := signingMethods[alg]; ok { + method = methodF() + } + return +} + +// GetAlgorithms returns a list of registered "alg" names +func GetAlgorithms() (algs []string) { + signingMethodLock.RLock() + defer signingMethodLock.RUnlock() + + for alg := range signingMethods { + algs = append(algs, alg) + } + return +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/staticcheck.conf b/vendor/github.com/golang-jwt/jwt/v5/staticcheck.conf new file mode 100644 index 000000000..53745d51d --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/staticcheck.conf @@ -0,0 +1 @@ +checks = ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1023"] diff --git a/vendor/github.com/golang-jwt/jwt/v5/token.go b/vendor/github.com/golang-jwt/jwt/v5/token.go new file mode 100644 index 000000000..352873a2d --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/token.go @@ -0,0 +1,100 @@ +package jwt + +import ( + "crypto" + "encoding/base64" + "encoding/json" +) + +// Keyfunc will be used by the Parse methods as a callback function to supply +// the key for verification. The function receives the parsed, but unverified +// Token. This allows you to use properties in the Header of the token (such as +// `kid`) to identify which key to use. +// +// The returned interface{} may be a single key or a VerificationKeySet containing +// multiple keys. +type Keyfunc func(*Token) (interface{}, error) + +// VerificationKey represents a public or secret key for verifying a token's signature. +type VerificationKey interface { + crypto.PublicKey | []uint8 +} + +// VerificationKeySet is a set of public or secret keys. It is used by the parser to verify a token. +type VerificationKeySet struct { + Keys []VerificationKey +} + +// Token represents a JWT Token. Different fields will be used depending on +// whether you're creating or parsing/verifying a token. +type Token struct { + Raw string // Raw contains the raw token. Populated when you [Parse] a token + Method SigningMethod // Method is the signing method used or to be used + Header map[string]interface{} // Header is the first segment of the token in decoded form + Claims Claims // Claims is the second segment of the token in decoded form + Signature []byte // Signature is the third segment of the token in decoded form. Populated when you Parse a token + Valid bool // Valid specifies if the token is valid. Populated when you Parse/Verify a token +} + +// New creates a new [Token] with the specified signing method and an empty map +// of claims. Additional options can be specified, but are currently unused. +func New(method SigningMethod, opts ...TokenOption) *Token { + return NewWithClaims(method, MapClaims{}, opts...) +} + +// NewWithClaims creates a new [Token] with the specified signing method and +// claims. Additional options can be specified, but are currently unused. +func NewWithClaims(method SigningMethod, claims Claims, opts ...TokenOption) *Token { + return &Token{ + Header: map[string]interface{}{ + "typ": "JWT", + "alg": method.Alg(), + }, + Claims: claims, + Method: method, + } +} + +// SignedString creates and returns a complete, signed JWT. The token is signed +// using the SigningMethod specified in the token. Please refer to +// https://golang-jwt.github.io/jwt/usage/signing_methods/#signing-methods-and-key-types +// for an overview of the different signing methods and their respective key +// types. +func (t *Token) SignedString(key interface{}) (string, error) { + sstr, err := t.SigningString() + if err != nil { + return "", err + } + + sig, err := t.Method.Sign(sstr, key) + if err != nil { + return "", err + } + + return sstr + "." + t.EncodeSegment(sig), nil +} + +// SigningString generates the signing string. This is the most expensive part +// of the whole deal. Unless you need this for something special, just go +// straight for the SignedString. +func (t *Token) SigningString() (string, error) { + h, err := json.Marshal(t.Header) + if err != nil { + return "", err + } + + c, err := json.Marshal(t.Claims) + if err != nil { + return "", err + } + + return t.EncodeSegment(h) + "." + t.EncodeSegment(c), nil +} + +// EncodeSegment encodes a JWT specific base64url encoding with padding +// stripped. In the future, this function might take into account a +// [TokenOption]. Therefore, this function exists as a method of [Token], rather +// than a global function. +func (*Token) EncodeSegment(seg []byte) string { + return base64.RawURLEncoding.EncodeToString(seg) +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/token_option.go b/vendor/github.com/golang-jwt/jwt/v5/token_option.go new file mode 100644 index 000000000..b4ae3badf --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/token_option.go @@ -0,0 +1,5 @@ +package jwt + +// TokenOption is a reserved type, which provides some forward compatibility, +// if we ever want to introduce token creation-related options. +type TokenOption func(*Token) diff --git a/vendor/github.com/golang-jwt/jwt/v5/types.go b/vendor/github.com/golang-jwt/jwt/v5/types.go new file mode 100644 index 000000000..b2655a9e6 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/types.go @@ -0,0 +1,149 @@ +package jwt + +import ( + "encoding/json" + "fmt" + "math" + "strconv" + "time" +) + +// TimePrecision sets the precision of times and dates within this library. This +// has an influence on the precision of times when comparing expiry or other +// related time fields. Furthermore, it is also the precision of times when +// serializing. +// +// For backwards compatibility the default precision is set to seconds, so that +// no fractional timestamps are generated. +var TimePrecision = time.Second + +// MarshalSingleStringAsArray modifies the behavior of the ClaimStrings type, +// especially its MarshalJSON function. +// +// If it is set to true (the default), it will always serialize the type as an +// array of strings, even if it just contains one element, defaulting to the +// behavior of the underlying []string. If it is set to false, it will serialize +// to a single string, if it contains one element. Otherwise, it will serialize +// to an array of strings. +var MarshalSingleStringAsArray = true + +// NumericDate represents a JSON numeric date value, as referenced at +// https://datatracker.ietf.org/doc/html/rfc7519#section-2. +type NumericDate struct { + time.Time +} + +// NewNumericDate constructs a new *NumericDate from a standard library time.Time struct. +// It will truncate the timestamp according to the precision specified in TimePrecision. +func NewNumericDate(t time.Time) *NumericDate { + return &NumericDate{t.Truncate(TimePrecision)} +} + +// newNumericDateFromSeconds creates a new *NumericDate out of a float64 representing a +// UNIX epoch with the float fraction representing non-integer seconds. +func newNumericDateFromSeconds(f float64) *NumericDate { + round, frac := math.Modf(f) + return NewNumericDate(time.Unix(int64(round), int64(frac*1e9))) +} + +// MarshalJSON is an implementation of the json.RawMessage interface and serializes the UNIX epoch +// represented in NumericDate to a byte array, using the precision specified in TimePrecision. +func (date NumericDate) MarshalJSON() (b []byte, err error) { + var prec int + if TimePrecision < time.Second { + prec = int(math.Log10(float64(time.Second) / float64(TimePrecision))) + } + truncatedDate := date.Truncate(TimePrecision) + + // For very large timestamps, UnixNano would overflow an int64, but this + // function requires nanosecond level precision, so we have to use the + // following technique to get round the issue: + // + // 1. Take the normal unix timestamp to form the whole number part of the + // output, + // 2. Take the result of the Nanosecond function, which returns the offset + // within the second of the particular unix time instance, to form the + // decimal part of the output + // 3. Concatenate them to produce the final result + seconds := strconv.FormatInt(truncatedDate.Unix(), 10) + nanosecondsOffset := strconv.FormatFloat(float64(truncatedDate.Nanosecond())/float64(time.Second), 'f', prec, 64) + + output := append([]byte(seconds), []byte(nanosecondsOffset)[1:]...) + + return output, nil +} + +// UnmarshalJSON is an implementation of the json.RawMessage interface and +// deserializes a [NumericDate] from a JSON representation, i.e. a +// [json.Number]. This number represents an UNIX epoch with either integer or +// non-integer seconds. +func (date *NumericDate) UnmarshalJSON(b []byte) (err error) { + var ( + number json.Number + f float64 + ) + + if err = json.Unmarshal(b, &number); err != nil { + return fmt.Errorf("could not parse NumericData: %w", err) + } + + if f, err = number.Float64(); err != nil { + return fmt.Errorf("could not convert json number value to float: %w", err) + } + + n := newNumericDateFromSeconds(f) + *date = *n + + return nil +} + +// ClaimStrings is basically just a slice of strings, but it can be either +// serialized from a string array or just a string. This type is necessary, +// since the "aud" claim can either be a single string or an array. +type ClaimStrings []string + +func (s *ClaimStrings) UnmarshalJSON(data []byte) (err error) { + var value interface{} + + if err = json.Unmarshal(data, &value); err != nil { + return err + } + + var aud []string + + switch v := value.(type) { + case string: + aud = append(aud, v) + case []string: + aud = ClaimStrings(v) + case []interface{}: + for _, vv := range v { + vs, ok := vv.(string) + if !ok { + return ErrInvalidType + } + aud = append(aud, vs) + } + case nil: + return nil + default: + return ErrInvalidType + } + + *s = aud + + return +} + +func (s ClaimStrings) MarshalJSON() (b []byte, err error) { + // This handles a special case in the JWT RFC. If the string array, e.g. + // used by the "aud" field, only contains one element, it MAY be serialized + // as a single string. This may or may not be desired based on the ecosystem + // of other JWT library used, so we make it configurable by the variable + // MarshalSingleStringAsArray. + if len(s) == 1 && !MarshalSingleStringAsArray { + return json.Marshal(s[0]) + } + + return json.Marshal([]string(s)) +} diff --git a/vendor/github.com/golang-jwt/jwt/v5/validator.go b/vendor/github.com/golang-jwt/jwt/v5/validator.go new file mode 100644 index 000000000..008ecd871 --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v5/validator.go @@ -0,0 +1,316 @@ +package jwt + +import ( + "crypto/subtle" + "fmt" + "time" +) + +// ClaimsValidator is an interface that can be implemented by custom claims who +// wish to execute any additional claims validation based on +// application-specific logic. The Validate function is then executed in +// addition to the regular claims validation and any error returned is appended +// to the final validation result. +// +// type MyCustomClaims struct { +// Foo string `json:"foo"` +// jwt.RegisteredClaims +// } +// +// func (m MyCustomClaims) Validate() error { +// if m.Foo != "bar" { +// return errors.New("must be foobar") +// } +// return nil +// } +type ClaimsValidator interface { + Claims + Validate() error +} + +// Validator is the core of the new Validation API. It is automatically used by +// a [Parser] during parsing and can be modified with various parser options. +// +// The [NewValidator] function should be used to create an instance of this +// struct. +type Validator struct { + // leeway is an optional leeway that can be provided to account for clock skew. + leeway time.Duration + + // timeFunc is used to supply the current time that is needed for + // validation. If unspecified, this defaults to time.Now. + timeFunc func() time.Time + + // requireExp specifies whether the exp claim is required + requireExp bool + + // verifyIat specifies whether the iat (Issued At) claim will be verified. + // According to https://www.rfc-editor.org/rfc/rfc7519#section-4.1.6 this + // only specifies the age of the token, but no validation check is + // necessary. However, if wanted, it can be checked if the iat is + // unrealistic, i.e., in the future. + verifyIat bool + + // expectedAud contains the audience this token expects. Supplying an empty + // string will disable aud checking. + expectedAud string + + // expectedIss contains the issuer this token expects. Supplying an empty + // string will disable iss checking. + expectedIss string + + // expectedSub contains the subject this token expects. Supplying an empty + // string will disable sub checking. + expectedSub string +} + +// NewValidator can be used to create a stand-alone validator with the supplied +// options. This validator can then be used to validate already parsed claims. +// +// Note: Under normal circumstances, explicitly creating a validator is not +// needed and can potentially be dangerous; instead functions of the [Parser] +// class should be used. +// +// The [Validator] is only checking the *validity* of the claims, such as its +// expiration time, but it does NOT perform *signature verification* of the +// token. +func NewValidator(opts ...ParserOption) *Validator { + p := NewParser(opts...) + return p.validator +} + +// Validate validates the given claims. It will also perform any custom +// validation if claims implements the [ClaimsValidator] interface. +// +// Note: It will NOT perform any *signature verification* on the token that +// contains the claims and expects that the [Claim] was already successfully +// verified. +func (v *Validator) Validate(claims Claims) error { + var ( + now time.Time + errs []error = make([]error, 0, 6) + err error + ) + + // Check, if we have a time func + if v.timeFunc != nil { + now = v.timeFunc() + } else { + now = time.Now() + } + + // We always need to check the expiration time, but usage of the claim + // itself is OPTIONAL by default. requireExp overrides this behavior + // and makes the exp claim mandatory. + if err = v.verifyExpiresAt(claims, now, v.requireExp); err != nil { + errs = append(errs, err) + } + + // We always need to check not-before, but usage of the claim itself is + // OPTIONAL. + if err = v.verifyNotBefore(claims, now, false); err != nil { + errs = append(errs, err) + } + + // Check issued-at if the option is enabled + if v.verifyIat { + if err = v.verifyIssuedAt(claims, now, false); err != nil { + errs = append(errs, err) + } + } + + // If we have an expected audience, we also require the audience claim + if v.expectedAud != "" { + if err = v.verifyAudience(claims, v.expectedAud, true); err != nil { + errs = append(errs, err) + } + } + + // If we have an expected issuer, we also require the issuer claim + if v.expectedIss != "" { + if err = v.verifyIssuer(claims, v.expectedIss, true); err != nil { + errs = append(errs, err) + } + } + + // If we have an expected subject, we also require the subject claim + if v.expectedSub != "" { + if err = v.verifySubject(claims, v.expectedSub, true); err != nil { + errs = append(errs, err) + } + } + + // Finally, we want to give the claim itself some possibility to do some + // additional custom validation based on a custom Validate function. + cvt, ok := claims.(ClaimsValidator) + if ok { + if err := cvt.Validate(); err != nil { + errs = append(errs, err) + } + } + + if len(errs) == 0 { + return nil + } + + return joinErrors(errs...) +} + +// verifyExpiresAt compares the exp claim in claims against cmp. This function +// will succeed if cmp < exp. Additional leeway is taken into account. +// +// If exp is not set, it will succeed if the claim is not required, +// otherwise ErrTokenRequiredClaimMissing will be returned. +// +// Additionally, if any error occurs while retrieving the claim, e.g., when its +// the wrong type, an ErrTokenUnverifiable error will be returned. +func (v *Validator) verifyExpiresAt(claims Claims, cmp time.Time, required bool) error { + exp, err := claims.GetExpirationTime() + if err != nil { + return err + } + + if exp == nil { + return errorIfRequired(required, "exp") + } + + return errorIfFalse(cmp.Before((exp.Time).Add(+v.leeway)), ErrTokenExpired) +} + +// verifyIssuedAt compares the iat claim in claims against cmp. This function +// will succeed if cmp >= iat. Additional leeway is taken into account. +// +// If iat is not set, it will succeed if the claim is not required, +// otherwise ErrTokenRequiredClaimMissing will be returned. +// +// Additionally, if any error occurs while retrieving the claim, e.g., when its +// the wrong type, an ErrTokenUnverifiable error will be returned. +func (v *Validator) verifyIssuedAt(claims Claims, cmp time.Time, required bool) error { + iat, err := claims.GetIssuedAt() + if err != nil { + return err + } + + if iat == nil { + return errorIfRequired(required, "iat") + } + + return errorIfFalse(!cmp.Before(iat.Add(-v.leeway)), ErrTokenUsedBeforeIssued) +} + +// verifyNotBefore compares the nbf claim in claims against cmp. This function +// will return true if cmp >= nbf. Additional leeway is taken into account. +// +// If nbf is not set, it will succeed if the claim is not required, +// otherwise ErrTokenRequiredClaimMissing will be returned. +// +// Additionally, if any error occurs while retrieving the claim, e.g., when its +// the wrong type, an ErrTokenUnverifiable error will be returned. +func (v *Validator) verifyNotBefore(claims Claims, cmp time.Time, required bool) error { + nbf, err := claims.GetNotBefore() + if err != nil { + return err + } + + if nbf == nil { + return errorIfRequired(required, "nbf") + } + + return errorIfFalse(!cmp.Before(nbf.Add(-v.leeway)), ErrTokenNotValidYet) +} + +// verifyAudience compares the aud claim against cmp. +// +// If aud is not set or an empty list, it will succeed if the claim is not required, +// otherwise ErrTokenRequiredClaimMissing will be returned. +// +// Additionally, if any error occurs while retrieving the claim, e.g., when its +// the wrong type, an ErrTokenUnverifiable error will be returned. +func (v *Validator) verifyAudience(claims Claims, cmp string, required bool) error { + aud, err := claims.GetAudience() + if err != nil { + return err + } + + if len(aud) == 0 { + return errorIfRequired(required, "aud") + } + + // use a var here to keep constant time compare when looping over a number of claims + result := false + + var stringClaims string + for _, a := range aud { + if subtle.ConstantTimeCompare([]byte(a), []byte(cmp)) != 0 { + result = true + } + stringClaims = stringClaims + a + } + + // case where "" is sent in one or many aud claims + if stringClaims == "" { + return errorIfRequired(required, "aud") + } + + return errorIfFalse(result, ErrTokenInvalidAudience) +} + +// verifyIssuer compares the iss claim in claims against cmp. +// +// If iss is not set, it will succeed if the claim is not required, +// otherwise ErrTokenRequiredClaimMissing will be returned. +// +// Additionally, if any error occurs while retrieving the claim, e.g., when its +// the wrong type, an ErrTokenUnverifiable error will be returned. +func (v *Validator) verifyIssuer(claims Claims, cmp string, required bool) error { + iss, err := claims.GetIssuer() + if err != nil { + return err + } + + if iss == "" { + return errorIfRequired(required, "iss") + } + + return errorIfFalse(iss == cmp, ErrTokenInvalidIssuer) +} + +// verifySubject compares the sub claim against cmp. +// +// If sub is not set, it will succeed if the claim is not required, +// otherwise ErrTokenRequiredClaimMissing will be returned. +// +// Additionally, if any error occurs while retrieving the claim, e.g., when its +// the wrong type, an ErrTokenUnverifiable error will be returned. +func (v *Validator) verifySubject(claims Claims, cmp string, required bool) error { + sub, err := claims.GetSubject() + if err != nil { + return err + } + + if sub == "" { + return errorIfRequired(required, "sub") + } + + return errorIfFalse(sub == cmp, ErrTokenInvalidSubject) +} + +// errorIfFalse returns the error specified in err, if the value is true. +// Otherwise, nil is returned. +func errorIfFalse(value bool, err error) error { + if value { + return nil + } else { + return err + } +} + +// errorIfRequired returns an ErrTokenRequiredClaimMissing error if required is +// true. Otherwise, nil is returned. +func errorIfRequired(required bool, claim string) error { + if required { + return newError(fmt.Sprintf("%s claim is required", claim), ErrTokenRequiredClaimMissing) + } else { + return nil + } +} diff --git a/vendor/github.com/kfcampbell/ghinstallation/AUTHORS b/vendor/github.com/kfcampbell/ghinstallation/AUTHORS new file mode 100644 index 000000000..88ca0ddd6 --- /dev/null +++ b/vendor/github.com/kfcampbell/ghinstallation/AUTHORS @@ -0,0 +1,6 @@ +Billy Lynch +Bradley Falzon +Philippe Modard +Ricardo Chimal, Jr +Tatsuya Kamohara <17017563+kamontia@users.noreply.github.com> +rob boll diff --git a/vendor/github.com/kfcampbell/ghinstallation/LICENSE b/vendor/github.com/kfcampbell/ghinstallation/LICENSE new file mode 100644 index 000000000..1c508b07b --- /dev/null +++ b/vendor/github.com/kfcampbell/ghinstallation/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2019 ghinstallation AUTHORS + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/kfcampbell/ghinstallation/README.md b/vendor/github.com/kfcampbell/ghinstallation/README.md new file mode 100644 index 000000000..9187123af --- /dev/null +++ b/vendor/github.com/kfcampbell/ghinstallation/README.md @@ -0,0 +1,76 @@ +# ghinstallation + +[![GoDoc](https://godoc.org/github.com/kfcampbell/ghinstallation?status.svg)](https://godoc.org/github.com/kfcampbell/ghinstallation) + +This library is forked from [bradleyfalzon/ghinstallation](https://github.com/bradleyfalzon/ghinstallation), which was created to provide GitHub Apps authentication helpers for [google/go-github](https://github.com/google/go-github). This fork is designed to work with [octokit/go-sdk](https://github.com/octokit/go-sdk). + +`ghinstallation` provides `Transport`, which implements `http.RoundTripper` to +provide authentication as an installation for GitHub Apps. + +See +https://developer.github.com/apps/building-integrations/setting-up-and-registering-github-apps/about-authentication-options-for-github-apps/ + +## Installation + +Get the package: + +```bash +go get -u github.com/kfcampbell/ghinstallation +``` + +## go-sdk example + +See [go-sdk](https://github.com/octokit/go-sdk/blob/apps-poc/cmd/app-example/main.go) examples for instructions on usage with the go-sdk library. + +## Manual usage example + +Create or obtain a transport, then wrap it with an Apps transport using your private key, client ID, and installation ID. + +```go + +existingTransport := http.DefaultTransport + +appTransport, err := ghinstallation.NewKeyFromFile(existingTransport, "your-client-ID", yourInstallationIDInt, "path/to/your/pem/file.pem") +if err != nil { + return nil, fmt.Errorf("failed to create transport from GitHub App using clientID: %v", err) +} +// use the created appTransport in your HttpClient +``` + +### What are client ID, app ID, and installation ID? + +These are fields unique to your application that GitHub uses to identify your App and issue its credentials. Client ID and App ID are interchangeable, and client ID is preferred. Both can be obtained by visiting the App's page > App settings. The URL for your App is "https://github.com/apps/{yourAppName}". + +The App page will look something like this, with the App settings link on the right sidebar: + +![App page](https://github.com/kfcampbell/ghinstallation/assets/9327688/db529326-e994-443e-bef5-98fcf0f5ab20) + +The App settings page will look like this, and allow you to copy the App ID and the client ID: + +![App settings page](https://github.com/kfcampbell/ghinstallation/assets/9327688/dc409378-0fba-45c9-bbbe-6490e967140f) + +The installation ID is specific to an installation of that App to a specific organization or user. You can find it in the URL when viewing an App's installation, when the URL will look something like this: "https://github.com/organizations/{yourAppName}/settings/installations/{installationID}". + +## Customizing signing behavior + +Users can customize signing behavior by passing in a +[Signer](https://pkg.go.dev/github.com/kfcampbell/ghinstallation#Signer) +implementation when creating an +[AppsTransport](https://pkg.go.dev/github.com/kfcampbell/ghinstallation#AppsTransport). +For example, this can be used to create tokens backed by keys in a KMS system. + +```go +signer := &myCustomSigner{ + key: "https://url/to/key/vault", +} +appsTransport := NewAppsTransportWithOptions(http.DefaultTransport, "your-client-ID", WithSigner(signer)) +transport := NewFromAppsTransport(appsTransport, yourInstallationIDInt) +``` + +## License + +[Apache 2.0](LICENSE) + +## Dependencies + +- [github.com/golang-jwt/jwt-go](https://github.com/golang-jwt/jwt-go) diff --git a/vendor/github.com/kfcampbell/ghinstallation/appsTransport.go b/vendor/github.com/kfcampbell/ghinstallation/appsTransport.go new file mode 100644 index 000000000..c9b3d96cf --- /dev/null +++ b/vendor/github.com/kfcampbell/ghinstallation/appsTransport.go @@ -0,0 +1,199 @@ +package ghinstallation + +import ( + "crypto/rsa" + "errors" + "fmt" + "net/http" + "os" + "strconv" + "time" + + jwt "github.com/golang-jwt/jwt/v5" +) + +// AppsTransport provides a http.RoundTripper by wrapping an existing +// http.RoundTripper and provides GitHub Apps authentication as a +// GitHub App. +// +// Client can also be overwritten, and is useful to change to one which +// provides retry logic if you do experience retryable errors. +// +// See https://developer.github.com/apps/building-integrations/setting-up-and-registering-github-apps/about-authentication-options-for-github-apps/ +type AppsTransport struct { + BaseURL string // BaseURL is the scheme and host for GitHub API, defaults to https://api.github.com + Client Client // Client to use to refresh tokens, defaults to http.Client with provided transport + tr http.RoundTripper // tr is the underlying roundtripper being wrapped + signer Signer // signer signs JWT tokens. + appID int64 // appID is the GitHub App's ID. Deprecated: use clientID instead. + clientID string // clientID is the GitHub App's client ID. This is preferred over App ID, and they are interchangeable. +} + +// NewAppsTransportKeyFromFile returns an AppsTransport using a private key from file. +func NewAppsTransportKeyFromFile(tr http.RoundTripper, clientID string, privateKeyFile string) (*AppsTransport, error) { + privateKey, err := os.ReadFile(privateKeyFile) + if err != nil { + return nil, fmt.Errorf("could not read private key: %s", err) + } + return NewAppsTransport(tr, clientID, privateKey) +} + +// NewAppsTransportKeyFromFileWithAppID returns an AppsTransport using a private key from file +// using the appID instead of the clientID. Deprecated: Use NewAppsTransportKeyFromFile instead. +func NewAppsTransportKeyFromFileWithAppID(tr http.RoundTripper, appID int64, privateKeyFile string) (*AppsTransport, error) { + privateKey, err := os.ReadFile(privateKeyFile) + if err != nil { + return nil, fmt.Errorf("could not read private key: %s", err) + } + return NewAppsTransportWithAppId(tr, appID, privateKey) +} + +// NewAppsTransport returns an AppsTransport using private key. The key is parsed +// and if any errors occur the error is non-nil. +// +// The provided tr http.RoundTripper should be shared between multiple +// installations to ensure reuse of underlying TCP connections. +// +// The returned Transport's RoundTrip method is safe to be used concurrently. +func NewAppsTransport(tr http.RoundTripper, clientID string, privateKey []byte) (*AppsTransport, error) { + key, err := jwt.ParseRSAPrivateKeyFromPEM(privateKey) + if err != nil { + return nil, fmt.Errorf("could not parse private key: %s", err) + } + return NewAppsTransportFromPrivateKey(tr, clientID, key), nil +} + +// NewAppsTransportWithAppId returns an AppsTransport using private key when given an appID instead of clientID. +// Deprecated: use NewAppsTransport instead +// The key is parsed +// and if any errors occur the error is non-nil. +// +// The provided tr http.RoundTripper should be shared between multiple +// installations to ensure reuse of underlying TCP connections. +// +// The returned Transport's RoundTrip method is safe to be used concurrently. +func NewAppsTransportWithAppId(tr http.RoundTripper, appID int64, privateKey []byte) (*AppsTransport, error) { + key, err := jwt.ParseRSAPrivateKeyFromPEM(privateKey) + if err != nil { + return nil, fmt.Errorf("could not parse private key: %s", err) + } + return NewAppsTransportFromPrivateKeyWithAppID(tr, appID, key), nil +} + +// NewAppsTransportFromPrivateKey returns an AppsTransport using a crypto/rsa.(*PrivateKey). +func NewAppsTransportFromPrivateKey(tr http.RoundTripper, clientID string, key *rsa.PrivateKey) *AppsTransport { + return &AppsTransport{ + BaseURL: apiBaseURL, + Client: &http.Client{Transport: tr}, + tr: tr, + signer: NewRSASigner(jwt.SigningMethodRS256, key), + clientID: clientID, + } +} + +// NewAppsTransportFromPrivateKeyWithAppID returns an AppsTransport using a crypto/rsa.(*PrivateKey) +// when given an appID instead of a clientID. +// Deprecated: use NewAppsTransportWithPrivateKey instead +func NewAppsTransportFromPrivateKeyWithAppID(tr http.RoundTripper, appID int64, key *rsa.PrivateKey) *AppsTransport { + return &AppsTransport{ + BaseURL: apiBaseURL, + Client: &http.Client{Transport: tr}, + tr: tr, + signer: NewRSASigner(jwt.SigningMethodRS256, key), + appID: appID, + } +} + +// NewAppsTransportWithAppIDWithOptions returns an *AppsTransport configured with the given options. +func NewAppsTransportWithOptions(tr http.RoundTripper, clientID string, opts ...AppsTransportOption) (*AppsTransport, error) { + t := &AppsTransport{ + BaseURL: apiBaseURL, + Client: &http.Client{Transport: tr}, + tr: tr, + clientID: clientID, + } + for _, fn := range opts { + fn(t) + } + + if t.signer == nil { + return nil, errors.New("no signer provided") + } + + return t, nil +} + +// NewAppsTransportWithAppIDWithOptions returns an *AppsTransport configured with the given options +// when given an appID instead of a clientID. +// Deprecated: use NewAppsTransportWithAppIDWithOptions instead +func NewAppsTransportWithAppIDWithOptions(tr http.RoundTripper, appID int64, opts ...AppsTransportOption) (*AppsTransport, error) { + t := &AppsTransport{ + BaseURL: apiBaseURL, + Client: &http.Client{Transport: tr}, + tr: tr, + appID: appID, + } + for _, fn := range opts { + fn(t) + } + + if t.signer == nil { + return nil, errors.New("no signer provided") + } + + return t, nil +} + +// RoundTrip implements http.RoundTripper interface. +func (t *AppsTransport) RoundTrip(req *http.Request) (*http.Response, error) { + // GitHub rejects expiry and issue timestamps that are not an integer, + // while the jwt-go library serializes to fractional timestamps. + // Truncate them before passing to jwt-go. + iss := time.Now().Add(-30 * time.Second).Truncate(time.Second) + exp := iss.Add(10 * time.Minute) + + // prefer clientID when given, fall back to appID when not + // TODO(kfcampbell): add test coverage for this behavior + issuer := t.clientID + if issuer == "" { + issuer = strconv.FormatInt(t.appID, 10) + } + + claims := &jwt.RegisteredClaims{ + IssuedAt: jwt.NewNumericDate(iss), + ExpiresAt: jwt.NewNumericDate(exp), + Issuer: issuer, + } + + ss, err := t.signer.Sign(claims) + if err != nil { + return nil, fmt.Errorf("could not sign jwt: %s", err) + } + + req.Header.Set("Authorization", "Bearer "+ss) + req.Header.Add("Accept", acceptHeader) + + resp, err := t.tr.RoundTrip(req) + return resp, err +} + +// AppID returns the appID of the transport +// Deprecated: prefer ClientID where possible +func (t *AppsTransport) AppID() int64 { + return t.appID +} + +// ClientID returns the clientID of the transport +func (t *AppsTransport) ClientID() string { + return t.clientID +} + +// AppsTransportOption is a functional option for configuring an AppsTransport +type AppsTransportOption func(*AppsTransport) + +// WithSigner configures the AppsTransport to use the given Signer for generating JWT tokens. +func WithSigner(signer Signer) AppsTransportOption { + return func(at *AppsTransport) { + at.signer = signer + } +} diff --git a/vendor/github.com/kfcampbell/ghinstallation/installation_token_options.go b/vendor/github.com/kfcampbell/ghinstallation/installation_token_options.go new file mode 100644 index 000000000..06f09d883 --- /dev/null +++ b/vendor/github.com/kfcampbell/ghinstallation/installation_token_options.go @@ -0,0 +1,22 @@ +package ghinstallation + +import ( + gh "github.com/octokit/go-sdk/pkg/github/models" +) + +// InstallationTokenOptions allow restricting a token's access to specific repositories. +// These options are taken from google/go-github's implementation. +// See more at https://github.com/google/go-github/blob/8c1232a5960307a6383998e1aa2dd71711343810/github/apps.go +type InstallationTokenOptions struct { + // The IDs of the repositories that the installation token can access. + // Providing repository IDs restricts the access of an installation token to specific repositories. + RepositoryIDs []int64 `json:"repository_ids,omitempty"` + + // The names of the repositories that the installation token can access. + // Providing repository names restricts the access of an installation token to specific repositories. + Repositories []string `json:"repositories,omitempty"` + + // The permissions granted to the access token. + // The permissions object includes the permission names and their access type. + Permissions *gh.AppPermissions `json:"permissions,omitempty"` +} diff --git a/vendor/github.com/kfcampbell/ghinstallation/sign.go b/vendor/github.com/kfcampbell/ghinstallation/sign.go new file mode 100644 index 000000000..e626a6089 --- /dev/null +++ b/vendor/github.com/kfcampbell/ghinstallation/sign.go @@ -0,0 +1,33 @@ +package ghinstallation + +import ( + "crypto/rsa" + + jwt "github.com/golang-jwt/jwt/v5" +) + +// Signer is a JWT token signer. This is a wrapper around [jwt.SigningMethod] with predetermined +// key material. +type Signer interface { + // Sign signs the given claims and returns a JWT token string, as specified + // by [jwt.Token.SignedString] + Sign(claims jwt.Claims) (string, error) +} + +// RSASigner signs JWT tokens using RSA keys. +type RSASigner struct { + method *jwt.SigningMethodRSA + key *rsa.PrivateKey +} + +func NewRSASigner(method *jwt.SigningMethodRSA, key *rsa.PrivateKey) *RSASigner { + return &RSASigner{ + method: method, + key: key, + } +} + +// Sign signs the JWT claims with the RSA key. +func (s *RSASigner) Sign(claims jwt.Claims) (string, error) { + return jwt.NewWithClaims(s.method, claims).SignedString(s.key) +} diff --git a/vendor/github.com/kfcampbell/ghinstallation/transport.go b/vendor/github.com/kfcampbell/ghinstallation/transport.go new file mode 100644 index 000000000..3491c4dc6 --- /dev/null +++ b/vendor/github.com/kfcampbell/ghinstallation/transport.go @@ -0,0 +1,312 @@ +package ghinstallation + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "os" + "strings" + "sync" + "time" + + gh "github.com/octokit/go-sdk/pkg/github/models" +) + +const ( + acceptHeader = "application/vnd.github.v3+json" + apiBaseURL = "https://api.github.com" +) + +// Transport provides a http.RoundTripper by wrapping an existing +// http.RoundTripper and provides GitHub Apps authentication as an +// installation. +// +// Client can also be overwritten, and is useful to change to one which +// provides retry logic if you do experience retryable errors. +// +// See https://developer.github.com/apps/building-integrations/setting-up-and-registering-github-apps/about-authentication-options-for-github-apps/ +type Transport struct { + BaseURL string // BaseURL is the scheme and host for GitHub API, defaults to https://api.github.com + Client Client // Client to use to refresh tokens, defaults to http.Client with provided transport + tr http.RoundTripper // tr is the underlying roundtripper being wrapped + appID int64 // appID is the GitHub App's ID. Deprecated: use clientID instead. + clientID string // clientID is the GitHub App's client ID. This is preferred over App ID, and they are interchangeable. + installationID int64 // installationID is the GitHub App Installation ID + InstallationTokenOptions *InstallationTokenOptions // parameters restrict a token's access + appsTransport *AppsTransport + + mu *sync.Mutex // mu protects token + token *accessToken // token is the installation's access token +} + +// accessToken is an installation access token response from GitHub +type accessToken struct { + Token string `json:"token"` + ExpiresAt time.Time `json:"expires_at"` + Permissions gh.AppPermissions `json:"permissions,omitempty"` + Repositories []gh.Repository `json:"repositories,omitempty"` +} + +// HTTPError represents a custom error for failing HTTP operations. +// Example in our usecase: refresh access token operation. +// It enables the caller to inspect the root cause and response. +type HTTPError struct { + Message string + RootCause error + InstallationID int64 + Response *http.Response +} + +func (e *HTTPError) Error() string { + return e.Message +} + +// Unwrap implements the standard library's error wrapping. It unwraps to the root cause. +func (e *HTTPError) Unwrap() error { + return e.RootCause +} + +var _ http.RoundTripper = &Transport{} + +// NewKeyFromFile returns a Transport using a private key from file. +func NewKeyFromFile(tr http.RoundTripper, clientID string, installationID int64, privateKeyFile string) (*Transport, error) { + privateKey, err := os.ReadFile(privateKeyFile) + if err != nil { + return nil, fmt.Errorf("could not read private key: %s", err) + } + return NewTransport(tr, clientID, installationID, privateKey) +} + +// NewKeyFromFileWithAppID returns a Transport using a private key from file when given an appID. +// Deprecated: use NewKeyFromFile instead. +func NewKeyFromFileWithAppID(tr http.RoundTripper, appID, installationID int64, privateKeyFile string) (*Transport, error) { + privateKey, err := os.ReadFile(privateKeyFile) + if err != nil { + return nil, fmt.Errorf("could not read private key: %s", err) + } + return NewTransportFromAppID(tr, appID, installationID, privateKey) +} + +// Client is a HTTP client which sends a http.Request and returns a http.Response +// or an error. +type Client interface { + Do(*http.Request) (*http.Response, error) +} + +// NewTransport returns an Transport using private key. The key is parsed +// and if any errors occur the error is non-nil. +// +// The provided tr http.RoundTripper should be shared between multiple +// installations to ensure reuse of underlying TCP connections. +// +// The returned Transport's RoundTrip method is safe to be used concurrently. +// Deprecated: Use NewTransport instead. +func NewTransport(tr http.RoundTripper, clientID string, installationID int64, privateKey []byte) (*Transport, error) { + atr, err := NewAppsTransport(tr, clientID, privateKey) + if err != nil { + return nil, err + } + return NewFromAppsTransport(atr, installationID), nil +} + +// NewTransportFromAppID returns an Transport using private key when given an appID instead of a clientID. +// Deprecated: Use NewTransport instead. +// The key is parsed +// and if any errors occur the error is non-nil. +// +// The provided tr http.RoundTripper should be shared between multiple +// installations to ensure reuse of underlying TCP connections. +// +// The returned Transport's RoundTrip method is safe to be used concurrently. +func NewTransportFromAppID(tr http.RoundTripper, appID, installationID int64, privateKey []byte) (*Transport, error) { + atr, err := NewAppsTransportWithAppId(tr, appID, privateKey) + if err != nil { + return nil, err + } + + return NewFromAppsTransport(atr, installationID), nil +} + +// NewFromAppsTransport returns a Transport using an existing *AppsTransport. +func NewFromAppsTransport(atr *AppsTransport, installationID int64) *Transport { + return &Transport{ + BaseURL: atr.BaseURL, + Client: &http.Client{Transport: atr.tr}, + tr: atr.tr, + appID: atr.appID, + clientID: atr.clientID, + installationID: installationID, + appsTransport: atr, + mu: &sync.Mutex{}, + } +} + +// RoundTrip implements http.RoundTripper interface. +func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { + reqBodyClosed := false + if req.Body != nil { + defer func() { + if !reqBodyClosed { + req.Body.Close() + } + }() + } + + token, err := t.Token(req.Context()) + if err != nil { + return nil, err + } + + creq := cloneRequest(req) // per RoundTripper contract + creq.Header.Set("Authorization", "token "+token) + + if creq.Header.Get("Accept") == "" { // We only add an "Accept" header to avoid overwriting the expected behavior. + creq.Header.Add("Accept", acceptHeader) + } + reqBodyClosed = true // req.Body is assumed to be closed by the tr RoundTripper. + resp, err := t.tr.RoundTrip(creq) + return resp, err +} + +func (at *accessToken) getRefreshTime() time.Time { + return at.ExpiresAt.Add(-time.Minute) +} + +func (at *accessToken) isExpired() bool { + return at == nil || at.getRefreshTime().Before(time.Now()) +} + +// Token checks the active token expiration and renews if necessary. Token returns +// a valid access token. If renewal fails an error is returned. +func (t *Transport) Token(ctx context.Context) (string, error) { + t.mu.Lock() + defer t.mu.Unlock() + if t.token.isExpired() { + // Token is not set or expired/nearly expired, so refresh + if err := t.refreshToken(ctx); err != nil { + return "", fmt.Errorf("could not refresh installation id %v's token: %w", t.installationID, err) + } + } + + return t.token.Token, nil +} + +// Permissions returns a transport token's GitHub installation permissions. +func (t *Transport) Permissions() (gh.AppPermissions, error) { + if t.token == nil { + return gh.AppPermissions{}, fmt.Errorf("Permissions() = nil, err: nil token") + } + return t.token.Permissions, nil +} + +// Repositories returns a transport token's GitHub repositories. +func (t *Transport) Repositories() ([]gh.Repository, error) { + if t.token == nil { + return nil, fmt.Errorf("Repositories() = nil, err: nil token") + } + return t.token.Repositories, nil +} + +// Expiry returns a transport token's expiration time and refresh time. There is a small grace period +// built in where a token will be refreshed before it expires. expiresAt is the actual token expiry, +// and refreshAt is when a call to Token() will cause it to be refreshed. +func (t *Transport) Expiry() (expiresAt time.Time, refreshAt time.Time, err error) { + if t.token == nil { + return time.Time{}, time.Time{}, errors.New("Expiry() = unknown, err: nil token") + } + return t.token.ExpiresAt, t.token.getRefreshTime(), nil +} + +// AppID returns the app ID associated with the transport +// Deprecated: use ClientID instead +func (t *Transport) AppID() int64 { + return t.appID +} + +// ClientID returns the clientID associated with the transport +func (t *Transport) ClientID() string { + return t.clientID +} + +// InstallationID returns the installation ID associated with the transport +func (t *Transport) InstallationID() int64 { + return t.installationID +} + +func (t *Transport) refreshToken(ctx context.Context) error { + // Convert InstallationTokenOptions into a ReadWriter to pass as an argument to http.NewRequest. + body, err := GetReadWriter(t.InstallationTokenOptions) + if err != nil { + return fmt.Errorf("could not convert installation token parameters into json: %s", err) + } + + requestURL := fmt.Sprintf("%s/app/installations/%v/access_tokens", strings.TrimRight(t.BaseURL, "/"), t.installationID) + req, err := http.NewRequest("POST", requestURL, body) + if err != nil { + return fmt.Errorf("could not create request: %s", err) + } + + // Set Content and Accept headers. + if body != nil { + req.Header.Set("Content-Type", "application/json") + } + req.Header.Set("Accept", acceptHeader) + + if ctx != nil { + req = req.WithContext(ctx) + } + + t.appsTransport.BaseURL = t.BaseURL + t.appsTransport.Client = t.Client + resp, err := t.appsTransport.RoundTrip(req) + e := &HTTPError{ + RootCause: err, + InstallationID: t.installationID, + Response: resp, + } + if err != nil { + e.Message = fmt.Sprintf("could not get access_tokens from GitHub API for installation ID %v: %v", t.installationID, err) + return e + } + + if resp.StatusCode/100 != 2 { + e.Message = fmt.Sprintf("received non 2xx response status %q when fetching %v", resp.Status, req.URL) + return e + } + // Closing body late, to provide caller a chance to inspect body in an error / non-200 response status situation + defer resp.Body.Close() + + return json.NewDecoder(resp.Body).Decode(&t.token) +} + +// GetReadWriter converts a body interface into an io.ReadWriter object. +func GetReadWriter(i interface{}) (io.ReadWriter, error) { + var buf io.ReadWriter + if i != nil { + buf = new(bytes.Buffer) + enc := json.NewEncoder(buf) + err := enc.Encode(i) + if err != nil { + return nil, err + } + } + return buf, nil +} + +// cloneRequest returns a clone of the provided *http.Request. +// The clone is a shallow copy of the struct and its Header map. +func cloneRequest(r *http.Request) *http.Request { + // shallow copy of the struct + r2 := new(http.Request) + *r2 = *r + // deep copy of the Header + r2.Header = make(http.Header, len(r.Header)) + for k, s := range r.Header { + r2.Header[k] = append([]string(nil), s...) + } + return r2 +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/.gitignore b/vendor/github.com/microsoft/kiota-abstractions-go/.gitignore new file mode 100644 index 000000000..91b6d9f05 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/.gitignore @@ -0,0 +1,17 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +.idea diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/CHANGELOG.md b/vendor/github.com/microsoft/kiota-abstractions-go/CHANGELOG.md new file mode 100644 index 000000000..5c88ff0a9 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/CHANGELOG.md @@ -0,0 +1,301 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added + +### Changed + +## [1.8.0] - 2024-02-29 + +### Added + +- Added support for untyped nodes. (https://github.com/microsoft/kiota/pull/4095) + +## [1.5.6] - 2024-01-18 + +### Changed + +- The input contains http or https which function will return an error. [#130](https://github.com/microsoft/kiota-abstractions-go/issues/130) + +## [1.5.5] - 2024-01-17 + +### Changed + +- Fixed a bug where reseting properties to null would be impossible with the in memory backing store. [microsoftgraph/msgraph-sdk-go#643](https://github.com/microsoftgraph/msgraph-sdk-go/issues/643) + +## [1.5.4] - 2024-01-16 + +### Changed + +- Fix bug where empty string query parameters are added to the request. [#133](https://github.com/microsoft/kiota-abstractions-go/issues/133) + +## [1.5.3] - 2023-11-24 + +### Added + +- Added support for multi valued query and path parameters of type other than string. [#124](https://github.com/microsoft/kiota-abstractions-go/pull/124) + +## [1.5.2] - 2023-11-22 + +### Added + +- Added ApiErrorable interface. [microsoft/kiota-http-go#110](https://github.com/microsoft/kiota-http-go/issues/110) + +## [1.5.1] - 2023-11-15 + +### Added + +- Added support for query an path parameters of enum type. [microsoft/kiota#3693](https://github.com/microsoft/kiota/issues/3693) + +## [1.5.0] - 2023-11-08 + +### Added + +- Added request information methods to reduce the amount of generated code. + +## [1.4.0] - 2023-11-01 + +### Added + +- Added serialization helpers. [microsoft/kiota#3406](https://github.com/microsoft/kiota/issues/3406) + +## [1.3.1] - 2023-10-31 + +### Changed + +- Fixed an issue where query parameters of type array of anything else than string would not be expanded properly. [#114](https://github.com/microsoft/kiota-abstractions-go/issues/114) + +## [1.3.0] - 2023-10-12 + +### Added + +- Added an overload method to set binary content with their content type. + +## [1.2.3] - 2023-10-05 + +### Added + +- A tryAdd method to RequestHeaders + +## [1.2.2] - 2023-09-21 + +### Changed + +- Switched the RFC 6570 implementation to std-uritemplate + +## [1.2.1] - 2023-09-06 + +### Changed + +- Fixed a bug where serialization registries would always replace existing values. [#95](https://github.com/microsoft/kiota-abstractions-go/issues/95) + +## [1.2.0] - 2023-07-26 + +### Added + +- Added support for multipart request body. + +## [1.1.0] - 2023-05-04 + +### Added + +- Added an interface to represent composed types. + +## [1.0.0] - 2023-05-04 + +### Changed + +- GA Release. + +## [0.20.0] - 2023-04-12 + +### Added + +- Adds response headers to Api Error class + +### Changed + +## [0.19.1] - 2023-04-12 + +### Added + +### Changed + +- Fixes concurrent map write panics when enabling backing stores. + +## [0.19.0] - 2023-03-22 + +### Added + +- Adds base request builder class to reduce generated code duplication. + +## [0.18.0] - 2023-03-20 + +### Added + +- Adds utility functions `CopyMap` and `CopyStringMap` that returns a copy of the passed map. + +## [0.17.3] - 2023-03-15 + +### Changed + +- Fixes panic when updating in-memory slices, maps or structs . + +## [0.17.2] - 2023-03-01 + +### Added + +- Adds ResponseStatusCode field in ApiError struct. + +## [0.17.1] - 2023-01-28 + +### Added + +- Adds a type qualifier for backing store instance type to be `BackingStoreFactory`. + +### Changed + +## [0.17.0] - 2023-01-23 + +### Added + +- Added support for backing store. + +## [0.16.0] - 2023-01-10 + +### Added + +- Added a method to convert abstract requests to native requests in the request adapter interface. + +## [0.15.2] - 2023-01-09 + +### Changed + +- Fix bug where empty string query parameters are added to the request. + +## [0.15.1] - 2022-12-15 + +### Changed + +- Fix bug preventing adding authentication key to header requests. + +## [0.15.0] - 2022-12-15 + +### Added + +- Added support for multi-valued request headers. + +## [0.14.0] - 2022-10-28 + +### Changed + +- Fixed a bug where request bodies collections with single elements would not serialize properly + +## [0.13.0] - 2022-10-18 + +### Added + +- Added an API key authentication provider. + +## [0.12.0] - 2022-09-27 + +### Added + +- Added tracing support through OpenTelemetry. + +## [0.11.0] - 2022-09-22 + +### Add +- Adds generic helper methods to reduce code duplication for serializer and deserializers +- Adds `WriteAnyValue` to support serialization of objects with undetermined properties at execution time e.g maps. +- Adds `GetRawValue` to allow returning an `interface{}` from the parse-node + +## [0.10.1] - 2022-09-14 + +### Changed + +- Fix: Add getter and setter on `ResponseHandler` pointer . + +## [0.10.0] - 2022-09-02 + +### Added + +- Added support for composed types serialization. + +## [0.9.1] - 2022-09-01 + +### Changed + +- Add `ResponseHandler` to request information struct + +## [0.9.0] - 2022-08-24 + +### Changed + +- Changes RequestAdapter contract passing a `Context` object as the first parameter for SendAsync + +## [0.8.2] - 2022-08-11 + +### Added + +- Add tests to verify DateTime and DateTimeOffsets default to ISO 8601. +- Adds check to return error when the baseUrl path parameter is not set when needed. + +## [0.8.1] - 2022-06-07 + +### Changed + +- Updated yaml package version through testify dependency. + +## [0.8.0] - 2022-05-26 + +### Added + +- Adds support for enum and enum collections responses. + +## [0.7.0] - 2022-05-18 + +### Changed + +- Breaking: adds support for continuous access evaluation. + +## [0.6.0] - 2022-05-16 + +- Added a method to set the content from a scalar value in request information. + +## [0.5.0] - 2022-04-21 + +### Added + +- Added vanity methods to request options to add headers and options to simplify code generation. + +## [0.4.0] - 2022-04-19 + +### Changed + +- Upgraded uri template library for quotes in template fix. +- Upgraded to Go 18 + +## [0.3.0] - 2022-04-08 + +### Added + +- Added support for query parameters with special characters in the name. + +## [0.2.0] - 2022-04-04 + +### Changed + +- Breaking: simplifies the field deserializers. + +## [0.1.0] - 2022-03-30 + +### Added + +- Initial tagged release of the library. diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/CODE_OF_CONDUCT.md b/vendor/github.com/microsoft/kiota-abstractions-go/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..c72a5749c --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/CODE_OF_CONDUCT.md @@ -0,0 +1,9 @@ +# Microsoft Open Source Code of Conduct + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). + +Resources: + +- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) +- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/LICENSE b/vendor/github.com/microsoft/kiota-abstractions-go/LICENSE new file mode 100644 index 000000000..3d8b93bc7 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/README.md b/vendor/github.com/microsoft/kiota-abstractions-go/README.md new file mode 100644 index 000000000..fc9ee97dc --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/README.md @@ -0,0 +1,37 @@ +# Kiota Abstractions Library for go + +![Go](https://github.com/microsoft/kiota-abstractions-go/actions/workflows/go.yml/badge.svg) + +The Kiota abstractions Library for go is the go library defining the basic constructs Kiota projects need once an SDK has been generated from an OpenAPI definition. + +A [Kiota](https://github.com/microsoft/kiota) generated project will need a reference to the abstraction package to build and run. + +Read more about Kiota [here](https://github.com/microsoft/kiota/blob/main/README.md). + +## Using the Abstractions Library + +```Shell +go get github.com/microsoft/kiota-abstractions-go +``` + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a +Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us +the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. + +When you submit a pull request, a CLA bot will automatically determine whether you need to provide +a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions +provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or +contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + +## Trademarks + +This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft +trademarks or logos is subject to and must follow +[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). +Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. +Any use of third-party trademarks or logos are subject to those third-party's policies. diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/SECURITY.md b/vendor/github.com/microsoft/kiota-abstractions-go/SECURITY.md new file mode 100644 index 000000000..12fbd8331 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/SECURITY.md @@ -0,0 +1,41 @@ + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). + + \ No newline at end of file diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/SUPPORT.md b/vendor/github.com/microsoft/kiota-abstractions-go/SUPPORT.md new file mode 100644 index 000000000..dc72f0e5a --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/SUPPORT.md @@ -0,0 +1,25 @@ +# TODO: The maintainer of this repo has not yet edited this file + +**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? + +- **No CSS support:** Fill out this template with information about how to file issues and get help. +- **Yes CSS support:** Fill out an intake form at [aka.ms/spot](https://aka.ms/spot). CSS will work with/help you to determine next steps. More details also available at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). +- **Not sure?** Fill out a SPOT intake as though the answer were "Yes". CSS will help you decide. + +*Then remove this first heading from this SUPPORT.MD file before publishing your repo.* + +# Support + +## How to file issues and get help + +This project uses GitHub Issues to track bugs and feature requests. Please search the existing +issues before filing new issues to avoid duplicates. For new issues, file your bug or +feature request as a new Issue. + +For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE +FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER +CHANNEL. WHERE WILL YOU HELP PEOPLE?**. + +## Microsoft Support Policy + +Support for this **PROJECT or PRODUCT** is limited to the resources listed above. diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/api_client_builder.go b/vendor/github.com/microsoft/kiota-abstractions-go/api_client_builder.go new file mode 100644 index 000000000..2ac0a9193 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/api_client_builder.go @@ -0,0 +1,78 @@ +package abstractions + +import ( + s "github.com/microsoft/kiota-abstractions-go/serialization" + "github.com/microsoft/kiota-abstractions-go/store" +) + +// RegisterDefaultSerializer registers the default serializer to the registry singleton to be used by the request adapter. +func RegisterDefaultSerializer(metaFactory func() s.SerializationWriterFactory) { + factory := metaFactory() + contentType, err := factory.GetValidContentType() + if err == nil && contentType != "" { + registry := s.DefaultSerializationWriterFactoryInstance + registry.Lock() + if _, ok := registry.ContentTypeAssociatedFactories[contentType]; !ok { + registry.ContentTypeAssociatedFactories[contentType] = factory + } + registry.Unlock() + } +} + +// RegisterDefaultDeserializer registers the default deserializer to the registry singleton to be used by the request adapter. +func RegisterDefaultDeserializer(metaFactory func() s.ParseNodeFactory) { + factory := metaFactory() + contentType, err := factory.GetValidContentType() + if err == nil && contentType != "" { + registry := s.DefaultParseNodeFactoryInstance + registry.Lock() + if _, ok := registry.ContentTypeAssociatedFactories[contentType]; !ok { + registry.ContentTypeAssociatedFactories[contentType] = factory + } + registry.Unlock() + } +} + +// EnableBackingStoreForSerializationWriterFactory Enables the backing store on default serialization writers and the given serialization writer. +func EnableBackingStoreForSerializationWriterFactory(factory s.SerializationWriterFactory) s.SerializationWriterFactory { + switch v := factory.(type) { + case *s.SerializationWriterFactoryRegistry: + enableBackingStoreForSerializationRegistry(v) + default: + factory = store.NewBackingStoreSerializationWriterProxyFactory(factory) + enableBackingStoreForSerializationRegistry(s.DefaultSerializationWriterFactoryInstance) + } + return factory +} + +func enableBackingStoreForSerializationRegistry(registry *s.SerializationWriterFactoryRegistry) { + registry.Lock() + defer registry.Unlock() + for key, value := range registry.ContentTypeAssociatedFactories { + if _, ok := value.(*store.BackingStoreSerializationWriterProxyFactory); !ok { + registry.ContentTypeAssociatedFactories[key] = store.NewBackingStoreSerializationWriterProxyFactory(value) + } + } +} + +// EnableBackingStoreForParseNodeFactory Enables the backing store on default parse nodes factories and the given parse node factory. +func EnableBackingStoreForParseNodeFactory(factory s.ParseNodeFactory) s.ParseNodeFactory { + switch v := factory.(type) { + case *s.ParseNodeFactoryRegistry: + enableBackingStoreForParseNodeRegistry(v) + default: + factory = store.NewBackingStoreParseNodeFactory(factory) + enableBackingStoreForParseNodeRegistry(s.DefaultParseNodeFactoryInstance) + } + return factory +} + +func enableBackingStoreForParseNodeRegistry(registry *s.ParseNodeFactoryRegistry) { + registry.Lock() + defer registry.Unlock() + for key, value := range registry.ContentTypeAssociatedFactories { + if _, ok := value.(*store.BackingStoreParseNodeFactory); !ok { + registry.ContentTypeAssociatedFactories[key] = store.NewBackingStoreParseNodeFactory(value) + } + } +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/api_error.go b/vendor/github.com/microsoft/kiota-abstractions-go/api_error.go new file mode 100644 index 000000000..83f5e17a8 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/api_error.go @@ -0,0 +1,36 @@ +package abstractions + +import "fmt" + +type ApiErrorable interface { + SetResponseHeaders(ResponseHeaders *ResponseHeaders) + SetStatusCode(ResponseStatusCode int) +} + +// ApiError is the parent type for errors thrown by the client when receiving failed responses to its requests +type ApiError struct { + Message string + ResponseStatusCode int + ResponseHeaders *ResponseHeaders +} + +func (e *ApiError) Error() string { + if len(e.Message) > 0 { + return fmt.Sprint(e.Message) + } else { + return "error status code received from the API" + } +} + +// NewApiError creates a new ApiError instance +func NewApiError() *ApiError { + return &ApiError{ResponseHeaders: NewResponseHeaders()} +} + +func (e *ApiError) SetResponseHeaders(ResponseHeaders *ResponseHeaders) { + e.ResponseHeaders = ResponseHeaders +} + +func (e *ApiError) SetStatusCode(ResponseStatusCode int) { + e.ResponseStatusCode = ResponseStatusCode +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/authentication/access_token_provider.go b/vendor/github.com/microsoft/kiota-abstractions-go/authentication/access_token_provider.go new file mode 100644 index 000000000..a54e6c2f8 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/authentication/access_token_provider.go @@ -0,0 +1,14 @@ +package authentication + +import ( + "context" + u "net/url" +) + +//AccessTokenProvider returns access tokens. +type AccessTokenProvider interface { + // GetAuthorizationToken returns the access token for the provided url. + GetAuthorizationToken(context context.Context, url *u.URL, additionalAuthenticationContext map[string]interface{}) (string, error) + // GetAllowedHostsValidator returns the hosts validator. + GetAllowedHostsValidator() *AllowedHostsValidator +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/authentication/allowed_hosts_validator.go b/vendor/github.com/microsoft/kiota-abstractions-go/authentication/allowed_hosts_validator.go new file mode 100644 index 000000000..052882de7 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/authentication/allowed_hosts_validator.go @@ -0,0 +1,77 @@ +package authentication + +import ( + "errors" + u "net/url" + "strings" +) + +// AllowedHostsValidator maintains a list of valid hosts and allows authentication providers to check whether a host is valid before authenticating a request +type AllowedHostsValidator struct { + validHosts map[string]bool +} + +// ErrInvalidHostPrefix indicates that a host should not contain the http or https prefix. +var ErrInvalidHostPrefix = errors.New("host should not contain http or https prefix") + +// Deprecated: NewAllowedHostsValidator creates a new AllowedHostsValidator object with provided values. +func NewAllowedHostsValidator(validHosts []string) AllowedHostsValidator { + result := AllowedHostsValidator{} + result.SetAllowedHosts(validHosts) + return result +} + +// NewAllowedHostsValidatorErrorCheck creates a new AllowedHostsValidator object with provided values and performs error checking. +func NewAllowedHostsValidatorErrorCheck(validHosts []string) (*AllowedHostsValidator, error) { + result := &AllowedHostsValidator{} + if err := result.SetAllowedHostsErrorCheck(validHosts); err != nil { + return nil, err + } + return result, nil +} + +// GetAllowedHosts returns the list of valid hosts. +func (v *AllowedHostsValidator) GetAllowedHosts() map[string]bool { + hosts := make(map[string]bool, len(v.validHosts)) + for host := range v.validHosts { + hosts[host] = true + } + return hosts +} + +// Deprecated: SetAllowedHosts sets the list of valid hosts. +func (v *AllowedHostsValidator) SetAllowedHosts(hosts []string) { + v.validHosts = make(map[string]bool, len(hosts)) + if len(hosts) > 0 { + for _, host := range hosts { + v.validHosts[strings.ToLower(host)] = true + } + } +} + +// SetAllowedHostsErrorCheck sets the list of valid hosts with error checking. +func (v *AllowedHostsValidator) SetAllowedHostsErrorCheck(hosts []string) error { + v.validHosts = make(map[string]bool, len(hosts)) + if len(hosts) > 0 { + for _, host := range hosts { + lowerHost := strings.ToLower(host) + if strings.HasPrefix(lowerHost, "http://") || strings.HasPrefix(lowerHost, "https://") { + return ErrInvalidHostPrefix + } + v.validHosts[lowerHost] = true + } + } + return nil +} + +// IsValidHost returns true if the host is valid. +func (v *AllowedHostsValidator) IsUrlHostValid(uri *u.URL) bool { + if uri == nil { + return false + } + host := uri.Hostname() + if host == "" { + return false + } + return len(v.validHosts) == 0 || v.validHosts[strings.ToLower(host)] +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/authentication/anonymous_authentication_provider.go b/vendor/github.com/microsoft/kiota-abstractions-go/authentication/anonymous_authentication_provider.go new file mode 100644 index 000000000..a931c647b --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/authentication/anonymous_authentication_provider.go @@ -0,0 +1,15 @@ +package authentication + +import ( + "context" + abs "github.com/microsoft/kiota-abstractions-go" +) + +// AnonymousAuthenticationProvider implements the AuthenticationProvider interface does not perform any authentication. +type AnonymousAuthenticationProvider struct { +} + +// AuthenticateRequest is a placeholder method that "authenticates" the RequestInformation instance: no-op. +func (provider *AnonymousAuthenticationProvider) AuthenticateRequest(context context.Context, request *abs.RequestInformation, additionalAuthenticationContext map[string]interface{}) error { + return nil +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/authentication/api_key_authentication_provider.go b/vendor/github.com/microsoft/kiota-abstractions-go/authentication/api_key_authentication_provider.go new file mode 100644 index 000000000..82b18fd1f --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/authentication/api_key_authentication_provider.go @@ -0,0 +1,94 @@ +package authentication + +import ( + "context" + "errors" + "strings" + + abs "github.com/microsoft/kiota-abstractions-go" + + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" +) + +// ApiKeyAuthenticationProvider implements the AuthenticationProvider interface and adds an API key to the request. +type ApiKeyAuthenticationProvider struct { + apiKey string + parameterName string + keyLocation KeyLocation + validator *AllowedHostsValidator +} + +type KeyLocation int + +const ( + // QUERYPARAMETER_KEYLOCATION is the value for the key location to be used as a query parameter. + QUERYPARAMETER_KEYLOCATION KeyLocation = iota + // HEADER_KEYLOCATION is the value for the key location to be used as a header. + HEADER_KEYLOCATION +) + +// NewApiKeyAuthenticationProvider creates a new ApiKeyAuthenticationProvider instance +func NewApiKeyAuthenticationProvider(apiKey string, parameterName string, keyLocation KeyLocation) (*ApiKeyAuthenticationProvider, error) { + return NewApiKeyAuthenticationProviderWithValidHosts(apiKey, parameterName, keyLocation, nil) +} + +// NewApiKeyAuthenticationProviderWithValidHosts creates a new ApiKeyAuthenticationProvider instance while specifying a list of valid hosts +func NewApiKeyAuthenticationProviderWithValidHosts(apiKey string, parameterName string, keyLocation KeyLocation, validHosts []string) (*ApiKeyAuthenticationProvider, error) { + if len(apiKey) == 0 { + return nil, errors.New("apiKey cannot be empty") + } + if len(parameterName) == 0 { + return nil, errors.New("parameterName cannot be empty") + } + + validator, err := NewAllowedHostsValidatorErrorCheck(validHosts) + if err != nil { + return nil, err + } + return &ApiKeyAuthenticationProvider{ + apiKey: apiKey, + parameterName: parameterName, + keyLocation: keyLocation, + validator: validator, + }, nil +} + +// AuthenticateRequest adds the API key to the request. +func (p *ApiKeyAuthenticationProvider) AuthenticateRequest(ctx context.Context, request *abs.RequestInformation, additionalAuthenticationContext map[string]interface{}) error { + ctx, span := otel.GetTracerProvider().Tracer("github.com/microsoft/kiota-abstractions-go").Start(ctx, "GetAuthorizationToken") + defer span.End() + if request == nil { + return errors.New("request cannot be nil") + } + + url, err := request.GetUri() + + if err != nil { + return err + } + + if !(*(p.validator)).IsUrlHostValid(url) { + span.SetAttributes(attribute.Bool("com.microsoft.kiota.authentication.is_url_valid", false)) + return nil + } + if !strings.EqualFold(url.Scheme, "https") { + span.SetAttributes(attribute.Bool("com.microsoft.kiota.authentication.is_url_valid", false)) + err := errors.New("url scheme must be https") + span.RecordError(err) + return err + } + span.SetAttributes(attribute.Bool("com.microsoft.kiota.authentication.is_url_valid", true)) + + switch p.keyLocation { + case QUERYPARAMETER_KEYLOCATION: + query := url.Query() + query.Set(p.parameterName, p.apiKey) + url.RawQuery = query.Encode() + request.SetUri(*url) + case HEADER_KEYLOCATION: + request.Headers.Add(p.parameterName, p.apiKey) + } + + return nil +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/authentication/authentication_provider.go b/vendor/github.com/microsoft/kiota-abstractions-go/authentication/authentication_provider.go new file mode 100644 index 000000000..7bedf2faa --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/authentication/authentication_provider.go @@ -0,0 +1,12 @@ +package authentication + +import ( + "context" + abs "github.com/microsoft/kiota-abstractions-go" +) + +// AuthenticationProvider authenticates the RequestInformation request. +type AuthenticationProvider interface { + // AuthenticateRequest authenticates the provided RequestInformation. + AuthenticateRequest(context context.Context, request *abs.RequestInformation, additionalAuthenticationContext map[string]interface{}) error +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/authentication/base_bearer_token_authentication_provider.go b/vendor/github.com/microsoft/kiota-abstractions-go/authentication/base_bearer_token_authentication_provider.go new file mode 100644 index 000000000..4c74d9b79 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/authentication/base_bearer_token_authentication_provider.go @@ -0,0 +1,60 @@ +package authentication + +import ( + "context" + "errors" + + abs "github.com/microsoft/kiota-abstractions-go" +) + +const authorizationHeader = "Authorization" +const claimsKey = "claims" + +// BaseBearerTokenAuthenticationProvider provides a base class implementing AuthenticationProvider for Bearer token scheme. +type BaseBearerTokenAuthenticationProvider struct { + // accessTokenProvider is called by the BaseBearerTokenAuthenticationProvider class to authenticate the request via the returned access token. + accessTokenProvider AccessTokenProvider +} + +// NewBaseBearerTokenAuthenticationProvider creates a new instance of the BaseBearerTokenAuthenticationProvider class. +func NewBaseBearerTokenAuthenticationProvider(accessTokenProvider AccessTokenProvider) *BaseBearerTokenAuthenticationProvider { + return &BaseBearerTokenAuthenticationProvider{accessTokenProvider} +} + +// AuthenticateRequest authenticates the provided RequestInformation instance using the provided authorization token callback. +func (provider *BaseBearerTokenAuthenticationProvider) AuthenticateRequest(ctx context.Context, request *abs.RequestInformation, additionalAuthenticationContext map[string]interface{}) error { + if request == nil { + return errors.New("request is nil") + } + if request.Headers == nil { + request.Headers = abs.NewRequestHeaders() + } + if provider.accessTokenProvider == nil { + return errors.New("this class needs to be initialized with an access token provider") + } + if len(additionalAuthenticationContext) > 0 && + additionalAuthenticationContext[claimsKey] != nil && + request.Headers.ContainsKey(authorizationHeader) { + request.Headers.Remove(authorizationHeader) + } + if !request.Headers.ContainsKey(authorizationHeader) { + uri, err := request.GetUri() + if err != nil { + return err + } + token, err := provider.accessTokenProvider.GetAuthorizationToken(ctx, uri, additionalAuthenticationContext) + if err != nil { + return err + } + if token != "" { + request.Headers.Add(authorizationHeader, "Bearer "+token) + } + } + + return nil +} + +// GetAuthorizationTokenProvider returns the access token provider the BaseBearerTokenAuthenticationProvider class uses to authenticate the request. +func (provider *BaseBearerTokenAuthenticationProvider) GetAuthorizationTokenProvider() AccessTokenProvider { + return provider.accessTokenProvider +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/base_request_builder.go b/vendor/github.com/microsoft/kiota-abstractions-go/base_request_builder.go new file mode 100644 index 000000000..d3aa3d995 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/base_request_builder.go @@ -0,0 +1,29 @@ +package abstractions + +// BaseRequestBuilder is the base class for all request builders. +type BaseRequestBuilder struct { + // Path parameters for the request + PathParameters map[string]string + // The request adapter to use to execute the requests. + RequestAdapter RequestAdapter + // Url template to use to build the URL for the current request builder + UrlTemplate string +} + +// NewBaseRequestBuilder creates a new BaseRequestBuilder instance. +func NewBaseRequestBuilder(requestAdapter RequestAdapter, urlTemplate string, pathParameters map[string]string) *BaseRequestBuilder { + if requestAdapter == nil { + panic("requestAdapter cannot be nil") + } + pathParametersCopy := make(map[string]string) + if pathParameters != nil { + for idx, item := range pathParameters { + pathParametersCopy[idx] = item + } + } + return &BaseRequestBuilder{ + RequestAdapter: requestAdapter, + UrlTemplate: urlTemplate, + PathParameters: pathParametersCopy, + } +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/headers.go b/vendor/github.com/microsoft/kiota-abstractions-go/headers.go new file mode 100644 index 000000000..23c94bd69 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/headers.go @@ -0,0 +1,111 @@ +package abstractions + +import "strings" + +type header struct { + headers map[string]map[string]struct{} +} + +type void struct{} + +var voidInstance void + +func normalizeHeaderKey(key string) string { + return strings.ToLower(strings.Trim(key, " ")) +} + +//Add adds a new header or append a new value to an existing header +func (r *header) Add(key string, value string, additionalValues ...string) { + normalizedKey := normalizeHeaderKey(key) + if normalizedKey == "" || value == "" { + return + } + if r.headers == nil { + r.headers = make(map[string]map[string]struct{}) + } + if r.headers[normalizedKey] == nil { + r.headers[normalizedKey] = make(map[string]struct{}) + } + r.headers[normalizedKey][value] = voidInstance + for _, v := range additionalValues { + r.headers[normalizedKey][v] = voidInstance + } +} + +//Get returns the values for the specific header +func (r *header) Get(key string) []string { + if r.headers == nil { + return nil + } + normalizedKey := normalizeHeaderKey(key) + if r.headers[normalizedKey] == nil { + return make([]string, 0) + } + values := make([]string, 0, len(r.headers[normalizedKey])) + for k := range r.headers[normalizedKey] { + values = append(values, k) + } + return values +} + +//Remove removes the specific header and all its values +func (r *header) Remove(key string) { + if r.headers == nil { + return + } + normalizedKey := normalizeHeaderKey(key) + delete(r.headers, normalizedKey) +} + +//RemoveValue remove the value for the specific header +func (r *header) RemoveValue(key string, value string) { + if r.headers == nil { + return + } + normalizedKey := normalizeHeaderKey(key) + if r.headers[normalizedKey] == nil { + return + } + delete(r.headers[normalizedKey], value) + if len(r.headers[normalizedKey]) == 0 { + delete(r.headers, normalizedKey) + } +} + +//ContainsKey check if the key exists in the headers +func (r *header) ContainsKey(key string) bool { + if r.headers == nil { + return false + } + normalizedKey := normalizeHeaderKey(key) + return r.headers[normalizedKey] != nil +} + +//Clear clear all headers +func (r *header) Clear() { + r.headers = nil +} + +//AddAll adds all headers from the other headers +func (r *header) AddAll(other *header) { + if other == nil || other.headers == nil { + return + } + for k, v := range other.headers { + for k2 := range v { + r.Add(k, k2) + } + } +} + +//ListKeys returns all the keys in the headers +func (r *header) ListKeys() []string { + if r.headers == nil { + return make([]string, 0) + } + keys := make([]string, 0, len(r.headers)) + for k := range r.headers { + keys = append(keys, k) + } + return keys +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/http_method.go b/vendor/github.com/microsoft/kiota-abstractions-go/http_method.go new file mode 100644 index 000000000..4d1d2a668 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/http_method.go @@ -0,0 +1,30 @@ +package abstractions + +// Represents the HTTP method used by a request. +type HttpMethod int + +const ( + // The HTTP GET method. + GET HttpMethod = iota + // The HTTP POST method. + POST + // The HTTP PATCH method. + PATCH + // The HTTP DELETE method. + DELETE + // The HTTP OPTIONS method. + OPTIONS + // The HTTP CONNECT method. + CONNECT + // The HTTP PUT method. + PUT + // The HTTP TRACE method. + TRACE + // The HTTP HEAD method. + HEAD +) + +// String returns the string representation of the HTTP method. +func (m HttpMethod) String() string { + return []string{"GET", "POST", "PATCH", "DELETE", "OPTIONS", "CONNECT", "PUT", "TRACE", "HEAD"}[m] +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/multipart_body.go b/vendor/github.com/microsoft/kiota-abstractions-go/multipart_body.go new file mode 100644 index 000000000..3494fa47a --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/multipart_body.go @@ -0,0 +1,191 @@ +package abstractions + +import ( + "errors" + "strings" + + "github.com/google/uuid" + "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// MultipartBody represents a multipart body for a request or a response. +type MultipartBody interface { + serialization.Parsable + // AddOrReplacePart adds or replaces a part in the multipart body. + AddOrReplacePart(name string, contentType string, content any) error + // GetPartValue gets the value of a part in the multipart body. + GetPartValue(name string) (any, error) + // RemovePart removes a part from the multipart body. + RemovePart(name string) error + // SetRequestAdapter sets the request adapter to use for serialization. + SetRequestAdapter(requestAdapter RequestAdapter) + // GetRequestAdapter gets the request adapter to use for serialization. + GetRequestAdapter() RequestAdapter + // GetBoundary returns the boundary used in the multipart body. + GetBoundary() string +} +type multipartBody struct { + parts map[string]multipartEntry + originalNamesMap map[string]string + boundary string + requestAdapter RequestAdapter +} + +func NewMultipartBody() MultipartBody { + return &multipartBody{ + parts: make(map[string]multipartEntry), + originalNamesMap: make(map[string]string), + boundary: strings.ReplaceAll(uuid.New().String(), "-", ""), + } +} +func normalizePartName(original string) string { + return strings.ToLower(original) +} +func stringReference(original string) *string { + return &original +} + +// AddOrReplacePart adds or replaces a part in the multipart body. +func (m *multipartBody) AddOrReplacePart(name string, contentType string, content any) error { + if name == "" { + return errors.New("name cannot be empty") + } + if contentType == "" { + return errors.New("contentType cannot be empty") + } + if content == nil { + return errors.New("content cannot be nil") + } + normalizedName := normalizePartName(name) + m.parts[normalizedName] = multipartEntry{ + ContentType: contentType, + Content: content, + } + m.originalNamesMap[normalizedName] = name + + return nil +} + +// GetPartValue gets the value of a part in the multipart body. +func (m *multipartBody) GetPartValue(name string) (any, error) { + if name == "" { + return nil, errors.New("name cannot be empty") + } + normalizedName := normalizePartName(name) + if part, ok := m.parts[normalizedName]; ok { + return part.Content, nil + } + return nil, nil +} + +// RemovePart removes a part from the multipart body. +func (m *multipartBody) RemovePart(name string) error { + if name == "" { + return errors.New("name cannot be empty") + } + normalizedName := normalizePartName(name) + delete(m.parts, normalizedName) + delete(m.originalNamesMap, normalizedName) + return nil +} + +// Serialize writes the objects properties to the current writer. +func (m *multipartBody) Serialize(writer serialization.SerializationWriter) error { + if writer == nil { + return errors.New("writer cannot be nil") + } + if m.requestAdapter == nil { + return errors.New("requestAdapter cannot be nil") + } + serializationWriterFactory := m.requestAdapter.GetSerializationWriterFactory() + if serializationWriterFactory == nil { + return errors.New("serializationWriterFactory cannot be nil") + } + if len(m.parts) == 0 { + return errors.New("no parts to serialize") + } + + first := true + for partName, part := range m.parts { + if first { + first = false + } else { + if err := writer.WriteStringValue("", stringReference("")); err != nil { + return err + } + } + if err := writer.WriteStringValue("", stringReference("--"+m.boundary)); err != nil { + return err + } + if err := writer.WriteStringValue("Content-Type", stringReference(part.ContentType)); err != nil { + return err + } + partOriginalName := m.originalNamesMap[partName] + if err := writer.WriteStringValue("Content-Disposition", stringReference("form-data; name=\""+partOriginalName+"\"")); err != nil { + return err + } + if err := writer.WriteStringValue("", stringReference("")); err != nil { + return err + } + if parsable, ok := part.Content.(serialization.Parsable); ok { + partWriter, error := serializationWriterFactory.GetSerializationWriter(part.ContentType) + defer partWriter.Close() + if error != nil { + return error + } + if error = partWriter.WriteObjectValue("", parsable); error != nil { + return error + } + partContent, error := partWriter.GetSerializedContent() + if error != nil { + return error + } + if error = writer.WriteByteArrayValue("", partContent); error != nil { + return error + } + } else if str, ok := part.Content.(string); ok { + if error := writer.WriteStringValue("", stringReference(str)); error != nil { + return error + } + } else if byteArray, ok := part.Content.([]byte); ok { + if error := writer.WriteByteArrayValue("", byteArray); error != nil { + return error + } + } else { + return errors.New("unsupported part type") + } + } + if err := writer.WriteStringValue("", stringReference("")); err != nil { + return err + } + if err := writer.WriteStringValue("", stringReference("--"+m.boundary+"--")); err != nil { + return err + } + + return nil +} + +// GetFieldDeserializers returns the deserialization information for this object. +func (m *multipartBody) GetFieldDeserializers() map[string]func(serialization.ParseNode) error { + panic("not implemented") +} + +// GetRequestAdapter gets the request adapter to use for serialization. +func (m *multipartBody) GetRequestAdapter() RequestAdapter { + return m.requestAdapter +} + +// SetRequestAdapter sets the request adapter to use for serialization. +func (m *multipartBody) SetRequestAdapter(requestAdapter RequestAdapter) { + m.requestAdapter = requestAdapter +} + +// GetBoundary returns the boundary used in the multipart body. +func (m *multipartBody) GetBoundary() string { + return m.boundary +} + +type multipartEntry struct { + ContentType string + Content any +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/request_adapter.go b/vendor/github.com/microsoft/kiota-abstractions-go/request_adapter.go new file mode 100644 index 000000000..21e2050de --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/request_adapter.go @@ -0,0 +1,47 @@ +// Package abstractions provides the base infrastructure for the Kiota-generated SDKs to function. +// It defines multiple concepts related to abstract HTTP requests, serialization, and authentication. +// These concepts can then be implemented independently without tying the SDKs to any specific implementation. +// Kiota also provides default implementations for these concepts. +// Checkout: +// - github.com/microsoft/kiota/authentication/go/azure +// - github.com/microsoft/kiota/http/go/nethttp +// - github.com/microsoft/kiota/serialization/go/json +package abstractions + +import ( + "context" + "github.com/microsoft/kiota-abstractions-go/store" + + s "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ErrorMappings is a mapping of status codes to error types factories. +type ErrorMappings map[string]s.ParsableFactory + +// RequestAdapter is the service responsible for translating abstract RequestInformation into native HTTP requests. +type RequestAdapter interface { + // Send executes the HTTP request specified by the given RequestInformation and returns the deserialized response model. + Send(context context.Context, requestInfo *RequestInformation, constructor s.ParsableFactory, errorMappings ErrorMappings) (s.Parsable, error) + // SendEnum executes the HTTP request specified by the given RequestInformation and returns the deserialized response model. + SendEnum(context context.Context, requestInfo *RequestInformation, parser s.EnumFactory, errorMappings ErrorMappings) (any, error) + // SendCollection executes the HTTP request specified by the given RequestInformation and returns the deserialized response model collection. + SendCollection(context context.Context, requestInfo *RequestInformation, constructor s.ParsableFactory, errorMappings ErrorMappings) ([]s.Parsable, error) + // SendEnumCollection executes the HTTP request specified by the given RequestInformation and returns the deserialized response model collection. + SendEnumCollection(context context.Context, requestInfo *RequestInformation, parser s.EnumFactory, errorMappings ErrorMappings) ([]any, error) + // SendPrimitive executes the HTTP request specified by the given RequestInformation and returns the deserialized primitive response model. + SendPrimitive(context context.Context, requestInfo *RequestInformation, typeName string, errorMappings ErrorMappings) (any, error) + // SendPrimitiveCollection executes the HTTP request specified by the given RequestInformation and returns the deserialized primitive response model collection. + SendPrimitiveCollection(context context.Context, requestInfo *RequestInformation, typeName string, errorMappings ErrorMappings) ([]any, error) + // SendNoContent executes the HTTP request specified by the given RequestInformation with no return content. + SendNoContent(context context.Context, requestInfo *RequestInformation, errorMappings ErrorMappings) error + // GetSerializationWriterFactory returns the serialization writer factory currently in use for the request adapter service. + GetSerializationWriterFactory() s.SerializationWriterFactory + // EnableBackingStore enables the backing store proxies for the SerializationWriters and ParseNodes in use. + EnableBackingStore(factory store.BackingStoreFactory) + // SetBaseUrl sets the base url for every request. + SetBaseUrl(baseUrl string) + // GetBaseUrl gets the base url for every request. + GetBaseUrl() string + // ConvertToNativeRequest converts the given RequestInformation into a native HTTP request. + ConvertToNativeRequest(context context.Context, requestInfo *RequestInformation) (any, error) +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/request_configuration.go b/vendor/github.com/microsoft/kiota-abstractions-go/request_configuration.go new file mode 100644 index 000000000..7b23c6b91 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/request_configuration.go @@ -0,0 +1,15 @@ +package abstractions + +// RequestConfiguration represents a set of options to be used when making HTTP requests. +type RequestConfiguration[T any] struct { + // Request headers + Headers *RequestHeaders + // Request options + Options []RequestOption + // Query parameters + QueryParameters *T +} + +// DefaultQueryParameters is a placeholder for operations without any query parameter documented. +type DefaultQueryParameters struct { +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/request_handler_option.go b/vendor/github.com/microsoft/kiota-abstractions-go/request_handler_option.go new file mode 100644 index 000000000..8aee1e3d0 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/request_handler_option.go @@ -0,0 +1,33 @@ +package abstractions + +// RequestHandlerOption represents an abstract provider for ResponseHandler +type RequestHandlerOption interface { + GetResponseHandler() ResponseHandler + SetResponseHandler(responseHandler ResponseHandler) + GetKey() RequestOptionKey +} + +var ResponseHandlerOptionKey = RequestOptionKey{ + Key: "ResponseHandlerOptionKey", +} + +type requestHandlerOption struct { + handler ResponseHandler +} + +// NewRequestHandlerOption creates a new RequestInformation object with default values. +func NewRequestHandlerOption() RequestHandlerOption { + return &requestHandlerOption{} +} + +func (r *requestHandlerOption) GetResponseHandler() ResponseHandler { + return r.handler +} + +func (r *requestHandlerOption) SetResponseHandler(responseHandler ResponseHandler) { + r.handler = responseHandler +} + +func (r *requestHandlerOption) GetKey() RequestOptionKey { + return ResponseHandlerOptionKey +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/request_headers.go b/vendor/github.com/microsoft/kiota-abstractions-go/request_headers.go new file mode 100644 index 000000000..e1523fa2e --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/request_headers.go @@ -0,0 +1,35 @@ +package abstractions + +// RequestHeaders represents a collection of request headers +type RequestHeaders struct { + header +} + +// NewRequestHeaders creates a new RequestHeaders +func NewRequestHeaders() *RequestHeaders { + return &RequestHeaders{ + header{make(map[string]map[string]struct{})}, + } +} + +// AddAll adds all headers from the other headers +func (r *RequestHeaders) AddAll(other *RequestHeaders) { + if other == nil || other.headers == nil { + return + } + for k, v := range other.headers { + for k2 := range v { + r.Add(k, k2) + } + } +} + +// TryAdd adds the header if it's not already present +func (r *RequestHeaders) TryAdd(key string, value string) bool { + if r.ContainsKey(key) { + return false + } + + r.Add(key, value) + return true +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/request_information.go b/vendor/github.com/microsoft/kiota-abstractions-go/request_information.go new file mode 100644 index 000000000..07885486d --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/request_information.go @@ -0,0 +1,566 @@ +package abstractions + +import ( + "context" + "errors" + "time" + + "reflect" + "strconv" + "strings" + + u "net/url" + + "github.com/google/uuid" + s "github.com/microsoft/kiota-abstractions-go/serialization" + stduritemplate "github.com/std-uritemplate/std-uritemplate/go" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" +) + +// RequestInformation represents an abstract HTTP request. +type RequestInformation struct { + // The HTTP method of the request. + Method HttpMethod + uri *u.URL + // The Request Headers. + Headers *RequestHeaders + // The Query Parameters of the request. + // Deprecated: use QueryParametersAny instead + QueryParameters map[string]string + // The Query Parameters of the request. + QueryParametersAny map[string]any + // The Request Body. + Content []byte + // The path parameters to use for the URL template when generating the URI. + // Deprecated: use PathParametersAny instead + PathParameters map[string]string + // The path parameters to use for the URL template when generating the URI. + PathParametersAny map[string]any + // The Url template for the current request. + UrlTemplate string + options map[string]RequestOption +} + +const raw_url_key = "request-raw-url" + +// NewRequestInformation creates a new RequestInformation object with default values. +func NewRequestInformation() *RequestInformation { + return &RequestInformation{ + Headers: NewRequestHeaders(), + QueryParameters: make(map[string]string), + QueryParametersAny: make(map[string]any), + options: make(map[string]RequestOption), + PathParameters: make(map[string]string), + PathParametersAny: make(map[string]any), + } +} + +// NewRequestInformationWithMethodAndUrlTemplateAndPathParameters creates a new RequestInformation object with the specified method and URL template and path parameters. +func NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(method HttpMethod, urlTemplate string, pathParameters map[string]string) *RequestInformation { + value := NewRequestInformation() + value.Method = method + value.UrlTemplate = urlTemplate + value.PathParameters = pathParameters + return value +} +func ConfigureRequestInformation[T any](request *RequestInformation, config *RequestConfiguration[T]) { + if request == nil { + return + } + if config == nil { + return + } + if config.QueryParameters != nil { + request.AddQueryParameters(*(config.QueryParameters)) + } + request.Headers.AddAll(config.Headers) + request.AddRequestOptions(config.Options) +} + +// GetUri returns the URI of the request. +func (request *RequestInformation) GetUri() (*u.URL, error) { + if request.uri != nil { + return request.uri, nil + } else if request.UrlTemplate == "" { + return nil, errors.New("uri cannot be empty") + } else if request.PathParameters == nil { + return nil, errors.New("uri template parameters cannot be nil") + } else if request.QueryParameters == nil { + return nil, errors.New("uri query parameters cannot be nil") + } else if request.QueryParametersAny == nil { + return nil, errors.New("uri query parameters cannot be nil") + } else if request.PathParameters[raw_url_key] != "" { + uri, err := u.Parse(request.PathParameters[raw_url_key]) + if err != nil { + return nil, err + } + request.SetUri(*uri) + return request.uri, nil + } else { + _, baseurlExists := request.PathParameters["baseurl"] + if !baseurlExists && strings.Contains(strings.ToLower(request.UrlTemplate), "{+baseurl}") { + return nil, errors.New("pathParameters must contain a value for \"baseurl\" for the url to be built") + } + + substitutions := make(map[string]any) + for key, value := range request.PathParameters { + substitutions[key] = value + } + for key, value := range request.PathParametersAny { + substitutions[key] = request.normalizeParameters(reflect.ValueOf(value), value, false) + } + for key, value := range request.QueryParameters { + substitutions[key] = value + } + for key, value := range request.QueryParametersAny { + substitutions[key] = value + } + url, err := stduritemplate.Expand(request.UrlTemplate, substitutions) + if err != nil { + return nil, err + } + uri, err := u.Parse(url) + return uri, err + } +} + +// SetUri updates the URI for the request from a raw URL. +func (request *RequestInformation) SetUri(url u.URL) { + request.uri = &url + for k := range request.PathParameters { + delete(request.PathParameters, k) + } + for k := range request.QueryParameters { + delete(request.QueryParameters, k) + } + for k := range request.QueryParametersAny { + delete(request.QueryParametersAny, k) + } +} + +// AddRequestOptions adds an option to the request to be read by the middleware infrastructure. +func (request *RequestInformation) AddRequestOptions(options []RequestOption) { + if options == nil { + return + } + if request.options == nil { + request.options = make(map[string]RequestOption, len(options)) + } + for _, option := range options { + request.options[option.GetKey().Key] = option + } +} + +// GetRequestOptions returns the options for this request. Options are unique by type. If an option of the same type is added twice, the last one wins. +func (request *RequestInformation) GetRequestOptions() []RequestOption { + if request.options == nil { + return []RequestOption{} + } + result := make([]RequestOption, len(request.options)) + idx := 0 + for _, option := range request.options { + result[idx] = option + idx++ + } + return result +} + +const contentTypeHeader = "Content-Type" +const binaryContentType = "application/octet-steam" + +// SetStreamContent sets the request body to a binary stream. +// Deprecated: Use SetStreamContentAndContentType instead. +func (request *RequestInformation) SetStreamContent(content []byte) { + request.SetStreamContentAndContentType(content, binaryContentType) +} + +// SetStreamContentAndContentType sets the request body to a binary stream with the specified content type. +func (request *RequestInformation) SetStreamContentAndContentType(content []byte, contentType string) { + request.Content = content + if request.Headers != nil { + request.Headers.Add(contentTypeHeader, contentType) + } +} + +func (request *RequestInformation) setContentAndContentType(writer s.SerializationWriter, contentType string) error { + content, err := writer.GetSerializedContent() + if err != nil { + return err + } else if content == nil { + return errors.New("content cannot be nil") + } + request.Content = content + if request.Headers != nil { + request.Headers.TryAdd(contentTypeHeader, contentType) + } + return nil +} + +func (request *RequestInformation) getSerializationWriter(requestAdapter RequestAdapter, contentType string, items ...interface{}) (s.SerializationWriter, error) { + if contentType == "" { + return nil, errors.New("content type cannot be empty") + } else if requestAdapter == nil { + return nil, errors.New("requestAdapter cannot be nil") + } else if len(items) == 0 { + return nil, errors.New("items cannot be nil or empty") + } + factory := requestAdapter.GetSerializationWriterFactory() + if factory == nil { + return nil, errors.New("factory cannot be nil") + } + writer, err := factory.GetSerializationWriter(contentType) + if err != nil { + return nil, err + } else if writer == nil { + return nil, errors.New("writer cannot be nil") + } else { + return writer, nil + } +} + +func (r *RequestInformation) setRequestType(result interface{}, span trace.Span) { + if result != nil { + span.SetAttributes(attribute.String("com.microsoft.kiota.request.type", reflect.TypeOf(result).String())) + } +} + +const observabilityTracerName = "github.com/microsoft/kiota-abstractions-go" + +// SetContentFromParsable sets the request body from a model with the specified content type. +func (request *RequestInformation) SetContentFromParsable(ctx context.Context, requestAdapter RequestAdapter, contentType string, item s.Parsable) error { + _, span := otel.GetTracerProvider().Tracer(observabilityTracerName).Start(ctx, "SetContentFromParsable") + defer span.End() + + writer, err := request.getSerializationWriter(requestAdapter, contentType, item) + if err != nil { + span.RecordError(err) + return err + } + defer writer.Close() + if multipartBody, ok := item.(MultipartBody); ok { + contentType += "; boundary=" + multipartBody.GetBoundary() + multipartBody.SetRequestAdapter(requestAdapter) + } + request.setRequestType(item, span) + err = writer.WriteObjectValue("", item) + if err != nil { + span.RecordError(err) + return err + } + err = request.setContentAndContentType(writer, contentType) + if err != nil { + span.RecordError(err) + return err + } + return nil +} + +// SetContentFromParsableCollection sets the request body from a model with the specified content type. +func (request *RequestInformation) SetContentFromParsableCollection(ctx context.Context, requestAdapter RequestAdapter, contentType string, items []s.Parsable) error { + _, span := otel.GetTracerProvider().Tracer(observabilityTracerName).Start(ctx, "SetContentFromParsableCollection") + defer span.End() + + writer, err := request.getSerializationWriter(requestAdapter, contentType, items) + if err != nil { + span.RecordError(err) + return err + } + defer writer.Close() + if len(items) > 0 { + request.setRequestType(items[0], span) + } + err = writer.WriteCollectionOfObjectValues("", items) + if err != nil { + span.RecordError(err) + return err + } + err = request.setContentAndContentType(writer, contentType) + if err != nil { + span.RecordError(err) + return err + } + return nil +} + +// SetContentFromScalar sets the request body from a scalar value with the specified content type. +func (request *RequestInformation) SetContentFromScalar(ctx context.Context, requestAdapter RequestAdapter, contentType string, item interface{}) error { + _, span := otel.GetTracerProvider().Tracer(observabilityTracerName).Start(ctx, "SetContentFromScalar") + defer span.End() + writer, err := request.getSerializationWriter(requestAdapter, contentType, item) + if err != nil { + span.RecordError(err) + return err + } + defer writer.Close() + request.setRequestType(item, span) + + if sv, ok := item.(*string); ok { + err = writer.WriteStringValue("", sv) + } else if bv, ok := item.(*bool); ok { + err = writer.WriteBoolValue("", bv) + } else if byv, ok := item.(*byte); ok { + err = writer.WriteByteValue("", byv) + } else if i8v, ok := item.(*int8); ok { + err = writer.WriteInt8Value("", i8v) + } else if i32v, ok := item.(*int32); ok { + err = writer.WriteInt32Value("", i32v) + } else if i64v, ok := item.(*int64); ok { + err = writer.WriteInt64Value("", i64v) + } else if f32v, ok := item.(*float32); ok { + err = writer.WriteFloat32Value("", f32v) + } else if f64v, ok := item.(*float64); ok { + err = writer.WriteFloat64Value("", f64v) + } else if uv, ok := item.(*uuid.UUID); ok { + err = writer.WriteUUIDValue("", uv) + } else if tv, ok := item.(*time.Time); ok { + err = writer.WriteTimeValue("", tv) + } else if dv, ok := item.(*s.ISODuration); ok { + err = writer.WriteISODurationValue("", dv) + } else if tov, ok := item.(*s.TimeOnly); ok { + err = writer.WriteTimeOnlyValue("", tov) + } else if dov, ok := item.(*s.DateOnly); ok { + err = writer.WriteDateOnlyValue("", dov) + } + if err != nil { + span.RecordError(err) + return err + } + err = request.setContentAndContentType(writer, contentType) + if err != nil { + span.RecordError(err) + return err + } + return nil +} + +// SetContentFromScalarCollection sets the request body from a scalar value with the specified content type. +func (request *RequestInformation) SetContentFromScalarCollection(ctx context.Context, requestAdapter RequestAdapter, contentType string, items []interface{}) error { + _, span := otel.GetTracerProvider().Tracer(observabilityTracerName).Start(ctx, "SetContentFromScalarCollection") + defer span.End() + writer, err := request.getSerializationWriter(requestAdapter, contentType, items...) + if err != nil { + span.RecordError(err) + return err + } + defer writer.Close() + if len(items) > 0 { + value := items[0] + request.setRequestType(value, span) + if _, ok := value.(string); ok { + sc := make([]string, len(items)) + for i, v := range items { + if sv, ok := v.(string); ok { + sc[i] = sv + } + } + err = writer.WriteCollectionOfStringValues("", sc) + } else if _, ok := value.(bool); ok { + bc := make([]bool, len(items)) + for i, v := range items { + if sv, ok := v.(bool); ok { + bc[i] = sv + } + } + err = writer.WriteCollectionOfBoolValues("", bc) + } else if _, ok := value.(byte); ok { + byc := make([]byte, len(items)) + for i, v := range items { + if sv, ok := v.(byte); ok { + byc[i] = sv + } + } + err = writer.WriteCollectionOfByteValues("", byc) + } else if _, ok := value.(int8); ok { + i8c := make([]int8, len(items)) + for i, v := range items { + if sv, ok := v.(int8); ok { + i8c[i] = sv + } + } + err = writer.WriteCollectionOfInt8Values("", i8c) + } else if _, ok := value.(int32); ok { + i32c := make([]int32, len(items)) + for i, v := range items { + if sv, ok := v.(int32); ok { + i32c[i] = sv + } + } + err = writer.WriteCollectionOfInt32Values("", i32c) + } else if _, ok := value.(int64); ok { + i64c := make([]int64, len(items)) + for i, v := range items { + if sv, ok := v.(int64); ok { + i64c[i] = sv + } + } + err = writer.WriteCollectionOfInt64Values("", i64c) + } else if _, ok := value.(float32); ok { + f32c := make([]float32, len(items)) + for i, v := range items { + if sv, ok := v.(float32); ok { + f32c[i] = sv + } + } + err = writer.WriteCollectionOfFloat32Values("", f32c) + } else if _, ok := value.(float64); ok { + f64c := make([]float64, len(items)) + for i, v := range items { + if sv, ok := v.(float64); ok { + f64c[i] = sv + } + } + err = writer.WriteCollectionOfFloat64Values("", f64c) + } else if _, ok := value.(uuid.UUID); ok { + uc := make([]uuid.UUID, len(items)) + for i, v := range items { + if sv, ok := v.(uuid.UUID); ok { + uc[i] = sv + } + } + err = writer.WriteCollectionOfUUIDValues("", uc) + } else if _, ok := value.(time.Time); ok { + tc := make([]time.Time, len(items)) + for i, v := range items { + if sv, ok := v.(time.Time); ok { + tc[i] = sv + } + } + err = writer.WriteCollectionOfTimeValues("", tc) + } else if _, ok := value.(s.ISODuration); ok { + dc := make([]s.ISODuration, len(items)) + for i, v := range items { + if sv, ok := v.(s.ISODuration); ok { + dc[i] = sv + } + } + err = writer.WriteCollectionOfISODurationValues("", dc) + } else if _, ok := value.(s.TimeOnly); ok { + toc := make([]s.TimeOnly, len(items)) + for i, v := range items { + if sv, ok := v.(s.TimeOnly); ok { + toc[i] = sv + } + } + err = writer.WriteCollectionOfTimeOnlyValues("", toc) + } else if _, ok := value.(s.DateOnly); ok { + doc := make([]s.DateOnly, len(items)) + for i, v := range items { + if sv, ok := v.(s.DateOnly); ok { + doc[i] = sv + } + } + err = writer.WriteCollectionOfDateOnlyValues("", doc) + } else if _, ok := value.(byte); ok { + ba := make([]byte, len(items)) + for i, v := range items { + if sv, ok := v.(byte); ok { + ba[i] = sv + } + } + err = writer.WriteByteArrayValue("", ba) + } + } + if err != nil { + span.RecordError(err) + return err + } + err = request.setContentAndContentType(writer, contentType) + if err != nil { + span.RecordError(err) + return err + } + return nil +} + +// AddQueryParameters adds the query parameters to the request by reading the properties from the provided object. +func (request *RequestInformation) AddQueryParameters(source any) { + if source == nil || request == nil { + return + } + valOfP := reflect.ValueOf(source) + fields := reflect.TypeOf(source) + numOfFields := fields.NumField() + for i := 0; i < numOfFields; i++ { + field := fields.Field(i) + fieldName := field.Name + fieldValue := valOfP.Field(i) + tagValue := field.Tag.Get("uriparametername") + if tagValue != "" { + fieldName = tagValue + } + value := fieldValue.Interface() + valueOfValue := reflect.ValueOf(value) + if valueOfValue.IsNil() { + continue + } + str, ok := value.(*string) + if ok && str != nil { + request.QueryParameters[fieldName] = *str + } + bl, ok := value.(*bool) + if ok && bl != nil { + request.QueryParameters[fieldName] = strconv.FormatBool(*bl) + } + it, ok := value.(*int32) + if ok && it != nil { + request.QueryParameters[fieldName] = strconv.FormatInt(int64(*it), 10) + } + strArr, ok := value.([]string) + if ok && len(strArr) > 0 { + // populating both query parameter fields to avoid breaking compatibility with code reading this field + request.QueryParameters[fieldName] = strings.Join(strArr, ",") + + tmp := make([]any, len(strArr)) + for i, v := range strArr { + tmp[i] = v + } + request.QueryParametersAny[fieldName] = tmp + } + if arr, ok := value.([]any); ok && len(arr) > 0 { + request.QueryParametersAny[fieldName] = arr + } + normalizedValue := request.normalizeParameters(valueOfValue, value, true) + if normalizedValue != nil { + request.QueryParametersAny[fieldName] = normalizedValue + } + } +} + +// Normalize different types to values that can be rendered in an URL: +// enum -> string (name) +// []enum -> []string (containing names) +// []non_interface -> []any (like []int64 -> []any) +func (request *RequestInformation) normalizeParameters(valueOfValue reflect.Value, value any, returnNilIfNotNormalizable bool) any { + if valueOfValue.Kind() == reflect.Slice && valueOfValue.Len() > 0 { + //type assertions to "enums" don't work if you don't know the enum type in advance, we need to use reflection + enumArr := valueOfValue.Slice(0, valueOfValue.Len()) + if _, ok := enumArr.Index(0).Interface().(kiotaEnum); ok { + // testing the first value is an enum to avoid iterating over the whole array if it's not + strRepresentations := make([]string, valueOfValue.Len()) + for i := range strRepresentations { + strRepresentations[i] = enumArr.Index(i).Interface().(kiotaEnum).String() + } + return strRepresentations + } else { + anySlice := make([]any, valueOfValue.Len()) + for i := range anySlice { + anySlice[i] = enumArr.Index(i).Interface() + } + return anySlice + } + } else if enum, ok := value.(kiotaEnum); ok { + return enum.String() + } + + if returnNilIfNotNormalizable { + return nil + } else { + return value + } +} + +type kiotaEnum interface { + String() string +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/request_option.go b/vendor/github.com/microsoft/kiota-abstractions-go/request_option.go new file mode 100644 index 000000000..b9c07089f --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/request_option.go @@ -0,0 +1,13 @@ +package abstractions + +// Represents a request option. +type RequestOption interface { + // GetKey returns the key to store the current option under. + GetKey() RequestOptionKey +} + +// RequestOptionKey represents a key to store a request option under. +type RequestOptionKey struct { + // The unique key for the option. + Key string +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/response_handler.go b/vendor/github.com/microsoft/kiota-abstractions-go/response_handler.go new file mode 100644 index 000000000..58b733216 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/response_handler.go @@ -0,0 +1,4 @@ +package abstractions + +// ResponseHandler handler to implement when a request's response should be handled a specific way. +type ResponseHandler func(response interface{}, errorMappings ErrorMappings) (interface{}, error) diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/response_headers.go b/vendor/github.com/microsoft/kiota-abstractions-go/response_headers.go new file mode 100644 index 000000000..9aaad7487 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/response_headers.go @@ -0,0 +1,25 @@ +package abstractions + +//ResponseHeaders represents a collection of response headers +type ResponseHeaders struct { + header +} + +//NewResponseHeaders creates a new ResponseHeaders +func NewResponseHeaders() *ResponseHeaders { + return &ResponseHeaders{ + header{make(map[string]map[string]struct{})}, + } +} + +//AddAll adds all headers from the other headers +func (r *ResponseHeaders) AddAll(other *ResponseHeaders) { + if other == nil || other.headers == nil { + return + } + for k, v := range other.headers { + for k2 := range v { + r.Add(k, k2) + } + } +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/additional_data_holder.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/additional_data_holder.go new file mode 100644 index 000000000..3e7dcffb8 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/additional_data_holder.go @@ -0,0 +1,9 @@ +package serialization + +// AdditionalDataHolder defines a contract for models that can hold additional data besides the described properties. +type AdditionalDataHolder interface { + // GetAdditionalData returns additional data of the object that doesn't belong to a field. + GetAdditionalData() map[string]interface{} + // SetAdditionalData sets additional data of the object that doesn't belong to a field. + SetAdditionalData(value map[string]interface{}) +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/composed_type_wrapper.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/composed_type_wrapper.go new file mode 100644 index 000000000..8cef8dce3 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/composed_type_wrapper.go @@ -0,0 +1,7 @@ +package serialization + +// ComposedTypeWrapper defines a contract for models that are wrappers for composed types. +type ComposedTypeWrapper interface { + // GetIsComposedType returns true if the type is composed, false otherwise. + GetIsComposedType() bool +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/date_only.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/date_only.go new file mode 100644 index 000000000..a6c682734 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/date_only.go @@ -0,0 +1,39 @@ +package serialization + +import ( + "strings" + "time" +) + +// DateOnly is a struct that represents a date only from a date time (Time). +type DateOnly struct { + time time.Time +} + +const dateOnlyFormat = "2006-01-02" + +// String returns the date only as a string following the RFC3339 standard. +func (t DateOnly) String() string { + return t.time.Format(dateOnlyFormat) +} + +// ParseDateOnly parses a string into a DateOnly following the RFC3339 standard. +func ParseDateOnly(s string) (*DateOnly, error) { + if len(strings.TrimSpace(s)) <= 0 { + return nil, nil + } + timeValue, err := time.Parse(dateOnlyFormat, s) + if err != nil { + return nil, err + } + return &DateOnly{ + time: timeValue, + }, nil +} + +// NewDateOnly creates a new DateOnly from a time.Time. +func NewDateOnly(t time.Time) *DateOnly { + return &DateOnly{ + time: t, + } +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/iso_duration.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/iso_duration.go new file mode 100644 index 000000000..c06546c1e --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/iso_duration.go @@ -0,0 +1,123 @@ +package serialization + +import ( + "time" + + cjl "github.com/cjlapao/common-go/duration" +) + +// ISODuration represents an ISO 8601 duration +type ISODuration struct { + duration cjl.Duration +} + +// GetYears returns the number of years. +func (i ISODuration) GetYears() int { + return i.duration.Years +} + +// GetWeeks returns the number of weeks. +func (i ISODuration) GetWeeks() int { + return i.duration.Weeks +} + +// GetDays returns the number of days. +func (i ISODuration) GetDays() int { + return i.duration.Days +} + +// GetHours returns the number of hours. +func (i ISODuration) GetHours() int { + return i.duration.Hours +} + +// GetMinutes returns the number of minutes. +func (i ISODuration) GetMinutes() int { + return i.duration.Minutes +} + +// GetSeconds returns the number of seconds. +func (i ISODuration) GetSeconds() int { + return i.duration.Seconds +} + +// GetMilliSeconds returns the number of milliseconds. +func (i ISODuration) GetMilliSeconds() int { + return i.duration.MilliSeconds +} + +// SetYears sets the number of years. +func (i ISODuration) SetYears(years int) { + i.duration.Years = years +} + +// SetWeeks sets the number of weeks. +func (i ISODuration) SetWeeks(weeks int) { + i.duration.Weeks = weeks +} + +// SetDays sets the number of days. +func (i ISODuration) SetDays(days int) { + i.duration.Days = days +} + +// SetHours sets the number of hours. +func (i ISODuration) SetHours(hours int) { + i.duration.Hours = hours +} + +// SetMinutes sets the number of minutes. +func (i ISODuration) SetMinutes(minutes int) { + i.duration.Minutes = minutes +} + +// SetSeconds sets the number of seconds. +func (i ISODuration) SetSeconds(seconds int) { + i.duration.Seconds = seconds +} + +// SetMilliSeconds sets the number of milliseconds. +func (i ISODuration) SetMilliSeconds(milliSeconds int) { + i.duration.MilliSeconds = milliSeconds +} + +// ParseISODuration parses a string into an ISODuration following the ISO 8601 standard. +func ParseISODuration(s string) (*ISODuration, error) { + d, err := cjl.FromString(s) + if err != nil { + return nil, err + } + return &ISODuration{ + duration: *d, + }, nil +} + +// NewISODuration creates a new ISODuration from primitive values. +func NewDuration(years int, weeks int, days int, hours int, minutes int, seconds int, milliSeconds int) *ISODuration { + return &ISODuration{ + duration: cjl.Duration{ + Years: years, + Weeks: weeks, + Days: days, + Hours: hours, + Minutes: minutes, + Seconds: seconds, + MilliSeconds: milliSeconds, + }, + } +} + +// String returns the ISO 8601 representation of the duration. +func (i ISODuration) String() string { + return i.duration.String() +} + +// FromDuration returns an ISODuration from a time.Duration. +func FromDuration(d time.Duration) *ISODuration { + return NewDuration(0, 0, 0, 0, 0, 0, int(d.Truncate(time.Millisecond).Milliseconds())) +} + +// ToDuration returns the time.Duration representation of the ISODuration. +func (d ISODuration) ToDuration() (time.Duration, error) { + return d.duration.ToDuration() +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/kiota_json_serializer.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/kiota_json_serializer.go new file mode 100644 index 000000000..80aa59ef7 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/kiota_json_serializer.go @@ -0,0 +1,23 @@ +package serialization + +var jsonContentType = "application/json" + +// SerializeToJson serializes the given model to JSON +func SerializeToJson(model Parsable) ([]byte, error) { + return Serialize(jsonContentType, model) +} + +// SerializeCollectionToJson serializes the given models to JSON +func SerializeCollectionToJson(models []Parsable) ([]byte, error) { + return SerializeCollection(jsonContentType, models) +} + +// DeserializeFromJson deserializes the given JSON to a model +func DeserializeFromJson(content []byte, parsableFactory ParsableFactory) (Parsable, error) { + return Deserialize(jsonContentType, content, parsableFactory) +} + +// DeserializeCollectionFromJson deserializes the given JSON to a collection of models +func DeserializeCollectionFromJson(content []byte, parsableFactory ParsableFactory) ([]Parsable, error) { + return DeserializeCollection(jsonContentType, content, parsableFactory) +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/kiota_serializer.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/kiota_serializer.go new file mode 100644 index 000000000..7cc44c600 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/kiota_serializer.go @@ -0,0 +1,88 @@ +package serialization + +import ( + "errors" +) + +// Serialize serializes the given model into a byte array. +func Serialize(contentType string, model Parsable) ([]byte, error) { + writer, err := getSerializationWriter(contentType, model) + if err != nil { + return nil, err + } + defer writer.Close() + err = writer.WriteObjectValue("", model) + if err != nil { + return nil, err + } + return writer.GetSerializedContent() +} + +// SerializeCollection serializes the given models into a byte array. +func SerializeCollection(contentType string, models []Parsable) ([]byte, error) { + writer, err := getSerializationWriter(contentType, models) + if err != nil { + return nil, err + } + defer writer.Close() + err = writer.WriteCollectionOfObjectValues("", models) + if err != nil { + return nil, err + } + return writer.GetSerializedContent() +} +func getSerializationWriter(contentType string, value interface{}) (SerializationWriter, error) { + if contentType == "" { + return nil, errors.New("the content type is empty") + } + if value == nil { + return nil, errors.New("the value is empty") + } + writer, err := DefaultSerializationWriterFactoryInstance.GetSerializationWriter(contentType) + if err != nil { + return nil, err + } + return writer, nil +} + +// Deserialize deserializes the given byte array into a model. +func Deserialize(contentType string, content []byte, parsableFactory ParsableFactory) (Parsable, error) { + node, err := getParseNode(contentType, content, parsableFactory) + if err != nil { + return nil, err + } + result, err := node.GetObjectValue(parsableFactory) + if err != nil { + return nil, err + } + return result, nil +} +func getParseNode(contentType string, content []byte, parsableFactory ParsableFactory) (ParseNode, error) { + if contentType == "" { + return nil, errors.New("the content type is empty") + } + if content == nil || len(content) == 0 { + return nil, errors.New("the content is empty") + } + if parsableFactory == nil { + return nil, errors.New("the parsable factory is empty") + } + node, err := DefaultParseNodeFactoryInstance.GetRootParseNode(contentType, content) + if err != nil { + return nil, err + } + return node, nil +} + +// DeserializeCollection deserializes the given byte array into a collection of models. +func DeserializeCollection(contentType string, content []byte, parsableFactory ParsableFactory) ([]Parsable, error) { + node, err := getParseNode(contentType, content, parsableFactory) + if err != nil { + return nil, err + } + result, err := node.GetCollectionOfObjectValues(parsableFactory) + if err != nil { + return nil, err + } + return result, nil +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parsable.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parsable.go new file mode 100644 index 000000000..a13066204 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parsable.go @@ -0,0 +1,18 @@ +package serialization + +// Parsable defines a serializable model object. +type Parsable interface { + // Serialize writes the objects properties to the current writer. + Serialize(writer SerializationWriter) error + // GetFieldDeserializers returns the deserialization information for this object. + GetFieldDeserializers() map[string]func(ParseNode) error +} + +// ParsableFactory is a factory for creating Parsable. +type ParsableFactory func(parseNode ParseNode) (Parsable, error) + +// EnumFactory is a factory for creating Enum. +type EnumFactory func(string) (interface{}, error) + +// NodeParser defines serializer's parse executor +type NodeParser func(ParseNode) error diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parse_node.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parse_node.go new file mode 100644 index 000000000..35f9a26a1 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parse_node.go @@ -0,0 +1,61 @@ +package serialization + +import ( + "time" + + "github.com/google/uuid" +) + +// ParseNode Interface for a deserialization node in a parse tree. This interface provides an abstraction layer over serialization formats, libraries and implementations. +type ParseNode interface { + // GetChildNode returns a new parse node for the given identifier. + GetChildNode(index string) (ParseNode, error) + // GetCollectionOfObjectValues returns the collection of Parsable values from the node. + GetCollectionOfObjectValues(ctor ParsableFactory) ([]Parsable, error) + // GetCollectionOfPrimitiveValues returns the collection of primitive values from the node. + GetCollectionOfPrimitiveValues(targetType string) ([]interface{}, error) + // GetCollectionOfEnumValues returns the collection of Enum values from the node. + GetCollectionOfEnumValues(parser EnumFactory) ([]interface{}, error) + // GetObjectValue returns the Parsable value from the node. + GetObjectValue(ctor ParsableFactory) (Parsable, error) + // GetStringValue returns a String value from the nodes. + GetStringValue() (*string, error) + // GetBoolValue returns a Bool value from the nodes. + GetBoolValue() (*bool, error) + // GetInt8Value returns a int8 value from the nodes. + GetInt8Value() (*int8, error) + // GetByteValue returns a Byte value from the nodes. + GetByteValue() (*byte, error) + // GetFloat32Value returns a Float32 value from the nodes. + GetFloat32Value() (*float32, error) + // GetFloat64Value returns a Float64 value from the nodes. + GetFloat64Value() (*float64, error) + // GetInt32Value returns a Int32 value from the nodes. + GetInt32Value() (*int32, error) + // GetInt64Value returns a Int64 value from the nodes. + GetInt64Value() (*int64, error) + // GetTimeValue returns a Time value from the nodes. + GetTimeValue() (*time.Time, error) + // GetISODurationValue returns a ISODuration value from the nodes. + GetISODurationValue() (*ISODuration, error) + // GetTimeOnlyValue returns a TimeOnly value from the nodes. + GetTimeOnlyValue() (*TimeOnly, error) + // GetDateOnlyValue returns a DateOnly value from the nodes. + GetDateOnlyValue() (*DateOnly, error) + // GetUUIDValue returns a UUID value from the nodes. + GetUUIDValue() (*uuid.UUID, error) + // GetEnumValue returns a Enum value from the nodes. + GetEnumValue(parser EnumFactory) (interface{}, error) + // GetByteArrayValue returns a ByteArray value from the nodes. + GetByteArrayValue() ([]byte, error) + // GetRawValue returns the values of the node as an interface of any type. + GetRawValue() (interface{}, error) + // GetOnBeforeAssignFieldValues returns a callback invoked before the node is deserialized. + GetOnBeforeAssignFieldValues() ParsableAction + // SetOnBeforeAssignFieldValues sets a callback invoked before the node is deserialized. + SetOnBeforeAssignFieldValues(ParsableAction) error + // GetOnAfterAssignFieldValues returns a callback invoked after the node is deserialized. + GetOnAfterAssignFieldValues() ParsableAction + // SetOnAfterAssignFieldValues sets a callback invoked after the node is deserialized. + SetOnAfterAssignFieldValues(ParsableAction) error +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parse_node_factory.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parse_node_factory.go new file mode 100644 index 000000000..82695faa6 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parse_node_factory.go @@ -0,0 +1,9 @@ +package serialization + +// ParseNodeFactory defines the contract for a factory that creates new ParseNode. +type ParseNodeFactory interface { + // GetValidContentType returns the content type this factory's parse nodes can deserialize. + GetValidContentType() (string, error) + // GetRootParseNode return a new ParseNode instance that is the root of the content + GetRootParseNode(contentType string, content []byte) (ParseNode, error) +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parse_node_factory_registry.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parse_node_factory_registry.go new file mode 100644 index 000000000..4230b4f83 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parse_node_factory_registry.go @@ -0,0 +1,64 @@ +package serialization + +import ( + "errors" + re "regexp" + "strings" + "sync" +) + +// ParseNodeFactoryRegistry holds a list of all the registered factories for the various types of nodes. +type ParseNodeFactoryRegistry struct { + lock *sync.Mutex + + // ContentTypeAssociatedFactories maps content types onto the relevant factory. + // + // When interacting with this field, please make use of Lock and Unlock methods to ensure thread safety. + ContentTypeAssociatedFactories map[string]ParseNodeFactory +} + +func NewParseNodeFactoryRegistry() *ParseNodeFactoryRegistry { + return &ParseNodeFactoryRegistry{ + lock: &sync.Mutex{}, + ContentTypeAssociatedFactories: make(map[string]ParseNodeFactory), + } +} + +// DefaultParseNodeFactoryInstance is the default singleton instance of the registry to be used when registering new factories that should be available by default. +var DefaultParseNodeFactoryInstance = NewParseNodeFactoryRegistry() + +// GetValidContentType returns the valid content type for the ParseNodeFactoryRegistry +func (m *ParseNodeFactoryRegistry) GetValidContentType() (string, error) { + return "", errors.New("the registry supports multiple content types. Get the registered factory instead") +} + +var contentTypeVendorCleanupPattern = re.MustCompile("[^/]+\\+") + +// GetRootParseNode returns a new ParseNode instance that is the root of the content +func (m *ParseNodeFactoryRegistry) GetRootParseNode(contentType string, content []byte) (ParseNode, error) { + if contentType == "" { + return nil, errors.New("contentType is required") + } + if content == nil { + return nil, errors.New("content is required") + } + vendorSpecificContentType := strings.Split(contentType, ";")[0] + factory, ok := m.ContentTypeAssociatedFactories[vendorSpecificContentType] + if ok { + return factory.GetRootParseNode(vendorSpecificContentType, content) + } + cleanedContentType := contentTypeVendorCleanupPattern.ReplaceAllString(vendorSpecificContentType, "") + factory, ok = m.ContentTypeAssociatedFactories[cleanedContentType] + if ok { + return factory.GetRootParseNode(cleanedContentType, content) + } + return nil, errors.New("content type " + cleanedContentType + " does not have a factory registered to be parsed") +} + +func (m *ParseNodeFactoryRegistry) Lock() { + m.lock.Lock() +} + +func (m *ParseNodeFactoryRegistry) Unlock() { + m.lock.Unlock() +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parse_node_helper.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parse_node_helper.go new file mode 100644 index 000000000..a1102992e --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parse_node_helper.go @@ -0,0 +1,24 @@ +package serialization + +import "errors" + +// MergeDeserializersForIntersectionWrapper merges the given fields deserializers for an intersection type into a single collection. +func MergeDeserializersForIntersectionWrapper(targets ...Parsable) (map[string]func(ParseNode) error, error) { + if len(targets) == 0 { + return nil, errors.New("no targets provided") + } + if len(targets) == 1 { + return targets[0].GetFieldDeserializers(), nil + } + deserializers := make(map[string]func(ParseNode) error) + for _, target := range targets { + if target != nil { + for key, deserializer := range target.GetFieldDeserializers() { + if _, ok := deserializers[key]; !ok { + deserializers[key] = deserializer + } + } + } + } + return deserializers, nil +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parse_node_proxy_factory.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parse_node_proxy_factory.go new file mode 100644 index 000000000..28bd5b5a1 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/parse_node_proxy_factory.go @@ -0,0 +1,73 @@ +package serialization + +type ParseNodeProxyFactory struct { + factory ParseNodeFactory + onBeforeAction ParsableAction + onAfterAction ParsableAction +} + +// NewParseNodeProxyFactory constructs a new instance of ParseNodeProxyFactory +func NewParseNodeProxyFactory( + factory ParseNodeFactory, + onBeforeAction ParsableAction, + onAfterAction ParsableAction, +) *ParseNodeProxyFactory { + return &ParseNodeProxyFactory{ + factory: factory, + onBeforeAction: onBeforeAction, + onAfterAction: onAfterAction, + } +} + +func (p *ParseNodeProxyFactory) GetValidContentType() (string, error) { + return p.factory.GetValidContentType() +} + +func (p *ParseNodeProxyFactory) GetRootParseNode(contentType string, content []byte) (ParseNode, error) { + node, err := p.factory.GetRootParseNode(contentType, content) + if err != nil { + return nil, err + } + + originalBefore := node.GetOnBeforeAssignFieldValues() + err = node.SetOnBeforeAssignFieldValues(func(parsable Parsable) error { + if parsable != nil { + err := p.onBeforeAction(parsable) + if err != nil { + return err + } + } + if originalBefore != nil { + err := originalBefore(parsable) + if err != nil { + return err + } + } + return nil + }) + if err != nil { + return nil, err + } + + originalAfter := node.GetOnAfterAssignFieldValues() + err = node.SetOnAfterAssignFieldValues(func(parsable Parsable) error { + if p != nil { + err := p.onBeforeAction(parsable) + if err != nil { + return err + } + } + if originalAfter != nil { + err := originalAfter(parsable) + if err != nil { + return err + } + } + return nil + }) + if err != nil { + return nil, err + } + + return node, nil +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/serialization_writer.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/serialization_writer.go new file mode 100644 index 000000000..df9e92804 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/serialization_writer.go @@ -0,0 +1,91 @@ +package serialization + +import ( + i "io" + "time" + + "github.com/google/uuid" +) + +// SerializationWriter defines an interface for serialization of models to a byte array. +type SerializationWriter interface { + i.Closer + // WriteStringValue writes a String value to underlying the byte array. + WriteStringValue(key string, value *string) error + // WriteBoolValue writes a Bool value to underlying the byte array. + WriteBoolValue(key string, value *bool) error + // WriteInt8Value writes a int8 value to underlying the byte array. + WriteInt8Value(key string, value *int8) error + // WriteByteValue writes a Byte value to underlying the byte array. + WriteByteValue(key string, value *byte) error + // WriteInt32Value writes a Int32 value to underlying the byte array. + WriteInt32Value(key string, value *int32) error + // WriteInt64Value writes a Int64 value to underlying the byte array. + WriteInt64Value(key string, value *int64) error + // WriteFloat32Value writes a Float32 value to underlying the byte array. + WriteFloat32Value(key string, value *float32) error + // WriteFloat64Value writes a Float64 value to underlying the byte array. + WriteFloat64Value(key string, value *float64) error + // WriteByteArrayValue writes a ByteArray value to underlying the byte array. + WriteByteArrayValue(key string, value []byte) error + // WriteTimeValue writes a Time value to underlying the byte array. + WriteTimeValue(key string, value *time.Time) error + // WriteTimeOnlyValue writes the time part of a Time value to underlying the byte array. + WriteTimeOnlyValue(key string, value *TimeOnly) error + // WriteDateOnlyValue writes the date part of a Time value to underlying the byte array. + WriteDateOnlyValue(key string, value *DateOnly) error + // WriteISODurationValue writes a ISODuration value to underlying the byte array. + WriteISODurationValue(key string, value *ISODuration) error + // WriteUUIDValue writes a UUID value to underlying the byte array. + WriteUUIDValue(key string, value *uuid.UUID) error + // WriteObjectValue writes a Parsable value to underlying the byte array. + WriteObjectValue(key string, item Parsable, additionalValuesToMerge ...Parsable) error + // WriteCollectionOfObjectValues writes a collection of Parsable values to underlying the byte array. + WriteCollectionOfObjectValues(key string, collection []Parsable) error + // WriteCollectionOfStringValues writes a collection of String values to underlying the byte array. + WriteCollectionOfStringValues(key string, collection []string) error + // WriteCollectionOfBoolValues writes a collection of Bool values to underlying the byte array. + WriteCollectionOfBoolValues(key string, collection []bool) error + // WriteCollectionOfInt8Values writes a collection of Int8 values to underlying the byte array. + WriteCollectionOfInt8Values(key string, collection []int8) error + // WriteCollectionOfByteValues writes a collection of Byte values to underlying the byte array. + WriteCollectionOfByteValues(key string, collection []byte) error + // WriteCollectionOfInt32Values writes a collection of Int32 values to underlying the byte array. + WriteCollectionOfInt32Values(key string, collection []int32) error + // WriteCollectionOfInt64Values writes a collection of Int64 values to underlying the byte array. + WriteCollectionOfInt64Values(key string, collection []int64) error + // WriteCollectionOfFloat32Values writes a collection of Float32 values to underlying the byte array. + WriteCollectionOfFloat32Values(key string, collection []float32) error + // WriteCollectionOfFloat64Values writes a collection of Float64 values to underlying the byte array. + WriteCollectionOfFloat64Values(key string, collection []float64) error + // WriteCollectionOfTimeValues writes a collection of Time values to underlying the byte array. + WriteCollectionOfTimeValues(key string, collection []time.Time) error + // WriteCollectionOfISODurationValues writes a collection of ISODuration values to underlying the byte array. + WriteCollectionOfISODurationValues(key string, collection []ISODuration) error + // WriteCollectionOfDateOnlyValues writes a collection of DateOnly values to underlying the byte array. + WriteCollectionOfDateOnlyValues(key string, collection []DateOnly) error + // WriteCollectionOfTimeOnlyValues writes a collection of TimeOnly values to underlying the byte array. + WriteCollectionOfTimeOnlyValues(key string, collection []TimeOnly) error + // WriteCollectionOfUUIDValues writes a collection of UUID values to underlying the byte array. + WriteCollectionOfUUIDValues(key string, collection []uuid.UUID) error + // GetSerializedContent returns the resulting byte array from the serialization writer. + GetSerializedContent() ([]byte, error) + // WriteNullValue writes a null value for the specified key. + WriteNullValue(key string) error + // WriteAdditionalData writes additional data to underlying the byte array. + WriteAdditionalData(value map[string]interface{}) error + // WriteAnyValue an object of unknown type as a json value + WriteAnyValue(key string, value interface{}) error + // GetOnBeforeSerialization returns a callback invoked before the serialization process starts. + GetOnBeforeSerialization() ParsableAction + // SetOnBeforeSerialization sets a callback invoked before the serialization process starts. + SetOnBeforeSerialization(ParsableAction) error + // GetOnAfterObjectSerialization returns a callback invoked after the serialization process completes. + GetOnAfterObjectSerialization() ParsableAction + // SetOnAfterObjectSerialization sets a callback invoked after the serialization process completes. + SetOnAfterObjectSerialization(ParsableAction) error + // GetOnStartObjectSerialization returns a callback invoked right after the serialization process starts. + GetOnStartObjectSerialization() ParsableWriter + // SetOnStartObjectSerialization sets a callback invoked right after the serialization process starts. + SetOnStartObjectSerialization(ParsableWriter) error +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/serialization_writer_factory.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/serialization_writer_factory.go new file mode 100644 index 000000000..f7423aa72 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/serialization_writer_factory.go @@ -0,0 +1,9 @@ +package serialization + +// SerializationWriterFactory defines the contract for a factory that creates SerializationWriter instances. +type SerializationWriterFactory interface { + // GetValidContentType returns the valid content type for the SerializationWriterFactoryRegistry + GetValidContentType() (string, error) + // GetSerializationWriter returns the relevant SerializationWriter instance for the given content type + GetSerializationWriter(contentType string) (SerializationWriter, error) +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/serialization_writer_factory_registry.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/serialization_writer_factory_registry.go new file mode 100644 index 000000000..d6fcac668 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/serialization_writer_factory_registry.go @@ -0,0 +1,58 @@ +package serialization + +import ( + "errors" + "strings" + "sync" +) + +// SerializationWriterFactoryRegistry is a factory holds a list of all the registered factories for the various types of nodes. +type SerializationWriterFactoryRegistry struct { + lock *sync.Mutex + + // ContentTypeAssociatedFactories list of factories that are registered by content type. + // + // When interacting with this field, please make use of Lock and Unlock methods to ensure thread safety. + ContentTypeAssociatedFactories map[string]SerializationWriterFactory +} + +func NewSerializationWriterFactoryRegistry() *SerializationWriterFactoryRegistry { + return &SerializationWriterFactoryRegistry{ + lock: &sync.Mutex{}, + ContentTypeAssociatedFactories: make(map[string]SerializationWriterFactory), + } +} + +// DefaultSerializationWriterFactoryInstance is the default singleton instance of the registry to be used when registering new factories that should be available by default. +var DefaultSerializationWriterFactoryInstance = NewSerializationWriterFactoryRegistry() + +// GetValidContentType returns the valid content type for the SerializationWriterFactoryRegistry +func (m *SerializationWriterFactoryRegistry) GetValidContentType() (string, error) { + return "", errors.New("the registry supports multiple content types. Get the registered factory instead") +} + +// GetSerializationWriter returns the relevant SerializationWriter instance for the given content type +func (m *SerializationWriterFactoryRegistry) GetSerializationWriter(contentType string) (SerializationWriter, error) { + if contentType == "" { + return nil, errors.New("the content type is empty") + } + vendorSpecificContentType := strings.Split(contentType, ";")[0] + factory, ok := m.ContentTypeAssociatedFactories[vendorSpecificContentType] + if ok { + return factory.GetSerializationWriter(contentType) + } + cleanedContentType := contentTypeVendorCleanupPattern.ReplaceAllString(vendorSpecificContentType, "") + factory, ok = m.ContentTypeAssociatedFactories[cleanedContentType] + if ok { + return factory.GetSerializationWriter(cleanedContentType) + } + return nil, errors.New("Content type " + cleanedContentType + " does not have a factory registered to be parsed") +} + +func (m *SerializationWriterFactoryRegistry) Lock() { + m.lock.Lock() +} + +func (m *SerializationWriterFactoryRegistry) Unlock() { + m.lock.Unlock() +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/serialization_writer_proxy_factory.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/serialization_writer_proxy_factory.go new file mode 100644 index 000000000..8f5e360cf --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/serialization_writer_proxy_factory.go @@ -0,0 +1,102 @@ +package serialization + +// ParsableAction Encapsulates a method with a single Parsable parameter +type ParsableAction func(Parsable) error + +// ParsableWriter Encapsulates a method that receives a Parsable and SerializationWriter as parameters +type ParsableWriter func(Parsable, SerializationWriter) error + +// SerializationWriterProxyFactory factory that allows the composition of before and after callbacks on existing factories. +type SerializationWriterProxyFactory struct { + factory SerializationWriterFactory + onBeforeAction ParsableAction + onAfterAction ParsableAction + onSerializationStart ParsableWriter +} + +// NewSerializationWriterProxyFactory constructs a new instance of SerializationWriterProxyFactory +func NewSerializationWriterProxyFactory( + factory SerializationWriterFactory, + onBeforeAction ParsableAction, + onAfterAction ParsableAction, + onSerializationStart ParsableWriter, +) *SerializationWriterProxyFactory { + return &SerializationWriterProxyFactory{ + factory: factory, + onBeforeAction: onBeforeAction, + onAfterAction: onAfterAction, + onSerializationStart: onSerializationStart, + } +} + +func (s *SerializationWriterProxyFactory) GetValidContentType() (string, error) { + return s.factory.GetValidContentType() +} + +func (s *SerializationWriterProxyFactory) GetSerializationWriter(contentType string) (SerializationWriter, error) { + writer, err := s.factory.GetSerializationWriter(contentType) + if err != nil { + return nil, err + } + + originalBefore := writer.GetOnBeforeSerialization() + err = writer.SetOnBeforeSerialization(func(parsable Parsable) error { + if s != nil { + err := s.onBeforeAction(parsable) + if err != nil { + return err + } + } + if originalBefore != nil { + err := originalBefore(parsable) + if err != nil { + return err + } + } + return nil + }) + if err != nil { + return nil, err + } + originalAfter := writer.GetOnAfterObjectSerialization() + err = writer.SetOnAfterObjectSerialization(func(parsable Parsable) error { + if s != nil { + err := s.onAfterAction(parsable) + if err != nil { + return err + } + } + if originalAfter != nil { + err := originalAfter(parsable) + if err != nil { + return err + } + } + return nil + }) + if err != nil { + return nil, err + } + + originalStart := writer.GetOnStartObjectSerialization() + err = writer.SetOnStartObjectSerialization(func(parsable Parsable, writer SerializationWriter) error { + if s != nil { + err := s.onSerializationStart(parsable, writer) + if err != nil { + return err + } + } + if originalBefore != nil { + err := originalStart(parsable, writer) + if err != nil { + return err + } + } + return nil + }) + if err != nil { + return nil, err + } + + return writer, nil +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/time_only.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/time_only.go new file mode 100644 index 000000000..92f30336c --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/time_only.go @@ -0,0 +1,62 @@ +package serialization + +import ( + "errors" + "strings" + "time" +) + +// TimeOnly is represents the time part of a date time (time) value. +type TimeOnly struct { + time time.Time +} + +const timeOnlyFormat = "15:04:05.000000000" + +var timeOnlyParsingFormats = map[int]string{ + 0: "15:04:05", //Go doesn't seem to support optional parameters in time.Parse, which is sad + 1: "15:04:05.0", + 2: "15:04:05.00", + 3: "15:04:05.000", + 4: "15:04:05.0000", + 5: "15:04:05.00000", + 6: "15:04:05.000000", + 7: "15:04:05.0000000", + 8: "15:04:05.00000000", + 9: timeOnlyFormat, +} + +// String returns the time only as a string following the RFC3339 standard. +func (t TimeOnly) String() string { + return t.time.Format(timeOnlyFormat) +} + +// ParseTimeOnly parses a string into a TimeOnly following the RFC3339 standard. +func ParseTimeOnly(s string) (*TimeOnly, error) { + if len(strings.TrimSpace(s)) <= 0 { + return nil, nil + } + splat := strings.Split(s, ".") + parsingFormat := timeOnlyParsingFormats[0] + if len(splat) > 1 { + dotSectionLen := len(splat[1]) + if dotSectionLen >= len(timeOnlyParsingFormats) { + return nil, errors.New("too many decimal places in time only string") + } + parsingFormat = timeOnlyParsingFormats[dotSectionLen] + } + timeValue, err := time.Parse(parsingFormat, s) + if err != nil { + return nil, err + } + return &TimeOnly{ + time: timeValue, + }, nil +} + +// NewTimeOnly creates a new TimeOnly from a time.Time. +func NewTimeOnly(t time.Time) *TimeOnly { + return &TimeOnly{ + time: t, + } +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_array.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_array.go new file mode 100644 index 000000000..3a46606a3 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_array.go @@ -0,0 +1,18 @@ +package serialization + +// UntypedArray defines an untyped collection. +type UntypedArray struct { + UntypedNode +} + +// GetValue returns a collection of UntypedNode. +func (un *UntypedArray) GetValue() []UntypedNodeable { + return un.value.([]UntypedNodeable) +} + +// NewUntypedArray creates a new UntypedArray object. +func NewUntypedArray(collection []UntypedNodeable) *UntypedArray { + m := &UntypedArray{} + m.value = collection + return m +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_boolean.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_boolean.go new file mode 100644 index 000000000..c7636407b --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_boolean.go @@ -0,0 +1,22 @@ +package serialization + +// UntypedBoolean defines an untyped boolean object. +type UntypedBoolean struct { + UntypedNode +} + +// GetValue returns the bool value. +func (un *UntypedBoolean) GetValue() *bool { + castValue, ok := un.value.(*bool) + if ok { + return castValue + } + return nil +} + +// NewUntypedBoolean creates a new UntypedBoolean object. +func NewUntypedBoolean(boolValue bool) *UntypedBoolean { + m := &UntypedBoolean{} + m.value = &boolValue + return m +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_double.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_double.go new file mode 100644 index 000000000..a1fabf63c --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_double.go @@ -0,0 +1,22 @@ +package serialization + +// UntypedDouble defines an untyped float64 object. +type UntypedDouble struct { + UntypedNode +} + +// GetValue returns the float64 value. +func (un *UntypedDouble) GetValue() *float64 { + castValue, ok := un.value.(*float64) + if ok { + return castValue + } + return nil +} + +// NewUntypedDouble creates a new UntypedDouble object. +func NewUntypedDouble(float64Value float64) *UntypedDouble { + m := &UntypedDouble{} + m.value = &float64Value + return m +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_float.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_float.go new file mode 100644 index 000000000..6d5f31303 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_float.go @@ -0,0 +1,22 @@ +package serialization + +// UntypedFloat defines an untyped float32 value. +type UntypedFloat struct { + UntypedNode +} + +// GetValue returns the float32 value. +func (un *UntypedFloat) GetValue() *float32 { + castValue, ok := un.value.(*float32) + if ok { + return castValue + } + return nil +} + +// NewUntypedFloat creates a new UntypedFloat object. +func NewUntypedFloat(float32Value float32) *UntypedFloat { + m := &UntypedFloat{} + m.value = &float32Value + return m +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_integer.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_integer.go new file mode 100644 index 000000000..126af28e1 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_integer.go @@ -0,0 +1,22 @@ +package serialization + +// UntypedInteger defines an untyped integer value. +type UntypedInteger struct { + UntypedNode +} + +// GetValue returns the int32 value. +func (un *UntypedInteger) GetValue() *int32 { + castValue, ok := un.value.(*int32) + if ok { + return castValue + } + return nil +} + +// NewUntypedInteger creates a new UntypedInteger object. +func NewUntypedInteger(int32Value int32) *UntypedInteger { + m := &UntypedInteger{} + m.value = &int32Value + return m +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_long.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_long.go new file mode 100644 index 000000000..616e07c69 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_long.go @@ -0,0 +1,22 @@ +package serialization + +// UntypedLong defines an untyped int64 value. +type UntypedLong struct { + UntypedNode +} + +// GetValue returns the int64 value. +func (un *UntypedLong) GetValue() *int64 { + castValue, ok := un.value.(*int64) + if ok { + return castValue + } + return nil +} + +// NewUntypedLong creates a new UntypedLong object. +func NewUntypedLong(int64Value int64) *UntypedLong { + m := &UntypedLong{} + m.value = &int64Value + return m +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_node.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_node.go new file mode 100644 index 000000000..c8c676585 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_node.go @@ -0,0 +1,44 @@ +package serialization + +type UntypedNodeable interface { + Parsable + GetIsUntypedNode() bool +} + +// Base model for an untyped object. +type UntypedNode struct { + value any +} + +// GetIsUntypedNode returns true if the node is untyped, false otherwise. +func (m *UntypedNode) GetIsUntypedNode() bool { + return true +} + +// GetValue gets the underlying object value. +func (m *UntypedNode) GetValue() any { + return m.value +} + +// Serialize writes the objects properties to the current writer. +func (m *UntypedNode) Serialize(writer SerializationWriter) error { + // Serialize the entity + return nil +} + +// GetFieldDeserializers returns the deserialization information for this object. +func (m *UntypedNode) GetFieldDeserializers() map[string]func(ParseNode) error { + return make(map[string]func(ParseNode) error) +} + +// NewUntypedNode instantiates a new untyped node and sets the default values. +func NewUntypedNode(value any) *UntypedNode { + m := &UntypedNode{} + m.value = value + return m +} + +// CreateUntypedNodeFromDiscriminatorValue a new untyped node and from a parse node. +func CreateUntypedNodeFromDiscriminatorValue(parseNode ParseNode) (Parsable, error) { + return NewUntypedNode(nil), nil +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_null.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_null.go new file mode 100644 index 000000000..ab6b64c7b --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_null.go @@ -0,0 +1,17 @@ +package serialization + +// UntypedNull defines a untyped nil object. +type UntypedNull struct { + UntypedNode +} + +// GetValue returns a nil value. +func (un *UntypedNull) GetValue() any { + return nil +} + +// NewUntypedString creates a new UntypedNull object. +func NewUntypedNull() *UntypedNull { + m := &UntypedNull{} + return m +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_object.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_object.go new file mode 100644 index 000000000..8b963dc55 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_object.go @@ -0,0 +1,22 @@ +package serialization + +// UntypedObject defines an untyped object. +type UntypedObject struct { + UntypedNode +} + +// GetValue gets a map of the properties of the object. +func (un *UntypedObject) GetValue() map[string]UntypedNodeable { + castValue, ok := un.value.(map[string]UntypedNodeable) + if ok { + return castValue + } + return nil +} + +// NewUntypedObject creates a new UntypedObject object. +func NewUntypedObject(properties map[string]UntypedNodeable) *UntypedObject { + m := &UntypedObject{} + m.value = properties + return m +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_string.go b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_string.go new file mode 100644 index 000000000..3acea5bfa --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/serialization/untyped_string.go @@ -0,0 +1,22 @@ +package serialization + +// UntypedString defines an untyped string object. +type UntypedString struct { + UntypedNode +} + +// GetValue returns the string object. +func (un *UntypedString) GetValue() *string { + castValue, ok := un.value.(*string) + if ok { + return castValue + } + return nil +} + +// NewUntypedString creates a new UntypedString object. +func NewUntypedString(stringValue string) *UntypedString { + m := &UntypedString{} + m.value = &stringValue + return m +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/sonar-project.properties b/vendor/github.com/microsoft/kiota-abstractions-go/sonar-project.properties new file mode 100644 index 000000000..62e832546 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=microsoft_kiota-abstractions-go +sonar.organization=microsoft +sonar.exclusions=**/*_test.go +sonar.test.inclusions=**/*_test.go +sonar.go.tests.reportPaths=result.out +sonar.go.coverage.reportPaths=cover.out \ No newline at end of file diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/store/backed_model.go b/vendor/github.com/microsoft/kiota-abstractions-go/store/backed_model.go new file mode 100644 index 000000000..e38bc5bf9 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/store/backed_model.go @@ -0,0 +1,7 @@ +package store + +// BackedModel defines methods for models that support a backing store +type BackedModel interface { + // GetBackingStore returns the store that is backing the model. + GetBackingStore() BackingStore +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/store/backing_store.go b/vendor/github.com/microsoft/kiota-abstractions-go/store/backing_store.go new file mode 100644 index 000000000..1f2ddf8a9 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/store/backing_store.go @@ -0,0 +1,49 @@ +package store + +// BackingStore Stores model information in a different location than the object properties. +// Implementations can provide dirty tracking capabilities, caching capabilities or integration with 3rd party stores. +type BackingStore interface { + + // Get return a value from the backing store based on its key. + // Returns null if the value hasn't changed and "ReturnOnlyChangedValues" is true + Get(key string) (interface{}, error) + + // Set or updates the stored value for the given key. + // Will trigger subscriptions callbacks. + Set(key string, value interface{}) error + + // Enumerate returns all the values stored in the backing store. Values will be filtered if "ReturnOnlyChangedValues" is true. + Enumerate() map[string]interface{} + + // EnumerateKeysForValuesChangedToNil returns the keys for all values that changed to null + EnumerateKeysForValuesChangedToNil() []string + + // Subscribe registers a listener to any data change happening. + // returns a subscriptionId which cah be used to reference the current subscription + Subscribe(callback BackingStoreSubscriber) string + + // SubscribeWithId registers a listener to any data change happening and assigns the given id + SubscribeWithId(callback BackingStoreSubscriber, subscriptionId string) error + + // Unsubscribe Removes a subscription from the store based on its subscription id. + Unsubscribe(subscriptionId string) error + + // Clear Removes the data stored in the backing store. Doesn't trigger any subscription. + Clear() + + // GetInitializationCompleted Track's status of object during serialization and deserialization. + // this property is used to initialize subscriber notifications + GetInitializationCompleted() bool + + // SetInitializationCompleted sets whether the initialization of the object and/or + // the initial deserialization has been completed to track whether objects have changed + SetInitializationCompleted(val bool) + + // GetReturnOnlyChangedValues is a flag that defines whether subscriber notifications should be sent only when + // data has been changed + GetReturnOnlyChangedValues() bool + + // SetReturnOnlyChangedValues Sets whether to return only values that have changed + // since the initialization of the object when calling the Get and Enumerate method + SetReturnOnlyChangedValues(val bool) +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/store/backing_store_factory.go b/vendor/github.com/microsoft/kiota-abstractions-go/store/backing_store_factory.go new file mode 100644 index 000000000..fdb237fdb --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/store/backing_store_factory.go @@ -0,0 +1,9 @@ +package store + +// BackingStoreFactory represents a factory function for a backing store +// initializes a new backing store object +type BackingStoreFactory func() BackingStore + +// BackingStoreFactoryInstance returns a backing store instance. +// if none exists an instance of InMemoryBackingStore is initialized and returned +var BackingStoreFactoryInstance BackingStoreFactory = NewInMemoryBackingStore diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/store/backing_store_parse_node_factory.go b/vendor/github.com/microsoft/kiota-abstractions-go/store/backing_store_parse_node_factory.go new file mode 100644 index 000000000..51a1d130c --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/store/backing_store_parse_node_factory.go @@ -0,0 +1,25 @@ +package store + +import "github.com/microsoft/kiota-abstractions-go/serialization" + +// BackingStoreParseNodeFactory Backing Store implementation for serialization.ParseNodeFactory +type BackingStoreParseNodeFactory struct { + serialization.ParseNodeFactory +} + +// NewBackingStoreParseNodeFactory Initializes a new instance of BackingStoreParseNodeFactory +func NewBackingStoreParseNodeFactory(factory serialization.ParseNodeFactory) *BackingStoreParseNodeFactory { + proxyFactory := serialization.NewParseNodeProxyFactory(factory, func(parsable serialization.Parsable) error { + if backedModel, ok := parsable.(BackedModel); ok && backedModel.GetBackingStore() != nil { + backedModel.GetBackingStore().SetInitializationCompleted(false) + } + return nil + }, func(parsable serialization.Parsable) error { + if backedModel, ok := parsable.(BackedModel); ok && backedModel.GetBackingStore() != nil { + backedModel.GetBackingStore().SetInitializationCompleted(true) + } + return nil + }) + + return &BackingStoreParseNodeFactory{proxyFactory} +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/store/backing_store_serialization_writer_proxy_factory.go b/vendor/github.com/microsoft/kiota-abstractions-go/store/backing_store_serialization_writer_proxy_factory.go new file mode 100644 index 000000000..e6343caec --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/store/backing_store_serialization_writer_proxy_factory.go @@ -0,0 +1,52 @@ +package store + +import ( + "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// BackingStoreSerializationWriterProxyFactory Backing Store implementation for serialization.SerializationWriterFactory +type BackingStoreSerializationWriterProxyFactory struct { + factory serialization.SerializationWriterFactory +} + +func (b *BackingStoreSerializationWriterProxyFactory) GetValidContentType() (string, error) { + return b.factory.GetValidContentType() +} + +func (b *BackingStoreSerializationWriterProxyFactory) GetSerializationWriter(contentType string) (serialization.SerializationWriter, error) { + return b.factory.GetSerializationWriter(contentType) +} + +// NewBackingStoreSerializationWriterProxyFactory Initializes a new instance of BackingStoreSerializationWriterProxyFactory +func NewBackingStoreSerializationWriterProxyFactory(factory serialization.SerializationWriterFactory) *BackingStoreSerializationWriterProxyFactory { + proxyFactory := serialization.NewSerializationWriterProxyFactory(factory, func(parsable serialization.Parsable) error { + if backedModel, ok := parsable.(BackedModel); ok && backedModel.GetBackingStore() != nil { + backedModel.GetBackingStore().SetReturnOnlyChangedValues(true) + } + return nil + }, func(parsable serialization.Parsable) error { + if backedModel, ok := parsable.(BackedModel); ok && backedModel.GetBackingStore() != nil { + store := backedModel.GetBackingStore() + store.SetReturnOnlyChangedValues(false) + store.SetInitializationCompleted(true) + } + return nil + }, func(parsable serialization.Parsable, writer serialization.SerializationWriter) error { + if backedModel, ok := parsable.(BackedModel); ok && backedModel.GetBackingStore() != nil { + + nilValues := backedModel.GetBackingStore().EnumerateKeysForValuesChangedToNil() + for _, k := range nilValues { + err := writer.WriteNullValue(k) + if err != nil { + return err + } + } + } + + return nil + }) + + return &BackingStoreSerializationWriterProxyFactory{ + factory: proxyFactory, + } +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/store/inmemory_backing_store.go b/vendor/github.com/microsoft/kiota-abstractions-go/store/inmemory_backing_store.go new file mode 100644 index 000000000..569851953 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/store/inmemory_backing_store.go @@ -0,0 +1,159 @@ +package store + +import ( + "errors" + "reflect" + "strings" + + "github.com/google/uuid" +) + +// BackingStoreSubscriber is a function signature for a listener to any changes to a backing store +// It takes a `key` that represents the name of the object that's changed, +// `oldVal` is the previous value +// `newVal` is the newly assigned value +type BackingStoreSubscriber func(key string, oldVal interface{}, newVal interface{}) + +type InMemoryBackingStore struct { + returnOnlyChangedValues bool + initializationCompleted bool + store map[string]interface{} + subscribers map[string]BackingStoreSubscriber + changedValues map[string]bool +} + +// NewInMemoryBackingStore returns a new instance of an in memory backing store +// this function also provides an implementation of a BackingStoreFactory +func NewInMemoryBackingStore() BackingStore { + return &InMemoryBackingStore{ + returnOnlyChangedValues: false, + initializationCompleted: true, + store: make(map[string]interface{}), + subscribers: make(map[string]BackingStoreSubscriber), + changedValues: make(map[string]bool), + } +} + +func (i *InMemoryBackingStore) Get(key string) (interface{}, error) { + key = strings.TrimSpace(key) + if key == "" { + return nil, errors.New("key cannot be an empty string") + } + + objectVal := i.store[key] + + if (i.GetReturnOnlyChangedValues() && i.changedValues[key]) || !i.GetReturnOnlyChangedValues() { + return objectVal, nil + } else { + return nil, nil + } +} + +func (i *InMemoryBackingStore) Set(key string, value interface{}) error { + key = strings.TrimSpace(key) + if key == "" { + return errors.New("key cannot be an empty string") + } + + current := i.store[key] + + // check if objects values have changed + if current == nil || hasChanged(current, value) { + // track changed key + i.changedValues[key] = i.GetInitializationCompleted() + + // update changed values + i.store[key] = value + + // notify subs + for _, subscriber := range i.subscribers { + subscriber(key, current, value) + } + } + + return nil +} + +func hasChanged(current interface{}, value interface{}) bool { + kind := reflect.ValueOf(current).Kind() + if kind == reflect.Map || kind == reflect.Slice || kind == reflect.Struct { + return !reflect.DeepEqual(current, value) + } else { + return current != value + } +} + +func (i *InMemoryBackingStore) Enumerate() map[string]interface{} { + items := make(map[string]interface{}) + + for k, v := range i.store { + if !i.GetReturnOnlyChangedValues() || i.changedValues[k] { // change flag not set or object changed + items[k] = v + } + } + + return items +} + +func (i *InMemoryBackingStore) EnumerateKeysForValuesChangedToNil() []string { + keys := make([]string, 0) + for k, v := range i.store { + valueOfV := reflect.ValueOf(v) + if i.changedValues[k] && (v == nil || valueOfV.Kind() == reflect.Ptr && valueOfV.IsNil()) { + keys = append(keys, k) + } + } + + return keys +} + +func (i *InMemoryBackingStore) Subscribe(callback BackingStoreSubscriber) string { + id := uuid.New().String() + i.subscribers[id] = callback + return id +} + +func (i *InMemoryBackingStore) SubscribeWithId(callback BackingStoreSubscriber, subscriptionId string) error { + subscriptionId = strings.TrimSpace(subscriptionId) + if subscriptionId == "" { + return errors.New("subscriptionId cannot be an empty string") + } + + i.subscribers[subscriptionId] = callback + + return nil +} + +func (i *InMemoryBackingStore) Unsubscribe(subscriptionId string) error { + subscriptionId = strings.TrimSpace(subscriptionId) + if subscriptionId == "" { + return errors.New("subscriptionId cannot be an empty string") + } + + delete(i.subscribers, subscriptionId) + + return nil +} + +func (i *InMemoryBackingStore) Clear() { + for k := range i.store { + delete(i.store, k) + delete(i.changedValues, k) // changed values must be an element in the store + } +} + +func (i *InMemoryBackingStore) GetInitializationCompleted() bool { + return i.initializationCompleted +} + +func (i *InMemoryBackingStore) SetInitializationCompleted(val bool) { + i.initializationCompleted = val +} + +func (i *InMemoryBackingStore) GetReturnOnlyChangedValues() bool { + return i.returnOnlyChangedValues +} + +func (i *InMemoryBackingStore) SetReturnOnlyChangedValues(val bool) { + i.returnOnlyChangedValues = val +} diff --git a/vendor/github.com/microsoft/kiota-abstractions-go/utils.go b/vendor/github.com/microsoft/kiota-abstractions-go/utils.go new file mode 100644 index 000000000..bcc851f83 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-abstractions-go/utils.go @@ -0,0 +1,372 @@ +package abstractions + +import ( + "github.com/google/uuid" + "github.com/microsoft/kiota-abstractions-go/serialization" + "time" +) + +// SetValue receives a source function and applies the results to the setter +// +// source is any function that produces (*T, error) +// setter recipient function of the result of the source if no error is produces +func SetValue[T interface{}](source func() (*T, error), setter func(t *T)) error { + val, err := source() + if err != nil { + return err + } + if val != nil { + setter(val) + } + return nil +} + +// SetObjectValueFromSource takes a generic source with a discriminator receiver, reads value and writes it to a setter +// +// `source func() (*T, error)` is a generic getter with possible error response. +// `setter func(t *T)` generic function that can write a value from the source +func SetObjectValueFromSource[T interface{}](source func(ctor serialization.ParsableFactory) (serialization.Parsable, error), ctor serialization.ParsableFactory, setter func(t T)) error { + val, err := source(ctor) + if err != nil { + return err + } + if val != nil { + res := (val).(T) + setter(res) + } + return nil +} + +// SetCollectionValue is a utility function that receives a collection that can be cast to Parsable and a function that expects the results +// +// source is any function that receives a `ParsableFactory` and returns a slice of Parsable or error +// ctor is a ParsableFactory +// setter is a recipient of the function results +func SetCollectionValue[T interface{}](source func(ctor serialization.ParsableFactory) ([]serialization.Parsable, error), ctor serialization.ParsableFactory, setter func(t []T)) error { + val, err := source(ctor) + if err != nil { + return err + } + if val != nil { + res := CollectionCast[T](val) + setter(res) + } + return nil +} + +// CollectionApply applies an operation to every element of the slice and returns a result of the modified collection +// +// is a slice of all the elementents to be mutated +// +// mutator applies an operation to the collection and returns a response of type `R` +func CollectionApply[T any, R interface{}](collection []T, mutator func(t T) R) []R { + cast := make([]R, len(collection)) + for i, v := range collection { + cast[i] = mutator(v) + } + return cast +} + +// SetReferencedEnumValue is a utility function that receives an enum getter , EnumFactory and applies a de-referenced result of the factory to a setter +// +// source is any function that receives a `EnumFactory` and returns an interface or error +// parser is an EnumFactory +// setter is a recipient of the function results +func SetReferencedEnumValue[T interface{}](source func(parser serialization.EnumFactory) (interface{}, error), parser serialization.EnumFactory, setter func(t *T)) error { + val, err := source(parser) + if err != nil { + return err + } + if val != nil { + res := (val).(*T) + setter(res) + } + return nil +} + +// SetCollectionOfReferencedEnumValue is a utility function that receives an enum collection source , EnumFactory and applies a de-referenced result of the factory to a setter +// +// source is any function that receives a `EnumFactory` and returns an interface or error +// parser is an EnumFactory +// setter is a recipient of the function results +func SetCollectionOfReferencedEnumValue[T interface{}](source func(parser serialization.EnumFactory) ([]interface{}, error), parser serialization.EnumFactory, setter func(t []*T)) error { + val, err := source(parser) + if err != nil { + return err + } + if val != nil { + res := CollectionApply(val, func(v interface{}) *T { return (v).(*T) }) + setter(res) + } + return nil +} + +// SetCollectionOfPrimitiveValue is a utility function that receives a collection of primitives , targetType and applies the result of the factory to a setter +// +// source is any function that receives a `EnumFactory` and returns an interface or error +// targetType is a string representing the type of result +// setter is a recipient of the function results +func SetCollectionOfPrimitiveValue[T interface{}](source func(targetType string) ([]interface{}, error), targetType string, setter func(t []T)) error { + val, err := source(targetType) + if err != nil { + return err + } + if val != nil { + res := CollectionCast[T](val) + setter(res) + } + return nil +} + +// SetCollectionOfReferencedPrimitiveValue is a utility function that receives a collection of primitives , targetType and applies the re-referenced result of the factory to a setter +// +// source is any function that receives a `EnumFactory` and returns an interface or error +// parser is an EnumFactory +// setter is a recipient of the function results +func SetCollectionOfReferencedPrimitiveValue[T interface{}](source func(targetType string) ([]interface{}, error), targetType string, setter func(t []T)) error { + val, err := source(targetType) + if err != nil { + return err + } + if val != nil { + res := CollectionValueCast[T](val) + setter(res) + } + return nil +} + +func p[T interface{}](t T) *T { + return &t +} + +// GetValueOrDefault Converts a Pointer to a value or returns a default value +func GetValueOrDefault[T interface{}](source func() *T, defaultValue T) T { + result := source() + if result != nil { + return *result + } else { + return defaultValue + } +} + +// SetCollectionOfObjectValues returns an objects collection prototype for deserialization +func SetCollectionOfObjectValues[T interface{}](ctor serialization.ParsableFactory, setter func(t []T)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ctor) + if err != nil { + return err + } + if val != nil { + res := CollectionCast[T](val) + setter(res) + } + return nil + } +} + +// SetCollectionOfPrimitiveValues returns a primitive's collection prototype for deserialization +func SetCollectionOfPrimitiveValues[T interface{}](targetType string, setter func(t []T)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues(targetType) + if err != nil { + return err + } + if val != nil { + res := CollectionValueCast[T](val) + setter(res) + } + return nil + } +} + +// SetCollectionOfEnumValues returns an enum prototype for deserialization +func SetCollectionOfEnumValues[T interface{}](parser serialization.EnumFactory, setter func(t []T)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(parser) + if err != nil { + return err + } + if val != nil { + res := CollectionValueCast[T](val) + setter(res) + } + return nil + } +} + +// SetObjectValue returns an object prototype for deserialization +func SetObjectValue[T interface{}](ctor serialization.ParsableFactory, setter func(t T)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + return SetObjectValueFromSource(n.GetObjectValue, ctor, setter) + } +} + +// SetStringValue returns a string prototype for deserialization +func SetStringValue(setter func(t *string)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + return SetValue(n.GetStringValue, setter) + } +} + +// SetBoolValue returns a boolean prototype for deserialization +func SetBoolValue(setter func(t *bool)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + return SetValue(n.GetBoolValue, setter) + } +} + +// SetInt8Value Returns an int8 prototype for deserialization +func SetInt8Value(setter func(t *int8)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + return SetValue(n.GetInt8Value, setter) + } +} + +// SetByteValue returns a byte prototype for deserialization +func SetByteValue(setter func(t *byte)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + return SetValue(n.GetByteValue, setter) + } +} + +// SetFloat32Value returns a float32 prototype for deserialization +func SetFloat32Value(setter func(t *float32)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + return SetValue(n.GetFloat32Value, setter) + } +} + +// SetFloat64Value returns a float64 prototype for deserialization +func SetFloat64Value(setter func(t *float64)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + return SetValue(n.GetFloat64Value, setter) + } +} + +// SetInt32Value returns a int32 prototype for deserialization +func SetInt32Value(setter func(t *int32)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + return SetValue(n.GetInt32Value, setter) + } +} + +// SetInt64Value returns a int64 prototype for deserialization +func SetInt64Value(setter func(t *int64)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + return SetValue(n.GetInt64Value, setter) + } +} + +// SetTimeValue returns a time.Time prototype for deserialization +func SetTimeValue(setter func(t *time.Time)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + return SetValue(n.GetTimeValue, setter) + } +} + +// SetISODurationValue returns a ISODuration prototype for deserialization +func SetISODurationValue(setter func(t *serialization.ISODuration)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + return SetValue(n.GetISODurationValue, setter) + } +} + +// SetTimeOnlyValue returns a TimeOnly prototype for deserialization +func SetTimeOnlyValue(setter func(t *serialization.TimeOnly)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + return SetValue(n.GetTimeOnlyValue, setter) + } +} + +// SetDateOnlyValue returns a DateOnly prototype for deserialization +func SetDateOnlyValue(setter func(t *serialization.DateOnly)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + return SetValue(n.GetDateOnlyValue, setter) + } +} + +// SetUUIDValue returns a DateOnly prototype for deserialization +func SetUUIDValue(setter func(t *uuid.UUID)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + return SetValue(n.GetUUIDValue, setter) + } +} + +// SetEnumValue returns a Enum prototype for deserialization +func SetEnumValue[T interface{}](parser serialization.EnumFactory, setter func(t *T)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + return SetReferencedEnumValue(n.GetEnumValue, parser, setter) + } +} + +// SetByteArrayValue returns a []byte prototype for deserialization +func SetByteArrayValue(setter func(t []byte)) serialization.NodeParser { + return func(n serialization.ParseNode) error { + val, err := n.GetByteArrayValue() + if err != nil { + return err + } + if val != nil { + setter(val) + } + return nil + } +} + +// CollectionCast casts a collection of values from any type T to given type R +func CollectionCast[R interface{}, T any](items []T) []R { + cast := CollectionApply(items, func(v T) R { return any(v).(R) }) + return cast +} + +// CollectionValueCast casts a collection of values from any type T to given type R +// +// Value cast can be used to cast memory addresses to the value of the pointer +func CollectionValueCast[R interface{}, T any](items []T) []R { + cast := CollectionApply(items, func(v T) R { return *(any(v).(*R)) }) + return cast +} + +// CollectionStructCast casts a collection of values from any type T to given type R +// +// Value cast can be used to cast memory addresses to the value of the pointer +func CollectionStructCast[R interface{}, T any](items []T) []R { + cast := CollectionApply(items, func(v T) R { + temp := v + return any(&temp).(R) + }) + return cast +} + +// InvokeParsableAction nil safe execution of ParsableAction +func InvokeParsableAction(action serialization.ParsableAction, parsable serialization.Parsable) { + if action != nil { + action(parsable) + } +} + +// InvokeParsableWriter executes the ParsableAction in a nil safe way +func InvokeParsableWriter(writer serialization.ParsableWriter, parsable serialization.Parsable, serializer serialization.SerializationWriter) error { + if writer != nil { + return writer(parsable, serializer) + } + return nil +} + +// CopyMap returns a copy of map[string]string +func CopyMap[T comparable, R interface{}](items map[T]R) map[T]R { + result := make(map[T]R) + for idx, item := range items { + result[idx] = item + } + return result +} + +// CopyStringMap returns a copy of map[string]string +func CopyStringMap(items map[string]string) map[string]string { + result := make(map[string]string) + for idx, item := range items { + result[idx] = item + } + return result +} diff --git a/vendor/github.com/microsoft/kiota-http-go/.gitignore b/vendor/github.com/microsoft/kiota-http-go/.gitignore new file mode 100644 index 000000000..91b6d9f05 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/.gitignore @@ -0,0 +1,17 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +.idea diff --git a/vendor/github.com/microsoft/kiota-http-go/CHANGELOG.md b/vendor/github.com/microsoft/kiota-http-go/CHANGELOG.md new file mode 100644 index 000000000..da2b6b609 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/CHANGELOG.md @@ -0,0 +1,246 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added + +### Changed + +## [1.3.3] - 2024-03-19 + +- Fix bug where overriding http.DefaultTransport with an implementation other than http.Transport would result in an interface conversion panic + +### Changed + +## [1.3.2] - 2024-02-28 + +### Changed + +- Fix bug with headers inspection handler using wrong key. + +## [1.3.1] - 2024-02-09 + +### Changed + +- Fix bug that resulted in the error "content is empty" being returned instead of HTTP status information if the request returned no content and an unsuccessful status code. + +## [1.3.0] - 2024-01-22 + +### Added + +- Added support to override default middleware with function `GetDefaultMiddlewaresWithOptions`. + +## [1.2.1] - 2023-01-22 + +### Changed + +- Fix bug passing no timeout in client as 0 timeout in context . + +## [1.2.0] - 2024-01-22 + +### Added + +- Adds support for XXX status code. + +## [1.1.2] - 2024-01-20 + +### Changed + +- Changed the code by replacing ioutil.ReadAll and ioutil.NopCloser with io.ReadAll and io.NopCloser, respectively, due to their deprecation. + +## [1.1.1] - 2023-11-22 + +### Added + +- Added response headers and status code to returned error in `throwIfFailedResponse`. + +## [1.1.0] - 2023-08-11 + +### Added + +- Added headers inspection middleware and option. + +## [1.0.1] - 2023-07-19 + +### Changed + +- Bug Fix: Update Host for Redirect URL in go client. + +## [1.0.0] - 2023-05-04 + +### Changed + +- GA Release. + +## [0.17.0] - 2023-04-26 + +### Added + +- Adds Response Headers to the ApiError returned on Api requests errors. + +## [0.16.2] - 2023-04-17 + +### Added + +- Exit retry handler earlier if context is done. +- Adds exported method `ReplacePathTokens` that can be used to process url replacement logic globally. + +## [0.16.1] - 2023-03-20 + +### Added + +- Context deadline for requests defaults to client timeout when not provided. + +## [0.16.0] - 2023-03-01 + +### Added + +- Adds ResponseStatusCode to the ApiError returned on Api requests errors. + +## [0.15.0] - 2023-02-23 + +### Added + +- Added UrlReplaceHandler that replaces segments of the URL. + +## [0.14.0] - 2023-01-25 + +### Added + +- Added implementation methods for backing store. + +## [0.13.0] - 2023-01-10 + +### Added + +- Added a method to convert abstract requests to native requests in the request adapter interface. + +## [0.12.0] - 2023-01-05 + +### Added + +- Added User Agent handler to add the library information as a product to the header. + +## [0.11.0] - 2022-12-20 + +### Changed + +- Fixed a bug where retry handling wouldn't rewind the request body before retrying. + +## [0.10.0] - 2022-12-15 + +### Added + +- Added support for multi-valued request headers. + +### Changed + +- Fixed http.request_content_length attribute name for tracing + +## [0.9.0] - 2022-09-27 + +### Added + +- Added support for tracing via OpenTelemetry. + +## [0.8.1] - 2022-09-26 + +### Changed + +- Fixed bug for http go where response handler was overwritten in context object. + +## [0.8.0] - 2022-09-22 + +### Added + +- Added support for constructing a proxy authenticated client. + +## [0.7.2] - 2022-09-09 + +### Changed + +- Updated reference to abstractions. + +## [0.7.1] - 2022-09-07 + +### Added + +- Added support for additional status codes. + +## [0.7.0] - 2022-08-24 + +### Added + +- Adds context param in send async methods + +## [0.6.2] - 2022-08-30 + +### Added + +- Default 100 secs timeout for all request with a default context. + +## [0.6.1] - 2022-08-29 + +### Changed + +- Fixed a bug where an error would be returned for a 201 response with described response. + +## [0.6.0] - 2022-08-17 + +### Added + +- Adds a chaos handler optional middleware for tests + +## [0.5.2] - 2022-06-27 + +### Changed + +- Fixed an issue where response error was ignored for Patch calls + +## [0.5.1] - 2022-06-07 + +### Changed + +- Updated abstractions and yaml dependencies. + +## [0.5.0] - 2022-05-26 + +### Added + +- Adds support for enum or enum collections responses + +## [0.4.1] - 2022-05-19 + +### Changed + +- Fixed a bug where CAE support would leak connections when retrying. + +## [0.4.0] - 2022-05-18 + +### Added + +- Adds support for continuous access evaluation. + +## [0.3.0] - 2022-04-19 + +### Changed + +- Upgraded to abstractions 0.4.0. +- Upgraded to go 18. + +## [0.2.0] - 2022-04-08 + +### Added + +- Added support for decoding special characters in query parameters names. + +## [0.1.0] - 2022-03-30 + +### Added + +- Initial tagged release of the library. diff --git a/vendor/github.com/microsoft/kiota-http-go/CODE_OF_CONDUCT.md b/vendor/github.com/microsoft/kiota-http-go/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..c72a5749c --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/CODE_OF_CONDUCT.md @@ -0,0 +1,9 @@ +# Microsoft Open Source Code of Conduct + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). + +Resources: + +- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) +- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns diff --git a/vendor/github.com/microsoft/kiota-http-go/LICENSE b/vendor/github.com/microsoft/kiota-http-go/LICENSE new file mode 100644 index 000000000..3d8b93bc7 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/vendor/github.com/microsoft/kiota-http-go/README.md b/vendor/github.com/microsoft/kiota-http-go/README.md new file mode 100644 index 000000000..218b0a0bf --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/README.md @@ -0,0 +1,41 @@ +# Kiota Http Library for Go + +![Go](https://github.com/microsoft/kiota-http-go/actions/workflows/go.yml/badge.svg) + +The Kiota HTTP Library for Go is the Go HTTP library implementation with [net/http](https://pkg.go.dev/net/http). + +A [Kiota](https://github.com/microsoft/kiota) generated project will need a reference to a HTTP package to make HTTP requests to an API endpoint. + +Read more about Kiota [here](https://github.com/microsoft/kiota/blob/main/README.md). + +## Using the Kiota Http Library for Go + +```Shell +go get github.com/microsoft/kiota-http-go +``` + +```Golang +httpAdapter, err := kiotahttp.NewNetHttpRequestAdapter(authProvider) +``` + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a +Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us +the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. + +When you submit a pull request, a CLA bot will automatically determine whether you need to provide +a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions +provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or +contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + +## Trademarks + +This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft +trademarks or logos is subject to and must follow +[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). +Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. +Any use of third-party trademarks or logos are subject to those third-party's policies. diff --git a/vendor/github.com/microsoft/kiota-http-go/SECURITY.md b/vendor/github.com/microsoft/kiota-http-go/SECURITY.md new file mode 100644 index 000000000..12fbd8331 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/SECURITY.md @@ -0,0 +1,41 @@ + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). + + \ No newline at end of file diff --git a/vendor/github.com/microsoft/kiota-http-go/SUPPORT.md b/vendor/github.com/microsoft/kiota-http-go/SUPPORT.md new file mode 100644 index 000000000..dc72f0e5a --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/SUPPORT.md @@ -0,0 +1,25 @@ +# TODO: The maintainer of this repo has not yet edited this file + +**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? + +- **No CSS support:** Fill out this template with information about how to file issues and get help. +- **Yes CSS support:** Fill out an intake form at [aka.ms/spot](https://aka.ms/spot). CSS will work with/help you to determine next steps. More details also available at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). +- **Not sure?** Fill out a SPOT intake as though the answer were "Yes". CSS will help you decide. + +*Then remove this first heading from this SUPPORT.MD file before publishing your repo.* + +# Support + +## How to file issues and get help + +This project uses GitHub Issues to track bugs and feature requests. Please search the existing +issues before filing new issues to avoid duplicates. For new issues, file your bug or +feature request as a new Issue. + +For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE +FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER +CHANNEL. WHERE WILL YOU HELP PEOPLE?**. + +## Microsoft Support Policy + +Support for this **PROJECT or PRODUCT** is limited to the resources listed above. diff --git a/vendor/github.com/microsoft/kiota-http-go/chaos_handler.go b/vendor/github.com/microsoft/kiota-http-go/chaos_handler.go new file mode 100644 index 000000000..6a85f7b02 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/chaos_handler.go @@ -0,0 +1,305 @@ +package nethttplibrary + +import ( + "errors" + "io" + "math/rand" + nethttp "net/http" + "regexp" + "strings" + + abstractions "github.com/microsoft/kiota-abstractions-go" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" +) + +type ChaosStrategy int + +const ( + Manual ChaosStrategy = iota + Random +) + +// ChaosHandlerOptions is a configuration struct holding behavior defined options for a chaos handler +// +// BaseUrl represent the host url for in +// ChaosStrategy Specifies the strategy used for the Testing Handler -> RANDOM/MANUAL +// StatusCode Status code to be returned as part of the error response +// StatusMessage Message to be returned as part of the error response +// ChaosPercentage The percentage of randomness/chaos in the handler +// ResponseBody The response body to be returned as part of the error response +// Headers The response headers to be returned as part of the error response +// StatusMap The Map passed by user containing url-statusCode info +type ChaosHandlerOptions struct { + BaseUrl string + ChaosStrategy ChaosStrategy + StatusCode int + StatusMessage string + ChaosPercentage int + ResponseBody *nethttp.Response + Headers map[string][]string + StatusMap map[string]map[string]int +} + +type chaosHandlerOptionsInt interface { + abstractions.RequestOption + GetBaseUrl() string + GetChaosStrategy() ChaosStrategy + GetStatusCode() int + GetStatusMessage() string + GetChaosPercentage() int + GetResponseBody() *nethttp.Response + GetHeaders() map[string][]string + GetStatusMap() map[string]map[string]int +} + +func (handlerOptions *ChaosHandlerOptions) GetBaseUrl() string { + return handlerOptions.BaseUrl +} + +func (handlerOptions *ChaosHandlerOptions) GetChaosStrategy() ChaosStrategy { + return handlerOptions.ChaosStrategy +} + +func (handlerOptions *ChaosHandlerOptions) GetStatusCode() int { + return handlerOptions.StatusCode +} + +func (handlerOptions *ChaosHandlerOptions) GetStatusMessage() string { + return handlerOptions.StatusMessage +} + +func (handlerOptions *ChaosHandlerOptions) GetChaosPercentage() int { + return handlerOptions.ChaosPercentage +} + +func (handlerOptions *ChaosHandlerOptions) GetResponseBody() *nethttp.Response { + return handlerOptions.ResponseBody +} + +func (handlerOptions *ChaosHandlerOptions) GetHeaders() map[string][]string { + return handlerOptions.Headers +} + +func (handlerOptions *ChaosHandlerOptions) GetStatusMap() map[string]map[string]int { + return handlerOptions.StatusMap +} + +type ChaosHandler struct { + options *ChaosHandlerOptions +} + +var chaosHandlerKey = abstractions.RequestOptionKey{Key: "ChaosHandler"} + +// GetKey returns ChaosHandlerOptions unique name in context object +func (handlerOptions *ChaosHandlerOptions) GetKey() abstractions.RequestOptionKey { + return chaosHandlerKey +} + +// NewChaosHandlerWithOptions creates a new ChaosHandler with the configured options +func NewChaosHandlerWithOptions(handlerOptions *ChaosHandlerOptions) (*ChaosHandler, error) { + if handlerOptions == nil { + return nil, errors.New("unexpected argument ChaosHandlerOptions as nil") + } + + if handlerOptions.ChaosPercentage < 0 || handlerOptions.ChaosPercentage > 100 { + return nil, errors.New("ChaosPercentage must be between 0 and 100") + } + if handlerOptions.ChaosStrategy == Manual { + if handlerOptions.StatusCode == 0 { + return nil, errors.New("invalid status code for manual strategy") + } + } + + return &ChaosHandler{options: handlerOptions}, nil +} + +// NewChaosHandler creates a new ChaosHandler with default configuration options of Random errors at 10% +func NewChaosHandler() *ChaosHandler { + return &ChaosHandler{ + options: &ChaosHandlerOptions{ + ChaosPercentage: 10, + ChaosStrategy: Random, + StatusMessage: "A random error message", + }, + } +} + +var methodStatusCode = map[string][]int{ + "GET": {429, 500, 502, 503, 504}, + "POST": {429, 500, 502, 503, 504, 507}, + "PUT": {429, 500, 502, 503, 504, 507}, + "PATCH": {429, 500, 502, 503, 504}, + "DELETE": {429, 500, 502, 503, 504, 507}, +} + +var httpStatusCode = map[int]string{ + 100: "Continue", + 101: "Switching Protocols", + 102: "Processing", + 103: "Early Hints", + 200: "OK", + 201: "Created", + 202: "Accepted", + 203: "Non-Authoritative Information", + 204: "No Content", + 205: "Reset Content", + 206: "Partial Content", + 207: "Multi-Status", + 208: "Already Reported", + 226: "IM Used", + 300: "Multiple Choices", + 301: "Moved Permanently", + 302: "Found", + 303: "See Other", + 304: "Not Modified", + 305: "Use Proxy", + 307: "Temporary Redirect", + 308: "Permanent Redirect", + 400: "Bad Request", + 401: "Unauthorized", + 402: "Payment Required", + 403: "Forbidden", + 404: "Not Found", + 405: "Method Not Allowed", + 406: "Not Acceptable", + 407: "Proxy Authentication Required", + 408: "Request Timeout", + 409: "Conflict", + 410: "Gone", + 411: "Length Required", + 412: "Precondition Failed", + 413: "Payload Too Large", + 414: "URI Too Long", + 415: "Unsupported Media Type", + 416: "Range Not Satisfiable", + 417: "Expectation Failed", + 421: "Misdirected Request", + 422: "Unprocessable Entity", + 423: "Locked", + 424: "Failed Dependency", + 425: "Too Early", + 426: "Upgrade Required", + 428: "Precondition Required", + 429: "Too Many Requests", + 431: "Request Header Fields Too Large", + 451: "Unavailable For Legal Reasons", + 500: "Internal Server Error", + 501: "Not Implemented", + 502: "Bad Gateway", + 503: "Service Unavailable", + 504: "Gateway Timeout", + 505: "HTTP Version Not Supported", + 506: "Variant Also Negotiates", + 507: "Insufficient Storage", + 508: "Loop Detected", + 510: "Not Extended", + 511: "Network Authentication Required", +} + +func generateRandomStatusCode(request *nethttp.Request) int { + statusCodeArray := methodStatusCode[request.Method] + return statusCodeArray[rand.Intn(len(statusCodeArray))] +} + +func getRelativeURL(handlerOptions chaosHandlerOptionsInt, url string) string { + baseUrl := handlerOptions.GetBaseUrl() + if baseUrl != "" { + return strings.Replace(url, baseUrl, "", 1) + } else { + return url + } +} + +func getStatusCode(handlerOptions chaosHandlerOptionsInt, req *nethttp.Request) int { + requestMethod := req.Method + statusMap := handlerOptions.GetStatusMap() + requestURL := req.RequestURI + + if handlerOptions.GetChaosStrategy() == Manual { + return handlerOptions.GetStatusCode() + } + + if handlerOptions.GetChaosStrategy() == Random { + if handlerOptions.GetStatusCode() > 0 { + return handlerOptions.GetStatusCode() + } else { + relativeUrl := getRelativeURL(handlerOptions, requestURL) + if definedResponses, ok := statusMap[relativeUrl]; ok { + if mapCode, mapCodeOk := definedResponses[requestMethod]; mapCodeOk { + return mapCode + } + } else { + for key := range statusMap { + match, _ := regexp.MatchString(key+"$", relativeUrl) + if match { + responseCode := statusMap[key][requestMethod] + if responseCode != 0 { + return responseCode + } + } + } + } + } + } + + return generateRandomStatusCode(req) +} + +func createResponseBody(handlerOptions chaosHandlerOptionsInt, statusCode int) *nethttp.Response { + if handlerOptions.GetResponseBody() != nil { + return handlerOptions.GetResponseBody() + } + + var stringReader *strings.Reader + if statusCode > 400 { + codeMessage := httpStatusCode[statusCode] + errMessage := handlerOptions.GetStatusMessage() + stringReader = strings.NewReader("error : { code : " + codeMessage + " , message : " + errMessage + " }") + } else { + stringReader = strings.NewReader("{}") + } + + return &nethttp.Response{ + StatusCode: statusCode, + Status: handlerOptions.GetStatusMessage(), + Body: io.NopCloser(stringReader), + Header: handlerOptions.GetHeaders(), + } +} + +func createChaosResponse(handler chaosHandlerOptionsInt, req *nethttp.Request) (*nethttp.Response, error) { + statusCode := getStatusCode(handler, req) + responseBody := createResponseBody(handler, statusCode) + return responseBody, nil +} + +// ChaosHandlerTriggeredEventKey is the key used for the open telemetry event +const ChaosHandlerTriggeredEventKey = "com.microsoft.kiota.chaos_handler_triggered" + +func (middleware ChaosHandler) Intercept(pipeline Pipeline, middlewareIndex int, req *nethttp.Request) (*nethttp.Response, error) { + reqOption, ok := req.Context().Value(chaosHandlerKey).(chaosHandlerOptionsInt) + if !ok { + reqOption = middleware.options + } + + obsOptions := GetObservabilityOptionsFromRequest(req) + ctx := req.Context() + var span trace.Span + if obsOptions != nil { + ctx, span = otel.GetTracerProvider().Tracer(obsOptions.GetTracerInstrumentationName()).Start(ctx, "ChaosHandler_Intercept") + span.SetAttributes(attribute.Bool("com.microsoft.kiota.handler.chaos.enable", true)) + req = req.WithContext(ctx) + defer span.End() + } + + if rand.Intn(100) < reqOption.GetChaosPercentage() { + if span != nil { + span.AddEvent(ChaosHandlerTriggeredEventKey) + } + return createChaosResponse(reqOption, req) + } + + return pipeline.Next(req, middlewareIndex) +} diff --git a/vendor/github.com/microsoft/kiota-http-go/compression_handler.go b/vendor/github.com/microsoft/kiota-http-go/compression_handler.go new file mode 100644 index 000000000..d5e30f42a --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/compression_handler.go @@ -0,0 +1,144 @@ +package nethttplibrary + +import ( + "bytes" + "compress/gzip" + "io" + "net/http" + + abstractions "github.com/microsoft/kiota-abstractions-go" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" +) + +// CompressionHandler represents a compression middleware +type CompressionHandler struct { + options CompressionOptions +} + +// CompressionOptions is a configuration object for the CompressionHandler middleware +type CompressionOptions struct { + enableCompression bool +} + +type compression interface { + abstractions.RequestOption + ShouldCompress() bool +} + +var compressKey = abstractions.RequestOptionKey{Key: "CompressionHandler"} + +// NewCompressionHandler creates an instance of a compression middleware +func NewCompressionHandler() *CompressionHandler { + options := NewCompressionOptions(true) + return NewCompressionHandlerWithOptions(options) +} + +// NewCompressionHandlerWithOptions creates an instance of the compression middlerware with +// specified configurations. +func NewCompressionHandlerWithOptions(option CompressionOptions) *CompressionHandler { + return &CompressionHandler{options: option} +} + +// NewCompressionOptions creates a configuration object for the CompressionHandler +func NewCompressionOptions(enableCompression bool) CompressionOptions { + return CompressionOptions{enableCompression: enableCompression} +} + +// GetKey returns CompressionOptions unique name in context object +func (o CompressionOptions) GetKey() abstractions.RequestOptionKey { + return compressKey +} + +// ShouldCompress reads compression setting form CompressionOptions +func (o CompressionOptions) ShouldCompress() bool { + return o.enableCompression +} + +// Intercept is invoked by the middleware pipeline to either move the request/response +// to the next middleware in the pipeline +func (c *CompressionHandler) Intercept(pipeline Pipeline, middlewareIndex int, req *http.Request) (*http.Response, error) { + reqOption, ok := req.Context().Value(compressKey).(compression) + if !ok { + reqOption = c.options + } + + obsOptions := GetObservabilityOptionsFromRequest(req) + ctx := req.Context() + var span trace.Span + if obsOptions != nil { + ctx, span = otel.GetTracerProvider().Tracer(obsOptions.GetTracerInstrumentationName()).Start(ctx, "CompressionHandler_Intercept") + span.SetAttributes(attribute.Bool("com.microsoft.kiota.handler.compression.enable", true)) + defer span.End() + req = req.WithContext(ctx) + } + + if !reqOption.ShouldCompress() || req.Body == nil { + return pipeline.Next(req, middlewareIndex) + } + if span != nil { + span.SetAttributes(attribute.Bool("http.request_body_compressed", true)) + } + + unCompressedBody, err := io.ReadAll(req.Body) + unCompressedContentLength := req.ContentLength + if err != nil { + if span != nil { + span.RecordError(err) + } + return nil, err + } + + compressedBody, size, err := compressReqBody(unCompressedBody) + if err != nil { + if span != nil { + span.RecordError(err) + } + return nil, err + } + + req.Header.Set("Content-Encoding", "gzip") + req.Body = compressedBody + req.ContentLength = int64(size) + + if span != nil { + span.SetAttributes(attribute.Int64("http.request_content_length", req.ContentLength)) + } + + // Sending request with compressed body + resp, err := pipeline.Next(req, middlewareIndex) + if err != nil { + return nil, err + } + + // If response has status 415 retry request with uncompressed body + if resp.StatusCode == 415 { + delete(req.Header, "Content-Encoding") + req.Body = io.NopCloser(bytes.NewBuffer(unCompressedBody)) + req.ContentLength = unCompressedContentLength + + if span != nil { + span.SetAttributes(attribute.Int64("http.request_content_length", req.ContentLength), + attribute.Int("http.request_content_length", 415)) + } + + return pipeline.Next(req, middlewareIndex) + } + + return resp, nil +} + +func compressReqBody(reqBody []byte) (io.ReadCloser, int, error) { + var buffer bytes.Buffer + gzipWriter := gzip.NewWriter(&buffer) + if _, err := gzipWriter.Write(reqBody); err != nil { + return nil, 0, err + } + + if err := gzipWriter.Close(); err != nil { + return nil, 0, err + } + + return io.NopCloser(&buffer), buffer.Len(), nil +} diff --git a/vendor/github.com/microsoft/kiota-http-go/headers_inspection_handler.go b/vendor/github.com/microsoft/kiota-http-go/headers_inspection_handler.go new file mode 100644 index 000000000..34ddb19ec --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/headers_inspection_handler.go @@ -0,0 +1,120 @@ +package nethttplibrary + +import ( + nethttp "net/http" + + abstractions "github.com/microsoft/kiota-abstractions-go" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" +) + +// HeadersInspectionHandlerOptions is the options to use when inspecting headers +type HeadersInspectionOptions struct { + InspectRequestHeaders bool + InspectResponseHeaders bool + RequestHeaders *abstractions.RequestHeaders + ResponseHeaders *abstractions.ResponseHeaders +} + +// NewHeadersInspectionOptions creates a new HeadersInspectionOptions with default options +func NewHeadersInspectionOptions() *HeadersInspectionOptions { + return &HeadersInspectionOptions{ + RequestHeaders: abstractions.NewRequestHeaders(), + ResponseHeaders: abstractions.NewResponseHeaders(), + } +} + +type headersInspectionOptionsInt interface { + abstractions.RequestOption + GetInspectRequestHeaders() bool + GetInspectResponseHeaders() bool + GetRequestHeaders() *abstractions.RequestHeaders + GetResponseHeaders() *abstractions.ResponseHeaders +} + +var headersInspectionKeyValue = abstractions.RequestOptionKey{ + Key: "nethttplibrary.HeadersInspectionOptions", +} + +// GetInspectRequestHeaders returns true if the request headers should be inspected +func (o *HeadersInspectionOptions) GetInspectRequestHeaders() bool { + return o.InspectRequestHeaders +} + +// GetInspectResponseHeaders returns true if the response headers should be inspected +func (o *HeadersInspectionOptions) GetInspectResponseHeaders() bool { + return o.InspectResponseHeaders +} + +// GetRequestHeaders returns the request headers +func (o *HeadersInspectionOptions) GetRequestHeaders() *abstractions.RequestHeaders { + return o.RequestHeaders +} + +// GetResponseHeaders returns the response headers +func (o *HeadersInspectionOptions) GetResponseHeaders() *abstractions.ResponseHeaders { + return o.ResponseHeaders +} + +// GetKey returns the key for the HeadersInspectionOptions +func (o *HeadersInspectionOptions) GetKey() abstractions.RequestOptionKey { + return headersInspectionKeyValue +} + +// HeadersInspectionHandler allows inspecting of the headers of the request and response via a request option +type HeadersInspectionHandler struct { + options HeadersInspectionOptions +} + +// NewHeadersInspectionHandler creates a new HeadersInspectionHandler with default options +func NewHeadersInspectionHandler() *HeadersInspectionHandler { + return NewHeadersInspectionHandlerWithOptions(*NewHeadersInspectionOptions()) +} + +// NewHeadersInspectionHandlerWithOptions creates a new HeadersInspectionHandler with the given options +func NewHeadersInspectionHandlerWithOptions(options HeadersInspectionOptions) *HeadersInspectionHandler { + return &HeadersInspectionHandler{options: options} +} + +// Intercept implements the interface and evaluates whether to retry a failed request. +func (middleware HeadersInspectionHandler) Intercept(pipeline Pipeline, middlewareIndex int, req *nethttp.Request) (*nethttp.Response, error) { + obsOptions := GetObservabilityOptionsFromRequest(req) + ctx := req.Context() + var span trace.Span + var observabilityName string + if obsOptions != nil { + observabilityName = obsOptions.GetTracerInstrumentationName() + ctx, span = otel.GetTracerProvider().Tracer(observabilityName).Start(ctx, "HeadersInspectionHandler_Intercept") + span.SetAttributes(attribute.Bool("com.microsoft.kiota.handler.headersInspection.enable", true)) + defer span.End() + req = req.WithContext(ctx) + } + reqOption, ok := req.Context().Value(headersInspectionKeyValue).(headersInspectionOptionsInt) + if !ok { + reqOption = &middleware.options + } + if reqOption.GetInspectRequestHeaders() { + for k, v := range req.Header { + if len(v) == 1 { + reqOption.GetRequestHeaders().Add(k, v[0]) + } else { + reqOption.GetRequestHeaders().Add(k, v[0], v[1:]...) + } + } + } + response, err := pipeline.Next(req, middlewareIndex) + if reqOption.GetInspectResponseHeaders() { + for k, v := range response.Header { + if len(v) == 1 { + reqOption.GetResponseHeaders().Add(k, v[0]) + } else { + reqOption.GetResponseHeaders().Add(k, v[0], v[1:]...) + } + } + } + if err != nil { + return response, err + } + return response, err +} diff --git a/vendor/github.com/microsoft/kiota-http-go/kiota_client_factory.go b/vendor/github.com/microsoft/kiota-http-go/kiota_client_factory.go new file mode 100644 index 000000000..94126c272 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/kiota_client_factory.go @@ -0,0 +1,153 @@ +// Package nethttplibrary implements the Kiota abstractions with net/http to execute the requests. +// It also provides a middleware infrastructure with some default middleware handlers like the retry handler and the redirect handler. +package nethttplibrary + +import ( + "errors" + abs "github.com/microsoft/kiota-abstractions-go" + nethttp "net/http" + "net/url" + "time" +) + +// GetClientWithProxySettings creates a new default net/http client with a proxy url and default middleware +// Not providing any middleware would result in having default middleware provided +func GetClientWithProxySettings(proxyUrlStr string, middleware ...Middleware) (*nethttp.Client, error) { + client := getDefaultClientWithoutMiddleware() + + transport, err := getTransportWithProxy(proxyUrlStr, nil, middleware...) + if err != nil { + return nil, err + } + client.Transport = transport + return client, nil +} + +// GetClientWithAuthenticatedProxySettings creates a new default net/http client with a proxy url and default middleware +// Not providing any middleware would result in having default middleware provided +func GetClientWithAuthenticatedProxySettings(proxyUrlStr string, username string, password string, middleware ...Middleware) (*nethttp.Client, error) { + client := getDefaultClientWithoutMiddleware() + + user := url.UserPassword(username, password) + transport, err := getTransportWithProxy(proxyUrlStr, user, middleware...) + if err != nil { + return nil, err + } + client.Transport = transport + return client, nil +} + +func getTransportWithProxy(proxyUrlStr string, user *url.Userinfo, middlewares ...Middleware) (nethttp.RoundTripper, error) { + proxyURL, err := url.Parse(proxyUrlStr) + if err != nil { + return nil, err + } + + if user != nil { + proxyURL.User = user + } + + transport := &nethttp.Transport{ + Proxy: nethttp.ProxyURL(proxyURL), + } + + if len(middlewares) == 0 { + middlewares = GetDefaultMiddlewares() + } + + return NewCustomTransportWithParentTransport(transport, middlewares...), nil +} + +// GetDefaultClient creates a new default net/http client with the options configured for the Kiota request adapter +func GetDefaultClient(middleware ...Middleware) *nethttp.Client { + client := getDefaultClientWithoutMiddleware() + client.Transport = NewCustomTransport(middleware...) + return client +} + +// used for internal unit testing +func getDefaultClientWithoutMiddleware() *nethttp.Client { + // the default client doesn't come with any other settings than making a new one does, and using the default client impacts behavior for non-kiota requests + return &nethttp.Client{ + CheckRedirect: func(req *nethttp.Request, via []*nethttp.Request) error { + return nethttp.ErrUseLastResponse + }, + Timeout: time.Second * 100, + } +} + +// GetDefaultMiddlewares creates a new default set of middlewares for the Kiota request adapter +func GetDefaultMiddlewares() []Middleware { + return getDefaultMiddleWare(make(map[abs.RequestOptionKey]Middleware)) +} + +// GetDefaultMiddlewaresWithOptions creates a new default set of middlewares for the Kiota request adapter with options +func GetDefaultMiddlewaresWithOptions(requestOptions ...abs.RequestOption) ([]Middleware, error) { + if len(requestOptions) == 0 { + return GetDefaultMiddlewares(), nil + } + + // map of middleware options + middlewareMap := make(map[abs.RequestOptionKey]Middleware) + + for _, element := range requestOptions { + switch v := element.(type) { + case *RetryHandlerOptions: + middlewareMap[retryKeyValue] = NewRetryHandlerWithOptions(*v) + case *RedirectHandlerOptions: + middlewareMap[redirectKeyValue] = NewRedirectHandlerWithOptions(*v) + case *CompressionOptions: + middlewareMap[compressKey] = NewCompressionHandlerWithOptions(*v) + case *ParametersNameDecodingOptions: + middlewareMap[parametersNameDecodingKeyValue] = NewParametersNameDecodingHandlerWithOptions(*v) + case *UserAgentHandlerOptions: + middlewareMap[userAgentKeyValue] = NewUserAgentHandlerWithOptions(v) + case *HeadersInspectionOptions: + middlewareMap[headersInspectionKeyValue] = NewHeadersInspectionHandlerWithOptions(*v) + default: + // none of the above types + return nil, errors.New("unsupported option type") + } + } + + middleware := getDefaultMiddleWare(middlewareMap) + return middleware, nil +} + +// getDefaultMiddleWare creates a new default set of middlewares for the Kiota request adapter +func getDefaultMiddleWare(middlewareMap map[abs.RequestOptionKey]Middleware) []Middleware { + middlewareSource := map[abs.RequestOptionKey]func() Middleware{ + retryKeyValue: func() Middleware { + return NewRetryHandler() + }, + redirectKeyValue: func() Middleware { + return NewRedirectHandler() + }, + compressKey: func() Middleware { + return NewCompressionHandler() + }, + parametersNameDecodingKeyValue: func() Middleware { + return NewParametersNameDecodingHandler() + }, + userAgentKeyValue: func() Middleware { + return NewUserAgentHandler() + }, + headersInspectionKeyValue: func() Middleware { + return NewHeadersInspectionHandler() + }, + } + + // loop over middlewareSource and add any middleware that wasn't provided in the requestOptions + for key, value := range middlewareSource { + if _, ok := middlewareMap[key]; !ok { + middlewareMap[key] = value() + } + } + + var middleware []Middleware + for _, value := range middlewareMap { + middleware = append(middleware, value) + } + + return middleware +} diff --git a/vendor/github.com/microsoft/kiota-http-go/middleware.go b/vendor/github.com/microsoft/kiota-http-go/middleware.go new file mode 100644 index 000000000..e4cab4cfa --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/middleware.go @@ -0,0 +1,9 @@ +package nethttplibrary + +import nethttp "net/http" + +// Middleware interface for cross cutting concerns with HTTP requests and responses. +type Middleware interface { + // Intercept intercepts the request and returns the response. The implementer MUST call pipeline.Next() + Intercept(Pipeline, int, *nethttp.Request) (*nethttp.Response, error) +} diff --git a/vendor/github.com/microsoft/kiota-http-go/nethttp_request_adapter.go b/vendor/github.com/microsoft/kiota-http-go/nethttp_request_adapter.go new file mode 100644 index 000000000..c140636d4 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/nethttp_request_adapter.go @@ -0,0 +1,827 @@ +package nethttplibrary + +import ( + "bytes" + "context" + "errors" + "io" + nethttp "net/http" + "reflect" + "regexp" + "strconv" + "strings" + + abs "github.com/microsoft/kiota-abstractions-go" + absauth "github.com/microsoft/kiota-abstractions-go/authentication" + absser "github.com/microsoft/kiota-abstractions-go/serialization" + "github.com/microsoft/kiota-abstractions-go/store" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/trace" +) + +// nopCloser is an alternate io.nopCloser implementation which +// provides io.ReadSeekCloser instead of io.ReadCloser as we need +// Seek for retries +type nopCloser struct { + io.ReadSeeker +} + +func NopCloser(r io.ReadSeeker) io.ReadSeekCloser { + return nopCloser{r} +} + +func (nopCloser) Close() error { return nil } + +// NetHttpRequestAdapter implements the RequestAdapter interface using net/http +type NetHttpRequestAdapter struct { + // serializationWriterFactory is the factory used to create serialization writers + serializationWriterFactory absser.SerializationWriterFactory + // parseNodeFactory is the factory used to create parse nodes + parseNodeFactory absser.ParseNodeFactory + // httpClient is the client used to send requests + httpClient *nethttp.Client + // authenticationProvider is the provider used to authenticate requests + authenticationProvider absauth.AuthenticationProvider + // The base url for every request. + baseUrl string + // The observation options for the request adapter. + observabilityOptions ObservabilityOptions +} + +// NewNetHttpRequestAdapter creates a new NetHttpRequestAdapter with the given parameters +func NewNetHttpRequestAdapter(authenticationProvider absauth.AuthenticationProvider) (*NetHttpRequestAdapter, error) { + return NewNetHttpRequestAdapterWithParseNodeFactory(authenticationProvider, nil) +} + +// NewNetHttpRequestAdapterWithParseNodeFactory creates a new NetHttpRequestAdapter with the given parameters +func NewNetHttpRequestAdapterWithParseNodeFactory(authenticationProvider absauth.AuthenticationProvider, parseNodeFactory absser.ParseNodeFactory) (*NetHttpRequestAdapter, error) { + return NewNetHttpRequestAdapterWithParseNodeFactoryAndSerializationWriterFactory(authenticationProvider, parseNodeFactory, nil) +} + +// NewNetHttpRequestAdapterWithParseNodeFactoryAndSerializationWriterFactory creates a new NetHttpRequestAdapter with the given parameters +func NewNetHttpRequestAdapterWithParseNodeFactoryAndSerializationWriterFactory(authenticationProvider absauth.AuthenticationProvider, parseNodeFactory absser.ParseNodeFactory, serializationWriterFactory absser.SerializationWriterFactory) (*NetHttpRequestAdapter, error) { + return NewNetHttpRequestAdapterWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClient(authenticationProvider, parseNodeFactory, serializationWriterFactory, nil) +} + +// NewNetHttpRequestAdapterWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClient creates a new NetHttpRequestAdapter with the given parameters +func NewNetHttpRequestAdapterWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClient(authenticationProvider absauth.AuthenticationProvider, parseNodeFactory absser.ParseNodeFactory, serializationWriterFactory absser.SerializationWriterFactory, httpClient *nethttp.Client) (*NetHttpRequestAdapter, error) { + return NewNetHttpRequestAdapterWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClientAndObservabilityOptions(authenticationProvider, parseNodeFactory, serializationWriterFactory, httpClient, ObservabilityOptions{}) +} + +// NewNetHttpRequestAdapterWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClientAndObservabilityOptions creates a new NetHttpRequestAdapter with the given parameters +func NewNetHttpRequestAdapterWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClientAndObservabilityOptions(authenticationProvider absauth.AuthenticationProvider, parseNodeFactory absser.ParseNodeFactory, serializationWriterFactory absser.SerializationWriterFactory, httpClient *nethttp.Client, observabilityOptions ObservabilityOptions) (*NetHttpRequestAdapter, error) { + if authenticationProvider == nil { + return nil, errors.New("authenticationProvider cannot be nil") + } + result := &NetHttpRequestAdapter{ + serializationWriterFactory: serializationWriterFactory, + parseNodeFactory: parseNodeFactory, + httpClient: httpClient, + authenticationProvider: authenticationProvider, + baseUrl: "", + observabilityOptions: observabilityOptions, + } + if result.httpClient == nil { + defaultClient := GetDefaultClient() + result.httpClient = defaultClient + } + if result.serializationWriterFactory == nil { + result.serializationWriterFactory = absser.DefaultSerializationWriterFactoryInstance + } + if result.parseNodeFactory == nil { + result.parseNodeFactory = absser.DefaultParseNodeFactoryInstance + } + return result, nil +} + +// GetSerializationWriterFactory returns the serialization writer factory currently in use for the request adapter service. +func (a *NetHttpRequestAdapter) GetSerializationWriterFactory() absser.SerializationWriterFactory { + return a.serializationWriterFactory +} + +// EnableBackingStore enables the backing store proxies for the SerializationWriters and ParseNodes in use. +func (a *NetHttpRequestAdapter) EnableBackingStore(factory store.BackingStoreFactory) { + a.parseNodeFactory = abs.EnableBackingStoreForParseNodeFactory(a.parseNodeFactory) + a.serializationWriterFactory = abs.EnableBackingStoreForSerializationWriterFactory(a.serializationWriterFactory) + if factory != nil { + store.BackingStoreFactoryInstance = factory + } +} + +// SetBaseUrl sets the base url for every request. +func (a *NetHttpRequestAdapter) SetBaseUrl(baseUrl string) { + a.baseUrl = baseUrl +} + +// GetBaseUrl gets the base url for every request. +func (a *NetHttpRequestAdapter) GetBaseUrl() string { + return a.baseUrl +} + +func (a *NetHttpRequestAdapter) getHttpResponseMessage(ctx context.Context, requestInfo *abs.RequestInformation, claims string, spanForAttributes trace.Span) (*nethttp.Response, error) { + ctx, span := otel.GetTracerProvider().Tracer(a.observabilityOptions.GetTracerInstrumentationName()).Start(ctx, "getHttpResponseMessage") + defer span.End() + if ctx == nil { + ctx = context.Background() + } + a.setBaseUrlForRequestInformation(requestInfo) + additionalContext := make(map[string]any) + if claims != "" { + additionalContext[claimsKey] = claims + } + err := a.authenticationProvider.AuthenticateRequest(ctx, requestInfo, additionalContext) + if err != nil { + return nil, err + } + request, err := a.getRequestFromRequestInformation(ctx, requestInfo, spanForAttributes) + if err != nil { + return nil, err + } + response, err := (*a.httpClient).Do(request) + if err != nil { + spanForAttributes.RecordError(err) + return nil, err + } + if response != nil { + contentLenHeader := response.Header.Get("Content-Length") + if contentLenHeader != "" { + contentLen, _ := strconv.Atoi(contentLenHeader) + spanForAttributes.SetAttributes(attribute.Int("http.response_content_length", contentLen)) + } + contentTypeHeader := response.Header.Get("Content-Type") + if contentTypeHeader != "" { + spanForAttributes.SetAttributes(attribute.String("http.response_content_type", contentTypeHeader)) + } + spanForAttributes.SetAttributes( + attribute.Int("http.status_code", response.StatusCode), + attribute.String("http.flavor", response.Proto), + ) + } + return a.retryCAEResponseIfRequired(ctx, response, requestInfo, claims, spanForAttributes) +} + +const claimsKey = "claims" + +var reBearer = regexp.MustCompile(`(?i)^Bearer\s`) +var reClaims = regexp.MustCompile(`\"([^\"]*)\"`) + +const AuthenticateChallengedEventKey = "com.microsoft.kiota.authenticate_challenge_received" + +func (a *NetHttpRequestAdapter) retryCAEResponseIfRequired(ctx context.Context, response *nethttp.Response, requestInfo *abs.RequestInformation, claims string, spanForAttributes trace.Span) (*nethttp.Response, error) { + ctx, span := otel.GetTracerProvider().Tracer(a.observabilityOptions.GetTracerInstrumentationName()).Start(ctx, "retryCAEResponseIfRequired") + defer span.End() + if response.StatusCode == 401 && + claims == "" { //avoid infinite loop, we only retry once + authenticateHeaderVal := response.Header.Get("WWW-Authenticate") + if authenticateHeaderVal != "" && reBearer.Match([]byte(authenticateHeaderVal)) { + span.AddEvent(AuthenticateChallengedEventKey) + spanForAttributes.SetAttributes(attribute.Int("http.retry_count", 1)) + responseClaims := "" + parametersRaw := string(reBearer.ReplaceAll([]byte(authenticateHeaderVal), []byte(""))) + parameters := strings.Split(parametersRaw, ",") + for _, parameter := range parameters { + if strings.HasPrefix(strings.Trim(parameter, " "), claimsKey) { + responseClaims = reClaims.FindStringSubmatch(parameter)[1] + break + } + } + if responseClaims != "" { + defer a.purge(response) + return a.getHttpResponseMessage(ctx, requestInfo, responseClaims, spanForAttributes) + } + } + } + return response, nil +} + +func (a *NetHttpRequestAdapter) getResponsePrimaryContentType(response *nethttp.Response) string { + if response.Header == nil { + return "" + } + rawType := response.Header.Get("Content-Type") + splat := strings.Split(rawType, ";") + return strings.ToLower(splat[0]) +} + +func (a *NetHttpRequestAdapter) setBaseUrlForRequestInformation(requestInfo *abs.RequestInformation) { + requestInfo.PathParameters["baseurl"] = a.GetBaseUrl() +} + +func (a *NetHttpRequestAdapter) prepareContext(ctx context.Context, requestInfo *abs.RequestInformation) context.Context { + if ctx == nil { + ctx = context.Background() + } + // set deadline if not set in receiving context + // ignore if timeout is 0 as it means no timeout + if _, deadlineSet := ctx.Deadline(); !deadlineSet && a.httpClient.Timeout != 0 { + ctx, _ = context.WithTimeout(ctx, a.httpClient.Timeout) + } + + for _, value := range requestInfo.GetRequestOptions() { + ctx = context.WithValue(ctx, value.GetKey(), value) + } + obsOptionsSet := false + if reqObsOpt := ctx.Value(observabilityOptionsKeyValue); reqObsOpt != nil { + if _, ok := reqObsOpt.(ObservabilityOptionsInt); ok { + obsOptionsSet = true + } + } + if !obsOptionsSet { + ctx = context.WithValue(ctx, observabilityOptionsKeyValue, &a.observabilityOptions) + } + return ctx +} + +// ConvertToNativeRequest converts the given RequestInformation into a native HTTP request. +func (a *NetHttpRequestAdapter) ConvertToNativeRequest(context context.Context, requestInfo *abs.RequestInformation) (any, error) { + err := a.authenticationProvider.AuthenticateRequest(context, requestInfo, nil) + if err != nil { + return nil, err + } + request, err := a.getRequestFromRequestInformation(context, requestInfo, nil) + if err != nil { + return nil, err + } + return request, nil +} + +func (a *NetHttpRequestAdapter) getRequestFromRequestInformation(ctx context.Context, requestInfo *abs.RequestInformation, spanForAttributes trace.Span) (*nethttp.Request, error) { + ctx, span := otel.GetTracerProvider().Tracer(a.observabilityOptions.GetTracerInstrumentationName()).Start(ctx, "getRequestFromRequestInformation") + defer span.End() + if spanForAttributes == nil { + spanForAttributes = span + } + spanForAttributes.SetAttributes(attribute.String("http.method", requestInfo.Method.String())) + uri, err := requestInfo.GetUri() + if err != nil { + spanForAttributes.RecordError(err) + return nil, err + } + spanForAttributes.SetAttributes( + attribute.String("http.scheme", uri.Scheme), + attribute.String("http.host", uri.Host), + ) + + if a.observabilityOptions.IncludeEUIIAttributes { + spanForAttributes.SetAttributes(attribute.String("http.uri", uri.String())) + } + + request, err := nethttp.NewRequestWithContext(ctx, requestInfo.Method.String(), uri.String(), nil) + + if err != nil { + spanForAttributes.RecordError(err) + return nil, err + } + if len(requestInfo.Content) > 0 { + reader := bytes.NewReader(requestInfo.Content) + request.Body = NopCloser(reader) + } + if request.Header == nil { + request.Header = make(nethttp.Header) + } + if requestInfo.Headers != nil { + for _, key := range requestInfo.Headers.ListKeys() { + values := requestInfo.Headers.Get(key) + for _, v := range values { + request.Header.Add(key, v) + } + } + if request.Header.Get("Content-Type") != "" { + spanForAttributes.SetAttributes( + attribute.String("http.request_content_type", request.Header.Get("Content-Type")), + ) + } + if request.Header.Get("Content-Length") != "" { + contentLenVal, _ := strconv.Atoi(request.Header.Get("Content-Length")) + spanForAttributes.SetAttributes( + attribute.Int("http.request_content_length", contentLenVal), + ) + } + } + + return request, nil +} + +const EventResponseHandlerInvokedKey = "com.microsoft.kiota.response_handler_invoked" + +var queryParametersCleanupRegex = regexp.MustCompile(`\{\?[^\}]+}`) + +func (a *NetHttpRequestAdapter) startTracingSpan(ctx context.Context, requestInfo *abs.RequestInformation, methodName string) (context.Context, trace.Span) { + decodedUriTemplate := decodeUriEncodedString(requestInfo.UrlTemplate, []byte{'-', '.', '~', '$'}) + telemetryPathValue := queryParametersCleanupRegex.ReplaceAll([]byte(decodedUriTemplate), []byte("")) + ctx, span := otel.GetTracerProvider().Tracer(a.observabilityOptions.GetTracerInstrumentationName()).Start(ctx, methodName+" - "+string(telemetryPathValue)) + span.SetAttributes(attribute.String("http.uri_template", decodedUriTemplate)) + return ctx, span +} + +// Send executes the HTTP request specified by the given RequestInformation and returns the deserialized response model. +func (a *NetHttpRequestAdapter) Send(ctx context.Context, requestInfo *abs.RequestInformation, constructor absser.ParsableFactory, errorMappings abs.ErrorMappings) (absser.Parsable, error) { + if requestInfo == nil { + return nil, errors.New("requestInfo cannot be nil") + } + ctx = a.prepareContext(ctx, requestInfo) + ctx, span := a.startTracingSpan(ctx, requestInfo, "Send") + defer span.End() + response, err := a.getHttpResponseMessage(ctx, requestInfo, "", span) + if err != nil { + return nil, err + } + + responseHandler := getResponseHandler(ctx) + if responseHandler != nil { + span.AddEvent(EventResponseHandlerInvokedKey) + result, err := responseHandler(response, errorMappings) + if err != nil { + span.RecordError(err) + return nil, err + } + return result.(absser.Parsable), nil + } else if response != nil { + defer a.purge(response) + err = a.throwIfFailedResponse(ctx, response, errorMappings, span) + if err != nil { + return nil, err + } + if a.shouldReturnNil(response) { + return nil, nil + } + parseNode, _, err := a.getRootParseNode(ctx, response, span) + if err != nil { + return nil, err + } + if parseNode == nil { + return nil, nil + } + _, deserializeSpan := otel.GetTracerProvider().Tracer(a.observabilityOptions.GetTracerInstrumentationName()).Start(ctx, "GetObjectValue") + defer deserializeSpan.End() + result, err := parseNode.GetObjectValue(constructor) + a.setResponseType(result, span) + if err != nil { + span.RecordError(err) + } + return result, err + } else { + return nil, errors.New("response is nil") + } +} + +func (a *NetHttpRequestAdapter) setResponseType(result any, span trace.Span) { + if result != nil { + span.SetAttributes(attribute.String("com.microsoft.kiota.response.type", reflect.TypeOf(result).String())) + } +} + +// SendEnum executes the HTTP request specified by the given RequestInformation and returns the deserialized response model. +func (a *NetHttpRequestAdapter) SendEnum(ctx context.Context, requestInfo *abs.RequestInformation, parser absser.EnumFactory, errorMappings abs.ErrorMappings) (any, error) { + if requestInfo == nil { + return nil, errors.New("requestInfo cannot be nil") + } + ctx = a.prepareContext(ctx, requestInfo) + ctx, span := a.startTracingSpan(ctx, requestInfo, "SendEnum") + defer span.End() + response, err := a.getHttpResponseMessage(ctx, requestInfo, "", span) + if err != nil { + return nil, err + } + + responseHandler := getResponseHandler(ctx) + if responseHandler != nil { + span.AddEvent(EventResponseHandlerInvokedKey) + result, err := responseHandler(response, errorMappings) + if err != nil { + span.RecordError(err) + return nil, err + } + return result.(absser.Parsable), nil + } else if response != nil { + defer a.purge(response) + err = a.throwIfFailedResponse(ctx, response, errorMappings, span) + if err != nil { + return nil, err + } + if a.shouldReturnNil(response) { + return nil, nil + } + parseNode, _, err := a.getRootParseNode(ctx, response, span) + if err != nil { + return nil, err + } + if parseNode == nil { + return nil, nil + } + _, deserializeSpan := otel.GetTracerProvider().Tracer(a.observabilityOptions.GetTracerInstrumentationName()).Start(ctx, "GetEnumValue") + defer deserializeSpan.End() + result, err := parseNode.GetEnumValue(parser) + a.setResponseType(result, span) + if err != nil { + span.RecordError(err) + } + return result, err + } else { + return nil, errors.New("response is nil") + } +} + +// SendCollection executes the HTTP request specified by the given RequestInformation and returns the deserialized response model collection. +func (a *NetHttpRequestAdapter) SendCollection(ctx context.Context, requestInfo *abs.RequestInformation, constructor absser.ParsableFactory, errorMappings abs.ErrorMappings) ([]absser.Parsable, error) { + if requestInfo == nil { + return nil, errors.New("requestInfo cannot be nil") + } + ctx = a.prepareContext(ctx, requestInfo) + ctx, span := a.startTracingSpan(ctx, requestInfo, "SendCollection") + defer span.End() + response, err := a.getHttpResponseMessage(ctx, requestInfo, "", span) + if err != nil { + return nil, err + } + + responseHandler := getResponseHandler(ctx) + if responseHandler != nil { + span.AddEvent(EventResponseHandlerInvokedKey) + result, err := responseHandler(response, errorMappings) + if err != nil { + span.RecordError(err) + return nil, err + } + return result.([]absser.Parsable), nil + } else if response != nil { + defer a.purge(response) + err = a.throwIfFailedResponse(ctx, response, errorMappings, span) + if err != nil { + return nil, err + } + if a.shouldReturnNil(response) { + return nil, nil + } + parseNode, _, err := a.getRootParseNode(ctx, response, span) + if err != nil { + return nil, err + } + if parseNode == nil { + return nil, nil + } + _, deserializeSpan := otel.GetTracerProvider().Tracer(a.observabilityOptions.GetTracerInstrumentationName()).Start(ctx, "GetCollectionOfObjectValues") + defer deserializeSpan.End() + result, err := parseNode.GetCollectionOfObjectValues(constructor) + a.setResponseType(result, span) + if err != nil { + span.RecordError(err) + } + return result, err + } else { + return nil, errors.New("response is nil") + } +} + +// SendEnumCollection executes the HTTP request specified by the given RequestInformation and returns the deserialized response model collection. +func (a *NetHttpRequestAdapter) SendEnumCollection(ctx context.Context, requestInfo *abs.RequestInformation, parser absser.EnumFactory, errorMappings abs.ErrorMappings) ([]any, error) { + if requestInfo == nil { + return nil, errors.New("requestInfo cannot be nil") + } + ctx = a.prepareContext(ctx, requestInfo) + ctx, span := a.startTracingSpan(ctx, requestInfo, "SendEnumCollection") + defer span.End() + response, err := a.getHttpResponseMessage(ctx, requestInfo, "", span) + if err != nil { + return nil, err + } + + responseHandler := getResponseHandler(ctx) + if responseHandler != nil { + span.AddEvent(EventResponseHandlerInvokedKey) + result, err := responseHandler(response, errorMappings) + if err != nil { + span.RecordError(err) + return nil, err + } + return result.([]any), nil + } else if response != nil { + defer a.purge(response) + err = a.throwIfFailedResponse(ctx, response, errorMappings, span) + if err != nil { + return nil, err + } + if a.shouldReturnNil(response) { + return nil, nil + } + parseNode, _, err := a.getRootParseNode(ctx, response, span) + if err != nil { + return nil, err + } + if parseNode == nil { + return nil, nil + } + _, deserializeSpan := otel.GetTracerProvider().Tracer(a.observabilityOptions.GetTracerInstrumentationName()).Start(ctx, "GetCollectionOfEnumValues") + defer deserializeSpan.End() + result, err := parseNode.GetCollectionOfEnumValues(parser) + a.setResponseType(result, span) + if err != nil { + span.RecordError(err) + } + return result, err + } else { + return nil, errors.New("response is nil") + } +} + +func getResponseHandler(ctx context.Context) abs.ResponseHandler { + var handlerOption = ctx.Value(abs.ResponseHandlerOptionKey) + if handlerOption != nil { + return handlerOption.(abs.RequestHandlerOption).GetResponseHandler() + } + return nil +} + +// SendPrimitive executes the HTTP request specified by the given RequestInformation and returns the deserialized primitive response model. +func (a *NetHttpRequestAdapter) SendPrimitive(ctx context.Context, requestInfo *abs.RequestInformation, typeName string, errorMappings abs.ErrorMappings) (any, error) { + if requestInfo == nil { + return nil, errors.New("requestInfo cannot be nil") + } + ctx = a.prepareContext(ctx, requestInfo) + ctx, span := a.startTracingSpan(ctx, requestInfo, "SendPrimitive") + defer span.End() + response, err := a.getHttpResponseMessage(ctx, requestInfo, "", span) + if err != nil { + return nil, err + } + + responseHandler := getResponseHandler(ctx) + if responseHandler != nil { + span.AddEvent(EventResponseHandlerInvokedKey) + result, err := responseHandler(response, errorMappings) + if err != nil { + span.RecordError(err) + return nil, err + } + return result.(absser.Parsable), nil + } else if response != nil { + defer a.purge(response) + err = a.throwIfFailedResponse(ctx, response, errorMappings, span) + if err != nil { + return nil, err + } + if a.shouldReturnNil(response) { + return nil, nil + } + if typeName == "[]byte" { + res, err := io.ReadAll(response.Body) + if err != nil { + span.RecordError(err) + return nil, err + } else if len(res) == 0 { + return nil, nil + } + return res, nil + } + parseNode, _, err := a.getRootParseNode(ctx, response, span) + if err != nil { + return nil, err + } + if parseNode == nil { + return nil, nil + } + _, deserializeSpan := otel.GetTracerProvider().Tracer(a.observabilityOptions.GetTracerInstrumentationName()).Start(ctx, "Get"+typeName+"Value") + defer deserializeSpan.End() + var result any + switch typeName { + case "string": + result, err = parseNode.GetStringValue() + case "float32": + result, err = parseNode.GetFloat32Value() + case "float64": + result, err = parseNode.GetFloat64Value() + case "int32": + result, err = parseNode.GetInt32Value() + case "int64": + result, err = parseNode.GetInt64Value() + case "bool": + result, err = parseNode.GetBoolValue() + case "Time": + result, err = parseNode.GetTimeValue() + case "UUID": + result, err = parseNode.GetUUIDValue() + default: + return nil, errors.New("unsupported type") + } + a.setResponseType(result, span) + if err != nil { + span.RecordError(err) + } + return result, err + } else { + return nil, errors.New("response is nil") + } +} + +// SendPrimitiveCollection executes the HTTP request specified by the given RequestInformation and returns the deserialized primitive response model collection. +func (a *NetHttpRequestAdapter) SendPrimitiveCollection(ctx context.Context, requestInfo *abs.RequestInformation, typeName string, errorMappings abs.ErrorMappings) ([]any, error) { + if requestInfo == nil { + return nil, errors.New("requestInfo cannot be nil") + } + ctx = a.prepareContext(ctx, requestInfo) + ctx, span := a.startTracingSpan(ctx, requestInfo, "SendPrimitiveCollection") + defer span.End() + response, err := a.getHttpResponseMessage(ctx, requestInfo, "", span) + if err != nil { + return nil, err + } + + responseHandler := getResponseHandler(ctx) + if responseHandler != nil { + span.AddEvent(EventResponseHandlerInvokedKey) + result, err := responseHandler(response, errorMappings) + if err != nil { + span.RecordError(err) + return nil, err + } + return result.([]any), nil + } else if response != nil { + defer a.purge(response) + err = a.throwIfFailedResponse(ctx, response, errorMappings, span) + if err != nil { + return nil, err + } + if a.shouldReturnNil(response) { + return nil, nil + } + parseNode, _, err := a.getRootParseNode(ctx, response, span) + if err != nil { + return nil, err + } + if parseNode == nil { + return nil, nil + } + _, deserializeSpan := otel.GetTracerProvider().Tracer(a.observabilityOptions.GetTracerInstrumentationName()).Start(ctx, "GetCollectionOfPrimitiveValues") + defer deserializeSpan.End() + result, err := parseNode.GetCollectionOfPrimitiveValues(typeName) + a.setResponseType(result, span) + if err != nil { + span.RecordError(err) + } + return result, err + } else { + return nil, errors.New("response is nil") + } +} + +// SendNoContent executes the HTTP request specified by the given RequestInformation with no return content. +func (a *NetHttpRequestAdapter) SendNoContent(ctx context.Context, requestInfo *abs.RequestInformation, errorMappings abs.ErrorMappings) error { + if requestInfo == nil { + return errors.New("requestInfo cannot be nil") + } + ctx = a.prepareContext(ctx, requestInfo) + ctx, span := a.startTracingSpan(ctx, requestInfo, "SendNoContent") + defer span.End() + response, err := a.getHttpResponseMessage(ctx, requestInfo, "", span) + if err != nil { + return err + } + + responseHandler := getResponseHandler(ctx) + if responseHandler != nil { + span.AddEvent(EventResponseHandlerInvokedKey) + _, err := responseHandler(response, errorMappings) + if err != nil { + span.RecordError(err) + } + return err + } else if response != nil { + defer a.purge(response) + err = a.throwIfFailedResponse(ctx, response, errorMappings, span) + if err != nil { + return err + } + return nil + } else { + return errors.New("response is nil") + } +} + +func (a *NetHttpRequestAdapter) getRootParseNode(ctx context.Context, response *nethttp.Response, spanForAttributes trace.Span) (absser.ParseNode, context.Context, error) { + ctx, span := otel.GetTracerProvider().Tracer(a.observabilityOptions.GetTracerInstrumentationName()).Start(ctx, "getRootParseNode") + defer span.End() + + if response.ContentLength == 0 { + return nil, ctx, nil + } + + body, err := io.ReadAll(response.Body) + if err != nil { + spanForAttributes.RecordError(err) + return nil, ctx, err + } + contentType := a.getResponsePrimaryContentType(response) + if contentType == "" { + return nil, ctx, nil + } + rootNode, err := a.parseNodeFactory.GetRootParseNode(contentType, body) + if err != nil { + spanForAttributes.RecordError(err) + } + return rootNode, ctx, err +} +func (a *NetHttpRequestAdapter) purge(response *nethttp.Response) error { + _, _ = io.ReadAll(response.Body) //we don't care about errors comming from reading the body, just trying to purge anything that maybe left + err := response.Body.Close() + if err != nil { + return err + } + return nil +} +func (a *NetHttpRequestAdapter) shouldReturnNil(response *nethttp.Response) bool { + return response.StatusCode == 204 +} + +// ErrorMappingFoundAttributeName is the attribute name used to indicate whether an error code mapping was found. +const ErrorMappingFoundAttributeName = "com.microsoft.kiota.error.mapping_found" + +// ErrorBodyFoundAttributeName is the attribute name used to indicate whether the error response contained a body +const ErrorBodyFoundAttributeName = "com.microsoft.kiota.error.body_found" + +func (a *NetHttpRequestAdapter) throwIfFailedResponse(ctx context.Context, response *nethttp.Response, errorMappings abs.ErrorMappings, spanForAttributes trace.Span) error { + ctx, span := otel.GetTracerProvider().Tracer(a.observabilityOptions.GetTracerInstrumentationName()).Start(ctx, "throwIfFailedResponse") + defer span.End() + if response.StatusCode < 400 { + return nil + } + spanForAttributes.SetStatus(codes.Error, "received_error_response") + + statusAsString := strconv.Itoa(response.StatusCode) + responseHeaders := abs.NewResponseHeaders() + for key, values := range response.Header { + for i := range values { + responseHeaders.Add(key, values[i]) + } + } + var errorCtor absser.ParsableFactory = nil + if len(errorMappings) != 0 { + if errorMappings[statusAsString] != nil { + errorCtor = errorMappings[statusAsString] + } else if response.StatusCode >= 400 && response.StatusCode < 500 && errorMappings["4XX"] != nil { + errorCtor = errorMappings["4XX"] + } else if response.StatusCode >= 500 && response.StatusCode < 600 && errorMappings["5XX"] != nil { + errorCtor = errorMappings["5XX"] + } else if errorMappings["XXX"] != nil && response.StatusCode >= 400 && response.StatusCode < 600 { + errorCtor = errorMappings["XXX"] + } + } + + if errorCtor == nil { + spanForAttributes.SetAttributes(attribute.Bool(ErrorMappingFoundAttributeName, false)) + err := &abs.ApiError{ + Message: "The server returned an unexpected status code and no error factory is registered for this code: " + statusAsString, + ResponseStatusCode: response.StatusCode, + ResponseHeaders: responseHeaders, + } + spanForAttributes.RecordError(err) + return err + } + spanForAttributes.SetAttributes(attribute.Bool(ErrorMappingFoundAttributeName, true)) + + rootNode, _, err := a.getRootParseNode(ctx, response, spanForAttributes) + if err != nil { + spanForAttributes.RecordError(err) + return err + } + if rootNode == nil { + spanForAttributes.SetAttributes(attribute.Bool(ErrorBodyFoundAttributeName, false)) + err := &abs.ApiError{ + Message: "The server returned an unexpected status code with no response body: " + statusAsString, + ResponseStatusCode: response.StatusCode, + ResponseHeaders: responseHeaders, + } + spanForAttributes.RecordError(err) + return err + } + spanForAttributes.SetAttributes(attribute.Bool(ErrorBodyFoundAttributeName, true)) + + _, deserializeSpan := otel.GetTracerProvider().Tracer(a.observabilityOptions.GetTracerInstrumentationName()).Start(ctx, "GetObjectValue") + defer deserializeSpan.End() + errValue, err := rootNode.GetObjectValue(errorCtor) + if err != nil { + spanForAttributes.RecordError(err) + if apiErrorable, ok := err.(abs.ApiErrorable); ok { + apiErrorable.SetResponseHeaders(responseHeaders) + apiErrorable.SetStatusCode(response.StatusCode) + } + return err + } else if errValue == nil { + return &abs.ApiError{ + Message: "The server returned an unexpected status code but the error could not be deserialized: " + statusAsString, + ResponseStatusCode: response.StatusCode, + ResponseHeaders: responseHeaders, + } + } + + if apiErrorable, ok := errValue.(abs.ApiErrorable); ok { + apiErrorable.SetResponseHeaders(responseHeaders) + apiErrorable.SetStatusCode(response.StatusCode) + } + + err = errValue.(error) + + spanForAttributes.RecordError(err) + return err +} diff --git a/vendor/github.com/microsoft/kiota-http-go/observability_options.go b/vendor/github.com/microsoft/kiota-http-go/observability_options.go new file mode 100644 index 000000000..11a1b2d71 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/observability_options.go @@ -0,0 +1,52 @@ +package nethttplibrary + +import ( + nethttp "net/http" + + abs "github.com/microsoft/kiota-abstractions-go" +) + +// ObservabilityOptions holds the tracing, metrics and logging configuration for the request adapter +type ObservabilityOptions struct { + // Whether to include attributes which could contains EUII information like URLs + IncludeEUIIAttributes bool +} + +// GetTracerInstrumentationName returns the observability name to use for the tracer +func (o *ObservabilityOptions) GetTracerInstrumentationName() string { + return "github.com/microsoft/kiota-http-go" +} + +// GetIncludeEUIIAttributes returns whether to include attributes which could contains EUII information +func (o *ObservabilityOptions) GetIncludeEUIIAttributes() bool { + return o.IncludeEUIIAttributes +} + +// SetIncludeEUIIAttributes set whether to include attributes which could contains EUII information +func (o *ObservabilityOptions) SetIncludeEUIIAttributes(value bool) { + o.IncludeEUIIAttributes = value +} + +// ObservabilityOptionsInt defines the options contract for handlers +type ObservabilityOptionsInt interface { + abs.RequestOption + GetTracerInstrumentationName() string + GetIncludeEUIIAttributes() bool + SetIncludeEUIIAttributes(value bool) +} + +func (*ObservabilityOptions) GetKey() abs.RequestOptionKey { + return observabilityOptionsKeyValue +} + +var observabilityOptionsKeyValue = abs.RequestOptionKey{ + Key: "ObservabilityOptions", +} + +// GetObservabilityOptionsFromRequest returns the observability options from the request context +func GetObservabilityOptionsFromRequest(req *nethttp.Request) ObservabilityOptionsInt { + if options, ok := req.Context().Value(observabilityOptionsKeyValue).(ObservabilityOptionsInt); ok { + return options + } + return nil +} diff --git a/vendor/github.com/microsoft/kiota-http-go/parameters_name_decoding_handler.go b/vendor/github.com/microsoft/kiota-http-go/parameters_name_decoding_handler.go new file mode 100644 index 000000000..3a169caf5 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/parameters_name_decoding_handler.go @@ -0,0 +1,94 @@ +package nethttplibrary + +import ( + nethttp "net/http" + "strconv" + "strings" + + abs "github.com/microsoft/kiota-abstractions-go" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" +) + +// ParametersNameDecodingOptions defines the options for the ParametersNameDecodingHandler +type ParametersNameDecodingOptions struct { + // Enable defines if the parameters name decoding should be enabled + Enable bool + // ParametersToDecode defines the characters that should be decoded + ParametersToDecode []byte +} + +// ParametersNameDecodingHandler decodes special characters in the request query parameters that had to be encoded due to RFC 6570 restrictions names before executing the request. +type ParametersNameDecodingHandler struct { + options ParametersNameDecodingOptions +} + +// NewParametersNameDecodingHandler creates a new ParametersNameDecodingHandler with default options +func NewParametersNameDecodingHandler() *ParametersNameDecodingHandler { + return NewParametersNameDecodingHandlerWithOptions(ParametersNameDecodingOptions{ + Enable: true, + ParametersToDecode: []byte{'-', '.', '~', '$'}, + }) +} + +// NewParametersNameDecodingHandlerWithOptions creates a new ParametersNameDecodingHandler with the given options +func NewParametersNameDecodingHandlerWithOptions(options ParametersNameDecodingOptions) *ParametersNameDecodingHandler { + return &ParametersNameDecodingHandler{options: options} +} + +type parametersNameDecodingOptionsInt interface { + abs.RequestOption + GetEnable() bool + GetParametersToDecode() []byte +} + +var parametersNameDecodingKeyValue = abs.RequestOptionKey{ + Key: "ParametersNameDecodingHandler", +} + +// GetKey returns the key value to be used when the option is added to the request context +func (options *ParametersNameDecodingOptions) GetKey() abs.RequestOptionKey { + return parametersNameDecodingKeyValue +} + +// GetEnable returns the enable value from the option +func (options *ParametersNameDecodingOptions) GetEnable() bool { + return options.Enable +} + +// GetParametersToDecode returns the parametersToDecode value from the option +func (options *ParametersNameDecodingOptions) GetParametersToDecode() []byte { + return options.ParametersToDecode +} + +// Intercept implements the RequestInterceptor interface and decodes the parameters name +func (handler *ParametersNameDecodingHandler) Intercept(pipeline Pipeline, middlewareIndex int, req *nethttp.Request) (*nethttp.Response, error) { + reqOption, ok := req.Context().Value(parametersNameDecodingKeyValue).(parametersNameDecodingOptionsInt) + if !ok { + reqOption = &handler.options + } + obsOptions := GetObservabilityOptionsFromRequest(req) + ctx := req.Context() + if obsOptions != nil { + ctx, span := otel.GetTracerProvider().Tracer(obsOptions.GetTracerInstrumentationName()).Start(ctx, "ParametersNameDecodingHandler_Intercept") + span.SetAttributes(attribute.Bool("com.microsoft.kiota.handler.parameters_name_decoding.enable", reqOption.GetEnable())) + req = req.WithContext(ctx) + defer span.End() + } + if reqOption.GetEnable() && + len(reqOption.GetParametersToDecode()) != 0 && + strings.Contains(req.URL.RawQuery, "%") { + req.URL.RawQuery = decodeUriEncodedString(req.URL.RawQuery, reqOption.GetParametersToDecode()) + } + return pipeline.Next(req, middlewareIndex) +} + +func decodeUriEncodedString(originalValue string, parametersToDecode []byte) string { + resultValue := originalValue + for _, parameter := range parametersToDecode { + valueToReplace := "%" + strconv.FormatInt(int64(parameter), 16) + replacementValue := string(parameter) + resultValue = strings.ReplaceAll(strings.ReplaceAll(resultValue, strings.ToUpper(valueToReplace), replacementValue), strings.ToLower(valueToReplace), replacementValue) + } + return resultValue +} diff --git a/vendor/github.com/microsoft/kiota-http-go/pipeline.go b/vendor/github.com/microsoft/kiota-http-go/pipeline.go new file mode 100644 index 000000000..3112abf48 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/pipeline.go @@ -0,0 +1,89 @@ +package nethttplibrary + +import ( + nethttp "net/http" + + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/trace" +) + +// Pipeline contract for middleware infrastructure +type Pipeline interface { + // Next moves the request object through middlewares in the pipeline + Next(req *nethttp.Request, middlewareIndex int) (*nethttp.Response, error) +} + +// custom transport for net/http with a middleware pipeline +type customTransport struct { + // middleware pipeline in use for the client + middlewarePipeline *middlewarePipeline +} + +// middleware pipeline implementation using a roundtripper from net/http +type middlewarePipeline struct { + // the round tripper to use to execute the request + transport nethttp.RoundTripper + // the middlewares to execute + middlewares []Middleware +} + +func newMiddlewarePipeline(middlewares []Middleware, transport nethttp.RoundTripper) *middlewarePipeline { + return &middlewarePipeline{ + transport: transport, + middlewares: middlewares, + } +} + +// Next moves the request object through middlewares in the pipeline +func (pipeline *middlewarePipeline) Next(req *nethttp.Request, middlewareIndex int) (*nethttp.Response, error) { + if middlewareIndex < len(pipeline.middlewares) { + middleware := pipeline.middlewares[middlewareIndex] + return middleware.Intercept(pipeline, middlewareIndex+1, req) + } + obsOptions := GetObservabilityOptionsFromRequest(req) + ctx := req.Context() + var span trace.Span + var observabilityName string + if obsOptions != nil { + observabilityName = obsOptions.GetTracerInstrumentationName() + ctx, span = otel.GetTracerProvider().Tracer(observabilityName).Start(ctx, "request_transport") + defer span.End() + req = req.WithContext(ctx) + } + return pipeline.transport.RoundTrip(req) +} + +// RoundTrip executes the the next middleware and returns a response +func (transport *customTransport) RoundTrip(req *nethttp.Request) (*nethttp.Response, error) { + return transport.middlewarePipeline.Next(req, 0) +} + +// GetDefaultTransport returns the default http transport used by the library +func GetDefaultTransport() nethttp.RoundTripper { + defaultTransport, ok := nethttp.DefaultTransport.(*nethttp.Transport) + if !ok { + return nethttp.DefaultTransport + } + defaultTransport = defaultTransport.Clone() + defaultTransport.ForceAttemptHTTP2 = true + defaultTransport.DisableCompression = false + return defaultTransport +} + +// NewCustomTransport creates a new custom transport for http client with the provided set of middleware +func NewCustomTransport(middlewares ...Middleware) *customTransport { + return NewCustomTransportWithParentTransport(nil, middlewares...) +} + +// NewCustomTransportWithParentTransport creates a new custom transport which relies on the provided transport for http client with the provided set of middleware +func NewCustomTransportWithParentTransport(parentTransport nethttp.RoundTripper, middlewares ...Middleware) *customTransport { + if len(middlewares) == 0 { + middlewares = GetDefaultMiddlewares() + } + if parentTransport == nil { + parentTransport = GetDefaultTransport() + } + return &customTransport{ + middlewarePipeline: newMiddlewarePipeline(middlewares, parentTransport), + } +} diff --git a/vendor/github.com/microsoft/kiota-http-go/redirect_handler.go b/vendor/github.com/microsoft/kiota-http-go/redirect_handler.go new file mode 100644 index 000000000..a9c2def96 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/redirect_handler.go @@ -0,0 +1,179 @@ +package nethttplibrary + +import ( + "context" + "errors" + "fmt" + nethttp "net/http" + "net/url" + "strings" + + abs "github.com/microsoft/kiota-abstractions-go" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" +) + +// RedirectHandler handles redirect responses and follows them according to the options specified. +type RedirectHandler struct { + // options to use when evaluating whether to redirect or not + options RedirectHandlerOptions +} + +// NewRedirectHandler creates a new redirect handler with the default options. +func NewRedirectHandler() *RedirectHandler { + return NewRedirectHandlerWithOptions(RedirectHandlerOptions{ + MaxRedirects: defaultMaxRedirects, + ShouldRedirect: func(req *nethttp.Request, res *nethttp.Response) bool { + return true + }, + }) +} + +// NewRedirectHandlerWithOptions creates a new redirect handler with the specified options. +func NewRedirectHandlerWithOptions(options RedirectHandlerOptions) *RedirectHandler { + return &RedirectHandler{options: options} +} + +// RedirectHandlerOptions to use when evaluating whether to redirect or not. +type RedirectHandlerOptions struct { + // A callback that determines whether to redirect or not. + ShouldRedirect func(req *nethttp.Request, res *nethttp.Response) bool + // The maximum number of redirects to follow. + MaxRedirects int +} + +var redirectKeyValue = abs.RequestOptionKey{ + Key: "RedirectHandler", +} + +type redirectHandlerOptionsInt interface { + abs.RequestOption + GetShouldRedirect() func(req *nethttp.Request, res *nethttp.Response) bool + GetMaxRedirect() int +} + +// GetKey returns the key value to be used when the option is added to the request context +func (options *RedirectHandlerOptions) GetKey() abs.RequestOptionKey { + return redirectKeyValue +} + +// GetShouldRedirect returns the redirection evaluation function. +func (options *RedirectHandlerOptions) GetShouldRedirect() func(req *nethttp.Request, res *nethttp.Response) bool { + return options.ShouldRedirect +} + +// GetMaxRedirect returns the maximum number of redirects to follow. +func (options *RedirectHandlerOptions) GetMaxRedirect() int { + if options == nil || options.MaxRedirects < 1 { + return defaultMaxRedirects + } else if options.MaxRedirects > absoluteMaxRedirects { + return absoluteMaxRedirects + } else { + return options.MaxRedirects + } +} + +const defaultMaxRedirects = 5 +const absoluteMaxRedirects = 20 +const movedPermanently = 301 +const found = 302 +const seeOther = 303 +const temporaryRedirect = 307 +const permanentRedirect = 308 +const locationHeader = "Location" + +// Intercept implements the interface and evaluates whether to follow a redirect response. +func (middleware RedirectHandler) Intercept(pipeline Pipeline, middlewareIndex int, req *nethttp.Request) (*nethttp.Response, error) { + obsOptions := GetObservabilityOptionsFromRequest(req) + ctx := req.Context() + var span trace.Span + var observabilityName string + if obsOptions != nil { + observabilityName = obsOptions.GetTracerInstrumentationName() + ctx, span = otel.GetTracerProvider().Tracer(observabilityName).Start(ctx, "RedirectHandler_Intercept") + span.SetAttributes(attribute.Bool("com.microsoft.kiota.handler.redirect.enable", true)) + defer span.End() + req = req.WithContext(ctx) + } + response, err := pipeline.Next(req, middlewareIndex) + if err != nil { + return response, err + } + reqOption, ok := req.Context().Value(redirectKeyValue).(redirectHandlerOptionsInt) + if !ok { + reqOption = &middleware.options + } + return middleware.redirectRequest(ctx, pipeline, middlewareIndex, reqOption, req, response, 0, observabilityName) +} + +func (middleware RedirectHandler) redirectRequest(ctx context.Context, pipeline Pipeline, middlewareIndex int, reqOption redirectHandlerOptionsInt, req *nethttp.Request, response *nethttp.Response, redirectCount int, observabilityName string) (*nethttp.Response, error) { + shouldRedirect := reqOption.GetShouldRedirect() != nil && reqOption.GetShouldRedirect()(req, response) || reqOption.GetShouldRedirect() == nil + if middleware.isRedirectResponse(response) && + redirectCount < reqOption.GetMaxRedirect() && + shouldRedirect { + redirectCount++ + redirectRequest, err := middleware.getRedirectRequest(req, response) + if err != nil { + return response, err + } + if observabilityName != "" { + ctx, span := otel.GetTracerProvider().Tracer(observabilityName).Start(ctx, "RedirectHandler_Intercept - redirect "+fmt.Sprint(redirectCount)) + span.SetAttributes(attribute.Int("com.microsoft.kiota.handler.redirect.count", redirectCount), + attribute.Int("http.status_code", response.StatusCode), + ) + defer span.End() + redirectRequest = redirectRequest.WithContext(ctx) + } + + result, err := pipeline.Next(redirectRequest, middlewareIndex) + if err != nil { + return result, err + } + return middleware.redirectRequest(ctx, pipeline, middlewareIndex, reqOption, redirectRequest, result, redirectCount, observabilityName) + } + return response, nil +} + +func (middleware RedirectHandler) isRedirectResponse(response *nethttp.Response) bool { + if response == nil { + return false + } + locationHeader := response.Header.Get(locationHeader) + if locationHeader == "" { + return false + } + statusCode := response.StatusCode + return statusCode == movedPermanently || statusCode == found || statusCode == seeOther || statusCode == temporaryRedirect || statusCode == permanentRedirect +} + +func (middleware RedirectHandler) getRedirectRequest(request *nethttp.Request, response *nethttp.Response) (*nethttp.Request, error) { + if request == nil || response == nil { + return nil, errors.New("request or response is nil") + } + locationHeaderValue := response.Header.Get(locationHeader) + if locationHeaderValue[0] == '/' { + locationHeaderValue = request.URL.Scheme + "://" + request.URL.Host + locationHeaderValue + } + result := request.Clone(request.Context()) + targetUrl, err := url.Parse(locationHeaderValue) + if err != nil { + return nil, err + } + result.URL = targetUrl + if result.Host != targetUrl.Host { + result.Host = targetUrl.Host + } + sameHost := strings.EqualFold(targetUrl.Host, request.URL.Host) + sameScheme := strings.EqualFold(targetUrl.Scheme, request.URL.Scheme) + if !sameHost || !sameScheme { + result.Header.Del("Authorization") + } + if response.StatusCode == seeOther { + result.Method = nethttp.MethodGet + result.Header.Del("Content-Type") + result.Header.Del("Content-Length") + result.Body = nil + } + return result, nil +} diff --git a/vendor/github.com/microsoft/kiota-http-go/retry_handler.go b/vendor/github.com/microsoft/kiota-http-go/retry_handler.go new file mode 100644 index 000000000..aa9faf43b --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/retry_handler.go @@ -0,0 +1,189 @@ +package nethttplibrary + +import ( + "context" + "fmt" + "io" + "math" + nethttp "net/http" + "strconv" + "time" + + abs "github.com/microsoft/kiota-abstractions-go" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" +) + +// RetryHandler handles transient HTTP responses and retries the request given the retry options +type RetryHandler struct { + // default options to use when evaluating the response + options RetryHandlerOptions +} + +// NewRetryHandler creates a new RetryHandler with default options +func NewRetryHandler() *RetryHandler { + return NewRetryHandlerWithOptions(RetryHandlerOptions{ + ShouldRetry: func(delay time.Duration, executionCount int, request *nethttp.Request, response *nethttp.Response) bool { + return true + }, + }) +} + +// NewRetryHandlerWithOptions creates a new RetryHandler with the given options +func NewRetryHandlerWithOptions(options RetryHandlerOptions) *RetryHandler { + return &RetryHandler{options: options} +} + +const defaultMaxRetries = 3 +const absoluteMaxRetries = 10 +const defaultDelaySeconds = 3 +const absoluteMaxDelaySeconds = 180 + +// RetryHandlerOptions to apply when evaluating the response for retrial +type RetryHandlerOptions struct { + // Callback to determine if the request should be retried + ShouldRetry func(delay time.Duration, executionCount int, request *nethttp.Request, response *nethttp.Response) bool + // The maximum number of times a request can be retried + MaxRetries int + // The delay in seconds between retries + DelaySeconds int +} + +type retryHandlerOptionsInt interface { + abs.RequestOption + GetShouldRetry() func(delay time.Duration, executionCount int, request *nethttp.Request, response *nethttp.Response) bool + GetDelaySeconds() int + GetMaxRetries() int +} + +var retryKeyValue = abs.RequestOptionKey{ + Key: "RetryHandler", +} + +// GetKey returns the key value to be used when the option is added to the request context +func (options *RetryHandlerOptions) GetKey() abs.RequestOptionKey { + return retryKeyValue +} + +// GetShouldRetry returns the should retry callback function which evaluates the response for retrial +func (options *RetryHandlerOptions) GetShouldRetry() func(delay time.Duration, executionCount int, request *nethttp.Request, response *nethttp.Response) bool { + return options.ShouldRetry +} + +// GetDelaySeconds returns the delays in seconds between retries +func (options *RetryHandlerOptions) GetDelaySeconds() int { + if options.DelaySeconds < 1 { + return defaultDelaySeconds + } else if options.DelaySeconds > absoluteMaxDelaySeconds { + return absoluteMaxDelaySeconds + } else { + return options.DelaySeconds + } +} + +// GetMaxRetries returns the maximum number of times a request can be retried +func (options *RetryHandlerOptions) GetMaxRetries() int { + if options.MaxRetries < 1 { + return defaultMaxRetries + } else if options.MaxRetries > absoluteMaxRetries { + return absoluteMaxRetries + } else { + return options.MaxRetries + } +} + +const retryAttemptHeader = "Retry-Attempt" +const retryAfterHeader = "Retry-After" + +const tooManyRequests = 429 +const serviceUnavailable = 503 +const gatewayTimeout = 504 + +// Intercept implements the interface and evaluates whether to retry a failed request. +func (middleware RetryHandler) Intercept(pipeline Pipeline, middlewareIndex int, req *nethttp.Request) (*nethttp.Response, error) { + obsOptions := GetObservabilityOptionsFromRequest(req) + ctx := req.Context() + var span trace.Span + var observabilityName string + if obsOptions != nil { + observabilityName = obsOptions.GetTracerInstrumentationName() + ctx, span = otel.GetTracerProvider().Tracer(observabilityName).Start(ctx, "RetryHandler_Intercept") + span.SetAttributes(attribute.Bool("com.microsoft.kiota.handler.retry.enable", true)) + defer span.End() + req = req.WithContext(ctx) + } + response, err := pipeline.Next(req, middlewareIndex) + if err != nil { + return response, err + } + reqOption, ok := req.Context().Value(retryKeyValue).(retryHandlerOptionsInt) + if !ok { + reqOption = &middleware.options + } + return middleware.retryRequest(ctx, pipeline, middlewareIndex, reqOption, req, response, 0, 0, observabilityName) +} + +func (middleware RetryHandler) retryRequest(ctx context.Context, pipeline Pipeline, middlewareIndex int, options retryHandlerOptionsInt, req *nethttp.Request, resp *nethttp.Response, executionCount int, cumulativeDelay time.Duration, observabilityName string) (*nethttp.Response, error) { + if middleware.isRetriableErrorCode(resp.StatusCode) && + middleware.isRetriableRequest(req) && + executionCount < options.GetMaxRetries() && + cumulativeDelay < time.Duration(absoluteMaxDelaySeconds)*time.Second && + options.GetShouldRetry()(cumulativeDelay, executionCount, req, resp) { + executionCount++ + delay := middleware.getRetryDelay(req, resp, options, executionCount) + cumulativeDelay += delay + req.Header.Set(retryAttemptHeader, strconv.Itoa(executionCount)) + if req.Body != nil { + s, ok := req.Body.(io.Seeker) + if ok { + s.Seek(0, io.SeekStart) + } + } + if observabilityName != "" { + ctx, span := otel.GetTracerProvider().Tracer(observabilityName).Start(ctx, "RetryHandler_Intercept - attempt "+fmt.Sprint(executionCount)) + span.SetAttributes(attribute.Int("http.retry_count", executionCount), + attribute.Int("http.status_code", resp.StatusCode), + ) + defer span.End() + req = req.WithContext(ctx) + } + t := time.NewTimer(delay) + select { + case <-ctx.Done(): + // Return without retrying if the context was cancelled. + return nil, ctx.Err() + + // Leaving this case empty causes it to exit the switch-block. + case <-t.C: + } + response, err := pipeline.Next(req, middlewareIndex) + if err != nil { + return response, err + } + return middleware.retryRequest(ctx, pipeline, middlewareIndex, options, req, response, executionCount, cumulativeDelay, observabilityName) + } + return resp, nil +} + +func (middleware RetryHandler) isRetriableErrorCode(code int) bool { + return code == tooManyRequests || code == serviceUnavailable || code == gatewayTimeout +} +func (middleware RetryHandler) isRetriableRequest(req *nethttp.Request) bool { + isBodiedMethod := req.Method == "POST" || req.Method == "PUT" || req.Method == "PATCH" + if isBodiedMethod && req.Body != nil { + return req.ContentLength != -1 + } + return true +} + +func (middleware RetryHandler) getRetryDelay(req *nethttp.Request, resp *nethttp.Response, options retryHandlerOptionsInt, executionCount int) time.Duration { + retryAfter := resp.Header.Get(retryAfterHeader) + if retryAfter != "" { + retryAfterDelay, err := strconv.ParseFloat(retryAfter, 64) + if err == nil { + return time.Duration(retryAfterDelay) * time.Second + } + } //TODO parse the header if it's a date + return time.Duration(math.Pow(float64(options.GetDelaySeconds()), float64(executionCount))) * time.Second +} diff --git a/vendor/github.com/microsoft/kiota-http-go/sonar-project.properties b/vendor/github.com/microsoft/kiota-http-go/sonar-project.properties new file mode 100644 index 000000000..c2fb1ef96 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=microsoft_kiota-http-go +sonar.organization=microsoft +sonar.exclusions=**/*_test.go +sonar.test.inclusions=**/*_test.go +sonar.go.tests.reportPaths=result.out +sonar.go.coverage.reportPaths=cover.out \ No newline at end of file diff --git a/vendor/github.com/microsoft/kiota-http-go/url_replace_handler.go b/vendor/github.com/microsoft/kiota-http-go/url_replace_handler.go new file mode 100644 index 000000000..40e8911b7 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/url_replace_handler.go @@ -0,0 +1,88 @@ +package nethttplibrary + +import ( + abstractions "github.com/microsoft/kiota-abstractions-go" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" + "net/http" + "strings" +) + +var urlReplaceOptionKey = abstractions.RequestOptionKey{Key: "UrlReplaceOptionKey"} + +// UrlReplaceHandler is a middleware handler that replaces url segments in the uri path. +type UrlReplaceHandler struct { + options UrlReplaceOptions +} + +// NewUrlReplaceHandler creates a configuration object for the CompressionHandler +func NewUrlReplaceHandler(enabled bool, replacementPairs map[string]string) *UrlReplaceHandler { + return &UrlReplaceHandler{UrlReplaceOptions{Enabled: enabled, ReplacementPairs: replacementPairs}} +} + +// UrlReplaceOptions is a configuration object for the UrlReplaceHandler middleware +type UrlReplaceOptions struct { + Enabled bool + ReplacementPairs map[string]string +} + +// GetKey returns UrlReplaceOptions unique name in context object +func (u *UrlReplaceOptions) GetKey() abstractions.RequestOptionKey { + return urlReplaceOptionKey +} + +// GetReplacementPairs reads ReplacementPairs settings from UrlReplaceOptions +func (u *UrlReplaceOptions) GetReplacementPairs() map[string]string { + return u.ReplacementPairs +} + +// IsEnabled reads Enabled setting from UrlReplaceOptions +func (u *UrlReplaceOptions) IsEnabled() bool { + return u.Enabled +} + +type urlReplaceOptionsInt interface { + abstractions.RequestOption + IsEnabled() bool + GetReplacementPairs() map[string]string +} + +// Intercept is invoked by the middleware pipeline to either move the request/response +// to the next middleware in the pipeline +func (c *UrlReplaceHandler) Intercept(pipeline Pipeline, middlewareIndex int, req *http.Request) (*http.Response, error) { + reqOption, ok := req.Context().Value(urlReplaceOptionKey).(urlReplaceOptionsInt) + if !ok { + reqOption = &c.options + } + + obsOptions := GetObservabilityOptionsFromRequest(req) + ctx := req.Context() + var span trace.Span + if obsOptions != nil { + ctx, span = otel.GetTracerProvider().Tracer(obsOptions.GetTracerInstrumentationName()).Start(ctx, "UrlReplaceHandler_Intercept") + span.SetAttributes(attribute.Bool("com.microsoft.kiota.handler.url_replacer.enable", true)) + defer span.End() + req = req.WithContext(ctx) + } + + if !reqOption.IsEnabled() || len(reqOption.GetReplacementPairs()) == 0 { + return pipeline.Next(req, middlewareIndex) + } + + req.URL.Path = ReplacePathTokens(req.URL.Path, reqOption.GetReplacementPairs()) + + if span != nil { + span.SetAttributes(attribute.String("http.request_url", req.RequestURI)) + } + + return pipeline.Next(req, middlewareIndex) +} + +// ReplacePathTokens invokes token replacement logic on the given url path +func ReplacePathTokens(path string, replacementPairs map[string]string) string { + for key, value := range replacementPairs { + path = strings.Replace(path, key, value, 1) + } + return path +} diff --git a/vendor/github.com/microsoft/kiota-http-go/user_agent_handler.go b/vendor/github.com/microsoft/kiota-http-go/user_agent_handler.go new file mode 100644 index 000000000..c984b8e9f --- /dev/null +++ b/vendor/github.com/microsoft/kiota-http-go/user_agent_handler.go @@ -0,0 +1,106 @@ +package nethttplibrary + +import ( + "fmt" + nethttp "net/http" + "strings" + + abs "github.com/microsoft/kiota-abstractions-go" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" +) + +// UserAgentHandler adds the product to the user agent header. +type UserAgentHandler struct { + options UserAgentHandlerOptions +} + +// NewUserAgentHandler creates a new user agent handler with the default options. +func NewUserAgentHandler() *UserAgentHandler { + return NewUserAgentHandlerWithOptions(nil) +} + +// NewUserAgentHandlerWithOptions creates a new user agent handler with the specified options. +func NewUserAgentHandlerWithOptions(options *UserAgentHandlerOptions) *UserAgentHandler { + if options == nil { + options = NewUserAgentHandlerOptions() + } + return &UserAgentHandler{ + options: *options, + } +} + +// UserAgentHandlerOptions to use when adding the product to the user agent header. +type UserAgentHandlerOptions struct { + Enabled bool + ProductName string + ProductVersion string +} + +// NewUserAgentHandlerOptions creates a new user agent handler options with the default values. +func NewUserAgentHandlerOptions() *UserAgentHandlerOptions { + return &UserAgentHandlerOptions{ + Enabled: true, + ProductName: "kiota-go", + ProductVersion: "1.3.3", + } +} + +var userAgentKeyValue = abs.RequestOptionKey{ + Key: "UserAgentHandler", +} + +type userAgentHandlerOptionsInt interface { + abs.RequestOption + GetEnabled() bool + GetProductName() string + GetProductVersion() string +} + +// GetKey returns the key value to be used when the option is added to the request context +func (options *UserAgentHandlerOptions) GetKey() abs.RequestOptionKey { + return userAgentKeyValue +} + +// GetEnabled returns the value of the enabled property +func (options *UserAgentHandlerOptions) GetEnabled() bool { + return options.Enabled +} + +// GetProductName returns the value of the product name property +func (options *UserAgentHandlerOptions) GetProductName() string { + return options.ProductName +} + +// GetProductVersion returns the value of the product version property +func (options *UserAgentHandlerOptions) GetProductVersion() string { + return options.ProductVersion +} + +const userAgentHeaderKey = "User-Agent" + +func (middleware UserAgentHandler) Intercept(pipeline Pipeline, middlewareIndex int, req *nethttp.Request) (*nethttp.Response, error) { + obsOptions := GetObservabilityOptionsFromRequest(req) + if obsOptions != nil { + observabilityName := obsOptions.GetTracerInstrumentationName() + ctx := req.Context() + ctx, span := otel.GetTracerProvider().Tracer(observabilityName).Start(ctx, "UserAgentHandler_Intercept") + span.SetAttributes(attribute.Bool("com.microsoft.kiota.handler.useragent.enable", true)) + defer span.End() + req = req.WithContext(ctx) + } + options, ok := req.Context().Value(userAgentKeyValue).(userAgentHandlerOptionsInt) + if !ok { + options = &middleware.options + } + if options.GetEnabled() { + additionalValue := fmt.Sprintf("%s/%s", options.GetProductName(), options.GetProductVersion()) + currentValue := req.Header.Get(userAgentHeaderKey) + if currentValue == "" { + req.Header.Set(userAgentHeaderKey, additionalValue) + } else if !strings.Contains(currentValue, additionalValue) { + req.Header.Set(userAgentHeaderKey, fmt.Sprintf("%s %s", currentValue, additionalValue)) + } + } + return pipeline.Next(req, middlewareIndex) +} diff --git a/vendor/github.com/microsoft/kiota-serialization-form-go/.gitignore b/vendor/github.com/microsoft/kiota-serialization-form-go/.gitignore new file mode 100644 index 000000000..398baf21b --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-form-go/.gitignore @@ -0,0 +1,17 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +.idea diff --git a/vendor/github.com/microsoft/kiota-serialization-form-go/CHANGELOG.md b/vendor/github.com/microsoft/kiota-serialization-form-go/CHANGELOG.md new file mode 100644 index 000000000..a4b8c5c07 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-form-go/CHANGELOG.md @@ -0,0 +1,48 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added + +### Changed + +## [1.0.0] - 2023-05-04 + +### Changed + +- GA Release. + +## [0.9.0] - 2023-03-01 + +### Changed + +- Update version number to 0.9.0. Fixes error in release number + +## [0.4.0] - 2023-03-01 + +### Added + +- Adds support for serialization of collections by serialization writer and parsenode. + +## [0.3.0] - 2023-01-26 + +### Changed + +- Added support for backing store. + +## [0.2.0] - 2022-12-16 + +### Changed + +- Fixed key encoding + +## [0.1.0] - 2022-12-15 + +### Added + +- Initial release of the package. diff --git a/vendor/github.com/microsoft/kiota-serialization-form-go/CODE_OF_CONDUCT.md b/vendor/github.com/microsoft/kiota-serialization-form-go/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..f9ba8cf65 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-form-go/CODE_OF_CONDUCT.md @@ -0,0 +1,9 @@ +# Microsoft Open Source Code of Conduct + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). + +Resources: + +- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) +- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns diff --git a/vendor/github.com/microsoft/kiota-serialization-form-go/LICENSE b/vendor/github.com/microsoft/kiota-serialization-form-go/LICENSE new file mode 100644 index 000000000..9e841e7a2 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-form-go/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/vendor/github.com/microsoft/kiota-serialization-form-go/README.md b/vendor/github.com/microsoft/kiota-serialization-form-go/README.md new file mode 100644 index 000000000..0c63cdc06 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-form-go/README.md @@ -0,0 +1,37 @@ +# Kiota Form Serialization Library for Go + +![Go Form Serialization](https://github.com/microsoft/kiota-serialization-form-go/actions/workflows/go.yml/badge.svg) + +This is the default Kiota Go form serialization library implementation. + +A [Kiota](https://github.com/microsoft/kiota) generated project will need a reference to a form serialization package to handle form payloads from an API endpoint. + +Read more about Kiota [here](https://github.com/microsoft/kiota/blob/main/README.md). + +## Using the Kiota Form Serialization Library + +```Shell +go get github.com/microsoft/kiota-serialization-form-go +``` + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a +Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us +the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. + +When you submit a pull request, a CLA bot will automatically determine whether you need to provide +a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions +provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or +contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + +## Trademarks + +This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft +trademarks or logos is subject to and must follow +[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). +Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. +Any use of third-party trademarks or logos are subject to those third-party's policies. diff --git a/vendor/github.com/microsoft/kiota-serialization-form-go/SECURITY.md b/vendor/github.com/microsoft/kiota-serialization-form-go/SECURITY.md new file mode 100644 index 000000000..e138ec5d6 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-form-go/SECURITY.md @@ -0,0 +1,41 @@ + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). + + diff --git a/vendor/github.com/microsoft/kiota-serialization-form-go/SUPPORT.md b/vendor/github.com/microsoft/kiota-serialization-form-go/SUPPORT.md new file mode 100644 index 000000000..291d4d437 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-form-go/SUPPORT.md @@ -0,0 +1,25 @@ +# TODO: The maintainer of this repo has not yet edited this file + +**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? + +- **No CSS support:** Fill out this template with information about how to file issues and get help. +- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps. +- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide. + +*Then remove this first heading from this SUPPORT.MD file before publishing your repo.* + +# Support + +## How to file issues and get help + +This project uses GitHub Issues to track bugs and feature requests. Please search the existing +issues before filing new issues to avoid duplicates. For new issues, file your bug or +feature request as a new Issue. + +For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE +FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER +CHANNEL. WHERE WILL YOU HELP PEOPLE?**. + +## Microsoft Support Policy + +Support for this **PROJECT or PRODUCT** is limited to the resources listed above. diff --git a/vendor/github.com/microsoft/kiota-serialization-form-go/form_parse_node.go b/vendor/github.com/microsoft/kiota-serialization-form-go/form_parse_node.go new file mode 100644 index 000000000..b17e922c8 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-form-go/form_parse_node.go @@ -0,0 +1,449 @@ +// Package formserialization is the default Kiota serialization implementation for URI form encoded. +package formserialization + +import ( + "encoding/base64" + "errors" + abstractions "github.com/microsoft/kiota-abstractions-go" + "net/url" + "strconv" + "strings" + "time" + + "github.com/google/uuid" + absser "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// FormParseNode is a ParseNode implementation for JSON. +type FormParseNode struct { + value string + fields map[string]string + onBeforeAssignFieldValues absser.ParsableAction + onAfterAssignFieldValues absser.ParsableAction +} + +// NewFormParseNode creates a new FormParseNode. +func NewFormParseNode(content []byte) (*FormParseNode, error) { + if len(content) == 0 { + return nil, errors.New("content is empty") + } + rawValue := string(content) + fields, err := loadFields(rawValue) + if err != nil { + return nil, err + } + return &FormParseNode{ + value: rawValue, + fields: fields, + }, nil +} +func loadFields(value string) (map[string]string, error) { + result := make(map[string]string) + if len(value) == 0 { + return result, nil + } + parts := strings.Split(value, "&") + for _, part := range parts { + keyValue := strings.Split(part, "=") + if len(keyValue) == 2 { + key, err := sanitizeKey(keyValue[0]) + if err != nil { + return nil, err + } + if result[key] == "" { + result[key] = keyValue[1] + } else { + result[key] += "," + keyValue[1] + } + } + } + return result, nil +} +func sanitizeKey(key string) (string, error) { + if key == "" { + return "", nil + } + res, err := url.QueryUnescape(key) + if err != nil { + return "", err + } + return strings.Trim(res, " "), nil +} + +// GetChildNode returns a new parse node for the given identifier. +func (n *FormParseNode) GetChildNode(index string) (absser.ParseNode, error) { + if index == "" { + return nil, errors.New("index is empty") + } + key, err := sanitizeKey(index) + if err != nil { + return nil, err + } + fieldValue := n.fields[key] + if fieldValue == "" { + return nil, nil + } + + node := &FormParseNode{ + value: fieldValue, + onBeforeAssignFieldValues: n.GetOnBeforeAssignFieldValues(), + onAfterAssignFieldValues: n.GetOnAfterAssignFieldValues(), + } + return node, nil +} + +// GetObjectValue returns the Parsable value from the node. +func (n *FormParseNode) GetObjectValue(ctor absser.ParsableFactory) (absser.Parsable, error) { + if ctor == nil { + return nil, errors.New("constructor is nil") + } + if n == nil || n.value == "" { + return nil, nil + } + result, err := ctor(n) + if err != nil { + return nil, err + } + abstractions.InvokeParsableAction(n.GetOnBeforeAssignFieldValues(), result) + fields := result.GetFieldDeserializers() + if len(n.fields) != 0 { + itemAsHolder, isHolder := result.(absser.AdditionalDataHolder) + var itemAdditionalData map[string]interface{} + if isHolder { + itemAdditionalData = itemAsHolder.GetAdditionalData() + if itemAdditionalData == nil { + itemAdditionalData = make(map[string]interface{}) + itemAsHolder.SetAdditionalData(itemAdditionalData) + } + } + + for key, value := range n.fields { + field := fields[key] + if field == nil { + if value != "" && isHolder { + if err != nil { + return nil, err + } + itemAdditionalData[key] = value + } + } else { + childNode, err := n.GetChildNode(key) + if err != nil { + return nil, err + } + err = field(childNode) + if err != nil { + return nil, err + } + } + } + } + abstractions.InvokeParsableAction(n.GetOnAfterAssignFieldValues(), result) + return result, nil +} + +// GetCollectionOfObjectValues returns the collection of Parsable values from the node. +func (n *FormParseNode) GetCollectionOfObjectValues(ctor absser.ParsableFactory) ([]absser.Parsable, error) { + return nil, errors.New("collections are not supported in form serialization") +} + +// GetCollectionOfPrimitiveValues returns the collection of primitive values from the node. +func (n *FormParseNode) GetCollectionOfPrimitiveValues(targetType string) ([]interface{}, error) { + if n == nil || n.value == "" { + return nil, nil + } + if targetType == "" { + return nil, errors.New("targetType is empty") + } + valueList := strings.Split(n.value, ",") + + result := make([]interface{}, len(valueList)) + for i, element := range valueList { + parseNode, err := NewFormParseNode([]byte(element)) + if err != nil { + return nil, err + } + + val, err := parseNode.getPrimitiveValue(targetType) + if err != nil { + return nil, err + } + result[i] = val + } + return result, nil +} + +func (n *FormParseNode) getPrimitiveValue(targetType string) (interface{}, error) { + switch targetType { + case "string": + return n.GetStringValue() + case "bool": + return n.GetBoolValue() + case "uint8": + return n.GetInt8Value() + case "byte": + return n.GetByteValue() + case "float32": + return n.GetFloat32Value() + case "float64": + return n.GetFloat64Value() + case "int32": + return n.GetInt32Value() + case "int64": + return n.GetInt64Value() + case "time": + return n.GetTimeValue() + case "timeonly": + return n.GetTimeOnlyValue() + case "dateonly": + return n.GetDateOnlyValue() + case "isoduration": + return n.GetISODurationValue() + case "uuid": + return n.GetUUIDValue() + case "base64": + return n.GetByteArrayValue() + default: + return nil, errors.New("targetType is not supported") + } +} + +// GetCollectionOfEnumValues returns the collection of Enum values from the node. +func (n *FormParseNode) GetCollectionOfEnumValues(parser absser.EnumFactory) ([]interface{}, error) { + if n == nil || n.value == "" { + return nil, nil + } + if parser == nil { + return nil, errors.New("parser is nil") + } + rawValues := strings.Split(n.value, ",") + result := make([]interface{}, len(rawValues)) + for i, rawValue := range rawValues { + node := &FormParseNode{ + value: rawValue, + } + val, err := node.GetEnumValue(parser) + if err != nil { + return nil, err + } + result[i] = val + } + return result, nil +} + +// GetStringValue returns a String value from the nodes. +func (n *FormParseNode) GetStringValue() (*string, error) { + if n == nil || n.value == "" { + return nil, nil + } + res, err := url.QueryUnescape(n.value) + if err != nil { + return nil, err + } + return &res, nil +} + +// GetBoolValue returns a Bool value from the nodes. +func (n *FormParseNode) GetBoolValue() (*bool, error) { + if n == nil || n.value == "" { + return nil, nil + } + res, err := strconv.ParseBool(n.value) + if err != nil { + return nil, err + } + return &res, nil +} + +// GetInt8Value returns a int8 value from the nodes. +func (n *FormParseNode) GetInt8Value() (*int8, error) { + if n == nil || n.value == "" { + return nil, nil + } + res, err := strconv.ParseInt(n.value, 10, 8) + if err != nil { + return nil, err + } + cast := int8(res) + return &cast, nil +} + +// GetBoolValue returns a Bool value from the nodes. +func (n *FormParseNode) GetByteValue() (*byte, error) { + if n == nil || n.value == "" { + return nil, nil + } + res, err := strconv.ParseInt(n.value, 10, 8) + if err != nil { + return nil, err + } + cast := byte(res) + return &cast, nil +} + +// GetFloat32Value returns a Float32 value from the nodes. +func (n *FormParseNode) GetFloat32Value() (*float32, error) { + v, err := n.GetFloat64Value() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + cast := float32(*v) + return &cast, nil +} + +// GetFloat64Value returns a Float64 value from the nodes. +func (n *FormParseNode) GetFloat64Value() (*float64, error) { + if n == nil || n.value == "" { + return nil, nil + } + res, err := strconv.ParseFloat(n.value, 64) + if err != nil { + return nil, err + } + return &res, nil +} + +// GetInt32Value returns a Int32 value from the nodes. +func (n *FormParseNode) GetInt32Value() (*int32, error) { + v, err := n.GetFloat64Value() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + cast := int32(*v) + return &cast, nil +} + +// GetInt64Value returns a Int64 value from the nodes. +func (n *FormParseNode) GetInt64Value() (*int64, error) { + v, err := n.GetFloat64Value() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + cast := int64(*v) + return &cast, nil +} + +// GetTimeValue returns a Time value from the nodes. +func (n *FormParseNode) GetTimeValue() (*time.Time, error) { + v, err := n.GetStringValue() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + parsed, err := time.Parse(time.RFC3339, *v) + return &parsed, err +} + +// GetISODurationValue returns a ISODuration value from the nodes. +func (n *FormParseNode) GetISODurationValue() (*absser.ISODuration, error) { + v, err := n.GetStringValue() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + return absser.ParseISODuration(*v) +} + +// GetTimeOnlyValue returns a TimeOnly value from the nodes. +func (n *FormParseNode) GetTimeOnlyValue() (*absser.TimeOnly, error) { + v, err := n.GetStringValue() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + return absser.ParseTimeOnly(*v) +} + +// GetDateOnlyValue returns a DateOnly value from the nodes. +func (n *FormParseNode) GetDateOnlyValue() (*absser.DateOnly, error) { + v, err := n.GetStringValue() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + return absser.ParseDateOnly(*v) +} + +// GetUUIDValue returns a UUID value from the nodes. +func (n *FormParseNode) GetUUIDValue() (*uuid.UUID, error) { + v, err := n.GetStringValue() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + parsed, err := uuid.Parse(*v) + return &parsed, err +} + +// GetEnumValue returns a Enum value from the nodes. +func (n *FormParseNode) GetEnumValue(parser absser.EnumFactory) (interface{}, error) { + if parser == nil { + return nil, errors.New("parser is nil") + } + s, err := n.GetStringValue() + if err != nil { + return nil, err + } + if s == nil { + return nil, nil + } + return parser(*s) +} + +// GetByteArrayValue returns a ByteArray value from the nodes. +func (n *FormParseNode) GetByteArrayValue() ([]byte, error) { + s, err := n.GetStringValue() + if err != nil { + return nil, err + } + if s == nil { + return nil, nil + } + return base64.StdEncoding.DecodeString(*s) +} + +// GetRawValue returns a ByteArray value from the nodes. +func (n *FormParseNode) GetRawValue() (interface{}, error) { + if n == nil || n.value == "" { + return nil, nil + } + res := n.value + return &res, nil +} + +func (n *FormParseNode) GetOnBeforeAssignFieldValues() absser.ParsableAction { + return n.onBeforeAssignFieldValues +} + +func (n *FormParseNode) SetOnBeforeAssignFieldValues(action absser.ParsableAction) error { + n.onBeforeAssignFieldValues = action + return nil +} + +func (n *FormParseNode) GetOnAfterAssignFieldValues() absser.ParsableAction { + return n.onAfterAssignFieldValues +} + +func (n *FormParseNode) SetOnAfterAssignFieldValues(action absser.ParsableAction) error { + n.onAfterAssignFieldValues = action + return nil +} diff --git a/vendor/github.com/microsoft/kiota-serialization-form-go/form_parse_node_factory.go b/vendor/github.com/microsoft/kiota-serialization-form-go/form_parse_node_factory.go new file mode 100644 index 000000000..cfe8d78b8 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-form-go/form_parse_node_factory.go @@ -0,0 +1,35 @@ +package formserialization + +import ( + "errors" + + absser "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// FormParseNodeFactory is a ParseNodeFactory implementation for URI form encoded +type FormParseNodeFactory struct { +} + +// Creates a new FormParseNodeFactory +func NewFormParseNodeFactory() *FormParseNodeFactory { + return &FormParseNodeFactory{} +} + +// GetValidContentType returns the content type this factory's parse nodes can deserialize. +func (f *FormParseNodeFactory) GetValidContentType() (string, error) { + return "application/x-www-form-urlencoded", nil +} + +// GetRootParseNode return a new ParseNode instance that is the root of the content +func (f *FormParseNodeFactory) GetRootParseNode(contentType string, content []byte) (absser.ParseNode, error) { + validType, err := f.GetValidContentType() + if err != nil { + return nil, err + } else if contentType == "" { + return nil, errors.New("contentType is empty") + } else if contentType != validType { + return nil, errors.New("contentType is not valid") + } else { + return NewFormParseNode(content) + } +} diff --git a/vendor/github.com/microsoft/kiota-serialization-form-go/form_serialization_writer.go b/vendor/github.com/microsoft/kiota-serialization-form-go/form_serialization_writer.go new file mode 100644 index 000000000..b4bd012c9 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-form-go/form_serialization_writer.go @@ -0,0 +1,505 @@ +package formserialization + +import ( + "encoding/base64" + "errors" + abstractions "github.com/microsoft/kiota-abstractions-go" + "net/url" + "strconv" + "strings" + "time" + + "github.com/google/uuid" + + absser "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// FormSerializationWriter implements SerializationWriter for URI form encoded. +type FormSerializationWriter struct { + writer []string + depth int + onBeforeAssignFieldValues absser.ParsableAction + onAfterAssignFieldValues absser.ParsableAction + onStartObjectSerialization absser.ParsableWriter +} + +// NewFormSerializationWriter creates a new instance of the FormSerializationWriter. +func NewFormSerializationWriter() *FormSerializationWriter { + return &FormSerializationWriter{ + writer: make([]string, 0), + } +} +func (w *FormSerializationWriter) writeRawValue(value string) { + w.writer = append(w.writer, url.QueryEscape(value)) +} +func (w *FormSerializationWriter) writeStringValue(value string) { + w.writeRawValue(value) +} +func (w *FormSerializationWriter) writePropertyName(key string) { + w.writer = append(w.writer, url.QueryEscape(key)+"=") +} +func (w *FormSerializationWriter) writePropertySeparator() { + w.writer = append(w.writer, "&") +} +func (w *FormSerializationWriter) trimLastPropertySeparator() { + lastIdx := len(w.writer) - 1 + if lastIdx > -1 && w.writer[lastIdx] == "&" { + w.writer[lastIdx] = "" + } +} + +// WriteStringValue writes a String value to underlying the byte array. +func (w *FormSerializationWriter) WriteStringValue(key string, value *string) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeStringValue(*value) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteBoolValue writes a Bool value to underlying the byte array. +func (w *FormSerializationWriter) WriteBoolValue(key string, value *bool) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeRawValue(strconv.FormatBool(*value)) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteByteValue writes a Byte value to underlying the byte array. +func (w *FormSerializationWriter) WriteByteValue(key string, value *byte) error { + if value != nil { + cast := int64(*value) + return w.WriteInt64Value(key, &cast) + } + return nil +} + +// WriteInt8Value writes a int8 value to underlying the byte array. +func (w *FormSerializationWriter) WriteInt8Value(key string, value *int8) error { + if value != nil { + cast := int64(*value) + return w.WriteInt64Value(key, &cast) + } + return nil +} + +// WriteInt32Value writes a Int32 value to underlying the byte array. +func (w *FormSerializationWriter) WriteInt32Value(key string, value *int32) error { + if value != nil { + cast := int64(*value) + return w.WriteInt64Value(key, &cast) + } + return nil +} + +// WriteInt64Value writes a Int64 value to underlying the byte array. +func (w *FormSerializationWriter) WriteInt64Value(key string, value *int64) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeRawValue(strconv.FormatInt(*value, 10)) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteFloat32Value writes a Float32 value to underlying the byte array. +func (w *FormSerializationWriter) WriteFloat32Value(key string, value *float32) error { + if value != nil { + cast := float64(*value) + return w.WriteFloat64Value(key, &cast) + } + return nil +} + +// WriteFloat64Value writes a Float64 value to underlying the byte array. +func (w *FormSerializationWriter) WriteFloat64Value(key string, value *float64) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeRawValue(strconv.FormatFloat(*value, 'f', -1, 64)) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteTimeValue writes a Time value to underlying the byte array. +func (w *FormSerializationWriter) WriteTimeValue(key string, value *time.Time) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeStringValue((*value).Format(time.RFC3339)) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteISODurationValue writes a ISODuration value to underlying the byte array. +func (w *FormSerializationWriter) WriteISODurationValue(key string, value *absser.ISODuration) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeStringValue((*value).String()) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteTimeOnlyValue writes a TimeOnly value to underlying the byte array. +func (w *FormSerializationWriter) WriteTimeOnlyValue(key string, value *absser.TimeOnly) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeStringValue((*value).String()) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteDateOnlyValue writes a DateOnly value to underlying the byte array. +func (w *FormSerializationWriter) WriteDateOnlyValue(key string, value *absser.DateOnly) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeStringValue((*value).String()) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteUUIDValue writes a UUID value to underlying the byte array. +func (w *FormSerializationWriter) WriteUUIDValue(key string, value *uuid.UUID) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeStringValue((*value).String()) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteByteArrayValue writes a ByteArray value to underlying the byte array. +func (w *FormSerializationWriter) WriteByteArrayValue(key string, value []byte) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeStringValue(base64.StdEncoding.EncodeToString(value)) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteObjectValue writes a Parsable value to underlying the byte array. +func (w *FormSerializationWriter) WriteObjectValue(key string, item absser.Parsable, additionalValuesToMerge ...absser.Parsable) error { + if w.depth > 0 { + return errors.New("nested objects serialization is not supported with FormSerializationWriter") + } + w.depth++ + additionalValuesLen := len(additionalValuesToMerge) + if item != nil || additionalValuesLen > 0 { + if key != "" { + w.writePropertyName(key) + } + abstractions.InvokeParsableAction(w.GetOnBeforeSerialization(), item) + if item != nil { + err := abstractions.InvokeParsableWriter(w.GetOnStartObjectSerialization(), item, w) + if err != nil { + return err + } + err = item.Serialize(w) + + abstractions.InvokeParsableAction(w.GetOnAfterObjectSerialization(), item) + if err != nil { + return err + } + } + + for _, additionalValue := range additionalValuesToMerge { + abstractions.InvokeParsableAction(w.GetOnBeforeSerialization(), additionalValue) + err := abstractions.InvokeParsableWriter(w.GetOnStartObjectSerialization(), additionalValue, w) + if err != nil { + return err + } + err = additionalValue.Serialize(w) + if err != nil { + return err + } + abstractions.InvokeParsableAction(w.GetOnAfterObjectSerialization(), additionalValue) + } + + if key != "" { + w.writePropertySeparator() + } + } + return nil +} + +// WriteCollectionOfObjectValues writes a collection of Parsable values to underlying the byte array. +func (w *FormSerializationWriter) WriteCollectionOfObjectValues(key string, collection []absser.Parsable) error { + return errors.New("collections serialization is not supported with FormSerializationWriter") +} + +func writeCollectionOfPrimitiveValues[T interface{}](key string, writer func(string, *T) error, collection []T) error { + if collection != nil && len(collection) > 0 { + for _, item := range collection { + err := writer(key, &item) + if err != nil { + return err + } + } + } + return nil +} + +// WriteCollectionOfStringValues writes a collection of String values to underlying the byte array. +func (w *FormSerializationWriter) WriteCollectionOfStringValues(key string, collection []string) error { + return writeCollectionOfPrimitiveValues(key, w.WriteStringValue, collection) +} + +// WriteCollectionOfInt32Values writes a collection of Int32 values to underlying the byte array. +func (w *FormSerializationWriter) WriteCollectionOfInt32Values(key string, collection []int32) error { + return writeCollectionOfPrimitiveValues(key, w.WriteInt32Value, collection) +} + +// WriteCollectionOfInt64Values writes a collection of Int64 values to underlying the byte array. +func (w *FormSerializationWriter) WriteCollectionOfInt64Values(key string, collection []int64) error { + return writeCollectionOfPrimitiveValues(key, w.WriteInt64Value, collection) +} + +// WriteCollectionOfFloat32Values writes a collection of Float32 values to underlying the byte array. +func (w *FormSerializationWriter) WriteCollectionOfFloat32Values(key string, collection []float32) error { + return writeCollectionOfPrimitiveValues(key, w.WriteFloat32Value, collection) +} + +// WriteCollectionOfFloat64Values writes a collection of Float64 values to underlying the byte array. +func (w *FormSerializationWriter) WriteCollectionOfFloat64Values(key string, collection []float64) error { + return writeCollectionOfPrimitiveValues(key, w.WriteFloat64Value, collection) +} + +// WriteCollectionOfTimeValues writes a collection of Time values to underlying the byte array. +func (w *FormSerializationWriter) WriteCollectionOfTimeValues(key string, collection []time.Time) error { + return writeCollectionOfPrimitiveValues(key, w.WriteTimeValue, collection) +} + +// WriteCollectionOfISODurationValues writes a collection of ISODuration values to underlying the byte array. +func (w *FormSerializationWriter) WriteCollectionOfISODurationValues(key string, collection []absser.ISODuration) error { + return writeCollectionOfPrimitiveValues(key, w.WriteISODurationValue, collection) +} + +// WriteCollectionOfTimeOnlyValues writes a collection of TimeOnly values to underlying the byte array. +func (w *FormSerializationWriter) WriteCollectionOfTimeOnlyValues(key string, collection []absser.TimeOnly) error { + return writeCollectionOfPrimitiveValues(key, w.WriteTimeOnlyValue, collection) +} + +// WriteCollectionOfDateOnlyValues writes a collection of DateOnly values to underlying the byte array. +func (w *FormSerializationWriter) WriteCollectionOfDateOnlyValues(key string, collection []absser.DateOnly) error { + return writeCollectionOfPrimitiveValues(key, w.WriteDateOnlyValue, collection) +} + +// WriteCollectionOfUUIDValues writes a collection of UUID values to underlying the byte array. +func (w *FormSerializationWriter) WriteCollectionOfUUIDValues(key string, collection []uuid.UUID) error { + return writeCollectionOfPrimitiveValues(key, w.WriteUUIDValue, collection) +} + +// WriteCollectionOfBoolValues writes a collection of Bool values to underlying the byte array. +func (w *FormSerializationWriter) WriteCollectionOfBoolValues(key string, collection []bool) error { + return writeCollectionOfPrimitiveValues(key, w.WriteBoolValue, collection) +} + +// WriteCollectionOfByteValues writes a collection of Byte values to underlying the byte array. +func (w *FormSerializationWriter) WriteCollectionOfByteValues(key string, collection []byte) error { + return writeCollectionOfPrimitiveValues(key, w.WriteByteValue, collection) +} + +// WriteCollectionOfInt8Values writes a collection of int8 values to underlying the byte array. +func (w *FormSerializationWriter) WriteCollectionOfInt8Values(key string, collection []int8) error { + return writeCollectionOfPrimitiveValues(key, w.WriteInt8Value, collection) +} + +// GetSerializedContent returns the resulting byte array from the serialization writer. +func (w *FormSerializationWriter) GetSerializedContent() ([]byte, error) { + w.trimLastPropertySeparator() + resultStr := strings.Join(w.writer, "") + return []byte(resultStr), nil +} + +// WriteAnyValue an unknown value as a parameter. +func (w *FormSerializationWriter) WriteAnyValue(key string, value interface{}) error { + return errors.New("serialization of any value is not supported with FormSerializationWriter") +} + +// WriteAdditionalData writes additional data to underlying the byte array. +func (w *FormSerializationWriter) WriteAdditionalData(value map[string]interface{}) error { + var err error + if len(value) != 0 { + for key, input := range value { + switch value := input.(type) { + case absser.Parsable: + err = w.WriteObjectValue(key, value) + case []absser.Parsable: + err = w.WriteCollectionOfObjectValues(key, value) + case []string: + err = w.WriteCollectionOfStringValues(key, value) + case []bool: + err = w.WriteCollectionOfBoolValues(key, value) + case []byte: + err = w.WriteCollectionOfByteValues(key, value) + case []int8: + err = w.WriteCollectionOfInt8Values(key, value) + case []int32: + err = w.WriteCollectionOfInt32Values(key, value) + case []int64: + err = w.WriteCollectionOfInt64Values(key, value) + case []float32: + err = w.WriteCollectionOfFloat32Values(key, value) + case []float64: + err = w.WriteCollectionOfFloat64Values(key, value) + case []uuid.UUID: + err = w.WriteCollectionOfUUIDValues(key, value) + case []time.Time: + err = w.WriteCollectionOfTimeValues(key, value) + case []absser.ISODuration: + err = w.WriteCollectionOfISODurationValues(key, value) + case []absser.TimeOnly: + err = w.WriteCollectionOfTimeOnlyValues(key, value) + case []absser.DateOnly: + err = w.WriteCollectionOfDateOnlyValues(key, value) + case *string: + err = w.WriteStringValue(key, value) + case string: + err = w.WriteStringValue(key, &value) + case *bool: + err = w.WriteBoolValue(key, value) + case bool: + err = w.WriteBoolValue(key, &value) + case *byte: + err = w.WriteByteValue(key, value) + case byte: + err = w.WriteByteValue(key, &value) + case *int8: + err = w.WriteInt8Value(key, value) + case int8: + err = w.WriteInt8Value(key, &value) + case *int32: + err = w.WriteInt32Value(key, value) + case int32: + err = w.WriteInt32Value(key, &value) + case *int64: + err = w.WriteInt64Value(key, value) + case int64: + err = w.WriteInt64Value(key, &value) + case *float32: + err = w.WriteFloat32Value(key, value) + case float32: + err = w.WriteFloat32Value(key, &value) + case *float64: + err = w.WriteFloat64Value(key, value) + case float64: + err = w.WriteFloat64Value(key, &value) + case *uuid.UUID: + err = w.WriteUUIDValue(key, value) + case uuid.UUID: + err = w.WriteUUIDValue(key, &value) + case *time.Time: + err = w.WriteTimeValue(key, value) + case time.Time: + err = w.WriteTimeValue(key, &value) + case *absser.ISODuration: + err = w.WriteISODurationValue(key, value) + case absser.ISODuration: + err = w.WriteISODurationValue(key, &value) + case *absser.TimeOnly: + err = w.WriteTimeOnlyValue(key, value) + case absser.TimeOnly: + err = w.WriteTimeOnlyValue(key, &value) + case *absser.DateOnly: + err = w.WriteDateOnlyValue(key, value) + case absser.DateOnly: + err = w.WriteDateOnlyValue(key, &value) + } + } + } + return err +} + +// Close clears the internal buffer. +func (w *FormSerializationWriter) Close() error { + w.writer = make([]string, 0) + return nil +} + +func (w *FormSerializationWriter) WriteNullValue(key string) error { + if key != "" { + w.writePropertyName(key) + } + + w.writeRawValue("null") + + if key != "" { + w.writePropertySeparator() + } + + return nil +} + +func (w *FormSerializationWriter) GetOnBeforeSerialization() absser.ParsableAction { + return w.onBeforeAssignFieldValues +} + +func (w *FormSerializationWriter) SetOnBeforeSerialization(action absser.ParsableAction) error { + w.onBeforeAssignFieldValues = action + return nil +} + +func (w *FormSerializationWriter) GetOnAfterObjectSerialization() absser.ParsableAction { + return w.onAfterAssignFieldValues +} + +func (w *FormSerializationWriter) SetOnAfterObjectSerialization(action absser.ParsableAction) error { + w.onAfterAssignFieldValues = action + return nil +} + +func (w *FormSerializationWriter) GetOnStartObjectSerialization() absser.ParsableWriter { + return w.onStartObjectSerialization +} + +func (w *FormSerializationWriter) SetOnStartObjectSerialization(writer absser.ParsableWriter) error { + w.onStartObjectSerialization = writer + return nil +} diff --git a/vendor/github.com/microsoft/kiota-serialization-form-go/form_serialization_writer_factory.go b/vendor/github.com/microsoft/kiota-serialization-form-go/form_serialization_writer_factory.go new file mode 100644 index 000000000..de0c94e6a --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-form-go/form_serialization_writer_factory.go @@ -0,0 +1,35 @@ +package formserialization + +import ( + "errors" + + absser "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// FormSerializationWriterFactory implements SerializationWriterFactory for URI form encoded. +type FormSerializationWriterFactory struct { +} + +// NewFormSerializationWriterFactory creates a new instance of the FormSerializationWriterFactory. +func NewFormSerializationWriterFactory() *FormSerializationWriterFactory { + return &FormSerializationWriterFactory{} +} + +// GetValidContentType returns the valid content type for the SerializationWriterFactoryRegistry +func (f *FormSerializationWriterFactory) GetValidContentType() (string, error) { + return "application/x-www-form-urlencoded", nil +} + +// GetSerializationWriter returns the relevant SerializationWriter instance for the given content type +func (f *FormSerializationWriterFactory) GetSerializationWriter(contentType string) (absser.SerializationWriter, error) { + validType, err := f.GetValidContentType() + if err != nil { + return nil, err + } else if contentType == "" { + return nil, errors.New("contentType is empty") + } else if contentType != validType { + return nil, errors.New("contentType is not valid") + } else { + return NewFormSerializationWriter(), nil + } +} diff --git a/vendor/github.com/microsoft/kiota-serialization-form-go/sonar-project.properties b/vendor/github.com/microsoft/kiota-serialization-form-go/sonar-project.properties new file mode 100644 index 000000000..6d229d864 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-form-go/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=microsoft_kiota-serialization-form-go +sonar.organization=microsoft +sonar.exclusions=**/*_test.go +sonar.test.inclusions=**/*_test.go +sonar.go.tests.reportPaths=result.out +sonar.go.coverage.reportPaths=cover.out \ No newline at end of file diff --git a/vendor/github.com/microsoft/kiota-serialization-json-go/.gitignore b/vendor/github.com/microsoft/kiota-serialization-json-go/.gitignore new file mode 100644 index 000000000..398baf21b --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-json-go/.gitignore @@ -0,0 +1,17 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +.idea diff --git a/vendor/github.com/microsoft/kiota-serialization-json-go/CHANGELOG.md b/vendor/github.com/microsoft/kiota-serialization-json-go/CHANGELOG.md new file mode 100644 index 000000000..6fe7349cf --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-json-go/CHANGELOG.md @@ -0,0 +1,215 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [1.0.7] - 2024-02-29 + +### Added + +- Adds support for serialization and deserialization untyped nodes. + +## [1.0.6] - 2024-02-12 + +### Changed + +- Fixes serilaization of `null` values in collections of Objects. + +## [1.0.5] - 2024-01-10 + +### Changed + +- Fixes some special character escaping when serializing strings to JSON. Previous incorrect escaping could lead to deserialization errors if old serialized data is read again. + +## [1.0.4] - 2023-07-12 + +### Changed + +- Fixes parsing time parsing without timezone information. + +## [1.0.3] - 2023-06-28 + +### Changed + +- Fixes serialization of composed types for scalar values. + +## [1.0.2] - 2023-06-14 + +- Safely serialize null values in collections of Objects, Enums or primitives. + +### Changed + +## [1.0.1] - 2023-05-25 + +- Fixes bug where slices backing data from `GetSerializedContent` could be overwritten before they were used but after `JsonSerializationWriter.Close()` was called. + +### Added + +## [1.0.0] - 2023-05-04 + +### Changed + +- GA Release. + +## [0.9.3] - 2023-04-24 + +### Changed + +- Use buffer pool for `JsonSerializationWriter`. + +## [0.9.2] - 2023-04-17 + +### Changed + +- Improve `JsonSerializationWriter` serialization performance. + +## [0.9.1] - 2023-04-05 + +### Added + +- Improve error messaging for serialization error. + +## [0.9.0] - 2023-03-30 + +### Added + +- Add Unmarshal and Marshal helpers. + +## [0.8.3] - 2023-03-20 + +### Added + +- Validates json content before parsing. + +## [0.8.2] - 2023-03-01 + +### Added + +- Fixes bug that returned `JsonParseNode` as value for nested maps when `GetRawValue` is called. + +## [0.8.1] - 2023-02-20 + +### Added + +- Fixes bug that returned `JsonParseNode` as value for collections when `GetRawValue` is called. + +## [0.8.0] - 2023-01-23 + +### Added + +- Added support for backing store. + +## [0.7.2] - 2022-09-29 + +### Changed + +- Fix: Bug on GetRawValue results to invalid memory address when server responds with a `null` on the request body field. + +## [0.7.1] - 2022-09-26 + +### Changed + +- Fixed method name for write any value. + +## [0.7.0] - 2022-09-22 + +### Added + +- Implement additional serialization method `WriteAnyValues` and parse method `GetRawValue`. + +## [0.6.0] - 2022-09-02 + +### Added + +- Added support for composed types serialization. + +## [0.5.6] - 2022-09-02 + +- Upgrades abstractions and yaml dependencies. + +### Added + +## [0.5.5] - 2022-07-12 + +- Fixed bug where string literals of `\t` and `\r` would result in generating an invalid JSON. + +### Changed + +## [0.5.4] - 2022-06-30 + +### Changed + +- Fixed a bug where a backslash in a string would result in an invalid payload. + +## [0.5.3] - 2022-06-09 + +### Changed + +- Fixed a bug where new lines in string values would not be escaped generating invalid JSON. + +## [0.5.2] - 2022-06-07 + +### Changed + +- Upgrades abstractions and yaml dependencies. + +## [0.5.1] - 2022-05-30 + +### Changed + + - Updated supported types for Additional Data, unsupported types now throwing an error instead of ignoring. + - Changed logic that trims excessive commas to be called only once on serialization. + +## [0.5.0] - 2022-05-26 + +### Changed + + - Updated reference to abstractions to support enum responses. + +## [0.4.0] - 2022-05-19 + +### Changed + +- Upgraded abstractions version. + +## [0.3.2] - 2022-05-11 + +### Changed + +- Serialization writer close method now clears the internal array and can be used to reset the writer. + +## [0.3.1] - 2022-05-03 + +### Changed + +- Fixed an issue where quotes in string values would not be escaped. #11 +- Fixed an issue where int64 and byte values would get a double key. #12, #13 + +## [0.3.0] - 2022-04-19 + +### Changed + +- Upgraded abstractions to 0.4.0. +- Upgraded to go 18. + +## [0.2.1] - 2022-04-14 + +### Changed + +- Fixed a bug where dates, date only, time only and duration would not serialize properly. + +## [0.2.0] - 2022-04-04 + +### Changed + +- Breaking: simplifies the field deserializers. + +## [0.1.0] - 2022-03-30 + +### Added + +- Initial tagged release of the library. diff --git a/vendor/github.com/microsoft/kiota-serialization-json-go/CODE_OF_CONDUCT.md b/vendor/github.com/microsoft/kiota-serialization-json-go/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..f9ba8cf65 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-json-go/CODE_OF_CONDUCT.md @@ -0,0 +1,9 @@ +# Microsoft Open Source Code of Conduct + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). + +Resources: + +- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) +- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns diff --git a/vendor/github.com/microsoft/kiota-serialization-json-go/LICENSE b/vendor/github.com/microsoft/kiota-serialization-json-go/LICENSE new file mode 100644 index 000000000..9e841e7a2 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-json-go/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/vendor/github.com/microsoft/kiota-serialization-json-go/README.md b/vendor/github.com/microsoft/kiota-serialization-json-go/README.md new file mode 100644 index 000000000..80ec5eb45 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-json-go/README.md @@ -0,0 +1,37 @@ +# Kiota Json Serialization Library for Go + +![Go Serialization Text](https://github.com/microsoft/kiota-serialization-json-go/actions/workflows/go.yml/badge.svg) + +The Json Serialization Library for Go is the Go JSON serialization library implementation. + +A [Kiota](https://github.com/microsoft/kiota) generated project will need a reference to a json serialization package to handle json payloads from an API endpoint. + +Read more about Kiota [here](https://github.com/microsoft/kiota/blob/main/README.md). + +## Using the Kiota Json Serialization Library + +```Shell + go get github.com/microsoft/kiota-serialization-json-go +``` + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a +Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us +the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. + +When you submit a pull request, a CLA bot will automatically determine whether you need to provide +a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions +provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or +contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + +## Trademarks + +This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft +trademarks or logos is subject to and must follow +[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). +Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. +Any use of third-party trademarks or logos are subject to those third-party's policies. diff --git a/vendor/github.com/microsoft/kiota-serialization-json-go/SECURITY.md b/vendor/github.com/microsoft/kiota-serialization-json-go/SECURITY.md new file mode 100644 index 000000000..f7b89984f --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-json-go/SECURITY.md @@ -0,0 +1,41 @@ + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). + + \ No newline at end of file diff --git a/vendor/github.com/microsoft/kiota-serialization-json-go/SUPPORT.md b/vendor/github.com/microsoft/kiota-serialization-json-go/SUPPORT.md new file mode 100644 index 000000000..dc72f0e5a --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-json-go/SUPPORT.md @@ -0,0 +1,25 @@ +# TODO: The maintainer of this repo has not yet edited this file + +**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? + +- **No CSS support:** Fill out this template with information about how to file issues and get help. +- **Yes CSS support:** Fill out an intake form at [aka.ms/spot](https://aka.ms/spot). CSS will work with/help you to determine next steps. More details also available at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). +- **Not sure?** Fill out a SPOT intake as though the answer were "Yes". CSS will help you decide. + +*Then remove this first heading from this SUPPORT.MD file before publishing your repo.* + +# Support + +## How to file issues and get help + +This project uses GitHub Issues to track bugs and feature requests. Please search the existing +issues before filing new issues to avoid duplicates. For new issues, file your bug or +feature request as a new Issue. + +For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE +FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER +CHANNEL. WHERE WILL YOU HELP PEOPLE?**. + +## Microsoft Support Policy + +Support for this **PROJECT or PRODUCT** is limited to the resources listed above. diff --git a/vendor/github.com/microsoft/kiota-serialization-json-go/json_parse_node.go b/vendor/github.com/microsoft/kiota-serialization-json-go/json_parse_node.go new file mode 100644 index 000000000..18396deaf --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-json-go/json_parse_node.go @@ -0,0 +1,635 @@ +// Package jsonserialization is the default Kiota serialization implementation for JSON. +// It relies on the standard Go JSON library. +package jsonserialization + +import ( + "bytes" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "io" + "time" + + "github.com/google/uuid" + + abstractions "github.com/microsoft/kiota-abstractions-go" + absser "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// JsonParseNode is a ParseNode implementation for JSON. +type JsonParseNode struct { + value interface{} + onBeforeAssignFieldValues absser.ParsableAction + onAfterAssignFieldValues absser.ParsableAction +} + +// NewJsonParseNode creates a new JsonParseNode. +func NewJsonParseNode(content []byte) (*JsonParseNode, error) { + if len(content) == 0 { + return nil, errors.New("content is empty") + } + if !json.Valid(content) { + return nil, errors.New("invalid json type") + } + decoder := json.NewDecoder(bytes.NewReader(content)) + value, err := loadJsonTree(decoder) + return value, err +} +func loadJsonTree(decoder *json.Decoder) (*JsonParseNode, error) { + for { + token, err := decoder.Token() + if err == io.EOF { + break + } + if err != nil { + return nil, err + } + switch token.(type) { + case json.Delim: + switch token.(json.Delim) { + case '{': + v := make(map[string]*JsonParseNode) + for decoder.More() { + key, err := decoder.Token() + if err != nil { + return nil, err + } + keyStr, ok := key.(string) + if !ok { + return nil, errors.New("key is not a string") + } + childNode, err := loadJsonTree(decoder) + if err != nil { + return nil, err + } + v[keyStr] = childNode + } + decoder.Token() // skip the closing curly + result := &JsonParseNode{value: v} + return result, nil + case '[': + v := make([]*JsonParseNode, 0) + for decoder.More() { + childNode, err := loadJsonTree(decoder) + if err != nil { + return nil, err + } + v = append(v, childNode) + } + decoder.Token() // skip the closing bracket + result := &JsonParseNode{value: v} + return result, nil + case ']': + case '}': + } + case json.Number: + number := token.(json.Number) + i, err := number.Int64() + c := &JsonParseNode{} + if err == nil { + c.SetValue(&i) + } else { + f, err := number.Float64() + if err == nil { + c.SetValue(&f) + } else { + return nil, err + } + } + return c, nil + case string: + v := token.(string) + c := &JsonParseNode{} + c.SetValue(&v) + return c, nil + case bool: + c := &JsonParseNode{} + v := token.(bool) + c.SetValue(&v) + return c, nil + case int8: + c := &JsonParseNode{} + v := token.(int8) + c.SetValue(&v) + return c, nil + case byte: + c := &JsonParseNode{} + v := token.(byte) + c.SetValue(&v) + return c, nil + case float64: + c := &JsonParseNode{} + v := token.(float64) + c.SetValue(&v) + return c, nil + case float32: + c := &JsonParseNode{} + v := token.(float32) + c.SetValue(&v) + return c, nil + case int32: + c := &JsonParseNode{} + v := token.(int32) + c.SetValue(&v) + return c, nil + case int64: + c := &JsonParseNode{} + v := token.(int64) + c.SetValue(&v) + return c, nil + case nil: + return nil, nil + default: + } + } + return nil, nil +} + +// SetValue sets the value represented by the node +func (n *JsonParseNode) SetValue(value interface{}) { + n.value = value +} + +// GetChildNode returns a new parse node for the given identifier. +func (n *JsonParseNode) GetChildNode(index string) (absser.ParseNode, error) { + if index == "" { + return nil, errors.New("index is empty") + } + childNodes, ok := n.value.(map[string]*JsonParseNode) + if !ok || len(childNodes) == 0 { + return nil, nil + } + + childNode := childNodes[index] + if childNode != nil { + err := childNode.SetOnBeforeAssignFieldValues(n.GetOnBeforeAssignFieldValues()) + if err != nil { + return nil, err + } + err = childNode.SetOnAfterAssignFieldValues(n.GetOnAfterAssignFieldValues()) + if err != nil { + return nil, err + } + } + + return childNode, nil +} + +// GetObjectValue returns the Parsable value from the node. +func (n *JsonParseNode) GetObjectValue(ctor absser.ParsableFactory) (absser.Parsable, error) { + if ctor == nil { + return nil, errors.New("constructor is nil") + } + if n == nil || n.value == nil { + return nil, nil + } + result, err := ctor(n) + if err != nil { + return nil, err + } + + _, isUntypedNode := result.(absser.UntypedNodeable) + if isUntypedNode { + switch value := n.value.(type) { + case *bool: + return absser.NewUntypedBoolean(*value), nil + case *string: + return absser.NewUntypedString(*value), nil + case *float32: + return absser.NewUntypedFloat(*value), nil + case *float64: + return absser.NewUntypedDouble(*value), nil + case *int32: + return absser.NewUntypedInteger(*value), nil + case *int64: + return absser.NewUntypedLong(*value), nil + case nil: + return absser.NewUntypedNull(), nil + case map[string]*JsonParseNode: + properties := make(map[string]absser.UntypedNodeable) + for key, value := range value { + parsable, err := value.GetObjectValue(absser.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return nil, errors.New("cannot parse object value") + } + if parsable == nil { + parsable = absser.NewUntypedNull() + } + property, ok := parsable.(absser.UntypedNodeable) + if ok { + properties[key] = property + } + } + return absser.NewUntypedObject(properties), nil + case []*JsonParseNode: + collection := make([]absser.UntypedNodeable, len(value)) + for index, node := range value { + parsable, err := node.GetObjectValue(absser.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return nil, errors.New("cannot parse object value") + } + if parsable == nil { + parsable = absser.NewUntypedNull() + } + property, ok := parsable.(absser.UntypedNodeable) + if ok { + collection[index] = property + } + + } + return absser.NewUntypedArray(collection), nil + default: + return absser.NewUntypedNode(value), nil + } + } + + abstractions.InvokeParsableAction(n.GetOnBeforeAssignFieldValues(), result) + properties, ok := n.value.(map[string]*JsonParseNode) + fields := result.GetFieldDeserializers() + if ok && len(properties) != 0 { + itemAsHolder, isHolder := result.(absser.AdditionalDataHolder) + var itemAdditionalData map[string]interface{} + if isHolder { + itemAdditionalData = itemAsHolder.GetAdditionalData() + if itemAdditionalData == nil { + itemAdditionalData = make(map[string]interface{}) + itemAsHolder.SetAdditionalData(itemAdditionalData) + } + } + + for key, value := range properties { + field := fields[key] + if value != nil { + err := value.SetOnBeforeAssignFieldValues(n.GetOnBeforeAssignFieldValues()) + if err != nil { + return nil, err + } + err = value.SetOnAfterAssignFieldValues(n.GetOnAfterAssignFieldValues()) + if err != nil { + return nil, err + } + } + if field == nil { + if value != nil && isHolder { + rawValue, err := value.GetRawValue() + if err != nil { + return nil, err + } + itemAdditionalData[key] = rawValue + } + } else { + err := field(value) + if err != nil { + return nil, err + } + } + } + } + abstractions.InvokeParsableAction(n.GetOnAfterAssignFieldValues(), result) + return result, nil +} + +// GetCollectionOfObjectValues returns the collection of Parsable values from the node. +func (n *JsonParseNode) GetCollectionOfObjectValues(ctor absser.ParsableFactory) ([]absser.Parsable, error) { + if n == nil || n.value == nil { + return nil, nil + } + if ctor == nil { + return nil, errors.New("ctor is nil") + } + nodes, ok := n.value.([]*JsonParseNode) + if !ok { + return nil, errors.New("value is not a collection") + } + result := make([]absser.Parsable, len(nodes)) + for i, v := range nodes { + if v != nil { + val, err := (*v).GetObjectValue(ctor) + if err != nil { + return nil, err + } + result[i] = val + } else { + result[i] = nil + } + } + return result, nil +} + +// GetCollectionOfPrimitiveValues returns the collection of primitive values from the node. +func (n *JsonParseNode) GetCollectionOfPrimitiveValues(targetType string) ([]interface{}, error) { + if n == nil || n.value == nil { + return nil, nil + } + if targetType == "" { + return nil, errors.New("targetType is empty") + } + nodes, ok := n.value.([]*JsonParseNode) + if !ok { + return nil, errors.New("value is not a collection") + } + result := make([]interface{}, len(nodes)) + for i, v := range nodes { + if v != nil { + val, err := v.getPrimitiveValue(targetType) + if err != nil { + return nil, err + } + result[i] = val + } else { + result[i] = nil + } + } + return result, nil +} +func (n *JsonParseNode) getPrimitiveValue(targetType string) (interface{}, error) { + switch targetType { + case "string": + return n.GetStringValue() + case "bool": + return n.GetBoolValue() + case "uint8": + return n.GetInt8Value() + case "byte": + return n.GetByteValue() + case "float32": + return n.GetFloat32Value() + case "float64": + return n.GetFloat64Value() + case "int32": + return n.GetInt32Value() + case "int64": + return n.GetInt64Value() + case "time": + return n.GetTimeValue() + case "timeonly": + return n.GetTimeOnlyValue() + case "dateonly": + return n.GetDateOnlyValue() + case "isoduration": + return n.GetISODurationValue() + case "uuid": + return n.GetUUIDValue() + case "base64": + return n.GetByteArrayValue() + default: + return nil, fmt.Errorf("targetType %s is not supported", targetType) + } +} + +// GetCollectionOfEnumValues returns the collection of Enum values from the node. +func (n *JsonParseNode) GetCollectionOfEnumValues(parser absser.EnumFactory) ([]interface{}, error) { + if n == nil || n.value == nil { + return nil, nil + } + if parser == nil { + return nil, errors.New("parser is nil") + } + nodes, ok := n.value.([]*JsonParseNode) + if !ok { + return nil, errors.New("value is not a collection") + } + result := make([]interface{}, len(nodes)) + for i, v := range nodes { + if v != nil { + val, err := v.GetEnumValue(parser) + if err != nil { + return nil, err + } + result[i] = val + } else { + result[i] = nil + } + } + return result, nil +} + +// GetStringValue returns a String value from the nodes. +func (n *JsonParseNode) GetStringValue() (*string, error) { + if n == nil || n.value == nil { + return nil, nil + } + res, ok := n.value.(*string) + if ok { + return res, nil + } else { + return nil, nil + } +} + +// GetBoolValue returns a Bool value from the nodes. +func (n *JsonParseNode) GetBoolValue() (*bool, error) { + if n == nil || n.value == nil { + return nil, nil + } + return n.value.(*bool), nil +} + +// GetInt8Value returns a int8 value from the nodes. +func (n *JsonParseNode) GetInt8Value() (*int8, error) { + if n == nil || n.value == nil { + return nil, nil + } + return n.value.(*int8), nil +} + +// GetBoolValue returns a Bool value from the nodes. +func (n *JsonParseNode) GetByteValue() (*byte, error) { + if n == nil || n.value == nil { + return nil, nil + } + return n.value.(*byte), nil +} + +// GetFloat32Value returns a Float32 value from the nodes. +func (n *JsonParseNode) GetFloat32Value() (*float32, error) { + v, err := n.GetFloat64Value() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + cast := float32(*v) + return &cast, nil +} + +// GetFloat64Value returns a Float64 value from the nodes. +func (n *JsonParseNode) GetFloat64Value() (*float64, error) { + if n == nil || n.value == nil { + return nil, nil + } + return n.value.(*float64), nil +} + +// GetInt32Value returns a Int32 value from the nodes. +func (n *JsonParseNode) GetInt32Value() (*int32, error) { + v, err := n.GetFloat64Value() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + cast := int32(*v) + return &cast, nil +} + +// GetInt64Value returns a Int64 value from the nodes. +func (n *JsonParseNode) GetInt64Value() (*int64, error) { + v, err := n.GetFloat64Value() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + cast := int64(*v) + return &cast, nil +} + +// GetTimeValue returns a Time value from the nodes. +func (n *JsonParseNode) GetTimeValue() (*time.Time, error) { + v, err := n.GetStringValue() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + + // if string does not have timezone information, add local timezone + if len(*v) == 19 { + *v = *v + time.Now().Format("-07:00") + } + parsed, err := time.Parse(time.RFC3339, *v) + return &parsed, err +} + +// GetISODurationValue returns a ISODuration value from the nodes. +func (n *JsonParseNode) GetISODurationValue() (*absser.ISODuration, error) { + v, err := n.GetStringValue() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + return absser.ParseISODuration(*v) +} + +// GetTimeOnlyValue returns a TimeOnly value from the nodes. +func (n *JsonParseNode) GetTimeOnlyValue() (*absser.TimeOnly, error) { + v, err := n.GetStringValue() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + return absser.ParseTimeOnly(*v) +} + +// GetDateOnlyValue returns a DateOnly value from the nodes. +func (n *JsonParseNode) GetDateOnlyValue() (*absser.DateOnly, error) { + v, err := n.GetStringValue() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + return absser.ParseDateOnly(*v) +} + +// GetUUIDValue returns a UUID value from the nodes. +func (n *JsonParseNode) GetUUIDValue() (*uuid.UUID, error) { + v, err := n.GetStringValue() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + parsed, err := uuid.Parse(*v) + return &parsed, err +} + +// GetEnumValue returns a Enum value from the nodes. +func (n *JsonParseNode) GetEnumValue(parser absser.EnumFactory) (interface{}, error) { + if parser == nil { + return nil, errors.New("parser is nil") + } + s, err := n.GetStringValue() + if err != nil { + return nil, err + } + if s == nil { + return nil, nil + } + return parser(*s) +} + +// GetByteArrayValue returns a ByteArray value from the nodes. +func (n *JsonParseNode) GetByteArrayValue() ([]byte, error) { + s, err := n.GetStringValue() + if err != nil { + return nil, err + } + if s == nil { + return nil, nil + } + return base64.StdEncoding.DecodeString(*s) +} + +// GetRawValue returns a ByteArray value from the nodes. +func (n *JsonParseNode) GetRawValue() (interface{}, error) { + if n == nil || n.value == nil { + return nil, nil + } + switch v := n.value.(type) { + case *JsonParseNode: + return v.GetRawValue() + case []*JsonParseNode: + result := make([]interface{}, len(v)) + for i, x := range v { + val, err := x.GetRawValue() + if err != nil { + return nil, err + } + result[i] = val + } + return result, nil + case map[string]*JsonParseNode: + m := make(map[string]interface{}) + for key, element := range v { + elementVal, err := element.GetRawValue() + if err != nil { + return nil, err + } + m[key] = elementVal + } + return m, nil + default: + return n.value, nil + } +} + +func (n *JsonParseNode) GetOnBeforeAssignFieldValues() absser.ParsableAction { + return n.onBeforeAssignFieldValues +} + +func (n *JsonParseNode) SetOnBeforeAssignFieldValues(action absser.ParsableAction) error { + n.onBeforeAssignFieldValues = action + return nil +} + +func (n *JsonParseNode) GetOnAfterAssignFieldValues() absser.ParsableAction { + return n.onAfterAssignFieldValues +} + +func (n *JsonParseNode) SetOnAfterAssignFieldValues(action absser.ParsableAction) error { + n.onAfterAssignFieldValues = action + return nil +} diff --git a/vendor/github.com/microsoft/kiota-serialization-json-go/json_parse_node_factory.go b/vendor/github.com/microsoft/kiota-serialization-json-go/json_parse_node_factory.go new file mode 100644 index 000000000..8e1e0a754 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-json-go/json_parse_node_factory.go @@ -0,0 +1,35 @@ +package jsonserialization + +import ( + "errors" + + absser "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// JsonParseNodeFactory is a ParseNodeFactory implementation for JSON +type JsonParseNodeFactory struct { +} + +// NewJsonParseNodeFactory creates a new JsonParseNodeFactory +func NewJsonParseNodeFactory() *JsonParseNodeFactory { + return &JsonParseNodeFactory{} +} + +// GetValidContentType returns the content type this factory's parse nodes can deserialize. +func (f *JsonParseNodeFactory) GetValidContentType() (string, error) { + return "application/json", nil +} + +// GetRootParseNode return a new ParseNode instance that is the root of the content +func (f *JsonParseNodeFactory) GetRootParseNode(contentType string, content []byte) (absser.ParseNode, error) { + validType, err := f.GetValidContentType() + if err != nil { + return nil, err + } else if contentType == "" { + return nil, errors.New("contentType is empty") + } else if contentType != validType { + return nil, errors.New("contentType is not valid") + } else { + return NewJsonParseNode(content) + } +} diff --git a/vendor/github.com/microsoft/kiota-serialization-json-go/json_serialization_helpers.go b/vendor/github.com/microsoft/kiota-serialization-json-go/json_serialization_helpers.go new file mode 100644 index 000000000..d00c34f9b --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-json-go/json_serialization_helpers.go @@ -0,0 +1,54 @@ +package jsonserialization + +import ( + "encoding/json" + "reflect" + + absser "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Unmarshal parses JSON-encoded data using a ParsableFactory and stores it in the value pointed to by model. To +// enable dirty tracking and better performance, set the DefaultParseNodeFactoryInstance for "application/json". +func Unmarshal[T absser.Parsable](data []byte, model *T, parser absser.ParsableFactory) error { + jpn, err := absser.DefaultParseNodeFactoryInstance.GetRootParseNode("application/json", data) + if err != nil { + if jpn, err = NewJsonParseNode(data); err != nil { + return err + } + } + + v, err := jpn.GetObjectValue(parser) + if err != nil { + return err + } + + if v != nil { + *model = v.(T) + } else { + // hand off to the std library to set model to its zero value + return json.Unmarshal(data, model) + } + + return nil +} + +// Marshal JSON-encodes a Parsable value. To enable dirty tracking and better performance, set the +// DefaultSerializationWriterFactoryInstance for "application/json". +func Marshal(v absser.Parsable) ([]byte, error) { + if vRef := reflect.ValueOf(v); !vRef.IsValid() || vRef.IsNil() { + return []byte("null"), nil + } + + serializer, err := absser.DefaultSerializationWriterFactoryInstance.GetSerializationWriter("application/json") + if err != nil { + serializer = NewJsonSerializationWriter() + } + + defer serializer.Close() + + if err := v.Serialize(serializer); err != nil { + return nil, err + } + + return serializer.GetSerializedContent() +} diff --git a/vendor/github.com/microsoft/kiota-serialization-json-go/json_serialization_writer.go b/vendor/github.com/microsoft/kiota-serialization-json-go/json_serialization_writer.go new file mode 100644 index 000000000..f136c08c8 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-json-go/json_serialization_writer.go @@ -0,0 +1,921 @@ +package jsonserialization + +import ( + "bytes" + "encoding/base64" + "encoding/json" + "strconv" + "strings" + "sync" + "time" + + "github.com/google/uuid" + + abstractions "github.com/microsoft/kiota-abstractions-go" + absser "github.com/microsoft/kiota-abstractions-go/serialization" +) + +var buffPool = sync.Pool{ + New: func() interface{} { + return new(bytes.Buffer) + }, +} + +// JsonSerializationWriter implements SerializationWriter for JSON. +type JsonSerializationWriter struct { + writer *bytes.Buffer + separatorIndices []int + onBeforeAssignFieldValues absser.ParsableAction + onAfterAssignFieldValues absser.ParsableAction + onStartObjectSerialization absser.ParsableWriter +} + +// NewJsonSerializationWriter creates a new instance of the JsonSerializationWriter. +func NewJsonSerializationWriter() *JsonSerializationWriter { + return &JsonSerializationWriter{ + writer: buffPool.Get().(*bytes.Buffer), + separatorIndices: make([]int, 0), + } +} +func (w *JsonSerializationWriter) getWriter() *bytes.Buffer { + if w.writer == nil { + panic("The writer has already been closed. Call Reset instead of Close to reuse it or instantiate a new one.") + } + + return w.writer +} +func (w *JsonSerializationWriter) writeRawValue(value ...string) { + writer := w.getWriter() + + for _, v := range value { + writer.WriteString(v) + } +} +func (w *JsonSerializationWriter) writeStringValue(value string) { + builder := &strings.Builder{} + // Allocate at least enough space for the string and quotes. However, it's + // possible that slightly overallocating may be a better strategy because then + // it would at least be able to handle a few character escape sequences + // without another allocation. + builder.Grow(len(value) + 2) + + // Turning off HTML escaping may not be strictly necessary but it matches with + // the current behavior. Testing with Exchange mail shows that it will + // accept and properly interpret data sent with and without HTML escaping + // enabled when creating emails with body content type HTML and HTML tags in + // the body content. + enc := json.NewEncoder(builder) + enc.SetEscapeHTML(false) + enc.SetIndent("", "") + enc.Encode(value) + + // Note that builder.String() returns a slice referencing the internal memory + // of builder. This means it's unsafe to continue holding that reference once + // this function exits (for example some conditions where a pool was used to + // reduce strings.Builder allocations). We can use it here directly since + // writeRawValue calls WriteString on a different buffer which should cause a + // copy of the contents. If that's changed though this will need updated. + s := builder.String() + // Need to trim off the trailing newline the encoder adds. + w.writeRawValue(s[:len(s)-1]) +} +func (w *JsonSerializationWriter) writePropertyName(key string) { + w.writeRawValue("\"", key, "\":") +} +func (w *JsonSerializationWriter) writePropertySeparator() { + w.separatorIndices = append(w.separatorIndices, w.getWriter().Len()) + w.writeRawValue(",") +} +func (w *JsonSerializationWriter) writeArrayStart() { + w.writeRawValue("[") +} +func (w *JsonSerializationWriter) writeArrayEnd() { + w.writeRawValue("]") +} +func (w *JsonSerializationWriter) writeObjectStart() { + w.writeRawValue("{") +} +func (w *JsonSerializationWriter) writeObjectEnd() { + w.writeRawValue("}") +} + +// WriteStringValue writes a String value to underlying the byte array. +func (w *JsonSerializationWriter) WriteStringValue(key string, value *string) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeStringValue(*value) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteBoolValue writes a Bool value to underlying the byte array. +func (w *JsonSerializationWriter) WriteBoolValue(key string, value *bool) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeRawValue(strconv.FormatBool(*value)) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteByteValue writes a Byte value to underlying the byte array. +func (w *JsonSerializationWriter) WriteByteValue(key string, value *byte) error { + if value != nil { + cast := int64(*value) + return w.WriteInt64Value(key, &cast) + } + return nil +} + +// WriteInt8Value writes a int8 value to underlying the byte array. +func (w *JsonSerializationWriter) WriteInt8Value(key string, value *int8) error { + if value != nil { + cast := int64(*value) + return w.WriteInt64Value(key, &cast) + } + return nil +} + +// WriteInt32Value writes a Int32 value to underlying the byte array. +func (w *JsonSerializationWriter) WriteInt32Value(key string, value *int32) error { + if value != nil { + cast := int64(*value) + return w.WriteInt64Value(key, &cast) + } + return nil +} + +// WriteInt64Value writes a Int64 value to underlying the byte array. +func (w *JsonSerializationWriter) WriteInt64Value(key string, value *int64) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeRawValue(strconv.FormatInt(*value, 10)) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteFloat32Value writes a Float32 value to underlying the byte array. +func (w *JsonSerializationWriter) WriteFloat32Value(key string, value *float32) error { + if value != nil { + cast := float64(*value) + return w.WriteFloat64Value(key, &cast) + } + return nil +} + +// WriteFloat64Value writes a Float64 value to underlying the byte array. +func (w *JsonSerializationWriter) WriteFloat64Value(key string, value *float64) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeRawValue(strconv.FormatFloat(*value, 'f', -1, 64)) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteTimeValue writes a Time value to underlying the byte array. +func (w *JsonSerializationWriter) WriteTimeValue(key string, value *time.Time) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeStringValue((*value).Format(time.RFC3339)) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteISODurationValue writes a ISODuration value to underlying the byte array. +func (w *JsonSerializationWriter) WriteISODurationValue(key string, value *absser.ISODuration) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeStringValue((*value).String()) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteTimeOnlyValue writes a TimeOnly value to underlying the byte array. +func (w *JsonSerializationWriter) WriteTimeOnlyValue(key string, value *absser.TimeOnly) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeStringValue((*value).String()) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteDateOnlyValue writes a DateOnly value to underlying the byte array. +func (w *JsonSerializationWriter) WriteDateOnlyValue(key string, value *absser.DateOnly) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeStringValue((*value).String()) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteUUIDValue writes a UUID value to underlying the byte array. +func (w *JsonSerializationWriter) WriteUUIDValue(key string, value *uuid.UUID) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeStringValue((*value).String()) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteByteArrayValue writes a ByteArray value to underlying the byte array. +func (w *JsonSerializationWriter) WriteByteArrayValue(key string, value []byte) error { + if key != "" && value != nil { + w.writePropertyName(key) + } + if value != nil { + w.writeStringValue(base64.StdEncoding.EncodeToString(value)) + } + if key != "" && value != nil { + w.writePropertySeparator() + } + return nil +} + +// WriteObjectValue writes a Parsable value to underlying the byte array. +func (w *JsonSerializationWriter) WriteObjectValue(key string, item absser.Parsable, additionalValuesToMerge ...absser.Parsable) error { + additionalValuesLen := len(additionalValuesToMerge) + if item != nil || additionalValuesLen > 0 { + untypedNode, isUntypedNode := item.(absser.UntypedNodeable) + if isUntypedNode { + switch value := untypedNode.(type) { + case *absser.UntypedBoolean: + w.WriteBoolValue(key, value.GetValue()) + return nil + case *absser.UntypedFloat: + w.WriteFloat32Value(key, value.GetValue()) + return nil + case *absser.UntypedDouble: + w.WriteFloat64Value(key, value.GetValue()) + return nil + case *absser.UntypedInteger: + w.WriteInt32Value(key, value.GetValue()) + return nil + case *absser.UntypedLong: + w.WriteInt64Value(key, value.GetValue()) + return nil + case *absser.UntypedNull: + w.WriteNullValue(key) + return nil + case *absser.UntypedString: + w.WriteStringValue(key, value.GetValue()) + return nil + case *absser.UntypedObject: + if key != "" { + w.writePropertyName(key) + } + properties := value.GetValue() + if properties != nil { + w.writeObjectStart() + for objectKey, val := range properties { + err := w.WriteObjectValue(objectKey, val) + if err != nil { + return err + } + } + w.writeObjectEnd() + if key != "" { + w.writePropertySeparator() + } + } + return nil + case *absser.UntypedArray: + if key != "" { + w.writePropertyName(key) + } + values := value.GetValue() + if values != nil { + w.writeArrayStart() + for _, val := range values { + err := w.WriteObjectValue("", val) + if err != nil { + return err + } + w.writePropertySeparator() + } + w.writeArrayEnd() + } + if key != "" { + w.writePropertySeparator() + } + return nil + } + } + + if key != "" { + w.writePropertyName(key) + } + abstractions.InvokeParsableAction(w.GetOnBeforeSerialization(), item) + _, isComposedTypeWrapper := item.(absser.ComposedTypeWrapper) + if !isComposedTypeWrapper { + w.writeObjectStart() + } + if item != nil { + err := abstractions.InvokeParsableWriter(w.GetOnStartObjectSerialization(), item, w) + if err != nil { + return err + } + err = item.Serialize(w) + + abstractions.InvokeParsableAction(w.GetOnAfterObjectSerialization(), item) + if err != nil { + return err + } + } + + for _, additionalValue := range additionalValuesToMerge { + abstractions.InvokeParsableAction(w.GetOnBeforeSerialization(), additionalValue) + err := abstractions.InvokeParsableWriter(w.GetOnStartObjectSerialization(), additionalValue, w) + if err != nil { + return err + } + err = additionalValue.Serialize(w) + if err != nil { + return err + } + abstractions.InvokeParsableAction(w.GetOnAfterObjectSerialization(), additionalValue) + } + + if !isComposedTypeWrapper { + w.writeObjectEnd() + } + if key != "" { + w.writePropertySeparator() + } + } + return nil +} + +// WriteCollectionOfObjectValues writes a collection of Parsable values to underlying the byte array. +func (w *JsonSerializationWriter) WriteCollectionOfObjectValues(key string, collection []absser.Parsable) error { + if collection != nil { // empty collections are meaningful + if key != "" { + w.writePropertyName(key) + } + w.writeArrayStart() + for _, item := range collection { + if item != nil { + err := w.WriteObjectValue("", item) + if err != nil { + return err + } + } else { + err := w.WriteNullValue("") + if err != nil { + return err + } + } + w.writePropertySeparator() + } + + w.writeArrayEnd() + if key != "" { + w.writePropertySeparator() + } + } + return nil +} + +// WriteCollectionOfStringValues writes a collection of String values to underlying the byte array. +func (w *JsonSerializationWriter) WriteCollectionOfStringValues(key string, collection []string) error { + if collection != nil { // empty collections are meaningful + if key != "" { + w.writePropertyName(key) + } + w.writeArrayStart() + for _, item := range collection { + err := w.WriteStringValue("", &item) + if err != nil { + return err + } + w.writePropertySeparator() + } + + w.writeArrayEnd() + if key != "" { + w.writePropertySeparator() + } + } + return nil +} + +// WriteCollectionOfInt32Values writes a collection of Int32 values to underlying the byte array. +func (w *JsonSerializationWriter) WriteCollectionOfInt32Values(key string, collection []int32) error { + if collection != nil { // empty collections are meaningful + if key != "" { + w.writePropertyName(key) + } + w.writeArrayStart() + for _, item := range collection { + err := w.WriteInt32Value("", &item) + if err != nil { + return err + } + w.writePropertySeparator() + } + + w.writeArrayEnd() + if key != "" { + w.writePropertySeparator() + } + } + return nil +} + +// WriteCollectionOfInt64Values writes a collection of Int64 values to underlying the byte array. +func (w *JsonSerializationWriter) WriteCollectionOfInt64Values(key string, collection []int64) error { + if collection != nil { // empty collections are meaningful + if key != "" { + w.writePropertyName(key) + } + w.writeArrayStart() + for _, item := range collection { + err := w.WriteInt64Value("", &item) + if err != nil { + return err + } + w.writePropertySeparator() + } + + w.writeArrayEnd() + if key != "" { + w.writePropertySeparator() + } + } + return nil +} + +// WriteCollectionOfFloat32Values writes a collection of Float32 values to underlying the byte array. +func (w *JsonSerializationWriter) WriteCollectionOfFloat32Values(key string, collection []float32) error { + if collection != nil { // empty collections are meaningful + if key != "" { + w.writePropertyName(key) + } + w.writeArrayStart() + for _, item := range collection { + err := w.WriteFloat32Value("", &item) + if err != nil { + return err + } + w.writePropertySeparator() + } + + w.writeArrayEnd() + if key != "" { + w.writePropertySeparator() + } + } + return nil +} + +// WriteCollectionOfFloat64Values writes a collection of Float64 values to underlying the byte array. +func (w *JsonSerializationWriter) WriteCollectionOfFloat64Values(key string, collection []float64) error { + if collection != nil { // empty collections are meaningful + if key != "" { + w.writePropertyName(key) + } + w.writeArrayStart() + for _, item := range collection { + err := w.WriteFloat64Value("", &item) + if err != nil { + return err + } + w.writePropertySeparator() + } + + w.writeArrayEnd() + if key != "" { + w.writePropertySeparator() + } + } + return nil +} + +// WriteCollectionOfTimeValues writes a collection of Time values to underlying the byte array. +func (w *JsonSerializationWriter) WriteCollectionOfTimeValues(key string, collection []time.Time) error { + if collection != nil { // empty collections are meaningful + if key != "" { + w.writePropertyName(key) + } + w.writeArrayStart() + for _, item := range collection { + err := w.WriteTimeValue("", &item) + if err != nil { + return err + } + w.writePropertySeparator() + } + + w.writeArrayEnd() + if key != "" { + w.writePropertySeparator() + } + } + return nil +} + +// WriteCollectionOfISODurationValues writes a collection of ISODuration values to underlying the byte array. +func (w *JsonSerializationWriter) WriteCollectionOfISODurationValues(key string, collection []absser.ISODuration) error { + if collection != nil { // empty collections are meaningful + if key != "" { + w.writePropertyName(key) + } + w.writeArrayStart() + for _, item := range collection { + err := w.WriteISODurationValue("", &item) + if err != nil { + return err + } + w.writePropertySeparator() + } + + w.writeArrayEnd() + if key != "" { + w.writePropertySeparator() + } + } + return nil +} + +// WriteCollectionOfTimeOnlyValues writes a collection of TimeOnly values to underlying the byte array. +func (w *JsonSerializationWriter) WriteCollectionOfTimeOnlyValues(key string, collection []absser.TimeOnly) error { + if collection != nil { // empty collections are meaningful + if key != "" { + w.writePropertyName(key) + } + w.writeArrayStart() + for _, item := range collection { + err := w.WriteTimeOnlyValue("", &item) + if err != nil { + return err + } + w.writePropertySeparator() + } + + w.writeArrayEnd() + if key != "" { + w.writePropertySeparator() + } + } + return nil +} + +// WriteCollectionOfDateOnlyValues writes a collection of DateOnly values to underlying the byte array. +func (w *JsonSerializationWriter) WriteCollectionOfDateOnlyValues(key string, collection []absser.DateOnly) error { + if collection != nil { // empty collections are meaningful + if key != "" { + w.writePropertyName(key) + } + w.writeArrayStart() + for _, item := range collection { + err := w.WriteDateOnlyValue("", &item) + if err != nil { + return err + } + w.writePropertySeparator() + } + + w.writeArrayEnd() + if key != "" { + w.writePropertySeparator() + } + } + return nil +} + +// WriteCollectionOfUUIDValues writes a collection of UUID values to underlying the byte array. +func (w *JsonSerializationWriter) WriteCollectionOfUUIDValues(key string, collection []uuid.UUID) error { + if collection != nil { // empty collections are meaningful + if key != "" { + w.writePropertyName(key) + } + w.writeArrayStart() + for _, item := range collection { + err := w.WriteUUIDValue("", &item) + if err != nil { + return err + } + w.writePropertySeparator() + } + + w.writeArrayEnd() + if key != "" { + w.writePropertySeparator() + } + } + return nil +} + +// WriteCollectionOfBoolValues writes a collection of Bool values to underlying the byte array. +func (w *JsonSerializationWriter) WriteCollectionOfBoolValues(key string, collection []bool) error { + if collection != nil { // empty collections are meaningful + if key != "" { + w.writePropertyName(key) + } + w.writeArrayStart() + for _, item := range collection { + err := w.WriteBoolValue("", &item) + if err != nil { + return err + } + w.writePropertySeparator() + } + + w.writeArrayEnd() + if key != "" { + w.writePropertySeparator() + } + } + return nil +} + +// WriteCollectionOfByteValues writes a collection of Byte values to underlying the byte array. +func (w *JsonSerializationWriter) WriteCollectionOfByteValues(key string, collection []byte) error { + if collection != nil { // empty collections are meaningful + if key != "" { + w.writePropertyName(key) + } + w.writeArrayStart() + for _, item := range collection { + err := w.WriteByteValue("", &item) + if err != nil { + return err + } + w.writePropertySeparator() + } + + w.writeArrayEnd() + if key != "" { + w.writePropertySeparator() + } + } + return nil +} + +// WriteCollectionOfInt8Values writes a collection of int8 values to underlying the byte array. +func (w *JsonSerializationWriter) WriteCollectionOfInt8Values(key string, collection []int8) error { + if collection != nil { // empty collections are meaningful + if key != "" { + w.writePropertyName(key) + } + w.writeArrayStart() + for _, item := range collection { + err := w.WriteInt8Value("", &item) + if err != nil { + return err + } + w.writePropertySeparator() + } + + w.writeArrayEnd() + if key != "" { + w.writePropertySeparator() + } + } + return nil +} + +// GetSerializedContent returns the resulting byte array from the serialization writer. +func (w *JsonSerializationWriter) GetSerializedContent() ([]byte, error) { + trimmed := w.getWriter().Bytes() + buffLen := len(trimmed) + + for i := len(w.separatorIndices) - 1; i >= 0; i-- { + idx := w.separatorIndices[i] + + if idx == buffLen-1 { + trimmed = trimmed[:idx] + } else if trimmed[idx+1] == byte(']') || trimmed[idx+1] == byte('}') { + trimmed = append(trimmed[:idx], trimmed[idx+1:]...) + } + } + + trimmedCopy := make([]byte, len(trimmed)) + copy(trimmedCopy, trimmed) + + return trimmedCopy, nil +} + +// WriteAnyValue an unknown value as a parameter. +func (w *JsonSerializationWriter) WriteAnyValue(key string, value interface{}) error { + if value != nil { + body, err := json.Marshal(value) + if err != nil { + return err + } + if key != "" { + w.writePropertyName(key) + } + + w.writeRawValue(string(body)) + + if key != "" { + w.writePropertySeparator() + } + } + return nil +} + +func (w *JsonSerializationWriter) WriteNullValue(key string) error { + if key != "" { + w.writePropertyName(key) + } + + w.writeRawValue("null") + + if key != "" { + w.writePropertySeparator() + } + + return nil +} + +func (w *JsonSerializationWriter) GetOnBeforeSerialization() absser.ParsableAction { + return w.onBeforeAssignFieldValues +} + +func (w *JsonSerializationWriter) SetOnBeforeSerialization(action absser.ParsableAction) error { + w.onBeforeAssignFieldValues = action + return nil +} + +func (w *JsonSerializationWriter) GetOnAfterObjectSerialization() absser.ParsableAction { + return w.onAfterAssignFieldValues +} + +func (w *JsonSerializationWriter) SetOnAfterObjectSerialization(action absser.ParsableAction) error { + w.onAfterAssignFieldValues = action + return nil +} + +func (w *JsonSerializationWriter) GetOnStartObjectSerialization() absser.ParsableWriter { + return w.onStartObjectSerialization +} + +func (w *JsonSerializationWriter) SetOnStartObjectSerialization(writer absser.ParsableWriter) error { + w.onStartObjectSerialization = writer + return nil +} + +// WriteAdditionalData writes additional data to underlying the byte array. +func (w *JsonSerializationWriter) WriteAdditionalData(value map[string]interface{}) error { + var err error + if len(value) != 0 { + for key, input := range value { + switch value := input.(type) { + case absser.Parsable: + err = w.WriteObjectValue(key, value) + case []absser.Parsable: + err = w.WriteCollectionOfObjectValues(key, value) + case []string: + err = w.WriteCollectionOfStringValues(key, value) + case []bool: + err = w.WriteCollectionOfBoolValues(key, value) + case []byte: + err = w.WriteCollectionOfByteValues(key, value) + case []int8: + err = w.WriteCollectionOfInt8Values(key, value) + case []int32: + err = w.WriteCollectionOfInt32Values(key, value) + case []int64: + err = w.WriteCollectionOfInt64Values(key, value) + case []float32: + err = w.WriteCollectionOfFloat32Values(key, value) + case []float64: + err = w.WriteCollectionOfFloat64Values(key, value) + case []uuid.UUID: + err = w.WriteCollectionOfUUIDValues(key, value) + case []time.Time: + err = w.WriteCollectionOfTimeValues(key, value) + case []absser.ISODuration: + err = w.WriteCollectionOfISODurationValues(key, value) + case []absser.TimeOnly: + err = w.WriteCollectionOfTimeOnlyValues(key, value) + case []absser.DateOnly: + err = w.WriteCollectionOfDateOnlyValues(key, value) + case *string: + err = w.WriteStringValue(key, value) + case string: + err = w.WriteStringValue(key, &value) + case *bool: + err = w.WriteBoolValue(key, value) + case bool: + err = w.WriteBoolValue(key, &value) + case *byte: + err = w.WriteByteValue(key, value) + case byte: + err = w.WriteByteValue(key, &value) + case *int8: + err = w.WriteInt8Value(key, value) + case int8: + err = w.WriteInt8Value(key, &value) + case *int32: + err = w.WriteInt32Value(key, value) + case int32: + err = w.WriteInt32Value(key, &value) + case *int64: + err = w.WriteInt64Value(key, value) + case int64: + err = w.WriteInt64Value(key, &value) + case *float32: + err = w.WriteFloat32Value(key, value) + case float32: + err = w.WriteFloat32Value(key, &value) + case *float64: + err = w.WriteFloat64Value(key, value) + case float64: + err = w.WriteFloat64Value(key, &value) + case *uuid.UUID: + err = w.WriteUUIDValue(key, value) + case uuid.UUID: + err = w.WriteUUIDValue(key, &value) + case *time.Time: + err = w.WriteTimeValue(key, value) + case time.Time: + err = w.WriteTimeValue(key, &value) + case *absser.ISODuration: + err = w.WriteISODurationValue(key, value) + case absser.ISODuration: + err = w.WriteISODurationValue(key, &value) + case *absser.TimeOnly: + err = w.WriteTimeOnlyValue(key, value) + case absser.TimeOnly: + err = w.WriteTimeOnlyValue(key, &value) + case *absser.DateOnly: + err = w.WriteDateOnlyValue(key, value) + case absser.DateOnly: + err = w.WriteDateOnlyValue(key, &value) + case absser.UntypedNodeable: + err = w.WriteObjectValue(key, value) + default: + err = w.WriteAnyValue(key, &value) + } + } + } + return err +} + +// Reset sets the internal buffer to empty, allowing the writer to be reused. +func (w *JsonSerializationWriter) Reset() error { + w.getWriter().Reset() + w.separatorIndices = w.separatorIndices[:0] + return nil +} + +// Close relases the internal buffer. Subsequent calls to the writer will panic. +func (w *JsonSerializationWriter) Close() error { + if w.writer == nil { + return nil + } + + w.writer.Reset() + buffPool.Put(w.writer) + + w.writer = nil + w.separatorIndices = nil + + return nil +} diff --git a/vendor/github.com/microsoft/kiota-serialization-json-go/json_serialization_writer_factory.go b/vendor/github.com/microsoft/kiota-serialization-json-go/json_serialization_writer_factory.go new file mode 100644 index 000000000..6a5b94904 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-json-go/json_serialization_writer_factory.go @@ -0,0 +1,35 @@ +package jsonserialization + +import ( + "errors" + + absser "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// JsonSerializationWriterFactory implements SerializationWriterFactory for JSON. +type JsonSerializationWriterFactory struct { +} + +// NewJsonSerializationWriterFactory creates a new instance of the JsonSerializationWriterFactory. +func NewJsonSerializationWriterFactory() *JsonSerializationWriterFactory { + return &JsonSerializationWriterFactory{} +} + +// GetValidContentType returns the valid content type for the SerializationWriterFactoryRegistry +func (f *JsonSerializationWriterFactory) GetValidContentType() (string, error) { + return "application/json", nil +} + +// GetSerializationWriter returns the relevant SerializationWriter instance for the given content type +func (f *JsonSerializationWriterFactory) GetSerializationWriter(contentType string) (absser.SerializationWriter, error) { + validType, err := f.GetValidContentType() + if err != nil { + return nil, err + } else if contentType == "" { + return nil, errors.New("contentType is empty") + } else if contentType != validType { + return nil, errors.New("contentType is not valid") + } else { + return NewJsonSerializationWriter(), nil + } +} diff --git a/vendor/github.com/microsoft/kiota-serialization-json-go/sonar-project.properties b/vendor/github.com/microsoft/kiota-serialization-json-go/sonar-project.properties new file mode 100644 index 000000000..d590b94ad --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-json-go/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=microsoft_kiota-serialization-json-go +sonar.organization=microsoft +sonar.exclusions=**/*_test.go +sonar.test.inclusions=**/*_test.go +sonar.go.tests.reportPaths=result.out +sonar.go.coverage.reportPaths=cover.out \ No newline at end of file diff --git a/vendor/github.com/microsoft/kiota-serialization-multipart-go/.gitignore b/vendor/github.com/microsoft/kiota-serialization-multipart-go/.gitignore new file mode 100644 index 000000000..398baf21b --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-multipart-go/.gitignore @@ -0,0 +1,17 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +.idea diff --git a/vendor/github.com/microsoft/kiota-serialization-multipart-go/CHANGELOG.md b/vendor/github.com/microsoft/kiota-serialization-multipart-go/CHANGELOG.md new file mode 100644 index 000000000..6debcadd0 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-multipart-go/CHANGELOG.md @@ -0,0 +1,18 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added + +### Changed + +## [1.0.0] - 2023-07-26 + +### Changed + +- Initial release diff --git a/vendor/github.com/microsoft/kiota-serialization-multipart-go/CODE_OF_CONDUCT.md b/vendor/github.com/microsoft/kiota-serialization-multipart-go/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..f9ba8cf65 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-multipart-go/CODE_OF_CONDUCT.md @@ -0,0 +1,9 @@ +# Microsoft Open Source Code of Conduct + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). + +Resources: + +- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) +- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns diff --git a/vendor/github.com/microsoft/kiota-serialization-multipart-go/LICENSE b/vendor/github.com/microsoft/kiota-serialization-multipart-go/LICENSE new file mode 100644 index 000000000..9e841e7a2 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-multipart-go/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/vendor/github.com/microsoft/kiota-serialization-multipart-go/README.md b/vendor/github.com/microsoft/kiota-serialization-multipart-go/README.md new file mode 100644 index 000000000..b071fdeb3 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-multipart-go/README.md @@ -0,0 +1,37 @@ +# Kiota Multipart Serialization Library for Go + +![Go Multipart Serialization](https://github.com/microsoft/kiota-serialization-multipart-go/actions/workflows/go.yml/badge.svg) + +This is the default Kiota Go multipart serialization library implementation. + +A [Kiota](https://github.com/microsoft/kiota) generated project will need a reference to a multipart serialization package to handle multipart payloads from an API endpoint. + +Read more about Kiota [here](https://github.com/microsoft/kiota/blob/main/README.md). + +## Using the Kiota Multipart Serialization Library + +```Shell +go get github.com/microsoft/kiota-serialization-multipart-go +``` + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a +Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us +the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. + +When you submit a pull request, a CLA bot will automatically determine whether you need to provide +a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions +provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more inMultipartation see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or +contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + +## Trademarks + +This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft +trademarks or logos is subject to and must follow +[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). +Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. +Any use of third-party trademarks or logos are subject to those third-party's policies. diff --git a/vendor/github.com/microsoft/kiota-serialization-multipart-go/SECURITY.md b/vendor/github.com/microsoft/kiota-serialization-multipart-go/SECURITY.md new file mode 100644 index 000000000..8b795c018 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-multipart-go/SECURITY.md @@ -0,0 +1,41 @@ + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional inMultipartation can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). + +Please include the requested inMultipartation listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This inMultipartation will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). + + diff --git a/vendor/github.com/microsoft/kiota-serialization-multipart-go/SUPPORT.md b/vendor/github.com/microsoft/kiota-serialization-multipart-go/SUPPORT.md new file mode 100644 index 000000000..8461100ea --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-multipart-go/SUPPORT.md @@ -0,0 +1,25 @@ +# TODO: The maintainer of this repo has not yet edited this file + +**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? + +- **No CSS support:** Fill out this template with inMultipartation about how to file issues and get help. +- **Yes CSS support:** Fill out an intake Multipart at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps. +- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide. + +*Then remove this first heading from this SUPPORT.MD file before publishing your repo.* + +# Support + +## How to file issues and get help + +This project uses GitHub Issues to track bugs and feature requests. Please search the existing +issues before filing new issues to avoid duplicates. For new issues, file your bug or +feature request as a new Issue. + +For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE +FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER +CHANNEL. WHERE WILL YOU HELP PEOPLE?**. + +## Microsoft Support Policy + +Support for this **PROJECT or PRODUCT** is limited to the resources listed above. diff --git a/vendor/github.com/microsoft/kiota-serialization-multipart-go/multipart_serialization_writer.go b/vendor/github.com/microsoft/kiota-serialization-multipart-go/multipart_serialization_writer.go new file mode 100644 index 000000000..a1660f693 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-multipart-go/multipart_serialization_writer.go @@ -0,0 +1,253 @@ +package multipartserialization + +import ( + "errors" + "time" + + abstractions "github.com/microsoft/kiota-abstractions-go" + + "github.com/google/uuid" + + absser "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// MultipartSerializationWriter implements SerializationWriter for URI Multipart encoded. +type MultipartSerializationWriter struct { + writer []byte + onBeforeAssignFieldValues absser.ParsableAction + onAfterAssignFieldValues absser.ParsableAction + onStartObjectSerialization absser.ParsableWriter +} + +// NewMultipartSerializationWriter creates a new instance of the MultipartSerializationWriter. +func NewMultipartSerializationWriter() *MultipartSerializationWriter { + return &MultipartSerializationWriter{ + writer: make([]byte, 0), + } +} + +// WriteStringValue writes a String value to underlying the byte array. +func (w *MultipartSerializationWriter) WriteStringValue(key string, value *string) error { + if key != "" { + w.WriteByteArrayValue("", []byte(key)) + } + if value != nil { + if key != "" { + w.WriteByteArrayValue("", []byte(": ")) + } + w.WriteByteArrayValue("", []byte(*value)) + } + w.WriteByteArrayValue("", []byte("\r\n")) + return nil +} + +// WriteBoolValue writes a Bool value to underlying the byte array. +func (w *MultipartSerializationWriter) WriteBoolValue(key string, value *bool) error { + return errors.New("serialization of bool value is not supported with MultipartSerializationWriter") +} + +// WriteByteValue writes a Byte value to underlying the byte array. +func (w *MultipartSerializationWriter) WriteByteValue(key string, value *byte) error { + return errors.New("serialization of byte value is not supported with MultipartSerializationWriter") +} + +// WriteInt8Value writes a int8 value to underlying the byte array. +func (w *MultipartSerializationWriter) WriteInt8Value(key string, value *int8) error { + return errors.New("serialization of int8 value is not supported with MultipartSerializationWriter") +} + +// WriteInt32Value writes a Int32 value to underlying the byte array. +func (w *MultipartSerializationWriter) WriteInt32Value(key string, value *int32) error { + return errors.New("serialization of int32 value is not supported with MultipartSerializationWriter") +} + +// WriteInt64Value writes a Int64 value to underlying the byte array. +func (w *MultipartSerializationWriter) WriteInt64Value(key string, value *int64) error { + return errors.New("serialization of int64 value is not supported with MultipartSerializationWriter") +} + +// WriteFloat32Value writes a Float32 value to underlying the byte array. +func (w *MultipartSerializationWriter) WriteFloat32Value(key string, value *float32) error { + return errors.New("serialization of float32 value is not supported with MultipartSerializationWriter") +} + +// WriteFloat64Value writes a Float64 value to underlying the byte array. +func (w *MultipartSerializationWriter) WriteFloat64Value(key string, value *float64) error { + return errors.New("serialization of float64 value is not supported with MultipartSerializationWriter") +} + +// WriteTimeValue writes a Time value to underlying the byte array. +func (w *MultipartSerializationWriter) WriteTimeValue(key string, value *time.Time) error { + return errors.New("serialization of time value is not supported with MultipartSerializationWriter") +} + +// WriteISODurationValue writes a ISODuration value to underlying the byte array. +func (w *MultipartSerializationWriter) WriteISODurationValue(key string, value *absser.ISODuration) error { + return errors.New("serialization of ISODuration value is not supported with MultipartSerializationWriter") +} + +// WriteTimeOnlyValue writes a TimeOnly value to underlying the byte array. +func (w *MultipartSerializationWriter) WriteTimeOnlyValue(key string, value *absser.TimeOnly) error { + return errors.New("serialization of TimeOnly value is not supported with MultipartSerializationWriter") +} + +// WriteDateOnlyValue writes a DateOnly value to underlying the byte array. +func (w *MultipartSerializationWriter) WriteDateOnlyValue(key string, value *absser.DateOnly) error { + return errors.New("serialization of DateOnly value is not supported with MultipartSerializationWriter") +} + +// WriteUUIDValue writes a UUID value to underlying the byte array. +func (w *MultipartSerializationWriter) WriteUUIDValue(key string, value *uuid.UUID) error { + return errors.New("serialization of UUID value is not supported with MultipartSerializationWriter") +} + +// WriteByteArrayValue writes a ByteArray value to underlying the byte array. +func (w *MultipartSerializationWriter) WriteByteArrayValue(key string, value []byte) error { + if value != nil { + w.writer = append(w.writer, value...) + } + return nil +} + +// WriteObjectValue writes a Parsable value to underlying the byte array. +func (w *MultipartSerializationWriter) WriteObjectValue(key string, item absser.Parsable, additionalValuesToMerge ...absser.Parsable) error { + if item != nil { + abstractions.InvokeParsableAction(w.GetOnBeforeSerialization(), item) + err := abstractions.InvokeParsableWriter(w.GetOnStartObjectSerialization(), item, w) + if err != nil { + return err + } + if _, ok := item.(abstractions.MultipartBody); !ok { + return errors.New("only the serialization of multipart bodies is supported with MultipartSerializationWriter") + } + err = item.Serialize(w) + + abstractions.InvokeParsableAction(w.GetOnAfterObjectSerialization(), item) + if err != nil { + return err + } + } + return nil +} + +// WriteCollectionOfObjectValues writes a collection of Parsable values to underlying the byte array. +func (w *MultipartSerializationWriter) WriteCollectionOfObjectValues(key string, collection []absser.Parsable) error { + return errors.New("collections serialization is not supported with MultipartSerializationWriter") +} + +// WriteCollectionOfStringValues writes a collection of String values to underlying the byte array. +func (w *MultipartSerializationWriter) WriteCollectionOfStringValues(key string, collection []string) error { + return errors.New("collections serialization is not supported with MultipartSerializationWriter") +} + +// WriteCollectionOfInt32Values writes a collection of Int32 values to underlying the byte array. +func (w *MultipartSerializationWriter) WriteCollectionOfInt32Values(key string, collection []int32) error { + return errors.New("collections serialization is not supported with MultipartSerializationWriter") +} + +// WriteCollectionOfInt64Values writes a collection of Int64 values to underlying the byte array. +func (w *MultipartSerializationWriter) WriteCollectionOfInt64Values(key string, collection []int64) error { + return errors.New("collections serialization is not supported with MultipartSerializationWriter") +} + +// WriteCollectionOfFloat32Values writes a collection of Float32 values to underlying the byte array. +func (w *MultipartSerializationWriter) WriteCollectionOfFloat32Values(key string, collection []float32) error { + return errors.New("collections serialization is not supported with MultipartSerializationWriter") +} + +// WriteCollectionOfFloat64Values writes a collection of Float64 values to underlying the byte array. +func (w *MultipartSerializationWriter) WriteCollectionOfFloat64Values(key string, collection []float64) error { + return errors.New("collections serialization is not supported with MultipartSerializationWriter") +} + +// WriteCollectionOfTimeValues writes a collection of Time values to underlying the byte array. +func (w *MultipartSerializationWriter) WriteCollectionOfTimeValues(key string, collection []time.Time) error { + return errors.New("collections serialization is not supported with MultipartSerializationWriter") +} + +// WriteCollectionOfISODurationValues writes a collection of ISODuration values to underlying the byte array. +func (w *MultipartSerializationWriter) WriteCollectionOfISODurationValues(key string, collection []absser.ISODuration) error { + return errors.New("collections serialization is not supported with MultipartSerializationWriter") +} + +// WriteCollectionOfTimeOnlyValues writes a collection of TimeOnly values to underlying the byte array. +func (w *MultipartSerializationWriter) WriteCollectionOfTimeOnlyValues(key string, collection []absser.TimeOnly) error { + return errors.New("collections serialization is not supported with MultipartSerializationWriter") +} + +// WriteCollectionOfDateOnlyValues writes a collection of DateOnly values to underlying the byte array. +func (w *MultipartSerializationWriter) WriteCollectionOfDateOnlyValues(key string, collection []absser.DateOnly) error { + return errors.New("collections serialization is not supported with MultipartSerializationWriter") +} + +// WriteCollectionOfUUIDValues writes a collection of UUID values to underlying the byte array. +func (w *MultipartSerializationWriter) WriteCollectionOfUUIDValues(key string, collection []uuid.UUID) error { + return errors.New("collections serialization is not supported with MultipartSerializationWriter") +} + +// WriteCollectionOfBoolValues writes a collection of Bool values to underlying the byte array. +func (w *MultipartSerializationWriter) WriteCollectionOfBoolValues(key string, collection []bool) error { + return errors.New("collections serialization is not supported with MultipartSerializationWriter") +} + +// WriteCollectionOfByteValues writes a collection of Byte values to underlying the byte array. +func (w *MultipartSerializationWriter) WriteCollectionOfByteValues(key string, collection []byte) error { + return errors.New("collections serialization is not supported with MultipartSerializationWriter") +} + +// WriteCollectionOfInt8Values writes a collection of int8 values to underlying the byte array. +func (w *MultipartSerializationWriter) WriteCollectionOfInt8Values(key string, collection []int8) error { + return errors.New("collections serialization is not supported with MultipartSerializationWriter") +} + +// GetSerializedContent returns the resulting byte array from the serialization writer. +func (w *MultipartSerializationWriter) GetSerializedContent() ([]byte, error) { + return w.writer, nil +} + +// WriteAnyValue an unknown value as a parameter. +func (w *MultipartSerializationWriter) WriteAnyValue(key string, value interface{}) error { + return errors.New("serialization of any value is not supported with MultipartSerializationWriter") +} + +// WriteAdditionalData writes additional data to underlying the byte array. +func (w *MultipartSerializationWriter) WriteAdditionalData(value map[string]interface{}) error { + return errors.New("serialization of additional data is not supported with MultipartSerializationWriter") +} + +// Close clears the internal buffer. +func (w *MultipartSerializationWriter) Close() error { + w.writer = make([]byte, 0) + return nil +} + +func (w *MultipartSerializationWriter) WriteNullValue(key string) error { + return errors.New("serialization of null value is not supported with MultipartSerializationWriter") +} + +func (w *MultipartSerializationWriter) GetOnBeforeSerialization() absser.ParsableAction { + return w.onBeforeAssignFieldValues +} + +func (w *MultipartSerializationWriter) SetOnBeforeSerialization(action absser.ParsableAction) error { + w.onBeforeAssignFieldValues = action + return nil +} + +func (w *MultipartSerializationWriter) GetOnAfterObjectSerialization() absser.ParsableAction { + return w.onAfterAssignFieldValues +} + +func (w *MultipartSerializationWriter) SetOnAfterObjectSerialization(action absser.ParsableAction) error { + w.onAfterAssignFieldValues = action + return nil +} + +func (w *MultipartSerializationWriter) GetOnStartObjectSerialization() absser.ParsableWriter { + return w.onStartObjectSerialization +} + +func (w *MultipartSerializationWriter) SetOnStartObjectSerialization(writer absser.ParsableWriter) error { + w.onStartObjectSerialization = writer + return nil +} diff --git a/vendor/github.com/microsoft/kiota-serialization-multipart-go/multipart_serialization_writer_factory.go b/vendor/github.com/microsoft/kiota-serialization-multipart-go/multipart_serialization_writer_factory.go new file mode 100644 index 000000000..f31b59f79 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-multipart-go/multipart_serialization_writer_factory.go @@ -0,0 +1,35 @@ +package multipartserialization + +import ( + "errors" + + absser "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// MultipartSerializationWriterFactory implements SerializationWriterFactory for URI Multipart encoded. +type MultipartSerializationWriterFactory struct { +} + +// NewMultipartSerializationWriterFactory creates a new instance of the MultipartSerializationWriterFactory. +func NewMultipartSerializationWriterFactory() *MultipartSerializationWriterFactory { + return &MultipartSerializationWriterFactory{} +} + +// GetValidContentType returns the valid content type for the SerializationWriterFactoryRegistry +func (f *MultipartSerializationWriterFactory) GetValidContentType() (string, error) { + return "multipart/form-data", nil +} + +// GetSerializationWriter returns the relevant SerializationWriter instance for the given content type +func (f *MultipartSerializationWriterFactory) GetSerializationWriter(contentType string) (absser.SerializationWriter, error) { + validType, err := f.GetValidContentType() + if err != nil { + return nil, err + } else if contentType == "" { + return nil, errors.New("contentType is empty") + } else if contentType != validType { + return nil, errors.New("contentType is not valid") + } else { + return NewMultipartSerializationWriter(), nil + } +} diff --git a/vendor/github.com/microsoft/kiota-serialization-multipart-go/sonar-project.properties b/vendor/github.com/microsoft/kiota-serialization-multipart-go/sonar-project.properties new file mode 100644 index 000000000..7537f032a --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-multipart-go/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=microsoft_kiota-serialization-multipart-go +sonar.organization=microsoft +sonar.exclusions=**/*_test.go +sonar.test.inclusions=**/*_test.go +sonar.go.tests.reportPaths=result.out +sonar.go.coverage.reportPaths=cover.out \ No newline at end of file diff --git a/vendor/github.com/microsoft/kiota-serialization-text-go/.gitignore b/vendor/github.com/microsoft/kiota-serialization-text-go/.gitignore new file mode 100644 index 000000000..66fd13c90 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-text-go/.gitignore @@ -0,0 +1,15 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ diff --git a/vendor/github.com/microsoft/kiota-serialization-text-go/CHANGELOG.md b/vendor/github.com/microsoft/kiota-serialization-text-go/CHANGELOG.md new file mode 100644 index 000000000..8f41fee9f --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-text-go/CHANGELOG.md @@ -0,0 +1,79 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added + +### Changed + +## [1.0.0] - 2023-05-04 + +### Changed + +- GA Release. + +## [0.7.1] - 2023-04-17 + +### Changed + +- Implement serialization and parseNode listeners. + +## [0.7.0] - 2023-01-23 + +### Added + +- Added support for backing store. + +## [0.6.0] - 2022-09-22 + +### Added + +- Implement additional serialization method `WriteAnyValues` and parse method `GetRawValue` introduced in abstractions. + +## [0.5.0] - 2022-09-02 + +### Added + +- Added support for composed types serialization. + +## [0.4.2] - 2022-09-02 + +### Changed + +- Updated kiota abstractions library. + +## [0.4.1] - 2022-06-07 + +### Changed + +- Upgraded abstractions and yaml dependencies. + +## [0.4.0] - 2022-05-26 + +### Changed + +- Updated reference to kiota abstractions for enum response support. + +## [0.3.0] - 2022-05-19 + +### Changed + +- Updated kiota abstractions library. + +## [0.2.0] - 2022-04-19 + +### Changed + +- Upgraded abstractions to 0.4.0. +- Upgraded to go 18. + +## [0.1.0] - 2022-03-30 + +### Added + +- Initial tagged release of the library. diff --git a/vendor/github.com/microsoft/kiota-serialization-text-go/CODE_OF_CONDUCT.md b/vendor/github.com/microsoft/kiota-serialization-text-go/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..f9ba8cf65 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-text-go/CODE_OF_CONDUCT.md @@ -0,0 +1,9 @@ +# Microsoft Open Source Code of Conduct + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). + +Resources: + +- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) +- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns diff --git a/vendor/github.com/microsoft/kiota-serialization-text-go/LICENSE b/vendor/github.com/microsoft/kiota-serialization-text-go/LICENSE new file mode 100644 index 000000000..9e841e7a2 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-text-go/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/vendor/github.com/microsoft/kiota-serialization-text-go/README.md b/vendor/github.com/microsoft/kiota-serialization-text-go/README.md new file mode 100644 index 000000000..4bd6d8bdb --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-text-go/README.md @@ -0,0 +1,37 @@ +# Kiota Text Serialization Library for Go + +![Go Serialization Text](https://github.com/microsoft/kiota-serialization-text-go/actions/workflows/go.yml/badge.svg) + +The text Serialization Library for Go is the Go text serialization library implementation. + +A [Kiota](https://github.com/microsoft/kiota) generated project will need a reference to a text serialization package to handle text payloads from an API endpoint. + +Read more about Kiota [here](https://github.com/microsoft/kiota/blob/main/README.md). + +## Using the Kiota Text Serialization Library + +```Shell +go get github.com/microsoft/kiota-serialization-text-go +``` + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a +Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us +the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. + +When you submit a pull request, a CLA bot will automatically determine whether you need to provide +a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions +provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or +contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + +## Trademarks + +This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft +trademarks or logos is subject to and must follow +[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). +Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. +Any use of third-party trademarks or logos are subject to those third-party's policies. diff --git a/vendor/github.com/microsoft/kiota-serialization-text-go/SECURITY.md b/vendor/github.com/microsoft/kiota-serialization-text-go/SECURITY.md new file mode 100644 index 000000000..f7b89984f --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-text-go/SECURITY.md @@ -0,0 +1,41 @@ + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). + + \ No newline at end of file diff --git a/vendor/github.com/microsoft/kiota-serialization-text-go/SUPPORT.md b/vendor/github.com/microsoft/kiota-serialization-text-go/SUPPORT.md new file mode 100644 index 000000000..dc72f0e5a --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-text-go/SUPPORT.md @@ -0,0 +1,25 @@ +# TODO: The maintainer of this repo has not yet edited this file + +**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? + +- **No CSS support:** Fill out this template with information about how to file issues and get help. +- **Yes CSS support:** Fill out an intake form at [aka.ms/spot](https://aka.ms/spot). CSS will work with/help you to determine next steps. More details also available at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). +- **Not sure?** Fill out a SPOT intake as though the answer were "Yes". CSS will help you decide. + +*Then remove this first heading from this SUPPORT.MD file before publishing your repo.* + +# Support + +## How to file issues and get help + +This project uses GitHub Issues to track bugs and feature requests. Please search the existing +issues before filing new issues to avoid duplicates. For new issues, file your bug or +feature request as a new Issue. + +For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE +FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER +CHANNEL. WHERE WILL YOU HELP PEOPLE?**. + +## Microsoft Support Policy + +Support for this **PROJECT or PRODUCT** is limited to the resources listed above. diff --git a/vendor/github.com/microsoft/kiota-serialization-text-go/sonar-project.properties b/vendor/github.com/microsoft/kiota-serialization-text-go/sonar-project.properties new file mode 100644 index 000000000..7f30071e4 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-text-go/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=microsoft_kiota-serialization-text-go +sonar.organization=microsoft +sonar.exclusions=**/*_test.go +sonar.test.inclusions=**/*_test.go +sonar.go.tests.reportPaths=result.out +sonar.go.coverage.reportPaths=cover.out \ No newline at end of file diff --git a/vendor/github.com/microsoft/kiota-serialization-text-go/text_parse_node.go b/vendor/github.com/microsoft/kiota-serialization-text-go/text_parse_node.go new file mode 100644 index 000000000..7bf7f0b9f --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-text-go/text_parse_node.go @@ -0,0 +1,274 @@ +// Package textserialization is the default Kiota serialization implementation for text. +package textserialization + +import ( + "encoding/base64" + "errors" + "strconv" + "strings" + "time" + + "github.com/google/uuid" + absser "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TextParseNode is a ParseNode implementation for JSON. +type TextParseNode struct { + value string + onBeforeAssignFieldValues absser.ParsableAction + onAfterAssignFieldValues absser.ParsableAction +} + +// NewTextParseNode creates a new TextParseNode. +func NewTextParseNode(content []byte) (*TextParseNode, error) { + if len(content) == 0 { + return nil, errors.New("content is empty") + } + value, err := loadTextTree(content) + return value, err +} +func loadTextTree(content []byte) (*TextParseNode, error) { + return &TextParseNode{ + value: string(content), + }, nil +} + +// GetChildNode returns a new parse node for the given identifier. +func (n *TextParseNode) GetChildNode(index string) (absser.ParseNode, error) { + return nil, NoStructuredDataError +} + +// GetObjectValue returns the Parsable value from the node. +func (n *TextParseNode) GetObjectValue(ctor absser.ParsableFactory) (absser.Parsable, error) { + return nil, NoStructuredDataError +} + +// GetCollectionOfObjectValues returns the collection of Parsable values from the node. +func (n *TextParseNode) GetCollectionOfObjectValues(ctor absser.ParsableFactory) ([]absser.Parsable, error) { + return nil, NoStructuredDataError +} + +// GetCollectionOfPrimitiveValues returns the collection of primitive values from the node. +func (n *TextParseNode) GetCollectionOfPrimitiveValues(targetType string) ([]interface{}, error) { + return nil, NoStructuredDataError +} + +// GetCollectionOfEnumValues returns the collection of Enum values from the node. +func (n *TextParseNode) GetCollectionOfEnumValues(parser absser.EnumFactory) ([]interface{}, error) { + return nil, NoStructuredDataError +} + +// GetStringValue returns a String value from the nodes. +func (n *TextParseNode) GetStringValue() (*string, error) { + if n == nil { + return nil, nil + } + val := strings.Trim(n.value, "\"") + return &val, nil +} + +// GetBoolValue returns a Bool value from the nodes. +func (n *TextParseNode) GetBoolValue() (*bool, error) { + if n == nil { + return nil, nil + } + val, err := strconv.ParseBool(n.value) + if err != nil { + return nil, err + } + return &val, nil +} + +// GetInt8Value returns a int8 value from the nodes. +func (n *TextParseNode) GetInt8Value() (*int8, error) { + if n == nil { + return nil, nil + } + val, err := strconv.ParseInt(n.value, 0, 8) + if err != nil { + return nil, err + } + cast := int8(val) + return &cast, nil +} + +// GetBoolValue returns a Bool value from the nodes. +func (n *TextParseNode) GetByteValue() (*byte, error) { + if n == nil { + return nil, nil + } + val, err := strconv.ParseInt(n.value, 0, 8) + if err != nil { + return nil, err + } + cast := uint8(val) + return &cast, nil +} + +// GetFloat32Value returns a Float32 value from the nodes. +func (n *TextParseNode) GetFloat32Value() (*float32, error) { + v, err := n.GetFloat64Value() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + cast := float32(*v) + return &cast, nil +} + +// GetFloat64Value returns a Float64 value from the nodes. +func (n *TextParseNode) GetFloat64Value() (*float64, error) { + if n == nil { + return nil, nil + } + val, err := strconv.ParseFloat(n.value, 0) + if err != nil { + return nil, err + } + cast := float64(val) + return &cast, nil +} + +// GetInt32Value returns a Int32 value from the nodes. +func (n *TextParseNode) GetInt32Value() (*int32, error) { + v, err := n.GetFloat64Value() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + cast := int32(*v) + return &cast, nil +} + +// GetInt64Value returns a Int64 value from the nodes. +func (n *TextParseNode) GetInt64Value() (*int64, error) { + v, err := n.GetFloat64Value() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + cast := int64(*v) + return &cast, nil +} + +// GetTimeValue returns a Time value from the nodes. +func (n *TextParseNode) GetTimeValue() (*time.Time, error) { + v, err := n.GetStringValue() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + parsed, err := time.Parse(time.RFC3339, *v) + return &parsed, err +} + +// GetISODurationValue returns a ISODuration value from the nodes. +func (n *TextParseNode) GetISODurationValue() (*absser.ISODuration, error) { + v, err := n.GetStringValue() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + return absser.ParseISODuration(*v) +} + +// GetTimeOnlyValue returns a TimeOnly value from the nodes. +func (n *TextParseNode) GetTimeOnlyValue() (*absser.TimeOnly, error) { + v, err := n.GetStringValue() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + return absser.ParseTimeOnly(*v) +} + +// GetDateOnlyValue returns a DateOnly value from the nodes. +func (n *TextParseNode) GetDateOnlyValue() (*absser.DateOnly, error) { + v, err := n.GetStringValue() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + return absser.ParseDateOnly(*v) +} + +// GetUUIDValue returns a UUID value from the nodes. +func (n *TextParseNode) GetUUIDValue() (*uuid.UUID, error) { + v, err := n.GetStringValue() + if err != nil { + return nil, err + } + if v == nil { + return nil, nil + } + parsed, err := uuid.Parse(*v) + return &parsed, err +} + +// GetEnumValue returns a Enum value from the nodes. +func (n *TextParseNode) GetEnumValue(parser absser.EnumFactory) (interface{}, error) { + if parser == nil { + return nil, errors.New("parser is nil") + } + s, err := n.GetStringValue() + if err != nil { + return nil, err + } + if s == nil { + return nil, nil + } + return parser(*s) +} + +// GetByteArrayValue returns a ByteArray value from the nodes. +func (n *TextParseNode) GetByteArrayValue() ([]byte, error) { + s, err := n.GetStringValue() + if err != nil { + return nil, err + } + if s == nil { + return nil, nil + } + return base64.StdEncoding.DecodeString(*s) +} + +// GetRawValue returns a ByteArray value from the nodes. +func (n *TextParseNode) GetRawValue() (interface{}, error) { + return n.value, nil +} + +// GetOnBeforeAssignFieldValues returns a ByteArray value from the nodes. +func (n *TextParseNode) GetOnBeforeAssignFieldValues() absser.ParsableAction { + return n.onBeforeAssignFieldValues +} + +// SetOnBeforeAssignFieldValues returns a ByteArray value from the nodes. +func (n *TextParseNode) SetOnBeforeAssignFieldValues(action absser.ParsableAction) error { + n.onBeforeAssignFieldValues = action + return nil +} + +// GetOnAfterAssignFieldValues returns a ByteArray value from the nodes. +func (n *TextParseNode) GetOnAfterAssignFieldValues() absser.ParsableAction { + return n.onAfterAssignFieldValues +} + +// SetOnAfterAssignFieldValues returns a ByteArray value from the nodes. +func (n *TextParseNode) SetOnAfterAssignFieldValues(action absser.ParsableAction) error { + n.onAfterAssignFieldValues = action + return nil +} diff --git a/vendor/github.com/microsoft/kiota-serialization-text-go/text_parse_node_factory.go b/vendor/github.com/microsoft/kiota-serialization-text-go/text_parse_node_factory.go new file mode 100644 index 000000000..6886e2c07 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-text-go/text_parse_node_factory.go @@ -0,0 +1,35 @@ +package textserialization + +import ( + "errors" + + absser "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TextParseNodeFactory is a ParseNodeFactory implementation for text +type TextParseNodeFactory struct { +} + +// Creates a new TextParseNodeFactory +func NewTextParseNodeFactory() *TextParseNodeFactory { + return &TextParseNodeFactory{} +} + +// GetValidContentType returns the content type this factory's parse nodes can deserialize. +func (f *TextParseNodeFactory) GetValidContentType() (string, error) { + return "text/plain", nil +} + +// GetRootParseNode return a new ParseNode instance that is the root of the content +func (f *TextParseNodeFactory) GetRootParseNode(contentType string, content []byte) (absser.ParseNode, error) { + validType, err := f.GetValidContentType() + if err != nil { + return nil, err + } else if contentType == "" { + return nil, errors.New("contentType is empty") + } else if contentType != validType { + return nil, errors.New("contentType is not valid") + } else { + return NewTextParseNode(content) + } +} diff --git a/vendor/github.com/microsoft/kiota-serialization-text-go/text_parse_node_factory_text.go b/vendor/github.com/microsoft/kiota-serialization-text-go/text_parse_node_factory_text.go new file mode 100644 index 000000000..c8fc2aa8a --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-text-go/text_parse_node_factory_text.go @@ -0,0 +1,13 @@ +package textserialization + +import ( + testing "testing" + + absser "github.com/microsoft/kiota-abstractions-go/serialization" + assert "github.com/stretchr/testify/assert" +) + +func TestTextParseFactoryNodeHonoursInterface(t *testing.T) { + instance := NewTextParseNodeFactory() + assert.Implements(t, (*absser.ParseNodeFactory)(nil), instance) +} diff --git a/vendor/github.com/microsoft/kiota-serialization-text-go/text_serialization_writer.go b/vendor/github.com/microsoft/kiota-serialization-text-go/text_serialization_writer.go new file mode 100644 index 000000000..59aa66a12 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-text-go/text_serialization_writer.go @@ -0,0 +1,286 @@ +package textserialization + +import ( + "encoding/base64" + "errors" + "strconv" + "strings" + "time" + + "github.com/google/uuid" + + absser "github.com/microsoft/kiota-abstractions-go/serialization" +) + +var NoStructuredDataError = errors.New("text does not support structured data") +var OnlyOneValue = errors.New("text serialization writer can only write one value") + +// TextSerializationWriter implements SerializationWriter for JSON. +type TextSerializationWriter struct { + writer []string + onBeforeAssignFieldValues absser.ParsableAction + onAfterAssignFieldValues absser.ParsableAction + onStartObjectSerialization absser.ParsableWriter +} + +// NewTextSerializationWriter creates a new instance of the TextSerializationWriter. +func NewTextSerializationWriter() *TextSerializationWriter { + return &TextSerializationWriter{ + writer: make([]string, 0), + } +} +func (w *TextSerializationWriter) writeStringValue(key string, value string) error { + if key != "" { + return NoStructuredDataError + } + if value != "" { + if len(w.writer) > 0 { + return OnlyOneValue + } + w.writer = append(w.writer, value) + } + return nil +} + +// WriteStringValue writes a String value to underlying the byte array. +func (w *TextSerializationWriter) WriteStringValue(key string, value *string) error { + if value != nil { + return w.writeStringValue(key, *value) + } + return nil +} + +// WriteBoolValue writes a Bool value to underlying the byte array. +func (w *TextSerializationWriter) WriteBoolValue(key string, value *bool) error { + if value != nil { + return w.writeStringValue(key, strconv.FormatBool(*value)) + } + return nil +} + +// WriteByteValue writes a Byte value to underlying the byte array. +func (w *TextSerializationWriter) WriteByteValue(key string, value *byte) error { + if value != nil { + cast := int64(*value) + return w.WriteInt64Value(key, &cast) + } + return nil +} + +// WriteInt8Value writes a int8 value to underlying the byte array. +func (w *TextSerializationWriter) WriteInt8Value(key string, value *int8) error { + if value != nil { + cast := int64(*value) + return w.WriteInt64Value(key, &cast) + } + return nil +} + +// WriteInt32Value writes a Int32 value to underlying the byte array. +func (w *TextSerializationWriter) WriteInt32Value(key string, value *int32) error { + if value != nil { + cast := int64(*value) + return w.WriteInt64Value(key, &cast) + } + return nil +} + +// WriteInt64Value writes a Int64 value to underlying the byte array. +func (w *TextSerializationWriter) WriteInt64Value(key string, value *int64) error { + if value != nil { + return w.writeStringValue(key, strconv.FormatInt(*value, 10)) + } + return nil +} + +// WriteFloat32Value writes a Float32 value to underlying the byte array. +func (w *TextSerializationWriter) WriteFloat32Value(key string, value *float32) error { + if value != nil { + cast := float64(*value) + return w.WriteFloat64Value(key, &cast) + } + return nil +} + +// WriteFloat64Value writes a Float64 value to underlying the byte array. +func (w *TextSerializationWriter) WriteFloat64Value(key string, value *float64) error { + if value != nil { + return w.writeStringValue(key, strconv.FormatFloat(*value, 'f', -1, 64)) + } + return nil +} + +// WriteTimeValue writes a Time value to underlying the byte array. +func (w *TextSerializationWriter) WriteTimeValue(key string, value *time.Time) error { + if value != nil { + return w.writeStringValue(key, (*value).String()) + } + return nil +} + +// WriteISODurationValue writes a ISODuration value to underlying the byte array. +func (w *TextSerializationWriter) WriteISODurationValue(key string, value *absser.ISODuration) error { + if value != nil { + return w.writeStringValue(key, (*value).String()) + } + return nil +} + +// WriteTimeOnlyValue writes a TimeOnly value to underlying the byte array. +func (w *TextSerializationWriter) WriteTimeOnlyValue(key string, value *absser.TimeOnly) error { + if value != nil { + return w.writeStringValue(key, (*value).String()) + } + return nil +} + +// WriteDateOnlyValue writes a DateOnly value to underlying the byte array. +func (w *TextSerializationWriter) WriteDateOnlyValue(key string, value *absser.DateOnly) error { + if value != nil { + return w.writeStringValue(key, (*value).String()) + } + return nil +} + +// WriteUUIDValue writes a UUID value to underlying the byte array. +func (w *TextSerializationWriter) WriteUUIDValue(key string, value *uuid.UUID) error { + if value != nil { + return w.writeStringValue(key, (*value).String()) + } + return nil +} + +// WriteByteArrayValue writes a ByteArray value to underlying the byte array. +func (w *TextSerializationWriter) WriteByteArrayValue(key string, value []byte) error { + if value != nil { + return w.writeStringValue(key, base64.StdEncoding.EncodeToString(value)) + } + return nil +} + +// WriteObjectValue writes a Parsable value to underlying the byte array. +func (w *TextSerializationWriter) WriteObjectValue(key string, item absser.Parsable, additionalValuesToMerge ...absser.Parsable) error { + return NoStructuredDataError +} + +// WriteCollectionOfObjectValues writes a collection of Parsable values to underlying the byte array. +func (w *TextSerializationWriter) WriteCollectionOfObjectValues(key string, collection []absser.Parsable) error { + return NoStructuredDataError +} + +// WriteCollectionOfStringValues writes a collection of String values to underlying the byte array. +func (w *TextSerializationWriter) WriteCollectionOfStringValues(key string, collection []string) error { + return NoStructuredDataError +} + +// WriteCollectionOfInt32Values writes a collection of Int32 values to underlying the byte array. +func (w *TextSerializationWriter) WriteCollectionOfInt32Values(key string, collection []int32) error { + return NoStructuredDataError +} + +// WriteCollectionOfInt64Values writes a collection of Int64 values to underlying the byte array. +func (w *TextSerializationWriter) WriteCollectionOfInt64Values(key string, collection []int64) error { + return NoStructuredDataError +} + +// WriteCollectionOfFloat32Values writes a collection of Float32 values to underlying the byte array. +func (w *TextSerializationWriter) WriteCollectionOfFloat32Values(key string, collection []float32) error { + return NoStructuredDataError +} + +// WriteCollectionOfFloat64Values writes a collection of Float64 values to underlying the byte array. +func (w *TextSerializationWriter) WriteCollectionOfFloat64Values(key string, collection []float64) error { + return NoStructuredDataError +} + +// WriteCollectionOfTimeValues writes a collection of Time values to underlying the byte array. +func (w *TextSerializationWriter) WriteCollectionOfTimeValues(key string, collection []time.Time) error { + return NoStructuredDataError +} + +// WriteCollectionOfISODurationValues writes a collection of ISODuration values to underlying the byte array. +func (w *TextSerializationWriter) WriteCollectionOfISODurationValues(key string, collection []absser.ISODuration) error { + return NoStructuredDataError +} + +// WriteCollectionOfTimeOnlyValues writes a collection of TimeOnly values to underlying the byte array. +func (w *TextSerializationWriter) WriteCollectionOfTimeOnlyValues(key string, collection []absser.TimeOnly) error { + return NoStructuredDataError +} + +// WriteCollectionOfDateOnlyValues writes a collection of DateOnly values to underlying the byte array. +func (w *TextSerializationWriter) WriteCollectionOfDateOnlyValues(key string, collection []absser.DateOnly) error { + return NoStructuredDataError +} + +// WriteCollectionOfUUIDValues writes a collection of UUID values to underlying the byte array. +func (w *TextSerializationWriter) WriteCollectionOfUUIDValues(key string, collection []uuid.UUID) error { + return NoStructuredDataError +} + +// WriteCollectionOfBoolValues writes a collection of Bool values to underlying the byte array. +func (w *TextSerializationWriter) WriteCollectionOfBoolValues(key string, collection []bool) error { + return NoStructuredDataError +} + +// WriteCollectionOfByteValues writes a collection of Byte values to underlying the byte array. +func (w *TextSerializationWriter) WriteCollectionOfByteValues(key string, collection []byte) error { + return NoStructuredDataError +} + +// WriteCollectionOfInt8Values writes a collection of int8 values to underlying the byte array. +func (w *TextSerializationWriter) WriteCollectionOfInt8Values(key string, collection []int8) error { + return NoStructuredDataError +} + +// GetSerializedContent returns the resulting byte array from the serialization writer. +func (w *TextSerializationWriter) GetSerializedContent() ([]byte, error) { + resultStr := strings.Join(w.writer, "") + return []byte(resultStr), nil +} + +// WriteAdditionalData writes additional data to underlying the byte array. +func (w *TextSerializationWriter) WriteAdditionalData(value map[string]interface{}) error { + return NoStructuredDataError +} + +// WriteAnyValue an unknown value as a parameter. +func (w *TextSerializationWriter) WriteAnyValue(key string, value interface{}) error { + return NoStructuredDataError +} + +// Close clears the internal buffer. +func (w *TextSerializationWriter) Close() error { + return nil +} + +func (w *TextSerializationWriter) WriteNullValue(key string) error { + return NoStructuredDataError +} + +func (w *TextSerializationWriter) GetOnBeforeSerialization() absser.ParsableAction { + return w.onBeforeAssignFieldValues +} + +func (w *TextSerializationWriter) SetOnBeforeSerialization(action absser.ParsableAction) error { + w.onBeforeAssignFieldValues = action + return nil +} + +func (w *TextSerializationWriter) GetOnAfterObjectSerialization() absser.ParsableAction { + return w.onAfterAssignFieldValues +} + +func (w *TextSerializationWriter) SetOnAfterObjectSerialization(action absser.ParsableAction) error { + w.onAfterAssignFieldValues = action + return nil +} + +func (w *TextSerializationWriter) GetOnStartObjectSerialization() absser.ParsableWriter { + return w.onStartObjectSerialization +} + +func (w *TextSerializationWriter) SetOnStartObjectSerialization(writer absser.ParsableWriter) error { + w.onStartObjectSerialization = writer + return nil +} diff --git a/vendor/github.com/microsoft/kiota-serialization-text-go/text_serialization_writer_factory.go b/vendor/github.com/microsoft/kiota-serialization-text-go/text_serialization_writer_factory.go new file mode 100644 index 000000000..3dcfc7ea3 --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-text-go/text_serialization_writer_factory.go @@ -0,0 +1,35 @@ +package textserialization + +import ( + "errors" + + absser "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TextSerializationWriterFactory implements SerializationWriterFactory for text. +type TextSerializationWriterFactory struct { +} + +// NewTextSerializationWriterFactory creates a new instance of the TextSerializationWriterFactory. +func NewTextSerializationWriterFactory() *TextSerializationWriterFactory { + return &TextSerializationWriterFactory{} +} + +// GetValidContentType returns the valid content type for the SerializationWriterFactoryRegistry +func (f *TextSerializationWriterFactory) GetValidContentType() (string, error) { + return "text/plain", nil +} + +// GetSerializationWriter returns the relevant SerializationWriter instance for the given content type +func (f *TextSerializationWriterFactory) GetSerializationWriter(contentType string) (absser.SerializationWriter, error) { + validType, err := f.GetValidContentType() + if err != nil { + return nil, err + } else if contentType == "" { + return nil, errors.New("contentType is empty") + } else if contentType != validType { + return nil, errors.New("contentType is not valid") + } else { + return NewTextSerializationWriter(), nil + } +} diff --git a/vendor/github.com/microsoft/kiota-serialization-text-go/text_serialization_writer_factory_text.go b/vendor/github.com/microsoft/kiota-serialization-text-go/text_serialization_writer_factory_text.go new file mode 100644 index 000000000..0d549db8f --- /dev/null +++ b/vendor/github.com/microsoft/kiota-serialization-text-go/text_serialization_writer_factory_text.go @@ -0,0 +1,13 @@ +package textserialization + +import ( + testing "testing" + + absser "github.com/microsoft/kiota-abstractions-go/serialization" + assert "github.com/stretchr/testify/assert" +) + +func TestSerializationWriterFactoryHonoursInterface(t *testing.T) { + instance := NewTextSerializationWriterFactory() + assert.Implements(t, (*absser.SerializationWriterFactory)(nil), instance) +} diff --git a/vendor/github.com/octokit/go-sdk/LICENSE b/vendor/github.com/octokit/go-sdk/LICENSE new file mode 100644 index 000000000..e221025b9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Octokit + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/octokit/go-sdk/pkg/authentication/request.go b/vendor/github.com/octokit/go-sdk/pkg/authentication/request.go new file mode 100644 index 000000000..fcfefb71d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/authentication/request.go @@ -0,0 +1,49 @@ +package authentication + +import ( + "fmt" + + abs "github.com/microsoft/kiota-abstractions-go" + "github.com/octokit/go-sdk/pkg/headers" +) + +// Request provides a wrapper around Kiota's abs.RequestInformation type +type Request struct { + *abs.RequestInformation +} + +// WithTokenAuthentication sets the Authorization header to the given token, +// prepended by the AuthType +func (r *Request) WithTokenAuthentication(token string) { + if r.Headers.ContainsKey(headers.AuthorizationKey) { + r.Headers.Remove(headers.AuthorizationKey) + } + r.Headers.Add(headers.AuthorizationKey, fmt.Sprintf("%v %v", headers.AuthType, token)) +} + +// WithUserAgent allows the caller to set the User-Agent string for each request +func (r *Request) WithUserAgent(userAgent string) { + if r.Headers.ContainsKey(headers.UserAgentKey) { + r.Headers.Remove(headers.UserAgentKey) + } + r.Headers.Add(headers.UserAgentKey, userAgent) +} + +// WithDefaultUserAgent sets the default User-Agent string for each request +func (r *Request) WithDefaultUserAgent() { + r.WithUserAgent(headers.UserAgentValue) +} + +// WithAPIVersion sets the API version header for each request +func (r *Request) WithAPIVersion(version string) { + if r.Headers.ContainsKey(headers.APIVersionKey) { + r.Headers.Remove(headers.APIVersionKey) + } + r.Headers.Add(headers.APIVersionKey, version) +} + +// WithDefaultAPIVersion sets the API version header to the default (the version used +// to generate the code) for each request +func (r *Request) WithDefaultAPIVersion() { + r.WithAPIVersion(headers.APIVersionValue) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/authentication/token_provider.go b/vendor/github.com/octokit/go-sdk/pkg/authentication/token_provider.go new file mode 100644 index 000000000..d610c8db0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/authentication/token_provider.go @@ -0,0 +1,89 @@ +package authentication + +import ( + "context" + + abs "github.com/microsoft/kiota-abstractions-go" +) + +// TokenProvider may use a token to authenticate each request. It also can be +// used to configure UserAgent strings, API Versions, and other request configuration. +// Note that GitHub App authentication is set at the client transport level. See the +// docs for pkg.NewApiClient for more. +type TokenProvider struct { + options []TokenProviderOption +} + +// TokenProviderOption provides a functional option +// for configuring a TokenProvider. +type TokenProviderOption func(*TokenProvider, *Request) + +// WithTokenAuthentication sets the AuthorizationToken for each request to the given token. +func WithTokenAuthentication(token string) TokenProviderOption { + return func(t *TokenProvider, r *Request) { + r.WithTokenAuthentication(token) + } +} + +// WithDefaultUserAgent sets the User-Agent string sent for requests to the default +// for this SDK. +func WithDefaultUserAgent() TokenProviderOption { + return func(t *TokenProvider, r *Request) { + r.WithDefaultUserAgent() + } +} + +// WithUserAgent sets the User-Agent string sent with each request. +func WithUserAgent(userAgent string) TokenProviderOption { + return func(t *TokenProvider, r *Request) { + r.WithUserAgent(userAgent) + } +} + +// WithDefaultAPIVersion sets the API version header sent with each request. +func WithDefaultAPIVersion() TokenProviderOption { + return func(t *TokenProvider, r *Request) { + r.WithDefaultAPIVersion() + } +} + +// WithAPIVersion sets the API version header sent with each request. +func WithAPIVersion(version string) TokenProviderOption { + return func(t *TokenProvider, r *Request) { + r.WithAPIVersion(version) + } +} + +// TODO(kfcampbell): implement new constructor with allowedHosts + +// NewTokenProvider creates an instance of TokenProvider with the specified token and options. +func NewTokenProvider(options ...TokenProviderOption) *TokenProvider { + provider := &TokenProvider{ + options: options, + } + return provider +} + +// defaultHandlers contains our "sensible defaults" for TokenProvider initialization +var defaultHandlers = []TokenProviderOption{WithDefaultUserAgent(), WithDefaultAPIVersion()} + +// AuthenticateRequest applies the default options for each request, then the user's options +// (if present in the TokenProvider). User options are guaranteed to be run in the order they +// were input. +func (t *TokenProvider) AuthenticateRequest(context context.Context, request *abs.RequestInformation, additionalAuthenticationContext map[string]interface{}) error { + reqWrapper := &Request{RequestInformation: request} + + if reqWrapper.Headers == nil { + reqWrapper.Headers = abs.NewRequestHeaders() + } + + for _, option := range defaultHandlers { + option(t, reqWrapper) + } + + // apply user options after defaults + for _, option := range t.options { + option(t, reqWrapper) + } + return nil +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/client.go b/vendor/github.com/octokit/go-sdk/pkg/client.go new file mode 100644 index 000000000..9538d96d3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/client.go @@ -0,0 +1,186 @@ +package pkg + +import ( + "fmt" + "net/http" + "time" + + "github.com/kfcampbell/ghinstallation" + kiotaHttp "github.com/microsoft/kiota-http-go" + auth "github.com/octokit/go-sdk/pkg/authentication" + "github.com/octokit/go-sdk/pkg/github" + "github.com/octokit/go-sdk/pkg/handlers" +) + +// NewApiClient is a convenience constructor to create a new instance of a +// Client (wrapper of *github.ApiClient) with the provided option functions. +// By default, it includes a rate limiting middleware. +func NewApiClient(optionFuncs ...ClientOptionFunc) (*Client, error) { + options := GetDefaultClientOptions() + for _, optionFunc := range optionFuncs { + optionFunc(options) + } + + rateLimitHandler := handlers.NewRateLimitHandler() + middlewares := options.Middleware + middlewares = append(middlewares, rateLimitHandler) + defaultTransport := kiotaHttp.GetDefaultTransport() + netHttpClient := &http.Client{ + Transport: defaultTransport, + } + + if options.RequestTimeout != 0 { + netHttpClient.Timeout = options.RequestTimeout + } + + if (options.GitHubAppID != 0 || options.GitHubAppClientID != "") && options.GitHubAppInstallationID != 0 && options.GitHubAppPemFilePath != "" { + existingTransport := netHttpClient.Transport + var appTransport *ghinstallation.Transport + var err error + + if options.GitHubAppClientID != "" { + appTransport, err = ghinstallation.NewKeyFromFile(existingTransport, options.GitHubAppClientID, options.GitHubAppInstallationID, options.GitHubAppPemFilePath) + } else { + appTransport, err = ghinstallation.NewKeyFromFileWithAppID(existingTransport, options.GitHubAppID, options.GitHubAppInstallationID, options.GitHubAppPemFilePath) + } + + if err != nil { + return nil, fmt.Errorf("failed to create transport from GitHub App: %v", err) + } + + netHttpClient.Transport = appTransport + } + + // Middleware must be applied after App transport is set, otherwise App token will fail to be + // renewed with a 400 Bad Request error (even though the request is identical to a successful one.) + finalTransport := kiotaHttp.NewCustomTransportWithParentTransport(netHttpClient.Transport, middlewares...) + netHttpClient.Transport = finalTransport + + tokenProviderOptions := []auth.TokenProviderOption{ + auth.WithAPIVersion(options.APIVersion), + auth.WithUserAgent(options.UserAgent), + } + + // If a PAT is provided and GitHub App information is not, configure token authentication + if options.Token != "" && (options.GitHubAppInstallationID == 0 && options.GitHubAppPemFilePath == "") { + tokenProviderOptions = append(tokenProviderOptions, auth.WithTokenAuthentication(options.Token)) + } + + tokenProvider := auth.NewTokenProvider(tokenProviderOptions...) + + adapter, err := kiotaHttp.NewNetHttpRequestAdapterWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClient(tokenProvider, nil, nil, netHttpClient) + if err != nil { + return nil, fmt.Errorf("failed to create request adapter: %v", err) + } + if options.BaseURL != "" { + adapter.SetBaseUrl(options.BaseURL) + } + + client := github.NewApiClient(adapter) + sdkClient := &Client{ + ApiClient: client, + } + + return sdkClient, nil +} + +// Client wraps github.ApiClient so that we may provide neater constructors and ease of use +type Client struct { + *github.ApiClient +} + +// ClientOptions contains every setting we could possibly want to set for the token provider, +// the netHttpClient, the middleware, and the adapter. If we can possibly override it, it should +// be in this struct. +// In the constructor, when helper functions apply options, they'll be applied to this struct. +// Then later in the constructor when that chain of objects is put together, all configuration +// will be drawn from this (hydrated) struct. +type ClientOptions struct { + UserAgent string + APIVersion string + RequestTimeout time.Duration + Middleware []kiotaHttp.Middleware + BaseURL string + + // Token should be left blank if GitHub App auth or an unauthenticated client is desired. + Token string + + // GitHubAppPemFilePath should be left blank if token auth or an unauthenticated client is desired. + GitHubAppPemFilePath string + // GitHubAppID should be left blank if token auth or an unauthenticated client is desired. + // Deprecated: Use GitHubAppClientID instead. + GitHubAppID int64 + // GitHubAppClientID should be left blank if token auth or an unauthenticated client is desired. + GitHubAppClientID string + // GitHubAppInstallationID should be left blank if token auth or an unauthenticated client is desired. + GitHubAppInstallationID int64 +} + +// GetDefaultClientOptions returns a new instance of ClientOptions with default values. +// This is used in the NewApiClient constructor before applying user-defined custom options. +func GetDefaultClientOptions() *ClientOptions { + return &ClientOptions{ + UserAgent: "octokit/go-sdk", + APIVersion: "2022-11-28", + Middleware: kiotaHttp.GetDefaultMiddlewares(), + } +} + +// ClientOptionFunc provides a functional pattern for client configuration +type ClientOptionFunc func(*ClientOptions) + +// WithUserAgent configures the client with the given user agent string. +func WithUserAgent(userAgent string) ClientOptionFunc { + return func(c *ClientOptions) { + c.UserAgent = userAgent + } +} + +// WithRequestTimeout configures the client with the given request timeout. +func WithRequestTimeout(timeout time.Duration) ClientOptionFunc { + return func(c *ClientOptions) { + c.RequestTimeout = timeout + } +} + +// WithBaseUrl configures the client with the given base URL. +func WithBaseUrl(baseURL string) ClientOptionFunc { + return func(c *ClientOptions) { + c.BaseURL = baseURL + } +} + +// WithTokenAuthentication configures the client with the given +// Personal Authorization Token. +func WithTokenAuthentication(token string) ClientOptionFunc { + return func(c *ClientOptions) { + c.Token = token + } +} + +// WithAPIVersion configures the client with the given API version. +func WithAPIVersion(version string) ClientOptionFunc { + return func(c *ClientOptions) { + c.APIVersion = version + } +} + +// WithGitHubAppAuthenticationUsingAppID configures the client with the given GitHub App +// auth. Deprecated: Use WithGitHubAppAuthentication instead, which takes in a clientID +// string instead of an appID integer. +func WithGitHubAppAuthenticationUsingAppID(pemFilePath string, appID int64, installationID int64) ClientOptionFunc { + return func(c *ClientOptions) { + c.GitHubAppPemFilePath = pemFilePath + c.GitHubAppID = appID + c.GitHubAppInstallationID = installationID + } +} + +// WithGitHubAppAuthentication configures the client with the given GitHub App auth. +func WithGitHubAppAuthentication(pemFilePath string, clientID string, installationID int64) ClientOptionFunc { + return func(c *ClientOptions) { + c.GitHubAppPemFilePath = pemFilePath + c.GitHubAppClientID = clientID + c.GitHubAppInstallationID = installationID + } +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/advisories/advisories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/advisories/advisories_request_builder.go new file mode 100644 index 000000000..f93e39b34 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/advisories/advisories_request_builder.go @@ -0,0 +1,113 @@ +package advisories + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// AdvisoriesRequestBuilder builds and executes requests for operations under \advisories +type AdvisoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// AdvisoriesRequestBuilderGetQueryParameters lists all global security advisories that match the specified parameters. If no other parameters are defined, the request will return only GitHub-reviewed advisories that are not malware.By default, all responses will exclude advisories for malware, because malware are not standard vulnerabilities. To list advisories for malware, you must include the `type` parameter in your request, with the value `malware`. For more information about the different types of security advisories, see "[About the GitHub Advisory database](https://docs.github.com/code-security/security-advisories/global-security-advisories/about-the-github-advisory-database#about-types-of-security-advisories)." +type AdvisoriesRequestBuilderGetQueryParameters struct { + // If specified, only return advisories that affect any of `package` or `package@version`. A maximum of 1000 packages can be specified.If the query parameter causes the URL to exceed the maximum URL length supported by your client, you must specify fewer packages.Example: `affects=package1,package2@1.0.0,package3@^2.0.0` or `affects[]=package1&affects[]=package2@1.0.0` + Affects *string `uriparametername:"affects"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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)." + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + Before *string `uriparametername:"before"` + // If specified, only advisories with this CVE (Common Vulnerabilities and Exposures) identifier will be returned. + Cve_id *string `uriparametername:"cve_id"` + // If specified, only advisories with these Common Weakness Enumerations (CWEs) will be returned.Example: `cwes=79,284,22` or `cwes[]=79&cwes[]=284&cwes[]=22` + Cwes *string `uriparametername:"cwes"` + // The direction to sort the results by. + Direction *GetDirectionQueryParameterType `uriparametername:"direction"` + // If specified, only advisories for these ecosystems will be returned. + Ecosystem *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecurityAdvisoryEcosystems `uriparametername:"ecosystem"` + // If specified, only advisories with this GHSA (GitHub Security Advisory) identifier will be returned. + Ghsa_id *string `uriparametername:"ghsa_id"` + // Whether to only return advisories that have been withdrawn. + Is_withdrawn *bool `uriparametername:"is_withdrawn"` + // If specified, only show advisories that were updated or published on a date or date range.For more information on the syntax of the date range, see "[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)." + Modified *string `uriparametername:"modified"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // If specified, only return advisories that were published on a date or date range.For more information on the syntax of the date range, see "[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)." + Published *string `uriparametername:"published"` + // If specified, only advisories with these severities will be returned. + Severity *GetSeverityQueryParameterType `uriparametername:"severity"` + // The property to sort the results by. + Sort *GetSortQueryParameterType `uriparametername:"sort"` + // If specified, only advisories of this type will be returned. By default, a request with no other parameters defined will only return reviewed advisories that are not malware. + Type *GetTypeQueryParameterType `uriparametername:"type"` + // If specified, only return advisories that were updated on a date or date range.For more information on the syntax of the date range, see "[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)." + Updated *string `uriparametername:"updated"` +} +// ByGhsa_id gets an item from the github.com/octokit/go-sdk/pkg/github.advisories.item collection +// returns a *WithGhsa_ItemRequestBuilder when successful +func (m *AdvisoriesRequestBuilder) ByGhsa_id(ghsa_id string)(*WithGhsa_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if ghsa_id != "" { + urlTplParams["ghsa_id"] = ghsa_id + } + return NewWithGhsa_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewAdvisoriesRequestBuilderInternal instantiates a new AdvisoriesRequestBuilder and sets the default values. +func NewAdvisoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AdvisoriesRequestBuilder) { + m := &AdvisoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/advisories{?affects*,after*,before*,cve_id*,cwes*,direction*,ecosystem*,ghsa_id*,is_withdrawn*,modified*,per_page*,published*,severity*,sort*,type*,updated*}", pathParameters), + } + return m +} +// NewAdvisoriesRequestBuilder instantiates a new AdvisoriesRequestBuilder and sets the default values. +func NewAdvisoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AdvisoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAdvisoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all global security advisories that match the specified parameters. If no other parameters are defined, the request will return only GitHub-reviewed advisories that are not malware.By default, all responses will exclude advisories for malware, because malware are not standard vulnerabilities. To list advisories for malware, you must include the `type` parameter in your request, with the value `malware`. For more information about the different types of security advisories, see "[About the GitHub Advisory database](https://docs.github.com/code-security/security-advisories/global-security-advisories/about-the-github-advisory-database#about-types-of-security-advisories)." +// returns a []GlobalAdvisoryable when successful +// returns a ValidationErrorSimple error when the service returns a 422 status code +// returns a BasicError error when the service returns a 429 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories +func (m *AdvisoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[AdvisoriesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GlobalAdvisoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + "429": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGlobalAdvisoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GlobalAdvisoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GlobalAdvisoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists all global security advisories that match the specified parameters. If no other parameters are defined, the request will return only GitHub-reviewed advisories that are not malware.By default, all responses will exclude advisories for malware, because malware are not standard vulnerabilities. To list advisories for malware, you must include the `type` parameter in your request, with the value `malware`. For more information about the different types of security advisories, see "[About the GitHub Advisory database](https://docs.github.com/code-security/security-advisories/global-security-advisories/about-the-github-advisory-database#about-types-of-security-advisories)." +// returns a *RequestInformation when successful +func (m *AdvisoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[AdvisoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *AdvisoriesRequestBuilder when successful +func (m *AdvisoriesRequestBuilder) WithUrl(rawUrl string)(*AdvisoriesRequestBuilder) { + return NewAdvisoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/advisories/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/advisories/get_direction_query_parameter_type.go new file mode 100644 index 000000000..2f7b45ba0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/advisories/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package advisories +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/advisories/get_ecosystem_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/advisories/get_ecosystem_query_parameter_type.go new file mode 100644 index 000000000..ecb63a7b2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/advisories/get_ecosystem_query_parameter_type.go @@ -0,0 +1,66 @@ +package advisories +import ( + "errors" +) +type GetEcosystemQueryParameterType int + +const ( + ACTIONS_GETECOSYSTEMQUERYPARAMETERTYPE GetEcosystemQueryParameterType = iota + COMPOSER_GETECOSYSTEMQUERYPARAMETERTYPE + ERLANG_GETECOSYSTEMQUERYPARAMETERTYPE + GO_GETECOSYSTEMQUERYPARAMETERTYPE + MAVEN_GETECOSYSTEMQUERYPARAMETERTYPE + NPM_GETECOSYSTEMQUERYPARAMETERTYPE + NUGET_GETECOSYSTEMQUERYPARAMETERTYPE + OTHER_GETECOSYSTEMQUERYPARAMETERTYPE + PIP_GETECOSYSTEMQUERYPARAMETERTYPE + PUB_GETECOSYSTEMQUERYPARAMETERTYPE + RUBYGEMS_GETECOSYSTEMQUERYPARAMETERTYPE + RUST_GETECOSYSTEMQUERYPARAMETERTYPE +) + +func (i GetEcosystemQueryParameterType) String() string { + return []string{"actions", "composer", "erlang", "go", "maven", "npm", "nuget", "other", "pip", "pub", "rubygems", "rust"}[i] +} +func ParseGetEcosystemQueryParameterType(v string) (any, error) { + result := ACTIONS_GETECOSYSTEMQUERYPARAMETERTYPE + switch v { + case "actions": + result = ACTIONS_GETECOSYSTEMQUERYPARAMETERTYPE + case "composer": + result = COMPOSER_GETECOSYSTEMQUERYPARAMETERTYPE + case "erlang": + result = ERLANG_GETECOSYSTEMQUERYPARAMETERTYPE + case "go": + result = GO_GETECOSYSTEMQUERYPARAMETERTYPE + case "maven": + result = MAVEN_GETECOSYSTEMQUERYPARAMETERTYPE + case "npm": + result = NPM_GETECOSYSTEMQUERYPARAMETERTYPE + case "nuget": + result = NUGET_GETECOSYSTEMQUERYPARAMETERTYPE + case "other": + result = OTHER_GETECOSYSTEMQUERYPARAMETERTYPE + case "pip": + result = PIP_GETECOSYSTEMQUERYPARAMETERTYPE + case "pub": + result = PUB_GETECOSYSTEMQUERYPARAMETERTYPE + case "rubygems": + result = RUBYGEMS_GETECOSYSTEMQUERYPARAMETERTYPE + case "rust": + result = RUST_GETECOSYSTEMQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetEcosystemQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetEcosystemQueryParameterType(values []GetEcosystemQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetEcosystemQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/advisories/get_severity_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/advisories/get_severity_query_parameter_type.go new file mode 100644 index 000000000..42a515201 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/advisories/get_severity_query_parameter_type.go @@ -0,0 +1,45 @@ +package advisories +import ( + "errors" +) +type GetSeverityQueryParameterType int + +const ( + UNKNOWN_GETSEVERITYQUERYPARAMETERTYPE GetSeverityQueryParameterType = iota + LOW_GETSEVERITYQUERYPARAMETERTYPE + MEDIUM_GETSEVERITYQUERYPARAMETERTYPE + HIGH_GETSEVERITYQUERYPARAMETERTYPE + CRITICAL_GETSEVERITYQUERYPARAMETERTYPE +) + +func (i GetSeverityQueryParameterType) String() string { + return []string{"unknown", "low", "medium", "high", "critical"}[i] +} +func ParseGetSeverityQueryParameterType(v string) (any, error) { + result := UNKNOWN_GETSEVERITYQUERYPARAMETERTYPE + switch v { + case "unknown": + result = UNKNOWN_GETSEVERITYQUERYPARAMETERTYPE + case "low": + result = LOW_GETSEVERITYQUERYPARAMETERTYPE + case "medium": + result = MEDIUM_GETSEVERITYQUERYPARAMETERTYPE + case "high": + result = HIGH_GETSEVERITYQUERYPARAMETERTYPE + case "critical": + result = CRITICAL_GETSEVERITYQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSeverityQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSeverityQueryParameterType(values []GetSeverityQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSeverityQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/advisories/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/advisories/get_sort_query_parameter_type.go new file mode 100644 index 000000000..d1b660202 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/advisories/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package advisories +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + UPDATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + PUBLISHED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"updated", "published"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := UPDATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "published": + result = PUBLISHED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/advisories/get_type_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/advisories/get_type_query_parameter_type.go new file mode 100644 index 000000000..528f5a5d4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/advisories/get_type_query_parameter_type.go @@ -0,0 +1,39 @@ +package advisories +import ( + "errors" +) +type GetTypeQueryParameterType int + +const ( + REVIEWED_GETTYPEQUERYPARAMETERTYPE GetTypeQueryParameterType = iota + MALWARE_GETTYPEQUERYPARAMETERTYPE + UNREVIEWED_GETTYPEQUERYPARAMETERTYPE +) + +func (i GetTypeQueryParameterType) String() string { + return []string{"reviewed", "malware", "unreviewed"}[i] +} +func ParseGetTypeQueryParameterType(v string) (any, error) { + result := REVIEWED_GETTYPEQUERYPARAMETERTYPE + switch v { + case "reviewed": + result = REVIEWED_GETTYPEQUERYPARAMETERTYPE + case "malware": + result = MALWARE_GETTYPEQUERYPARAMETERTYPE + case "unreviewed": + result = UNREVIEWED_GETTYPEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetTypeQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetTypeQueryParameterType(values []GetTypeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetTypeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/advisories/with_ghsa_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/advisories/with_ghsa_item_request_builder.go new file mode 100644 index 000000000..700bbe476 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/advisories/with_ghsa_item_request_builder.go @@ -0,0 +1,61 @@ +package advisories + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// WithGhsa_ItemRequestBuilder builds and executes requests for operations under \advisories\{ghsa_id} +type WithGhsa_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithGhsa_ItemRequestBuilderInternal instantiates a new WithGhsa_ItemRequestBuilder and sets the default values. +func NewWithGhsa_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithGhsa_ItemRequestBuilder) { + m := &WithGhsa_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/advisories/{ghsa_id}", pathParameters), + } + return m +} +// NewWithGhsa_ItemRequestBuilder instantiates a new WithGhsa_ItemRequestBuilder and sets the default values. +func NewWithGhsa_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithGhsa_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithGhsa_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a global security advisory using its GitHub Security Advisory (GHSA) identifier. +// returns a GlobalAdvisoryable 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/security-advisories/global-advisories#get-a-global-security-advisory +func (m *WithGhsa_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GlobalAdvisoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGlobalAdvisoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GlobalAdvisoryable), nil +} +// ToGetRequestInformation gets a global security advisory using its GitHub Security Advisory (GHSA) identifier. +// returns a *RequestInformation when successful +func (m *WithGhsa_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *WithGhsa_ItemRequestBuilder when successful +func (m *WithGhsa_ItemRequestBuilder) WithUrl(rawUrl string)(*WithGhsa_ItemRequestBuilder) { + return NewWithGhsa_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/api_client.go b/vendor/github.com/octokit/go-sdk/pkg/github/api_client.go new file mode 100644 index 000000000..ffb8a2891 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/api_client.go @@ -0,0 +1,272 @@ +package github + +import ( + "context" + i25911dc319edd61cbac496af7eab5ef20b6069a42515e22ec6a9bc97bf598488 "github.com/microsoft/kiota-serialization-json-go" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i4bcdc892e61ac17e2afc10b5e2b536b29f4fd6c1ad30f4a5a68df47495db3347 "github.com/microsoft/kiota-serialization-form-go" + i56887720f41ac882814261620b1c8459c4a992a0207af547c4453dd39fabc426 "github.com/microsoft/kiota-serialization-multipart-go" + i7294a22093d408fdca300f11b81a887d89c47b764af06c8b803e2323973fdb83 "github.com/microsoft/kiota-serialization-text-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i0418eb5bc6d6e5c5596c278b5f327e24b1594d0a2338da0da064365a642eceff "github.com/octokit/go-sdk/pkg/github/app" + i04dfd3ae6494a1aec921b0f0ae334653c1b3e6091b7b31a50e7977b2b4e54f66 "github.com/octokit/go-sdk/pkg/github/users" + i0737a59f72bd0b3677f51f977eb9a1a5e217db56b30eda4683f072dd51df524a "github.com/octokit/go-sdk/pkg/github/user" + i08b5ce560895c2e4c4bd1673fc739fcd3d31e314c5b53adc6a89aba3d8c6244e "github.com/octokit/go-sdk/pkg/github/appmanifests" + i0ee0b8f649e15b17c2eabdd46a0f8c70c497e9c6cdef6ff35be832f2eb719ac3 "github.com/octokit/go-sdk/pkg/github/classrooms" + i12a9b43201d9a86bb60f5b677ba8d0e7e5da47bc806080ad3218e4c65628b957 "github.com/octokit/go-sdk/pkg/github/rate_limit" + i24ae3cb00d5734ee78f4378d5739457021b8117fbda874d208f0e79ba3767e84 "github.com/octokit/go-sdk/pkg/github/enterprises" + i331f27c1d84b94cd34b6f5276a80b9b495557537e64366b12a82d4f6256cc315 "github.com/octokit/go-sdk/pkg/github/markdown" + i3d7d4dc978cfc98dfee1e9704d82dee19f232386607bb0ec32b0288e7ad55112 "github.com/octokit/go-sdk/pkg/github/notifications" + i4000a3f52da0039065e50768fd1044a9efa2154163159903dfe0efad17ee681d "github.com/octokit/go-sdk/pkg/github/repos" + i47b66686b0190707417a08d06857b07dec037d9b5534bb91752a10f16de0e9db "github.com/octokit/go-sdk/pkg/github/search" + i4d1eee1704a96ea8ab53e424182986725fde88abc66df8b117e9a2f20429d93a "github.com/octokit/go-sdk/pkg/github/meta" + i54045f2cdc31d6122b70e132f86739f81aea3c9aaaa4bbebeafc3e09be67700a "github.com/octokit/go-sdk/pkg/github/organizations" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i5c383b7fca29547223d6e4abf6eaff83f09b72e11524fd25346fd31be394ace5 "github.com/octokit/go-sdk/pkg/github/issues" + i5cf6ed0734619011c475ed18bdb3bf27f375f600864b00ae52feb4473ffe1081 "github.com/octokit/go-sdk/pkg/github/emojis" + i6265cecf37e9b8b6daa13472abde6c43c88081bb9d68ee62d9c56c001ae179d4 "github.com/octokit/go-sdk/pkg/github/feeds" + i68b78648401e10ac283b41c6c62b9e34e6b84e36aed7bbf9a408157262621541 "github.com/octokit/go-sdk/pkg/github/gitignore" + i6fbd16012f9d384db4ed793592fd1e4960e1e71a355ae0e5a6a457dec525b9fa "github.com/octokit/go-sdk/pkg/github/orgs" + i77422b4816b2e4034320d80ba8150f21a4209c1d31d547c1f9105e20e5bd24ac "github.com/octokit/go-sdk/pkg/github/applications" + i7c2f4266a964aa71671d1f93b3dedd60ab0fb58fc1c48d67ec5323e06f987d13 "github.com/octokit/go-sdk/pkg/github/installation" + i81237a20a3d3d568f85359ecb683b25d592945354af01b3bb96015225d355d0b "github.com/octokit/go-sdk/pkg/github/advisories" + i9058dc6558645b18c3dabb68ce06f623305fd2f87c0952167619d0d8b4249490 "github.com/octokit/go-sdk/pkg/github/zen" + i92a99a8b5d9294c6b4600047e7f16515a40994715a7ed07d4afa2393ed306c04 "github.com/octokit/go-sdk/pkg/github/octocat" + i986f660025ed63efc77aa38f829d1f8dbd3f63e6ad3c8df735c5335e37b607be "github.com/octokit/go-sdk/pkg/github/licenses" + i9a3e59ac75b1a35f0b41cb5bba910e278ebbbf0527883428330d78ca41ad925b "github.com/octokit/go-sdk/pkg/github/networks" + i9c8518268801f75b016b6b68b07c0ac4c95512b503cc56ba270c337a1b265384 "github.com/octokit/go-sdk/pkg/github/repositories" + ia5478699530639ac7ac52c373afc47e03f523b842a72b212b381ca49aae9255d "github.com/octokit/go-sdk/pkg/github/codes_of_conduct" + ia7fd50a86ade62d3f84a4d485b2c3bb76080fbbce4f4ab65fdcbd7789bd82705 "github.com/octokit/go-sdk/pkg/github/gists" + ib62b62162b22a0c33176b41c32ba6062508c8c70e490bfdd926b74d9500eb171 "github.com/octokit/go-sdk/pkg/github/events" + icccce443123713e2f41a15534fb2982842bc02bef783c80ed5f0f20406addd52 "github.com/octokit/go-sdk/pkg/github/teams" + id2671b72dcd915381cbe90f24655e8c8c52db963e200cc8f20b1738da7beb68f "github.com/octokit/go-sdk/pkg/github/assignments" + ie7ab5250c8bf9bd78939f5773ba8b0e78d558cfedd3cf8858458622c0c8ee879 "github.com/octokit/go-sdk/pkg/github/marketplace_listing" + if0a678a7358b449c2d0570a0c4327fbd4d0b69bdec4884ec0cd79748e725fc19 "github.com/octokit/go-sdk/pkg/github/projects" + if6a0b82222a4a600b84ed4730a3e16ae4912e617120d6fd543a9e35c9c81e38e "github.com/octokit/go-sdk/pkg/github/apps" + if9262d059a5df6366c8597430a86d0c7247500ee47d3cb11ea28c4da6de74620 "github.com/octokit/go-sdk/pkg/github/versions" +) + +// ApiClient the main entry point of the SDK, exposes the configuration and the fluent API. +type ApiClient struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Advisories the advisories property +// returns a *AdvisoriesRequestBuilder when successful +func (m *ApiClient) Advisories()(*i81237a20a3d3d568f85359ecb683b25d592945354af01b3bb96015225d355d0b.AdvisoriesRequestBuilder) { + return i81237a20a3d3d568f85359ecb683b25d592945354af01b3bb96015225d355d0b.NewAdvisoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// App the app property +// returns a *AppRequestBuilder when successful +func (m *ApiClient) App()(*i0418eb5bc6d6e5c5596c278b5f327e24b1594d0a2338da0da064365a642eceff.AppRequestBuilder) { + return i0418eb5bc6d6e5c5596c278b5f327e24b1594d0a2338da0da064365a642eceff.NewAppRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Applications the applications property +// returns a *ApplicationsRequestBuilder when successful +func (m *ApiClient) Applications()(*i77422b4816b2e4034320d80ba8150f21a4209c1d31d547c1f9105e20e5bd24ac.ApplicationsRequestBuilder) { + return i77422b4816b2e4034320d80ba8150f21a4209c1d31d547c1f9105e20e5bd24ac.NewApplicationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// AppManifests the appManifests property +// returns a *AppManifestsRequestBuilder when successful +func (m *ApiClient) AppManifests()(*i08b5ce560895c2e4c4bd1673fc739fcd3d31e314c5b53adc6a89aba3d8c6244e.AppManifestsRequestBuilder) { + return i08b5ce560895c2e4c4bd1673fc739fcd3d31e314c5b53adc6a89aba3d8c6244e.NewAppManifestsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Apps the apps property +// returns a *AppsRequestBuilder when successful +func (m *ApiClient) Apps()(*if6a0b82222a4a600b84ed4730a3e16ae4912e617120d6fd543a9e35c9c81e38e.AppsRequestBuilder) { + return if6a0b82222a4a600b84ed4730a3e16ae4912e617120d6fd543a9e35c9c81e38e.NewAppsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Assignments the assignments property +// returns a *AssignmentsRequestBuilder when successful +func (m *ApiClient) Assignments()(*id2671b72dcd915381cbe90f24655e8c8c52db963e200cc8f20b1738da7beb68f.AssignmentsRequestBuilder) { + return id2671b72dcd915381cbe90f24655e8c8c52db963e200cc8f20b1738da7beb68f.NewAssignmentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Classrooms the classrooms property +// returns a *ClassroomsRequestBuilder when successful +func (m *ApiClient) Classrooms()(*i0ee0b8f649e15b17c2eabdd46a0f8c70c497e9c6cdef6ff35be832f2eb719ac3.ClassroomsRequestBuilder) { + return i0ee0b8f649e15b17c2eabdd46a0f8c70c497e9c6cdef6ff35be832f2eb719ac3.NewClassroomsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Codes_of_conduct the codes_of_conduct property +// returns a *Codes_of_conductRequestBuilder when successful +func (m *ApiClient) Codes_of_conduct()(*ia5478699530639ac7ac52c373afc47e03f523b842a72b212b381ca49aae9255d.Codes_of_conductRequestBuilder) { + return ia5478699530639ac7ac52c373afc47e03f523b842a72b212b381ca49aae9255d.NewCodes_of_conductRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewApiClient instantiates a new ApiClient and sets the default values. +func NewApiClient(requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiClient) { + m := &ApiClient{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}", map[string]string{}), + } + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RegisterDefaultSerializer(func() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriterFactory { return i25911dc319edd61cbac496af7eab5ef20b6069a42515e22ec6a9bc97bf598488.NewJsonSerializationWriterFactory() }) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RegisterDefaultSerializer(func() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriterFactory { return i7294a22093d408fdca300f11b81a887d89c47b764af06c8b803e2323973fdb83.NewTextSerializationWriterFactory() }) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RegisterDefaultSerializer(func() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriterFactory { return i4bcdc892e61ac17e2afc10b5e2b536b29f4fd6c1ad30f4a5a68df47495db3347.NewFormSerializationWriterFactory() }) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RegisterDefaultSerializer(func() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriterFactory { return i56887720f41ac882814261620b1c8459c4a992a0207af547c4453dd39fabc426.NewMultipartSerializationWriterFactory() }) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RegisterDefaultDeserializer(func() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNodeFactory { return i25911dc319edd61cbac496af7eab5ef20b6069a42515e22ec6a9bc97bf598488.NewJsonParseNodeFactory() }) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RegisterDefaultDeserializer(func() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNodeFactory { return i7294a22093d408fdca300f11b81a887d89c47b764af06c8b803e2323973fdb83.NewTextParseNodeFactory() }) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RegisterDefaultDeserializer(func() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNodeFactory { return i4bcdc892e61ac17e2afc10b5e2b536b29f4fd6c1ad30f4a5a68df47495db3347.NewFormParseNodeFactory() }) + if m.BaseRequestBuilder.RequestAdapter.GetBaseUrl() == "" { + m.BaseRequestBuilder.RequestAdapter.SetBaseUrl("https://api.github.com") + } + m.BaseRequestBuilder.PathParameters["baseurl"] = m.BaseRequestBuilder.RequestAdapter.GetBaseUrl() + return m +} +// Emojis the emojis property +// returns a *EmojisRequestBuilder when successful +func (m *ApiClient) Emojis()(*i5cf6ed0734619011c475ed18bdb3bf27f375f600864b00ae52feb4473ffe1081.EmojisRequestBuilder) { + return i5cf6ed0734619011c475ed18bdb3bf27f375f600864b00ae52feb4473ffe1081.NewEmojisRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Enterprises the enterprises property +// returns a *EnterprisesRequestBuilder when successful +func (m *ApiClient) Enterprises()(*i24ae3cb00d5734ee78f4378d5739457021b8117fbda874d208f0e79ba3767e84.EnterprisesRequestBuilder) { + return i24ae3cb00d5734ee78f4378d5739457021b8117fbda874d208f0e79ba3767e84.NewEnterprisesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Events the events property +// returns a *EventsRequestBuilder when successful +func (m *ApiClient) Events()(*ib62b62162b22a0c33176b41c32ba6062508c8c70e490bfdd926b74d9500eb171.EventsRequestBuilder) { + return ib62b62162b22a0c33176b41c32ba6062508c8c70e490bfdd926b74d9500eb171.NewEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Feeds the feeds property +// returns a *FeedsRequestBuilder when successful +func (m *ApiClient) Feeds()(*i6265cecf37e9b8b6daa13472abde6c43c88081bb9d68ee62d9c56c001ae179d4.FeedsRequestBuilder) { + return i6265cecf37e9b8b6daa13472abde6c43c88081bb9d68ee62d9c56c001ae179d4.NewFeedsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get get Hypermedia links to resources accessible in GitHub's REST API +// returns a Rootable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/meta/meta#github-api-root +func (m *ApiClient) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Rootable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRootFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Rootable), nil +} +// Gists the gists property +// returns a *GistsRequestBuilder when successful +func (m *ApiClient) Gists()(*ia7fd50a86ade62d3f84a4d485b2c3bb76080fbbce4f4ab65fdcbd7789bd82705.GistsRequestBuilder) { + return ia7fd50a86ade62d3f84a4d485b2c3bb76080fbbce4f4ab65fdcbd7789bd82705.NewGistsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Gitignore the gitignore property +// returns a *GitignoreRequestBuilder when successful +func (m *ApiClient) Gitignore()(*i68b78648401e10ac283b41c6c62b9e34e6b84e36aed7bbf9a408157262621541.GitignoreRequestBuilder) { + return i68b78648401e10ac283b41c6c62b9e34e6b84e36aed7bbf9a408157262621541.NewGitignoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Installation the installation property +// returns a *InstallationRequestBuilder when successful +func (m *ApiClient) Installation()(*i7c2f4266a964aa71671d1f93b3dedd60ab0fb58fc1c48d67ec5323e06f987d13.InstallationRequestBuilder) { + return i7c2f4266a964aa71671d1f93b3dedd60ab0fb58fc1c48d67ec5323e06f987d13.NewInstallationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Issues the issues property +// returns a *IssuesRequestBuilder when successful +func (m *ApiClient) Issues()(*i5c383b7fca29547223d6e4abf6eaff83f09b72e11524fd25346fd31be394ace5.IssuesRequestBuilder) { + return i5c383b7fca29547223d6e4abf6eaff83f09b72e11524fd25346fd31be394ace5.NewIssuesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Licenses the licenses property +// returns a *LicensesRequestBuilder when successful +func (m *ApiClient) Licenses()(*i986f660025ed63efc77aa38f829d1f8dbd3f63e6ad3c8df735c5335e37b607be.LicensesRequestBuilder) { + return i986f660025ed63efc77aa38f829d1f8dbd3f63e6ad3c8df735c5335e37b607be.NewLicensesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Markdown the markdown property +// returns a *MarkdownRequestBuilder when successful +func (m *ApiClient) Markdown()(*i331f27c1d84b94cd34b6f5276a80b9b495557537e64366b12a82d4f6256cc315.MarkdownRequestBuilder) { + return i331f27c1d84b94cd34b6f5276a80b9b495557537e64366b12a82d4f6256cc315.NewMarkdownRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Marketplace_listing the marketplace_listing property +// returns a *Marketplace_listingRequestBuilder when successful +func (m *ApiClient) Marketplace_listing()(*ie7ab5250c8bf9bd78939f5773ba8b0e78d558cfedd3cf8858458622c0c8ee879.Marketplace_listingRequestBuilder) { + return ie7ab5250c8bf9bd78939f5773ba8b0e78d558cfedd3cf8858458622c0c8ee879.NewMarketplace_listingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Meta the meta property +// returns a *MetaRequestBuilder when successful +func (m *ApiClient) Meta()(*i4d1eee1704a96ea8ab53e424182986725fde88abc66df8b117e9a2f20429d93a.MetaRequestBuilder) { + return i4d1eee1704a96ea8ab53e424182986725fde88abc66df8b117e9a2f20429d93a.NewMetaRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Networks the networks property +// returns a *NetworksRequestBuilder when successful +func (m *ApiClient) Networks()(*i9a3e59ac75b1a35f0b41cb5bba910e278ebbbf0527883428330d78ca41ad925b.NetworksRequestBuilder) { + return i9a3e59ac75b1a35f0b41cb5bba910e278ebbbf0527883428330d78ca41ad925b.NewNetworksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Notifications the notifications property +// returns a *NotificationsRequestBuilder when successful +func (m *ApiClient) Notifications()(*i3d7d4dc978cfc98dfee1e9704d82dee19f232386607bb0ec32b0288e7ad55112.NotificationsRequestBuilder) { + return i3d7d4dc978cfc98dfee1e9704d82dee19f232386607bb0ec32b0288e7ad55112.NewNotificationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Octocat the octocat property +// returns a *OctocatRequestBuilder when successful +func (m *ApiClient) Octocat()(*i92a99a8b5d9294c6b4600047e7f16515a40994715a7ed07d4afa2393ed306c04.OctocatRequestBuilder) { + return i92a99a8b5d9294c6b4600047e7f16515a40994715a7ed07d4afa2393ed306c04.NewOctocatRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Organizations the organizations property +// returns a *OrganizationsRequestBuilder when successful +func (m *ApiClient) Organizations()(*i54045f2cdc31d6122b70e132f86739f81aea3c9aaaa4bbebeafc3e09be67700a.OrganizationsRequestBuilder) { + return i54045f2cdc31d6122b70e132f86739f81aea3c9aaaa4bbebeafc3e09be67700a.NewOrganizationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Orgs the orgs property +// returns a *OrgsRequestBuilder when successful +func (m *ApiClient) Orgs()(*i6fbd16012f9d384db4ed793592fd1e4960e1e71a355ae0e5a6a457dec525b9fa.OrgsRequestBuilder) { + return i6fbd16012f9d384db4ed793592fd1e4960e1e71a355ae0e5a6a457dec525b9fa.NewOrgsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Projects the projects property +// returns a *ProjectsRequestBuilder when successful +func (m *ApiClient) Projects()(*if0a678a7358b449c2d0570a0c4327fbd4d0b69bdec4884ec0cd79748e725fc19.ProjectsRequestBuilder) { + return if0a678a7358b449c2d0570a0c4327fbd4d0b69bdec4884ec0cd79748e725fc19.NewProjectsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rate_limit the rate_limit property +// returns a *Rate_limitRequestBuilder when successful +func (m *ApiClient) Rate_limit()(*i12a9b43201d9a86bb60f5b677ba8d0e7e5da47bc806080ad3218e4c65628b957.Rate_limitRequestBuilder) { + return i12a9b43201d9a86bb60f5b677ba8d0e7e5da47bc806080ad3218e4c65628b957.NewRate_limitRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repos the repos property +// returns a *ReposRequestBuilder when successful +func (m *ApiClient) Repos()(*i4000a3f52da0039065e50768fd1044a9efa2154163159903dfe0efad17ee681d.ReposRequestBuilder) { + return i4000a3f52da0039065e50768fd1044a9efa2154163159903dfe0efad17ee681d.NewReposRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repositories the repositories property +// returns a *RepositoriesRequestBuilder when successful +func (m *ApiClient) Repositories()(*i9c8518268801f75b016b6b68b07c0ac4c95512b503cc56ba270c337a1b265384.RepositoriesRequestBuilder) { + return i9c8518268801f75b016b6b68b07c0ac4c95512b503cc56ba270c337a1b265384.NewRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Search the search property +// returns a *SearchRequestBuilder when successful +func (m *ApiClient) Search()(*i47b66686b0190707417a08d06857b07dec037d9b5534bb91752a10f16de0e9db.SearchRequestBuilder) { + return i47b66686b0190707417a08d06857b07dec037d9b5534bb91752a10f16de0e9db.NewSearchRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Teams the teams property +// returns a *TeamsRequestBuilder when successful +func (m *ApiClient) Teams()(*icccce443123713e2f41a15534fb2982842bc02bef783c80ed5f0f20406addd52.TeamsRequestBuilder) { + return icccce443123713e2f41a15534fb2982842bc02bef783c80ed5f0f20406addd52.NewTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation get Hypermedia links to resources accessible in GitHub's REST API +// returns a *RequestInformation when successful +func (m *ApiClient) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// User the user property +// returns a *UserRequestBuilder when successful +func (m *ApiClient) User()(*i0737a59f72bd0b3677f51f977eb9a1a5e217db56b30eda4683f072dd51df524a.UserRequestBuilder) { + return i0737a59f72bd0b3677f51f977eb9a1a5e217db56b30eda4683f072dd51df524a.NewUserRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Users the users property +// returns a *UsersRequestBuilder when successful +func (m *ApiClient) Users()(*i04dfd3ae6494a1aec921b0f0ae334653c1b3e6091b7b31a50e7977b2b4e54f66.UsersRequestBuilder) { + return i04dfd3ae6494a1aec921b0f0ae334653c1b3e6091b7b31a50e7977b2b4e54f66.NewUsersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Versions the versions property +// returns a *VersionsRequestBuilder when successful +func (m *ApiClient) Versions()(*if9262d059a5df6366c8597430a86d0c7247500ee47d3cb11ea28c4da6de74620.VersionsRequestBuilder) { + return if9262d059a5df6366c8597430a86d0c7247500ee47d3cb11ea28c4da6de74620.NewVersionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Zen the zen property +// returns a *ZenRequestBuilder when successful +func (m *ApiClient) Zen()(*i9058dc6558645b18c3dabb68ce06f623305fd2f87c0952167619d0d8b4249490.ZenRequestBuilder) { + return i9058dc6558645b18c3dabb68ce06f623305fd2f87c0952167619d0d8b4249490.NewZenRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/app/app_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/app/app_request_builder.go new file mode 100644 index 000000000..3afee4ef9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/app/app_request_builder.go @@ -0,0 +1,72 @@ +package app + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// AppRequestBuilder builds and executes requests for operations under \app +type AppRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewAppRequestBuilderInternal instantiates a new AppRequestBuilder and sets the default values. +func NewAppRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AppRequestBuilder) { + m := &AppRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app", pathParameters), + } + return m +} +// NewAppRequestBuilder instantiates a new AppRequestBuilder and sets the default values. +func NewAppRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AppRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAppRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the `installations_count` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app)" endpoint.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a Integrationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/apps#get-the-authenticated-app +func (m *AppRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integrationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIntegrationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integrationable), nil +} +// Hook the hook property +// returns a *HookRequestBuilder when successful +func (m *AppRequestBuilder) Hook()(*HookRequestBuilder) { + return NewHookRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// InstallationRequests the installationRequests property +// returns a *InstallationRequestsRequestBuilder when successful +func (m *AppRequestBuilder) InstallationRequests()(*InstallationRequestsRequestBuilder) { + return NewInstallationRequestsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Installations the installations property +// returns a *InstallationsRequestBuilder when successful +func (m *AppRequestBuilder) Installations()(*InstallationsRequestBuilder) { + return NewInstallationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the `installations_count` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app)" endpoint.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *AppRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *AppRequestBuilder when successful +func (m *AppRequestBuilder) WithUrl(rawUrl string)(*AppRequestBuilder) { + return NewAppRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_config_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_config_patch_request_body.go new file mode 100644 index 000000000..8213fbbe0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_config_patch_request_body.go @@ -0,0 +1,168 @@ +package app + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type HookConfigPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // The insecure_ssl property + insecure_ssl i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). + secret *string + // The URL to which the payloads will be delivered. + url *string +} +// NewHookConfigPatchRequestBody instantiates a new HookConfigPatchRequestBody and sets the default values. +func NewHookConfigPatchRequestBody()(*HookConfigPatchRequestBody) { + m := &HookConfigPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookConfigPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookConfigPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookConfigPatchRequestBody(), 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 *HookConfigPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +// returns a *string when successful +func (m *HookConfigPatchRequestBody) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HookConfigPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWebhookConfigInsecureSslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a WebhookConfigInsecureSslable when successful +func (m *HookConfigPatchRequestBody) GetInsecureSsl()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable) { + return m.insecure_ssl +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +// returns a *string when successful +func (m *HookConfigPatchRequestBody) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +// returns a *string when successful +func (m *HookConfigPatchRequestBody) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *HookConfigPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *HookConfigPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *HookConfigPatchRequestBody) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *HookConfigPatchRequestBody) SetInsecureSsl(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)() { + m.insecure_ssl = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +func (m *HookConfigPatchRequestBody) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *HookConfigPatchRequestBody) SetUrl(value *string)() { + m.url = value +} +type HookConfigPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable) + GetSecret()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_config_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_config_request_builder.go new file mode 100644 index 000000000..9f388f873 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_config_request_builder.go @@ -0,0 +1,88 @@ +package app + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// HookConfigRequestBuilder builds and executes requests for operations under \app\hook\config +type HookConfigRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewHookConfigRequestBuilderInternal instantiates a new HookConfigRequestBuilder and sets the default values. +func NewHookConfigRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookConfigRequestBuilder) { + m := &HookConfigRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/hook/config", pathParameters), + } + return m +} +// NewHookConfigRequestBuilder instantiates a new HookConfigRequestBuilder and sets the default values. +func NewHookConfigRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookConfigRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewHookConfigRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)."You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a WebhookConfigable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app +func (m *HookConfigRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWebhookConfigFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable), nil +} +// Patch updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)."You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a WebhookConfigable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app +func (m *HookConfigRequestBuilder) Patch(ctx context.Context, body HookConfigPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWebhookConfigFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable), nil +} +// ToGetRequestInformation returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)."You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *HookConfigRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)."You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *HookConfigRequestBuilder) ToPatchRequestInformation(ctx context.Context, body HookConfigPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *HookConfigRequestBuilder when successful +func (m *HookConfigRequestBuilder) WithUrl(rawUrl string)(*HookConfigRequestBuilder) { + return NewHookConfigRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_deliveries_item_attempts_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_deliveries_item_attempts_post_response.go new file mode 100644 index 000000000..8ca2fc597 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_deliveries_item_attempts_post_response.go @@ -0,0 +1,51 @@ +package app + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type HookDeliveriesItemAttemptsPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewHookDeliveriesItemAttemptsPostResponse instantiates a new HookDeliveriesItemAttemptsPostResponse and sets the default values. +func NewHookDeliveriesItemAttemptsPostResponse()(*HookDeliveriesItemAttemptsPostResponse) { + m := &HookDeliveriesItemAttemptsPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookDeliveriesItemAttemptsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookDeliveriesItemAttemptsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookDeliveriesItemAttemptsPostResponse(), 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 *HookDeliveriesItemAttemptsPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HookDeliveriesItemAttemptsPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *HookDeliveriesItemAttemptsPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *HookDeliveriesItemAttemptsPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type HookDeliveriesItemAttemptsPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_deliveries_item_attempts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_deliveries_item_attempts_request_builder.go new file mode 100644 index 000000000..983d83166 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_deliveries_item_attempts_request_builder.go @@ -0,0 +1,63 @@ +package app + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// HookDeliveriesItemAttemptsRequestBuilder builds and executes requests for operations under \app\hook\deliveries\{delivery_id}\attempts +type HookDeliveriesItemAttemptsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewHookDeliveriesItemAttemptsRequestBuilderInternal instantiates a new HookDeliveriesItemAttemptsRequestBuilder and sets the default values. +func NewHookDeliveriesItemAttemptsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookDeliveriesItemAttemptsRequestBuilder) { + m := &HookDeliveriesItemAttemptsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/hook/deliveries/{delivery_id}/attempts", pathParameters), + } + return m +} +// NewHookDeliveriesItemAttemptsRequestBuilder instantiates a new HookDeliveriesItemAttemptsRequestBuilder and sets the default values. +func NewHookDeliveriesItemAttemptsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookDeliveriesItemAttemptsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewHookDeliveriesItemAttemptsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post redeliver a delivery for the webhook configured for a GitHub App.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a HookDeliveriesItemAttemptsPostResponseable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook +func (m *HookDeliveriesItemAttemptsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(HookDeliveriesItemAttemptsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateHookDeliveriesItemAttemptsPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(HookDeliveriesItemAttemptsPostResponseable), nil +} +// ToPostRequestInformation redeliver a delivery for the webhook configured for a GitHub App.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *HookDeliveriesItemAttemptsRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *HookDeliveriesItemAttemptsRequestBuilder when successful +func (m *HookDeliveriesItemAttemptsRequestBuilder) WithUrl(rawUrl string)(*HookDeliveriesItemAttemptsRequestBuilder) { + return NewHookDeliveriesItemAttemptsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_deliveries_item_attempts_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_deliveries_item_attempts_response.go new file mode 100644 index 000000000..5b350e4df --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_deliveries_item_attempts_response.go @@ -0,0 +1,28 @@ +package app + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// HookDeliveriesItemAttemptsResponse +// Deprecated: This class is obsolete. Use attemptsPostResponse instead. +type HookDeliveriesItemAttemptsResponse struct { + HookDeliveriesItemAttemptsPostResponse +} +// NewHookDeliveriesItemAttemptsResponse instantiates a new HookDeliveriesItemAttemptsResponse and sets the default values. +func NewHookDeliveriesItemAttemptsResponse()(*HookDeliveriesItemAttemptsResponse) { + m := &HookDeliveriesItemAttemptsResponse{ + HookDeliveriesItemAttemptsPostResponse: *NewHookDeliveriesItemAttemptsPostResponse(), + } + return m +} +// CreateHookDeliveriesItemAttemptsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateHookDeliveriesItemAttemptsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookDeliveriesItemAttemptsResponse(), nil +} +// HookDeliveriesItemAttemptsResponseable +// Deprecated: This class is obsolete. Use attemptsPostResponse instead. +type HookDeliveriesItemAttemptsResponseable interface { + HookDeliveriesItemAttemptsPostResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_deliveries_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_deliveries_request_builder.go new file mode 100644 index 000000000..b49ef796d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_deliveries_request_builder.go @@ -0,0 +1,85 @@ +package app + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// HookDeliveriesRequestBuilder builds and executes requests for operations under \app\hook\deliveries +type HookDeliveriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// HookDeliveriesRequestBuilderGetQueryParameters returns a list of webhook deliveries for the webhook configured for a GitHub App.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +type HookDeliveriesRequestBuilderGetQueryParameters 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"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + Redelivery *bool `uriparametername:"redelivery"` +} +// ByDelivery_id gets an item from the github.com/octokit/go-sdk/pkg/github.app.hook.deliveries.item collection +// returns a *HookDeliveriesWithDelivery_ItemRequestBuilder when successful +func (m *HookDeliveriesRequestBuilder) ByDelivery_id(delivery_id int32)(*HookDeliveriesWithDelivery_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["delivery_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(delivery_id), 10) + return NewHookDeliveriesWithDelivery_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewHookDeliveriesRequestBuilderInternal instantiates a new HookDeliveriesRequestBuilder and sets the default values. +func NewHookDeliveriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookDeliveriesRequestBuilder) { + m := &HookDeliveriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/hook/deliveries{?cursor*,per_page*,redelivery*}", pathParameters), + } + return m +} +// NewHookDeliveriesRequestBuilder instantiates a new HookDeliveriesRequestBuilder and sets the default values. +func NewHookDeliveriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookDeliveriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewHookDeliveriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns a list of webhook deliveries for the webhook configured for a GitHub App.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook +func (m *HookDeliveriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[HookDeliveriesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.HookDeliveryItemable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateHookDeliveryItemFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.HookDeliveryItemable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.HookDeliveryItemable) + } + } + return val, nil +} +// ToGetRequestInformation returns a list of webhook deliveries for the webhook configured for a GitHub App.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *HookDeliveriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[HookDeliveriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *HookDeliveriesRequestBuilder when successful +func (m *HookDeliveriesRequestBuilder) WithUrl(rawUrl string)(*HookDeliveriesRequestBuilder) { + return NewHookDeliveriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_deliveries_with_delivery_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_deliveries_with_delivery_item_request_builder.go new file mode 100644 index 000000000..b97a65e18 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_deliveries_with_delivery_item_request_builder.go @@ -0,0 +1,68 @@ +package app + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// HookDeliveriesWithDelivery_ItemRequestBuilder builds and executes requests for operations under \app\hook\deliveries\{delivery_id} +type HookDeliveriesWithDelivery_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Attempts the attempts property +// returns a *HookDeliveriesItemAttemptsRequestBuilder when successful +func (m *HookDeliveriesWithDelivery_ItemRequestBuilder) Attempts()(*HookDeliveriesItemAttemptsRequestBuilder) { + return NewHookDeliveriesItemAttemptsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewHookDeliveriesWithDelivery_ItemRequestBuilderInternal instantiates a new HookDeliveriesWithDelivery_ItemRequestBuilder and sets the default values. +func NewHookDeliveriesWithDelivery_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookDeliveriesWithDelivery_ItemRequestBuilder) { + m := &HookDeliveriesWithDelivery_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/hook/deliveries/{delivery_id}", pathParameters), + } + return m +} +// NewHookDeliveriesWithDelivery_ItemRequestBuilder instantiates a new HookDeliveriesWithDelivery_ItemRequestBuilder and sets the default values. +func NewHookDeliveriesWithDelivery_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookDeliveriesWithDelivery_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewHookDeliveriesWithDelivery_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns a delivery for the webhook configured for a GitHub App.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook +func (m *HookDeliveriesWithDelivery_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.HookDeliveryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateHookDeliveryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.HookDeliveryable), nil +} +// ToGetRequestInformation returns a delivery for the webhook configured for a GitHub App.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *HookDeliveriesWithDelivery_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *HookDeliveriesWithDelivery_ItemRequestBuilder when successful +func (m *HookDeliveriesWithDelivery_ItemRequestBuilder) WithUrl(rawUrl string)(*HookDeliveriesWithDelivery_ItemRequestBuilder) { + return NewHookDeliveriesWithDelivery_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_request_builder.go new file mode 100644 index 000000000..60ac8c402 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/app/hook_request_builder.go @@ -0,0 +1,33 @@ +package app + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// HookRequestBuilder builds and executes requests for operations under \app\hook +type HookRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Config the config property +// returns a *HookConfigRequestBuilder when successful +func (m *HookRequestBuilder) Config()(*HookConfigRequestBuilder) { + return NewHookConfigRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewHookRequestBuilderInternal instantiates a new HookRequestBuilder and sets the default values. +func NewHookRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookRequestBuilder) { + m := &HookRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/hook", pathParameters), + } + return m +} +// NewHookRequestBuilder instantiates a new HookRequestBuilder and sets the default values. +func NewHookRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewHookRequestBuilderInternal(urlParams, requestAdapter) +} +// Deliveries the deliveries property +// returns a *HookDeliveriesRequestBuilder when successful +func (m *HookRequestBuilder) Deliveries()(*HookDeliveriesRequestBuilder) { + return NewHookDeliveriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/app/installation_requests_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/app/installation_requests_request_builder.go new file mode 100644 index 000000000..3aa50480e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/app/installation_requests_request_builder.go @@ -0,0 +1,71 @@ +package app + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// InstallationRequestsRequestBuilder builds and executes requests for operations under \app\installation-requests +type InstallationRequestsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// InstallationRequestsRequestBuilderGetQueryParameters lists all the pending installation requests for the authenticated GitHub App. +type InstallationRequestsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewInstallationRequestsRequestBuilderInternal instantiates a new InstallationRequestsRequestBuilder and sets the default values. +func NewInstallationRequestsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationRequestsRequestBuilder) { + m := &InstallationRequestsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/installation-requests{?page*,per_page*}", pathParameters), + } + return m +} +// NewInstallationRequestsRequestBuilder instantiates a new InstallationRequestsRequestBuilder and sets the default values. +func NewInstallationRequestsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationRequestsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationRequestsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all the pending installation requests for the authenticated GitHub App. +// returns a []IntegrationInstallationRequestable when successful +// returns a BasicError error when the service returns a 401 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app +func (m *InstallationRequestsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[InstallationRequestsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IntegrationInstallationRequestable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIntegrationInstallationRequestFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IntegrationInstallationRequestable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IntegrationInstallationRequestable) + } + } + return val, nil +} +// ToGetRequestInformation lists all the pending installation requests for the authenticated GitHub App. +// returns a *RequestInformation when successful +func (m *InstallationRequestsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[InstallationRequestsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *InstallationRequestsRequestBuilder when successful +func (m *InstallationRequestsRequestBuilder) WithUrl(rawUrl string)(*InstallationRequestsRequestBuilder) { + return NewInstallationRequestsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/app/installations_item_access_tokens_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/app/installations_item_access_tokens_post_request_body.go new file mode 100644 index 000000000..4a48e2f4c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/app/installations_item_access_tokens_post_request_body.go @@ -0,0 +1,151 @@ +package app + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type InstallationsItemAccess_tokensPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The permissions granted to the user access token. + permissions i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AppPermissionsable + // List of repository names that the token should have access to + repositories []string + // List of repository IDs that the token should have access to + repository_ids []int32 +} +// NewInstallationsItemAccess_tokensPostRequestBody instantiates a new InstallationsItemAccess_tokensPostRequestBody and sets the default values. +func NewInstallationsItemAccess_tokensPostRequestBody()(*InstallationsItemAccess_tokensPostRequestBody) { + m := &InstallationsItemAccess_tokensPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateInstallationsItemAccess_tokensPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInstallationsItemAccess_tokensPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInstallationsItemAccess_tokensPostRequestBody(), 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 *InstallationsItemAccess_tokensPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *InstallationsItemAccess_tokensPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAppPermissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AppPermissionsable)) + } + return nil + } + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRepositories(res) + } + return nil + } + res["repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetRepositoryIds(res) + } + return nil + } + return res +} +// GetPermissions gets the permissions property value. The permissions granted to the user access token. +// returns a AppPermissionsable when successful +func (m *InstallationsItemAccess_tokensPostRequestBody) GetPermissions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AppPermissionsable) { + return m.permissions +} +// GetRepositories gets the repositories property value. List of repository names that the token should have access to +// returns a []string when successful +func (m *InstallationsItemAccess_tokensPostRequestBody) GetRepositories()([]string) { + return m.repositories +} +// GetRepositoryIds gets the repository_ids property value. List of repository IDs that the token should have access to +// returns a []int32 when successful +func (m *InstallationsItemAccess_tokensPostRequestBody) GetRepositoryIds()([]int32) { + return m.repository_ids +} +// Serialize serializes information the current object +func (m *InstallationsItemAccess_tokensPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + if m.GetRepositories() != nil { + err := writer.WriteCollectionOfStringValues("repositories", m.GetRepositories()) + if err != nil { + return err + } + } + if m.GetRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("repository_ids", m.GetRepositoryIds()) + 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 *InstallationsItemAccess_tokensPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPermissions sets the permissions property value. The permissions granted to the user access token. +func (m *InstallationsItemAccess_tokensPostRequestBody) SetPermissions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AppPermissionsable)() { + m.permissions = value +} +// SetRepositories sets the repositories property value. List of repository names that the token should have access to +func (m *InstallationsItemAccess_tokensPostRequestBody) SetRepositories(value []string)() { + m.repositories = value +} +// SetRepositoryIds sets the repository_ids property value. List of repository IDs that the token should have access to +func (m *InstallationsItemAccess_tokensPostRequestBody) SetRepositoryIds(value []int32)() { + m.repository_ids = value +} +type InstallationsItemAccess_tokensPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPermissions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AppPermissionsable) + GetRepositories()([]string) + GetRepositoryIds()([]int32) + SetPermissions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AppPermissionsable)() + SetRepositories(value []string)() + SetRepositoryIds(value []int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/app/installations_item_access_tokens_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/app/installations_item_access_tokens_request_builder.go new file mode 100644 index 000000000..12378017d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/app/installations_item_access_tokens_request_builder.go @@ -0,0 +1,71 @@ +package app + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// InstallationsItemAccess_tokensRequestBuilder builds and executes requests for operations under \app\installations\{installation_id}\access_tokens +type InstallationsItemAccess_tokensRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewInstallationsItemAccess_tokensRequestBuilderInternal instantiates a new InstallationsItemAccess_tokensRequestBuilder and sets the default values. +func NewInstallationsItemAccess_tokensRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsItemAccess_tokensRequestBuilder) { + m := &InstallationsItemAccess_tokensRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/installations/{installation_id}/access_tokens", pathParameters), + } + return m +} +// NewInstallationsItemAccess_tokensRequestBuilder instantiates a new InstallationsItemAccess_tokensRequestBuilder and sets the default values. +func NewInstallationsItemAccess_tokensRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsItemAccess_tokensRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationsItemAccess_tokensRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access.Optionally, you can use the `repositories` or `repository_ids` body parameters to specify individual repositories that the installation access token can access. If you don't use `repositories` or `repository_ids` to grant access to specific repositories, the installation access token will have access to all repositories that the installation was granted access to. The installation access token cannot be granted access to repositories that the installation was not granted access to. Up to 500 repositories can be listed in this manner.Optionally, use the `permissions` body parameter to specify the permissions that the installation access token should have. If `permissions` is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted.When using the repository or permission parameters to reduce the access of the token, the complexity of the token is increased due to both the number of permissions in the request and the number of repositories the token will have access to. If the complexity is too large, the token will fail to be issued. If this occurs, the error message will indicate the maximum number of repositories that should be requested. For the average application requesting 8 permissions, this limit is around 5000 repositories. With fewer permissions requested, more repositories are supported.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a InstallationTokenable 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 +// 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] +// +// [API method documentation]: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app +func (m *InstallationsItemAccess_tokensRequestBuilder) Post(ctx context.Context, body InstallationsItemAccess_tokensPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InstallationTokenable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateInstallationTokenFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InstallationTokenable), nil +} +// ToPostRequestInformation creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access.Optionally, you can use the `repositories` or `repository_ids` body parameters to specify individual repositories that the installation access token can access. If you don't use `repositories` or `repository_ids` to grant access to specific repositories, the installation access token will have access to all repositories that the installation was granted access to. The installation access token cannot be granted access to repositories that the installation was not granted access to. Up to 500 repositories can be listed in this manner.Optionally, use the `permissions` body parameter to specify the permissions that the installation access token should have. If `permissions` is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted.When using the repository or permission parameters to reduce the access of the token, the complexity of the token is increased due to both the number of permissions in the request and the number of repositories the token will have access to. If the complexity is too large, the token will fail to be issued. If this occurs, the error message will indicate the maximum number of repositories that should be requested. For the average application requesting 8 permissions, this limit is around 5000 repositories. With fewer permissions requested, more repositories are supported.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *InstallationsItemAccess_tokensRequestBuilder) ToPostRequestInformation(ctx context.Context, body InstallationsItemAccess_tokensPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *InstallationsItemAccess_tokensRequestBuilder when successful +func (m *InstallationsItemAccess_tokensRequestBuilder) WithUrl(rawUrl string)(*InstallationsItemAccess_tokensRequestBuilder) { + return NewInstallationsItemAccess_tokensRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/app/installations_item_suspended_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/app/installations_item_suspended_request_builder.go new file mode 100644 index 000000000..fb2c9e143 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/app/installations_item_suspended_request_builder.go @@ -0,0 +1,84 @@ +package app + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// InstallationsItemSuspendedRequestBuilder builds and executes requests for operations under \app\installations\{installation_id}\suspended +type InstallationsItemSuspendedRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewInstallationsItemSuspendedRequestBuilderInternal instantiates a new InstallationsItemSuspendedRequestBuilder and sets the default values. +func NewInstallationsItemSuspendedRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsItemSuspendedRequestBuilder) { + m := &InstallationsItemSuspendedRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/installations/{installation_id}/suspended", pathParameters), + } + return m +} +// NewInstallationsItemSuspendedRequestBuilder instantiates a new InstallationsItemSuspendedRequestBuilder and sets the default values. +func NewInstallationsItemSuspendedRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsItemSuspendedRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationsItemSuspendedRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a GitHub App installation suspension.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation +func (m *InstallationsItemSuspendedRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/apps#suspend-an-app-installation +func (m *InstallationsItemSuspendedRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a GitHub App installation suspension.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *InstallationsItemSuspendedRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *InstallationsItemSuspendedRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *InstallationsItemSuspendedRequestBuilder when successful +func (m *InstallationsItemSuspendedRequestBuilder) WithUrl(rawUrl string)(*InstallationsItemSuspendedRequestBuilder) { + return NewInstallationsItemSuspendedRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/app/installations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/app/installations_request_builder.go new file mode 100644 index 000000000..c398ad5a7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/app/installations_request_builder.go @@ -0,0 +1,82 @@ +package app + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// InstallationsRequestBuilder builds and executes requests for operations under \app\installations +type InstallationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// InstallationsRequestBuilderGetQueryParameters the permissions the installation has are included under the `permissions` key.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +type InstallationsRequestBuilderGetQueryParameters struct { + Outdated *string `uriparametername:"outdated"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` +} +// ByInstallation_id gets an item from the github.com/octokit/go-sdk/pkg/github.app.installations.item collection +// returns a *InstallationsWithInstallation_ItemRequestBuilder when successful +func (m *InstallationsRequestBuilder) ByInstallation_id(installation_id int32)(*InstallationsWithInstallation_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["installation_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(installation_id), 10) + return NewInstallationsWithInstallation_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewInstallationsRequestBuilderInternal instantiates a new InstallationsRequestBuilder and sets the default values. +func NewInstallationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsRequestBuilder) { + m := &InstallationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/installations{?outdated*,page*,per_page*,since*}", pathParameters), + } + return m +} +// NewInstallationsRequestBuilder instantiates a new InstallationsRequestBuilder and sets the default values. +func NewInstallationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get the permissions the installation has are included under the `permissions` key.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a []Installationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app +func (m *InstallationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[InstallationsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateInstallationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable) + } + } + return val, nil +} +// ToGetRequestInformation the permissions the installation has are included under the `permissions` key.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *InstallationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[InstallationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *InstallationsRequestBuilder when successful +func (m *InstallationsRequestBuilder) WithUrl(rawUrl string)(*InstallationsRequestBuilder) { + return NewInstallationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/app/installations_with_installation_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/app/installations_with_installation_item_request_builder.go new file mode 100644 index 000000000..fbcaf9e4c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/app/installations_with_installation_item_request_builder.go @@ -0,0 +1,98 @@ +package app + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// InstallationsWithInstallation_ItemRequestBuilder builds and executes requests for operations under \app\installations\{installation_id} +type InstallationsWithInstallation_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Access_tokens the access_tokens property +// returns a *InstallationsItemAccess_tokensRequestBuilder when successful +func (m *InstallationsWithInstallation_ItemRequestBuilder) Access_tokens()(*InstallationsItemAccess_tokensRequestBuilder) { + return NewInstallationsItemAccess_tokensRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewInstallationsWithInstallation_ItemRequestBuilderInternal instantiates a new InstallationsWithInstallation_ItemRequestBuilder and sets the default values. +func NewInstallationsWithInstallation_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsWithInstallation_ItemRequestBuilder) { + m := &InstallationsWithInstallation_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/installations/{installation_id}", pathParameters), + } + return m +} +// NewInstallationsWithInstallation_ItemRequestBuilder instantiates a new InstallationsWithInstallation_ItemRequestBuilder and sets the default values. +func NewInstallationsWithInstallation_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsWithInstallation_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationsWithInstallation_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app +func (m *InstallationsWithInstallation_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get enables an authenticated GitHub App to find an installation's information using the installation id.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a Installationable 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/apps/apps#get-an-installation-for-the-authenticated-app +func (m *InstallationsWithInstallation_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateInstallationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable), nil +} +// Suspended the suspended property +// returns a *InstallationsItemSuspendedRequestBuilder when successful +func (m *InstallationsWithInstallation_ItemRequestBuilder) Suspended()(*InstallationsItemSuspendedRequestBuilder) { + return NewInstallationsItemSuspendedRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *InstallationsWithInstallation_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation enables an authenticated GitHub App to find an installation's information using the installation id.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *InstallationsWithInstallation_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *InstallationsWithInstallation_ItemRequestBuilder when successful +func (m *InstallationsWithInstallation_ItemRequestBuilder) WithUrl(rawUrl string)(*InstallationsWithInstallation_ItemRequestBuilder) { + return NewInstallationsWithInstallation_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/applications/applications_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/applications/applications_request_builder.go new file mode 100644 index 000000000..598c53e10 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/applications/applications_request_builder.go @@ -0,0 +1,35 @@ +package applications + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ApplicationsRequestBuilder builds and executes requests for operations under \applications +type ApplicationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByClient_id gets an item from the github.com/octokit/go-sdk/pkg/github.applications.item collection +// returns a *WithClient_ItemRequestBuilder when successful +func (m *ApplicationsRequestBuilder) ByClient_id(client_id string)(*WithClient_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if client_id != "" { + urlTplParams["client_id"] = client_id + } + return NewWithClient_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewApplicationsRequestBuilderInternal instantiates a new ApplicationsRequestBuilder and sets the default values. +func NewApplicationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApplicationsRequestBuilder) { + m := &ApplicationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/applications", pathParameters), + } + return m +} +// NewApplicationsRequestBuilder instantiates a new ApplicationsRequestBuilder and sets the default values. +func NewApplicationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApplicationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewApplicationsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_grant_delete_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_grant_delete_request_body.go new file mode 100644 index 000000000..e99421794 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_grant_delete_request_body.go @@ -0,0 +1,80 @@ +package applications + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemGrantDeleteRequestBody struct { + // The OAuth access token used to authenticate to the GitHub API. + access_token *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemGrantDeleteRequestBody instantiates a new ItemGrantDeleteRequestBody and sets the default values. +func NewItemGrantDeleteRequestBody()(*ItemGrantDeleteRequestBody) { + m := &ItemGrantDeleteRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemGrantDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemGrantDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemGrantDeleteRequestBody(), nil +} +// GetAccessToken gets the access_token property value. The OAuth access token used to authenticate to the GitHub API. +// returns a *string when successful +func (m *ItemGrantDeleteRequestBody) GetAccessToken()(*string) { + return m.access_token +} +// 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 *ItemGrantDeleteRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemGrantDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["access_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAccessToken(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemGrantDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("access_token", m.GetAccessToken()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccessToken sets the access_token property value. The OAuth access token used to authenticate to the GitHub API. +func (m *ItemGrantDeleteRequestBody) SetAccessToken(value *string)() { + m.access_token = value +} +// 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 *ItemGrantDeleteRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemGrantDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessToken()(*string) + SetAccessToken(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_grant_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_grant_request_builder.go new file mode 100644 index 000000000..0ded22a6e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_grant_request_builder.go @@ -0,0 +1,61 @@ +package applications + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemGrantRequestBuilder builds and executes requests for operations under \applications\{client_id}\grant +type ItemGrantRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemGrantRequestBuilderInternal instantiates a new ItemGrantRequestBuilder and sets the default values. +func NewItemGrantRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemGrantRequestBuilder) { + m := &ItemGrantRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/applications/{client_id}/grant", pathParameters), + } + return m +} +// NewItemGrantRequestBuilder instantiates a new ItemGrantRequestBuilder and sets the default values. +func NewItemGrantRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemGrantRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemGrantRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete oAuth and GitHub application owners can revoke a grant for their application and a specific user. You must provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted.Deleting an application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization +func (m *ItemGrantRequestBuilder) Delete(ctx context.Context, body ItemGrantDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation oAuth and GitHub application owners can revoke a grant for their application and a specific user. You must provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted.Deleting an application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). +// returns a *RequestInformation when successful +func (m *ItemGrantRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ItemGrantDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemGrantRequestBuilder when successful +func (m *ItemGrantRequestBuilder) WithUrl(rawUrl string)(*ItemGrantRequestBuilder) { + return NewItemGrantRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_delete_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_delete_request_body.go new file mode 100644 index 000000000..3e3ee81c9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_delete_request_body.go @@ -0,0 +1,80 @@ +package applications + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTokenDeleteRequestBody struct { + // The OAuth access token used to authenticate to the GitHub API. + access_token *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemTokenDeleteRequestBody instantiates a new ItemTokenDeleteRequestBody and sets the default values. +func NewItemTokenDeleteRequestBody()(*ItemTokenDeleteRequestBody) { + m := &ItemTokenDeleteRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTokenDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTokenDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTokenDeleteRequestBody(), nil +} +// GetAccessToken gets the access_token property value. The OAuth access token used to authenticate to the GitHub API. +// returns a *string when successful +func (m *ItemTokenDeleteRequestBody) GetAccessToken()(*string) { + return m.access_token +} +// 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 *ItemTokenDeleteRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTokenDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["access_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAccessToken(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemTokenDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("access_token", m.GetAccessToken()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccessToken sets the access_token property value. The OAuth access token used to authenticate to the GitHub API. +func (m *ItemTokenDeleteRequestBody) SetAccessToken(value *string)() { + m.access_token = value +} +// 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 *ItemTokenDeleteRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemTokenDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessToken()(*string) + SetAccessToken(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_patch_request_body.go new file mode 100644 index 000000000..4119cfaee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_patch_request_body.go @@ -0,0 +1,80 @@ +package applications + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTokenPatchRequestBody struct { + // The access_token of the OAuth or GitHub application. + access_token *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemTokenPatchRequestBody instantiates a new ItemTokenPatchRequestBody and sets the default values. +func NewItemTokenPatchRequestBody()(*ItemTokenPatchRequestBody) { + m := &ItemTokenPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTokenPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTokenPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTokenPatchRequestBody(), nil +} +// GetAccessToken gets the access_token property value. The access_token of the OAuth or GitHub application. +// returns a *string when successful +func (m *ItemTokenPatchRequestBody) GetAccessToken()(*string) { + return m.access_token +} +// 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 *ItemTokenPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTokenPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["access_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAccessToken(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemTokenPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("access_token", m.GetAccessToken()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccessToken sets the access_token property value. The access_token of the OAuth or GitHub application. +func (m *ItemTokenPatchRequestBody) SetAccessToken(value *string)() { + m.access_token = value +} +// 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 *ItemTokenPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemTokenPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessToken()(*string) + SetAccessToken(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_post_request_body.go new file mode 100644 index 000000000..fc2a4c5f9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_post_request_body.go @@ -0,0 +1,80 @@ +package applications + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTokenPostRequestBody struct { + // The access_token of the OAuth or GitHub application. + access_token *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemTokenPostRequestBody instantiates a new ItemTokenPostRequestBody and sets the default values. +func NewItemTokenPostRequestBody()(*ItemTokenPostRequestBody) { + m := &ItemTokenPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTokenPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTokenPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTokenPostRequestBody(), nil +} +// GetAccessToken gets the access_token property value. The access_token of the OAuth or GitHub application. +// returns a *string when successful +func (m *ItemTokenPostRequestBody) GetAccessToken()(*string) { + return m.access_token +} +// 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 *ItemTokenPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTokenPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["access_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAccessToken(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemTokenPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("access_token", m.GetAccessToken()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccessToken sets the access_token property value. The access_token of the OAuth or GitHub application. +func (m *ItemTokenPostRequestBody) SetAccessToken(value *string)() { + m.access_token = value +} +// 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 *ItemTokenPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemTokenPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessToken()(*string) + SetAccessToken(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_request_builder.go new file mode 100644 index 000000000..98fd50562 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_request_builder.go @@ -0,0 +1,138 @@ +package applications + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemTokenRequestBuilder builds and executes requests for operations under \applications\{client_id}\token +type ItemTokenRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTokenRequestBuilderInternal instantiates a new ItemTokenRequestBuilder and sets the default values. +func NewItemTokenRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTokenRequestBuilder) { + m := &ItemTokenRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/applications/{client_id}/token", pathParameters), + } + return m +} +// NewItemTokenRequestBuilder instantiates a new ItemTokenRequestBuilder and sets the default values. +func NewItemTokenRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTokenRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTokenRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete oAuth or GitHub application owners can revoke a single token for an OAuth application or a GitHub application with an OAuth authorization. +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-token +func (m *ItemTokenRequestBuilder) Delete(ctx context.Context, body ItemTokenDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Patch oAuth applications and GitHub applications with OAuth authorizations can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. Invalid tokens will return `404 NOT FOUND`. +// returns a Authorizationable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/oauth-applications#reset-a-token +func (m *ItemTokenRequestBuilder) Patch(ctx context.Context, body ItemTokenPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Authorizationable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAuthorizationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Authorizationable), nil +} +// Post oAuth applications and GitHub applications with OAuth authorizations can use this API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. Invalid tokens will return `404 NOT FOUND`. +// returns a Authorizationable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/oauth-applications#check-a-token +func (m *ItemTokenRequestBuilder) Post(ctx context.Context, body ItemTokenPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Authorizationable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAuthorizationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Authorizationable), nil +} +// Scoped the scoped property +// returns a *ItemTokenScopedRequestBuilder when successful +func (m *ItemTokenRequestBuilder) Scoped()(*ItemTokenScopedRequestBuilder) { + return NewItemTokenScopedRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation oAuth or GitHub application owners can revoke a single token for an OAuth application or a GitHub application with an OAuth authorization. +// returns a *RequestInformation when successful +func (m *ItemTokenRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ItemTokenDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPatchRequestInformation oAuth applications and GitHub applications with OAuth authorizations can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. Invalid tokens will return `404 NOT FOUND`. +// returns a *RequestInformation when successful +func (m *ItemTokenRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemTokenPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPostRequestInformation oAuth applications and GitHub applications with OAuth authorizations can use this API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. Invalid tokens will return `404 NOT FOUND`. +// returns a *RequestInformation when successful +func (m *ItemTokenRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemTokenPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTokenRequestBuilder when successful +func (m *ItemTokenRequestBuilder) WithUrl(rawUrl string)(*ItemTokenRequestBuilder) { + return NewItemTokenRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_scoped_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_scoped_post_request_body.go new file mode 100644 index 000000000..117e00cbc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_scoped_post_request_body.go @@ -0,0 +1,238 @@ +package applications + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemTokenScopedPostRequestBody struct { + // The access token used to authenticate to the GitHub API. + access_token *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The permissions granted to the user access token. + permissions i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AppPermissionsable + // The list of repository names to scope the user access token to. `repositories` may not be specified if `repository_ids` is specified. + repositories []string + // The list of repository IDs to scope the user access token to. `repository_ids` may not be specified if `repositories` is specified. + repository_ids []int32 + // The name of the user or organization to scope the user access token to. **Required** unless `target_id` is specified. + target *string + // The ID of the user or organization to scope the user access token to. **Required** unless `target` is specified. + target_id *int32 +} +// NewItemTokenScopedPostRequestBody instantiates a new ItemTokenScopedPostRequestBody and sets the default values. +func NewItemTokenScopedPostRequestBody()(*ItemTokenScopedPostRequestBody) { + m := &ItemTokenScopedPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTokenScopedPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTokenScopedPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTokenScopedPostRequestBody(), nil +} +// GetAccessToken gets the access_token property value. The access token used to authenticate to the GitHub API. +// returns a *string when successful +func (m *ItemTokenScopedPostRequestBody) GetAccessToken()(*string) { + return m.access_token +} +// 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 *ItemTokenScopedPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTokenScopedPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["access_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAccessToken(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAppPermissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AppPermissionsable)) + } + return nil + } + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRepositories(res) + } + return nil + } + res["repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetRepositoryIds(res) + } + return nil + } + res["target"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTarget(val) + } + return nil + } + res["target_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTargetId(val) + } + return nil + } + return res +} +// GetPermissions gets the permissions property value. The permissions granted to the user access token. +// returns a AppPermissionsable when successful +func (m *ItemTokenScopedPostRequestBody) GetPermissions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AppPermissionsable) { + return m.permissions +} +// GetRepositories gets the repositories property value. The list of repository names to scope the user access token to. `repositories` may not be specified if `repository_ids` is specified. +// returns a []string when successful +func (m *ItemTokenScopedPostRequestBody) GetRepositories()([]string) { + return m.repositories +} +// GetRepositoryIds gets the repository_ids property value. The list of repository IDs to scope the user access token to. `repository_ids` may not be specified if `repositories` is specified. +// returns a []int32 when successful +func (m *ItemTokenScopedPostRequestBody) GetRepositoryIds()([]int32) { + return m.repository_ids +} +// GetTarget gets the target property value. The name of the user or organization to scope the user access token to. **Required** unless `target_id` is specified. +// returns a *string when successful +func (m *ItemTokenScopedPostRequestBody) GetTarget()(*string) { + return m.target +} +// GetTargetId gets the target_id property value. The ID of the user or organization to scope the user access token to. **Required** unless `target` is specified. +// returns a *int32 when successful +func (m *ItemTokenScopedPostRequestBody) GetTargetId()(*int32) { + return m.target_id +} +// Serialize serializes information the current object +func (m *ItemTokenScopedPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("access_token", m.GetAccessToken()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + if m.GetRepositories() != nil { + err := writer.WriteCollectionOfStringValues("repositories", m.GetRepositories()) + if err != nil { + return err + } + } + if m.GetRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("repository_ids", m.GetRepositoryIds()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target", m.GetTarget()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("target_id", m.GetTargetId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccessToken sets the access_token property value. The access token used to authenticate to the GitHub API. +func (m *ItemTokenScopedPostRequestBody) SetAccessToken(value *string)() { + m.access_token = value +} +// 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 *ItemTokenScopedPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPermissions sets the permissions property value. The permissions granted to the user access token. +func (m *ItemTokenScopedPostRequestBody) SetPermissions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AppPermissionsable)() { + m.permissions = value +} +// SetRepositories sets the repositories property value. The list of repository names to scope the user access token to. `repositories` may not be specified if `repository_ids` is specified. +func (m *ItemTokenScopedPostRequestBody) SetRepositories(value []string)() { + m.repositories = value +} +// SetRepositoryIds sets the repository_ids property value. The list of repository IDs to scope the user access token to. `repository_ids` may not be specified if `repositories` is specified. +func (m *ItemTokenScopedPostRequestBody) SetRepositoryIds(value []int32)() { + m.repository_ids = value +} +// SetTarget sets the target property value. The name of the user or organization to scope the user access token to. **Required** unless `target_id` is specified. +func (m *ItemTokenScopedPostRequestBody) SetTarget(value *string)() { + m.target = value +} +// SetTargetId sets the target_id property value. The ID of the user or organization to scope the user access token to. **Required** unless `target` is specified. +func (m *ItemTokenScopedPostRequestBody) SetTargetId(value *int32)() { + m.target_id = value +} +type ItemTokenScopedPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessToken()(*string) + GetPermissions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AppPermissionsable) + GetRepositories()([]string) + GetRepositoryIds()([]int32) + GetTarget()(*string) + GetTargetId()(*int32) + SetAccessToken(value *string)() + SetPermissions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AppPermissionsable)() + SetRepositories(value []string)() + SetRepositoryIds(value []int32)() + SetTarget(value *string)() + SetTargetId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_scoped_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_scoped_request_builder.go new file mode 100644 index 000000000..197c0545e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/applications/item_token_scoped_request_builder.go @@ -0,0 +1,71 @@ +package applications + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemTokenScopedRequestBuilder builds and executes requests for operations under \applications\{client_id}\token\scoped +type ItemTokenScopedRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTokenScopedRequestBuilderInternal instantiates a new ItemTokenScopedRequestBuilder and sets the default values. +func NewItemTokenScopedRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTokenScopedRequestBuilder) { + m := &ItemTokenScopedRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/applications/{client_id}/token/scoped", pathParameters), + } + return m +} +// NewItemTokenScopedRequestBuilder instantiates a new ItemTokenScopedRequestBuilder and sets the default values. +func NewItemTokenScopedRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTokenScopedRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTokenScopedRequestBuilderInternal(urlParams, requestAdapter) +} +// Post use a non-scoped user access token to create a repository-scoped and/or permission-scoped user access token. You can specifywhich repositories the token can access and which permissions are granted to thetoken.Invalid tokens will return `404 NOT FOUND`. +// returns a Authorizationable 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 +// 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] +// +// [API method documentation]: https://docs.github.com/rest/apps/apps#create-a-scoped-access-token +func (m *ItemTokenScopedRequestBuilder) Post(ctx context.Context, body ItemTokenScopedPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Authorizationable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAuthorizationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Authorizationable), nil +} +// ToPostRequestInformation use a non-scoped user access token to create a repository-scoped and/or permission-scoped user access token. You can specifywhich repositories the token can access and which permissions are granted to thetoken.Invalid tokens will return `404 NOT FOUND`. +// returns a *RequestInformation when successful +func (m *ItemTokenScopedRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemTokenScopedPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTokenScopedRequestBuilder when successful +func (m *ItemTokenScopedRequestBuilder) WithUrl(rawUrl string)(*ItemTokenScopedRequestBuilder) { + return NewItemTokenScopedRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/applications/with_client_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/applications/with_client_item_request_builder.go new file mode 100644 index 000000000..8867db6cb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/applications/with_client_item_request_builder.go @@ -0,0 +1,33 @@ +package applications + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// WithClient_ItemRequestBuilder builds and executes requests for operations under \applications\{client_id} +type WithClient_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithClient_ItemRequestBuilderInternal instantiates a new WithClient_ItemRequestBuilder and sets the default values. +func NewWithClient_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithClient_ItemRequestBuilder) { + m := &WithClient_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/applications/{client_id}", pathParameters), + } + return m +} +// NewWithClient_ItemRequestBuilder instantiates a new WithClient_ItemRequestBuilder and sets the default values. +func NewWithClient_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithClient_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithClient_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Grant the grant property +// returns a *ItemGrantRequestBuilder when successful +func (m *WithClient_ItemRequestBuilder) Grant()(*ItemGrantRequestBuilder) { + return NewItemGrantRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Token the token property +// returns a *ItemTokenRequestBuilder when successful +func (m *WithClient_ItemRequestBuilder) Token()(*ItemTokenRequestBuilder) { + return NewItemTokenRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/appmanifests/app_manifests_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/appmanifests/app_manifests_request_builder.go new file mode 100644 index 000000000..33b174927 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/appmanifests/app_manifests_request_builder.go @@ -0,0 +1,35 @@ +package appmanifests + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// AppManifestsRequestBuilder builds and executes requests for operations under \app-manifests +type AppManifestsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByCode gets an item from the github.com/octokit/go-sdk/pkg/github.appManifests.item collection +// returns a *WithCodeItemRequestBuilder when successful +func (m *AppManifestsRequestBuilder) ByCode(code string)(*WithCodeItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if code != "" { + urlTplParams["code"] = code + } + return NewWithCodeItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewAppManifestsRequestBuilderInternal instantiates a new AppManifestsRequestBuilder and sets the default values. +func NewAppManifestsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AppManifestsRequestBuilder) { + m := &AppManifestsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app-manifests", pathParameters), + } + return m +} +// NewAppManifestsRequestBuilder instantiates a new AppManifestsRequestBuilder and sets the default values. +func NewAppManifestsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AppManifestsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAppManifestsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/appmanifests/item_conversions_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/appmanifests/item_conversions_post_response.go new file mode 100644 index 000000000..00cda020c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/appmanifests/item_conversions_post_response.go @@ -0,0 +1,40 @@ +package appmanifests + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemConversionsPostResponse struct { + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integration +} +// NewItemConversionsPostResponse instantiates a new ItemConversionsPostResponse and sets the default values. +func NewItemConversionsPostResponse()(*ItemConversionsPostResponse) { + m := &ItemConversionsPostResponse{ + Integration: *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.NewIntegration(), + } + return m +} +// CreateItemConversionsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemConversionsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemConversionsPostResponse(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemConversionsPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := m.Integration.GetFieldDeserializers() + return res +} +// Serialize serializes information the current object +func (m *ItemConversionsPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + err := m.Integration.Serialize(writer) + if err != nil { + return err + } + return nil +} +type ItemConversionsPostResponseable interface { + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integrationable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/appmanifests/item_conversions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/appmanifests/item_conversions_request_builder.go new file mode 100644 index 000000000..1ddc81709 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/appmanifests/item_conversions_request_builder.go @@ -0,0 +1,63 @@ +package appmanifests + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemConversionsRequestBuilder builds and executes requests for operations under \app-manifests\{code}\conversions +type ItemConversionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemConversionsRequestBuilderInternal instantiates a new ItemConversionsRequestBuilder and sets the default values. +func NewItemConversionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemConversionsRequestBuilder) { + m := &ItemConversionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app-manifests/{code}/conversions", pathParameters), + } + return m +} +// NewItemConversionsRequestBuilder instantiates a new ItemConversionsRequestBuilder and sets the default values. +func NewItemConversionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemConversionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemConversionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`. +// returns a ItemConversionsPostResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest +func (m *ItemConversionsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemConversionsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemConversionsPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemConversionsPostResponseable), nil +} +// ToPostRequestInformation use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`. +// returns a *RequestInformation when successful +func (m *ItemConversionsRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemConversionsRequestBuilder when successful +func (m *ItemConversionsRequestBuilder) WithUrl(rawUrl string)(*ItemConversionsRequestBuilder) { + return NewItemConversionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/appmanifests/item_conversions_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/appmanifests/item_conversions_response.go new file mode 100644 index 000000000..58632ce37 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/appmanifests/item_conversions_response.go @@ -0,0 +1,28 @@ +package appmanifests + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemConversionsResponse +// Deprecated: This class is obsolete. Use conversionsPostResponse instead. +type ItemConversionsResponse struct { + ItemConversionsPostResponse +} +// NewItemConversionsResponse instantiates a new ItemConversionsResponse and sets the default values. +func NewItemConversionsResponse()(*ItemConversionsResponse) { + m := &ItemConversionsResponse{ + ItemConversionsPostResponse: *NewItemConversionsPostResponse(), + } + return m +} +// CreateItemConversionsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemConversionsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemConversionsResponse(), nil +} +// ItemConversionsResponseable +// Deprecated: This class is obsolete. Use conversionsPostResponse instead. +type ItemConversionsResponseable interface { + ItemConversionsPostResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/appmanifests/with_code_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/appmanifests/with_code_item_request_builder.go new file mode 100644 index 000000000..4748a6bfe --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/appmanifests/with_code_item_request_builder.go @@ -0,0 +1,28 @@ +package appmanifests + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// WithCodeItemRequestBuilder builds and executes requests for operations under \app-manifests\{code} +type WithCodeItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithCodeItemRequestBuilderInternal instantiates a new WithCodeItemRequestBuilder and sets the default values. +func NewWithCodeItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithCodeItemRequestBuilder) { + m := &WithCodeItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app-manifests/{code}", pathParameters), + } + return m +} +// NewWithCodeItemRequestBuilder instantiates a new WithCodeItemRequestBuilder and sets the default values. +func NewWithCodeItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithCodeItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithCodeItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Conversions the conversions property +// returns a *ItemConversionsRequestBuilder when successful +func (m *WithCodeItemRequestBuilder) Conversions()(*ItemConversionsRequestBuilder) { + return NewItemConversionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/apps/apps_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/apps/apps_request_builder.go new file mode 100644 index 000000000..d499860d8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/apps/apps_request_builder.go @@ -0,0 +1,35 @@ +package apps + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// AppsRequestBuilder builds and executes requests for operations under \apps +type AppsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByApp_slug gets an item from the github.com/octokit/go-sdk/pkg/github.apps.item collection +// returns a *WithApp_slugItemRequestBuilder when successful +func (m *AppsRequestBuilder) ByApp_slug(app_slug string)(*WithApp_slugItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if app_slug != "" { + urlTplParams["app_slug"] = app_slug + } + return NewWithApp_slugItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewAppsRequestBuilderInternal instantiates a new AppsRequestBuilder and sets the default values. +func NewAppsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AppsRequestBuilder) { + m := &AppsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/apps", pathParameters), + } + return m +} +// NewAppsRequestBuilder instantiates a new AppsRequestBuilder and sets the default values. +func NewAppsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AppsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAppsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/apps/with_app_slug_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/apps/with_app_slug_item_request_builder.go new file mode 100644 index 000000000..5c6687709 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/apps/with_app_slug_item_request_builder.go @@ -0,0 +1,63 @@ +package apps + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// WithApp_slugItemRequestBuilder builds and executes requests for operations under \apps\{app_slug} +type WithApp_slugItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithApp_slugItemRequestBuilderInternal instantiates a new WithApp_slugItemRequestBuilder and sets the default values. +func NewWithApp_slugItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithApp_slugItemRequestBuilder) { + m := &WithApp_slugItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/apps/{app_slug}", pathParameters), + } + return m +} +// NewWithApp_slugItemRequestBuilder instantiates a new WithApp_slugItemRequestBuilder and sets the default values. +func NewWithApp_slugItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithApp_slugItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithApp_slugItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Note**: The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`). +// returns a Integrationable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/apps#get-an-app +func (m *WithApp_slugItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integrationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIntegrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integrationable), nil +} +// ToGetRequestInformation **Note**: The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`). +// returns a *RequestInformation when successful +func (m *WithApp_slugItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *WithApp_slugItemRequestBuilder when successful +func (m *WithApp_slugItemRequestBuilder) WithUrl(rawUrl string)(*WithApp_slugItemRequestBuilder) { + return NewWithApp_slugItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/assignments/assignments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/assignments/assignments_request_builder.go new file mode 100644 index 000000000..0489542fe --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/assignments/assignments_request_builder.go @@ -0,0 +1,34 @@ +package assignments + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// AssignmentsRequestBuilder builds and executes requests for operations under \assignments +type AssignmentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByAssignment_id gets an item from the github.com/octokit/go-sdk/pkg/github.assignments.item collection +// returns a *WithAssignment_ItemRequestBuilder when successful +func (m *AssignmentsRequestBuilder) ByAssignment_id(assignment_id int32)(*WithAssignment_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["assignment_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(assignment_id), 10) + return NewWithAssignment_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewAssignmentsRequestBuilderInternal instantiates a new AssignmentsRequestBuilder and sets the default values. +func NewAssignmentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AssignmentsRequestBuilder) { + m := &AssignmentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/assignments", pathParameters), + } + return m +} +// NewAssignmentsRequestBuilder instantiates a new AssignmentsRequestBuilder and sets the default values. +func NewAssignmentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AssignmentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAssignmentsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/assignments/item_accepted_assignments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/assignments/item_accepted_assignments_request_builder.go new file mode 100644 index 000000000..445d28769 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/assignments/item_accepted_assignments_request_builder.go @@ -0,0 +1,67 @@ +package assignments + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemAccepted_assignmentsRequestBuilder builds and executes requests for operations under \assignments\{assignment_id}\accepted_assignments +type ItemAccepted_assignmentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemAccepted_assignmentsRequestBuilderGetQueryParameters lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. +type ItemAccepted_assignmentsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemAccepted_assignmentsRequestBuilderInternal instantiates a new ItemAccepted_assignmentsRequestBuilder and sets the default values. +func NewItemAccepted_assignmentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAccepted_assignmentsRequestBuilder) { + m := &ItemAccepted_assignmentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/assignments/{assignment_id}/accepted_assignments{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemAccepted_assignmentsRequestBuilder instantiates a new ItemAccepted_assignmentsRequestBuilder and sets the default values. +func NewItemAccepted_assignmentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAccepted_assignmentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemAccepted_assignmentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. +// returns a []ClassroomAcceptedAssignmentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/classroom/classroom#list-accepted-assignments-for-an-assignment +func (m *ItemAccepted_assignmentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemAccepted_assignmentsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ClassroomAcceptedAssignmentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateClassroomAcceptedAssignmentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ClassroomAcceptedAssignmentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ClassroomAcceptedAssignmentable) + } + } + return val, nil +} +// ToGetRequestInformation lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. +// returns a *RequestInformation when successful +func (m *ItemAccepted_assignmentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemAccepted_assignmentsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemAccepted_assignmentsRequestBuilder when successful +func (m *ItemAccepted_assignmentsRequestBuilder) WithUrl(rawUrl string)(*ItemAccepted_assignmentsRequestBuilder) { + return NewItemAccepted_assignmentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/assignments/item_grades_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/assignments/item_grades_request_builder.go new file mode 100644 index 000000000..e18f5f301 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/assignments/item_grades_request_builder.go @@ -0,0 +1,64 @@ +package assignments + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemGradesRequestBuilder builds and executes requests for operations under \assignments\{assignment_id}\grades +type ItemGradesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemGradesRequestBuilderInternal instantiates a new ItemGradesRequestBuilder and sets the default values. +func NewItemGradesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemGradesRequestBuilder) { + m := &ItemGradesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/assignments/{assignment_id}/grades", pathParameters), + } + return m +} +// NewItemGradesRequestBuilder instantiates a new ItemGradesRequestBuilder and sets the default values. +func NewItemGradesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemGradesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemGradesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets grades for a GitHub Classroom assignment. Grades will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. +// returns a []ClassroomAssignmentGradeable 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/classroom/classroom#get-assignment-grades +func (m *ItemGradesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ClassroomAssignmentGradeable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateClassroomAssignmentGradeFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ClassroomAssignmentGradeable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ClassroomAssignmentGradeable) + } + } + return val, nil +} +// ToGetRequestInformation gets grades for a GitHub Classroom assignment. Grades will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. +// returns a *RequestInformation when successful +func (m *ItemGradesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemGradesRequestBuilder when successful +func (m *ItemGradesRequestBuilder) WithUrl(rawUrl string)(*ItemGradesRequestBuilder) { + return NewItemGradesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/assignments/with_assignment_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/assignments/with_assignment_item_request_builder.go new file mode 100644 index 000000000..f52888b87 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/assignments/with_assignment_item_request_builder.go @@ -0,0 +1,71 @@ +package assignments + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// WithAssignment_ItemRequestBuilder builds and executes requests for operations under \assignments\{assignment_id} +type WithAssignment_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Accepted_assignments the accepted_assignments property +// returns a *ItemAccepted_assignmentsRequestBuilder when successful +func (m *WithAssignment_ItemRequestBuilder) Accepted_assignments()(*ItemAccepted_assignmentsRequestBuilder) { + return NewItemAccepted_assignmentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewWithAssignment_ItemRequestBuilderInternal instantiates a new WithAssignment_ItemRequestBuilder and sets the default values. +func NewWithAssignment_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithAssignment_ItemRequestBuilder) { + m := &WithAssignment_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/assignments/{assignment_id}", pathParameters), + } + return m +} +// NewWithAssignment_ItemRequestBuilder instantiates a new WithAssignment_ItemRequestBuilder and sets the default values. +func NewWithAssignment_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithAssignment_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithAssignment_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a GitHub Classroom assignment. Assignment will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. +// returns a ClassroomAssignmentable 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/classroom/classroom#get-an-assignment +func (m *WithAssignment_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ClassroomAssignmentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateClassroomAssignmentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ClassroomAssignmentable), nil +} +// Grades the grades property +// returns a *ItemGradesRequestBuilder when successful +func (m *WithAssignment_ItemRequestBuilder) Grades()(*ItemGradesRequestBuilder) { + return NewItemGradesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation gets a GitHub Classroom assignment. Assignment will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. +// returns a *RequestInformation when successful +func (m *WithAssignment_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *WithAssignment_ItemRequestBuilder when successful +func (m *WithAssignment_ItemRequestBuilder) WithUrl(rawUrl string)(*WithAssignment_ItemRequestBuilder) { + return NewWithAssignment_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/classrooms/classrooms_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/classrooms/classrooms_request_builder.go new file mode 100644 index 000000000..870198cbd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/classrooms/classrooms_request_builder.go @@ -0,0 +1,78 @@ +package classrooms + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ClassroomsRequestBuilder builds and executes requests for operations under \classrooms +type ClassroomsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ClassroomsRequestBuilderGetQueryParameters lists GitHub Classroom classrooms for the current user. Classrooms will only be returned if the current user is an administrator of one or more GitHub Classrooms. +type ClassroomsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByClassroom_id gets an item from the github.com/octokit/go-sdk/pkg/github.classrooms.item collection +// returns a *WithClassroom_ItemRequestBuilder when successful +func (m *ClassroomsRequestBuilder) ByClassroom_id(classroom_id int32)(*WithClassroom_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["classroom_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(classroom_id), 10) + return NewWithClassroom_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewClassroomsRequestBuilderInternal instantiates a new ClassroomsRequestBuilder and sets the default values. +func NewClassroomsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ClassroomsRequestBuilder) { + m := &ClassroomsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/classrooms{?page*,per_page*}", pathParameters), + } + return m +} +// NewClassroomsRequestBuilder instantiates a new ClassroomsRequestBuilder and sets the default values. +func NewClassroomsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ClassroomsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewClassroomsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists GitHub Classroom classrooms for the current user. Classrooms will only be returned if the current user is an administrator of one or more GitHub Classrooms. +// returns a []SimpleClassroomable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/classroom/classroom#list-classrooms +func (m *ClassroomsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ClassroomsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleClassroomable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleClassroomFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleClassroomable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleClassroomable) + } + } + return val, nil +} +// ToGetRequestInformation lists GitHub Classroom classrooms for the current user. Classrooms will only be returned if the current user is an administrator of one or more GitHub Classrooms. +// returns a *RequestInformation when successful +func (m *ClassroomsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ClassroomsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ClassroomsRequestBuilder when successful +func (m *ClassroomsRequestBuilder) WithUrl(rawUrl string)(*ClassroomsRequestBuilder) { + return NewClassroomsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/classrooms/item_assignments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/classrooms/item_assignments_request_builder.go new file mode 100644 index 000000000..7b801c546 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/classrooms/item_assignments_request_builder.go @@ -0,0 +1,67 @@ +package classrooms + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemAssignmentsRequestBuilder builds and executes requests for operations under \classrooms\{classroom_id}\assignments +type ItemAssignmentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemAssignmentsRequestBuilderGetQueryParameters lists GitHub Classroom assignments for a classroom. Assignments will only be returned if the current user is an administrator of the GitHub Classroom. +type ItemAssignmentsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemAssignmentsRequestBuilderInternal instantiates a new ItemAssignmentsRequestBuilder and sets the default values. +func NewItemAssignmentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAssignmentsRequestBuilder) { + m := &ItemAssignmentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/classrooms/{classroom_id}/assignments{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemAssignmentsRequestBuilder instantiates a new ItemAssignmentsRequestBuilder and sets the default values. +func NewItemAssignmentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAssignmentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemAssignmentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists GitHub Classroom assignments for a classroom. Assignments will only be returned if the current user is an administrator of the GitHub Classroom. +// returns a []SimpleClassroomAssignmentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/classroom/classroom#list-assignments-for-a-classroom +func (m *ItemAssignmentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemAssignmentsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleClassroomAssignmentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleClassroomAssignmentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleClassroomAssignmentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleClassroomAssignmentable) + } + } + return val, nil +} +// ToGetRequestInformation lists GitHub Classroom assignments for a classroom. Assignments will only be returned if the current user is an administrator of the GitHub Classroom. +// returns a *RequestInformation when successful +func (m *ItemAssignmentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemAssignmentsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemAssignmentsRequestBuilder when successful +func (m *ItemAssignmentsRequestBuilder) WithUrl(rawUrl string)(*ItemAssignmentsRequestBuilder) { + return NewItemAssignmentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/classrooms/with_classroom_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/classrooms/with_classroom_item_request_builder.go new file mode 100644 index 000000000..2284057fd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/classrooms/with_classroom_item_request_builder.go @@ -0,0 +1,66 @@ +package classrooms + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// WithClassroom_ItemRequestBuilder builds and executes requests for operations under \classrooms\{classroom_id} +type WithClassroom_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Assignments the assignments property +// returns a *ItemAssignmentsRequestBuilder when successful +func (m *WithClassroom_ItemRequestBuilder) Assignments()(*ItemAssignmentsRequestBuilder) { + return NewItemAssignmentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewWithClassroom_ItemRequestBuilderInternal instantiates a new WithClassroom_ItemRequestBuilder and sets the default values. +func NewWithClassroom_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithClassroom_ItemRequestBuilder) { + m := &WithClassroom_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/classrooms/{classroom_id}", pathParameters), + } + return m +} +// NewWithClassroom_ItemRequestBuilder instantiates a new WithClassroom_ItemRequestBuilder and sets the default values. +func NewWithClassroom_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithClassroom_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithClassroom_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a GitHub Classroom classroom for the current user. Classroom will only be returned if the current user is an administrator of the GitHub Classroom. +// returns a Classroomable 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/classroom/classroom#get-a-classroom +func (m *WithClassroom_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Classroomable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateClassroomFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Classroomable), nil +} +// ToGetRequestInformation gets a GitHub Classroom classroom for the current user. Classroom will only be returned if the current user is an administrator of the GitHub Classroom. +// returns a *RequestInformation when successful +func (m *WithClassroom_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *WithClassroom_ItemRequestBuilder when successful +func (m *WithClassroom_ItemRequestBuilder) WithUrl(rawUrl string)(*WithClassroom_ItemRequestBuilder) { + return NewWithClassroom_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/codes_of_conduct/codes_of_conduct_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/codes_of_conduct/codes_of_conduct_request_builder.go new file mode 100644 index 000000000..b9ef1fc17 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/codes_of_conduct/codes_of_conduct_request_builder.go @@ -0,0 +1,72 @@ +package codes_of_conduct + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// Codes_of_conductRequestBuilder builds and executes requests for operations under \codes_of_conduct +type Codes_of_conductRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByKey gets an item from the github.com/octokit/go-sdk/pkg/github.codes_of_conduct.item collection +// returns a *WithKeyItemRequestBuilder when successful +func (m *Codes_of_conductRequestBuilder) ByKey(key string)(*WithKeyItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if key != "" { + urlTplParams["key"] = key + } + return NewWithKeyItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewCodes_of_conductRequestBuilderInternal instantiates a new Codes_of_conductRequestBuilder and sets the default values. +func NewCodes_of_conductRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Codes_of_conductRequestBuilder) { + m := &Codes_of_conductRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/codes_of_conduct", pathParameters), + } + return m +} +// NewCodes_of_conductRequestBuilder instantiates a new Codes_of_conductRequestBuilder and sets the default values. +func NewCodes_of_conductRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Codes_of_conductRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCodes_of_conductRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns array of all GitHub's codes of conduct. +// returns a []CodeOfConductable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct +func (m *Codes_of_conductRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeOfConductable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeOfConductFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeOfConductable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeOfConductable) + } + } + return val, nil +} +// ToGetRequestInformation returns array of all GitHub's codes of conduct. +// returns a *RequestInformation when successful +func (m *Codes_of_conductRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *Codes_of_conductRequestBuilder when successful +func (m *Codes_of_conductRequestBuilder) WithUrl(rawUrl string)(*Codes_of_conductRequestBuilder) { + return NewCodes_of_conductRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/codes_of_conduct/with_key_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/codes_of_conduct/with_key_item_request_builder.go new file mode 100644 index 000000000..c02444077 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/codes_of_conduct/with_key_item_request_builder.go @@ -0,0 +1,61 @@ +package codes_of_conduct + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// WithKeyItemRequestBuilder builds and executes requests for operations under \codes_of_conduct\{key} +type WithKeyItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithKeyItemRequestBuilderInternal instantiates a new WithKeyItemRequestBuilder and sets the default values. +func NewWithKeyItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithKeyItemRequestBuilder) { + m := &WithKeyItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/codes_of_conduct/{key}", pathParameters), + } + return m +} +// NewWithKeyItemRequestBuilder instantiates a new WithKeyItemRequestBuilder and sets the default values. +func NewWithKeyItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithKeyItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithKeyItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns information about the specified GitHub code of conduct. +// returns a CodeOfConductable 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/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct +func (m *WithKeyItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeOfConductable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeOfConductFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeOfConductable), nil +} +// ToGetRequestInformation returns information about the specified GitHub code of conduct. +// returns a *RequestInformation when successful +func (m *WithKeyItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *WithKeyItemRequestBuilder when successful +func (m *WithKeyItemRequestBuilder) WithUrl(rawUrl string)(*WithKeyItemRequestBuilder) { + return NewWithKeyItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/emojis/emojis_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/emojis/emojis_get_response.go new file mode 100644 index 000000000..fa4455a2d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/emojis/emojis_get_response.go @@ -0,0 +1,51 @@ +package emojis + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EmojisGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewEmojisGetResponse instantiates a new EmojisGetResponse and sets the default values. +func NewEmojisGetResponse()(*EmojisGetResponse) { + m := &EmojisGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEmojisGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEmojisGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEmojisGetResponse(), 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 *EmojisGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EmojisGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *EmojisGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *EmojisGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type EmojisGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/emojis/emojis_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/emojis/emojis_request_builder.go new file mode 100644 index 000000000..927c1aee5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/emojis/emojis_request_builder.go @@ -0,0 +1,56 @@ +package emojis + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// EmojisRequestBuilder builds and executes requests for operations under \emojis +type EmojisRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewEmojisRequestBuilderInternal instantiates a new EmojisRequestBuilder and sets the default values. +func NewEmojisRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EmojisRequestBuilder) { + m := &EmojisRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/emojis", pathParameters), + } + return m +} +// NewEmojisRequestBuilder instantiates a new EmojisRequestBuilder and sets the default values. +func NewEmojisRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EmojisRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewEmojisRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all the emojis available to use on GitHub. +// returns a EmojisGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/emojis/emojis#get-emojis +func (m *EmojisRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(EmojisGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateEmojisGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(EmojisGetResponseable), nil +} +// ToGetRequestInformation lists all the emojis available to use on GitHub. +// returns a *RequestInformation when successful +func (m *EmojisRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *EmojisRequestBuilder when successful +func (m *EmojisRequestBuilder) WithUrl(rawUrl string)(*EmojisRequestBuilder) { + return NewEmojisRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/emojis/emojis_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/emojis/emojis_response.go new file mode 100644 index 000000000..b170a3216 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/emojis/emojis_response.go @@ -0,0 +1,28 @@ +package emojis + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// EmojisResponse +// Deprecated: This class is obsolete. Use emojisGetResponse instead. +type EmojisResponse struct { + EmojisGetResponse +} +// NewEmojisResponse instantiates a new emojisResponse and sets the default values. +func NewEmojisResponse()(*EmojisResponse) { + m := &EmojisResponse{ + EmojisGetResponse: *NewEmojisGetResponse(), + } + return m +} +// CreateEmojisResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateEmojisResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEmojisResponse(), nil +} +// EmojisResponseable +// Deprecated: This class is obsolete. Use emojisGetResponse instead. +type EmojisResponseable interface { + EmojisGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/enterprises_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/enterprises_request_builder.go new file mode 100644 index 000000000..9d8629855 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/enterprises_request_builder.go @@ -0,0 +1,35 @@ +package enterprises + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// EnterprisesRequestBuilder builds and executes requests for operations under \enterprises +type EnterprisesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByEnterprise gets an item from the github.com/octokit/go-sdk/pkg/github.enterprises.item collection +// returns a *WithEnterpriseItemRequestBuilder when successful +func (m *EnterprisesRequestBuilder) ByEnterprise(enterprise string)(*WithEnterpriseItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if enterprise != "" { + urlTplParams["enterprise"] = enterprise + } + return NewWithEnterpriseItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewEnterprisesRequestBuilderInternal instantiates a new EnterprisesRequestBuilder and sets the default values. +func NewEnterprisesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EnterprisesRequestBuilder) { + m := &EnterprisesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises", pathParameters), + } + return m +} +// NewEnterprisesRequestBuilder instantiates a new EnterprisesRequestBuilder and sets the default values. +func NewEnterprisesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EnterprisesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewEnterprisesRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/dependabot/alerts/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/dependabot/alerts/get_direction_query_parameter_type.go new file mode 100644 index 000000000..70606a8da --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/dependabot/alerts/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/dependabot/alerts/get_scope_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/dependabot/alerts/get_scope_query_parameter_type.go new file mode 100644 index 000000000..906bdb78d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/dependabot/alerts/get_scope_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetScopeQueryParameterType int + +const ( + DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE GetScopeQueryParameterType = iota + RUNTIME_GETSCOPEQUERYPARAMETERTYPE +) + +func (i GetScopeQueryParameterType) String() string { + return []string{"development", "runtime"}[i] +} +func ParseGetScopeQueryParameterType(v string) (any, error) { + result := DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE + switch v { + case "development": + result = DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE + case "runtime": + result = RUNTIME_GETSCOPEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetScopeQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetScopeQueryParameterType(values []GetScopeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetScopeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/dependabot/alerts/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/dependabot/alerts/get_sort_query_parameter_type.go new file mode 100644 index 000000000..bc094eda5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/dependabot/alerts/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/secretscanning/alerts/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/secretscanning/alerts/get_direction_query_parameter_type.go new file mode 100644 index 000000000..70606a8da --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/secretscanning/alerts/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/secretscanning/alerts/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/secretscanning/alerts/get_sort_query_parameter_type.go new file mode 100644 index 000000000..bc094eda5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/secretscanning/alerts/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/secretscanning/alerts/get_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/secretscanning/alerts/get_state_query_parameter_type.go new file mode 100644 index 000000000..382957f5c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item/secretscanning/alerts/get_state_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + RESOLVED_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "resolved"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "resolved": + result = RESOLVED_GETSTATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_copilot_billing_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_copilot_billing_request_builder.go new file mode 100644 index 000000000..3d4ee8be9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_copilot_billing_request_builder.go @@ -0,0 +1,28 @@ +package enterprises + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemCopilotBillingRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\copilot\billing +type ItemCopilotBillingRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCopilotBillingRequestBuilderInternal instantiates a new ItemCopilotBillingRequestBuilder and sets the default values. +func NewItemCopilotBillingRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotBillingRequestBuilder) { + m := &ItemCopilotBillingRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot/billing", pathParameters), + } + return m +} +// NewItemCopilotBillingRequestBuilder instantiates a new ItemCopilotBillingRequestBuilder and sets the default values. +func NewItemCopilotBillingRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotBillingRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCopilotBillingRequestBuilderInternal(urlParams, requestAdapter) +} +// Seats the seats property +// returns a *ItemCopilotBillingSeatsRequestBuilder when successful +func (m *ItemCopilotBillingRequestBuilder) Seats()(*ItemCopilotBillingSeatsRequestBuilder) { + return NewItemCopilotBillingSeatsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_copilot_billing_seats_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_copilot_billing_seats_get_response.go new file mode 100644 index 000000000..3e6c50e49 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_copilot_billing_seats_get_response.go @@ -0,0 +1,122 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemCopilotBillingSeatsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The seats property + seats []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable + // The total number of Copilot seats the enterprise is being billed for. Users with access through multiple organizations or enterprise teams are only counted once. + total_seats *int32 +} +// NewItemCopilotBillingSeatsGetResponse instantiates a new ItemCopilotBillingSeatsGetResponse and sets the default values. +func NewItemCopilotBillingSeatsGetResponse()(*ItemCopilotBillingSeatsGetResponse) { + m := &ItemCopilotBillingSeatsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCopilotBillingSeatsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCopilotBillingSeatsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCopilotBillingSeatsGetResponse(), 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 *ItemCopilotBillingSeatsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCopilotBillingSeatsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCopilotSeatDetailsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable) + } + } + m.SetSeats(res) + } + return nil + } + res["total_seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalSeats(val) + } + return nil + } + return res +} +// GetSeats gets the seats property value. The seats property +// returns a []CopilotSeatDetailsable when successful +func (m *ItemCopilotBillingSeatsGetResponse) GetSeats()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable) { + return m.seats +} +// GetTotalSeats gets the total_seats property value. The total number of Copilot seats the enterprise is being billed for. Users with access through multiple organizations or enterprise teams are only counted once. +// returns a *int32 when successful +func (m *ItemCopilotBillingSeatsGetResponse) GetTotalSeats()(*int32) { + return m.total_seats +} +// Serialize serializes information the current object +func (m *ItemCopilotBillingSeatsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSeats() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSeats())) + for i, v := range m.GetSeats() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("seats", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_seats", m.GetTotalSeats()) + 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 *ItemCopilotBillingSeatsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSeats sets the seats property value. The seats property +func (m *ItemCopilotBillingSeatsGetResponse) SetSeats(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable)() { + m.seats = value +} +// SetTotalSeats sets the total_seats property value. The total number of Copilot seats the enterprise is being billed for. Users with access through multiple organizations or enterprise teams are only counted once. +func (m *ItemCopilotBillingSeatsGetResponse) SetTotalSeats(value *int32)() { + m.total_seats = value +} +type ItemCopilotBillingSeatsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSeats()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable) + GetTotalSeats()(*int32) + SetSeats(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable)() + SetTotalSeats(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_copilot_billing_seats_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_copilot_billing_seats_request_builder.go new file mode 100644 index 000000000..0078d2e63 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_copilot_billing_seats_request_builder.go @@ -0,0 +1,74 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCopilotBillingSeatsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\copilot\billing\seats +type ItemCopilotBillingSeatsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCopilotBillingSeatsRequestBuilderGetQueryParameters **Note**: This endpoint is in beta and is subject to change.Lists all active Copilot seats across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription.Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once.For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array.Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams.Personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. +type ItemCopilotBillingSeatsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemCopilotBillingSeatsRequestBuilderInternal instantiates a new ItemCopilotBillingSeatsRequestBuilder and sets the default values. +func NewItemCopilotBillingSeatsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotBillingSeatsRequestBuilder) { + m := &ItemCopilotBillingSeatsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot/billing/seats{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemCopilotBillingSeatsRequestBuilder instantiates a new ItemCopilotBillingSeatsRequestBuilder and sets the default values. +func NewItemCopilotBillingSeatsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotBillingSeatsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCopilotBillingSeatsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Note**: This endpoint is in beta and is subject to change.Lists all active Copilot seats across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription.Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once.For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array.Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams.Personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. +// returns a ItemCopilotBillingSeatsGetResponseable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-enterprise +func (m *ItemCopilotBillingSeatsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCopilotBillingSeatsRequestBuilderGetQueryParameters])(ItemCopilotBillingSeatsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemCopilotBillingSeatsGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemCopilotBillingSeatsGetResponseable), nil +} +// ToGetRequestInformation **Note**: This endpoint is in beta and is subject to change.Lists all active Copilot seats across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription.Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once.For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array.Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams.Personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCopilotBillingSeatsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCopilotBillingSeatsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCopilotBillingSeatsRequestBuilder when successful +func (m *ItemCopilotBillingSeatsRequestBuilder) WithUrl(rawUrl string)(*ItemCopilotBillingSeatsRequestBuilder) { + return NewItemCopilotBillingSeatsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_copilot_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_copilot_request_builder.go new file mode 100644 index 000000000..9a7c8b1e7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_copilot_request_builder.go @@ -0,0 +1,33 @@ +package enterprises + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemCopilotRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\copilot +type ItemCopilotRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Billing the billing property +// returns a *ItemCopilotBillingRequestBuilder when successful +func (m *ItemCopilotRequestBuilder) Billing()(*ItemCopilotBillingRequestBuilder) { + return NewItemCopilotBillingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCopilotRequestBuilderInternal instantiates a new ItemCopilotRequestBuilder and sets the default values. +func NewItemCopilotRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotRequestBuilder) { + m := &ItemCopilotRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot", pathParameters), + } + return m +} +// NewItemCopilotRequestBuilder instantiates a new ItemCopilotRequestBuilder and sets the default values. +func NewItemCopilotRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCopilotRequestBuilderInternal(urlParams, requestAdapter) +} +// Usage the usage property +// returns a *ItemCopilotUsageRequestBuilder when successful +func (m *ItemCopilotRequestBuilder) Usage()(*ItemCopilotUsageRequestBuilder) { + return NewItemCopilotUsageRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_copilot_usage_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_copilot_usage_request_builder.go new file mode 100644 index 000000000..427ab3e08 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_copilot_usage_request_builder.go @@ -0,0 +1,81 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCopilotUsageRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\copilot\usage +type ItemCopilotUsageRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCopilotUsageRequestBuilderGetQueryParameters **Note**: This endpoint is in beta and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEfor all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances,and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.The response contains metrics for the prior 28 days. Usage metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.Only owners and billing managers can view Copilot usage metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. +type ItemCopilotUsageRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + Since *string `uriparametername:"since"` + // Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + Until *string `uriparametername:"until"` +} +// NewItemCopilotUsageRequestBuilderInternal instantiates a new ItemCopilotUsageRequestBuilder and sets the default values. +func NewItemCopilotUsageRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotUsageRequestBuilder) { + m := &ItemCopilotUsageRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot/usage{?page*,per_page*,since*,until*}", pathParameters), + } + return m +} +// NewItemCopilotUsageRequestBuilder instantiates a new ItemCopilotUsageRequestBuilder and sets the default values. +func NewItemCopilotUsageRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotUsageRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCopilotUsageRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Note**: This endpoint is in beta and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEfor all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances,and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.The response contains metrics for the prior 28 days. Usage metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.Only owners and billing managers can view Copilot usage metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. +// returns a []CopilotUsageMetricsable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-enterprise-members +func (m *ItemCopilotUsageRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCopilotUsageRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCopilotUsageMetricsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsable) + } + } + return val, nil +} +// ToGetRequestInformation **Note**: This endpoint is in beta and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEfor all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances,and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.The response contains metrics for the prior 28 days. Usage metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.Only owners and billing managers can view Copilot usage metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCopilotUsageRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCopilotUsageRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCopilotUsageRequestBuilder when successful +func (m *ItemCopilotUsageRequestBuilder) WithUrl(rawUrl string)(*ItemCopilotUsageRequestBuilder) { + return NewItemCopilotUsageRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_dependabot_alerts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_dependabot_alerts_request_builder.go new file mode 100644 index 000000000..c17b1f143 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_dependabot_alerts_request_builder.go @@ -0,0 +1,96 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i77c38d6454f4c9dc55005405729b416470b652fa12f001a040f72bc1395cc732 "github.com/octokit/go-sdk/pkg/github/enterprises/item/dependabot/alerts" +) + +// ItemDependabotAlertsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\dependabot\alerts +type ItemDependabotAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemDependabotAlertsRequestBuilderGetQueryParameters lists Dependabot alerts for repositories that are owned by the specified enterprise.The authenticated user must be a member of the enterprise to use this endpoint.Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. For more information about security managers, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. +type ItemDependabotAlertsRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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)." + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *i77c38d6454f4c9dc55005405729b416470b652fa12f001a040f72bc1395cc732.GetDirectionQueryParameterType `uriparametername:"direction"` + // A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned.Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust` + Ecosystem *string `uriparametername:"ecosystem"` + // **Deprecated**. The number of results per page (max 100), starting from the first matching result.This parameter must not be used in combination with `last`.Instead, use `per_page` in combination with `after` to fetch the first page of results. + First *int32 `uriparametername:"first"` + // **Deprecated**. The number of results per page (max 100), starting from the last matching result.This parameter must not be used in combination with `first`.Instead, use `per_page` in combination with `before` to fetch the last page of results. + Last *int32 `uriparametername:"last"` + // A comma-separated list of package names. If specified, only alerts for these packages will be returned. + Package *string `uriparametername:"package"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. + Scope *i77c38d6454f4c9dc55005405729b416470b652fa12f001a040f72bc1395cc732.GetScopeQueryParameterType `uriparametername:"scope"` + // A comma-separated list of severities. If specified, only alerts with these severities will be returned.Can be: `low`, `medium`, `high`, `critical` + Severity *string `uriparametername:"severity"` + // The property by which to sort the results.`created` means when the alert was created.`updated` means when the alert's state last changed. + Sort *i77c38d6454f4c9dc55005405729b416470b652fa12f001a040f72bc1395cc732.GetSortQueryParameterType `uriparametername:"sort"` + // A comma-separated list of states. If specified, only alerts with these states will be returned.Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` + State *string `uriparametername:"state"` +} +// NewItemDependabotAlertsRequestBuilderInternal instantiates a new ItemDependabotAlertsRequestBuilder and sets the default values. +func NewItemDependabotAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotAlertsRequestBuilder) { + m := &ItemDependabotAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/dependabot/alerts{?after*,before*,direction*,ecosystem*,first*,last*,package*,per_page*,scope*,severity*,sort*,state*}", pathParameters), + } + return m +} +// NewItemDependabotAlertsRequestBuilder instantiates a new ItemDependabotAlertsRequestBuilder and sets the default values. +func NewItemDependabotAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists Dependabot alerts for repositories that are owned by the specified enterprise.The authenticated user must be a member of the enterprise to use this endpoint.Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. For more information about security managers, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. +// returns a []DependabotAlertWithRepositoryable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise +func (m *ItemDependabotAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDependabotAlertsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotAlertWithRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDependabotAlertWithRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotAlertWithRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotAlertWithRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists Dependabot alerts for repositories that are owned by the specified enterprise.The authenticated user must be a member of the enterprise to use this endpoint.Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. For more information about security managers, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDependabotAlertsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemDependabotAlertsRequestBuilder when successful +func (m *ItemDependabotAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemDependabotAlertsRequestBuilder) { + return NewItemDependabotAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_dependabot_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_dependabot_request_builder.go new file mode 100644 index 000000000..d8039c85e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_dependabot_request_builder.go @@ -0,0 +1,28 @@ +package enterprises + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemDependabotRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\dependabot +type ItemDependabotRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Alerts the alerts property +// returns a *ItemDependabotAlertsRequestBuilder when successful +func (m *ItemDependabotRequestBuilder) Alerts()(*ItemDependabotAlertsRequestBuilder) { + return NewItemDependabotAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDependabotRequestBuilderInternal instantiates a new ItemDependabotRequestBuilder and sets the default values. +func NewItemDependabotRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotRequestBuilder) { + m := &ItemDependabotRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/dependabot", pathParameters), + } + return m +} +// NewItemDependabotRequestBuilder instantiates a new ItemDependabotRequestBuilder and sets the default values. +func NewItemDependabotRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_secret_scanning_alerts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_secret_scanning_alerts_request_builder.go new file mode 100644 index 000000000..0e6f2584f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_secret_scanning_alerts_request_builder.go @@ -0,0 +1,88 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i001db24e943d0f84422b7e2ee3ebec420ca587ebd5e378cf50225876c7468a70 "github.com/octokit/go-sdk/pkg/github/enterprises/item/secretscanning/alerts" +) + +// ItemSecretScanningAlertsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\secret-scanning\alerts +type ItemSecretScanningAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemSecretScanningAlertsRequestBuilderGetQueryParameters lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest.Alerts are only returned for organizations in the enterprise for which the authenticated user is an organization owner or a [security manager](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).The authenticated user must be a member of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope or `security_events` scope to use this endpoint. +type ItemSecretScanningAlertsRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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)." + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *i001db24e943d0f84422b7e2ee3ebec420ca587ebd5e378cf50225876c7468a70.GetDirectionQueryParameterType `uriparametername:"direction"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. + Resolution *string `uriparametername:"resolution"` + // A comma-separated list of secret types to return. By default all secret types are returned.See "[Secret scanning patterns](https://docs.github.com/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)"for a complete list of secret types. + Secret_type *string `uriparametername:"secret_type"` + // The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. + Sort *i001db24e943d0f84422b7e2ee3ebec420ca587ebd5e378cf50225876c7468a70.GetSortQueryParameterType `uriparametername:"sort"` + // Set to `open` or `resolved` to only list secret scanning alerts in a specific state. + State *i001db24e943d0f84422b7e2ee3ebec420ca587ebd5e378cf50225876c7468a70.GetStateQueryParameterType `uriparametername:"state"` + // A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. + Validity *string `uriparametername:"validity"` +} +// NewItemSecretScanningAlertsRequestBuilderInternal instantiates a new ItemSecretScanningAlertsRequestBuilder and sets the default values. +func NewItemSecretScanningAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecretScanningAlertsRequestBuilder) { + m := &ItemSecretScanningAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/secret-scanning/alerts{?after*,before*,direction*,per_page*,resolution*,secret_type*,sort*,state*,validity*}", pathParameters), + } + return m +} +// NewItemSecretScanningAlertsRequestBuilder instantiates a new ItemSecretScanningAlertsRequestBuilder and sets the default values. +func NewItemSecretScanningAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecretScanningAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSecretScanningAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest.Alerts are only returned for organizations in the enterprise for which the authenticated user is an organization owner or a [security manager](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).The authenticated user must be a member of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope or `security_events` scope to use this endpoint. +// returns a []OrganizationSecretScanningAlertable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a Alerts503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise +func (m *ItemSecretScanningAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSecretScanningAlertsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationSecretScanningAlertable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAlerts503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationSecretScanningAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationSecretScanningAlertable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationSecretScanningAlertable) + } + } + return val, nil +} +// ToGetRequestInformation lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest.Alerts are only returned for organizations in the enterprise for which the authenticated user is an organization owner or a [security manager](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).The authenticated user must be a member of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope or `security_events` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemSecretScanningAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSecretScanningAlertsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemSecretScanningAlertsRequestBuilder when successful +func (m *ItemSecretScanningAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemSecretScanningAlertsRequestBuilder) { + return NewItemSecretScanningAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_secret_scanning_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_secret_scanning_request_builder.go new file mode 100644 index 000000000..fee781574 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/item_secret_scanning_request_builder.go @@ -0,0 +1,28 @@ +package enterprises + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSecretScanningRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\secret-scanning +type ItemSecretScanningRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Alerts the alerts property +// returns a *ItemSecretScanningAlertsRequestBuilder when successful +func (m *ItemSecretScanningRequestBuilder) Alerts()(*ItemSecretScanningAlertsRequestBuilder) { + return NewItemSecretScanningAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemSecretScanningRequestBuilderInternal instantiates a new ItemSecretScanningRequestBuilder and sets the default values. +func NewItemSecretScanningRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecretScanningRequestBuilder) { + m := &ItemSecretScanningRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/secret-scanning", pathParameters), + } + return m +} +// NewItemSecretScanningRequestBuilder instantiates a new ItemSecretScanningRequestBuilder and sets the default values. +func NewItemSecretScanningRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecretScanningRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSecretScanningRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/with_enterprise_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/with_enterprise_item_request_builder.go new file mode 100644 index 000000000..72c0de516 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/enterprises/with_enterprise_item_request_builder.go @@ -0,0 +1,38 @@ +package enterprises + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// WithEnterpriseItemRequestBuilder builds and executes requests for operations under \enterprises\{enterprise} +type WithEnterpriseItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithEnterpriseItemRequestBuilderInternal instantiates a new WithEnterpriseItemRequestBuilder and sets the default values. +func NewWithEnterpriseItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithEnterpriseItemRequestBuilder) { + m := &WithEnterpriseItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}", pathParameters), + } + return m +} +// NewWithEnterpriseItemRequestBuilder instantiates a new WithEnterpriseItemRequestBuilder and sets the default values. +func NewWithEnterpriseItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithEnterpriseItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithEnterpriseItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Copilot the copilot property +// returns a *ItemCopilotRequestBuilder when successful +func (m *WithEnterpriseItemRequestBuilder) Copilot()(*ItemCopilotRequestBuilder) { + return NewItemCopilotRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Dependabot the dependabot property +// returns a *ItemDependabotRequestBuilder when successful +func (m *WithEnterpriseItemRequestBuilder) Dependabot()(*ItemDependabotRequestBuilder) { + return NewItemDependabotRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SecretScanning the secretScanning property +// returns a *ItemSecretScanningRequestBuilder when successful +func (m *WithEnterpriseItemRequestBuilder) SecretScanning()(*ItemSecretScanningRequestBuilder) { + return NewItemSecretScanningRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/events/events_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/events/events_request_builder.go new file mode 100644 index 000000000..40c67b389 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/events/events_request_builder.go @@ -0,0 +1,73 @@ +package events + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// EventsRequestBuilder builds and executes requests for operations under \events +type EventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// EventsRequestBuilderGetQueryParameters we delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago. +type EventsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewEventsRequestBuilderInternal instantiates a new EventsRequestBuilder and sets the default values. +func NewEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EventsRequestBuilder) { + m := &EventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/events{?page*,per_page*}", pathParameters), + } + return m +} +// NewEventsRequestBuilder instantiates a new EventsRequestBuilder and sets the default values. +func NewEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewEventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get we delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago. +// returns a []Eventable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a Events503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/events#list-public-events +func (m *EventsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[EventsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEvents503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEventFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable) + } + } + return val, nil +} +// ToGetRequestInformation we delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago. +// returns a *RequestInformation when successful +func (m *EventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[EventsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *EventsRequestBuilder when successful +func (m *EventsRequestBuilder) WithUrl(rawUrl string)(*EventsRequestBuilder) { + return NewEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/feeds/feeds_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/feeds/feeds_request_builder.go new file mode 100644 index 000000000..929806577 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/feeds/feeds_request_builder.go @@ -0,0 +1,57 @@ +package feeds + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// FeedsRequestBuilder builds and executes requests for operations under \feeds +type FeedsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewFeedsRequestBuilderInternal instantiates a new FeedsRequestBuilder and sets the default values. +func NewFeedsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*FeedsRequestBuilder) { + m := &FeedsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/feeds", pathParameters), + } + return m +} +// NewFeedsRequestBuilder instantiates a new FeedsRequestBuilder and sets the default values. +func NewFeedsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*FeedsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewFeedsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the feeds available to the authenticated user. The response provides a URL for each feed. You can then get a specific feed by sending a request to one of the feed URLs.* **Timeline**: The GitHub global public timeline* **User**: The public timeline for any user, using `uri_template`. For more information, see "[Hypermedia](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia)."* **Current user public**: The public timeline for the authenticated user* **Current user**: The private timeline for the authenticated user* **Current user actor**: The private timeline for activity created by the authenticated user* **Current user organizations**: The private timeline for the organizations the authenticated user is a member of.* **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub.By default, timeline resources are returned in JSON. You can specify the `application/atom+xml` type in the `Accept` header to return timeline resources in Atom format. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."**Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) since current feed URIs use the older, non revocable auth tokens. +// returns a Feedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/feeds#get-feeds +func (m *FeedsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Feedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateFeedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Feedable), nil +} +// ToGetRequestInformation lists the feeds available to the authenticated user. The response provides a URL for each feed. You can then get a specific feed by sending a request to one of the feed URLs.* **Timeline**: The GitHub global public timeline* **User**: The public timeline for any user, using `uri_template`. For more information, see "[Hypermedia](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia)."* **Current user public**: The public timeline for the authenticated user* **Current user**: The private timeline for the authenticated user* **Current user actor**: The private timeline for activity created by the authenticated user* **Current user organizations**: The private timeline for the organizations the authenticated user is a member of.* **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub.By default, timeline resources are returned in JSON. You can specify the `application/atom+xml` type in the `Accept` header to return timeline resources in Atom format. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."**Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) since current feed URIs use the older, non revocable auth tokens. +// returns a *RequestInformation when successful +func (m *FeedsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *FeedsRequestBuilder when successful +func (m *FeedsRequestBuilder) WithUrl(rawUrl string)(*FeedsRequestBuilder) { + return NewFeedsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gists/gists_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/gists/gists_post_request_body.go new file mode 100644 index 000000000..c36f92d44 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gists/gists_post_request_body.go @@ -0,0 +1,232 @@ +package gists + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Description of the gist + description *string + // Names and content for the files that make up the gist + files GistsPostRequestBody_filesable + // The public property + public GistsPostRequestBody_GistsPostRequestBody_publicable +} +// GistsPostRequestBody_GistsPostRequestBody_public composed type wrapper for classes bool, string +type GistsPostRequestBody_GistsPostRequestBody_public struct { + // Composed type representation for type bool + boolean *bool + // Composed type representation for type string + string *string +} +// NewGistsPostRequestBody_GistsPostRequestBody_public instantiates a new GistsPostRequestBody_GistsPostRequestBody_public and sets the default values. +func NewGistsPostRequestBody_GistsPostRequestBody_public()(*GistsPostRequestBody_GistsPostRequestBody_public) { + m := &GistsPostRequestBody_GistsPostRequestBody_public{ + } + return m +} +// CreateGistsPostRequestBody_GistsPostRequestBody_publicFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistsPostRequestBody_GistsPostRequestBody_publicFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewGistsPostRequestBody_GistsPostRequestBody_public() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetBoolValue(); val != nil { + if err != nil { + return nil, err + } + result.SetBoolean(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetBoolean gets the boolean property value. Composed type representation for type bool +// returns a *bool when successful +func (m *GistsPostRequestBody_GistsPostRequestBody_public) GetBoolean()(*bool) { + return m.boolean +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistsPostRequestBody_GistsPostRequestBody_public) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *GistsPostRequestBody_GistsPostRequestBody_public) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *GistsPostRequestBody_GistsPostRequestBody_public) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *GistsPostRequestBody_GistsPostRequestBody_public) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBoolean() != nil { + err := writer.WriteBoolValue("", m.GetBoolean()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetBoolean sets the boolean property value. Composed type representation for type bool +func (m *GistsPostRequestBody_GistsPostRequestBody_public) SetBoolean(value *bool)() { + m.boolean = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *GistsPostRequestBody_GistsPostRequestBody_public) SetString(value *string)() { + m.string = value +} +type GistsPostRequestBody_GistsPostRequestBody_publicable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBoolean()(*bool) + GetString()(*string) + SetBoolean(value *bool)() + SetString(value *string)() +} +// NewGistsPostRequestBody instantiates a new GistsPostRequestBody and sets the default values. +func NewGistsPostRequestBody()(*GistsPostRequestBody) { + m := &GistsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistsPostRequestBody(), 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 *GistsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. Description of the gist +// returns a *string when successful +func (m *GistsPostRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistsPostRequestBody_filesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetFiles(val.(GistsPostRequestBody_filesable)) + } + return nil + } + res["public"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistsPostRequestBody_GistsPostRequestBody_publicFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPublic(val.(GistsPostRequestBody_GistsPostRequestBody_publicable)) + } + return nil + } + return res +} +// GetFiles gets the files property value. Names and content for the files that make up the gist +// returns a GistsPostRequestBody_filesable when successful +func (m *GistsPostRequestBody) GetFiles()(GistsPostRequestBody_filesable) { + return m.files +} +// GetPublic gets the public property value. The public property +// returns a GistsPostRequestBody_GistsPostRequestBody_publicable when successful +func (m *GistsPostRequestBody) GetPublic()(GistsPostRequestBody_GistsPostRequestBody_publicable) { + return m.public +} +// Serialize serializes information the current object +func (m *GistsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("files", m.GetFiles()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("public", m.GetPublic()) + 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 *GistsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. Description of the gist +func (m *GistsPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetFiles sets the files property value. Names and content for the files that make up the gist +func (m *GistsPostRequestBody) SetFiles(value GistsPostRequestBody_filesable)() { + m.files = value +} +// SetPublic sets the public property value. The public property +func (m *GistsPostRequestBody) SetPublic(value GistsPostRequestBody_GistsPostRequestBody_publicable)() { + m.public = value +} +type GistsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetFiles()(GistsPostRequestBody_filesable) + GetPublic()(GistsPostRequestBody_GistsPostRequestBody_publicable) + SetDescription(value *string)() + SetFiles(value GistsPostRequestBody_filesable)() + SetPublic(value GistsPostRequestBody_GistsPostRequestBody_publicable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gists/gists_post_request_body_files.go b/vendor/github.com/octokit/go-sdk/pkg/github/gists/gists_post_request_body_files.go new file mode 100644 index 000000000..41da470d3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gists/gists_post_request_body_files.go @@ -0,0 +1,52 @@ +package gists + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GistsPostRequestBody_files names and content for the files that make up the gist +type GistsPostRequestBody_files struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewGistsPostRequestBody_files instantiates a new GistsPostRequestBody_files and sets the default values. +func NewGistsPostRequestBody_files()(*GistsPostRequestBody_files) { + m := &GistsPostRequestBody_files{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistsPostRequestBody_filesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistsPostRequestBody_filesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistsPostRequestBody_files(), 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 *GistsPostRequestBody_files) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistsPostRequestBody_files) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *GistsPostRequestBody_files) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *GistsPostRequestBody_files) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type GistsPostRequestBody_filesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gists/gists_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/gists/gists_request_builder.go new file mode 100644 index 000000000..e1a42b014 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gists/gists_request_builder.go @@ -0,0 +1,135 @@ +package gists + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// GistsRequestBuilder builds and executes requests for operations under \gists +type GistsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// GistsRequestBuilderGetQueryParameters lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: +type GistsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` +} +// ByGist_id gets an item from the github.com/octokit/go-sdk/pkg/github.gists.item collection +// returns a *WithGist_ItemRequestBuilder when successful +func (m *GistsRequestBuilder) ByGist_id(gist_id string)(*WithGist_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if gist_id != "" { + urlTplParams["gist_id"] = gist_id + } + return NewWithGist_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewGistsRequestBuilderInternal instantiates a new GistsRequestBuilder and sets the default values. +func NewGistsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GistsRequestBuilder) { + m := &GistsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists{?page*,per_page*,since*}", pathParameters), + } + return m +} +// NewGistsRequestBuilder instantiates a new GistsRequestBuilder and sets the default values. +func NewGistsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GistsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewGistsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: +// returns a []BaseGistable when successful +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user +func (m *GistsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[GistsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BaseGistable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBaseGistFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BaseGistable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BaseGistable) + } + } + return val, nil +} +// Post allows you to add a new gist with one or more files.**Note:** Don't name your files "gistfile" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally. +// returns a GistSimpleable when successful +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/gists/gists#create-a-gist +func (m *GistsRequestBuilder) Post(ctx context.Context, body GistsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistSimpleable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGistSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistSimpleable), nil +} +// Public the public property +// returns a *PublicRequestBuilder when successful +func (m *GistsRequestBuilder) Public()(*PublicRequestBuilder) { + return NewPublicRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Starred the starred property +// returns a *StarredRequestBuilder when successful +func (m *GistsRequestBuilder) Starred()(*StarredRequestBuilder) { + return NewStarredRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: +// returns a *RequestInformation when successful +func (m *GistsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[GistsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation allows you to add a new gist with one or more files.**Note:** Don't name your files "gistfile" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally. +// returns a *RequestInformation when successful +func (m *GistsRequestBuilder) ToPostRequestInformation(ctx context.Context, body GistsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *GistsRequestBuilder when successful +func (m *GistsRequestBuilder) WithUrl(rawUrl string)(*GistsRequestBuilder) { + return NewGistsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_comments_item_with_comment_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_comments_item_with_comment_patch_request_body.go new file mode 100644 index 000000000..d4c89fbff --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_comments_item_with_comment_patch_request_body.go @@ -0,0 +1,80 @@ +package gists + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCommentsItemWithComment_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The comment text. + body *string +} +// NewItemCommentsItemWithComment_PatchRequestBody instantiates a new ItemCommentsItemWithComment_PatchRequestBody and sets the default values. +func NewItemCommentsItemWithComment_PatchRequestBody()(*ItemCommentsItemWithComment_PatchRequestBody) { + m := &ItemCommentsItemWithComment_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCommentsItemWithComment_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCommentsItemWithComment_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCommentsItemWithComment_PatchRequestBody(), 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 *ItemCommentsItemWithComment_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The comment text. +// returns a *string when successful +func (m *ItemCommentsItemWithComment_PatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCommentsItemWithComment_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemCommentsItemWithComment_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemCommentsItemWithComment_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The comment text. +func (m *ItemCommentsItemWithComment_PatchRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemCommentsItemWithComment_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_comments_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_comments_post_request_body.go new file mode 100644 index 000000000..edf315085 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_comments_post_request_body.go @@ -0,0 +1,80 @@ +package gists + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCommentsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The comment text. + body *string +} +// NewItemCommentsPostRequestBody instantiates a new ItemCommentsPostRequestBody and sets the default values. +func NewItemCommentsPostRequestBody()(*ItemCommentsPostRequestBody) { + m := &ItemCommentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCommentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCommentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCommentsPostRequestBody(), 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 *ItemCommentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The comment text. +// returns a *string when successful +func (m *ItemCommentsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCommentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemCommentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemCommentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The comment text. +func (m *ItemCommentsPostRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemCommentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_comments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_comments_request_builder.go new file mode 100644 index 000000000..b98e1f2e4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_comments_request_builder.go @@ -0,0 +1,121 @@ +package gists + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCommentsRequestBuilder builds and executes requests for operations under \gists\{gist_id}\comments +type ItemCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCommentsRequestBuilderGetQueryParameters lists the comments on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +type ItemCommentsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByComment_id gets an item from the github.com/octokit/go-sdk/pkg/github.gists.item.comments.item collection +// returns a *ItemCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemCommentsRequestBuilder) ByComment_id(comment_id int32)(*ItemCommentsWithComment_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["comment_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(comment_id), 10) + return NewItemCommentsWithComment_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCommentsRequestBuilderInternal instantiates a new ItemCommentsRequestBuilder and sets the default values. +func NewItemCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCommentsRequestBuilder) { + m := &ItemCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/{gist_id}/comments{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemCommentsRequestBuilder instantiates a new ItemCommentsRequestBuilder and sets the default values. +func NewItemCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the comments on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a []GistCommentable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/gists/comments#list-gist-comments +func (m *ItemCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCommentsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGistCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistCommentable) + } + } + return val, nil +} +// Post creates a comment on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a GistCommentable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/gists/comments#create-a-gist-comment +func (m *ItemCommentsRequestBuilder) Post(ctx context.Context, body ItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistCommentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGistCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistCommentable), nil +} +// ToGetRequestInformation lists the comments on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a *RequestInformation when successful +func (m *ItemCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCommentsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a comment on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a *RequestInformation when successful +func (m *ItemCommentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCommentsRequestBuilder when successful +func (m *ItemCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemCommentsRequestBuilder) { + return NewItemCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_comments_with_comment_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_comments_with_comment_item_request_builder.go new file mode 100644 index 000000000..e55756977 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_comments_with_comment_item_request_builder.go @@ -0,0 +1,126 @@ +package gists + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCommentsWithComment_ItemRequestBuilder builds and executes requests for operations under \gists\{gist_id}\comments\{comment_id} +type ItemCommentsWithComment_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCommentsWithComment_ItemRequestBuilderInternal instantiates a new ItemCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemCommentsWithComment_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCommentsWithComment_ItemRequestBuilder) { + m := &ItemCommentsWithComment_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/{gist_id}/comments/{comment_id}", pathParameters), + } + return m +} +// NewItemCommentsWithComment_ItemRequestBuilder instantiates a new ItemCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemCommentsWithComment_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCommentsWithComment_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCommentsWithComment_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a gist comment +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/gists/comments#delete-a-gist-comment +func (m *ItemCommentsWithComment_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a comment on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a GistCommentable when successful +// returns a GistComment403Error error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/gists/comments#get-a-gist-comment +func (m *ItemCommentsWithComment_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGistComment403ErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGistCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistCommentable), nil +} +// Patch updates a comment on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a GistCommentable 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/gists/comments#update-a-gist-comment +func (m *ItemCommentsWithComment_ItemRequestBuilder) Patch(ctx context.Context, body ItemCommentsItemWithComment_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistCommentable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGistCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistCommentable), nil +} +// returns a *RequestInformation when successful +func (m *ItemCommentsWithComment_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets a comment on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a *RequestInformation when successful +func (m *ItemCommentsWithComment_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates a comment on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a *RequestInformation when successful +func (m *ItemCommentsWithComment_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemCommentsItemWithComment_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemCommentsWithComment_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemCommentsWithComment_ItemRequestBuilder) { + return NewItemCommentsWithComment_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_commits_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_commits_request_builder.go new file mode 100644 index 000000000..bf3631790 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_commits_request_builder.go @@ -0,0 +1,72 @@ +package gists + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCommitsRequestBuilder builds and executes requests for operations under \gists\{gist_id}\commits +type ItemCommitsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCommitsRequestBuilderGetQueryParameters list gist commits +type ItemCommitsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemCommitsRequestBuilderInternal instantiates a new ItemCommitsRequestBuilder and sets the default values. +func NewItemCommitsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCommitsRequestBuilder) { + m := &ItemCommitsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/{gist_id}/commits{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemCommitsRequestBuilder instantiates a new ItemCommitsRequestBuilder and sets the default values. +func NewItemCommitsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCommitsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCommitsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list gist commits +// returns a []GistCommitable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/gists/gists#list-gist-commits +func (m *ItemCommitsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCommitsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistCommitable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGistCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistCommitable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistCommitable) + } + } + return val, nil +} +// returns a *RequestInformation when successful +func (m *ItemCommitsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCommitsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCommitsRequestBuilder when successful +func (m *ItemCommitsRequestBuilder) WithUrl(rawUrl string)(*ItemCommitsRequestBuilder) { + return NewItemCommitsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_forks_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_forks_request_builder.go new file mode 100644 index 000000000..315269cff --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_forks_request_builder.go @@ -0,0 +1,106 @@ +package gists + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemForksRequestBuilder builds and executes requests for operations under \gists\{gist_id}\forks +type ItemForksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemForksRequestBuilderGetQueryParameters list gist forks +type ItemForksRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemForksRequestBuilderInternal instantiates a new ItemForksRequestBuilder and sets the default values. +func NewItemForksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemForksRequestBuilder) { + m := &ItemForksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/{gist_id}/forks{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemForksRequestBuilder instantiates a new ItemForksRequestBuilder and sets the default values. +func NewItemForksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemForksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemForksRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list gist forks +// returns a []GistSimpleable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/gists/gists#list-gist-forks +func (m *ItemForksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemForksRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGistSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistSimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistSimpleable) + } + } + return val, nil +} +// Post fork a gist +// returns a BaseGistable when successful +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/gists/gists#fork-a-gist +func (m *ItemForksRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BaseGistable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBaseGistFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BaseGistable), nil +} +// returns a *RequestInformation when successful +func (m *ItemForksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemForksRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *ItemForksRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemForksRequestBuilder when successful +func (m *ItemForksRequestBuilder) WithUrl(rawUrl string)(*ItemForksRequestBuilder) { + return NewItemForksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_star404_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_star404_error.go new file mode 100644 index 000000000..34d3a62e5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_star404_error.go @@ -0,0 +1,40 @@ +package gists + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemStar404Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError +} +// NewItemStar404Error instantiates a new ItemStar404Error and sets the default values. +func NewItemStar404Error()(*ItemStar404Error) { + m := &ItemStar404Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + return m +} +// CreateItemStar404ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemStar404ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemStar404Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemStar404Error) Error()(string) { + return m.ApiError.Error() +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemStar404Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemStar404Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +type ItemStar404Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_star_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_star_request_builder.go new file mode 100644 index 000000000..43b33c826 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_star_request_builder.go @@ -0,0 +1,115 @@ +package gists + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemStarRequestBuilder builds and executes requests for operations under \gists\{gist_id}\star +type ItemStarRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemStarRequestBuilderInternal instantiates a new ItemStarRequestBuilder and sets the default values. +func NewItemStarRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemStarRequestBuilder) { + m := &ItemStarRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/{gist_id}/star", pathParameters), + } + return m +} +// NewItemStarRequestBuilder instantiates a new ItemStarRequestBuilder and sets the default values. +func NewItemStarRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemStarRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemStarRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete unstar a gist +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/gists/gists#unstar-a-gist +func (m *ItemStarRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get check if a gist is starred +// returns a BasicError error when the service returns a 403 status code +// returns a ItemStar404Error error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred +func (m *ItemStarRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": CreateItemStar404ErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/gists/gists#star-a-gist +func (m *ItemStarRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// returns a *RequestInformation when successful +func (m *ItemStarRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *ItemStarRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." +// returns a *RequestInformation when successful +func (m *ItemStarRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemStarRequestBuilder when successful +func (m *ItemStarRequestBuilder) WithUrl(rawUrl string)(*ItemStarRequestBuilder) { + return NewItemStarRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_with_gist_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_with_gist_patch_request_body.go new file mode 100644 index 000000000..9b5c888a1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_with_gist_patch_request_body.go @@ -0,0 +1,109 @@ +package gists + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemWithGist_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The description of the gist. + description *string + // The gist files to be updated, renamed, or deleted. Each `key` must match the current filename(including extension) of the targeted gist file. For example: `hello.py`.To delete a file, set the whole file to null. For example: `hello.py : null`. The file will also bedeleted if the specified object does not contain at least one of `content` or `filename`. + files ItemWithGist_PatchRequestBody_filesable +} +// NewItemWithGist_PatchRequestBody instantiates a new ItemWithGist_PatchRequestBody and sets the default values. +func NewItemWithGist_PatchRequestBody()(*ItemWithGist_PatchRequestBody) { + m := &ItemWithGist_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemWithGist_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemWithGist_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemWithGist_PatchRequestBody(), 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 *ItemWithGist_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description of the gist. +// returns a *string when successful +func (m *ItemWithGist_PatchRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemWithGist_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemWithGist_PatchRequestBody_filesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetFiles(val.(ItemWithGist_PatchRequestBody_filesable)) + } + return nil + } + return res +} +// GetFiles gets the files property value. The gist files to be updated, renamed, or deleted. Each `key` must match the current filename(including extension) of the targeted gist file. For example: `hello.py`.To delete a file, set the whole file to null. For example: `hello.py : null`. The file will also bedeleted if the specified object does not contain at least one of `content` or `filename`. +// returns a ItemWithGist_PatchRequestBody_filesable when successful +func (m *ItemWithGist_PatchRequestBody) GetFiles()(ItemWithGist_PatchRequestBody_filesable) { + return m.files +} +// Serialize serializes information the current object +func (m *ItemWithGist_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("files", m.GetFiles()) + 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 *ItemWithGist_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description of the gist. +func (m *ItemWithGist_PatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetFiles sets the files property value. The gist files to be updated, renamed, or deleted. Each `key` must match the current filename(including extension) of the targeted gist file. For example: `hello.py`.To delete a file, set the whole file to null. For example: `hello.py : null`. The file will also bedeleted if the specified object does not contain at least one of `content` or `filename`. +func (m *ItemWithGist_PatchRequestBody) SetFiles(value ItemWithGist_PatchRequestBody_filesable)() { + m.files = value +} +type ItemWithGist_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetFiles()(ItemWithGist_PatchRequestBody_filesable) + SetDescription(value *string)() + SetFiles(value ItemWithGist_PatchRequestBody_filesable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_with_gist_patch_request_body_files.go b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_with_gist_patch_request_body_files.go new file mode 100644 index 000000000..4546effae --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_with_gist_patch_request_body_files.go @@ -0,0 +1,52 @@ +package gists + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemWithGist_PatchRequestBody_files the gist files to be updated, renamed, or deleted. Each `key` must match the current filename(including extension) of the targeted gist file. For example: `hello.py`.To delete a file, set the whole file to null. For example: `hello.py : null`. The file will also bedeleted if the specified object does not contain at least one of `content` or `filename`. +type ItemWithGist_PatchRequestBody_files struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemWithGist_PatchRequestBody_files instantiates a new ItemWithGist_PatchRequestBody_files and sets the default values. +func NewItemWithGist_PatchRequestBody_files()(*ItemWithGist_PatchRequestBody_files) { + m := &ItemWithGist_PatchRequestBody_files{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemWithGist_PatchRequestBody_filesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemWithGist_PatchRequestBody_filesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemWithGist_PatchRequestBody_files(), 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 *ItemWithGist_PatchRequestBody_files) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemWithGist_PatchRequestBody_files) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemWithGist_PatchRequestBody_files) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemWithGist_PatchRequestBody_files) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemWithGist_PatchRequestBody_filesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_with_sha_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_with_sha_item_request_builder.go new file mode 100644 index 000000000..f88e42494 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gists/item_with_sha_item_request_builder.go @@ -0,0 +1,65 @@ +package gists + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemWithShaItemRequestBuilder builds and executes requests for operations under \gists\{gist_id}\{sha} +type ItemWithShaItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemWithShaItemRequestBuilderInternal instantiates a new ItemWithShaItemRequestBuilder and sets the default values. +func NewItemWithShaItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWithShaItemRequestBuilder) { + m := &ItemWithShaItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/{gist_id}/{sha}", pathParameters), + } + return m +} +// NewItemWithShaItemRequestBuilder instantiates a new ItemWithShaItemRequestBuilder and sets the default values. +func NewItemWithShaItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWithShaItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemWithShaItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a specified gist revision.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a GistSimpleable when successful +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/gists/gists#get-a-gist-revision +func (m *ItemWithShaItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGistSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistSimpleable), nil +} +// ToGetRequestInformation gets a specified gist revision.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a *RequestInformation when successful +func (m *ItemWithShaItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemWithShaItemRequestBuilder when successful +func (m *ItemWithShaItemRequestBuilder) WithUrl(rawUrl string)(*ItemWithShaItemRequestBuilder) { + return NewItemWithShaItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gists/public_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/gists/public_request_builder.go new file mode 100644 index 000000000..3aa1ba3ab --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gists/public_request_builder.go @@ -0,0 +1,76 @@ +package gists + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// PublicRequestBuilder builds and executes requests for operations under \gists\public +type PublicRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// PublicRequestBuilderGetQueryParameters list public gists sorted by most recently updated to least recently updated.Note: With [pagination](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. +type PublicRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` +} +// NewPublicRequestBuilderInternal instantiates a new PublicRequestBuilder and sets the default values. +func NewPublicRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PublicRequestBuilder) { + m := &PublicRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/public{?page*,per_page*,since*}", pathParameters), + } + return m +} +// NewPublicRequestBuilder instantiates a new PublicRequestBuilder and sets the default values. +func NewPublicRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PublicRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPublicRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list public gists sorted by most recently updated to least recently updated.Note: With [pagination](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. +// returns a []BaseGistable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/gists/gists#list-public-gists +func (m *PublicRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PublicRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BaseGistable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBaseGistFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BaseGistable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BaseGistable) + } + } + return val, nil +} +// ToGetRequestInformation list public gists sorted by most recently updated to least recently updated.Note: With [pagination](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. +// returns a *RequestInformation when successful +func (m *PublicRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PublicRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *PublicRequestBuilder when successful +func (m *PublicRequestBuilder) WithUrl(rawUrl string)(*PublicRequestBuilder) { + return NewPublicRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gists/starred_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/gists/starred_request_builder.go new file mode 100644 index 000000000..1e6506c8e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gists/starred_request_builder.go @@ -0,0 +1,76 @@ +package gists + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// StarredRequestBuilder builds and executes requests for operations under \gists\starred +type StarredRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// StarredRequestBuilderGetQueryParameters list the authenticated user's starred gists: +type StarredRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` +} +// NewStarredRequestBuilderInternal instantiates a new StarredRequestBuilder and sets the default values. +func NewStarredRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StarredRequestBuilder) { + m := &StarredRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/starred{?page*,per_page*,since*}", pathParameters), + } + return m +} +// NewStarredRequestBuilder instantiates a new StarredRequestBuilder and sets the default values. +func NewStarredRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StarredRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStarredRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the authenticated user's starred gists: +// returns a []BaseGistable 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/gists/gists#list-starred-gists +func (m *StarredRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[StarredRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BaseGistable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBaseGistFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BaseGistable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BaseGistable) + } + } + return val, nil +} +// ToGetRequestInformation list the authenticated user's starred gists: +// returns a *RequestInformation when successful +func (m *StarredRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[StarredRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *StarredRequestBuilder when successful +func (m *StarredRequestBuilder) WithUrl(rawUrl string)(*StarredRequestBuilder) { + return NewStarredRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gists/with_gist_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/gists/with_gist_item_request_builder.go new file mode 100644 index 000000000..bcb39244a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gists/with_gist_item_request_builder.go @@ -0,0 +1,160 @@ +package gists + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// WithGist_ItemRequestBuilder builds and executes requests for operations under \gists\{gist_id} +type WithGist_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// BySha gets an item from the github.com/octokit/go-sdk/pkg/github.gists.item.item collection +// returns a *ItemWithShaItemRequestBuilder when successful +func (m *WithGist_ItemRequestBuilder) BySha(sha string)(*ItemWithShaItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if sha != "" { + urlTplParams["sha"] = sha + } + return NewItemWithShaItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +// returns a *ItemCommentsRequestBuilder when successful +func (m *WithGist_ItemRequestBuilder) Comments()(*ItemCommentsRequestBuilder) { + return NewItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Commits the commits property +// returns a *ItemCommitsRequestBuilder when successful +func (m *WithGist_ItemRequestBuilder) Commits()(*ItemCommitsRequestBuilder) { + return NewItemCommitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewWithGist_ItemRequestBuilderInternal instantiates a new WithGist_ItemRequestBuilder and sets the default values. +func NewWithGist_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithGist_ItemRequestBuilder) { + m := &WithGist_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/{gist_id}", pathParameters), + } + return m +} +// NewWithGist_ItemRequestBuilder instantiates a new WithGist_ItemRequestBuilder and sets the default values. +func NewWithGist_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithGist_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithGist_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a gist +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/gists/gists#delete-a-gist +func (m *WithGist_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Forks the forks property +// returns a *ItemForksRequestBuilder when successful +func (m *WithGist_ItemRequestBuilder) Forks()(*ItemForksRequestBuilder) { + return NewItemForksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get gets a specified gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a GistSimpleable when successful +// returns a GistSimple403Error error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/gists/gists#get-a-gist +func (m *WithGist_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGistSimple403ErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGistSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistSimpleable), nil +} +// Patch allows you to update a gist's description and to update, delete, or rename gist files. Filesfrom the previous version of the gist that aren't explicitly changed during an editare unchanged.At least one of `description` or `files` is required.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a GistSimpleable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/gists/gists#update-a-gist +func (m *WithGist_ItemRequestBuilder) Patch(ctx context.Context, body ItemWithGist_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistSimpleable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGistSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GistSimpleable), nil +} +// Star the star property +// returns a *ItemStarRequestBuilder when successful +func (m *WithGist_ItemRequestBuilder) Star()(*ItemStarRequestBuilder) { + return NewItemStarRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// returns a *RequestInformation when successful +func (m *WithGist_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets a specified gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a *RequestInformation when successful +func (m *WithGist_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation allows you to update a gist's description and to update, delete, or rename gist files. Filesfrom the previous version of the gist that aren't explicitly changed during an editare unchanged.At least one of `description` or `files` is required.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a *RequestInformation when successful +func (m *WithGist_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemWithGist_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *WithGist_ItemRequestBuilder when successful +func (m *WithGist_ItemRequestBuilder) WithUrl(rawUrl string)(*WithGist_ItemRequestBuilder) { + return NewWithGist_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gitignore/gitignore_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/gitignore/gitignore_request_builder.go new file mode 100644 index 000000000..1f096980a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gitignore/gitignore_request_builder.go @@ -0,0 +1,28 @@ +package gitignore + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// GitignoreRequestBuilder builds and executes requests for operations under \gitignore +type GitignoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewGitignoreRequestBuilderInternal instantiates a new GitignoreRequestBuilder and sets the default values. +func NewGitignoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GitignoreRequestBuilder) { + m := &GitignoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gitignore", pathParameters), + } + return m +} +// NewGitignoreRequestBuilder instantiates a new GitignoreRequestBuilder and sets the default values. +func NewGitignoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GitignoreRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewGitignoreRequestBuilderInternal(urlParams, requestAdapter) +} +// Templates the templates property +// returns a *TemplatesRequestBuilder when successful +func (m *GitignoreRequestBuilder) Templates()(*TemplatesRequestBuilder) { + return NewTemplatesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gitignore/templates_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/gitignore/templates_request_builder.go new file mode 100644 index 000000000..ac5da9bc5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gitignore/templates_request_builder.go @@ -0,0 +1,71 @@ +package gitignore + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// TemplatesRequestBuilder builds and executes requests for operations under \gitignore\templates +type TemplatesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByName gets an item from the github.com/octokit/go-sdk/pkg/github.gitignore.templates.item collection +// returns a *TemplatesWithNameItemRequestBuilder when successful +func (m *TemplatesRequestBuilder) ByName(name string)(*TemplatesWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewTemplatesWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewTemplatesRequestBuilderInternal instantiates a new TemplatesRequestBuilder and sets the default values. +func NewTemplatesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TemplatesRequestBuilder) { + m := &TemplatesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gitignore/templates", pathParameters), + } + return m +} +// NewTemplatesRequestBuilder instantiates a new TemplatesRequestBuilder and sets the default values. +func NewTemplatesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TemplatesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTemplatesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all templates available to pass as an option when [creating a repository](https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user). +// returns a []string when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates +func (m *TemplatesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]string, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitiveCollection(ctx, requestInfo, "string", nil) + if err != nil { + return nil, err + } + val := make([]string, len(res)) + for i, v := range res { + if v != nil { + val[i] = *(v.(*string)) + } + } + return val, nil +} +// ToGetRequestInformation list all templates available to pass as an option when [creating a repository](https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user). +// returns a *RequestInformation when successful +func (m *TemplatesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *TemplatesRequestBuilder when successful +func (m *TemplatesRequestBuilder) WithUrl(rawUrl string)(*TemplatesRequestBuilder) { + return NewTemplatesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/gitignore/templates_with_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/gitignore/templates_with_name_item_request_builder.go new file mode 100644 index 000000000..28f85fb1e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/gitignore/templates_with_name_item_request_builder.go @@ -0,0 +1,57 @@ +package gitignore + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// TemplatesWithNameItemRequestBuilder builds and executes requests for operations under \gitignore\templates\{name} +type TemplatesWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewTemplatesWithNameItemRequestBuilderInternal instantiates a new TemplatesWithNameItemRequestBuilder and sets the default values. +func NewTemplatesWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TemplatesWithNameItemRequestBuilder) { + m := &TemplatesWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gitignore/templates/{name}", pathParameters), + } + return m +} +// NewTemplatesWithNameItemRequestBuilder instantiates a new TemplatesWithNameItemRequestBuilder and sets the default values. +func NewTemplatesWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TemplatesWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTemplatesWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get the content of a gitignore template.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw .gitignore contents. +// returns a GitignoreTemplateable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template +func (m *TemplatesWithNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitignoreTemplateable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGitignoreTemplateFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitignoreTemplateable), nil +} +// ToGetRequestInformation get the content of a gitignore template.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw .gitignore contents. +// returns a *RequestInformation when successful +func (m *TemplatesWithNameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *TemplatesWithNameItemRequestBuilder when successful +func (m *TemplatesWithNameItemRequestBuilder) WithUrl(rawUrl string)(*TemplatesWithNameItemRequestBuilder) { + return NewTemplatesWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/installation/installation_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/installation/installation_request_builder.go new file mode 100644 index 000000000..5a20731e4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/installation/installation_request_builder.go @@ -0,0 +1,33 @@ +package installation + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// InstallationRequestBuilder builds and executes requests for operations under \installation +type InstallationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewInstallationRequestBuilderInternal instantiates a new InstallationRequestBuilder and sets the default values. +func NewInstallationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationRequestBuilder) { + m := &InstallationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/installation", pathParameters), + } + return m +} +// NewInstallationRequestBuilder instantiates a new InstallationRequestBuilder and sets the default values. +func NewInstallationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationRequestBuilderInternal(urlParams, requestAdapter) +} +// Repositories the repositories property +// returns a *RepositoriesRequestBuilder when successful +func (m *InstallationRequestBuilder) Repositories()(*RepositoriesRequestBuilder) { + return NewRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Token the token property +// returns a *TokenRequestBuilder when successful +func (m *InstallationRequestBuilder) Token()(*TokenRequestBuilder) { + return NewTokenRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/installation/repositories_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/installation/repositories_get_response.go new file mode 100644 index 000000000..f250df80c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/installation/repositories_get_response.go @@ -0,0 +1,151 @@ +package installation + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type RepositoriesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The repositories property + repositories []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable + // The repository_selection property + repository_selection *string + // The total_count property + total_count *int32 +} +// NewRepositoriesGetResponse instantiates a new RepositoriesGetResponse and sets the default values. +func NewRepositoriesGetResponse()(*RepositoriesGetResponse) { + m := &RepositoriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoriesGetResponse(), 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 *RepositoriesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["repository_selection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositorySelection(val) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []Repositoryable when successful +func (m *RepositoriesGetResponse) GetRepositories()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable) { + return m.repositories +} +// GetRepositorySelection gets the repository_selection property value. The repository_selection property +// returns a *string when successful +func (m *RepositoriesGetResponse) GetRepositorySelection()(*string) { + return m.repository_selection +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *RepositoriesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *RepositoriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_selection", m.GetRepositorySelection()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *RepositoriesGetResponse) SetRepositories(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable)() { + m.repositories = value +} +// SetRepositorySelection sets the repository_selection property value. The repository_selection property +func (m *RepositoriesGetResponse) SetRepositorySelection(value *string)() { + m.repository_selection = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *RepositoriesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type RepositoriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositories()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable) + GetRepositorySelection()(*string) + GetTotalCount()(*int32) + SetRepositories(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable)() + SetRepositorySelection(value *string)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/installation/repositories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/installation/repositories_request_builder.go new file mode 100644 index 000000000..f13bb7638 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/installation/repositories_request_builder.go @@ -0,0 +1,70 @@ +package installation + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// RepositoriesRequestBuilder builds and executes requests for operations under \installation\repositories +type RepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// RepositoriesRequestBuilderGetQueryParameters list repositories that an app installation can access. +type RepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewRepositoriesRequestBuilderInternal instantiates a new RepositoriesRequestBuilder and sets the default values. +func NewRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RepositoriesRequestBuilder) { + m := &RepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/installation/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewRepositoriesRequestBuilder instantiates a new RepositoriesRequestBuilder and sets the default values. +func NewRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list repositories that an app installation can access. +// returns a RepositoriesGetResponseable 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/apps/installations#list-repositories-accessible-to-the-app-installation +func (m *RepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[RepositoriesRequestBuilderGetQueryParameters])(RepositoriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateRepositoriesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(RepositoriesGetResponseable), nil +} +// ToGetRequestInformation list repositories that an app installation can access. +// returns a *RequestInformation when successful +func (m *RepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[RepositoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *RepositoriesRequestBuilder when successful +func (m *RepositoriesRequestBuilder) WithUrl(rawUrl string)(*RepositoriesRequestBuilder) { + return NewRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/installation/repositories_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/installation/repositories_response.go new file mode 100644 index 000000000..f85078825 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/installation/repositories_response.go @@ -0,0 +1,28 @@ +package installation + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoriesResponse +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type RepositoriesResponse struct { + RepositoriesGetResponse +} +// NewRepositoriesResponse instantiates a new RepositoriesResponse and sets the default values. +func NewRepositoriesResponse()(*RepositoriesResponse) { + m := &RepositoriesResponse{ + RepositoriesGetResponse: *NewRepositoriesGetResponse(), + } + return m +} +// CreateRepositoriesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateRepositoriesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoriesResponse(), nil +} +// RepositoriesResponseable +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type RepositoriesResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + RepositoriesGetResponseable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/installation/token_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/installation/token_request_builder.go new file mode 100644 index 000000000..6bf8c47c7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/installation/token_request_builder.go @@ -0,0 +1,51 @@ +package installation + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// TokenRequestBuilder builds and executes requests for operations under \installation\token +type TokenRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewTokenRequestBuilderInternal instantiates a new TokenRequestBuilder and sets the default values. +func NewTokenRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TokenRequestBuilder) { + m := &TokenRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/installation/token", pathParameters), + } + return m +} +// NewTokenRequestBuilder instantiates a new TokenRequestBuilder and sets the default values. +func NewTokenRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TokenRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTokenRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete revokes the installation token you're using to authenticate as an installation and access this endpoint.Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app)" endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token +func (m *TokenRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation revokes the installation token you're using to authenticate as an installation and access this endpoint.Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app)" endpoint. +// returns a *RequestInformation when successful +func (m *TokenRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *TokenRequestBuilder when successful +func (m *TokenRequestBuilder) WithUrl(rawUrl string)(*TokenRequestBuilder) { + return NewTokenRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/issues/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/issues/get_direction_query_parameter_type.go new file mode 100644 index 000000000..6aca6ecb9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/issues/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package issues +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/issues/get_filter_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/issues/get_filter_query_parameter_type.go new file mode 100644 index 000000000..bd35fa09b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/issues/get_filter_query_parameter_type.go @@ -0,0 +1,48 @@ +package issues +import ( + "errors" +) +type GetFilterQueryParameterType int + +const ( + ASSIGNED_GETFILTERQUERYPARAMETERTYPE GetFilterQueryParameterType = iota + CREATED_GETFILTERQUERYPARAMETERTYPE + MENTIONED_GETFILTERQUERYPARAMETERTYPE + SUBSCRIBED_GETFILTERQUERYPARAMETERTYPE + REPOS_GETFILTERQUERYPARAMETERTYPE + ALL_GETFILTERQUERYPARAMETERTYPE +) + +func (i GetFilterQueryParameterType) String() string { + return []string{"assigned", "created", "mentioned", "subscribed", "repos", "all"}[i] +} +func ParseGetFilterQueryParameterType(v string) (any, error) { + result := ASSIGNED_GETFILTERQUERYPARAMETERTYPE + switch v { + case "assigned": + result = ASSIGNED_GETFILTERQUERYPARAMETERTYPE + case "created": + result = CREATED_GETFILTERQUERYPARAMETERTYPE + case "mentioned": + result = MENTIONED_GETFILTERQUERYPARAMETERTYPE + case "subscribed": + result = SUBSCRIBED_GETFILTERQUERYPARAMETERTYPE + case "repos": + result = REPOS_GETFILTERQUERYPARAMETERTYPE + case "all": + result = ALL_GETFILTERQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetFilterQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetFilterQueryParameterType(values []GetFilterQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetFilterQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/issues/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/issues/get_sort_query_parameter_type.go new file mode 100644 index 000000000..ba962acfb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/issues/get_sort_query_parameter_type.go @@ -0,0 +1,39 @@ +package issues +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + COMMENTS_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "comments"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "comments": + result = COMMENTS_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/issues/get_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/issues/get_state_query_parameter_type.go new file mode 100644 index 000000000..554151074 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/issues/get_state_query_parameter_type.go @@ -0,0 +1,39 @@ +package issues +import ( + "errors" +) +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/issues/issues_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/issues/issues_request_builder.go new file mode 100644 index 000000000..7458c385e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/issues/issues_request_builder.go @@ -0,0 +1,90 @@ +package issues + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// IssuesRequestBuilder builds and executes requests for operations under \issues +type IssuesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// IssuesRequestBuilderGetQueryParameters list issues assigned to the authenticated user across all visible repositories including owned repositories, memberrepositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are notnecessarily assigned to you.**Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For thisreason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests bythe `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pullrequest id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type IssuesRequestBuilderGetQueryParameters struct { + Collab *bool `uriparametername:"collab"` + // The direction to sort the results by. + Direction *GetDirectionQueryParameterType `uriparametername:"direction"` + // Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation. + Filter *GetFilterQueryParameterType `uriparametername:"filter"` + // A list of comma separated label names. Example: `bug,ui,@high` + Labels *string `uriparametername:"labels"` + Orgs *bool `uriparametername:"orgs"` + Owned *bool `uriparametername:"owned"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + Pulls *bool `uriparametername:"pulls"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + // What to sort results by. + Sort *GetSortQueryParameterType `uriparametername:"sort"` + // Indicates the state of the issues to return. + State *GetStateQueryParameterType `uriparametername:"state"` +} +// NewIssuesRequestBuilderInternal instantiates a new IssuesRequestBuilder and sets the default values. +func NewIssuesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IssuesRequestBuilder) { + m := &IssuesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/issues{?collab*,direction*,filter*,labels*,orgs*,owned*,page*,per_page*,pulls*,since*,sort*,state*}", pathParameters), + } + return m +} +// NewIssuesRequestBuilder instantiates a new IssuesRequestBuilder and sets the default values. +func NewIssuesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IssuesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewIssuesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list issues assigned to the authenticated user across all visible repositories including owned repositories, memberrepositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are notnecessarily assigned to you.**Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For thisreason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests bythe `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pullrequest id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []Issueable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user +func (m *IssuesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[IssuesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable) + } + } + return val, nil +} +// ToGetRequestInformation list issues assigned to the authenticated user across all visible repositories including owned repositories, memberrepositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are notnecessarily assigned to you.**Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For thisreason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests bythe `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pullrequest id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *IssuesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[IssuesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *IssuesRequestBuilder when successful +func (m *IssuesRequestBuilder) WithUrl(rawUrl string)(*IssuesRequestBuilder) { + return NewIssuesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/kiota-lock.json b/vendor/github.com/octokit/go-sdk/pkg/github/kiota-lock.json new file mode 100644 index 000000000..98b376079 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/kiota-lock.json @@ -0,0 +1,32 @@ +{ + "descriptionHash": "AD108B150ECABF1201FE2A2C1C00E8353E15706330F0E30E1074B0B468533787C150464CDBC404C86BA0014CEB95E514322658FADE429D0910375BD6CE4BD409", + "descriptionLocation": "../../../../../schemas/api.github.com.json", + "lockFileVersion": "1.0.0", + "kiotaVersion": "1.14.0", + "clientClassName": "ApiClient", + "clientNamespaceName": "github.com/octokit/go-sdk/pkg/github", + "language": "Go", + "usesBackingStore": false, + "excludeBackwardCompatible": true, + "includeAdditionalData": true, + "serializers": [ + "Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Text.TextSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Form.FormSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Multipart.MultipartSerializationWriterFactory" + ], + "deserializers": [ + "Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory", + "Microsoft.Kiota.Serialization.Text.TextParseNodeFactory", + "Microsoft.Kiota.Serialization.Form.FormParseNodeFactory" + ], + "structuredMimeTypes": [ + "application/json", + "text/plain;q=0.9", + "application/x-www-form-urlencoded;q=0.2", + "multipart/form-data;q=0.1" + ], + "includePatterns": [], + "excludePatterns": [], + "disabledValidationRules": [] +} \ No newline at end of file diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/licenses/licenses_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/licenses/licenses_request_builder.go new file mode 100644 index 000000000..19532a4a4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/licenses/licenses_request_builder.go @@ -0,0 +1,80 @@ +package licenses + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// LicensesRequestBuilder builds and executes requests for operations under \licenses +type LicensesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// LicensesRequestBuilderGetQueryParameters lists the most commonly used licenses on GitHub. For more information, see "[Licensing a repository ](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)." +type LicensesRequestBuilderGetQueryParameters struct { + Featured *bool `uriparametername:"featured"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByLicense gets an item from the github.com/octokit/go-sdk/pkg/github.licenses.item collection +// returns a *WithLicenseItemRequestBuilder when successful +func (m *LicensesRequestBuilder) ByLicense(license string)(*WithLicenseItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if license != "" { + urlTplParams["license"] = license + } + return NewWithLicenseItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewLicensesRequestBuilderInternal instantiates a new LicensesRequestBuilder and sets the default values. +func NewLicensesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LicensesRequestBuilder) { + m := &LicensesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/licenses{?featured*,page*,per_page*}", pathParameters), + } + return m +} +// NewLicensesRequestBuilder instantiates a new LicensesRequestBuilder and sets the default values. +func NewLicensesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LicensesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewLicensesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the most commonly used licenses on GitHub. For more information, see "[Licensing a repository ](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)." +// returns a []LicenseSimpleable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses +func (m *LicensesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[LicensesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.LicenseSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateLicenseSimpleFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.LicenseSimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.LicenseSimpleable) + } + } + return val, nil +} +// ToGetRequestInformation lists the most commonly used licenses on GitHub. For more information, see "[Licensing a repository ](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)." +// returns a *RequestInformation when successful +func (m *LicensesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[LicensesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *LicensesRequestBuilder when successful +func (m *LicensesRequestBuilder) WithUrl(rawUrl string)(*LicensesRequestBuilder) { + return NewLicensesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/licenses/with_license_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/licenses/with_license_item_request_builder.go new file mode 100644 index 000000000..aa7bf6df4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/licenses/with_license_item_request_builder.go @@ -0,0 +1,63 @@ +package licenses + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// WithLicenseItemRequestBuilder builds and executes requests for operations under \licenses\{license} +type WithLicenseItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithLicenseItemRequestBuilderInternal instantiates a new WithLicenseItemRequestBuilder and sets the default values. +func NewWithLicenseItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithLicenseItemRequestBuilder) { + m := &WithLicenseItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/licenses/{license}", pathParameters), + } + return m +} +// NewWithLicenseItemRequestBuilder instantiates a new WithLicenseItemRequestBuilder and sets the default values. +func NewWithLicenseItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithLicenseItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithLicenseItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets information about a specific license. For more information, see "[Licensing a repository ](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)." +// returns a Licenseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/licenses/licenses#get-a-license +func (m *WithLicenseItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Licenseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateLicenseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Licenseable), nil +} +// ToGetRequestInformation gets information about a specific license. For more information, see "[Licensing a repository ](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)." +// returns a *RequestInformation when successful +func (m *WithLicenseItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *WithLicenseItemRequestBuilder when successful +func (m *WithLicenseItemRequestBuilder) WithUrl(rawUrl string)(*WithLicenseItemRequestBuilder) { + return NewWithLicenseItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/markdown/markdown_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/markdown/markdown_post_request_body.go new file mode 100644 index 000000000..b6aa988ac --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/markdown/markdown_post_request_body.go @@ -0,0 +1,141 @@ +package markdown + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MarkdownPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The repository context to use when creating references in `gfm` mode. For example, setting `context` to `octo-org/octo-repo` will change the text `#42` into an HTML link to issue 42 in the `octo-org/octo-repo` repository. + context *string + // The rendering mode. + mode *MarkdownPostRequestBody_mode + // The Markdown text to render in HTML. + text *string +} +// NewMarkdownPostRequestBody instantiates a new MarkdownPostRequestBody and sets the default values. +func NewMarkdownPostRequestBody()(*MarkdownPostRequestBody) { + m := &MarkdownPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + modeValue := MARKDOWN_MARKDOWNPOSTREQUESTBODY_MODE + m.SetMode(&modeValue) + return m +} +// CreateMarkdownPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMarkdownPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMarkdownPostRequestBody(), 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 *MarkdownPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContext gets the context property value. The repository context to use when creating references in `gfm` mode. For example, setting `context` to `octo-org/octo-repo` will change the text `#42` into an HTML link to issue 42 in the `octo-org/octo-repo` repository. +// returns a *string when successful +func (m *MarkdownPostRequestBody) GetContext()(*string) { + return m.context +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MarkdownPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + return nil + } + res["mode"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseMarkdownPostRequestBody_mode) + if err != nil { + return err + } + if val != nil { + m.SetMode(val.(*MarkdownPostRequestBody_mode)) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetMode gets the mode property value. The rendering mode. +// returns a *MarkdownPostRequestBody_mode when successful +func (m *MarkdownPostRequestBody) GetMode()(*MarkdownPostRequestBody_mode) { + return m.mode +} +// GetText gets the text property value. The Markdown text to render in HTML. +// returns a *string when successful +func (m *MarkdownPostRequestBody) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *MarkdownPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("context", m.GetContext()) + if err != nil { + return err + } + } + if m.GetMode() != nil { + cast := (*m.GetMode()).String() + err := writer.WriteStringValue("mode", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + 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 *MarkdownPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContext sets the context property value. The repository context to use when creating references in `gfm` mode. For example, setting `context` to `octo-org/octo-repo` will change the text `#42` into an HTML link to issue 42 in the `octo-org/octo-repo` repository. +func (m *MarkdownPostRequestBody) SetContext(value *string)() { + m.context = value +} +// SetMode sets the mode property value. The rendering mode. +func (m *MarkdownPostRequestBody) SetMode(value *MarkdownPostRequestBody_mode)() { + m.mode = value +} +// SetText sets the text property value. The Markdown text to render in HTML. +func (m *MarkdownPostRequestBody) SetText(value *string)() { + m.text = value +} +type MarkdownPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContext()(*string) + GetMode()(*MarkdownPostRequestBody_mode) + GetText()(*string) + SetContext(value *string)() + SetMode(value *MarkdownPostRequestBody_mode)() + SetText(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/markdown/markdown_post_request_body_mode.go b/vendor/github.com/octokit/go-sdk/pkg/github/markdown/markdown_post_request_body_mode.go new file mode 100644 index 000000000..013f3d211 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/markdown/markdown_post_request_body_mode.go @@ -0,0 +1,37 @@ +package markdown +import ( + "errors" +) +// The rendering mode. +type MarkdownPostRequestBody_mode int + +const ( + MARKDOWN_MARKDOWNPOSTREQUESTBODY_MODE MarkdownPostRequestBody_mode = iota + GFM_MARKDOWNPOSTREQUESTBODY_MODE +) + +func (i MarkdownPostRequestBody_mode) String() string { + return []string{"markdown", "gfm"}[i] +} +func ParseMarkdownPostRequestBody_mode(v string) (any, error) { + result := MARKDOWN_MARKDOWNPOSTREQUESTBODY_MODE + switch v { + case "markdown": + result = MARKDOWN_MARKDOWNPOSTREQUESTBODY_MODE + case "gfm": + result = GFM_MARKDOWNPOSTREQUESTBODY_MODE + default: + return 0, errors.New("Unknown MarkdownPostRequestBody_mode value: " + v) + } + return &result, nil +} +func SerializeMarkdownPostRequestBody_mode(values []MarkdownPostRequestBody_mode) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i MarkdownPostRequestBody_mode) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/markdown/markdown_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/markdown/markdown_request_builder.go new file mode 100644 index 000000000..26068d9aa --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/markdown/markdown_request_builder.go @@ -0,0 +1,60 @@ +package markdown + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// MarkdownRequestBuilder builds and executes requests for operations under \markdown +type MarkdownRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewMarkdownRequestBuilderInternal instantiates a new MarkdownRequestBuilder and sets the default values. +func NewMarkdownRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MarkdownRequestBuilder) { + m := &MarkdownRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/markdown", pathParameters), + } + return m +} +// NewMarkdownRequestBuilder instantiates a new MarkdownRequestBuilder and sets the default values. +func NewMarkdownRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MarkdownRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMarkdownRequestBuilderInternal(urlParams, requestAdapter) +} +// Post render a Markdown document +// [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])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Raw the raw property +// returns a *RawRequestBuilder when successful +func (m *MarkdownRequestBuilder) Raw()(*RawRequestBuilder) { + return NewRawRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// returns a *RequestInformation when successful +func (m *MarkdownRequestBuilder) ToPostRequestInformation(ctx context.Context, body MarkdownPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "text/html") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *MarkdownRequestBuilder when successful +func (m *MarkdownRequestBuilder) WithUrl(rawUrl string)(*MarkdownRequestBuilder) { + return NewMarkdownRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/markdown/raw_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/markdown/raw_request_builder.go new file mode 100644 index 000000000..952132ee0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/markdown/raw_request_builder.go @@ -0,0 +1,53 @@ +package markdown + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// RawRequestBuilder builds and executes requests for operations under \markdown\raw +type RawRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewRawRequestBuilderInternal instantiates a new RawRequestBuilder and sets the default values. +func NewRawRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RawRequestBuilder) { + m := &RawRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/markdown/raw", pathParameters), + } + return m +} +// NewRawRequestBuilder instantiates a new RawRequestBuilder and sets the default values. +func NewRawRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RawRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + 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. +// [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])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + 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 +func (m *RawRequestBuilder) ToPostRequestInformation(ctx context.Context, body *string, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "text/html") + requestInfo.SetContentFromScalar(ctx, m.BaseRequestBuilder.RequestAdapter, "text/plain", body) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *RawRequestBuilder when successful +func (m *RawRequestBuilder) WithUrl(rawUrl string)(*RawRequestBuilder) { + return NewRawRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/accounts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/accounts_request_builder.go new file mode 100644 index 000000000..051d0f976 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/accounts_request_builder.go @@ -0,0 +1,34 @@ +package marketplace_listing + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// AccountsRequestBuilder builds and executes requests for operations under \marketplace_listing\accounts +type AccountsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByAccount_id gets an item from the github.com/octokit/go-sdk/pkg/github.marketplace_listing.accounts.item collection +// returns a *AccountsWithAccount_ItemRequestBuilder when successful +func (m *AccountsRequestBuilder) ByAccount_id(account_id int32)(*AccountsWithAccount_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["account_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(account_id), 10) + return NewAccountsWithAccount_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewAccountsRequestBuilderInternal instantiates a new AccountsRequestBuilder and sets the default values. +func NewAccountsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AccountsRequestBuilder) { + m := &AccountsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/marketplace_listing/accounts", pathParameters), + } + return m +} +// NewAccountsRequestBuilder instantiates a new AccountsRequestBuilder and sets the default values. +func NewAccountsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AccountsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAccountsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/accounts_with_account_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/accounts_with_account_item_request_builder.go new file mode 100644 index 000000000..5737fdbc4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/accounts_with_account_item_request_builder.go @@ -0,0 +1,63 @@ +package marketplace_listing + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// AccountsWithAccount_ItemRequestBuilder builds and executes requests for operations under \marketplace_listing\accounts\{account_id} +type AccountsWithAccount_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewAccountsWithAccount_ItemRequestBuilderInternal instantiates a new AccountsWithAccount_ItemRequestBuilder and sets the default values. +func NewAccountsWithAccount_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AccountsWithAccount_ItemRequestBuilder) { + m := &AccountsWithAccount_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/marketplace_listing/accounts/{account_id}", pathParameters), + } + return m +} +// NewAccountsWithAccount_ItemRequestBuilder instantiates a new AccountsWithAccount_ItemRequestBuilder and sets the default values. +func NewAccountsWithAccount_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AccountsWithAccount_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAccountsWithAccount_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint. +// returns a MarketplacePurchaseable when successful +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account +func (m *AccountsWithAccount_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MarketplacePurchaseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMarketplacePurchaseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MarketplacePurchaseable), nil +} +// ToGetRequestInformation shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint. +// returns a *RequestInformation when successful +func (m *AccountsWithAccount_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *AccountsWithAccount_ItemRequestBuilder when successful +func (m *AccountsWithAccount_ItemRequestBuilder) WithUrl(rawUrl string)(*AccountsWithAccount_ItemRequestBuilder) { + return NewAccountsWithAccount_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/marketplace_listing_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/marketplace_listing_request_builder.go new file mode 100644 index 000000000..6a874d5ea --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/marketplace_listing_request_builder.go @@ -0,0 +1,38 @@ +package marketplace_listing + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// Marketplace_listingRequestBuilder builds and executes requests for operations under \marketplace_listing +type Marketplace_listingRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Accounts the accounts property +// returns a *AccountsRequestBuilder when successful +func (m *Marketplace_listingRequestBuilder) Accounts()(*AccountsRequestBuilder) { + return NewAccountsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewMarketplace_listingRequestBuilderInternal instantiates a new Marketplace_listingRequestBuilder and sets the default values. +func NewMarketplace_listingRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Marketplace_listingRequestBuilder) { + m := &Marketplace_listingRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/marketplace_listing", pathParameters), + } + return m +} +// NewMarketplace_listingRequestBuilder instantiates a new Marketplace_listingRequestBuilder and sets the default values. +func NewMarketplace_listingRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Marketplace_listingRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMarketplace_listingRequestBuilderInternal(urlParams, requestAdapter) +} +// Plans the plans property +// returns a *PlansRequestBuilder when successful +func (m *Marketplace_listingRequestBuilder) Plans()(*PlansRequestBuilder) { + return NewPlansRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Stubbed the stubbed property +// returns a *StubbedRequestBuilder when successful +func (m *Marketplace_listingRequestBuilder) Stubbed()(*StubbedRequestBuilder) { + return NewStubbedRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/plans/item/accounts/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/plans/item/accounts/get_direction_query_parameter_type.go new file mode 100644 index 000000000..8d6726fff --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/plans/item/accounts/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package accounts +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/plans/item/accounts/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/plans/item/accounts/get_sort_query_parameter_type.go new file mode 100644 index 000000000..5ecd106ef --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/plans/item/accounts/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package accounts +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/plans_item_accounts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/plans_item_accounts_request_builder.go new file mode 100644 index 000000000..b18f0307a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/plans_item_accounts_request_builder.go @@ -0,0 +1,80 @@ +package marketplace_listing + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i56b9d03293585ca583bbb85dc6c217737665c7595f6e6dc578f5a52298ca9b7b "github.com/octokit/go-sdk/pkg/github/marketplace_listing/plans/item/accounts" +) + +// PlansItemAccountsRequestBuilder builds and executes requests for operations under \marketplace_listing\plans\{plan_id}\accounts +type PlansItemAccountsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// PlansItemAccountsRequestBuilderGetQueryParameters returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint. +type PlansItemAccountsRequestBuilderGetQueryParameters struct { + // To return the oldest accounts first, set to `asc`. Ignored without the `sort` parameter. + Direction *i56b9d03293585ca583bbb85dc6c217737665c7595f6e6dc578f5a52298ca9b7b.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The property to sort the results by. + Sort *i56b9d03293585ca583bbb85dc6c217737665c7595f6e6dc578f5a52298ca9b7b.GetSortQueryParameterType `uriparametername:"sort"` +} +// NewPlansItemAccountsRequestBuilderInternal instantiates a new PlansItemAccountsRequestBuilder and sets the default values. +func NewPlansItemAccountsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PlansItemAccountsRequestBuilder) { + m := &PlansItemAccountsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/marketplace_listing/plans/{plan_id}/accounts{?direction*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewPlansItemAccountsRequestBuilder instantiates a new PlansItemAccountsRequestBuilder and sets the default values. +func NewPlansItemAccountsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PlansItemAccountsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPlansItemAccountsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint. +// returns a []MarketplacePurchaseable when successful +// returns a BasicError error when the service returns a 401 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan +func (m *PlansItemAccountsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PlansItemAccountsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MarketplacePurchaseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMarketplacePurchaseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MarketplacePurchaseable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MarketplacePurchaseable) + } + } + return val, nil +} +// ToGetRequestInformation returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint. +// returns a *RequestInformation when successful +func (m *PlansItemAccountsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PlansItemAccountsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *PlansItemAccountsRequestBuilder when successful +func (m *PlansItemAccountsRequestBuilder) WithUrl(rawUrl string)(*PlansItemAccountsRequestBuilder) { + return NewPlansItemAccountsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/plans_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/plans_request_builder.go new file mode 100644 index 000000000..83716579f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/plans_request_builder.go @@ -0,0 +1,84 @@ +package marketplace_listing + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// PlansRequestBuilder builds and executes requests for operations under \marketplace_listing\plans +type PlansRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// PlansRequestBuilderGetQueryParameters lists all plans that are part of your GitHub Marketplace listing.GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint. +type PlansRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByPlan_id gets an item from the github.com/octokit/go-sdk/pkg/github.marketplace_listing.plans.item collection +// returns a *PlansWithPlan_ItemRequestBuilder when successful +func (m *PlansRequestBuilder) ByPlan_id(plan_id int32)(*PlansWithPlan_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["plan_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(plan_id), 10) + return NewPlansWithPlan_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewPlansRequestBuilderInternal instantiates a new PlansRequestBuilder and sets the default values. +func NewPlansRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PlansRequestBuilder) { + m := &PlansRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/marketplace_listing/plans{?page*,per_page*}", pathParameters), + } + return m +} +// NewPlansRequestBuilder instantiates a new PlansRequestBuilder and sets the default values. +func NewPlansRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PlansRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPlansRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all plans that are part of your GitHub Marketplace listing.GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint. +// returns a []MarketplaceListingPlanable when successful +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/marketplace#list-plans +func (m *PlansRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PlansRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MarketplaceListingPlanable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMarketplaceListingPlanFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MarketplaceListingPlanable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MarketplaceListingPlanable) + } + } + return val, nil +} +// ToGetRequestInformation lists all plans that are part of your GitHub Marketplace listing.GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint. +// returns a *RequestInformation when successful +func (m *PlansRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PlansRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *PlansRequestBuilder when successful +func (m *PlansRequestBuilder) WithUrl(rawUrl string)(*PlansRequestBuilder) { + return NewPlansRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/plans_with_plan_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/plans_with_plan_item_request_builder.go new file mode 100644 index 000000000..85b6d40eb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/plans_with_plan_item_request_builder.go @@ -0,0 +1,28 @@ +package marketplace_listing + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// PlansWithPlan_ItemRequestBuilder builds and executes requests for operations under \marketplace_listing\plans\{plan_id} +type PlansWithPlan_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Accounts the accounts property +// returns a *PlansItemAccountsRequestBuilder when successful +func (m *PlansWithPlan_ItemRequestBuilder) Accounts()(*PlansItemAccountsRequestBuilder) { + return NewPlansItemAccountsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewPlansWithPlan_ItemRequestBuilderInternal instantiates a new PlansWithPlan_ItemRequestBuilder and sets the default values. +func NewPlansWithPlan_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PlansWithPlan_ItemRequestBuilder) { + m := &PlansWithPlan_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/marketplace_listing/plans/{plan_id}", pathParameters), + } + return m +} +// NewPlansWithPlan_ItemRequestBuilder instantiates a new PlansWithPlan_ItemRequestBuilder and sets the default values. +func NewPlansWithPlan_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PlansWithPlan_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPlansWithPlan_ItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed/plans/item/accounts/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed/plans/item/accounts/get_direction_query_parameter_type.go new file mode 100644 index 000000000..8d6726fff --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed/plans/item/accounts/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package accounts +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed/plans/item/accounts/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed/plans/item/accounts/get_sort_query_parameter_type.go new file mode 100644 index 000000000..5ecd106ef --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed/plans/item/accounts/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package accounts +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_accounts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_accounts_request_builder.go new file mode 100644 index 000000000..ca62da0f8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_accounts_request_builder.go @@ -0,0 +1,34 @@ +package marketplace_listing + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// StubbedAccountsRequestBuilder builds and executes requests for operations under \marketplace_listing\stubbed\accounts +type StubbedAccountsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByAccount_id gets an item from the github.com/octokit/go-sdk/pkg/github.marketplace_listing.stubbed.accounts.item collection +// returns a *StubbedAccountsWithAccount_ItemRequestBuilder when successful +func (m *StubbedAccountsRequestBuilder) ByAccount_id(account_id int32)(*StubbedAccountsWithAccount_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["account_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(account_id), 10) + return NewStubbedAccountsWithAccount_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewStubbedAccountsRequestBuilderInternal instantiates a new StubbedAccountsRequestBuilder and sets the default values. +func NewStubbedAccountsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StubbedAccountsRequestBuilder) { + m := &StubbedAccountsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/marketplace_listing/stubbed/accounts", pathParameters), + } + return m +} +// NewStubbedAccountsRequestBuilder instantiates a new StubbedAccountsRequestBuilder and sets the default values. +func NewStubbedAccountsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StubbedAccountsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStubbedAccountsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_accounts_with_account_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_accounts_with_account_item_request_builder.go new file mode 100644 index 000000000..d98c3a142 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_accounts_with_account_item_request_builder.go @@ -0,0 +1,61 @@ +package marketplace_listing + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// StubbedAccountsWithAccount_ItemRequestBuilder builds and executes requests for operations under \marketplace_listing\stubbed\accounts\{account_id} +type StubbedAccountsWithAccount_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewStubbedAccountsWithAccount_ItemRequestBuilderInternal instantiates a new StubbedAccountsWithAccount_ItemRequestBuilder and sets the default values. +func NewStubbedAccountsWithAccount_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StubbedAccountsWithAccount_ItemRequestBuilder) { + m := &StubbedAccountsWithAccount_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/marketplace_listing/stubbed/accounts/{account_id}", pathParameters), + } + return m +} +// NewStubbedAccountsWithAccount_ItemRequestBuilder instantiates a new StubbedAccountsWithAccount_ItemRequestBuilder and sets the default values. +func NewStubbedAccountsWithAccount_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StubbedAccountsWithAccount_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStubbedAccountsWithAccount_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint. +// returns a MarketplacePurchaseable when successful +// returns a BasicError error when the service returns a 401 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account-stubbed +func (m *StubbedAccountsWithAccount_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MarketplacePurchaseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMarketplacePurchaseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MarketplacePurchaseable), nil +} +// ToGetRequestInformation shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint. +// returns a *RequestInformation when successful +func (m *StubbedAccountsWithAccount_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *StubbedAccountsWithAccount_ItemRequestBuilder when successful +func (m *StubbedAccountsWithAccount_ItemRequestBuilder) WithUrl(rawUrl string)(*StubbedAccountsWithAccount_ItemRequestBuilder) { + return NewStubbedAccountsWithAccount_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_plans_item_accounts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_plans_item_accounts_request_builder.go new file mode 100644 index 000000000..50802218e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_plans_item_accounts_request_builder.go @@ -0,0 +1,76 @@ +package marketplace_listing + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + ib2201bb0242d254ae6bcc1c5b32345ae2ac3863ba8e87cb7a02fb6b325aff8aa "github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed/plans/item/accounts" +) + +// StubbedPlansItemAccountsRequestBuilder builds and executes requests for operations under \marketplace_listing\stubbed\plans\{plan_id}\accounts +type StubbedPlansItemAccountsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// StubbedPlansItemAccountsRequestBuilderGetQueryParameters returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint. +type StubbedPlansItemAccountsRequestBuilderGetQueryParameters struct { + // To return the oldest accounts first, set to `asc`. Ignored without the `sort` parameter. + Direction *ib2201bb0242d254ae6bcc1c5b32345ae2ac3863ba8e87cb7a02fb6b325aff8aa.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The property to sort the results by. + Sort *ib2201bb0242d254ae6bcc1c5b32345ae2ac3863ba8e87cb7a02fb6b325aff8aa.GetSortQueryParameterType `uriparametername:"sort"` +} +// NewStubbedPlansItemAccountsRequestBuilderInternal instantiates a new StubbedPlansItemAccountsRequestBuilder and sets the default values. +func NewStubbedPlansItemAccountsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StubbedPlansItemAccountsRequestBuilder) { + m := &StubbedPlansItemAccountsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/marketplace_listing/stubbed/plans/{plan_id}/accounts{?direction*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewStubbedPlansItemAccountsRequestBuilder instantiates a new StubbedPlansItemAccountsRequestBuilder and sets the default values. +func NewStubbedPlansItemAccountsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StubbedPlansItemAccountsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStubbedPlansItemAccountsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint. +// returns a []MarketplacePurchaseable when successful +// returns a BasicError error when the service returns a 401 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan-stubbed +func (m *StubbedPlansItemAccountsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[StubbedPlansItemAccountsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MarketplacePurchaseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMarketplacePurchaseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MarketplacePurchaseable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MarketplacePurchaseable) + } + } + return val, nil +} +// ToGetRequestInformation returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint. +// returns a *RequestInformation when successful +func (m *StubbedPlansItemAccountsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[StubbedPlansItemAccountsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *StubbedPlansItemAccountsRequestBuilder when successful +func (m *StubbedPlansItemAccountsRequestBuilder) WithUrl(rawUrl string)(*StubbedPlansItemAccountsRequestBuilder) { + return NewStubbedPlansItemAccountsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_plans_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_plans_request_builder.go new file mode 100644 index 000000000..349ef1cb0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_plans_request_builder.go @@ -0,0 +1,82 @@ +package marketplace_listing + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// StubbedPlansRequestBuilder builds and executes requests for operations under \marketplace_listing\stubbed\plans +type StubbedPlansRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// StubbedPlansRequestBuilderGetQueryParameters lists all plans that are part of your GitHub Marketplace listing.GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint. +type StubbedPlansRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByPlan_id gets an item from the github.com/octokit/go-sdk/pkg/github.marketplace_listing.stubbed.plans.item collection +// returns a *StubbedPlansWithPlan_ItemRequestBuilder when successful +func (m *StubbedPlansRequestBuilder) ByPlan_id(plan_id int32)(*StubbedPlansWithPlan_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["plan_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(plan_id), 10) + return NewStubbedPlansWithPlan_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewStubbedPlansRequestBuilderInternal instantiates a new StubbedPlansRequestBuilder and sets the default values. +func NewStubbedPlansRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StubbedPlansRequestBuilder) { + m := &StubbedPlansRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/marketplace_listing/stubbed/plans{?page*,per_page*}", pathParameters), + } + return m +} +// NewStubbedPlansRequestBuilder instantiates a new StubbedPlansRequestBuilder and sets the default values. +func NewStubbedPlansRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StubbedPlansRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStubbedPlansRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all plans that are part of your GitHub Marketplace listing.GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint. +// returns a []MarketplaceListingPlanable when successful +// returns a BasicError error when the service returns a 401 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/marketplace#list-plans-stubbed +func (m *StubbedPlansRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[StubbedPlansRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MarketplaceListingPlanable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMarketplaceListingPlanFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MarketplaceListingPlanable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MarketplaceListingPlanable) + } + } + return val, nil +} +// ToGetRequestInformation lists all plans that are part of your GitHub Marketplace listing.GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint. +// returns a *RequestInformation when successful +func (m *StubbedPlansRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[StubbedPlansRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *StubbedPlansRequestBuilder when successful +func (m *StubbedPlansRequestBuilder) WithUrl(rawUrl string)(*StubbedPlansRequestBuilder) { + return NewStubbedPlansRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_plans_with_plan_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_plans_with_plan_item_request_builder.go new file mode 100644 index 000000000..2f70c2df6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_plans_with_plan_item_request_builder.go @@ -0,0 +1,28 @@ +package marketplace_listing + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// StubbedPlansWithPlan_ItemRequestBuilder builds and executes requests for operations under \marketplace_listing\stubbed\plans\{plan_id} +type StubbedPlansWithPlan_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Accounts the accounts property +// returns a *StubbedPlansItemAccountsRequestBuilder when successful +func (m *StubbedPlansWithPlan_ItemRequestBuilder) Accounts()(*StubbedPlansItemAccountsRequestBuilder) { + return NewStubbedPlansItemAccountsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewStubbedPlansWithPlan_ItemRequestBuilderInternal instantiates a new StubbedPlansWithPlan_ItemRequestBuilder and sets the default values. +func NewStubbedPlansWithPlan_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StubbedPlansWithPlan_ItemRequestBuilder) { + m := &StubbedPlansWithPlan_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/marketplace_listing/stubbed/plans/{plan_id}", pathParameters), + } + return m +} +// NewStubbedPlansWithPlan_ItemRequestBuilder instantiates a new StubbedPlansWithPlan_ItemRequestBuilder and sets the default values. +func NewStubbedPlansWithPlan_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StubbedPlansWithPlan_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStubbedPlansWithPlan_ItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_request_builder.go new file mode 100644 index 000000000..2f673eeee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed_request_builder.go @@ -0,0 +1,33 @@ +package marketplace_listing + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// StubbedRequestBuilder builds and executes requests for operations under \marketplace_listing\stubbed +type StubbedRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Accounts the accounts property +// returns a *StubbedAccountsRequestBuilder when successful +func (m *StubbedRequestBuilder) Accounts()(*StubbedAccountsRequestBuilder) { + return NewStubbedAccountsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewStubbedRequestBuilderInternal instantiates a new StubbedRequestBuilder and sets the default values. +func NewStubbedRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StubbedRequestBuilder) { + m := &StubbedRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/marketplace_listing/stubbed", pathParameters), + } + return m +} +// NewStubbedRequestBuilder instantiates a new StubbedRequestBuilder and sets the default values. +func NewStubbedRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StubbedRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStubbedRequestBuilderInternal(urlParams, requestAdapter) +} +// Plans the plans property +// returns a *StubbedPlansRequestBuilder when successful +func (m *StubbedRequestBuilder) Plans()(*StubbedPlansRequestBuilder) { + return NewStubbedPlansRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/meta/meta_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/meta/meta_request_builder.go new file mode 100644 index 000000000..7b157d84e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/meta/meta_request_builder.go @@ -0,0 +1,57 @@ +package meta + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// MetaRequestBuilder builds and executes requests for operations under \meta +type MetaRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewMetaRequestBuilderInternal instantiates a new MetaRequestBuilder and sets the default values. +func NewMetaRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MetaRequestBuilder) { + m := &MetaRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/meta", pathParameters), + } + return m +} +// NewMetaRequestBuilder instantiates a new MetaRequestBuilder and sets the default values. +func NewMetaRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MetaRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMetaRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns meta information about GitHub, including a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://docs.github.com/articles/about-github-s-ip-addresses/)."The API's response also includes a list of GitHub's domain names.The values shown in the documentation's response are example values. You must always query the API directly to get the latest values.**Note:** This endpoint returns both IPv4 and IPv6 addresses. However, not all features support IPv6. You should refer to the specific documentation for each feature to determine if IPv6 is supported. +// returns a ApiOverviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/meta/meta#get-apiname-meta-information +func (m *MetaRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ApiOverviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateApiOverviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ApiOverviewable), nil +} +// ToGetRequestInformation returns meta information about GitHub, including a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://docs.github.com/articles/about-github-s-ip-addresses/)."The API's response also includes a list of GitHub's domain names.The values shown in the documentation's response are example values. You must always query the API directly to get the latest values.**Note:** This endpoint returns both IPv4 and IPv6 addresses. However, not all features support IPv6. You should refer to the specific documentation for each feature to determine if IPv6 is supported. +// returns a *RequestInformation when successful +func (m *MetaRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *MetaRequestBuilder when successful +func (m *MetaRequestBuilder) WithUrl(rawUrl string)(*MetaRequestBuilder) { + return NewMetaRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_billing_usage.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_billing_usage.go new file mode 100644 index 000000000..914e0ca8b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_billing_usage.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsBillingUsage struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The amount of free GitHub Actions minutes available. + included_minutes *int32 + // The minutes_used_breakdown property + minutes_used_breakdown ActionsBillingUsage_minutes_used_breakdownable + // The sum of the free and paid GitHub Actions minutes used. + total_minutes_used *int32 + // The total paid GitHub Actions minutes used. + total_paid_minutes_used *int32 +} +// NewActionsBillingUsage instantiates a new ActionsBillingUsage and sets the default values. +func NewActionsBillingUsage()(*ActionsBillingUsage) { + m := &ActionsBillingUsage{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsBillingUsageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsBillingUsageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsBillingUsage(), 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 *ActionsBillingUsage) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsBillingUsage) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["included_minutes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetIncludedMinutes(val) + } + return nil + } + res["minutes_used_breakdown"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateActionsBillingUsage_minutes_used_breakdownFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMinutesUsedBreakdown(val.(ActionsBillingUsage_minutes_used_breakdownable)) + } + return nil + } + res["total_minutes_used"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalMinutesUsed(val) + } + return nil + } + res["total_paid_minutes_used"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalPaidMinutesUsed(val) + } + return nil + } + return res +} +// GetIncludedMinutes gets the included_minutes property value. The amount of free GitHub Actions minutes available. +// returns a *int32 when successful +func (m *ActionsBillingUsage) GetIncludedMinutes()(*int32) { + return m.included_minutes +} +// GetMinutesUsedBreakdown gets the minutes_used_breakdown property value. The minutes_used_breakdown property +// returns a ActionsBillingUsage_minutes_used_breakdownable when successful +func (m *ActionsBillingUsage) GetMinutesUsedBreakdown()(ActionsBillingUsage_minutes_used_breakdownable) { + return m.minutes_used_breakdown +} +// GetTotalMinutesUsed gets the total_minutes_used property value. The sum of the free and paid GitHub Actions minutes used. +// returns a *int32 when successful +func (m *ActionsBillingUsage) GetTotalMinutesUsed()(*int32) { + return m.total_minutes_used +} +// GetTotalPaidMinutesUsed gets the total_paid_minutes_used property value. The total paid GitHub Actions minutes used. +// returns a *int32 when successful +func (m *ActionsBillingUsage) GetTotalPaidMinutesUsed()(*int32) { + return m.total_paid_minutes_used +} +// Serialize serializes information the current object +func (m *ActionsBillingUsage) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("included_minutes", m.GetIncludedMinutes()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("minutes_used_breakdown", m.GetMinutesUsedBreakdown()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_minutes_used", m.GetTotalMinutesUsed()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_paid_minutes_used", m.GetTotalPaidMinutesUsed()) + 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 *ActionsBillingUsage) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncludedMinutes sets the included_minutes property value. The amount of free GitHub Actions minutes available. +func (m *ActionsBillingUsage) SetIncludedMinutes(value *int32)() { + m.included_minutes = value +} +// SetMinutesUsedBreakdown sets the minutes_used_breakdown property value. The minutes_used_breakdown property +func (m *ActionsBillingUsage) SetMinutesUsedBreakdown(value ActionsBillingUsage_minutes_used_breakdownable)() { + m.minutes_used_breakdown = value +} +// SetTotalMinutesUsed sets the total_minutes_used property value. The sum of the free and paid GitHub Actions minutes used. +func (m *ActionsBillingUsage) SetTotalMinutesUsed(value *int32)() { + m.total_minutes_used = value +} +// SetTotalPaidMinutesUsed sets the total_paid_minutes_used property value. The total paid GitHub Actions minutes used. +func (m *ActionsBillingUsage) SetTotalPaidMinutesUsed(value *int32)() { + m.total_paid_minutes_used = value +} +type ActionsBillingUsageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncludedMinutes()(*int32) + GetMinutesUsedBreakdown()(ActionsBillingUsage_minutes_used_breakdownable) + GetTotalMinutesUsed()(*int32) + GetTotalPaidMinutesUsed()(*int32) + SetIncludedMinutes(value *int32)() + SetMinutesUsedBreakdown(value ActionsBillingUsage_minutes_used_breakdownable)() + SetTotalMinutesUsed(value *int32)() + SetTotalPaidMinutesUsed(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_billing_usage_minutes_used_breakdown.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_billing_usage_minutes_used_breakdown.go new file mode 100644 index 000000000..03a291b65 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_billing_usage_minutes_used_breakdown.go @@ -0,0 +1,486 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsBillingUsage_minutes_used_breakdown struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Total minutes used on macOS runner machines. + mACOS *int32 + // Total minutes used on macOS 12 core runner machines. + macos_12_core *int32 + // Total minutes used on all runner machines. + total *int32 + // Total minutes used on Ubuntu runner machines. + uBUNTU *int32 + // Total minutes used on Ubuntu 16 core runner machines. + ubuntu_16_core *int32 + // Total minutes used on Ubuntu 32 core runner machines. + ubuntu_32_core *int32 + // Total minutes used on Ubuntu 4 core runner machines. + ubuntu_4_core *int32 + // Total minutes used on Ubuntu 64 core runner machines. + ubuntu_64_core *int32 + // Total minutes used on Ubuntu 8 core runner machines. + ubuntu_8_core *int32 + // Total minutes used on Windows runner machines. + wINDOWS *int32 + // Total minutes used on Windows 16 core runner machines. + windows_16_core *int32 + // Total minutes used on Windows 32 core runner machines. + windows_32_core *int32 + // Total minutes used on Windows 4 core runner machines. + windows_4_core *int32 + // Total minutes used on Windows 64 core runner machines. + windows_64_core *int32 + // Total minutes used on Windows 8 core runner machines. + windows_8_core *int32 +} +// NewActionsBillingUsage_minutes_used_breakdown instantiates a new ActionsBillingUsage_minutes_used_breakdown and sets the default values. +func NewActionsBillingUsage_minutes_used_breakdown()(*ActionsBillingUsage_minutes_used_breakdown) { + m := &ActionsBillingUsage_minutes_used_breakdown{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsBillingUsage_minutes_used_breakdownFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsBillingUsage_minutes_used_breakdownFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsBillingUsage_minutes_used_breakdown(), 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 *ActionsBillingUsage_minutes_used_breakdown) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsBillingUsage_minutes_used_breakdown) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["MACOS"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMACOS(val) + } + return nil + } + res["macos_12_core"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMacos12Core(val) + } + return nil + } + res["total"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotal(val) + } + return nil + } + res["UBUNTU"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUBUNTU(val) + } + return nil + } + res["ubuntu_16_core"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUbuntu16Core(val) + } + return nil + } + res["ubuntu_32_core"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUbuntu32Core(val) + } + return nil + } + res["ubuntu_4_core"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUbuntu4Core(val) + } + return nil + } + res["ubuntu_64_core"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUbuntu64Core(val) + } + return nil + } + res["ubuntu_8_core"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUbuntu8Core(val) + } + return nil + } + res["WINDOWS"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWINDOWS(val) + } + return nil + } + res["windows_16_core"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWindows16Core(val) + } + return nil + } + res["windows_32_core"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWindows32Core(val) + } + return nil + } + res["windows_4_core"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWindows4Core(val) + } + return nil + } + res["windows_64_core"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWindows64Core(val) + } + return nil + } + res["windows_8_core"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWindows8Core(val) + } + return nil + } + return res +} +// GetMACOS gets the MACOS property value. Total minutes used on macOS runner machines. +// returns a *int32 when successful +func (m *ActionsBillingUsage_minutes_used_breakdown) GetMACOS()(*int32) { + return m.mACOS +} +// GetMacos12Core gets the macos_12_core property value. Total minutes used on macOS 12 core runner machines. +// returns a *int32 when successful +func (m *ActionsBillingUsage_minutes_used_breakdown) GetMacos12Core()(*int32) { + return m.macos_12_core +} +// GetTotal gets the total property value. Total minutes used on all runner machines. +// returns a *int32 when successful +func (m *ActionsBillingUsage_minutes_used_breakdown) GetTotal()(*int32) { + return m.total +} +// GetUBUNTU gets the UBUNTU property value. Total minutes used on Ubuntu runner machines. +// returns a *int32 when successful +func (m *ActionsBillingUsage_minutes_used_breakdown) GetUBUNTU()(*int32) { + return m.uBUNTU +} +// GetUbuntu16Core gets the ubuntu_16_core property value. Total minutes used on Ubuntu 16 core runner machines. +// returns a *int32 when successful +func (m *ActionsBillingUsage_minutes_used_breakdown) GetUbuntu16Core()(*int32) { + return m.ubuntu_16_core +} +// GetUbuntu32Core gets the ubuntu_32_core property value. Total minutes used on Ubuntu 32 core runner machines. +// returns a *int32 when successful +func (m *ActionsBillingUsage_minutes_used_breakdown) GetUbuntu32Core()(*int32) { + return m.ubuntu_32_core +} +// GetUbuntu4Core gets the ubuntu_4_core property value. Total minutes used on Ubuntu 4 core runner machines. +// returns a *int32 when successful +func (m *ActionsBillingUsage_minutes_used_breakdown) GetUbuntu4Core()(*int32) { + return m.ubuntu_4_core +} +// GetUbuntu64Core gets the ubuntu_64_core property value. Total minutes used on Ubuntu 64 core runner machines. +// returns a *int32 when successful +func (m *ActionsBillingUsage_minutes_used_breakdown) GetUbuntu64Core()(*int32) { + return m.ubuntu_64_core +} +// GetUbuntu8Core gets the ubuntu_8_core property value. Total minutes used on Ubuntu 8 core runner machines. +// returns a *int32 when successful +func (m *ActionsBillingUsage_minutes_used_breakdown) GetUbuntu8Core()(*int32) { + return m.ubuntu_8_core +} +// GetWINDOWS gets the WINDOWS property value. Total minutes used on Windows runner machines. +// returns a *int32 when successful +func (m *ActionsBillingUsage_minutes_used_breakdown) GetWINDOWS()(*int32) { + return m.wINDOWS +} +// GetWindows16Core gets the windows_16_core property value. Total minutes used on Windows 16 core runner machines. +// returns a *int32 when successful +func (m *ActionsBillingUsage_minutes_used_breakdown) GetWindows16Core()(*int32) { + return m.windows_16_core +} +// GetWindows32Core gets the windows_32_core property value. Total minutes used on Windows 32 core runner machines. +// returns a *int32 when successful +func (m *ActionsBillingUsage_minutes_used_breakdown) GetWindows32Core()(*int32) { + return m.windows_32_core +} +// GetWindows4Core gets the windows_4_core property value. Total minutes used on Windows 4 core runner machines. +// returns a *int32 when successful +func (m *ActionsBillingUsage_minutes_used_breakdown) GetWindows4Core()(*int32) { + return m.windows_4_core +} +// GetWindows64Core gets the windows_64_core property value. Total minutes used on Windows 64 core runner machines. +// returns a *int32 when successful +func (m *ActionsBillingUsage_minutes_used_breakdown) GetWindows64Core()(*int32) { + return m.windows_64_core +} +// GetWindows8Core gets the windows_8_core property value. Total minutes used on Windows 8 core runner machines. +// returns a *int32 when successful +func (m *ActionsBillingUsage_minutes_used_breakdown) GetWindows8Core()(*int32) { + return m.windows_8_core +} +// Serialize serializes information the current object +func (m *ActionsBillingUsage_minutes_used_breakdown) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("MACOS", m.GetMACOS()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("macos_12_core", m.GetMacos12Core()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total", m.GetTotal()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("UBUNTU", m.GetUBUNTU()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("ubuntu_16_core", m.GetUbuntu16Core()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("ubuntu_32_core", m.GetUbuntu32Core()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("ubuntu_4_core", m.GetUbuntu4Core()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("ubuntu_64_core", m.GetUbuntu64Core()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("ubuntu_8_core", m.GetUbuntu8Core()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("WINDOWS", m.GetWINDOWS()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("windows_16_core", m.GetWindows16Core()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("windows_32_core", m.GetWindows32Core()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("windows_4_core", m.GetWindows4Core()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("windows_64_core", m.GetWindows64Core()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("windows_8_core", m.GetWindows8Core()) + 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 *ActionsBillingUsage_minutes_used_breakdown) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMACOS sets the MACOS property value. Total minutes used on macOS runner machines. +func (m *ActionsBillingUsage_minutes_used_breakdown) SetMACOS(value *int32)() { + m.mACOS = value +} +// SetMacos12Core sets the macos_12_core property value. Total minutes used on macOS 12 core runner machines. +func (m *ActionsBillingUsage_minutes_used_breakdown) SetMacos12Core(value *int32)() { + m.macos_12_core = value +} +// SetTotal sets the total property value. Total minutes used on all runner machines. +func (m *ActionsBillingUsage_minutes_used_breakdown) SetTotal(value *int32)() { + m.total = value +} +// SetUBUNTU sets the UBUNTU property value. Total minutes used on Ubuntu runner machines. +func (m *ActionsBillingUsage_minutes_used_breakdown) SetUBUNTU(value *int32)() { + m.uBUNTU = value +} +// SetUbuntu16Core sets the ubuntu_16_core property value. Total minutes used on Ubuntu 16 core runner machines. +func (m *ActionsBillingUsage_minutes_used_breakdown) SetUbuntu16Core(value *int32)() { + m.ubuntu_16_core = value +} +// SetUbuntu32Core sets the ubuntu_32_core property value. Total minutes used on Ubuntu 32 core runner machines. +func (m *ActionsBillingUsage_minutes_used_breakdown) SetUbuntu32Core(value *int32)() { + m.ubuntu_32_core = value +} +// SetUbuntu4Core sets the ubuntu_4_core property value. Total minutes used on Ubuntu 4 core runner machines. +func (m *ActionsBillingUsage_minutes_used_breakdown) SetUbuntu4Core(value *int32)() { + m.ubuntu_4_core = value +} +// SetUbuntu64Core sets the ubuntu_64_core property value. Total minutes used on Ubuntu 64 core runner machines. +func (m *ActionsBillingUsage_minutes_used_breakdown) SetUbuntu64Core(value *int32)() { + m.ubuntu_64_core = value +} +// SetUbuntu8Core sets the ubuntu_8_core property value. Total minutes used on Ubuntu 8 core runner machines. +func (m *ActionsBillingUsage_minutes_used_breakdown) SetUbuntu8Core(value *int32)() { + m.ubuntu_8_core = value +} +// SetWINDOWS sets the WINDOWS property value. Total minutes used on Windows runner machines. +func (m *ActionsBillingUsage_minutes_used_breakdown) SetWINDOWS(value *int32)() { + m.wINDOWS = value +} +// SetWindows16Core sets the windows_16_core property value. Total minutes used on Windows 16 core runner machines. +func (m *ActionsBillingUsage_minutes_used_breakdown) SetWindows16Core(value *int32)() { + m.windows_16_core = value +} +// SetWindows32Core sets the windows_32_core property value. Total minutes used on Windows 32 core runner machines. +func (m *ActionsBillingUsage_minutes_used_breakdown) SetWindows32Core(value *int32)() { + m.windows_32_core = value +} +// SetWindows4Core sets the windows_4_core property value. Total minutes used on Windows 4 core runner machines. +func (m *ActionsBillingUsage_minutes_used_breakdown) SetWindows4Core(value *int32)() { + m.windows_4_core = value +} +// SetWindows64Core sets the windows_64_core property value. Total minutes used on Windows 64 core runner machines. +func (m *ActionsBillingUsage_minutes_used_breakdown) SetWindows64Core(value *int32)() { + m.windows_64_core = value +} +// SetWindows8Core sets the windows_8_core property value. Total minutes used on Windows 8 core runner machines. +func (m *ActionsBillingUsage_minutes_used_breakdown) SetWindows8Core(value *int32)() { + m.windows_8_core = value +} +type ActionsBillingUsage_minutes_used_breakdownable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMACOS()(*int32) + GetMacos12Core()(*int32) + GetTotal()(*int32) + GetUBUNTU()(*int32) + GetUbuntu16Core()(*int32) + GetUbuntu32Core()(*int32) + GetUbuntu4Core()(*int32) + GetUbuntu64Core()(*int32) + GetUbuntu8Core()(*int32) + GetWINDOWS()(*int32) + GetWindows16Core()(*int32) + GetWindows32Core()(*int32) + GetWindows4Core()(*int32) + GetWindows64Core()(*int32) + GetWindows8Core()(*int32) + SetMACOS(value *int32)() + SetMacos12Core(value *int32)() + SetTotal(value *int32)() + SetUBUNTU(value *int32)() + SetUbuntu16Core(value *int32)() + SetUbuntu32Core(value *int32)() + SetUbuntu4Core(value *int32)() + SetUbuntu64Core(value *int32)() + SetUbuntu8Core(value *int32)() + SetWINDOWS(value *int32)() + SetWindows16Core(value *int32)() + SetWindows32Core(value *int32)() + SetWindows4Core(value *int32)() + SetWindows64Core(value *int32)() + SetWindows8Core(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_cache_list.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_cache_list.go new file mode 100644 index 000000000..4642274a2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_cache_list.go @@ -0,0 +1,122 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ActionsCacheList repository actions caches +type ActionsCacheList struct { + // Array of caches + actions_caches []ActionsCacheList_actions_cachesable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Total number of caches + total_count *int32 +} +// NewActionsCacheList instantiates a new ActionsCacheList and sets the default values. +func NewActionsCacheList()(*ActionsCacheList) { + m := &ActionsCacheList{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsCacheListFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsCacheListFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsCacheList(), nil +} +// GetActionsCaches gets the actions_caches property value. Array of caches +// returns a []ActionsCacheList_actions_cachesable when successful +func (m *ActionsCacheList) GetActionsCaches()([]ActionsCacheList_actions_cachesable) { + return m.actions_caches +} +// 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 *ActionsCacheList) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsCacheList) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actions_caches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateActionsCacheList_actions_cachesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ActionsCacheList_actions_cachesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ActionsCacheList_actions_cachesable) + } + } + m.SetActionsCaches(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. Total number of caches +// returns a *int32 when successful +func (m *ActionsCacheList) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ActionsCacheList) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetActionsCaches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetActionsCaches())) + for i, v := range m.GetActionsCaches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("actions_caches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActionsCaches sets the actions_caches property value. Array of caches +func (m *ActionsCacheList) SetActionsCaches(value []ActionsCacheList_actions_cachesable)() { + m.actions_caches = value +} +// 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 *ActionsCacheList) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. Total number of caches +func (m *ActionsCacheList) SetTotalCount(value *int32)() { + m.total_count = value +} +type ActionsCacheListable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActionsCaches()([]ActionsCacheList_actions_cachesable) + GetTotalCount()(*int32) + SetActionsCaches(value []ActionsCacheList_actions_cachesable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_cache_list_actions_caches.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_cache_list_actions_caches.go new file mode 100644 index 000000000..d13178dcb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_cache_list_actions_caches.go @@ -0,0 +1,255 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsCacheList_actions_caches struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The id property + id *int32 + // The key property + key *string + // The last_accessed_at property + last_accessed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The ref property + ref *string + // The size_in_bytes property + size_in_bytes *int32 + // The version property + version *string +} +// NewActionsCacheList_actions_caches instantiates a new ActionsCacheList_actions_caches and sets the default values. +func NewActionsCacheList_actions_caches()(*ActionsCacheList_actions_caches) { + m := &ActionsCacheList_actions_caches{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsCacheList_actions_cachesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsCacheList_actions_cachesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsCacheList_actions_caches(), 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 *ActionsCacheList_actions_caches) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *ActionsCacheList_actions_caches) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsCacheList_actions_caches) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["last_accessed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastAccessedAt(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["size_in_bytes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSizeInBytes(val) + } + return nil + } + res["version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *ActionsCacheList_actions_caches) GetId()(*int32) { + return m.id +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *ActionsCacheList_actions_caches) GetKey()(*string) { + return m.key +} +// GetLastAccessedAt gets the last_accessed_at property value. The last_accessed_at property +// returns a *Time when successful +func (m *ActionsCacheList_actions_caches) GetLastAccessedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.last_accessed_at +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *ActionsCacheList_actions_caches) GetRef()(*string) { + return m.ref +} +// GetSizeInBytes gets the size_in_bytes property value. The size_in_bytes property +// returns a *int32 when successful +func (m *ActionsCacheList_actions_caches) GetSizeInBytes()(*int32) { + return m.size_in_bytes +} +// GetVersion gets the version property value. The version property +// returns a *string when successful +func (m *ActionsCacheList_actions_caches) GetVersion()(*string) { + return m.version +} +// Serialize serializes information the current object +func (m *ActionsCacheList_actions_caches) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("last_accessed_at", m.GetLastAccessedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size_in_bytes", m.GetSizeInBytes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("version", m.GetVersion()) + 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 *ActionsCacheList_actions_caches) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ActionsCacheList_actions_caches) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *ActionsCacheList_actions_caches) SetId(value *int32)() { + m.id = value +} +// SetKey sets the key property value. The key property +func (m *ActionsCacheList_actions_caches) SetKey(value *string)() { + m.key = value +} +// SetLastAccessedAt sets the last_accessed_at property value. The last_accessed_at property +func (m *ActionsCacheList_actions_caches) SetLastAccessedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.last_accessed_at = value +} +// SetRef sets the ref property value. The ref property +func (m *ActionsCacheList_actions_caches) SetRef(value *string)() { + m.ref = value +} +// SetSizeInBytes sets the size_in_bytes property value. The size_in_bytes property +func (m *ActionsCacheList_actions_caches) SetSizeInBytes(value *int32)() { + m.size_in_bytes = value +} +// SetVersion sets the version property value. The version property +func (m *ActionsCacheList_actions_caches) SetVersion(value *string)() { + m.version = value +} +type ActionsCacheList_actions_cachesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int32) + GetKey()(*string) + GetLastAccessedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetRef()(*string) + GetSizeInBytes()(*int32) + GetVersion()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int32)() + SetKey(value *string)() + SetLastAccessedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetRef(value *string)() + SetSizeInBytes(value *int32)() + SetVersion(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_cache_usage_by_repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_cache_usage_by_repository.go new file mode 100644 index 000000000..956fa8770 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_cache_usage_by_repository.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ActionsCacheUsageByRepository gitHub Actions Cache Usage by repository. +type ActionsCacheUsageByRepository struct { + // The number of active caches in the repository. + active_caches_count *int32 + // The sum of the size in bytes of all the active cache items in the repository. + active_caches_size_in_bytes *int32 + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The repository owner and name for the cache usage being shown. + full_name *string +} +// NewActionsCacheUsageByRepository instantiates a new ActionsCacheUsageByRepository and sets the default values. +func NewActionsCacheUsageByRepository()(*ActionsCacheUsageByRepository) { + m := &ActionsCacheUsageByRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsCacheUsageByRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsCacheUsageByRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsCacheUsageByRepository(), nil +} +// GetActiveCachesCount gets the active_caches_count property value. The number of active caches in the repository. +// returns a *int32 when successful +func (m *ActionsCacheUsageByRepository) GetActiveCachesCount()(*int32) { + return m.active_caches_count +} +// GetActiveCachesSizeInBytes gets the active_caches_size_in_bytes property value. The sum of the size in bytes of all the active cache items in the repository. +// returns a *int32 when successful +func (m *ActionsCacheUsageByRepository) GetActiveCachesSizeInBytes()(*int32) { + return m.active_caches_size_in_bytes +} +// 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 *ActionsCacheUsageByRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsCacheUsageByRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active_caches_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetActiveCachesCount(val) + } + return nil + } + res["active_caches_size_in_bytes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetActiveCachesSizeInBytes(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + return res +} +// GetFullName gets the full_name property value. The repository owner and name for the cache usage being shown. +// returns a *string when successful +func (m *ActionsCacheUsageByRepository) GetFullName()(*string) { + return m.full_name +} +// Serialize serializes information the current object +func (m *ActionsCacheUsageByRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("active_caches_count", m.GetActiveCachesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("active_caches_size_in_bytes", m.GetActiveCachesSizeInBytes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActiveCachesCount sets the active_caches_count property value. The number of active caches in the repository. +func (m *ActionsCacheUsageByRepository) SetActiveCachesCount(value *int32)() { + m.active_caches_count = value +} +// SetActiveCachesSizeInBytes sets the active_caches_size_in_bytes property value. The sum of the size in bytes of all the active cache items in the repository. +func (m *ActionsCacheUsageByRepository) SetActiveCachesSizeInBytes(value *int32)() { + m.active_caches_size_in_bytes = value +} +// 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 *ActionsCacheUsageByRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFullName sets the full_name property value. The repository owner and name for the cache usage being shown. +func (m *ActionsCacheUsageByRepository) SetFullName(value *string)() { + m.full_name = value +} +type ActionsCacheUsageByRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActiveCachesCount()(*int32) + GetActiveCachesSizeInBytes()(*int32) + GetFullName()(*string) + SetActiveCachesCount(value *int32)() + SetActiveCachesSizeInBytes(value *int32)() + SetFullName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_cache_usage_org_enterprise.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_cache_usage_org_enterprise.go new file mode 100644 index 000000000..a1927d98d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_cache_usage_org_enterprise.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsCacheUsageOrgEnterprise struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The count of active caches across all repositories of an enterprise or an organization. + total_active_caches_count *int32 + // The total size in bytes of all active cache items across all repositories of an enterprise or an organization. + total_active_caches_size_in_bytes *int32 +} +// NewActionsCacheUsageOrgEnterprise instantiates a new ActionsCacheUsageOrgEnterprise and sets the default values. +func NewActionsCacheUsageOrgEnterprise()(*ActionsCacheUsageOrgEnterprise) { + m := &ActionsCacheUsageOrgEnterprise{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsCacheUsageOrgEnterpriseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsCacheUsageOrgEnterpriseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsCacheUsageOrgEnterprise(), 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 *ActionsCacheUsageOrgEnterprise) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsCacheUsageOrgEnterprise) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["total_active_caches_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalActiveCachesCount(val) + } + return nil + } + res["total_active_caches_size_in_bytes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalActiveCachesSizeInBytes(val) + } + return nil + } + return res +} +// GetTotalActiveCachesCount gets the total_active_caches_count property value. The count of active caches across all repositories of an enterprise or an organization. +// returns a *int32 when successful +func (m *ActionsCacheUsageOrgEnterprise) GetTotalActiveCachesCount()(*int32) { + return m.total_active_caches_count +} +// GetTotalActiveCachesSizeInBytes gets the total_active_caches_size_in_bytes property value. The total size in bytes of all active cache items across all repositories of an enterprise or an organization. +// returns a *int32 when successful +func (m *ActionsCacheUsageOrgEnterprise) GetTotalActiveCachesSizeInBytes()(*int32) { + return m.total_active_caches_size_in_bytes +} +// Serialize serializes information the current object +func (m *ActionsCacheUsageOrgEnterprise) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_active_caches_count", m.GetTotalActiveCachesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_active_caches_size_in_bytes", m.GetTotalActiveCachesSizeInBytes()) + 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 *ActionsCacheUsageOrgEnterprise) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalActiveCachesCount sets the total_active_caches_count property value. The count of active caches across all repositories of an enterprise or an organization. +func (m *ActionsCacheUsageOrgEnterprise) SetTotalActiveCachesCount(value *int32)() { + m.total_active_caches_count = value +} +// SetTotalActiveCachesSizeInBytes sets the total_active_caches_size_in_bytes property value. The total size in bytes of all active cache items across all repositories of an enterprise or an organization. +func (m *ActionsCacheUsageOrgEnterprise) SetTotalActiveCachesSizeInBytes(value *int32)() { + m.total_active_caches_size_in_bytes = value +} +type ActionsCacheUsageOrgEnterpriseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalActiveCachesCount()(*int32) + GetTotalActiveCachesSizeInBytes()(*int32) + SetTotalActiveCachesCount(value *int32)() + SetTotalActiveCachesSizeInBytes(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_default_workflow_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_default_workflow_permissions.go new file mode 100644 index 000000000..7efe4c0c8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_default_workflow_permissions.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The default workflow permissions granted to the GITHUB_TOKEN when running workflows. +type ActionsDefaultWorkflowPermissions int + +const ( + READ_ACTIONSDEFAULTWORKFLOWPERMISSIONS ActionsDefaultWorkflowPermissions = iota + WRITE_ACTIONSDEFAULTWORKFLOWPERMISSIONS +) + +func (i ActionsDefaultWorkflowPermissions) String() string { + return []string{"read", "write"}[i] +} +func ParseActionsDefaultWorkflowPermissions(v string) (any, error) { + result := READ_ACTIONSDEFAULTWORKFLOWPERMISSIONS + switch v { + case "read": + result = READ_ACTIONSDEFAULTWORKFLOWPERMISSIONS + case "write": + result = WRITE_ACTIONSDEFAULTWORKFLOWPERMISSIONS + default: + return 0, errors.New("Unknown ActionsDefaultWorkflowPermissions value: " + v) + } + return &result, nil +} +func SerializeActionsDefaultWorkflowPermissions(values []ActionsDefaultWorkflowPermissions) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ActionsDefaultWorkflowPermissions) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_get_default_workflow_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_get_default_workflow_permissions.go new file mode 100644 index 000000000..43385fc52 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_get_default_workflow_permissions.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsGetDefaultWorkflowPermissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether GitHub Actions can approve pull requests. Enabling this can be a security risk. + can_approve_pull_request_reviews *bool + // The default workflow permissions granted to the GITHUB_TOKEN when running workflows. + default_workflow_permissions *ActionsDefaultWorkflowPermissions +} +// NewActionsGetDefaultWorkflowPermissions instantiates a new ActionsGetDefaultWorkflowPermissions and sets the default values. +func NewActionsGetDefaultWorkflowPermissions()(*ActionsGetDefaultWorkflowPermissions) { + m := &ActionsGetDefaultWorkflowPermissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsGetDefaultWorkflowPermissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsGetDefaultWorkflowPermissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsGetDefaultWorkflowPermissions(), 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 *ActionsGetDefaultWorkflowPermissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCanApprovePullRequestReviews gets the can_approve_pull_request_reviews property value. Whether GitHub Actions can approve pull requests. Enabling this can be a security risk. +// returns a *bool when successful +func (m *ActionsGetDefaultWorkflowPermissions) GetCanApprovePullRequestReviews()(*bool) { + return m.can_approve_pull_request_reviews +} +// GetDefaultWorkflowPermissions gets the default_workflow_permissions property value. The default workflow permissions granted to the GITHUB_TOKEN when running workflows. +// returns a *ActionsDefaultWorkflowPermissions when successful +func (m *ActionsGetDefaultWorkflowPermissions) GetDefaultWorkflowPermissions()(*ActionsDefaultWorkflowPermissions) { + return m.default_workflow_permissions +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsGetDefaultWorkflowPermissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["can_approve_pull_request_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanApprovePullRequestReviews(val) + } + return nil + } + res["default_workflow_permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseActionsDefaultWorkflowPermissions) + if err != nil { + return err + } + if val != nil { + m.SetDefaultWorkflowPermissions(val.(*ActionsDefaultWorkflowPermissions)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ActionsGetDefaultWorkflowPermissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("can_approve_pull_request_reviews", m.GetCanApprovePullRequestReviews()) + if err != nil { + return err + } + } + if m.GetDefaultWorkflowPermissions() != nil { + cast := (*m.GetDefaultWorkflowPermissions()).String() + err := writer.WriteStringValue("default_workflow_permissions", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ActionsGetDefaultWorkflowPermissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCanApprovePullRequestReviews sets the can_approve_pull_request_reviews property value. Whether GitHub Actions can approve pull requests. Enabling this can be a security risk. +func (m *ActionsGetDefaultWorkflowPermissions) SetCanApprovePullRequestReviews(value *bool)() { + m.can_approve_pull_request_reviews = value +} +// SetDefaultWorkflowPermissions sets the default_workflow_permissions property value. The default workflow permissions granted to the GITHUB_TOKEN when running workflows. +func (m *ActionsGetDefaultWorkflowPermissions) SetDefaultWorkflowPermissions(value *ActionsDefaultWorkflowPermissions)() { + m.default_workflow_permissions = value +} +type ActionsGetDefaultWorkflowPermissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCanApprovePullRequestReviews()(*bool) + GetDefaultWorkflowPermissions()(*ActionsDefaultWorkflowPermissions) + SetCanApprovePullRequestReviews(value *bool)() + SetDefaultWorkflowPermissions(value *ActionsDefaultWorkflowPermissions)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_organization_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_organization_permissions.go new file mode 100644 index 000000000..2ae9e9bee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_organization_permissions.go @@ -0,0 +1,169 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsOrganizationPermissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The permissions policy that controls the actions and reusable workflows that are allowed to run. + allowed_actions *AllowedActions + // The policy that controls the repositories in the organization that are allowed to run GitHub Actions. + enabled_repositories *EnabledRepositories + // The API URL to use to get or set the actions and reusable workflows that are allowed to run, when `allowed_actions` is set to `selected`. + selected_actions_url *string + // The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when `enabled_repositories` is set to `selected`. + selected_repositories_url *string +} +// NewActionsOrganizationPermissions instantiates a new ActionsOrganizationPermissions and sets the default values. +func NewActionsOrganizationPermissions()(*ActionsOrganizationPermissions) { + m := &ActionsOrganizationPermissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsOrganizationPermissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsOrganizationPermissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsOrganizationPermissions(), 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 *ActionsOrganizationPermissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowedActions gets the allowed_actions property value. The permissions policy that controls the actions and reusable workflows that are allowed to run. +// returns a *AllowedActions when successful +func (m *ActionsOrganizationPermissions) GetAllowedActions()(*AllowedActions) { + return m.allowed_actions +} +// GetEnabledRepositories gets the enabled_repositories property value. The policy that controls the repositories in the organization that are allowed to run GitHub Actions. +// returns a *EnabledRepositories when successful +func (m *ActionsOrganizationPermissions) GetEnabledRepositories()(*EnabledRepositories) { + return m.enabled_repositories +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsOrganizationPermissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allowed_actions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAllowedActions) + if err != nil { + return err + } + if val != nil { + m.SetAllowedActions(val.(*AllowedActions)) + } + return nil + } + res["enabled_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseEnabledRepositories) + if err != nil { + return err + } + if val != nil { + m.SetEnabledRepositories(val.(*EnabledRepositories)) + } + return nil + } + res["selected_actions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedActionsUrl(val) + } + return nil + } + res["selected_repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedRepositoriesUrl(val) + } + return nil + } + return res +} +// GetSelectedActionsUrl gets the selected_actions_url property value. The API URL to use to get or set the actions and reusable workflows that are allowed to run, when `allowed_actions` is set to `selected`. +// returns a *string when successful +func (m *ActionsOrganizationPermissions) GetSelectedActionsUrl()(*string) { + return m.selected_actions_url +} +// GetSelectedRepositoriesUrl gets the selected_repositories_url property value. The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when `enabled_repositories` is set to `selected`. +// returns a *string when successful +func (m *ActionsOrganizationPermissions) GetSelectedRepositoriesUrl()(*string) { + return m.selected_repositories_url +} +// Serialize serializes information the current object +func (m *ActionsOrganizationPermissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAllowedActions() != nil { + cast := (*m.GetAllowedActions()).String() + err := writer.WriteStringValue("allowed_actions", &cast) + if err != nil { + return err + } + } + if m.GetEnabledRepositories() != nil { + cast := (*m.GetEnabledRepositories()).String() + err := writer.WriteStringValue("enabled_repositories", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("selected_actions_url", m.GetSelectedActionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("selected_repositories_url", m.GetSelectedRepositoriesUrl()) + 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 *ActionsOrganizationPermissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowedActions sets the allowed_actions property value. The permissions policy that controls the actions and reusable workflows that are allowed to run. +func (m *ActionsOrganizationPermissions) SetAllowedActions(value *AllowedActions)() { + m.allowed_actions = value +} +// SetEnabledRepositories sets the enabled_repositories property value. The policy that controls the repositories in the organization that are allowed to run GitHub Actions. +func (m *ActionsOrganizationPermissions) SetEnabledRepositories(value *EnabledRepositories)() { + m.enabled_repositories = value +} +// SetSelectedActionsUrl sets the selected_actions_url property value. The API URL to use to get or set the actions and reusable workflows that are allowed to run, when `allowed_actions` is set to `selected`. +func (m *ActionsOrganizationPermissions) SetSelectedActionsUrl(value *string)() { + m.selected_actions_url = value +} +// SetSelectedRepositoriesUrl sets the selected_repositories_url property value. The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when `enabled_repositories` is set to `selected`. +func (m *ActionsOrganizationPermissions) SetSelectedRepositoriesUrl(value *string)() { + m.selected_repositories_url = value +} +type ActionsOrganizationPermissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowedActions()(*AllowedActions) + GetEnabledRepositories()(*EnabledRepositories) + GetSelectedActionsUrl()(*string) + GetSelectedRepositoriesUrl()(*string) + SetAllowedActions(value *AllowedActions)() + SetEnabledRepositories(value *EnabledRepositories)() + SetSelectedActionsUrl(value *string)() + SetSelectedRepositoriesUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_public_key.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_public_key.go new file mode 100644 index 000000000..026685143 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_public_key.go @@ -0,0 +1,226 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ActionsPublicKey the public key used for setting Actions Secrets. +type ActionsPublicKey struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *string + // The id property + id *int32 + // The Base64 encoded public key. + key *string + // The identifier for the key. + key_id *string + // The title property + title *string + // The url property + url *string +} +// NewActionsPublicKey instantiates a new ActionsPublicKey and sets the default values. +func NewActionsPublicKey()(*ActionsPublicKey) { + m := &ActionsPublicKey{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsPublicKeyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsPublicKeyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsPublicKey(), 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 *ActionsPublicKey) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *ActionsPublicKey) GetCreatedAt()(*string) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsPublicKey) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *ActionsPublicKey) GetId()(*int32) { + return m.id +} +// GetKey gets the key property value. The Base64 encoded public key. +// returns a *string when successful +func (m *ActionsPublicKey) GetKey()(*string) { + return m.key +} +// GetKeyId gets the key_id property value. The identifier for the key. +// returns a *string when successful +func (m *ActionsPublicKey) GetKeyId()(*string) { + return m.key_id +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *ActionsPublicKey) GetTitle()(*string) { + return m.title +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ActionsPublicKey) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ActionsPublicKey) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ActionsPublicKey) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ActionsPublicKey) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *ActionsPublicKey) SetId(value *int32)() { + m.id = value +} +// SetKey sets the key property value. The Base64 encoded public key. +func (m *ActionsPublicKey) SetKey(value *string)() { + m.key = value +} +// SetKeyId sets the key_id property value. The identifier for the key. +func (m *ActionsPublicKey) SetKeyId(value *string)() { + m.key_id = value +} +// SetTitle sets the title property value. The title property +func (m *ActionsPublicKey) SetTitle(value *string)() { + m.title = value +} +// SetUrl sets the url property value. The url property +func (m *ActionsPublicKey) SetUrl(value *string)() { + m.url = value +} +type ActionsPublicKeyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*string) + GetId()(*int32) + GetKey()(*string) + GetKeyId()(*string) + GetTitle()(*string) + GetUrl()(*string) + SetCreatedAt(value *string)() + SetId(value *int32)() + SetKey(value *string)() + SetKeyId(value *string)() + SetTitle(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_repository_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_repository_permissions.go new file mode 100644 index 000000000..4d8143b76 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_repository_permissions.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsRepositoryPermissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The permissions policy that controls the actions and reusable workflows that are allowed to run. + allowed_actions *AllowedActions + // Whether GitHub Actions is enabled on the repository. + enabled *bool + // The API URL to use to get or set the actions and reusable workflows that are allowed to run, when `allowed_actions` is set to `selected`. + selected_actions_url *string +} +// NewActionsRepositoryPermissions instantiates a new ActionsRepositoryPermissions and sets the default values. +func NewActionsRepositoryPermissions()(*ActionsRepositoryPermissions) { + m := &ActionsRepositoryPermissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsRepositoryPermissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsRepositoryPermissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsRepositoryPermissions(), 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 *ActionsRepositoryPermissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowedActions gets the allowed_actions property value. The permissions policy that controls the actions and reusable workflows that are allowed to run. +// returns a *AllowedActions when successful +func (m *ActionsRepositoryPermissions) GetAllowedActions()(*AllowedActions) { + return m.allowed_actions +} +// GetEnabled gets the enabled property value. Whether GitHub Actions is enabled on the repository. +// returns a *bool when successful +func (m *ActionsRepositoryPermissions) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsRepositoryPermissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allowed_actions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAllowedActions) + if err != nil { + return err + } + if val != nil { + m.SetAllowedActions(val.(*AllowedActions)) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["selected_actions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedActionsUrl(val) + } + return nil + } + return res +} +// GetSelectedActionsUrl gets the selected_actions_url property value. The API URL to use to get or set the actions and reusable workflows that are allowed to run, when `allowed_actions` is set to `selected`. +// returns a *string when successful +func (m *ActionsRepositoryPermissions) GetSelectedActionsUrl()(*string) { + return m.selected_actions_url +} +// Serialize serializes information the current object +func (m *ActionsRepositoryPermissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAllowedActions() != nil { + cast := (*m.GetAllowedActions()).String() + err := writer.WriteStringValue("allowed_actions", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("selected_actions_url", m.GetSelectedActionsUrl()) + 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 *ActionsRepositoryPermissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowedActions sets the allowed_actions property value. The permissions policy that controls the actions and reusable workflows that are allowed to run. +func (m *ActionsRepositoryPermissions) SetAllowedActions(value *AllowedActions)() { + m.allowed_actions = value +} +// SetEnabled sets the enabled property value. Whether GitHub Actions is enabled on the repository. +func (m *ActionsRepositoryPermissions) SetEnabled(value *bool)() { + m.enabled = value +} +// SetSelectedActionsUrl sets the selected_actions_url property value. The API URL to use to get or set the actions and reusable workflows that are allowed to run, when `allowed_actions` is set to `selected`. +func (m *ActionsRepositoryPermissions) SetSelectedActionsUrl(value *string)() { + m.selected_actions_url = value +} +type ActionsRepositoryPermissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowedActions()(*AllowedActions) + GetEnabled()(*bool) + GetSelectedActionsUrl()(*string) + SetAllowedActions(value *AllowedActions)() + SetEnabled(value *bool)() + SetSelectedActionsUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_secret.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_secret.go new file mode 100644 index 000000000..c42490e14 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_secret.go @@ -0,0 +1,140 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ActionsSecret set secrets for GitHub Actions. +type ActionsSecret struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the secret. + name *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewActionsSecret instantiates a new ActionsSecret and sets the default values. +func NewActionsSecret()(*ActionsSecret) { + m := &ActionsSecret{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsSecretFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsSecretFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsSecret(), 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 *ActionsSecret) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *ActionsSecret) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsSecret) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the secret. +// returns a *string when successful +func (m *ActionsSecret) GetName()(*string) { + return m.name +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *ActionsSecret) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *ActionsSecret) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + 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 *ActionsSecret) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ActionsSecret) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetName sets the name property value. The name of the secret. +func (m *ActionsSecret) SetName(value *string)() { + m.name = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *ActionsSecret) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type ActionsSecretable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_set_default_workflow_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_set_default_workflow_permissions.go new file mode 100644 index 000000000..86dcf13ac --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_set_default_workflow_permissions.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsSetDefaultWorkflowPermissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether GitHub Actions can approve pull requests. Enabling this can be a security risk. + can_approve_pull_request_reviews *bool + // The default workflow permissions granted to the GITHUB_TOKEN when running workflows. + default_workflow_permissions *ActionsDefaultWorkflowPermissions +} +// NewActionsSetDefaultWorkflowPermissions instantiates a new ActionsSetDefaultWorkflowPermissions and sets the default values. +func NewActionsSetDefaultWorkflowPermissions()(*ActionsSetDefaultWorkflowPermissions) { + m := &ActionsSetDefaultWorkflowPermissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsSetDefaultWorkflowPermissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsSetDefaultWorkflowPermissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsSetDefaultWorkflowPermissions(), 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 *ActionsSetDefaultWorkflowPermissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCanApprovePullRequestReviews gets the can_approve_pull_request_reviews property value. Whether GitHub Actions can approve pull requests. Enabling this can be a security risk. +// returns a *bool when successful +func (m *ActionsSetDefaultWorkflowPermissions) GetCanApprovePullRequestReviews()(*bool) { + return m.can_approve_pull_request_reviews +} +// GetDefaultWorkflowPermissions gets the default_workflow_permissions property value. The default workflow permissions granted to the GITHUB_TOKEN when running workflows. +// returns a *ActionsDefaultWorkflowPermissions when successful +func (m *ActionsSetDefaultWorkflowPermissions) GetDefaultWorkflowPermissions()(*ActionsDefaultWorkflowPermissions) { + return m.default_workflow_permissions +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsSetDefaultWorkflowPermissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["can_approve_pull_request_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanApprovePullRequestReviews(val) + } + return nil + } + res["default_workflow_permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseActionsDefaultWorkflowPermissions) + if err != nil { + return err + } + if val != nil { + m.SetDefaultWorkflowPermissions(val.(*ActionsDefaultWorkflowPermissions)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ActionsSetDefaultWorkflowPermissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("can_approve_pull_request_reviews", m.GetCanApprovePullRequestReviews()) + if err != nil { + return err + } + } + if m.GetDefaultWorkflowPermissions() != nil { + cast := (*m.GetDefaultWorkflowPermissions()).String() + err := writer.WriteStringValue("default_workflow_permissions", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ActionsSetDefaultWorkflowPermissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCanApprovePullRequestReviews sets the can_approve_pull_request_reviews property value. Whether GitHub Actions can approve pull requests. Enabling this can be a security risk. +func (m *ActionsSetDefaultWorkflowPermissions) SetCanApprovePullRequestReviews(value *bool)() { + m.can_approve_pull_request_reviews = value +} +// SetDefaultWorkflowPermissions sets the default_workflow_permissions property value. The default workflow permissions granted to the GITHUB_TOKEN when running workflows. +func (m *ActionsSetDefaultWorkflowPermissions) SetDefaultWorkflowPermissions(value *ActionsDefaultWorkflowPermissions)() { + m.default_workflow_permissions = value +} +type ActionsSetDefaultWorkflowPermissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCanApprovePullRequestReviews()(*bool) + GetDefaultWorkflowPermissions()(*ActionsDefaultWorkflowPermissions) + SetCanApprovePullRequestReviews(value *bool)() + SetDefaultWorkflowPermissions(value *ActionsDefaultWorkflowPermissions)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_variable.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_variable.go new file mode 100644 index 000000000..f89af004f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_variable.go @@ -0,0 +1,168 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsVariable struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The date and time at which the variable was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the variable. + name *string + // The date and time at which the variable was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The value of the variable. + value *string +} +// NewActionsVariable instantiates a new ActionsVariable and sets the default values. +func NewActionsVariable()(*ActionsVariable) { + m := &ActionsVariable{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsVariableFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsVariableFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsVariable(), 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 *ActionsVariable) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The date and time at which the variable was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +// returns a *Time when successful +func (m *ActionsVariable) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsVariable) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ActionsVariable) GetName()(*string) { + return m.name +} +// GetUpdatedAt gets the updated_at property value. The date and time at which the variable was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +// returns a *Time when successful +func (m *ActionsVariable) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ActionsVariable) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ActionsVariable) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ActionsVariable) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The date and time at which the variable was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +func (m *ActionsVariable) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetName sets the name property value. The name of the variable. +func (m *ActionsVariable) SetName(value *string)() { + m.name = value +} +// SetUpdatedAt sets the updated_at property value. The date and time at which the variable was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +func (m *ActionsVariable) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ActionsVariable) SetValue(value *string)() { + m.value = value +} +type ActionsVariableable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetValue()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetValue(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_workflow_access_to_repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_workflow_access_to_repository.go new file mode 100644 index 000000000..12c33a6f7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_workflow_access_to_repository.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsWorkflowAccessToRepository struct { + // Defines the level of access that workflows outside of the repository have to actions and reusable workflows within therepository.`none` means the access is only possible from workflows in this repository. `user` level access allows sharing across user owned private repositories only. `organization` level access allows sharing across the organization. + access_level *ActionsWorkflowAccessToRepository_access_level + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewActionsWorkflowAccessToRepository instantiates a new ActionsWorkflowAccessToRepository and sets the default values. +func NewActionsWorkflowAccessToRepository()(*ActionsWorkflowAccessToRepository) { + m := &ActionsWorkflowAccessToRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsWorkflowAccessToRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsWorkflowAccessToRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsWorkflowAccessToRepository(), nil +} +// GetAccessLevel gets the access_level property value. Defines the level of access that workflows outside of the repository have to actions and reusable workflows within therepository.`none` means the access is only possible from workflows in this repository. `user` level access allows sharing across user owned private repositories only. `organization` level access allows sharing across the organization. +// returns a *ActionsWorkflowAccessToRepository_access_level when successful +func (m *ActionsWorkflowAccessToRepository) GetAccessLevel()(*ActionsWorkflowAccessToRepository_access_level) { + return m.access_level +} +// 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 *ActionsWorkflowAccessToRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsWorkflowAccessToRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["access_level"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseActionsWorkflowAccessToRepository_access_level) + if err != nil { + return err + } + if val != nil { + m.SetAccessLevel(val.(*ActionsWorkflowAccessToRepository_access_level)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ActionsWorkflowAccessToRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAccessLevel() != nil { + cast := (*m.GetAccessLevel()).String() + err := writer.WriteStringValue("access_level", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccessLevel sets the access_level property value. Defines the level of access that workflows outside of the repository have to actions and reusable workflows within therepository.`none` means the access is only possible from workflows in this repository. `user` level access allows sharing across user owned private repositories only. `organization` level access allows sharing across the organization. +func (m *ActionsWorkflowAccessToRepository) SetAccessLevel(value *ActionsWorkflowAccessToRepository_access_level)() { + m.access_level = value +} +// 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 *ActionsWorkflowAccessToRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ActionsWorkflowAccessToRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessLevel()(*ActionsWorkflowAccessToRepository_access_level) + SetAccessLevel(value *ActionsWorkflowAccessToRepository_access_level)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_workflow_access_to_repository_access_level.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_workflow_access_to_repository_access_level.go new file mode 100644 index 000000000..83a37bdeb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/actions_workflow_access_to_repository_access_level.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// Defines the level of access that workflows outside of the repository have to actions and reusable workflows within therepository.`none` means the access is only possible from workflows in this repository. `user` level access allows sharing across user owned private repositories only. `organization` level access allows sharing across the organization. +type ActionsWorkflowAccessToRepository_access_level int + +const ( + NONE_ACTIONSWORKFLOWACCESSTOREPOSITORY_ACCESS_LEVEL ActionsWorkflowAccessToRepository_access_level = iota + USER_ACTIONSWORKFLOWACCESSTOREPOSITORY_ACCESS_LEVEL + ORGANIZATION_ACTIONSWORKFLOWACCESSTOREPOSITORY_ACCESS_LEVEL +) + +func (i ActionsWorkflowAccessToRepository_access_level) String() string { + return []string{"none", "user", "organization"}[i] +} +func ParseActionsWorkflowAccessToRepository_access_level(v string) (any, error) { + result := NONE_ACTIONSWORKFLOWACCESSTOREPOSITORY_ACCESS_LEVEL + switch v { + case "none": + result = NONE_ACTIONSWORKFLOWACCESSTOREPOSITORY_ACCESS_LEVEL + case "user": + result = USER_ACTIONSWORKFLOWACCESSTOREPOSITORY_ACCESS_LEVEL + case "organization": + result = ORGANIZATION_ACTIONSWORKFLOWACCESSTOREPOSITORY_ACCESS_LEVEL + default: + return 0, errors.New("Unknown ActionsWorkflowAccessToRepository_access_level value: " + v) + } + return &result, nil +} +func SerializeActionsWorkflowAccessToRepository_access_level(values []ActionsWorkflowAccessToRepository_access_level) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ActionsWorkflowAccessToRepository_access_level) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/activity.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/activity.go new file mode 100644 index 000000000..b8be7875b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/activity.go @@ -0,0 +1,286 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Activity activity +type Activity struct { + // The type of the activity that was performed. + activity_type *Activity_activity_type + // A GitHub user. + actor NullableSimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The SHA of the commit after the activity. + after *string + // The SHA of the commit before the activity. + before *string + // The id property + id *int32 + // The node_id property + node_id *string + // The full Git reference, formatted as `refs/heads/`. + ref *string + // The time when the activity occurred. + timestamp *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewActivity instantiates a new Activity and sets the default values. +func NewActivity()(*Activity) { + m := &Activity{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActivityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActivityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActivity(), nil +} +// GetActivityType gets the activity_type property value. The type of the activity that was performed. +// returns a *Activity_activity_type when successful +func (m *Activity) GetActivityType()(*Activity_activity_type) { + return m.activity_type +} +// GetActor gets the actor property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Activity) GetActor()(NullableSimpleUserable) { + return m.actor +} +// 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 *Activity) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAfter gets the after property value. The SHA of the commit after the activity. +// returns a *string when successful +func (m *Activity) GetAfter()(*string) { + return m.after +} +// GetBefore gets the before property value. The SHA of the commit before the activity. +// returns a *string when successful +func (m *Activity) GetBefore()(*string) { + return m.before +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Activity) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["activity_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseActivity_activity_type) + if err != nil { + return err + } + if val != nil { + m.SetActivityType(val.(*Activity_activity_type)) + } + return nil + } + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(NullableSimpleUserable)) + } + return nil + } + res["after"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAfter(val) + } + return nil + } + res["before"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBefore(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["timestamp"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetTimestamp(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Activity) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Activity) GetNodeId()(*string) { + return m.node_id +} +// GetRef gets the ref property value. The full Git reference, formatted as `refs/heads/`. +// returns a *string when successful +func (m *Activity) GetRef()(*string) { + return m.ref +} +// GetTimestamp gets the timestamp property value. The time when the activity occurred. +// returns a *Time when successful +func (m *Activity) GetTimestamp()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.timestamp +} +// Serialize serializes information the current object +func (m *Activity) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetActivityType() != nil { + cast := (*m.GetActivityType()).String() + err := writer.WriteStringValue("activity_type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("after", m.GetAfter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("before", m.GetBefore()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("timestamp", m.GetTimestamp()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActivityType sets the activity_type property value. The type of the activity that was performed. +func (m *Activity) SetActivityType(value *Activity_activity_type)() { + m.activity_type = value +} +// SetActor sets the actor property value. A GitHub user. +func (m *Activity) SetActor(value NullableSimpleUserable)() { + m.actor = value +} +// 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 *Activity) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAfter sets the after property value. The SHA of the commit after the activity. +func (m *Activity) SetAfter(value *string)() { + m.after = value +} +// SetBefore sets the before property value. The SHA of the commit before the activity. +func (m *Activity) SetBefore(value *string)() { + m.before = value +} +// SetId sets the id property value. The id property +func (m *Activity) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Activity) SetNodeId(value *string)() { + m.node_id = value +} +// SetRef sets the ref property value. The full Git reference, formatted as `refs/heads/`. +func (m *Activity) SetRef(value *string)() { + m.ref = value +} +// SetTimestamp sets the timestamp property value. The time when the activity occurred. +func (m *Activity) SetTimestamp(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.timestamp = value +} +type Activityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActivityType()(*Activity_activity_type) + GetActor()(NullableSimpleUserable) + GetAfter()(*string) + GetBefore()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetRef()(*string) + GetTimestamp()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetActivityType(value *Activity_activity_type)() + SetActor(value NullableSimpleUserable)() + SetAfter(value *string)() + SetBefore(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetRef(value *string)() + SetTimestamp(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/activity_activity_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/activity_activity_type.go new file mode 100644 index 000000000..3ff3b9c89 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/activity_activity_type.go @@ -0,0 +1,49 @@ +package models +import ( + "errors" +) +// The type of the activity that was performed. +type Activity_activity_type int + +const ( + PUSH_ACTIVITY_ACTIVITY_TYPE Activity_activity_type = iota + FORCE_PUSH_ACTIVITY_ACTIVITY_TYPE + BRANCH_DELETION_ACTIVITY_ACTIVITY_TYPE + BRANCH_CREATION_ACTIVITY_ACTIVITY_TYPE + PR_MERGE_ACTIVITY_ACTIVITY_TYPE + MERGE_QUEUE_MERGE_ACTIVITY_ACTIVITY_TYPE +) + +func (i Activity_activity_type) String() string { + return []string{"push", "force_push", "branch_deletion", "branch_creation", "pr_merge", "merge_queue_merge"}[i] +} +func ParseActivity_activity_type(v string) (any, error) { + result := PUSH_ACTIVITY_ACTIVITY_TYPE + switch v { + case "push": + result = PUSH_ACTIVITY_ACTIVITY_TYPE + case "force_push": + result = FORCE_PUSH_ACTIVITY_ACTIVITY_TYPE + case "branch_deletion": + result = BRANCH_DELETION_ACTIVITY_ACTIVITY_TYPE + case "branch_creation": + result = BRANCH_CREATION_ACTIVITY_ACTIVITY_TYPE + case "pr_merge": + result = PR_MERGE_ACTIVITY_ACTIVITY_TYPE + case "merge_queue_merge": + result = MERGE_QUEUE_MERGE_ACTIVITY_ACTIVITY_TYPE + default: + return 0, errors.New("Unknown Activity_activity_type value: " + v) + } + return &result, nil +} +func SerializeActivity_activity_type(values []Activity_activity_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Activity_activity_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/actor.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/actor.go new file mode 100644 index 000000000..bceb99333 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/actor.go @@ -0,0 +1,226 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Actor actor +type Actor struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The display_login property + display_login *string + // The gravatar_id property + gravatar_id *string + // The id property + id *int32 + // The login property + login *string + // The url property + url *string +} +// NewActor instantiates a new Actor and sets the default values. +func NewActor()(*Actor) { + m := &Actor{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActor(), 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 *Actor) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *Actor) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetDisplayLogin gets the display_login property value. The display_login property +// returns a *string when successful +func (m *Actor) GetDisplayLogin()(*string) { + return m.display_login +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Actor) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["display_login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayLogin(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *Actor) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Actor) GetId()(*int32) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *Actor) GetLogin()(*string) { + return m.login +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Actor) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Actor) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("display_login", m.GetDisplayLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Actor) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *Actor) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetDisplayLogin sets the display_login property value. The display_login property +func (m *Actor) SetDisplayLogin(value *string)() { + m.display_login = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *Actor) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetId sets the id property value. The id property +func (m *Actor) SetId(value *int32)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *Actor) SetLogin(value *string)() { + m.login = value +} +// SetUrl sets the url property value. The url property +func (m *Actor) SetUrl(value *string)() { + m.url = value +} +type Actorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetDisplayLogin()(*string) + GetGravatarId()(*string) + GetId()(*int32) + GetLogin()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetDisplayLogin(value *string)() + SetGravatarId(value *string)() + SetId(value *int32)() + SetLogin(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/added_to_project_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/added_to_project_issue_event.go new file mode 100644 index 000000000..9d1dfe688 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/added_to_project_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// AddedToProjectIssueEvent added to Project Issue Event +type AddedToProjectIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The project_card property + project_card AddedToProjectIssueEvent_project_cardable + // The url property + url *string +} +// NewAddedToProjectIssueEvent instantiates a new AddedToProjectIssueEvent and sets the default values. +func NewAddedToProjectIssueEvent()(*AddedToProjectIssueEvent) { + m := &AddedToProjectIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAddedToProjectIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAddedToProjectIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAddedToProjectIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *AddedToProjectIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *AddedToProjectIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *AddedToProjectIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *AddedToProjectIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *AddedToProjectIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *AddedToProjectIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AddedToProjectIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["project_card"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAddedToProjectIssueEvent_project_cardFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProjectCard(val.(AddedToProjectIssueEvent_project_cardable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *AddedToProjectIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *AddedToProjectIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *AddedToProjectIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetProjectCard gets the project_card property value. The project_card property +// returns a AddedToProjectIssueEvent_project_cardable when successful +func (m *AddedToProjectIssueEvent) GetProjectCard()(AddedToProjectIssueEvent_project_cardable) { + return m.project_card +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *AddedToProjectIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *AddedToProjectIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("project_card", m.GetProjectCard()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *AddedToProjectIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *AddedToProjectIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *AddedToProjectIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *AddedToProjectIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *AddedToProjectIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *AddedToProjectIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *AddedToProjectIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *AddedToProjectIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *AddedToProjectIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetProjectCard sets the project_card property value. The project_card property +func (m *AddedToProjectIssueEvent) SetProjectCard(value AddedToProjectIssueEvent_project_cardable)() { + m.project_card = value +} +// SetUrl sets the url property value. The url property +func (m *AddedToProjectIssueEvent) SetUrl(value *string)() { + m.url = value +} +type AddedToProjectIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetProjectCard()(AddedToProjectIssueEvent_project_cardable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetProjectCard(value AddedToProjectIssueEvent_project_cardable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/added_to_project_issue_event_project_card.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/added_to_project_issue_event_project_card.go new file mode 100644 index 000000000..7c5424699 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/added_to_project_issue_event_project_card.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type AddedToProjectIssueEvent_project_card struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The column_name property + column_name *string + // The id property + id *int32 + // The previous_column_name property + previous_column_name *string + // The project_id property + project_id *int32 + // The project_url property + project_url *string + // The url property + url *string +} +// NewAddedToProjectIssueEvent_project_card instantiates a new AddedToProjectIssueEvent_project_card and sets the default values. +func NewAddedToProjectIssueEvent_project_card()(*AddedToProjectIssueEvent_project_card) { + m := &AddedToProjectIssueEvent_project_card{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAddedToProjectIssueEvent_project_cardFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAddedToProjectIssueEvent_project_cardFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAddedToProjectIssueEvent_project_card(), 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 *AddedToProjectIssueEvent_project_card) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColumnName gets the column_name property value. The column_name property +// returns a *string when successful +func (m *AddedToProjectIssueEvent_project_card) GetColumnName()(*string) { + return m.column_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AddedToProjectIssueEvent_project_card) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnName(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["previous_column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviousColumnName(val) + } + return nil + } + res["project_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetProjectId(val) + } + return nil + } + res["project_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProjectUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *AddedToProjectIssueEvent_project_card) GetId()(*int32) { + return m.id +} +// GetPreviousColumnName gets the previous_column_name property value. The previous_column_name property +// returns a *string when successful +func (m *AddedToProjectIssueEvent_project_card) GetPreviousColumnName()(*string) { + return m.previous_column_name +} +// GetProjectId gets the project_id property value. The project_id property +// returns a *int32 when successful +func (m *AddedToProjectIssueEvent_project_card) GetProjectId()(*int32) { + return m.project_id +} +// GetProjectUrl gets the project_url property value. The project_url property +// returns a *string when successful +func (m *AddedToProjectIssueEvent_project_card) GetProjectUrl()(*string) { + return m.project_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *AddedToProjectIssueEvent_project_card) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *AddedToProjectIssueEvent_project_card) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("column_name", m.GetColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("previous_column_name", m.GetPreviousColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("project_id", m.GetProjectId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("project_url", m.GetProjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *AddedToProjectIssueEvent_project_card) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColumnName sets the column_name property value. The column_name property +func (m *AddedToProjectIssueEvent_project_card) SetColumnName(value *string)() { + m.column_name = value +} +// SetId sets the id property value. The id property +func (m *AddedToProjectIssueEvent_project_card) SetId(value *int32)() { + m.id = value +} +// SetPreviousColumnName sets the previous_column_name property value. The previous_column_name property +func (m *AddedToProjectIssueEvent_project_card) SetPreviousColumnName(value *string)() { + m.previous_column_name = value +} +// SetProjectId sets the project_id property value. The project_id property +func (m *AddedToProjectIssueEvent_project_card) SetProjectId(value *int32)() { + m.project_id = value +} +// SetProjectUrl sets the project_url property value. The project_url property +func (m *AddedToProjectIssueEvent_project_card) SetProjectUrl(value *string)() { + m.project_url = value +} +// SetUrl sets the url property value. The url property +func (m *AddedToProjectIssueEvent_project_card) SetUrl(value *string)() { + m.url = value +} +type AddedToProjectIssueEvent_project_cardable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColumnName()(*string) + GetId()(*int32) + GetPreviousColumnName()(*string) + GetProjectId()(*int32) + GetProjectUrl()(*string) + GetUrl()(*string) + SetColumnName(value *string)() + SetId(value *int32)() + SetPreviousColumnName(value *string)() + SetProjectId(value *int32)() + SetProjectUrl(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/alerts503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/alerts503_error.go new file mode 100644 index 000000000..11350948f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/alerts503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Alerts503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewAlerts503Error instantiates a new Alerts503Error and sets the default values. +func NewAlerts503Error()(*Alerts503Error) { + m := &Alerts503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAlerts503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAlerts503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAlerts503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Alerts503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Alerts503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Alerts503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Alerts503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Alerts503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Alerts503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Alerts503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *Alerts503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Alerts503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Alerts503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Alerts503Error) SetMessage(value *string)() { + m.message = value +} +type Alerts503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/allowed_actions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/allowed_actions.go new file mode 100644 index 000000000..dd5c04b07 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/allowed_actions.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The permissions policy that controls the actions and reusable workflows that are allowed to run. +type AllowedActions int + +const ( + ALL_ALLOWEDACTIONS AllowedActions = iota + LOCAL_ONLY_ALLOWEDACTIONS + SELECTED_ALLOWEDACTIONS +) + +func (i AllowedActions) String() string { + return []string{"all", "local_only", "selected"}[i] +} +func ParseAllowedActions(v string) (any, error) { + result := ALL_ALLOWEDACTIONS + switch v { + case "all": + result = ALL_ALLOWEDACTIONS + case "local_only": + result = LOCAL_ONLY_ALLOWEDACTIONS + case "selected": + result = SELECTED_ALLOWEDACTIONS + default: + return 0, errors.New("Unknown AllowedActions value: " + v) + } + return &result, nil +} +func SerializeAllowedActions(values []AllowedActions) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AllowedActions) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/analyses503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/analyses503_error.go new file mode 100644 index 000000000..59c81fe8c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/analyses503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Analyses503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewAnalyses503Error instantiates a new Analyses503Error and sets the default values. +func NewAnalyses503Error()(*Analyses503Error) { + m := &Analyses503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAnalyses503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAnalyses503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAnalyses503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Analyses503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Analyses503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Analyses503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Analyses503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Analyses503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Analyses503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Analyses503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *Analyses503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Analyses503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Analyses503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Analyses503Error) SetMessage(value *string)() { + m.message = value +} +type Analyses503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/api_overview.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/api_overview.go new file mode 100644 index 000000000..bc68b0f6a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/api_overview.go @@ -0,0 +1,559 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ApiOverview api Overview +type ApiOverview struct { + // The actions property + actions []string + // The actions_macos property + actions_macos []string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The api property + api []string + // The dependabot property + dependabot []string + // The domains property + domains ApiOverview_domainsable + // The git property + git []string + // The github_enterprise_importer property + github_enterprise_importer []string + // The hooks property + hooks []string + // The importer property + importer []string + // The packages property + packages []string + // The pages property + pages []string + // The ssh_key_fingerprints property + ssh_key_fingerprints ApiOverview_ssh_key_fingerprintsable + // The ssh_keys property + ssh_keys []string + // The verifiable_password_authentication property + verifiable_password_authentication *bool + // The web property + web []string +} +// NewApiOverview instantiates a new ApiOverview and sets the default values. +func NewApiOverview()(*ApiOverview) { + m := &ApiOverview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateApiOverviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateApiOverviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewApiOverview(), nil +} +// GetActions gets the actions property value. The actions property +// returns a []string when successful +func (m *ApiOverview) GetActions()([]string) { + return m.actions +} +// GetActionsMacos gets the actions_macos property value. The actions_macos property +// returns a []string when successful +func (m *ApiOverview) GetActionsMacos()([]string) { + return m.actions_macos +} +// 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 *ApiOverview) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApi gets the api property value. The api property +// returns a []string when successful +func (m *ApiOverview) GetApi()([]string) { + return m.api +} +// GetDependabot gets the dependabot property value. The dependabot property +// returns a []string when successful +func (m *ApiOverview) GetDependabot()([]string) { + return m.dependabot +} +// GetDomains gets the domains property value. The domains property +// returns a ApiOverview_domainsable when successful +func (m *ApiOverview) GetDomains()(ApiOverview_domainsable) { + return m.domains +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ApiOverview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetActions(res) + } + return nil + } + res["actions_macos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetActionsMacos(res) + } + return nil + } + res["api"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetApi(res) + } + return nil + } + res["dependabot"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetDependabot(res) + } + return nil + } + res["domains"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateApiOverview_domainsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDomains(val.(ApiOverview_domainsable)) + } + return nil + } + res["git"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetGit(res) + } + return nil + } + res["github_enterprise_importer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetGithubEnterpriseImporter(res) + } + return nil + } + res["hooks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetHooks(res) + } + return nil + } + res["importer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetImporter(res) + } + return nil + } + res["packages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetPackages(res) + } + return nil + } + res["pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetPages(res) + } + return nil + } + res["ssh_key_fingerprints"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateApiOverview_ssh_key_fingerprintsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSshKeyFingerprints(val.(ApiOverview_ssh_key_fingerprintsable)) + } + return nil + } + res["ssh_keys"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetSshKeys(res) + } + return nil + } + res["verifiable_password_authentication"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerifiablePasswordAuthentication(val) + } + return nil + } + res["web"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetWeb(res) + } + return nil + } + return res +} +// GetGit gets the git property value. The git property +// returns a []string when successful +func (m *ApiOverview) GetGit()([]string) { + return m.git +} +// GetGithubEnterpriseImporter gets the github_enterprise_importer property value. The github_enterprise_importer property +// returns a []string when successful +func (m *ApiOverview) GetGithubEnterpriseImporter()([]string) { + return m.github_enterprise_importer +} +// GetHooks gets the hooks property value. The hooks property +// returns a []string when successful +func (m *ApiOverview) GetHooks()([]string) { + return m.hooks +} +// GetImporter gets the importer property value. The importer property +// returns a []string when successful +func (m *ApiOverview) GetImporter()([]string) { + return m.importer +} +// GetPackages gets the packages property value. The packages property +// returns a []string when successful +func (m *ApiOverview) GetPackages()([]string) { + return m.packages +} +// GetPages gets the pages property value. The pages property +// returns a []string when successful +func (m *ApiOverview) GetPages()([]string) { + return m.pages +} +// GetSshKeyFingerprints gets the ssh_key_fingerprints property value. The ssh_key_fingerprints property +// returns a ApiOverview_ssh_key_fingerprintsable when successful +func (m *ApiOverview) GetSshKeyFingerprints()(ApiOverview_ssh_key_fingerprintsable) { + return m.ssh_key_fingerprints +} +// GetSshKeys gets the ssh_keys property value. The ssh_keys property +// returns a []string when successful +func (m *ApiOverview) GetSshKeys()([]string) { + return m.ssh_keys +} +// GetVerifiablePasswordAuthentication gets the verifiable_password_authentication property value. The verifiable_password_authentication property +// returns a *bool when successful +func (m *ApiOverview) GetVerifiablePasswordAuthentication()(*bool) { + return m.verifiable_password_authentication +} +// GetWeb gets the web property value. The web property +// returns a []string when successful +func (m *ApiOverview) GetWeb()([]string) { + return m.web +} +// Serialize serializes information the current object +func (m *ApiOverview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetActions() != nil { + err := writer.WriteCollectionOfStringValues("actions", m.GetActions()) + if err != nil { + return err + } + } + if m.GetActionsMacos() != nil { + err := writer.WriteCollectionOfStringValues("actions_macos", m.GetActionsMacos()) + if err != nil { + return err + } + } + if m.GetApi() != nil { + err := writer.WriteCollectionOfStringValues("api", m.GetApi()) + if err != nil { + return err + } + } + if m.GetDependabot() != nil { + err := writer.WriteCollectionOfStringValues("dependabot", m.GetDependabot()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("domains", m.GetDomains()) + if err != nil { + return err + } + } + if m.GetGit() != nil { + err := writer.WriteCollectionOfStringValues("git", m.GetGit()) + if err != nil { + return err + } + } + if m.GetGithubEnterpriseImporter() != nil { + err := writer.WriteCollectionOfStringValues("github_enterprise_importer", m.GetGithubEnterpriseImporter()) + if err != nil { + return err + } + } + if m.GetHooks() != nil { + err := writer.WriteCollectionOfStringValues("hooks", m.GetHooks()) + if err != nil { + return err + } + } + if m.GetImporter() != nil { + err := writer.WriteCollectionOfStringValues("importer", m.GetImporter()) + if err != nil { + return err + } + } + if m.GetPackages() != nil { + err := writer.WriteCollectionOfStringValues("packages", m.GetPackages()) + if err != nil { + return err + } + } + if m.GetPages() != nil { + err := writer.WriteCollectionOfStringValues("pages", m.GetPages()) + if err != nil { + return err + } + } + if m.GetSshKeys() != nil { + err := writer.WriteCollectionOfStringValues("ssh_keys", m.GetSshKeys()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("ssh_key_fingerprints", m.GetSshKeyFingerprints()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verifiable_password_authentication", m.GetVerifiablePasswordAuthentication()) + if err != nil { + return err + } + } + if m.GetWeb() != nil { + err := writer.WriteCollectionOfStringValues("web", m.GetWeb()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActions sets the actions property value. The actions property +func (m *ApiOverview) SetActions(value []string)() { + m.actions = value +} +// SetActionsMacos sets the actions_macos property value. The actions_macos property +func (m *ApiOverview) SetActionsMacos(value []string)() { + m.actions_macos = value +} +// 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 *ApiOverview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApi sets the api property value. The api property +func (m *ApiOverview) SetApi(value []string)() { + m.api = value +} +// SetDependabot sets the dependabot property value. The dependabot property +func (m *ApiOverview) SetDependabot(value []string)() { + m.dependabot = value +} +// SetDomains sets the domains property value. The domains property +func (m *ApiOverview) SetDomains(value ApiOverview_domainsable)() { + m.domains = value +} +// SetGit sets the git property value. The git property +func (m *ApiOverview) SetGit(value []string)() { + m.git = value +} +// SetGithubEnterpriseImporter sets the github_enterprise_importer property value. The github_enterprise_importer property +func (m *ApiOverview) SetGithubEnterpriseImporter(value []string)() { + m.github_enterprise_importer = value +} +// SetHooks sets the hooks property value. The hooks property +func (m *ApiOverview) SetHooks(value []string)() { + m.hooks = value +} +// SetImporter sets the importer property value. The importer property +func (m *ApiOverview) SetImporter(value []string)() { + m.importer = value +} +// SetPackages sets the packages property value. The packages property +func (m *ApiOverview) SetPackages(value []string)() { + m.packages = value +} +// SetPages sets the pages property value. The pages property +func (m *ApiOverview) SetPages(value []string)() { + m.pages = value +} +// SetSshKeyFingerprints sets the ssh_key_fingerprints property value. The ssh_key_fingerprints property +func (m *ApiOverview) SetSshKeyFingerprints(value ApiOverview_ssh_key_fingerprintsable)() { + m.ssh_key_fingerprints = value +} +// SetSshKeys sets the ssh_keys property value. The ssh_keys property +func (m *ApiOverview) SetSshKeys(value []string)() { + m.ssh_keys = value +} +// SetVerifiablePasswordAuthentication sets the verifiable_password_authentication property value. The verifiable_password_authentication property +func (m *ApiOverview) SetVerifiablePasswordAuthentication(value *bool)() { + m.verifiable_password_authentication = value +} +// SetWeb sets the web property value. The web property +func (m *ApiOverview) SetWeb(value []string)() { + m.web = value +} +type ApiOverviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActions()([]string) + GetActionsMacos()([]string) + GetApi()([]string) + GetDependabot()([]string) + GetDomains()(ApiOverview_domainsable) + GetGit()([]string) + GetGithubEnterpriseImporter()([]string) + GetHooks()([]string) + GetImporter()([]string) + GetPackages()([]string) + GetPages()([]string) + GetSshKeyFingerprints()(ApiOverview_ssh_key_fingerprintsable) + GetSshKeys()([]string) + GetVerifiablePasswordAuthentication()(*bool) + GetWeb()([]string) + SetActions(value []string)() + SetActionsMacos(value []string)() + SetApi(value []string)() + SetDependabot(value []string)() + SetDomains(value ApiOverview_domainsable)() + SetGit(value []string)() + SetGithubEnterpriseImporter(value []string)() + SetHooks(value []string)() + SetImporter(value []string)() + SetPackages(value []string)() + SetPages(value []string)() + SetSshKeyFingerprints(value ApiOverview_ssh_key_fingerprintsable)() + SetSshKeys(value []string)() + SetVerifiablePasswordAuthentication(value *bool)() + SetWeb(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/api_overview_domains.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/api_overview_domains.go new file mode 100644 index 000000000..28e55bb65 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/api_overview_domains.go @@ -0,0 +1,226 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ApiOverview_domains struct { + // The actions property + actions []string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The codespaces property + codespaces []string + // The copilot property + copilot []string + // The packages property + packages []string + // The website property + website []string +} +// NewApiOverview_domains instantiates a new ApiOverview_domains and sets the default values. +func NewApiOverview_domains()(*ApiOverview_domains) { + m := &ApiOverview_domains{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateApiOverview_domainsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateApiOverview_domainsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewApiOverview_domains(), nil +} +// GetActions gets the actions property value. The actions property +// returns a []string when successful +func (m *ApiOverview_domains) GetActions()([]string) { + return m.actions +} +// 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 *ApiOverview_domains) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCodespaces gets the codespaces property value. The codespaces property +// returns a []string when successful +func (m *ApiOverview_domains) GetCodespaces()([]string) { + return m.codespaces +} +// GetCopilot gets the copilot property value. The copilot property +// returns a []string when successful +func (m *ApiOverview_domains) GetCopilot()([]string) { + return m.copilot +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ApiOverview_domains) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetActions(res) + } + return nil + } + res["codespaces"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetCodespaces(res) + } + return nil + } + res["copilot"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetCopilot(res) + } + return nil + } + res["packages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetPackages(res) + } + return nil + } + res["website"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetWebsite(res) + } + return nil + } + return res +} +// GetPackages gets the packages property value. The packages property +// returns a []string when successful +func (m *ApiOverview_domains) GetPackages()([]string) { + return m.packages +} +// GetWebsite gets the website property value. The website property +// returns a []string when successful +func (m *ApiOverview_domains) GetWebsite()([]string) { + return m.website +} +// Serialize serializes information the current object +func (m *ApiOverview_domains) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetActions() != nil { + err := writer.WriteCollectionOfStringValues("actions", m.GetActions()) + if err != nil { + return err + } + } + if m.GetCodespaces() != nil { + err := writer.WriteCollectionOfStringValues("codespaces", m.GetCodespaces()) + if err != nil { + return err + } + } + if m.GetCopilot() != nil { + err := writer.WriteCollectionOfStringValues("copilot", m.GetCopilot()) + if err != nil { + return err + } + } + if m.GetPackages() != nil { + err := writer.WriteCollectionOfStringValues("packages", m.GetPackages()) + if err != nil { + return err + } + } + if m.GetWebsite() != nil { + err := writer.WriteCollectionOfStringValues("website", m.GetWebsite()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActions sets the actions property value. The actions property +func (m *ApiOverview_domains) SetActions(value []string)() { + m.actions = value +} +// 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 *ApiOverview_domains) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCodespaces sets the codespaces property value. The codespaces property +func (m *ApiOverview_domains) SetCodespaces(value []string)() { + m.codespaces = value +} +// SetCopilot sets the copilot property value. The copilot property +func (m *ApiOverview_domains) SetCopilot(value []string)() { + m.copilot = value +} +// SetPackages sets the packages property value. The packages property +func (m *ApiOverview_domains) SetPackages(value []string)() { + m.packages = value +} +// SetWebsite sets the website property value. The website property +func (m *ApiOverview_domains) SetWebsite(value []string)() { + m.website = value +} +type ApiOverview_domainsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActions()([]string) + GetCodespaces()([]string) + GetCopilot()([]string) + GetPackages()([]string) + GetWebsite()([]string) + SetActions(value []string)() + SetCodespaces(value []string)() + SetCopilot(value []string)() + SetPackages(value []string)() + SetWebsite(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/api_overview_ssh_key_fingerprints.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/api_overview_ssh_key_fingerprints.go new file mode 100644 index 000000000..11f32ae02 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/api_overview_ssh_key_fingerprints.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ApiOverview_ssh_key_fingerprints struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The SHA256_DSA property + sHA256_DSA *string + // The SHA256_ECDSA property + sHA256_ECDSA *string + // The SHA256_ED25519 property + sHA256_ED25519 *string + // The SHA256_RSA property + sHA256_RSA *string +} +// NewApiOverview_ssh_key_fingerprints instantiates a new ApiOverview_ssh_key_fingerprints and sets the default values. +func NewApiOverview_ssh_key_fingerprints()(*ApiOverview_ssh_key_fingerprints) { + m := &ApiOverview_ssh_key_fingerprints{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateApiOverview_ssh_key_fingerprintsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateApiOverview_ssh_key_fingerprintsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewApiOverview_ssh_key_fingerprints(), 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 *ApiOverview_ssh_key_fingerprints) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ApiOverview_ssh_key_fingerprints) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["SHA256_DSA"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSHA256DSA(val) + } + return nil + } + res["SHA256_ECDSA"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSHA256ECDSA(val) + } + return nil + } + res["SHA256_ED25519"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSHA256ED25519(val) + } + return nil + } + res["SHA256_RSA"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSHA256RSA(val) + } + return nil + } + return res +} +// GetSHA256DSA gets the SHA256_DSA property value. The SHA256_DSA property +// returns a *string when successful +func (m *ApiOverview_ssh_key_fingerprints) GetSHA256DSA()(*string) { + return m.sHA256_DSA +} +// GetSHA256ECDSA gets the SHA256_ECDSA property value. The SHA256_ECDSA property +// returns a *string when successful +func (m *ApiOverview_ssh_key_fingerprints) GetSHA256ECDSA()(*string) { + return m.sHA256_ECDSA +} +// GetSHA256ED25519 gets the SHA256_ED25519 property value. The SHA256_ED25519 property +// returns a *string when successful +func (m *ApiOverview_ssh_key_fingerprints) GetSHA256ED25519()(*string) { + return m.sHA256_ED25519 +} +// GetSHA256RSA gets the SHA256_RSA property value. The SHA256_RSA property +// returns a *string when successful +func (m *ApiOverview_ssh_key_fingerprints) GetSHA256RSA()(*string) { + return m.sHA256_RSA +} +// Serialize serializes information the current object +func (m *ApiOverview_ssh_key_fingerprints) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("SHA256_DSA", m.GetSHA256DSA()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("SHA256_ECDSA", m.GetSHA256ECDSA()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("SHA256_ED25519", m.GetSHA256ED25519()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("SHA256_RSA", m.GetSHA256RSA()) + 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 *ApiOverview_ssh_key_fingerprints) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSHA256DSA sets the SHA256_DSA property value. The SHA256_DSA property +func (m *ApiOverview_ssh_key_fingerprints) SetSHA256DSA(value *string)() { + m.sHA256_DSA = value +} +// SetSHA256ECDSA sets the SHA256_ECDSA property value. The SHA256_ECDSA property +func (m *ApiOverview_ssh_key_fingerprints) SetSHA256ECDSA(value *string)() { + m.sHA256_ECDSA = value +} +// SetSHA256ED25519 sets the SHA256_ED25519 property value. The SHA256_ED25519 property +func (m *ApiOverview_ssh_key_fingerprints) SetSHA256ED25519(value *string)() { + m.sHA256_ED25519 = value +} +// SetSHA256RSA sets the SHA256_RSA property value. The SHA256_RSA property +func (m *ApiOverview_ssh_key_fingerprints) SetSHA256RSA(value *string)() { + m.sHA256_RSA = value +} +type ApiOverview_ssh_key_fingerprintsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSHA256DSA()(*string) + GetSHA256ECDSA()(*string) + GetSHA256ED25519()(*string) + GetSHA256RSA()(*string) + SetSHA256DSA(value *string)() + SetSHA256ECDSA(value *string)() + SetSHA256ED25519(value *string)() + SetSHA256RSA(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions.go new file mode 100644 index 000000000..ca2dc1519 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions.go @@ -0,0 +1,1492 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// AppPermissions the permissions granted to the user access token. +type AppPermissions struct { + // The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. + actions *AppPermissions_actions + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. + administration *AppPermissions_administration + // The level of permission to grant the access token for checks on code. + checks *AppPermissions_checks + // The level of permission to grant the access token to create, edit, delete, and list Codespaces. + codespaces *AppPermissions_codespaces + // The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. + contents *AppPermissions_contents + // The leve of permission to grant the access token to manage Dependabot secrets. + dependabot_secrets *AppPermissions_dependabot_secrets + // The level of permission to grant the access token for deployments and deployment statuses. + deployments *AppPermissions_deployments + // The level of permission to grant the access token to manage the email addresses belonging to a user. + email_addresses *AppPermissions_email_addresses + // The level of permission to grant the access token for managing repository environments. + environments *AppPermissions_environments + // The level of permission to grant the access token to manage the followers belonging to a user. + followers *AppPermissions_followers + // The level of permission to grant the access token to manage git SSH keys. + git_ssh_keys *AppPermissions_git_ssh_keys + // The level of permission to grant the access token to view and manage GPG keys belonging to a user. + gpg_keys *AppPermissions_gpg_keys + // The level of permission to grant the access token to view and manage interaction limits on a repository. + interaction_limits *AppPermissions_interaction_limits + // The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. + issues *AppPermissions_issues + // The level of permission to grant the access token for organization teams and members. + members *AppPermissions_members + // The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. + metadata *AppPermissions_metadata + // The level of permission to grant the access token to manage access to an organization. + organization_administration *AppPermissions_organization_administration + // The level of permission to grant the access token to view and manage announcement banners for an organization. + organization_announcement_banners *AppPermissions_organization_announcement_banners + // The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in beta and is subject to change. + organization_copilot_seat_management *AppPermissions_organization_copilot_seat_management + // The level of permission to grant the access token for custom organization roles management. + organization_custom_org_roles *AppPermissions_organization_custom_org_roles + // The level of permission to grant the access token for custom property management. + organization_custom_properties *AppPermissions_organization_custom_properties + // The level of permission to grant the access token for custom repository roles management. + organization_custom_roles *AppPermissions_organization_custom_roles + // The level of permission to grant the access token to view events triggered by an activity in an organization. + organization_events *AppPermissions_organization_events + // The level of permission to grant the access token to manage the post-receive hooks for an organization. + organization_hooks *AppPermissions_organization_hooks + // The level of permission to grant the access token for organization packages published to GitHub Packages. + organization_packages *AppPermissions_organization_packages + // The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization. + organization_personal_access_token_requests *AppPermissions_organization_personal_access_token_requests + // The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization. + organization_personal_access_tokens *AppPermissions_organization_personal_access_tokens + // The level of permission to grant the access token for viewing an organization's plan. + organization_plan *AppPermissions_organization_plan + // The level of permission to grant the access token to manage organization projects and projects beta (where available). + organization_projects *AppPermissions_organization_projects + // The level of permission to grant the access token to manage organization secrets. + organization_secrets *AppPermissions_organization_secrets + // The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. + organization_self_hosted_runners *AppPermissions_organization_self_hosted_runners + // The level of permission to grant the access token to view and manage users blocked by the organization. + organization_user_blocking *AppPermissions_organization_user_blocking + // The level of permission to grant the access token for packages published to GitHub Packages. + packages *AppPermissions_packages + // The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. + pages *AppPermissions_pages + // The level of permission to grant the access token to manage the profile settings belonging to a user. + profile *AppPermissions_profile + // The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. + pull_requests *AppPermissions_pull_requests + // The level of permission to grant the access token to view and edit custom properties for a repository, when allowed by the property. + repository_custom_properties *AppPermissions_repository_custom_properties + // The level of permission to grant the access token to manage the post-receive hooks for a repository. + repository_hooks *AppPermissions_repository_hooks + // The level of permission to grant the access token to manage repository projects, columns, and cards. + repository_projects *AppPermissions_repository_projects + // The level of permission to grant the access token to view and manage secret scanning alerts. + secret_scanning_alerts *AppPermissions_secret_scanning_alerts + // The level of permission to grant the access token to manage repository secrets. + secrets *AppPermissions_secrets + // The level of permission to grant the access token to view and manage security events like code scanning alerts. + security_events *AppPermissions_security_events + // The level of permission to grant the access token to manage just a single file. + single_file *AppPermissions_single_file + // The level of permission to grant the access token to list and manage repositories a user is starring. + starring *AppPermissions_starring + // The level of permission to grant the access token for commit statuses. + statuses *AppPermissions_statuses + // The level of permission to grant the access token to manage team discussions and related comments. + team_discussions *AppPermissions_team_discussions + // The level of permission to grant the access token to manage Dependabot alerts. + vulnerability_alerts *AppPermissions_vulnerability_alerts + // The level of permission to grant the access token to update GitHub Actions workflow files. + workflows *AppPermissions_workflows +} +// NewAppPermissions instantiates a new AppPermissions and sets the default values. +func NewAppPermissions()(*AppPermissions) { + m := &AppPermissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAppPermissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAppPermissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAppPermissions(), nil +} +// GetActions gets the actions property value. The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. +// returns a *AppPermissions_actions when successful +func (m *AppPermissions) GetActions()(*AppPermissions_actions) { + return m.actions +} +// 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 *AppPermissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdministration gets the administration property value. The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. +// returns a *AppPermissions_administration when successful +func (m *AppPermissions) GetAdministration()(*AppPermissions_administration) { + return m.administration +} +// GetChecks gets the checks property value. The level of permission to grant the access token for checks on code. +// returns a *AppPermissions_checks when successful +func (m *AppPermissions) GetChecks()(*AppPermissions_checks) { + return m.checks +} +// GetCodespaces gets the codespaces property value. The level of permission to grant the access token to create, edit, delete, and list Codespaces. +// returns a *AppPermissions_codespaces when successful +func (m *AppPermissions) GetCodespaces()(*AppPermissions_codespaces) { + return m.codespaces +} +// GetContents gets the contents property value. The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. +// returns a *AppPermissions_contents when successful +func (m *AppPermissions) GetContents()(*AppPermissions_contents) { + return m.contents +} +// GetDependabotSecrets gets the dependabot_secrets property value. The leve of permission to grant the access token to manage Dependabot secrets. +// returns a *AppPermissions_dependabot_secrets when successful +func (m *AppPermissions) GetDependabotSecrets()(*AppPermissions_dependabot_secrets) { + return m.dependabot_secrets +} +// GetDeployments gets the deployments property value. The level of permission to grant the access token for deployments and deployment statuses. +// returns a *AppPermissions_deployments when successful +func (m *AppPermissions) GetDeployments()(*AppPermissions_deployments) { + return m.deployments +} +// GetEmailAddresses gets the email_addresses property value. The level of permission to grant the access token to manage the email addresses belonging to a user. +// returns a *AppPermissions_email_addresses when successful +func (m *AppPermissions) GetEmailAddresses()(*AppPermissions_email_addresses) { + return m.email_addresses +} +// GetEnvironments gets the environments property value. The level of permission to grant the access token for managing repository environments. +// returns a *AppPermissions_environments when successful +func (m *AppPermissions) GetEnvironments()(*AppPermissions_environments) { + return m.environments +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AppPermissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_actions) + if err != nil { + return err + } + if val != nil { + m.SetActions(val.(*AppPermissions_actions)) + } + return nil + } + res["administration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_administration) + if err != nil { + return err + } + if val != nil { + m.SetAdministration(val.(*AppPermissions_administration)) + } + return nil + } + res["checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_checks) + if err != nil { + return err + } + if val != nil { + m.SetChecks(val.(*AppPermissions_checks)) + } + return nil + } + res["codespaces"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_codespaces) + if err != nil { + return err + } + if val != nil { + m.SetCodespaces(val.(*AppPermissions_codespaces)) + } + return nil + } + res["contents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_contents) + if err != nil { + return err + } + if val != nil { + m.SetContents(val.(*AppPermissions_contents)) + } + return nil + } + res["dependabot_secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_dependabot_secrets) + if err != nil { + return err + } + if val != nil { + m.SetDependabotSecrets(val.(*AppPermissions_dependabot_secrets)) + } + return nil + } + res["deployments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_deployments) + if err != nil { + return err + } + if val != nil { + m.SetDeployments(val.(*AppPermissions_deployments)) + } + return nil + } + res["email_addresses"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_email_addresses) + if err != nil { + return err + } + if val != nil { + m.SetEmailAddresses(val.(*AppPermissions_email_addresses)) + } + return nil + } + res["environments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_environments) + if err != nil { + return err + } + if val != nil { + m.SetEnvironments(val.(*AppPermissions_environments)) + } + return nil + } + res["followers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_followers) + if err != nil { + return err + } + if val != nil { + m.SetFollowers(val.(*AppPermissions_followers)) + } + return nil + } + res["git_ssh_keys"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_git_ssh_keys) + if err != nil { + return err + } + if val != nil { + m.SetGitSshKeys(val.(*AppPermissions_git_ssh_keys)) + } + return nil + } + res["gpg_keys"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_gpg_keys) + if err != nil { + return err + } + if val != nil { + m.SetGpgKeys(val.(*AppPermissions_gpg_keys)) + } + return nil + } + res["interaction_limits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_interaction_limits) + if err != nil { + return err + } + if val != nil { + m.SetInteractionLimits(val.(*AppPermissions_interaction_limits)) + } + return nil + } + res["issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_issues) + if err != nil { + return err + } + if val != nil { + m.SetIssues(val.(*AppPermissions_issues)) + } + return nil + } + res["members"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_members) + if err != nil { + return err + } + if val != nil { + m.SetMembers(val.(*AppPermissions_members)) + } + return nil + } + res["metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_metadata) + if err != nil { + return err + } + if val != nil { + m.SetMetadata(val.(*AppPermissions_metadata)) + } + return nil + } + res["organization_administration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_administration) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationAdministration(val.(*AppPermissions_organization_administration)) + } + return nil + } + res["organization_announcement_banners"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_announcement_banners) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationAnnouncementBanners(val.(*AppPermissions_organization_announcement_banners)) + } + return nil + } + res["organization_copilot_seat_management"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_copilot_seat_management) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationCopilotSeatManagement(val.(*AppPermissions_organization_copilot_seat_management)) + } + return nil + } + res["organization_custom_org_roles"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_custom_org_roles) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationCustomOrgRoles(val.(*AppPermissions_organization_custom_org_roles)) + } + return nil + } + res["organization_custom_properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_custom_properties) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationCustomProperties(val.(*AppPermissions_organization_custom_properties)) + } + return nil + } + res["organization_custom_roles"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_custom_roles) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationCustomRoles(val.(*AppPermissions_organization_custom_roles)) + } + return nil + } + res["organization_events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_events) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationEvents(val.(*AppPermissions_organization_events)) + } + return nil + } + res["organization_hooks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_hooks) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationHooks(val.(*AppPermissions_organization_hooks)) + } + return nil + } + res["organization_packages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_packages) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationPackages(val.(*AppPermissions_organization_packages)) + } + return nil + } + res["organization_personal_access_token_requests"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_personal_access_token_requests) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationPersonalAccessTokenRequests(val.(*AppPermissions_organization_personal_access_token_requests)) + } + return nil + } + res["organization_personal_access_tokens"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_personal_access_tokens) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationPersonalAccessTokens(val.(*AppPermissions_organization_personal_access_tokens)) + } + return nil + } + res["organization_plan"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_plan) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationPlan(val.(*AppPermissions_organization_plan)) + } + return nil + } + res["organization_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_projects) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationProjects(val.(*AppPermissions_organization_projects)) + } + return nil + } + res["organization_secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_secrets) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationSecrets(val.(*AppPermissions_organization_secrets)) + } + return nil + } + res["organization_self_hosted_runners"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_self_hosted_runners) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationSelfHostedRunners(val.(*AppPermissions_organization_self_hosted_runners)) + } + return nil + } + res["organization_user_blocking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_user_blocking) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationUserBlocking(val.(*AppPermissions_organization_user_blocking)) + } + return nil + } + res["packages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_packages) + if err != nil { + return err + } + if val != nil { + m.SetPackages(val.(*AppPermissions_packages)) + } + return nil + } + res["pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_pages) + if err != nil { + return err + } + if val != nil { + m.SetPages(val.(*AppPermissions_pages)) + } + return nil + } + res["profile"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_profile) + if err != nil { + return err + } + if val != nil { + m.SetProfile(val.(*AppPermissions_profile)) + } + return nil + } + res["pull_requests"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_pull_requests) + if err != nil { + return err + } + if val != nil { + m.SetPullRequests(val.(*AppPermissions_pull_requests)) + } + return nil + } + res["repository_custom_properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_repository_custom_properties) + if err != nil { + return err + } + if val != nil { + m.SetRepositoryCustomProperties(val.(*AppPermissions_repository_custom_properties)) + } + return nil + } + res["repository_hooks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_repository_hooks) + if err != nil { + return err + } + if val != nil { + m.SetRepositoryHooks(val.(*AppPermissions_repository_hooks)) + } + return nil + } + res["repository_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_repository_projects) + if err != nil { + return err + } + if val != nil { + m.SetRepositoryProjects(val.(*AppPermissions_repository_projects)) + } + return nil + } + res["secret_scanning_alerts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_secret_scanning_alerts) + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningAlerts(val.(*AppPermissions_secret_scanning_alerts)) + } + return nil + } + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_secrets) + if err != nil { + return err + } + if val != nil { + m.SetSecrets(val.(*AppPermissions_secrets)) + } + return nil + } + res["security_events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_security_events) + if err != nil { + return err + } + if val != nil { + m.SetSecurityEvents(val.(*AppPermissions_security_events)) + } + return nil + } + res["single_file"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_single_file) + if err != nil { + return err + } + if val != nil { + m.SetSingleFile(val.(*AppPermissions_single_file)) + } + return nil + } + res["starring"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_starring) + if err != nil { + return err + } + if val != nil { + m.SetStarring(val.(*AppPermissions_starring)) + } + return nil + } + res["statuses"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_statuses) + if err != nil { + return err + } + if val != nil { + m.SetStatuses(val.(*AppPermissions_statuses)) + } + return nil + } + res["team_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_team_discussions) + if err != nil { + return err + } + if val != nil { + m.SetTeamDiscussions(val.(*AppPermissions_team_discussions)) + } + return nil + } + res["vulnerability_alerts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_vulnerability_alerts) + if err != nil { + return err + } + if val != nil { + m.SetVulnerabilityAlerts(val.(*AppPermissions_vulnerability_alerts)) + } + return nil + } + res["workflows"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_workflows) + if err != nil { + return err + } + if val != nil { + m.SetWorkflows(val.(*AppPermissions_workflows)) + } + return nil + } + return res +} +// GetFollowers gets the followers property value. The level of permission to grant the access token to manage the followers belonging to a user. +// returns a *AppPermissions_followers when successful +func (m *AppPermissions) GetFollowers()(*AppPermissions_followers) { + return m.followers +} +// GetGitSshKeys gets the git_ssh_keys property value. The level of permission to grant the access token to manage git SSH keys. +// returns a *AppPermissions_git_ssh_keys when successful +func (m *AppPermissions) GetGitSshKeys()(*AppPermissions_git_ssh_keys) { + return m.git_ssh_keys +} +// GetGpgKeys gets the gpg_keys property value. The level of permission to grant the access token to view and manage GPG keys belonging to a user. +// returns a *AppPermissions_gpg_keys when successful +func (m *AppPermissions) GetGpgKeys()(*AppPermissions_gpg_keys) { + return m.gpg_keys +} +// GetInteractionLimits gets the interaction_limits property value. The level of permission to grant the access token to view and manage interaction limits on a repository. +// returns a *AppPermissions_interaction_limits when successful +func (m *AppPermissions) GetInteractionLimits()(*AppPermissions_interaction_limits) { + return m.interaction_limits +} +// GetIssues gets the issues property value. The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. +// returns a *AppPermissions_issues when successful +func (m *AppPermissions) GetIssues()(*AppPermissions_issues) { + return m.issues +} +// GetMembers gets the members property value. The level of permission to grant the access token for organization teams and members. +// returns a *AppPermissions_members when successful +func (m *AppPermissions) GetMembers()(*AppPermissions_members) { + return m.members +} +// GetMetadata gets the metadata property value. The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. +// returns a *AppPermissions_metadata when successful +func (m *AppPermissions) GetMetadata()(*AppPermissions_metadata) { + return m.metadata +} +// GetOrganizationAdministration gets the organization_administration property value. The level of permission to grant the access token to manage access to an organization. +// returns a *AppPermissions_organization_administration when successful +func (m *AppPermissions) GetOrganizationAdministration()(*AppPermissions_organization_administration) { + return m.organization_administration +} +// GetOrganizationAnnouncementBanners gets the organization_announcement_banners property value. The level of permission to grant the access token to view and manage announcement banners for an organization. +// returns a *AppPermissions_organization_announcement_banners when successful +func (m *AppPermissions) GetOrganizationAnnouncementBanners()(*AppPermissions_organization_announcement_banners) { + return m.organization_announcement_banners +} +// GetOrganizationCopilotSeatManagement gets the organization_copilot_seat_management property value. The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in beta and is subject to change. +// returns a *AppPermissions_organization_copilot_seat_management when successful +func (m *AppPermissions) GetOrganizationCopilotSeatManagement()(*AppPermissions_organization_copilot_seat_management) { + return m.organization_copilot_seat_management +} +// GetOrganizationCustomOrgRoles gets the organization_custom_org_roles property value. The level of permission to grant the access token for custom organization roles management. +// returns a *AppPermissions_organization_custom_org_roles when successful +func (m *AppPermissions) GetOrganizationCustomOrgRoles()(*AppPermissions_organization_custom_org_roles) { + return m.organization_custom_org_roles +} +// GetOrganizationCustomProperties gets the organization_custom_properties property value. The level of permission to grant the access token for custom property management. +// returns a *AppPermissions_organization_custom_properties when successful +func (m *AppPermissions) GetOrganizationCustomProperties()(*AppPermissions_organization_custom_properties) { + return m.organization_custom_properties +} +// GetOrganizationCustomRoles gets the organization_custom_roles property value. The level of permission to grant the access token for custom repository roles management. +// returns a *AppPermissions_organization_custom_roles when successful +func (m *AppPermissions) GetOrganizationCustomRoles()(*AppPermissions_organization_custom_roles) { + return m.organization_custom_roles +} +// GetOrganizationEvents gets the organization_events property value. The level of permission to grant the access token to view events triggered by an activity in an organization. +// returns a *AppPermissions_organization_events when successful +func (m *AppPermissions) GetOrganizationEvents()(*AppPermissions_organization_events) { + return m.organization_events +} +// GetOrganizationHooks gets the organization_hooks property value. The level of permission to grant the access token to manage the post-receive hooks for an organization. +// returns a *AppPermissions_organization_hooks when successful +func (m *AppPermissions) GetOrganizationHooks()(*AppPermissions_organization_hooks) { + return m.organization_hooks +} +// GetOrganizationPackages gets the organization_packages property value. The level of permission to grant the access token for organization packages published to GitHub Packages. +// returns a *AppPermissions_organization_packages when successful +func (m *AppPermissions) GetOrganizationPackages()(*AppPermissions_organization_packages) { + return m.organization_packages +} +// GetOrganizationPersonalAccessTokenRequests gets the organization_personal_access_token_requests property value. The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization. +// returns a *AppPermissions_organization_personal_access_token_requests when successful +func (m *AppPermissions) GetOrganizationPersonalAccessTokenRequests()(*AppPermissions_organization_personal_access_token_requests) { + return m.organization_personal_access_token_requests +} +// GetOrganizationPersonalAccessTokens gets the organization_personal_access_tokens property value. The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization. +// returns a *AppPermissions_organization_personal_access_tokens when successful +func (m *AppPermissions) GetOrganizationPersonalAccessTokens()(*AppPermissions_organization_personal_access_tokens) { + return m.organization_personal_access_tokens +} +// GetOrganizationPlan gets the organization_plan property value. The level of permission to grant the access token for viewing an organization's plan. +// returns a *AppPermissions_organization_plan when successful +func (m *AppPermissions) GetOrganizationPlan()(*AppPermissions_organization_plan) { + return m.organization_plan +} +// GetOrganizationProjects gets the organization_projects property value. The level of permission to grant the access token to manage organization projects and projects beta (where available). +// returns a *AppPermissions_organization_projects when successful +func (m *AppPermissions) GetOrganizationProjects()(*AppPermissions_organization_projects) { + return m.organization_projects +} +// GetOrganizationSecrets gets the organization_secrets property value. The level of permission to grant the access token to manage organization secrets. +// returns a *AppPermissions_organization_secrets when successful +func (m *AppPermissions) GetOrganizationSecrets()(*AppPermissions_organization_secrets) { + return m.organization_secrets +} +// GetOrganizationSelfHostedRunners gets the organization_self_hosted_runners property value. The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. +// returns a *AppPermissions_organization_self_hosted_runners when successful +func (m *AppPermissions) GetOrganizationSelfHostedRunners()(*AppPermissions_organization_self_hosted_runners) { + return m.organization_self_hosted_runners +} +// GetOrganizationUserBlocking gets the organization_user_blocking property value. The level of permission to grant the access token to view and manage users blocked by the organization. +// returns a *AppPermissions_organization_user_blocking when successful +func (m *AppPermissions) GetOrganizationUserBlocking()(*AppPermissions_organization_user_blocking) { + return m.organization_user_blocking +} +// GetPackages gets the packages property value. The level of permission to grant the access token for packages published to GitHub Packages. +// returns a *AppPermissions_packages when successful +func (m *AppPermissions) GetPackages()(*AppPermissions_packages) { + return m.packages +} +// GetPages gets the pages property value. The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. +// returns a *AppPermissions_pages when successful +func (m *AppPermissions) GetPages()(*AppPermissions_pages) { + return m.pages +} +// GetProfile gets the profile property value. The level of permission to grant the access token to manage the profile settings belonging to a user. +// returns a *AppPermissions_profile when successful +func (m *AppPermissions) GetProfile()(*AppPermissions_profile) { + return m.profile +} +// GetPullRequests gets the pull_requests property value. The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. +// returns a *AppPermissions_pull_requests when successful +func (m *AppPermissions) GetPullRequests()(*AppPermissions_pull_requests) { + return m.pull_requests +} +// GetRepositoryCustomProperties gets the repository_custom_properties property value. The level of permission to grant the access token to view and edit custom properties for a repository, when allowed by the property. +// returns a *AppPermissions_repository_custom_properties when successful +func (m *AppPermissions) GetRepositoryCustomProperties()(*AppPermissions_repository_custom_properties) { + return m.repository_custom_properties +} +// GetRepositoryHooks gets the repository_hooks property value. The level of permission to grant the access token to manage the post-receive hooks for a repository. +// returns a *AppPermissions_repository_hooks when successful +func (m *AppPermissions) GetRepositoryHooks()(*AppPermissions_repository_hooks) { + return m.repository_hooks +} +// GetRepositoryProjects gets the repository_projects property value. The level of permission to grant the access token to manage repository projects, columns, and cards. +// returns a *AppPermissions_repository_projects when successful +func (m *AppPermissions) GetRepositoryProjects()(*AppPermissions_repository_projects) { + return m.repository_projects +} +// GetSecrets gets the secrets property value. The level of permission to grant the access token to manage repository secrets. +// returns a *AppPermissions_secrets when successful +func (m *AppPermissions) GetSecrets()(*AppPermissions_secrets) { + return m.secrets +} +// GetSecretScanningAlerts gets the secret_scanning_alerts property value. The level of permission to grant the access token to view and manage secret scanning alerts. +// returns a *AppPermissions_secret_scanning_alerts when successful +func (m *AppPermissions) GetSecretScanningAlerts()(*AppPermissions_secret_scanning_alerts) { + return m.secret_scanning_alerts +} +// GetSecurityEvents gets the security_events property value. The level of permission to grant the access token to view and manage security events like code scanning alerts. +// returns a *AppPermissions_security_events when successful +func (m *AppPermissions) GetSecurityEvents()(*AppPermissions_security_events) { + return m.security_events +} +// GetSingleFile gets the single_file property value. The level of permission to grant the access token to manage just a single file. +// returns a *AppPermissions_single_file when successful +func (m *AppPermissions) GetSingleFile()(*AppPermissions_single_file) { + return m.single_file +} +// GetStarring gets the starring property value. The level of permission to grant the access token to list and manage repositories a user is starring. +// returns a *AppPermissions_starring when successful +func (m *AppPermissions) GetStarring()(*AppPermissions_starring) { + return m.starring +} +// GetStatuses gets the statuses property value. The level of permission to grant the access token for commit statuses. +// returns a *AppPermissions_statuses when successful +func (m *AppPermissions) GetStatuses()(*AppPermissions_statuses) { + return m.statuses +} +// GetTeamDiscussions gets the team_discussions property value. The level of permission to grant the access token to manage team discussions and related comments. +// returns a *AppPermissions_team_discussions when successful +func (m *AppPermissions) GetTeamDiscussions()(*AppPermissions_team_discussions) { + return m.team_discussions +} +// GetVulnerabilityAlerts gets the vulnerability_alerts property value. The level of permission to grant the access token to manage Dependabot alerts. +// returns a *AppPermissions_vulnerability_alerts when successful +func (m *AppPermissions) GetVulnerabilityAlerts()(*AppPermissions_vulnerability_alerts) { + return m.vulnerability_alerts +} +// GetWorkflows gets the workflows property value. The level of permission to grant the access token to update GitHub Actions workflow files. +// returns a *AppPermissions_workflows when successful +func (m *AppPermissions) GetWorkflows()(*AppPermissions_workflows) { + return m.workflows +} +// Serialize serializes information the current object +func (m *AppPermissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetActions() != nil { + cast := (*m.GetActions()).String() + err := writer.WriteStringValue("actions", &cast) + if err != nil { + return err + } + } + if m.GetAdministration() != nil { + cast := (*m.GetAdministration()).String() + err := writer.WriteStringValue("administration", &cast) + if err != nil { + return err + } + } + if m.GetChecks() != nil { + cast := (*m.GetChecks()).String() + err := writer.WriteStringValue("checks", &cast) + if err != nil { + return err + } + } + if m.GetCodespaces() != nil { + cast := (*m.GetCodespaces()).String() + err := writer.WriteStringValue("codespaces", &cast) + if err != nil { + return err + } + } + if m.GetContents() != nil { + cast := (*m.GetContents()).String() + err := writer.WriteStringValue("contents", &cast) + if err != nil { + return err + } + } + if m.GetDependabotSecrets() != nil { + cast := (*m.GetDependabotSecrets()).String() + err := writer.WriteStringValue("dependabot_secrets", &cast) + if err != nil { + return err + } + } + if m.GetDeployments() != nil { + cast := (*m.GetDeployments()).String() + err := writer.WriteStringValue("deployments", &cast) + if err != nil { + return err + } + } + if m.GetEmailAddresses() != nil { + cast := (*m.GetEmailAddresses()).String() + err := writer.WriteStringValue("email_addresses", &cast) + if err != nil { + return err + } + } + if m.GetEnvironments() != nil { + cast := (*m.GetEnvironments()).String() + err := writer.WriteStringValue("environments", &cast) + if err != nil { + return err + } + } + if m.GetFollowers() != nil { + cast := (*m.GetFollowers()).String() + err := writer.WriteStringValue("followers", &cast) + if err != nil { + return err + } + } + if m.GetGitSshKeys() != nil { + cast := (*m.GetGitSshKeys()).String() + err := writer.WriteStringValue("git_ssh_keys", &cast) + if err != nil { + return err + } + } + if m.GetGpgKeys() != nil { + cast := (*m.GetGpgKeys()).String() + err := writer.WriteStringValue("gpg_keys", &cast) + if err != nil { + return err + } + } + if m.GetInteractionLimits() != nil { + cast := (*m.GetInteractionLimits()).String() + err := writer.WriteStringValue("interaction_limits", &cast) + if err != nil { + return err + } + } + if m.GetIssues() != nil { + cast := (*m.GetIssues()).String() + err := writer.WriteStringValue("issues", &cast) + if err != nil { + return err + } + } + if m.GetMembers() != nil { + cast := (*m.GetMembers()).String() + err := writer.WriteStringValue("members", &cast) + if err != nil { + return err + } + } + if m.GetMetadata() != nil { + cast := (*m.GetMetadata()).String() + err := writer.WriteStringValue("metadata", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationAdministration() != nil { + cast := (*m.GetOrganizationAdministration()).String() + err := writer.WriteStringValue("organization_administration", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationAnnouncementBanners() != nil { + cast := (*m.GetOrganizationAnnouncementBanners()).String() + err := writer.WriteStringValue("organization_announcement_banners", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationCopilotSeatManagement() != nil { + cast := (*m.GetOrganizationCopilotSeatManagement()).String() + err := writer.WriteStringValue("organization_copilot_seat_management", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationCustomOrgRoles() != nil { + cast := (*m.GetOrganizationCustomOrgRoles()).String() + err := writer.WriteStringValue("organization_custom_org_roles", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationCustomProperties() != nil { + cast := (*m.GetOrganizationCustomProperties()).String() + err := writer.WriteStringValue("organization_custom_properties", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationCustomRoles() != nil { + cast := (*m.GetOrganizationCustomRoles()).String() + err := writer.WriteStringValue("organization_custom_roles", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationEvents() != nil { + cast := (*m.GetOrganizationEvents()).String() + err := writer.WriteStringValue("organization_events", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationHooks() != nil { + cast := (*m.GetOrganizationHooks()).String() + err := writer.WriteStringValue("organization_hooks", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationPackages() != nil { + cast := (*m.GetOrganizationPackages()).String() + err := writer.WriteStringValue("organization_packages", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationPersonalAccessTokens() != nil { + cast := (*m.GetOrganizationPersonalAccessTokens()).String() + err := writer.WriteStringValue("organization_personal_access_tokens", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationPersonalAccessTokenRequests() != nil { + cast := (*m.GetOrganizationPersonalAccessTokenRequests()).String() + err := writer.WriteStringValue("organization_personal_access_token_requests", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationPlan() != nil { + cast := (*m.GetOrganizationPlan()).String() + err := writer.WriteStringValue("organization_plan", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationProjects() != nil { + cast := (*m.GetOrganizationProjects()).String() + err := writer.WriteStringValue("organization_projects", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationSecrets() != nil { + cast := (*m.GetOrganizationSecrets()).String() + err := writer.WriteStringValue("organization_secrets", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationSelfHostedRunners() != nil { + cast := (*m.GetOrganizationSelfHostedRunners()).String() + err := writer.WriteStringValue("organization_self_hosted_runners", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationUserBlocking() != nil { + cast := (*m.GetOrganizationUserBlocking()).String() + err := writer.WriteStringValue("organization_user_blocking", &cast) + if err != nil { + return err + } + } + if m.GetPackages() != nil { + cast := (*m.GetPackages()).String() + err := writer.WriteStringValue("packages", &cast) + if err != nil { + return err + } + } + if m.GetPages() != nil { + cast := (*m.GetPages()).String() + err := writer.WriteStringValue("pages", &cast) + if err != nil { + return err + } + } + if m.GetProfile() != nil { + cast := (*m.GetProfile()).String() + err := writer.WriteStringValue("profile", &cast) + if err != nil { + return err + } + } + if m.GetPullRequests() != nil { + cast := (*m.GetPullRequests()).String() + err := writer.WriteStringValue("pull_requests", &cast) + if err != nil { + return err + } + } + if m.GetRepositoryCustomProperties() != nil { + cast := (*m.GetRepositoryCustomProperties()).String() + err := writer.WriteStringValue("repository_custom_properties", &cast) + if err != nil { + return err + } + } + if m.GetRepositoryHooks() != nil { + cast := (*m.GetRepositoryHooks()).String() + err := writer.WriteStringValue("repository_hooks", &cast) + if err != nil { + return err + } + } + if m.GetRepositoryProjects() != nil { + cast := (*m.GetRepositoryProjects()).String() + err := writer.WriteStringValue("repository_projects", &cast) + if err != nil { + return err + } + } + if m.GetSecrets() != nil { + cast := (*m.GetSecrets()).String() + err := writer.WriteStringValue("secrets", &cast) + if err != nil { + return err + } + } + if m.GetSecretScanningAlerts() != nil { + cast := (*m.GetSecretScanningAlerts()).String() + err := writer.WriteStringValue("secret_scanning_alerts", &cast) + if err != nil { + return err + } + } + if m.GetSecurityEvents() != nil { + cast := (*m.GetSecurityEvents()).String() + err := writer.WriteStringValue("security_events", &cast) + if err != nil { + return err + } + } + if m.GetSingleFile() != nil { + cast := (*m.GetSingleFile()).String() + err := writer.WriteStringValue("single_file", &cast) + if err != nil { + return err + } + } + if m.GetStarring() != nil { + cast := (*m.GetStarring()).String() + err := writer.WriteStringValue("starring", &cast) + if err != nil { + return err + } + } + if m.GetStatuses() != nil { + cast := (*m.GetStatuses()).String() + err := writer.WriteStringValue("statuses", &cast) + if err != nil { + return err + } + } + if m.GetTeamDiscussions() != nil { + cast := (*m.GetTeamDiscussions()).String() + err := writer.WriteStringValue("team_discussions", &cast) + if err != nil { + return err + } + } + if m.GetVulnerabilityAlerts() != nil { + cast := (*m.GetVulnerabilityAlerts()).String() + err := writer.WriteStringValue("vulnerability_alerts", &cast) + if err != nil { + return err + } + } + if m.GetWorkflows() != nil { + cast := (*m.GetWorkflows()).String() + err := writer.WriteStringValue("workflows", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActions sets the actions property value. The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. +func (m *AppPermissions) SetActions(value *AppPermissions_actions)() { + m.actions = value +} +// 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 *AppPermissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdministration sets the administration property value. The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. +func (m *AppPermissions) SetAdministration(value *AppPermissions_administration)() { + m.administration = value +} +// SetChecks sets the checks property value. The level of permission to grant the access token for checks on code. +func (m *AppPermissions) SetChecks(value *AppPermissions_checks)() { + m.checks = value +} +// SetCodespaces sets the codespaces property value. The level of permission to grant the access token to create, edit, delete, and list Codespaces. +func (m *AppPermissions) SetCodespaces(value *AppPermissions_codespaces)() { + m.codespaces = value +} +// SetContents sets the contents property value. The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. +func (m *AppPermissions) SetContents(value *AppPermissions_contents)() { + m.contents = value +} +// SetDependabotSecrets sets the dependabot_secrets property value. The leve of permission to grant the access token to manage Dependabot secrets. +func (m *AppPermissions) SetDependabotSecrets(value *AppPermissions_dependabot_secrets)() { + m.dependabot_secrets = value +} +// SetDeployments sets the deployments property value. The level of permission to grant the access token for deployments and deployment statuses. +func (m *AppPermissions) SetDeployments(value *AppPermissions_deployments)() { + m.deployments = value +} +// SetEmailAddresses sets the email_addresses property value. The level of permission to grant the access token to manage the email addresses belonging to a user. +func (m *AppPermissions) SetEmailAddresses(value *AppPermissions_email_addresses)() { + m.email_addresses = value +} +// SetEnvironments sets the environments property value. The level of permission to grant the access token for managing repository environments. +func (m *AppPermissions) SetEnvironments(value *AppPermissions_environments)() { + m.environments = value +} +// SetFollowers sets the followers property value. The level of permission to grant the access token to manage the followers belonging to a user. +func (m *AppPermissions) SetFollowers(value *AppPermissions_followers)() { + m.followers = value +} +// SetGitSshKeys sets the git_ssh_keys property value. The level of permission to grant the access token to manage git SSH keys. +func (m *AppPermissions) SetGitSshKeys(value *AppPermissions_git_ssh_keys)() { + m.git_ssh_keys = value +} +// SetGpgKeys sets the gpg_keys property value. The level of permission to grant the access token to view and manage GPG keys belonging to a user. +func (m *AppPermissions) SetGpgKeys(value *AppPermissions_gpg_keys)() { + m.gpg_keys = value +} +// SetInteractionLimits sets the interaction_limits property value. The level of permission to grant the access token to view and manage interaction limits on a repository. +func (m *AppPermissions) SetInteractionLimits(value *AppPermissions_interaction_limits)() { + m.interaction_limits = value +} +// SetIssues sets the issues property value. The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. +func (m *AppPermissions) SetIssues(value *AppPermissions_issues)() { + m.issues = value +} +// SetMembers sets the members property value. The level of permission to grant the access token for organization teams and members. +func (m *AppPermissions) SetMembers(value *AppPermissions_members)() { + m.members = value +} +// SetMetadata sets the metadata property value. The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. +func (m *AppPermissions) SetMetadata(value *AppPermissions_metadata)() { + m.metadata = value +} +// SetOrganizationAdministration sets the organization_administration property value. The level of permission to grant the access token to manage access to an organization. +func (m *AppPermissions) SetOrganizationAdministration(value *AppPermissions_organization_administration)() { + m.organization_administration = value +} +// SetOrganizationAnnouncementBanners sets the organization_announcement_banners property value. The level of permission to grant the access token to view and manage announcement banners for an organization. +func (m *AppPermissions) SetOrganizationAnnouncementBanners(value *AppPermissions_organization_announcement_banners)() { + m.organization_announcement_banners = value +} +// SetOrganizationCopilotSeatManagement sets the organization_copilot_seat_management property value. The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in beta and is subject to change. +func (m *AppPermissions) SetOrganizationCopilotSeatManagement(value *AppPermissions_organization_copilot_seat_management)() { + m.organization_copilot_seat_management = value +} +// SetOrganizationCustomOrgRoles sets the organization_custom_org_roles property value. The level of permission to grant the access token for custom organization roles management. +func (m *AppPermissions) SetOrganizationCustomOrgRoles(value *AppPermissions_organization_custom_org_roles)() { + m.organization_custom_org_roles = value +} +// SetOrganizationCustomProperties sets the organization_custom_properties property value. The level of permission to grant the access token for custom property management. +func (m *AppPermissions) SetOrganizationCustomProperties(value *AppPermissions_organization_custom_properties)() { + m.organization_custom_properties = value +} +// SetOrganizationCustomRoles sets the organization_custom_roles property value. The level of permission to grant the access token for custom repository roles management. +func (m *AppPermissions) SetOrganizationCustomRoles(value *AppPermissions_organization_custom_roles)() { + m.organization_custom_roles = value +} +// SetOrganizationEvents sets the organization_events property value. The level of permission to grant the access token to view events triggered by an activity in an organization. +func (m *AppPermissions) SetOrganizationEvents(value *AppPermissions_organization_events)() { + m.organization_events = value +} +// SetOrganizationHooks sets the organization_hooks property value. The level of permission to grant the access token to manage the post-receive hooks for an organization. +func (m *AppPermissions) SetOrganizationHooks(value *AppPermissions_organization_hooks)() { + m.organization_hooks = value +} +// SetOrganizationPackages sets the organization_packages property value. The level of permission to grant the access token for organization packages published to GitHub Packages. +func (m *AppPermissions) SetOrganizationPackages(value *AppPermissions_organization_packages)() { + m.organization_packages = value +} +// SetOrganizationPersonalAccessTokenRequests sets the organization_personal_access_token_requests property value. The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization. +func (m *AppPermissions) SetOrganizationPersonalAccessTokenRequests(value *AppPermissions_organization_personal_access_token_requests)() { + m.organization_personal_access_token_requests = value +} +// SetOrganizationPersonalAccessTokens sets the organization_personal_access_tokens property value. The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization. +func (m *AppPermissions) SetOrganizationPersonalAccessTokens(value *AppPermissions_organization_personal_access_tokens)() { + m.organization_personal_access_tokens = value +} +// SetOrganizationPlan sets the organization_plan property value. The level of permission to grant the access token for viewing an organization's plan. +func (m *AppPermissions) SetOrganizationPlan(value *AppPermissions_organization_plan)() { + m.organization_plan = value +} +// SetOrganizationProjects sets the organization_projects property value. The level of permission to grant the access token to manage organization projects and projects beta (where available). +func (m *AppPermissions) SetOrganizationProjects(value *AppPermissions_organization_projects)() { + m.organization_projects = value +} +// SetOrganizationSecrets sets the organization_secrets property value. The level of permission to grant the access token to manage organization secrets. +func (m *AppPermissions) SetOrganizationSecrets(value *AppPermissions_organization_secrets)() { + m.organization_secrets = value +} +// SetOrganizationSelfHostedRunners sets the organization_self_hosted_runners property value. The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. +func (m *AppPermissions) SetOrganizationSelfHostedRunners(value *AppPermissions_organization_self_hosted_runners)() { + m.organization_self_hosted_runners = value +} +// SetOrganizationUserBlocking sets the organization_user_blocking property value. The level of permission to grant the access token to view and manage users blocked by the organization. +func (m *AppPermissions) SetOrganizationUserBlocking(value *AppPermissions_organization_user_blocking)() { + m.organization_user_blocking = value +} +// SetPackages sets the packages property value. The level of permission to grant the access token for packages published to GitHub Packages. +func (m *AppPermissions) SetPackages(value *AppPermissions_packages)() { + m.packages = value +} +// SetPages sets the pages property value. The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. +func (m *AppPermissions) SetPages(value *AppPermissions_pages)() { + m.pages = value +} +// SetProfile sets the profile property value. The level of permission to grant the access token to manage the profile settings belonging to a user. +func (m *AppPermissions) SetProfile(value *AppPermissions_profile)() { + m.profile = value +} +// SetPullRequests sets the pull_requests property value. The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. +func (m *AppPermissions) SetPullRequests(value *AppPermissions_pull_requests)() { + m.pull_requests = value +} +// SetRepositoryCustomProperties sets the repository_custom_properties property value. The level of permission to grant the access token to view and edit custom properties for a repository, when allowed by the property. +func (m *AppPermissions) SetRepositoryCustomProperties(value *AppPermissions_repository_custom_properties)() { + m.repository_custom_properties = value +} +// SetRepositoryHooks sets the repository_hooks property value. The level of permission to grant the access token to manage the post-receive hooks for a repository. +func (m *AppPermissions) SetRepositoryHooks(value *AppPermissions_repository_hooks)() { + m.repository_hooks = value +} +// SetRepositoryProjects sets the repository_projects property value. The level of permission to grant the access token to manage repository projects, columns, and cards. +func (m *AppPermissions) SetRepositoryProjects(value *AppPermissions_repository_projects)() { + m.repository_projects = value +} +// SetSecrets sets the secrets property value. The level of permission to grant the access token to manage repository secrets. +func (m *AppPermissions) SetSecrets(value *AppPermissions_secrets)() { + m.secrets = value +} +// SetSecretScanningAlerts sets the secret_scanning_alerts property value. The level of permission to grant the access token to view and manage secret scanning alerts. +func (m *AppPermissions) SetSecretScanningAlerts(value *AppPermissions_secret_scanning_alerts)() { + m.secret_scanning_alerts = value +} +// SetSecurityEvents sets the security_events property value. The level of permission to grant the access token to view and manage security events like code scanning alerts. +func (m *AppPermissions) SetSecurityEvents(value *AppPermissions_security_events)() { + m.security_events = value +} +// SetSingleFile sets the single_file property value. The level of permission to grant the access token to manage just a single file. +func (m *AppPermissions) SetSingleFile(value *AppPermissions_single_file)() { + m.single_file = value +} +// SetStarring sets the starring property value. The level of permission to grant the access token to list and manage repositories a user is starring. +func (m *AppPermissions) SetStarring(value *AppPermissions_starring)() { + m.starring = value +} +// SetStatuses sets the statuses property value. The level of permission to grant the access token for commit statuses. +func (m *AppPermissions) SetStatuses(value *AppPermissions_statuses)() { + m.statuses = value +} +// SetTeamDiscussions sets the team_discussions property value. The level of permission to grant the access token to manage team discussions and related comments. +func (m *AppPermissions) SetTeamDiscussions(value *AppPermissions_team_discussions)() { + m.team_discussions = value +} +// SetVulnerabilityAlerts sets the vulnerability_alerts property value. The level of permission to grant the access token to manage Dependabot alerts. +func (m *AppPermissions) SetVulnerabilityAlerts(value *AppPermissions_vulnerability_alerts)() { + m.vulnerability_alerts = value +} +// SetWorkflows sets the workflows property value. The level of permission to grant the access token to update GitHub Actions workflow files. +func (m *AppPermissions) SetWorkflows(value *AppPermissions_workflows)() { + m.workflows = value +} +type AppPermissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActions()(*AppPermissions_actions) + GetAdministration()(*AppPermissions_administration) + GetChecks()(*AppPermissions_checks) + GetCodespaces()(*AppPermissions_codespaces) + GetContents()(*AppPermissions_contents) + GetDependabotSecrets()(*AppPermissions_dependabot_secrets) + GetDeployments()(*AppPermissions_deployments) + GetEmailAddresses()(*AppPermissions_email_addresses) + GetEnvironments()(*AppPermissions_environments) + GetFollowers()(*AppPermissions_followers) + GetGitSshKeys()(*AppPermissions_git_ssh_keys) + GetGpgKeys()(*AppPermissions_gpg_keys) + GetInteractionLimits()(*AppPermissions_interaction_limits) + GetIssues()(*AppPermissions_issues) + GetMembers()(*AppPermissions_members) + GetMetadata()(*AppPermissions_metadata) + GetOrganizationAdministration()(*AppPermissions_organization_administration) + GetOrganizationAnnouncementBanners()(*AppPermissions_organization_announcement_banners) + GetOrganizationCopilotSeatManagement()(*AppPermissions_organization_copilot_seat_management) + GetOrganizationCustomOrgRoles()(*AppPermissions_organization_custom_org_roles) + GetOrganizationCustomProperties()(*AppPermissions_organization_custom_properties) + GetOrganizationCustomRoles()(*AppPermissions_organization_custom_roles) + GetOrganizationEvents()(*AppPermissions_organization_events) + GetOrganizationHooks()(*AppPermissions_organization_hooks) + GetOrganizationPackages()(*AppPermissions_organization_packages) + GetOrganizationPersonalAccessTokenRequests()(*AppPermissions_organization_personal_access_token_requests) + GetOrganizationPersonalAccessTokens()(*AppPermissions_organization_personal_access_tokens) + GetOrganizationPlan()(*AppPermissions_organization_plan) + GetOrganizationProjects()(*AppPermissions_organization_projects) + GetOrganizationSecrets()(*AppPermissions_organization_secrets) + GetOrganizationSelfHostedRunners()(*AppPermissions_organization_self_hosted_runners) + GetOrganizationUserBlocking()(*AppPermissions_organization_user_blocking) + GetPackages()(*AppPermissions_packages) + GetPages()(*AppPermissions_pages) + GetProfile()(*AppPermissions_profile) + GetPullRequests()(*AppPermissions_pull_requests) + GetRepositoryCustomProperties()(*AppPermissions_repository_custom_properties) + GetRepositoryHooks()(*AppPermissions_repository_hooks) + GetRepositoryProjects()(*AppPermissions_repository_projects) + GetSecrets()(*AppPermissions_secrets) + GetSecretScanningAlerts()(*AppPermissions_secret_scanning_alerts) + GetSecurityEvents()(*AppPermissions_security_events) + GetSingleFile()(*AppPermissions_single_file) + GetStarring()(*AppPermissions_starring) + GetStatuses()(*AppPermissions_statuses) + GetTeamDiscussions()(*AppPermissions_team_discussions) + GetVulnerabilityAlerts()(*AppPermissions_vulnerability_alerts) + GetWorkflows()(*AppPermissions_workflows) + SetActions(value *AppPermissions_actions)() + SetAdministration(value *AppPermissions_administration)() + SetChecks(value *AppPermissions_checks)() + SetCodespaces(value *AppPermissions_codespaces)() + SetContents(value *AppPermissions_contents)() + SetDependabotSecrets(value *AppPermissions_dependabot_secrets)() + SetDeployments(value *AppPermissions_deployments)() + SetEmailAddresses(value *AppPermissions_email_addresses)() + SetEnvironments(value *AppPermissions_environments)() + SetFollowers(value *AppPermissions_followers)() + SetGitSshKeys(value *AppPermissions_git_ssh_keys)() + SetGpgKeys(value *AppPermissions_gpg_keys)() + SetInteractionLimits(value *AppPermissions_interaction_limits)() + SetIssues(value *AppPermissions_issues)() + SetMembers(value *AppPermissions_members)() + SetMetadata(value *AppPermissions_metadata)() + SetOrganizationAdministration(value *AppPermissions_organization_administration)() + SetOrganizationAnnouncementBanners(value *AppPermissions_organization_announcement_banners)() + SetOrganizationCopilotSeatManagement(value *AppPermissions_organization_copilot_seat_management)() + SetOrganizationCustomOrgRoles(value *AppPermissions_organization_custom_org_roles)() + SetOrganizationCustomProperties(value *AppPermissions_organization_custom_properties)() + SetOrganizationCustomRoles(value *AppPermissions_organization_custom_roles)() + SetOrganizationEvents(value *AppPermissions_organization_events)() + SetOrganizationHooks(value *AppPermissions_organization_hooks)() + SetOrganizationPackages(value *AppPermissions_organization_packages)() + SetOrganizationPersonalAccessTokenRequests(value *AppPermissions_organization_personal_access_token_requests)() + SetOrganizationPersonalAccessTokens(value *AppPermissions_organization_personal_access_tokens)() + SetOrganizationPlan(value *AppPermissions_organization_plan)() + SetOrganizationProjects(value *AppPermissions_organization_projects)() + SetOrganizationSecrets(value *AppPermissions_organization_secrets)() + SetOrganizationSelfHostedRunners(value *AppPermissions_organization_self_hosted_runners)() + SetOrganizationUserBlocking(value *AppPermissions_organization_user_blocking)() + SetPackages(value *AppPermissions_packages)() + SetPages(value *AppPermissions_pages)() + SetProfile(value *AppPermissions_profile)() + SetPullRequests(value *AppPermissions_pull_requests)() + SetRepositoryCustomProperties(value *AppPermissions_repository_custom_properties)() + SetRepositoryHooks(value *AppPermissions_repository_hooks)() + SetRepositoryProjects(value *AppPermissions_repository_projects)() + SetSecrets(value *AppPermissions_secrets)() + SetSecretScanningAlerts(value *AppPermissions_secret_scanning_alerts)() + SetSecurityEvents(value *AppPermissions_security_events)() + SetSingleFile(value *AppPermissions_single_file)() + SetStarring(value *AppPermissions_starring)() + SetStatuses(value *AppPermissions_statuses)() + SetTeamDiscussions(value *AppPermissions_team_discussions)() + SetVulnerabilityAlerts(value *AppPermissions_vulnerability_alerts)() + SetWorkflows(value *AppPermissions_workflows)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_actions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_actions.go new file mode 100644 index 000000000..937956a9a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_actions.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. +type AppPermissions_actions int + +const ( + READ_APPPERMISSIONS_ACTIONS AppPermissions_actions = iota + WRITE_APPPERMISSIONS_ACTIONS +) + +func (i AppPermissions_actions) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_actions(v string) (any, error) { + result := READ_APPPERMISSIONS_ACTIONS + switch v { + case "read": + result = READ_APPPERMISSIONS_ACTIONS + case "write": + result = WRITE_APPPERMISSIONS_ACTIONS + default: + return 0, errors.New("Unknown AppPermissions_actions value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_actions(values []AppPermissions_actions) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_actions) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_administration.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_administration.go new file mode 100644 index 000000000..60f54d0f5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_administration.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. +type AppPermissions_administration int + +const ( + READ_APPPERMISSIONS_ADMINISTRATION AppPermissions_administration = iota + WRITE_APPPERMISSIONS_ADMINISTRATION +) + +func (i AppPermissions_administration) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_administration(v string) (any, error) { + result := READ_APPPERMISSIONS_ADMINISTRATION + switch v { + case "read": + result = READ_APPPERMISSIONS_ADMINISTRATION + case "write": + result = WRITE_APPPERMISSIONS_ADMINISTRATION + default: + return 0, errors.New("Unknown AppPermissions_administration value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_administration(values []AppPermissions_administration) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_administration) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_checks.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_checks.go new file mode 100644 index 000000000..f22fcf50a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_checks.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for checks on code. +type AppPermissions_checks int + +const ( + READ_APPPERMISSIONS_CHECKS AppPermissions_checks = iota + WRITE_APPPERMISSIONS_CHECKS +) + +func (i AppPermissions_checks) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_checks(v string) (any, error) { + result := READ_APPPERMISSIONS_CHECKS + switch v { + case "read": + result = READ_APPPERMISSIONS_CHECKS + case "write": + result = WRITE_APPPERMISSIONS_CHECKS + default: + return 0, errors.New("Unknown AppPermissions_checks value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_checks(values []AppPermissions_checks) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_checks) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_codespaces.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_codespaces.go new file mode 100644 index 000000000..1d49364d6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_codespaces.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to create, edit, delete, and list Codespaces. +type AppPermissions_codespaces int + +const ( + READ_APPPERMISSIONS_CODESPACES AppPermissions_codespaces = iota + WRITE_APPPERMISSIONS_CODESPACES +) + +func (i AppPermissions_codespaces) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_codespaces(v string) (any, error) { + result := READ_APPPERMISSIONS_CODESPACES + switch v { + case "read": + result = READ_APPPERMISSIONS_CODESPACES + case "write": + result = WRITE_APPPERMISSIONS_CODESPACES + default: + return 0, errors.New("Unknown AppPermissions_codespaces value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_codespaces(values []AppPermissions_codespaces) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_codespaces) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_contents.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_contents.go new file mode 100644 index 000000000..b3eaf8c6c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_contents.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. +type AppPermissions_contents int + +const ( + READ_APPPERMISSIONS_CONTENTS AppPermissions_contents = iota + WRITE_APPPERMISSIONS_CONTENTS +) + +func (i AppPermissions_contents) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_contents(v string) (any, error) { + result := READ_APPPERMISSIONS_CONTENTS + switch v { + case "read": + result = READ_APPPERMISSIONS_CONTENTS + case "write": + result = WRITE_APPPERMISSIONS_CONTENTS + default: + return 0, errors.New("Unknown AppPermissions_contents value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_contents(values []AppPermissions_contents) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_contents) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_dependabot_secrets.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_dependabot_secrets.go new file mode 100644 index 000000000..cfbcaa343 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_dependabot_secrets.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The leve of permission to grant the access token to manage Dependabot secrets. +type AppPermissions_dependabot_secrets int + +const ( + READ_APPPERMISSIONS_DEPENDABOT_SECRETS AppPermissions_dependabot_secrets = iota + WRITE_APPPERMISSIONS_DEPENDABOT_SECRETS +) + +func (i AppPermissions_dependabot_secrets) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_dependabot_secrets(v string) (any, error) { + result := READ_APPPERMISSIONS_DEPENDABOT_SECRETS + switch v { + case "read": + result = READ_APPPERMISSIONS_DEPENDABOT_SECRETS + case "write": + result = WRITE_APPPERMISSIONS_DEPENDABOT_SECRETS + default: + return 0, errors.New("Unknown AppPermissions_dependabot_secrets value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_dependabot_secrets(values []AppPermissions_dependabot_secrets) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_dependabot_secrets) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_deployments.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_deployments.go new file mode 100644 index 000000000..cff72b3b2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_deployments.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for deployments and deployment statuses. +type AppPermissions_deployments int + +const ( + READ_APPPERMISSIONS_DEPLOYMENTS AppPermissions_deployments = iota + WRITE_APPPERMISSIONS_DEPLOYMENTS +) + +func (i AppPermissions_deployments) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_deployments(v string) (any, error) { + result := READ_APPPERMISSIONS_DEPLOYMENTS + switch v { + case "read": + result = READ_APPPERMISSIONS_DEPLOYMENTS + case "write": + result = WRITE_APPPERMISSIONS_DEPLOYMENTS + default: + return 0, errors.New("Unknown AppPermissions_deployments value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_deployments(values []AppPermissions_deployments) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_deployments) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_email_addresses.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_email_addresses.go new file mode 100644 index 000000000..766f2869c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_email_addresses.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to manage the email addresses belonging to a user. +type AppPermissions_email_addresses int + +const ( + READ_APPPERMISSIONS_EMAIL_ADDRESSES AppPermissions_email_addresses = iota + WRITE_APPPERMISSIONS_EMAIL_ADDRESSES +) + +func (i AppPermissions_email_addresses) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_email_addresses(v string) (any, error) { + result := READ_APPPERMISSIONS_EMAIL_ADDRESSES + switch v { + case "read": + result = READ_APPPERMISSIONS_EMAIL_ADDRESSES + case "write": + result = WRITE_APPPERMISSIONS_EMAIL_ADDRESSES + default: + return 0, errors.New("Unknown AppPermissions_email_addresses value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_email_addresses(values []AppPermissions_email_addresses) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_email_addresses) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_environments.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_environments.go new file mode 100644 index 000000000..86e3eb539 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_environments.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for managing repository environments. +type AppPermissions_environments int + +const ( + READ_APPPERMISSIONS_ENVIRONMENTS AppPermissions_environments = iota + WRITE_APPPERMISSIONS_ENVIRONMENTS +) + +func (i AppPermissions_environments) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_environments(v string) (any, error) { + result := READ_APPPERMISSIONS_ENVIRONMENTS + switch v { + case "read": + result = READ_APPPERMISSIONS_ENVIRONMENTS + case "write": + result = WRITE_APPPERMISSIONS_ENVIRONMENTS + default: + return 0, errors.New("Unknown AppPermissions_environments value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_environments(values []AppPermissions_environments) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_environments) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_followers.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_followers.go new file mode 100644 index 000000000..9f86fb7a9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_followers.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to manage the followers belonging to a user. +type AppPermissions_followers int + +const ( + READ_APPPERMISSIONS_FOLLOWERS AppPermissions_followers = iota + WRITE_APPPERMISSIONS_FOLLOWERS +) + +func (i AppPermissions_followers) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_followers(v string) (any, error) { + result := READ_APPPERMISSIONS_FOLLOWERS + switch v { + case "read": + result = READ_APPPERMISSIONS_FOLLOWERS + case "write": + result = WRITE_APPPERMISSIONS_FOLLOWERS + default: + return 0, errors.New("Unknown AppPermissions_followers value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_followers(values []AppPermissions_followers) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_followers) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_git_ssh_keys.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_git_ssh_keys.go new file mode 100644 index 000000000..05993d25f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_git_ssh_keys.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to manage git SSH keys. +type AppPermissions_git_ssh_keys int + +const ( + READ_APPPERMISSIONS_GIT_SSH_KEYS AppPermissions_git_ssh_keys = iota + WRITE_APPPERMISSIONS_GIT_SSH_KEYS +) + +func (i AppPermissions_git_ssh_keys) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_git_ssh_keys(v string) (any, error) { + result := READ_APPPERMISSIONS_GIT_SSH_KEYS + switch v { + case "read": + result = READ_APPPERMISSIONS_GIT_SSH_KEYS + case "write": + result = WRITE_APPPERMISSIONS_GIT_SSH_KEYS + default: + return 0, errors.New("Unknown AppPermissions_git_ssh_keys value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_git_ssh_keys(values []AppPermissions_git_ssh_keys) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_git_ssh_keys) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_gpg_keys.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_gpg_keys.go new file mode 100644 index 000000000..8da34fce8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_gpg_keys.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to view and manage GPG keys belonging to a user. +type AppPermissions_gpg_keys int + +const ( + READ_APPPERMISSIONS_GPG_KEYS AppPermissions_gpg_keys = iota + WRITE_APPPERMISSIONS_GPG_KEYS +) + +func (i AppPermissions_gpg_keys) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_gpg_keys(v string) (any, error) { + result := READ_APPPERMISSIONS_GPG_KEYS + switch v { + case "read": + result = READ_APPPERMISSIONS_GPG_KEYS + case "write": + result = WRITE_APPPERMISSIONS_GPG_KEYS + default: + return 0, errors.New("Unknown AppPermissions_gpg_keys value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_gpg_keys(values []AppPermissions_gpg_keys) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_gpg_keys) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_interaction_limits.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_interaction_limits.go new file mode 100644 index 000000000..e167e1e33 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_interaction_limits.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to view and manage interaction limits on a repository. +type AppPermissions_interaction_limits int + +const ( + READ_APPPERMISSIONS_INTERACTION_LIMITS AppPermissions_interaction_limits = iota + WRITE_APPPERMISSIONS_INTERACTION_LIMITS +) + +func (i AppPermissions_interaction_limits) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_interaction_limits(v string) (any, error) { + result := READ_APPPERMISSIONS_INTERACTION_LIMITS + switch v { + case "read": + result = READ_APPPERMISSIONS_INTERACTION_LIMITS + case "write": + result = WRITE_APPPERMISSIONS_INTERACTION_LIMITS + default: + return 0, errors.New("Unknown AppPermissions_interaction_limits value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_interaction_limits(values []AppPermissions_interaction_limits) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_interaction_limits) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_issues.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_issues.go new file mode 100644 index 000000000..1eacc87cd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_issues.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. +type AppPermissions_issues int + +const ( + READ_APPPERMISSIONS_ISSUES AppPermissions_issues = iota + WRITE_APPPERMISSIONS_ISSUES +) + +func (i AppPermissions_issues) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_issues(v string) (any, error) { + result := READ_APPPERMISSIONS_ISSUES + switch v { + case "read": + result = READ_APPPERMISSIONS_ISSUES + case "write": + result = WRITE_APPPERMISSIONS_ISSUES + default: + return 0, errors.New("Unknown AppPermissions_issues value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_issues(values []AppPermissions_issues) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_issues) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_members.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_members.go new file mode 100644 index 000000000..28b592093 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_members.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for organization teams and members. +type AppPermissions_members int + +const ( + READ_APPPERMISSIONS_MEMBERS AppPermissions_members = iota + WRITE_APPPERMISSIONS_MEMBERS +) + +func (i AppPermissions_members) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_members(v string) (any, error) { + result := READ_APPPERMISSIONS_MEMBERS + switch v { + case "read": + result = READ_APPPERMISSIONS_MEMBERS + case "write": + result = WRITE_APPPERMISSIONS_MEMBERS + default: + return 0, errors.New("Unknown AppPermissions_members value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_members(values []AppPermissions_members) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_members) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_metadata.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_metadata.go new file mode 100644 index 000000000..7d7fd3ecd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_metadata.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. +type AppPermissions_metadata int + +const ( + READ_APPPERMISSIONS_METADATA AppPermissions_metadata = iota + WRITE_APPPERMISSIONS_METADATA +) + +func (i AppPermissions_metadata) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_metadata(v string) (any, error) { + result := READ_APPPERMISSIONS_METADATA + switch v { + case "read": + result = READ_APPPERMISSIONS_METADATA + case "write": + result = WRITE_APPPERMISSIONS_METADATA + default: + return 0, errors.New("Unknown AppPermissions_metadata value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_metadata(values []AppPermissions_metadata) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_metadata) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_administration.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_administration.go new file mode 100644 index 000000000..6adff853b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_administration.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to manage access to an organization. +type AppPermissions_organization_administration int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_ADMINISTRATION AppPermissions_organization_administration = iota + WRITE_APPPERMISSIONS_ORGANIZATION_ADMINISTRATION +) + +func (i AppPermissions_organization_administration) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_administration(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_ADMINISTRATION + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_ADMINISTRATION + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_ADMINISTRATION + default: + return 0, errors.New("Unknown AppPermissions_organization_administration value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_organization_administration(values []AppPermissions_organization_administration) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_administration) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_announcement_banners.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_announcement_banners.go new file mode 100644 index 000000000..087b38ddb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_announcement_banners.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to view and manage announcement banners for an organization. +type AppPermissions_organization_announcement_banners int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_ANNOUNCEMENT_BANNERS AppPermissions_organization_announcement_banners = iota + WRITE_APPPERMISSIONS_ORGANIZATION_ANNOUNCEMENT_BANNERS +) + +func (i AppPermissions_organization_announcement_banners) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_announcement_banners(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_ANNOUNCEMENT_BANNERS + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_ANNOUNCEMENT_BANNERS + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_ANNOUNCEMENT_BANNERS + default: + return 0, errors.New("Unknown AppPermissions_organization_announcement_banners value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_organization_announcement_banners(values []AppPermissions_organization_announcement_banners) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_announcement_banners) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_copilot_seat_management.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_copilot_seat_management.go new file mode 100644 index 000000000..acc122be5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_copilot_seat_management.go @@ -0,0 +1,34 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in beta and is subject to change. +type AppPermissions_organization_copilot_seat_management int + +const ( + WRITE_APPPERMISSIONS_ORGANIZATION_COPILOT_SEAT_MANAGEMENT AppPermissions_organization_copilot_seat_management = iota +) + +func (i AppPermissions_organization_copilot_seat_management) String() string { + return []string{"write"}[i] +} +func ParseAppPermissions_organization_copilot_seat_management(v string) (any, error) { + result := WRITE_APPPERMISSIONS_ORGANIZATION_COPILOT_SEAT_MANAGEMENT + switch v { + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_COPILOT_SEAT_MANAGEMENT + default: + return 0, errors.New("Unknown AppPermissions_organization_copilot_seat_management value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_organization_copilot_seat_management(values []AppPermissions_organization_copilot_seat_management) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_copilot_seat_management) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_custom_org_roles.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_custom_org_roles.go new file mode 100644 index 000000000..146db921a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_custom_org_roles.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for custom organization roles management. +type AppPermissions_organization_custom_org_roles int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_ORG_ROLES AppPermissions_organization_custom_org_roles = iota + WRITE_APPPERMISSIONS_ORGANIZATION_CUSTOM_ORG_ROLES +) + +func (i AppPermissions_organization_custom_org_roles) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_custom_org_roles(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_ORG_ROLES + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_ORG_ROLES + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_CUSTOM_ORG_ROLES + default: + return 0, errors.New("Unknown AppPermissions_organization_custom_org_roles value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_organization_custom_org_roles(values []AppPermissions_organization_custom_org_roles) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_custom_org_roles) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_custom_properties.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_custom_properties.go new file mode 100644 index 000000000..57840ae0b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_custom_properties.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for custom property management. +type AppPermissions_organization_custom_properties int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_PROPERTIES AppPermissions_organization_custom_properties = iota + WRITE_APPPERMISSIONS_ORGANIZATION_CUSTOM_PROPERTIES + ADMIN_APPPERMISSIONS_ORGANIZATION_CUSTOM_PROPERTIES +) + +func (i AppPermissions_organization_custom_properties) String() string { + return []string{"read", "write", "admin"}[i] +} +func ParseAppPermissions_organization_custom_properties(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_PROPERTIES + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_PROPERTIES + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_CUSTOM_PROPERTIES + case "admin": + result = ADMIN_APPPERMISSIONS_ORGANIZATION_CUSTOM_PROPERTIES + default: + return 0, errors.New("Unknown AppPermissions_organization_custom_properties value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_organization_custom_properties(values []AppPermissions_organization_custom_properties) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_custom_properties) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_custom_roles.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_custom_roles.go new file mode 100644 index 000000000..3f1219395 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_custom_roles.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for custom repository roles management. +type AppPermissions_organization_custom_roles int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_ROLES AppPermissions_organization_custom_roles = iota + WRITE_APPPERMISSIONS_ORGANIZATION_CUSTOM_ROLES +) + +func (i AppPermissions_organization_custom_roles) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_custom_roles(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_ROLES + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_ROLES + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_CUSTOM_ROLES + default: + return 0, errors.New("Unknown AppPermissions_organization_custom_roles value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_organization_custom_roles(values []AppPermissions_organization_custom_roles) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_custom_roles) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_events.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_events.go new file mode 100644 index 000000000..995b1b565 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_events.go @@ -0,0 +1,34 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to view events triggered by an activity in an organization. +type AppPermissions_organization_events int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_EVENTS AppPermissions_organization_events = iota +) + +func (i AppPermissions_organization_events) String() string { + return []string{"read"}[i] +} +func ParseAppPermissions_organization_events(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_EVENTS + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_EVENTS + default: + return 0, errors.New("Unknown AppPermissions_organization_events value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_organization_events(values []AppPermissions_organization_events) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_events) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_hooks.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_hooks.go new file mode 100644 index 000000000..64c4c9714 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_hooks.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to manage the post-receive hooks for an organization. +type AppPermissions_organization_hooks int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_HOOKS AppPermissions_organization_hooks = iota + WRITE_APPPERMISSIONS_ORGANIZATION_HOOKS +) + +func (i AppPermissions_organization_hooks) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_hooks(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_HOOKS + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_HOOKS + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_HOOKS + default: + return 0, errors.New("Unknown AppPermissions_organization_hooks value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_organization_hooks(values []AppPermissions_organization_hooks) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_hooks) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_packages.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_packages.go new file mode 100644 index 000000000..34dc2e455 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_packages.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for organization packages published to GitHub Packages. +type AppPermissions_organization_packages int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_PACKAGES AppPermissions_organization_packages = iota + WRITE_APPPERMISSIONS_ORGANIZATION_PACKAGES +) + +func (i AppPermissions_organization_packages) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_packages(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_PACKAGES + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_PACKAGES + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_PACKAGES + default: + return 0, errors.New("Unknown AppPermissions_organization_packages value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_organization_packages(values []AppPermissions_organization_packages) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_packages) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_personal_access_token_requests.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_personal_access_token_requests.go new file mode 100644 index 000000000..3ff20f685 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_personal_access_token_requests.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization. +type AppPermissions_organization_personal_access_token_requests int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKEN_REQUESTS AppPermissions_organization_personal_access_token_requests = iota + WRITE_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKEN_REQUESTS +) + +func (i AppPermissions_organization_personal_access_token_requests) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_personal_access_token_requests(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKEN_REQUESTS + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKEN_REQUESTS + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKEN_REQUESTS + default: + return 0, errors.New("Unknown AppPermissions_organization_personal_access_token_requests value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_organization_personal_access_token_requests(values []AppPermissions_organization_personal_access_token_requests) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_personal_access_token_requests) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_personal_access_tokens.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_personal_access_tokens.go new file mode 100644 index 000000000..499db17b9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_personal_access_tokens.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization. +type AppPermissions_organization_personal_access_tokens int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKENS AppPermissions_organization_personal_access_tokens = iota + WRITE_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKENS +) + +func (i AppPermissions_organization_personal_access_tokens) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_personal_access_tokens(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKENS + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKENS + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKENS + default: + return 0, errors.New("Unknown AppPermissions_organization_personal_access_tokens value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_organization_personal_access_tokens(values []AppPermissions_organization_personal_access_tokens) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_personal_access_tokens) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_plan.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_plan.go new file mode 100644 index 000000000..ec5ae0925 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_plan.go @@ -0,0 +1,34 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for viewing an organization's plan. +type AppPermissions_organization_plan int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_PLAN AppPermissions_organization_plan = iota +) + +func (i AppPermissions_organization_plan) String() string { + return []string{"read"}[i] +} +func ParseAppPermissions_organization_plan(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_PLAN + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_PLAN + default: + return 0, errors.New("Unknown AppPermissions_organization_plan value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_organization_plan(values []AppPermissions_organization_plan) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_plan) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_projects.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_projects.go new file mode 100644 index 000000000..580043abb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_projects.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to manage organization projects and projects beta (where available). +type AppPermissions_organization_projects int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_PROJECTS AppPermissions_organization_projects = iota + WRITE_APPPERMISSIONS_ORGANIZATION_PROJECTS + ADMIN_APPPERMISSIONS_ORGANIZATION_PROJECTS +) + +func (i AppPermissions_organization_projects) String() string { + return []string{"read", "write", "admin"}[i] +} +func ParseAppPermissions_organization_projects(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_PROJECTS + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_PROJECTS + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_PROJECTS + case "admin": + result = ADMIN_APPPERMISSIONS_ORGANIZATION_PROJECTS + default: + return 0, errors.New("Unknown AppPermissions_organization_projects value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_organization_projects(values []AppPermissions_organization_projects) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_projects) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_secrets.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_secrets.go new file mode 100644 index 000000000..ee4c386b4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_secrets.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to manage organization secrets. +type AppPermissions_organization_secrets int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_SECRETS AppPermissions_organization_secrets = iota + WRITE_APPPERMISSIONS_ORGANIZATION_SECRETS +) + +func (i AppPermissions_organization_secrets) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_secrets(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_SECRETS + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_SECRETS + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_SECRETS + default: + return 0, errors.New("Unknown AppPermissions_organization_secrets value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_organization_secrets(values []AppPermissions_organization_secrets) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_secrets) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_self_hosted_runners.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_self_hosted_runners.go new file mode 100644 index 000000000..842862ca2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_self_hosted_runners.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. +type AppPermissions_organization_self_hosted_runners int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_SELF_HOSTED_RUNNERS AppPermissions_organization_self_hosted_runners = iota + WRITE_APPPERMISSIONS_ORGANIZATION_SELF_HOSTED_RUNNERS +) + +func (i AppPermissions_organization_self_hosted_runners) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_self_hosted_runners(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_SELF_HOSTED_RUNNERS + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_SELF_HOSTED_RUNNERS + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_SELF_HOSTED_RUNNERS + default: + return 0, errors.New("Unknown AppPermissions_organization_self_hosted_runners value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_organization_self_hosted_runners(values []AppPermissions_organization_self_hosted_runners) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_self_hosted_runners) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_user_blocking.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_user_blocking.go new file mode 100644 index 000000000..9e2c415af --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_organization_user_blocking.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to view and manage users blocked by the organization. +type AppPermissions_organization_user_blocking int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_USER_BLOCKING AppPermissions_organization_user_blocking = iota + WRITE_APPPERMISSIONS_ORGANIZATION_USER_BLOCKING +) + +func (i AppPermissions_organization_user_blocking) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_user_blocking(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_USER_BLOCKING + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_USER_BLOCKING + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_USER_BLOCKING + default: + return 0, errors.New("Unknown AppPermissions_organization_user_blocking value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_organization_user_blocking(values []AppPermissions_organization_user_blocking) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_user_blocking) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_packages.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_packages.go new file mode 100644 index 000000000..fd6990353 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_packages.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for packages published to GitHub Packages. +type AppPermissions_packages int + +const ( + READ_APPPERMISSIONS_PACKAGES AppPermissions_packages = iota + WRITE_APPPERMISSIONS_PACKAGES +) + +func (i AppPermissions_packages) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_packages(v string) (any, error) { + result := READ_APPPERMISSIONS_PACKAGES + switch v { + case "read": + result = READ_APPPERMISSIONS_PACKAGES + case "write": + result = WRITE_APPPERMISSIONS_PACKAGES + default: + return 0, errors.New("Unknown AppPermissions_packages value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_packages(values []AppPermissions_packages) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_packages) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_pages.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_pages.go new file mode 100644 index 000000000..ac6289fd1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_pages.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. +type AppPermissions_pages int + +const ( + READ_APPPERMISSIONS_PAGES AppPermissions_pages = iota + WRITE_APPPERMISSIONS_PAGES +) + +func (i AppPermissions_pages) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_pages(v string) (any, error) { + result := READ_APPPERMISSIONS_PAGES + switch v { + case "read": + result = READ_APPPERMISSIONS_PAGES + case "write": + result = WRITE_APPPERMISSIONS_PAGES + default: + return 0, errors.New("Unknown AppPermissions_pages value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_pages(values []AppPermissions_pages) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_pages) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_profile.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_profile.go new file mode 100644 index 000000000..6196c1989 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_profile.go @@ -0,0 +1,34 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to manage the profile settings belonging to a user. +type AppPermissions_profile int + +const ( + WRITE_APPPERMISSIONS_PROFILE AppPermissions_profile = iota +) + +func (i AppPermissions_profile) String() string { + return []string{"write"}[i] +} +func ParseAppPermissions_profile(v string) (any, error) { + result := WRITE_APPPERMISSIONS_PROFILE + switch v { + case "write": + result = WRITE_APPPERMISSIONS_PROFILE + default: + return 0, errors.New("Unknown AppPermissions_profile value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_profile(values []AppPermissions_profile) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_profile) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_pull_requests.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_pull_requests.go new file mode 100644 index 000000000..b9530f2b6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_pull_requests.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. +type AppPermissions_pull_requests int + +const ( + READ_APPPERMISSIONS_PULL_REQUESTS AppPermissions_pull_requests = iota + WRITE_APPPERMISSIONS_PULL_REQUESTS +) + +func (i AppPermissions_pull_requests) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_pull_requests(v string) (any, error) { + result := READ_APPPERMISSIONS_PULL_REQUESTS + switch v { + case "read": + result = READ_APPPERMISSIONS_PULL_REQUESTS + case "write": + result = WRITE_APPPERMISSIONS_PULL_REQUESTS + default: + return 0, errors.New("Unknown AppPermissions_pull_requests value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_pull_requests(values []AppPermissions_pull_requests) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_pull_requests) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_repository_custom_properties.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_repository_custom_properties.go new file mode 100644 index 000000000..9f408afb7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_repository_custom_properties.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to view and edit custom properties for a repository, when allowed by the property. +type AppPermissions_repository_custom_properties int + +const ( + READ_APPPERMISSIONS_REPOSITORY_CUSTOM_PROPERTIES AppPermissions_repository_custom_properties = iota + WRITE_APPPERMISSIONS_REPOSITORY_CUSTOM_PROPERTIES +) + +func (i AppPermissions_repository_custom_properties) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_repository_custom_properties(v string) (any, error) { + result := READ_APPPERMISSIONS_REPOSITORY_CUSTOM_PROPERTIES + switch v { + case "read": + result = READ_APPPERMISSIONS_REPOSITORY_CUSTOM_PROPERTIES + case "write": + result = WRITE_APPPERMISSIONS_REPOSITORY_CUSTOM_PROPERTIES + default: + return 0, errors.New("Unknown AppPermissions_repository_custom_properties value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_repository_custom_properties(values []AppPermissions_repository_custom_properties) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_repository_custom_properties) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_repository_hooks.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_repository_hooks.go new file mode 100644 index 000000000..f7b502772 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_repository_hooks.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to manage the post-receive hooks for a repository. +type AppPermissions_repository_hooks int + +const ( + READ_APPPERMISSIONS_REPOSITORY_HOOKS AppPermissions_repository_hooks = iota + WRITE_APPPERMISSIONS_REPOSITORY_HOOKS +) + +func (i AppPermissions_repository_hooks) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_repository_hooks(v string) (any, error) { + result := READ_APPPERMISSIONS_REPOSITORY_HOOKS + switch v { + case "read": + result = READ_APPPERMISSIONS_REPOSITORY_HOOKS + case "write": + result = WRITE_APPPERMISSIONS_REPOSITORY_HOOKS + default: + return 0, errors.New("Unknown AppPermissions_repository_hooks value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_repository_hooks(values []AppPermissions_repository_hooks) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_repository_hooks) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_repository_projects.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_repository_projects.go new file mode 100644 index 000000000..0de65e094 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_repository_projects.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to manage repository projects, columns, and cards. +type AppPermissions_repository_projects int + +const ( + READ_APPPERMISSIONS_REPOSITORY_PROJECTS AppPermissions_repository_projects = iota + WRITE_APPPERMISSIONS_REPOSITORY_PROJECTS + ADMIN_APPPERMISSIONS_REPOSITORY_PROJECTS +) + +func (i AppPermissions_repository_projects) String() string { + return []string{"read", "write", "admin"}[i] +} +func ParseAppPermissions_repository_projects(v string) (any, error) { + result := READ_APPPERMISSIONS_REPOSITORY_PROJECTS + switch v { + case "read": + result = READ_APPPERMISSIONS_REPOSITORY_PROJECTS + case "write": + result = WRITE_APPPERMISSIONS_REPOSITORY_PROJECTS + case "admin": + result = ADMIN_APPPERMISSIONS_REPOSITORY_PROJECTS + default: + return 0, errors.New("Unknown AppPermissions_repository_projects value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_repository_projects(values []AppPermissions_repository_projects) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_repository_projects) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_secret_scanning_alerts.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_secret_scanning_alerts.go new file mode 100644 index 000000000..b31cfcebe --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_secret_scanning_alerts.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to view and manage secret scanning alerts. +type AppPermissions_secret_scanning_alerts int + +const ( + READ_APPPERMISSIONS_SECRET_SCANNING_ALERTS AppPermissions_secret_scanning_alerts = iota + WRITE_APPPERMISSIONS_SECRET_SCANNING_ALERTS +) + +func (i AppPermissions_secret_scanning_alerts) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_secret_scanning_alerts(v string) (any, error) { + result := READ_APPPERMISSIONS_SECRET_SCANNING_ALERTS + switch v { + case "read": + result = READ_APPPERMISSIONS_SECRET_SCANNING_ALERTS + case "write": + result = WRITE_APPPERMISSIONS_SECRET_SCANNING_ALERTS + default: + return 0, errors.New("Unknown AppPermissions_secret_scanning_alerts value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_secret_scanning_alerts(values []AppPermissions_secret_scanning_alerts) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_secret_scanning_alerts) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_secrets.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_secrets.go new file mode 100644 index 000000000..69e423c82 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_secrets.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to manage repository secrets. +type AppPermissions_secrets int + +const ( + READ_APPPERMISSIONS_SECRETS AppPermissions_secrets = iota + WRITE_APPPERMISSIONS_SECRETS +) + +func (i AppPermissions_secrets) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_secrets(v string) (any, error) { + result := READ_APPPERMISSIONS_SECRETS + switch v { + case "read": + result = READ_APPPERMISSIONS_SECRETS + case "write": + result = WRITE_APPPERMISSIONS_SECRETS + default: + return 0, errors.New("Unknown AppPermissions_secrets value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_secrets(values []AppPermissions_secrets) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_secrets) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_security_events.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_security_events.go new file mode 100644 index 000000000..2ec318f74 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_security_events.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to view and manage security events like code scanning alerts. +type AppPermissions_security_events int + +const ( + READ_APPPERMISSIONS_SECURITY_EVENTS AppPermissions_security_events = iota + WRITE_APPPERMISSIONS_SECURITY_EVENTS +) + +func (i AppPermissions_security_events) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_security_events(v string) (any, error) { + result := READ_APPPERMISSIONS_SECURITY_EVENTS + switch v { + case "read": + result = READ_APPPERMISSIONS_SECURITY_EVENTS + case "write": + result = WRITE_APPPERMISSIONS_SECURITY_EVENTS + default: + return 0, errors.New("Unknown AppPermissions_security_events value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_security_events(values []AppPermissions_security_events) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_security_events) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_single_file.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_single_file.go new file mode 100644 index 000000000..c8abbe34b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_single_file.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to manage just a single file. +type AppPermissions_single_file int + +const ( + READ_APPPERMISSIONS_SINGLE_FILE AppPermissions_single_file = iota + WRITE_APPPERMISSIONS_SINGLE_FILE +) + +func (i AppPermissions_single_file) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_single_file(v string) (any, error) { + result := READ_APPPERMISSIONS_SINGLE_FILE + switch v { + case "read": + result = READ_APPPERMISSIONS_SINGLE_FILE + case "write": + result = WRITE_APPPERMISSIONS_SINGLE_FILE + default: + return 0, errors.New("Unknown AppPermissions_single_file value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_single_file(values []AppPermissions_single_file) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_single_file) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_starring.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_starring.go new file mode 100644 index 000000000..e5b4320e3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_starring.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to list and manage repositories a user is starring. +type AppPermissions_starring int + +const ( + READ_APPPERMISSIONS_STARRING AppPermissions_starring = iota + WRITE_APPPERMISSIONS_STARRING +) + +func (i AppPermissions_starring) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_starring(v string) (any, error) { + result := READ_APPPERMISSIONS_STARRING + switch v { + case "read": + result = READ_APPPERMISSIONS_STARRING + case "write": + result = WRITE_APPPERMISSIONS_STARRING + default: + return 0, errors.New("Unknown AppPermissions_starring value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_starring(values []AppPermissions_starring) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_starring) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_statuses.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_statuses.go new file mode 100644 index 000000000..e72c20659 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_statuses.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token for commit statuses. +type AppPermissions_statuses int + +const ( + READ_APPPERMISSIONS_STATUSES AppPermissions_statuses = iota + WRITE_APPPERMISSIONS_STATUSES +) + +func (i AppPermissions_statuses) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_statuses(v string) (any, error) { + result := READ_APPPERMISSIONS_STATUSES + switch v { + case "read": + result = READ_APPPERMISSIONS_STATUSES + case "write": + result = WRITE_APPPERMISSIONS_STATUSES + default: + return 0, errors.New("Unknown AppPermissions_statuses value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_statuses(values []AppPermissions_statuses) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_statuses) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_team_discussions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_team_discussions.go new file mode 100644 index 000000000..32b533a27 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_team_discussions.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to manage team discussions and related comments. +type AppPermissions_team_discussions int + +const ( + READ_APPPERMISSIONS_TEAM_DISCUSSIONS AppPermissions_team_discussions = iota + WRITE_APPPERMISSIONS_TEAM_DISCUSSIONS +) + +func (i AppPermissions_team_discussions) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_team_discussions(v string) (any, error) { + result := READ_APPPERMISSIONS_TEAM_DISCUSSIONS + switch v { + case "read": + result = READ_APPPERMISSIONS_TEAM_DISCUSSIONS + case "write": + result = WRITE_APPPERMISSIONS_TEAM_DISCUSSIONS + default: + return 0, errors.New("Unknown AppPermissions_team_discussions value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_team_discussions(values []AppPermissions_team_discussions) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_team_discussions) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_vulnerability_alerts.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_vulnerability_alerts.go new file mode 100644 index 000000000..2c051c547 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_vulnerability_alerts.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to manage Dependabot alerts. +type AppPermissions_vulnerability_alerts int + +const ( + READ_APPPERMISSIONS_VULNERABILITY_ALERTS AppPermissions_vulnerability_alerts = iota + WRITE_APPPERMISSIONS_VULNERABILITY_ALERTS +) + +func (i AppPermissions_vulnerability_alerts) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_vulnerability_alerts(v string) (any, error) { + result := READ_APPPERMISSIONS_VULNERABILITY_ALERTS + switch v { + case "read": + result = READ_APPPERMISSIONS_VULNERABILITY_ALERTS + case "write": + result = WRITE_APPPERMISSIONS_VULNERABILITY_ALERTS + default: + return 0, errors.New("Unknown AppPermissions_vulnerability_alerts value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_vulnerability_alerts(values []AppPermissions_vulnerability_alerts) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_vulnerability_alerts) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_workflows.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_workflows.go new file mode 100644 index 000000000..5cb7f73f8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/app_permissions_workflows.go @@ -0,0 +1,34 @@ +package models +import ( + "errors" +) +// The level of permission to grant the access token to update GitHub Actions workflow files. +type AppPermissions_workflows int + +const ( + WRITE_APPPERMISSIONS_WORKFLOWS AppPermissions_workflows = iota +) + +func (i AppPermissions_workflows) String() string { + return []string{"write"}[i] +} +func ParseAppPermissions_workflows(v string) (any, error) { + result := WRITE_APPPERMISSIONS_WORKFLOWS + switch v { + case "write": + result = WRITE_APPPERMISSIONS_WORKFLOWS + default: + return 0, errors.New("Unknown AppPermissions_workflows value: " + v) + } + return &result, nil +} +func SerializeAppPermissions_workflows(values []AppPermissions_workflows) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_workflows) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/artifact.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/artifact.go new file mode 100644 index 000000000..ef53f1061 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/artifact.go @@ -0,0 +1,372 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Artifact an artifact +type Artifact struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The archive_download_url property + archive_download_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Whether or not the artifact has expired. + expired *bool + // The expires_at property + expires_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The id property + id *int32 + // The name of the artifact. + name *string + // The node_id property + node_id *string + // The size in bytes of the artifact. + size_in_bytes *int32 + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The workflow_run property + workflow_run Artifact_workflow_runable +} +// NewArtifact instantiates a new Artifact and sets the default values. +func NewArtifact()(*Artifact) { + m := &Artifact{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateArtifactFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateArtifactFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewArtifact(), 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 *Artifact) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArchiveDownloadUrl gets the archive_download_url property value. The archive_download_url property +// returns a *string when successful +func (m *Artifact) GetArchiveDownloadUrl()(*string) { + return m.archive_download_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Artifact) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetExpired gets the expired property value. Whether or not the artifact has expired. +// returns a *bool when successful +func (m *Artifact) GetExpired()(*bool) { + return m.expired +} +// GetExpiresAt gets the expires_at property value. The expires_at property +// returns a *Time when successful +func (m *Artifact) GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.expires_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Artifact) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["archive_download_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveDownloadUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["expired"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExpired(val) + } + return nil + } + res["expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["size_in_bytes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSizeInBytes(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["workflow_run"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateArtifact_workflow_runFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetWorkflowRun(val.(Artifact_workflow_runable)) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Artifact) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name of the artifact. +// returns a *string when successful +func (m *Artifact) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Artifact) GetNodeId()(*string) { + return m.node_id +} +// GetSizeInBytes gets the size_in_bytes property value. The size in bytes of the artifact. +// returns a *int32 when successful +func (m *Artifact) GetSizeInBytes()(*int32) { + return m.size_in_bytes +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Artifact) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Artifact) GetUrl()(*string) { + return m.url +} +// GetWorkflowRun gets the workflow_run property value. The workflow_run property +// returns a Artifact_workflow_runable when successful +func (m *Artifact) GetWorkflowRun()(Artifact_workflow_runable) { + return m.workflow_run +} +// Serialize serializes information the current object +func (m *Artifact) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("archive_download_url", m.GetArchiveDownloadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("expired", m.GetExpired()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("expires_at", m.GetExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size_in_bytes", m.GetSizeInBytes()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("workflow_run", m.GetWorkflowRun()) + 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 *Artifact) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArchiveDownloadUrl sets the archive_download_url property value. The archive_download_url property +func (m *Artifact) SetArchiveDownloadUrl(value *string)() { + m.archive_download_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Artifact) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetExpired sets the expired property value. Whether or not the artifact has expired. +func (m *Artifact) SetExpired(value *bool)() { + m.expired = value +} +// SetExpiresAt sets the expires_at property value. The expires_at property +func (m *Artifact) SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.expires_at = value +} +// SetId sets the id property value. The id property +func (m *Artifact) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name of the artifact. +func (m *Artifact) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Artifact) SetNodeId(value *string)() { + m.node_id = value +} +// SetSizeInBytes sets the size_in_bytes property value. The size in bytes of the artifact. +func (m *Artifact) SetSizeInBytes(value *int32)() { + m.size_in_bytes = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Artifact) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Artifact) SetUrl(value *string)() { + m.url = value +} +// SetWorkflowRun sets the workflow_run property value. The workflow_run property +func (m *Artifact) SetWorkflowRun(value Artifact_workflow_runable)() { + m.workflow_run = value +} +type Artifactable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArchiveDownloadUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetExpired()(*bool) + GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetSizeInBytes()(*int32) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetWorkflowRun()(Artifact_workflow_runable) + SetArchiveDownloadUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetExpired(value *bool)() + SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetSizeInBytes(value *int32)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetWorkflowRun(value Artifact_workflow_runable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/artifact_workflow_run.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/artifact_workflow_run.go new file mode 100644 index 000000000..8ab9b1475 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/artifact_workflow_run.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Artifact_workflow_run struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The head_branch property + head_branch *string + // The head_repository_id property + head_repository_id *int32 + // The head_sha property + head_sha *string + // The id property + id *int32 + // The repository_id property + repository_id *int32 +} +// NewArtifact_workflow_run instantiates a new Artifact_workflow_run and sets the default values. +func NewArtifact_workflow_run()(*Artifact_workflow_run) { + m := &Artifact_workflow_run{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateArtifact_workflow_runFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateArtifact_workflow_runFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewArtifact_workflow_run(), 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 *Artifact_workflow_run) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Artifact_workflow_run) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["head_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadBranch(val) + } + return nil + } + res["head_repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetHeadRepositoryId(val) + } + return nil + } + res["head_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadSha(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + return res +} +// GetHeadBranch gets the head_branch property value. The head_branch property +// returns a *string when successful +func (m *Artifact_workflow_run) GetHeadBranch()(*string) { + return m.head_branch +} +// GetHeadRepositoryId gets the head_repository_id property value. The head_repository_id property +// returns a *int32 when successful +func (m *Artifact_workflow_run) GetHeadRepositoryId()(*int32) { + return m.head_repository_id +} +// GetHeadSha gets the head_sha property value. The head_sha property +// returns a *string when successful +func (m *Artifact_workflow_run) GetHeadSha()(*string) { + return m.head_sha +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Artifact_workflow_run) GetId()(*int32) { + return m.id +} +// GetRepositoryId gets the repository_id property value. The repository_id property +// returns a *int32 when successful +func (m *Artifact_workflow_run) GetRepositoryId()(*int32) { + return m.repository_id +} +// Serialize serializes information the current object +func (m *Artifact_workflow_run) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("head_branch", m.GetHeadBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("head_repository_id", m.GetHeadRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_sha", m.GetHeadSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + 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 *Artifact_workflow_run) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHeadBranch sets the head_branch property value. The head_branch property +func (m *Artifact_workflow_run) SetHeadBranch(value *string)() { + m.head_branch = value +} +// SetHeadRepositoryId sets the head_repository_id property value. The head_repository_id property +func (m *Artifact_workflow_run) SetHeadRepositoryId(value *int32)() { + m.head_repository_id = value +} +// SetHeadSha sets the head_sha property value. The head_sha property +func (m *Artifact_workflow_run) SetHeadSha(value *string)() { + m.head_sha = value +} +// SetId sets the id property value. The id property +func (m *Artifact_workflow_run) SetId(value *int32)() { + m.id = value +} +// SetRepositoryId sets the repository_id property value. The repository_id property +func (m *Artifact_workflow_run) SetRepositoryId(value *int32)() { + m.repository_id = value +} +type Artifact_workflow_runable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHeadBranch()(*string) + GetHeadRepositoryId()(*int32) + GetHeadSha()(*string) + GetId()(*int32) + GetRepositoryId()(*int32) + SetHeadBranch(value *string)() + SetHeadRepositoryId(value *int32)() + SetHeadSha(value *string)() + SetId(value *int32)() + SetRepositoryId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/assigned_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/assigned_issue_event.go new file mode 100644 index 000000000..dfa254571 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/assigned_issue_event.go @@ -0,0 +1,371 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// AssignedIssueEvent assigned Issue Event +type AssignedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee SimpleUserable + // A GitHub user. + assigner SimpleUserable + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app Integrationable + // The url property + url *string +} +// NewAssignedIssueEvent instantiates a new AssignedIssueEvent and sets the default values. +func NewAssignedIssueEvent()(*AssignedIssueEvent) { + m := &AssignedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAssignedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAssignedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAssignedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *AssignedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *AssignedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *AssignedIssueEvent) GetAssignee()(SimpleUserable) { + return m.assignee +} +// GetAssigner gets the assigner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *AssignedIssueEvent) GetAssigner()(SimpleUserable) { + return m.assigner +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *AssignedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *AssignedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *AssignedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *AssignedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AssignedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(SimpleUserable)) + } + return nil + } + res["assigner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssigner(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(Integrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *AssignedIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *AssignedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a Integrationable when successful +func (m *AssignedIssueEvent) GetPerformedViaGithubApp()(Integrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *AssignedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *AssignedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assigner", m.GetAssigner()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *AssignedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *AssignedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *AssignedIssueEvent) SetAssignee(value SimpleUserable)() { + m.assignee = value +} +// SetAssigner sets the assigner property value. A GitHub user. +func (m *AssignedIssueEvent) SetAssigner(value SimpleUserable)() { + m.assigner = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *AssignedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *AssignedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *AssignedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *AssignedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *AssignedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *AssignedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *AssignedIssueEvent) SetPerformedViaGithubApp(value Integrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *AssignedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type AssignedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetAssignee()(SimpleUserable) + GetAssigner()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(Integrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetAssignee(value SimpleUserable)() + SetAssigner(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value Integrationable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/authentication_token.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/authentication_token.go new file mode 100644 index 000000000..c0fdc8433 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/authentication_token.go @@ -0,0 +1,240 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// AuthenticationToken authentication Token +type AuthenticationToken struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time this token expires + expires_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The permissions property + permissions AuthenticationToken_permissionsable + // The repositories this token has access to + repositories []Repositoryable + // Describe whether all repositories have been selected or there's a selection involved + repository_selection *AuthenticationToken_repository_selection + // The single_file property + single_file *string + // The token used for authentication + token *string +} +// NewAuthenticationToken instantiates a new AuthenticationToken and sets the default values. +func NewAuthenticationToken()(*AuthenticationToken) { + m := &AuthenticationToken{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAuthenticationTokenFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAuthenticationTokenFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAuthenticationToken(), 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 *AuthenticationToken) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetExpiresAt gets the expires_at property value. The time this token expires +// returns a *Time when successful +func (m *AuthenticationToken) GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.expires_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AuthenticationToken) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresAt(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAuthenticationToken_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(AuthenticationToken_permissionsable)) + } + return nil + } + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Repositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Repositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["repository_selection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthenticationToken_repository_selection) + if err != nil { + return err + } + if val != nil { + m.SetRepositorySelection(val.(*AuthenticationToken_repository_selection)) + } + return nil + } + res["single_file"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSingleFile(val) + } + return nil + } + res["token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetToken(val) + } + return nil + } + return res +} +// GetPermissions gets the permissions property value. The permissions property +// returns a AuthenticationToken_permissionsable when successful +func (m *AuthenticationToken) GetPermissions()(AuthenticationToken_permissionsable) { + return m.permissions +} +// GetRepositories gets the repositories property value. The repositories this token has access to +// returns a []Repositoryable when successful +func (m *AuthenticationToken) GetRepositories()([]Repositoryable) { + return m.repositories +} +// GetRepositorySelection gets the repository_selection property value. Describe whether all repositories have been selected or there's a selection involved +// returns a *AuthenticationToken_repository_selection when successful +func (m *AuthenticationToken) GetRepositorySelection()(*AuthenticationToken_repository_selection) { + return m.repository_selection +} +// GetSingleFile gets the single_file property value. The single_file property +// returns a *string when successful +func (m *AuthenticationToken) GetSingleFile()(*string) { + return m.single_file +} +// GetToken gets the token property value. The token used for authentication +// returns a *string when successful +func (m *AuthenticationToken) GetToken()(*string) { + return m.token +} +// Serialize serializes information the current object +func (m *AuthenticationToken) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("expires_at", m.GetExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + if m.GetRepositorySelection() != nil { + cast := (*m.GetRepositorySelection()).String() + err := writer.WriteStringValue("repository_selection", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("single_file", m.GetSingleFile()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token", m.GetToken()) + 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 *AuthenticationToken) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetExpiresAt sets the expires_at property value. The time this token expires +func (m *AuthenticationToken) SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.expires_at = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *AuthenticationToken) SetPermissions(value AuthenticationToken_permissionsable)() { + m.permissions = value +} +// SetRepositories sets the repositories property value. The repositories this token has access to +func (m *AuthenticationToken) SetRepositories(value []Repositoryable)() { + m.repositories = value +} +// SetRepositorySelection sets the repository_selection property value. Describe whether all repositories have been selected or there's a selection involved +func (m *AuthenticationToken) SetRepositorySelection(value *AuthenticationToken_repository_selection)() { + m.repository_selection = value +} +// SetSingleFile sets the single_file property value. The single_file property +func (m *AuthenticationToken) SetSingleFile(value *string)() { + m.single_file = value +} +// SetToken sets the token property value. The token used for authentication +func (m *AuthenticationToken) SetToken(value *string)() { + m.token = value +} +type AuthenticationTokenable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetPermissions()(AuthenticationToken_permissionsable) + GetRepositories()([]Repositoryable) + GetRepositorySelection()(*AuthenticationToken_repository_selection) + GetSingleFile()(*string) + GetToken()(*string) + SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetPermissions(value AuthenticationToken_permissionsable)() + SetRepositories(value []Repositoryable)() + SetRepositorySelection(value *AuthenticationToken_repository_selection)() + SetSingleFile(value *string)() + SetToken(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/authentication_token_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/authentication_token_permissions.go new file mode 100644 index 000000000..a3af4def0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/authentication_token_permissions.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type AuthenticationToken_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewAuthenticationToken_permissions instantiates a new AuthenticationToken_permissions and sets the default values. +func NewAuthenticationToken_permissions()(*AuthenticationToken_permissions) { + m := &AuthenticationToken_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAuthenticationToken_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAuthenticationToken_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAuthenticationToken_permissions(), 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 *AuthenticationToken_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AuthenticationToken_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *AuthenticationToken_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *AuthenticationToken_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type AuthenticationToken_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/authentication_token_repository_selection.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/authentication_token_repository_selection.go new file mode 100644 index 000000000..24215fe37 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/authentication_token_repository_selection.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// Describe whether all repositories have been selected or there's a selection involved +type AuthenticationToken_repository_selection int + +const ( + ALL_AUTHENTICATIONTOKEN_REPOSITORY_SELECTION AuthenticationToken_repository_selection = iota + SELECTED_AUTHENTICATIONTOKEN_REPOSITORY_SELECTION +) + +func (i AuthenticationToken_repository_selection) String() string { + return []string{"all", "selected"}[i] +} +func ParseAuthenticationToken_repository_selection(v string) (any, error) { + result := ALL_AUTHENTICATIONTOKEN_REPOSITORY_SELECTION + switch v { + case "all": + result = ALL_AUTHENTICATIONTOKEN_REPOSITORY_SELECTION + case "selected": + result = SELECTED_AUTHENTICATIONTOKEN_REPOSITORY_SELECTION + default: + return 0, errors.New("Unknown AuthenticationToken_repository_selection value: " + v) + } + return &result, nil +} +func SerializeAuthenticationToken_repository_selection(values []AuthenticationToken_repository_selection) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AuthenticationToken_repository_selection) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/author_association.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/author_association.go new file mode 100644 index 000000000..5904dc917 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/author_association.go @@ -0,0 +1,55 @@ +package models +import ( + "errors" +) +// How the author is associated with the repository. +type AuthorAssociation int + +const ( + COLLABORATOR_AUTHORASSOCIATION AuthorAssociation = iota + CONTRIBUTOR_AUTHORASSOCIATION + FIRST_TIMER_AUTHORASSOCIATION + FIRST_TIME_CONTRIBUTOR_AUTHORASSOCIATION + MANNEQUIN_AUTHORASSOCIATION + MEMBER_AUTHORASSOCIATION + NONE_AUTHORASSOCIATION + OWNER_AUTHORASSOCIATION +) + +func (i AuthorAssociation) String() string { + return []string{"COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MANNEQUIN", "MEMBER", "NONE", "OWNER"}[i] +} +func ParseAuthorAssociation(v string) (any, error) { + result := COLLABORATOR_AUTHORASSOCIATION + switch v { + case "COLLABORATOR": + result = COLLABORATOR_AUTHORASSOCIATION + case "CONTRIBUTOR": + result = CONTRIBUTOR_AUTHORASSOCIATION + case "FIRST_TIMER": + result = FIRST_TIMER_AUTHORASSOCIATION + case "FIRST_TIME_CONTRIBUTOR": + result = FIRST_TIME_CONTRIBUTOR_AUTHORASSOCIATION + case "MANNEQUIN": + result = MANNEQUIN_AUTHORASSOCIATION + case "MEMBER": + result = MEMBER_AUTHORASSOCIATION + case "NONE": + result = NONE_AUTHORASSOCIATION + case "OWNER": + result = OWNER_AUTHORASSOCIATION + default: + return 0, errors.New("Unknown AuthorAssociation value: " + v) + } + return &result, nil +} +func SerializeAuthorAssociation(values []AuthorAssociation) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AuthorAssociation) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/authorization.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/authorization.go new file mode 100644 index 000000000..df9a7c566 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/authorization.go @@ -0,0 +1,494 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Authorization the authorization for an OAuth app, GitHub App, or a Personal Access Token. +type Authorization struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The app property + app Authorization_appable + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The expires_at property + expires_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The fingerprint property + fingerprint *string + // The hashed_token property + hashed_token *string + // The id property + id *int64 + // The installation property + installation NullableScopedInstallationable + // The note property + note *string + // The note_url property + note_url *string + // A list of scopes that this authorization is in. + scopes []string + // The token property + token *string + // The token_last_eight property + token_last_eight *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewAuthorization instantiates a new Authorization and sets the default values. +func NewAuthorization()(*Authorization) { + m := &Authorization{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAuthorizationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAuthorizationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAuthorization(), 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 *Authorization) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApp gets the app property value. The app property +// returns a Authorization_appable when successful +func (m *Authorization) GetApp()(Authorization_appable) { + return m.app +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Authorization) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetExpiresAt gets the expires_at property value. The expires_at property +// returns a *Time when successful +func (m *Authorization) GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.expires_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Authorization) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAuthorization_appFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetApp(val.(Authorization_appable)) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresAt(val) + } + return nil + } + res["fingerprint"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFingerprint(val) + } + return nil + } + res["hashed_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHashedToken(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["installation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableScopedInstallationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInstallation(val.(NullableScopedInstallationable)) + } + return nil + } + res["note"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNote(val) + } + return nil + } + res["note_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNoteUrl(val) + } + return nil + } + res["scopes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetScopes(res) + } + return nil + } + res["token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetToken(val) + } + return nil + } + res["token_last_eight"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTokenLastEight(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetFingerprint gets the fingerprint property value. The fingerprint property +// returns a *string when successful +func (m *Authorization) GetFingerprint()(*string) { + return m.fingerprint +} +// GetHashedToken gets the hashed_token property value. The hashed_token property +// returns a *string when successful +func (m *Authorization) GetHashedToken()(*string) { + return m.hashed_token +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *Authorization) GetId()(*int64) { + return m.id +} +// GetInstallation gets the installation property value. The installation property +// returns a NullableScopedInstallationable when successful +func (m *Authorization) GetInstallation()(NullableScopedInstallationable) { + return m.installation +} +// GetNote gets the note property value. The note property +// returns a *string when successful +func (m *Authorization) GetNote()(*string) { + return m.note +} +// GetNoteUrl gets the note_url property value. The note_url property +// returns a *string when successful +func (m *Authorization) GetNoteUrl()(*string) { + return m.note_url +} +// GetScopes gets the scopes property value. A list of scopes that this authorization is in. +// returns a []string when successful +func (m *Authorization) GetScopes()([]string) { + return m.scopes +} +// GetToken gets the token property value. The token property +// returns a *string when successful +func (m *Authorization) GetToken()(*string) { + return m.token +} +// GetTokenLastEight gets the token_last_eight property value. The token_last_eight property +// returns a *string when successful +func (m *Authorization) GetTokenLastEight()(*string) { + return m.token_last_eight +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Authorization) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Authorization) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Authorization) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *Authorization) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("app", m.GetApp()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("expires_at", m.GetExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("fingerprint", m.GetFingerprint()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hashed_token", m.GetHashedToken()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("installation", m.GetInstallation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("note", m.GetNote()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("note_url", m.GetNoteUrl()) + if err != nil { + return err + } + } + if m.GetScopes() != nil { + err := writer.WriteCollectionOfStringValues("scopes", m.GetScopes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token", m.GetToken()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token_last_eight", m.GetTokenLastEight()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *Authorization) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApp sets the app property value. The app property +func (m *Authorization) SetApp(value Authorization_appable)() { + m.app = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Authorization) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetExpiresAt sets the expires_at property value. The expires_at property +func (m *Authorization) SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.expires_at = value +} +// SetFingerprint sets the fingerprint property value. The fingerprint property +func (m *Authorization) SetFingerprint(value *string)() { + m.fingerprint = value +} +// SetHashedToken sets the hashed_token property value. The hashed_token property +func (m *Authorization) SetHashedToken(value *string)() { + m.hashed_token = value +} +// SetId sets the id property value. The id property +func (m *Authorization) SetId(value *int64)() { + m.id = value +} +// SetInstallation sets the installation property value. The installation property +func (m *Authorization) SetInstallation(value NullableScopedInstallationable)() { + m.installation = value +} +// SetNote sets the note property value. The note property +func (m *Authorization) SetNote(value *string)() { + m.note = value +} +// SetNoteUrl sets the note_url property value. The note_url property +func (m *Authorization) SetNoteUrl(value *string)() { + m.note_url = value +} +// SetScopes sets the scopes property value. A list of scopes that this authorization is in. +func (m *Authorization) SetScopes(value []string)() { + m.scopes = value +} +// SetToken sets the token property value. The token property +func (m *Authorization) SetToken(value *string)() { + m.token = value +} +// SetTokenLastEight sets the token_last_eight property value. The token_last_eight property +func (m *Authorization) SetTokenLastEight(value *string)() { + m.token_last_eight = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Authorization) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Authorization) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *Authorization) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type Authorizationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApp()(Authorization_appable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetFingerprint()(*string) + GetHashedToken()(*string) + GetId()(*int64) + GetInstallation()(NullableScopedInstallationable) + GetNote()(*string) + GetNoteUrl()(*string) + GetScopes()([]string) + GetToken()(*string) + GetTokenLastEight()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetApp(value Authorization_appable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetFingerprint(value *string)() + SetHashedToken(value *string)() + SetId(value *int64)() + SetInstallation(value NullableScopedInstallationable)() + SetNote(value *string)() + SetNoteUrl(value *string)() + SetScopes(value []string)() + SetToken(value *string)() + SetTokenLastEight(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/authorization_app.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/authorization_app.go new file mode 100644 index 000000000..045c52205 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/authorization_app.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Authorization_app struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The client_id property + client_id *string + // The name property + name *string + // The url property + url *string +} +// NewAuthorization_app instantiates a new Authorization_app and sets the default values. +func NewAuthorization_app()(*Authorization_app) { + m := &Authorization_app{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAuthorization_appFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAuthorization_appFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAuthorization_app(), 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 *Authorization_app) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientId gets the client_id property value. The client_id property +// returns a *string when successful +func (m *Authorization_app) GetClientId()(*string) { + return m.client_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Authorization_app) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *Authorization_app) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Authorization_app) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Authorization_app) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("client_id", m.GetClientId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Authorization_app) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientId sets the client_id property value. The client_id property +func (m *Authorization_app) SetClientId(value *string)() { + m.client_id = value +} +// SetName sets the name property value. The name property +func (m *Authorization_app) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url property +func (m *Authorization_app) SetUrl(value *string)() { + m.url = value +} +type Authorization_appable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientId()(*string) + GetName()(*string) + GetUrl()(*string) + SetClientId(value *string)() + SetName(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/auto_merge.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/auto_merge.go new file mode 100644 index 000000000..c2c7ffc50 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/auto_merge.go @@ -0,0 +1,169 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// AutoMerge the status of auto merging a pull request. +type AutoMerge struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Commit message for the merge commit. + commit_message *string + // Title for the merge commit message. + commit_title *string + // A GitHub user. + enabled_by SimpleUserable + // The merge method to use. + merge_method *AutoMerge_merge_method +} +// NewAutoMerge instantiates a new AutoMerge and sets the default values. +func NewAutoMerge()(*AutoMerge) { + m := &AutoMerge{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAutoMergeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAutoMergeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAutoMerge(), 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 *AutoMerge) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitMessage gets the commit_message property value. Commit message for the merge commit. +// returns a *string when successful +func (m *AutoMerge) GetCommitMessage()(*string) { + return m.commit_message +} +// GetCommitTitle gets the commit_title property value. Title for the merge commit message. +// returns a *string when successful +func (m *AutoMerge) GetCommitTitle()(*string) { + return m.commit_title +} +// GetEnabledBy gets the enabled_by property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *AutoMerge) GetEnabledBy()(SimpleUserable) { + return m.enabled_by +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AutoMerge) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitMessage(val) + } + return nil + } + res["commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitTitle(val) + } + return nil + } + res["enabled_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetEnabledBy(val.(SimpleUserable)) + } + return nil + } + res["merge_method"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAutoMerge_merge_method) + if err != nil { + return err + } + if val != nil { + m.SetMergeMethod(val.(*AutoMerge_merge_method)) + } + return nil + } + return res +} +// GetMergeMethod gets the merge_method property value. The merge method to use. +// returns a *AutoMerge_merge_method when successful +func (m *AutoMerge) GetMergeMethod()(*AutoMerge_merge_method) { + return m.merge_method +} +// Serialize serializes information the current object +func (m *AutoMerge) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("commit_message", m.GetCommitMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_title", m.GetCommitTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("enabled_by", m.GetEnabledBy()) + if err != nil { + return err + } + } + if m.GetMergeMethod() != nil { + cast := (*m.GetMergeMethod()).String() + err := writer.WriteStringValue("merge_method", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *AutoMerge) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitMessage sets the commit_message property value. Commit message for the merge commit. +func (m *AutoMerge) SetCommitMessage(value *string)() { + m.commit_message = value +} +// SetCommitTitle sets the commit_title property value. Title for the merge commit message. +func (m *AutoMerge) SetCommitTitle(value *string)() { + m.commit_title = value +} +// SetEnabledBy sets the enabled_by property value. A GitHub user. +func (m *AutoMerge) SetEnabledBy(value SimpleUserable)() { + m.enabled_by = value +} +// SetMergeMethod sets the merge_method property value. The merge method to use. +func (m *AutoMerge) SetMergeMethod(value *AutoMerge_merge_method)() { + m.merge_method = value +} +type AutoMergeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommitMessage()(*string) + GetCommitTitle()(*string) + GetEnabledBy()(SimpleUserable) + GetMergeMethod()(*AutoMerge_merge_method) + SetCommitMessage(value *string)() + SetCommitTitle(value *string)() + SetEnabledBy(value SimpleUserable)() + SetMergeMethod(value *AutoMerge_merge_method)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/auto_merge_merge_method.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/auto_merge_merge_method.go new file mode 100644 index 000000000..7060adf16 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/auto_merge_merge_method.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The merge method to use. +type AutoMerge_merge_method int + +const ( + MERGE_AUTOMERGE_MERGE_METHOD AutoMerge_merge_method = iota + SQUASH_AUTOMERGE_MERGE_METHOD + REBASE_AUTOMERGE_MERGE_METHOD +) + +func (i AutoMerge_merge_method) String() string { + return []string{"merge", "squash", "rebase"}[i] +} +func ParseAutoMerge_merge_method(v string) (any, error) { + result := MERGE_AUTOMERGE_MERGE_METHOD + switch v { + case "merge": + result = MERGE_AUTOMERGE_MERGE_METHOD + case "squash": + result = SQUASH_AUTOMERGE_MERGE_METHOD + case "rebase": + result = REBASE_AUTOMERGE_MERGE_METHOD + default: + return 0, errors.New("Unknown AutoMerge_merge_method value: " + v) + } + return &result, nil +} +func SerializeAutoMerge_merge_method(values []AutoMerge_merge_method) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AutoMerge_merge_method) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/autolink.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/autolink.go new file mode 100644 index 000000000..ef226b35f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/autolink.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Autolink an autolink reference. +type Autolink struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 + // Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. + is_alphanumeric *bool + // The prefix of a key that is linkified. + key_prefix *string + // A template for the target URL that is generated if a key was found. + url_template *string +} +// NewAutolink instantiates a new Autolink and sets the default values. +func NewAutolink()(*Autolink) { + m := &Autolink{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAutolinkFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAutolinkFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAutolink(), 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 *Autolink) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Autolink) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_alphanumeric"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsAlphanumeric(val) + } + return nil + } + res["key_prefix"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyPrefix(val) + } + return nil + } + res["url_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrlTemplate(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Autolink) GetId()(*int32) { + return m.id +} +// GetIsAlphanumeric gets the is_alphanumeric property value. Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. +// returns a *bool when successful +func (m *Autolink) GetIsAlphanumeric()(*bool) { + return m.is_alphanumeric +} +// GetKeyPrefix gets the key_prefix property value. The prefix of a key that is linkified. +// returns a *string when successful +func (m *Autolink) GetKeyPrefix()(*string) { + return m.key_prefix +} +// GetUrlTemplate gets the url_template property value. A template for the target URL that is generated if a key was found. +// returns a *string when successful +func (m *Autolink) GetUrlTemplate()(*string) { + return m.url_template +} +// Serialize serializes information the current object +func (m *Autolink) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_alphanumeric", m.GetIsAlphanumeric()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_prefix", m.GetKeyPrefix()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url_template", m.GetUrlTemplate()) + 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 *Autolink) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *Autolink) SetId(value *int32)() { + m.id = value +} +// SetIsAlphanumeric sets the is_alphanumeric property value. Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. +func (m *Autolink) SetIsAlphanumeric(value *bool)() { + m.is_alphanumeric = value +} +// SetKeyPrefix sets the key_prefix property value. The prefix of a key that is linkified. +func (m *Autolink) SetKeyPrefix(value *string)() { + m.key_prefix = value +} +// SetUrlTemplate sets the url_template property value. A template for the target URL that is generated if a key was found. +func (m *Autolink) SetUrlTemplate(value *string)() { + m.url_template = value +} +type Autolinkable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetIsAlphanumeric()(*bool) + GetKeyPrefix()(*string) + GetUrlTemplate()(*string) + SetId(value *int32)() + SetIsAlphanumeric(value *bool)() + SetKeyPrefix(value *string)() + SetUrlTemplate(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/base_gist.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/base_gist.go new file mode 100644 index 000000000..87644a4f2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/base_gist.go @@ -0,0 +1,633 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// BaseGist base Gist +type BaseGist struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The comments property + comments *int32 + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The description property + 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 + id *string + // The node_id property + node_id *string + // A GitHub user. + owner SimpleUserable + // The public property + public *bool + // The truncated property + truncated *bool + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewBaseGist instantiates a new BaseGist and sets the default values. +func NewBaseGist()(*BaseGist) { + m := &BaseGist{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBaseGistFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBaseGistFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBaseGist(), 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 *BaseGist) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComments gets the comments property value. The comments property +// returns a *int32 when successful +func (m *BaseGist) GetComments()(*int32) { + return m.comments +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *BaseGist) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *BaseGist) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *BaseGist) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *BaseGist) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BaseGist) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetComments(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBaseGist_filesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetFiles(val.(BaseGist_filesable)) + } + 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 { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["git_pull_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitPullUrl(val) + } + return nil + } + res["git_push_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitPushUrl(val) + } + 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 { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["public"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPublic(val) + } + return nil + } + res["truncated"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTruncated(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetFiles gets the files property value. The files property +// returns a BaseGist_filesable when successful +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) { + return m.forks_url +} +// GetGitPullUrl gets the git_pull_url property value. The git_pull_url property +// returns a *string when successful +func (m *BaseGist) GetGitPullUrl()(*string) { + return m.git_pull_url +} +// GetGitPushUrl gets the git_push_url property value. The git_push_url property +// returns a *string when successful +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) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *string when successful +func (m *BaseGist) GetId()(*string) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *BaseGist) GetNodeId()(*string) { + return m.node_id +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *BaseGist) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPublic gets the public property value. The public property +// returns a *bool when successful +func (m *BaseGist) GetPublic()(*bool) { + return m.public +} +// GetTruncated gets the truncated property value. The truncated property +// returns a *bool when successful +func (m *BaseGist) GetTruncated()(*bool) { + return m.truncated +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *BaseGist) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BaseGist) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *BaseGist) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *BaseGist) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("files", m.GetFiles()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_pull_url", m.GetGitPullUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_push_url", m.GetGitPushUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("history", m.GetHistory()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("public", m.GetPublic()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("truncated", m.GetTruncated()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *BaseGist) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComments sets the comments property value. The comments property +func (m *BaseGist) SetComments(value *int32)() { + m.comments = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *BaseGist) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *BaseGist) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *BaseGist) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *BaseGist) SetDescription(value *string)() { + m.description = value +} +// SetFiles sets the files property value. The files property +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 +} +// SetGitPullUrl sets the git_pull_url property value. The git_pull_url property +func (m *BaseGist) SetGitPullUrl(value *string)() { + m.git_pull_url = value +} +// SetGitPushUrl sets the git_push_url property value. The git_push_url property +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 +} +// SetId sets the id property value. The id property +func (m *BaseGist) SetId(value *string)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *BaseGist) SetNodeId(value *string)() { + m.node_id = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *BaseGist) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPublic sets the public property value. The public property +func (m *BaseGist) SetPublic(value *bool)() { + m.public = value +} +// SetTruncated sets the truncated property value. The truncated property +func (m *BaseGist) SetTruncated(value *bool)() { + m.truncated = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *BaseGist) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *BaseGist) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *BaseGist) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type BaseGistable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComments()(*int32) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + 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) + GetOwner()(SimpleUserable) + GetPublic()(*bool) + GetTruncated()(*bool) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetComments(value *int32)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + 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)() + SetOwner(value SimpleUserable)() + SetPublic(value *bool)() + SetTruncated(value *bool)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/base_gist_files.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/base_gist_files.go new file mode 100644 index 000000000..8fab653be --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/base_gist_files.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BaseGist_files struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewBaseGist_files instantiates a new BaseGist_files and sets the default values. +func NewBaseGist_files()(*BaseGist_files) { + m := &BaseGist_files{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBaseGist_filesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBaseGist_filesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBaseGist_files(), 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 *BaseGist_files) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BaseGist_files) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *BaseGist_files) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *BaseGist_files) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type BaseGist_filesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/basic_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/basic_error.go new file mode 100644 index 000000000..ab2919a42 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/basic_error.go @@ -0,0 +1,176 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// BasicError basic Error +type BasicError struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The documentation_url property + documentation_url *string + // The message property + message *string + // The status property + status *string + // The url property + url *string +} +// NewBasicError instantiates a new BasicError and sets the default values. +func NewBasicError()(*BasicError) { + m := &BasicError{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBasicErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBasicErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBasicError(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *BasicError) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *BasicError) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *BasicError) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BasicError) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *BasicError) GetMessage()(*string) { + return m.message +} +// GetStatus gets the status property value. The status property +// returns a *string when successful +func (m *BasicError) GetStatus()(*string) { + return m.status +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BasicError) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *BasicError) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status", m.GetStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *BasicError) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *BasicError) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *BasicError) SetMessage(value *string)() { + m.message = value +} +// SetStatus sets the status property value. The status property +func (m *BasicError) SetStatus(value *string)() { + m.status = value +} +// SetUrl sets the url property value. The url property +func (m *BasicError) SetUrl(value *string)() { + m.url = value +} +type BasicErrorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetMessage()(*string) + GetStatus()(*string) + GetUrl()(*string) + SetDocumentationUrl(value *string)() + SetMessage(value *string)() + SetStatus(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/blob.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/blob.go new file mode 100644 index 000000000..f83a82027 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/blob.go @@ -0,0 +1,255 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Blob blob +type Blob struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The content property + content *string + // The encoding property + encoding *string + // The highlighted_content property + highlighted_content *string + // The node_id property + node_id *string + // The sha property + sha *string + // The size property + size *int32 + // The url property + url *string +} +// NewBlob instantiates a new Blob and sets the default values. +func NewBlob()(*Blob) { + m := &Blob{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBlobFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBlobFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBlob(), 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 *Blob) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContent gets the content property value. The content property +// returns a *string when successful +func (m *Blob) GetContent()(*string) { + return m.content +} +// GetEncoding gets the encoding property value. The encoding property +// returns a *string when successful +func (m *Blob) GetEncoding()(*string) { + return m.encoding +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Blob) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContent(val) + } + return nil + } + res["encoding"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncoding(val) + } + return nil + } + res["highlighted_content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHighlightedContent(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHighlightedContent gets the highlighted_content property value. The highlighted_content property +// returns a *string when successful +func (m *Blob) GetHighlightedContent()(*string) { + return m.highlighted_content +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Blob) GetNodeId()(*string) { + return m.node_id +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *Blob) GetSha()(*string) { + return m.sha +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *Blob) GetSize()(*int32) { + return m.size +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Blob) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Blob) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content", m.GetContent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("encoding", m.GetEncoding()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("highlighted_content", m.GetHighlightedContent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Blob) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContent sets the content property value. The content property +func (m *Blob) SetContent(value *string)() { + m.content = value +} +// SetEncoding sets the encoding property value. The encoding property +func (m *Blob) SetEncoding(value *string)() { + m.encoding = value +} +// SetHighlightedContent sets the highlighted_content property value. The highlighted_content property +func (m *Blob) SetHighlightedContent(value *string)() { + m.highlighted_content = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Blob) SetNodeId(value *string)() { + m.node_id = value +} +// SetSha sets the sha property value. The sha property +func (m *Blob) SetSha(value *string)() { + m.sha = value +} +// SetSize sets the size property value. The size property +func (m *Blob) SetSize(value *int32)() { + m.size = value +} +// SetUrl sets the url property value. The url property +func (m *Blob) SetUrl(value *string)() { + m.url = value +} +type Blobable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContent()(*string) + GetEncoding()(*string) + GetHighlightedContent()(*string) + GetNodeId()(*string) + GetSha()(*string) + GetSize()(*int32) + GetUrl()(*string) + SetContent(value *string)() + SetEncoding(value *string)() + SetHighlightedContent(value *string)() + SetNodeId(value *string)() + SetSha(value *string)() + SetSize(value *int32)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection.go new file mode 100644 index 000000000..595ce27a1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection.go @@ -0,0 +1,516 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// BranchProtection branch Protection +type BranchProtection struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The allow_deletions property + allow_deletions BranchProtection_allow_deletionsable + // The allow_force_pushes property + allow_force_pushes BranchProtection_allow_force_pushesable + // Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. + allow_fork_syncing BranchProtection_allow_fork_syncingable + // The block_creations property + block_creations BranchProtection_block_creationsable + // The enabled property + enabled *bool + // Protected Branch Admin Enforced + enforce_admins ProtectedBranchAdminEnforcedable + // Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. + lock_branch BranchProtection_lock_branchable + // The name property + name *string + // The protection_url property + protection_url *string + // The required_conversation_resolution property + required_conversation_resolution BranchProtection_required_conversation_resolutionable + // The required_linear_history property + required_linear_history BranchProtection_required_linear_historyable + // Protected Branch Pull Request Review + required_pull_request_reviews ProtectedBranchPullRequestReviewable + // The required_signatures property + required_signatures BranchProtection_required_signaturesable + // Protected Branch Required Status Check + required_status_checks ProtectedBranchRequiredStatusCheckable + // Branch Restriction Policy + restrictions BranchRestrictionPolicyable + // The url property + url *string +} +// NewBranchProtection instantiates a new BranchProtection and sets the default values. +func NewBranchProtection()(*BranchProtection) { + m := &BranchProtection{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtectionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtectionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection(), 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 *BranchProtection) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowDeletions gets the allow_deletions property value. The allow_deletions property +// returns a BranchProtection_allow_deletionsable when successful +func (m *BranchProtection) GetAllowDeletions()(BranchProtection_allow_deletionsable) { + return m.allow_deletions +} +// GetAllowForcePushes gets the allow_force_pushes property value. The allow_force_pushes property +// returns a BranchProtection_allow_force_pushesable when successful +func (m *BranchProtection) GetAllowForcePushes()(BranchProtection_allow_force_pushesable) { + return m.allow_force_pushes +} +// GetAllowForkSyncing gets the allow_fork_syncing property value. Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. +// returns a BranchProtection_allow_fork_syncingable when successful +func (m *BranchProtection) GetAllowForkSyncing()(BranchProtection_allow_fork_syncingable) { + return m.allow_fork_syncing +} +// GetBlockCreations gets the block_creations property value. The block_creations property +// returns a BranchProtection_block_creationsable when successful +func (m *BranchProtection) GetBlockCreations()(BranchProtection_block_creationsable) { + return m.block_creations +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection) GetEnabled()(*bool) { + return m.enabled +} +// GetEnforceAdmins gets the enforce_admins property value. Protected Branch Admin Enforced +// returns a ProtectedBranchAdminEnforcedable when successful +func (m *BranchProtection) GetEnforceAdmins()(ProtectedBranchAdminEnforcedable) { + return m.enforce_admins +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_deletions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtection_allow_deletionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAllowDeletions(val.(BranchProtection_allow_deletionsable)) + } + return nil + } + res["allow_force_pushes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtection_allow_force_pushesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAllowForcePushes(val.(BranchProtection_allow_force_pushesable)) + } + return nil + } + res["allow_fork_syncing"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtection_allow_fork_syncingFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAllowForkSyncing(val.(BranchProtection_allow_fork_syncingable)) + } + return nil + } + res["block_creations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtection_block_creationsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBlockCreations(val.(BranchProtection_block_creationsable)) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["enforce_admins"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranchAdminEnforcedFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetEnforceAdmins(val.(ProtectedBranchAdminEnforcedable)) + } + return nil + } + res["lock_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtection_lock_branchFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLockBranch(val.(BranchProtection_lock_branchable)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["protection_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProtectionUrl(val) + } + return nil + } + res["required_conversation_resolution"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtection_required_conversation_resolutionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredConversationResolution(val.(BranchProtection_required_conversation_resolutionable)) + } + return nil + } + res["required_linear_history"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtection_required_linear_historyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredLinearHistory(val.(BranchProtection_required_linear_historyable)) + } + return nil + } + res["required_pull_request_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranchPullRequestReviewFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredPullRequestReviews(val.(ProtectedBranchPullRequestReviewable)) + } + return nil + } + res["required_signatures"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtection_required_signaturesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredSignatures(val.(BranchProtection_required_signaturesable)) + } + return nil + } + res["required_status_checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranchRequiredStatusCheckFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredStatusChecks(val.(ProtectedBranchRequiredStatusCheckable)) + } + return nil + } + res["restrictions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchRestrictionPolicyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRestrictions(val.(BranchRestrictionPolicyable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetLockBranch gets the lock_branch property value. Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. +// returns a BranchProtection_lock_branchable when successful +func (m *BranchProtection) GetLockBranch()(BranchProtection_lock_branchable) { + return m.lock_branch +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *BranchProtection) GetName()(*string) { + return m.name +} +// GetProtectionUrl gets the protection_url property value. The protection_url property +// returns a *string when successful +func (m *BranchProtection) GetProtectionUrl()(*string) { + return m.protection_url +} +// GetRequiredConversationResolution gets the required_conversation_resolution property value. The required_conversation_resolution property +// returns a BranchProtection_required_conversation_resolutionable when successful +func (m *BranchProtection) GetRequiredConversationResolution()(BranchProtection_required_conversation_resolutionable) { + return m.required_conversation_resolution +} +// GetRequiredLinearHistory gets the required_linear_history property value. The required_linear_history property +// returns a BranchProtection_required_linear_historyable when successful +func (m *BranchProtection) GetRequiredLinearHistory()(BranchProtection_required_linear_historyable) { + return m.required_linear_history +} +// GetRequiredPullRequestReviews gets the required_pull_request_reviews property value. Protected Branch Pull Request Review +// returns a ProtectedBranchPullRequestReviewable when successful +func (m *BranchProtection) GetRequiredPullRequestReviews()(ProtectedBranchPullRequestReviewable) { + return m.required_pull_request_reviews +} +// GetRequiredSignatures gets the required_signatures property value. The required_signatures property +// returns a BranchProtection_required_signaturesable when successful +func (m *BranchProtection) GetRequiredSignatures()(BranchProtection_required_signaturesable) { + return m.required_signatures +} +// GetRequiredStatusChecks gets the required_status_checks property value. Protected Branch Required Status Check +// returns a ProtectedBranchRequiredStatusCheckable when successful +func (m *BranchProtection) GetRequiredStatusChecks()(ProtectedBranchRequiredStatusCheckable) { + return m.required_status_checks +} +// GetRestrictions gets the restrictions property value. Branch Restriction Policy +// returns a BranchRestrictionPolicyable when successful +func (m *BranchProtection) GetRestrictions()(BranchRestrictionPolicyable) { + return m.restrictions +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BranchProtection) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *BranchProtection) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("allow_deletions", m.GetAllowDeletions()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("allow_force_pushes", m.GetAllowForcePushes()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("allow_fork_syncing", m.GetAllowForkSyncing()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("block_creations", m.GetBlockCreations()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("enforce_admins", m.GetEnforceAdmins()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("lock_branch", m.GetLockBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("protection_url", m.GetProtectionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_conversation_resolution", m.GetRequiredConversationResolution()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_linear_history", m.GetRequiredLinearHistory()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_pull_request_reviews", m.GetRequiredPullRequestReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_signatures", m.GetRequiredSignatures()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_status_checks", m.GetRequiredStatusChecks()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("restrictions", m.GetRestrictions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *BranchProtection) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowDeletions sets the allow_deletions property value. The allow_deletions property +func (m *BranchProtection) SetAllowDeletions(value BranchProtection_allow_deletionsable)() { + m.allow_deletions = value +} +// SetAllowForcePushes sets the allow_force_pushes property value. The allow_force_pushes property +func (m *BranchProtection) SetAllowForcePushes(value BranchProtection_allow_force_pushesable)() { + m.allow_force_pushes = value +} +// SetAllowForkSyncing sets the allow_fork_syncing property value. Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. +func (m *BranchProtection) SetAllowForkSyncing(value BranchProtection_allow_fork_syncingable)() { + m.allow_fork_syncing = value +} +// SetBlockCreations sets the block_creations property value. The block_creations property +func (m *BranchProtection) SetBlockCreations(value BranchProtection_block_creationsable)() { + m.block_creations = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection) SetEnabled(value *bool)() { + m.enabled = value +} +// SetEnforceAdmins sets the enforce_admins property value. Protected Branch Admin Enforced +func (m *BranchProtection) SetEnforceAdmins(value ProtectedBranchAdminEnforcedable)() { + m.enforce_admins = value +} +// SetLockBranch sets the lock_branch property value. Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. +func (m *BranchProtection) SetLockBranch(value BranchProtection_lock_branchable)() { + m.lock_branch = value +} +// SetName sets the name property value. The name property +func (m *BranchProtection) SetName(value *string)() { + m.name = value +} +// SetProtectionUrl sets the protection_url property value. The protection_url property +func (m *BranchProtection) SetProtectionUrl(value *string)() { + m.protection_url = value +} +// SetRequiredConversationResolution sets the required_conversation_resolution property value. The required_conversation_resolution property +func (m *BranchProtection) SetRequiredConversationResolution(value BranchProtection_required_conversation_resolutionable)() { + m.required_conversation_resolution = value +} +// SetRequiredLinearHistory sets the required_linear_history property value. The required_linear_history property +func (m *BranchProtection) SetRequiredLinearHistory(value BranchProtection_required_linear_historyable)() { + m.required_linear_history = value +} +// SetRequiredPullRequestReviews sets the required_pull_request_reviews property value. Protected Branch Pull Request Review +func (m *BranchProtection) SetRequiredPullRequestReviews(value ProtectedBranchPullRequestReviewable)() { + m.required_pull_request_reviews = value +} +// SetRequiredSignatures sets the required_signatures property value. The required_signatures property +func (m *BranchProtection) SetRequiredSignatures(value BranchProtection_required_signaturesable)() { + m.required_signatures = value +} +// SetRequiredStatusChecks sets the required_status_checks property value. Protected Branch Required Status Check +func (m *BranchProtection) SetRequiredStatusChecks(value ProtectedBranchRequiredStatusCheckable)() { + m.required_status_checks = value +} +// SetRestrictions sets the restrictions property value. Branch Restriction Policy +func (m *BranchProtection) SetRestrictions(value BranchRestrictionPolicyable)() { + m.restrictions = value +} +// SetUrl sets the url property value. The url property +func (m *BranchProtection) SetUrl(value *string)() { + m.url = value +} +type BranchProtectionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowDeletions()(BranchProtection_allow_deletionsable) + GetAllowForcePushes()(BranchProtection_allow_force_pushesable) + GetAllowForkSyncing()(BranchProtection_allow_fork_syncingable) + GetBlockCreations()(BranchProtection_block_creationsable) + GetEnabled()(*bool) + GetEnforceAdmins()(ProtectedBranchAdminEnforcedable) + GetLockBranch()(BranchProtection_lock_branchable) + GetName()(*string) + GetProtectionUrl()(*string) + GetRequiredConversationResolution()(BranchProtection_required_conversation_resolutionable) + GetRequiredLinearHistory()(BranchProtection_required_linear_historyable) + GetRequiredPullRequestReviews()(ProtectedBranchPullRequestReviewable) + GetRequiredSignatures()(BranchProtection_required_signaturesable) + GetRequiredStatusChecks()(ProtectedBranchRequiredStatusCheckable) + GetRestrictions()(BranchRestrictionPolicyable) + GetUrl()(*string) + SetAllowDeletions(value BranchProtection_allow_deletionsable)() + SetAllowForcePushes(value BranchProtection_allow_force_pushesable)() + SetAllowForkSyncing(value BranchProtection_allow_fork_syncingable)() + SetBlockCreations(value BranchProtection_block_creationsable)() + SetEnabled(value *bool)() + SetEnforceAdmins(value ProtectedBranchAdminEnforcedable)() + SetLockBranch(value BranchProtection_lock_branchable)() + SetName(value *string)() + SetProtectionUrl(value *string)() + SetRequiredConversationResolution(value BranchProtection_required_conversation_resolutionable)() + SetRequiredLinearHistory(value BranchProtection_required_linear_historyable)() + SetRequiredPullRequestReviews(value ProtectedBranchPullRequestReviewable)() + SetRequiredSignatures(value BranchProtection_required_signaturesable)() + SetRequiredStatusChecks(value ProtectedBranchRequiredStatusCheckable)() + SetRestrictions(value BranchRestrictionPolicyable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_allow_deletions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_allow_deletions.go new file mode 100644 index 000000000..c633d3e61 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_allow_deletions.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchProtection_allow_deletions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The enabled property + enabled *bool +} +// NewBranchProtection_allow_deletions instantiates a new BranchProtection_allow_deletions and sets the default values. +func NewBranchProtection_allow_deletions()(*BranchProtection_allow_deletions) { + m := &BranchProtection_allow_deletions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtection_allow_deletionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtection_allow_deletionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection_allow_deletions(), 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 *BranchProtection_allow_deletions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection_allow_deletions) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection_allow_deletions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *BranchProtection_allow_deletions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *BranchProtection_allow_deletions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection_allow_deletions) SetEnabled(value *bool)() { + m.enabled = value +} +type BranchProtection_allow_deletionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_allow_force_pushes.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_allow_force_pushes.go new file mode 100644 index 000000000..4745c2e54 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_allow_force_pushes.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchProtection_allow_force_pushes struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The enabled property + enabled *bool +} +// NewBranchProtection_allow_force_pushes instantiates a new BranchProtection_allow_force_pushes and sets the default values. +func NewBranchProtection_allow_force_pushes()(*BranchProtection_allow_force_pushes) { + m := &BranchProtection_allow_force_pushes{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtection_allow_force_pushesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtection_allow_force_pushesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection_allow_force_pushes(), 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 *BranchProtection_allow_force_pushes) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection_allow_force_pushes) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection_allow_force_pushes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *BranchProtection_allow_force_pushes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *BranchProtection_allow_force_pushes) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection_allow_force_pushes) SetEnabled(value *bool)() { + m.enabled = value +} +type BranchProtection_allow_force_pushesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_allow_fork_syncing.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_allow_fork_syncing.go new file mode 100644 index 000000000..a9be4df30 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_allow_fork_syncing.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// BranchProtection_allow_fork_syncing whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. +type BranchProtection_allow_fork_syncing struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The enabled property + enabled *bool +} +// NewBranchProtection_allow_fork_syncing instantiates a new BranchProtection_allow_fork_syncing and sets the default values. +func NewBranchProtection_allow_fork_syncing()(*BranchProtection_allow_fork_syncing) { + m := &BranchProtection_allow_fork_syncing{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtection_allow_fork_syncingFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtection_allow_fork_syncingFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection_allow_fork_syncing(), 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 *BranchProtection_allow_fork_syncing) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection_allow_fork_syncing) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection_allow_fork_syncing) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *BranchProtection_allow_fork_syncing) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *BranchProtection_allow_fork_syncing) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection_allow_fork_syncing) SetEnabled(value *bool)() { + m.enabled = value +} +type BranchProtection_allow_fork_syncingable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_block_creations.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_block_creations.go new file mode 100644 index 000000000..dc34c0c5e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_block_creations.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchProtection_block_creations struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The enabled property + enabled *bool +} +// NewBranchProtection_block_creations instantiates a new BranchProtection_block_creations and sets the default values. +func NewBranchProtection_block_creations()(*BranchProtection_block_creations) { + m := &BranchProtection_block_creations{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtection_block_creationsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtection_block_creationsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection_block_creations(), 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 *BranchProtection_block_creations) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection_block_creations) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection_block_creations) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *BranchProtection_block_creations) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *BranchProtection_block_creations) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection_block_creations) SetEnabled(value *bool)() { + m.enabled = value +} +type BranchProtection_block_creationsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_lock_branch.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_lock_branch.go new file mode 100644 index 000000000..fc2c1b014 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_lock_branch.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// BranchProtection_lock_branch whether to set the branch as read-only. If this is true, users will not be able to push to the branch. +type BranchProtection_lock_branch struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The enabled property + enabled *bool +} +// NewBranchProtection_lock_branch instantiates a new BranchProtection_lock_branch and sets the default values. +func NewBranchProtection_lock_branch()(*BranchProtection_lock_branch) { + m := &BranchProtection_lock_branch{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtection_lock_branchFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtection_lock_branchFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection_lock_branch(), 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 *BranchProtection_lock_branch) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection_lock_branch) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection_lock_branch) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *BranchProtection_lock_branch) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *BranchProtection_lock_branch) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection_lock_branch) SetEnabled(value *bool)() { + m.enabled = value +} +type BranchProtection_lock_branchable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_required_conversation_resolution.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_required_conversation_resolution.go new file mode 100644 index 000000000..b772d300e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_required_conversation_resolution.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchProtection_required_conversation_resolution struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The enabled property + enabled *bool +} +// NewBranchProtection_required_conversation_resolution instantiates a new BranchProtection_required_conversation_resolution and sets the default values. +func NewBranchProtection_required_conversation_resolution()(*BranchProtection_required_conversation_resolution) { + m := &BranchProtection_required_conversation_resolution{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtection_required_conversation_resolutionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtection_required_conversation_resolutionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection_required_conversation_resolution(), 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 *BranchProtection_required_conversation_resolution) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection_required_conversation_resolution) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection_required_conversation_resolution) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *BranchProtection_required_conversation_resolution) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *BranchProtection_required_conversation_resolution) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection_required_conversation_resolution) SetEnabled(value *bool)() { + m.enabled = value +} +type BranchProtection_required_conversation_resolutionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_required_linear_history.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_required_linear_history.go new file mode 100644 index 000000000..b804813b1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_required_linear_history.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchProtection_required_linear_history struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The enabled property + enabled *bool +} +// NewBranchProtection_required_linear_history instantiates a new BranchProtection_required_linear_history and sets the default values. +func NewBranchProtection_required_linear_history()(*BranchProtection_required_linear_history) { + m := &BranchProtection_required_linear_history{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtection_required_linear_historyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtection_required_linear_historyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection_required_linear_history(), 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 *BranchProtection_required_linear_history) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection_required_linear_history) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection_required_linear_history) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *BranchProtection_required_linear_history) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *BranchProtection_required_linear_history) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection_required_linear_history) SetEnabled(value *bool)() { + m.enabled = value +} +type BranchProtection_required_linear_historyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_required_signatures.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_required_signatures.go new file mode 100644 index 000000000..fdd4af5a2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_protection_required_signatures.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchProtection_required_signatures struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The enabled property + enabled *bool + // The url property + url *string +} +// NewBranchProtection_required_signatures instantiates a new BranchProtection_required_signatures and sets the default values. +func NewBranchProtection_required_signatures()(*BranchProtection_required_signatures) { + m := &BranchProtection_required_signatures{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtection_required_signaturesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtection_required_signaturesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection_required_signatures(), 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 *BranchProtection_required_signatures) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection_required_signatures) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection_required_signatures) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BranchProtection_required_signatures) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *BranchProtection_required_signatures) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *BranchProtection_required_signatures) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection_required_signatures) SetEnabled(value *bool)() { + m.enabled = value +} +// SetUrl sets the url property value. The url property +func (m *BranchProtection_required_signatures) SetUrl(value *string)() { + m.url = value +} +type BranchProtection_required_signaturesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + GetUrl()(*string) + SetEnabled(value *bool)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy.go new file mode 100644 index 000000000..acfa68d47 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy.go @@ -0,0 +1,291 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// BranchRestrictionPolicy branch Restriction Policy +type BranchRestrictionPolicy struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The apps property + apps []BranchRestrictionPolicy_appsable + // The apps_url property + apps_url *string + // The teams property + teams []BranchRestrictionPolicy_teamsable + // The teams_url property + teams_url *string + // The url property + url *string + // The users property + users []BranchRestrictionPolicy_usersable + // The users_url property + users_url *string +} +// NewBranchRestrictionPolicy instantiates a new BranchRestrictionPolicy and sets the default values. +func NewBranchRestrictionPolicy()(*BranchRestrictionPolicy) { + m := &BranchRestrictionPolicy{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchRestrictionPolicyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchRestrictionPolicyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchRestrictionPolicy(), 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 *BranchRestrictionPolicy) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The apps property +// returns a []BranchRestrictionPolicy_appsable when successful +func (m *BranchRestrictionPolicy) GetApps()([]BranchRestrictionPolicy_appsable) { + return m.apps +} +// GetAppsUrl gets the apps_url property value. The apps_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy) GetAppsUrl()(*string) { + return m.apps_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchRestrictionPolicy) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateBranchRestrictionPolicy_appsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]BranchRestrictionPolicy_appsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(BranchRestrictionPolicy_appsable) + } + } + m.SetApps(res) + } + return nil + } + res["apps_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAppsUrl(val) + } + return nil + } + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateBranchRestrictionPolicy_teamsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]BranchRestrictionPolicy_teamsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(BranchRestrictionPolicy_teamsable) + } + } + m.SetTeams(res) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateBranchRestrictionPolicy_usersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]BranchRestrictionPolicy_usersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(BranchRestrictionPolicy_usersable) + } + } + m.SetUsers(res) + } + return nil + } + res["users_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUsersUrl(val) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The teams property +// returns a []BranchRestrictionPolicy_teamsable when successful +func (m *BranchRestrictionPolicy) GetTeams()([]BranchRestrictionPolicy_teamsable) { + return m.teams +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BranchRestrictionPolicy) GetUrl()(*string) { + return m.url +} +// GetUsers gets the users property value. The users property +// returns a []BranchRestrictionPolicy_usersable when successful +func (m *BranchRestrictionPolicy) GetUsers()([]BranchRestrictionPolicy_usersable) { + return m.users +} +// GetUsersUrl gets the users_url property value. The users_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy) GetUsersUrl()(*string) { + return m.users_url +} +// Serialize serializes information the current object +func (m *BranchRestrictionPolicy) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetApps())) + for i, v := range m.GetApps() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("apps", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("apps_url", m.GetAppsUrl()) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTeams())) + for i, v := range m.GetTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("teams", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetUsers())) + for i, v := range m.GetUsers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("users", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("users_url", m.GetUsersUrl()) + 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 *BranchRestrictionPolicy) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The apps property +func (m *BranchRestrictionPolicy) SetApps(value []BranchRestrictionPolicy_appsable)() { + m.apps = value +} +// SetAppsUrl sets the apps_url property value. The apps_url property +func (m *BranchRestrictionPolicy) SetAppsUrl(value *string)() { + m.apps_url = value +} +// SetTeams sets the teams property value. The teams property +func (m *BranchRestrictionPolicy) SetTeams(value []BranchRestrictionPolicy_teamsable)() { + m.teams = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *BranchRestrictionPolicy) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetUrl sets the url property value. The url property +func (m *BranchRestrictionPolicy) SetUrl(value *string)() { + m.url = value +} +// SetUsers sets the users property value. The users property +func (m *BranchRestrictionPolicy) SetUsers(value []BranchRestrictionPolicy_usersable)() { + m.users = value +} +// SetUsersUrl sets the users_url property value. The users_url property +func (m *BranchRestrictionPolicy) SetUsersUrl(value *string)() { + m.users_url = value +} +type BranchRestrictionPolicyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]BranchRestrictionPolicy_appsable) + GetAppsUrl()(*string) + GetTeams()([]BranchRestrictionPolicy_teamsable) + GetTeamsUrl()(*string) + GetUrl()(*string) + GetUsers()([]BranchRestrictionPolicy_usersable) + GetUsersUrl()(*string) + SetApps(value []BranchRestrictionPolicy_appsable)() + SetAppsUrl(value *string)() + SetTeams(value []BranchRestrictionPolicy_teamsable)() + SetTeamsUrl(value *string)() + SetUrl(value *string)() + SetUsers(value []BranchRestrictionPolicy_usersable)() + SetUsersUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy_apps.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy_apps.go new file mode 100644 index 000000000..fff868eb1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy_apps.go @@ -0,0 +1,405 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchRestrictionPolicy_apps struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *string + // The description property + description *string + // The events property + events []string + // The external_url property + external_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The name property + name *string + // The node_id property + node_id *string + // The owner property + owner BranchRestrictionPolicy_apps_ownerable + // The permissions property + permissions BranchRestrictionPolicy_apps_permissionsable + // The slug property + slug *string + // The updated_at property + updated_at *string +} +// NewBranchRestrictionPolicy_apps instantiates a new BranchRestrictionPolicy_apps and sets the default values. +func NewBranchRestrictionPolicy_apps()(*BranchRestrictionPolicy_apps) { + m := &BranchRestrictionPolicy_apps{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchRestrictionPolicy_appsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchRestrictionPolicy_appsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchRestrictionPolicy_apps(), 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 *BranchRestrictionPolicy_apps) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps) GetCreatedAt()(*string) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps) GetDescription()(*string) { + return m.description +} +// GetEvents gets the events property value. The events property +// returns a []string when successful +func (m *BranchRestrictionPolicy_apps) GetEvents()([]string) { + return m.events +} +// GetExternalUrl gets the external_url property value. The external_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps) GetExternalUrl()(*string) { + return m.external_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchRestrictionPolicy_apps) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetEvents(res) + } + return nil + } + res["external_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExternalUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchRestrictionPolicy_apps_ownerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(BranchRestrictionPolicy_apps_ownerable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchRestrictionPolicy_apps_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(BranchRestrictionPolicy_apps_permissionsable)) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *BranchRestrictionPolicy_apps) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps) GetNodeId()(*string) { + return m.node_id +} +// GetOwner gets the owner property value. The owner property +// returns a BranchRestrictionPolicy_apps_ownerable when successful +func (m *BranchRestrictionPolicy_apps) GetOwner()(BranchRestrictionPolicy_apps_ownerable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a BranchRestrictionPolicy_apps_permissionsable when successful +func (m *BranchRestrictionPolicy_apps) GetPermissions()(BranchRestrictionPolicy_apps_permissionsable) { + return m.permissions +} +// GetSlug gets the slug property value. The slug property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps) GetSlug()(*string) { + return m.slug +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps) GetUpdatedAt()(*string) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *BranchRestrictionPolicy_apps) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("external_url", m.GetExternalUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + 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 *BranchRestrictionPolicy_apps) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *BranchRestrictionPolicy_apps) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *BranchRestrictionPolicy_apps) SetDescription(value *string)() { + m.description = value +} +// SetEvents sets the events property value. The events property +func (m *BranchRestrictionPolicy_apps) SetEvents(value []string)() { + m.events = value +} +// SetExternalUrl sets the external_url property value. The external_url property +func (m *BranchRestrictionPolicy_apps) SetExternalUrl(value *string)() { + m.external_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *BranchRestrictionPolicy_apps) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *BranchRestrictionPolicy_apps) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *BranchRestrictionPolicy_apps) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *BranchRestrictionPolicy_apps) SetNodeId(value *string)() { + m.node_id = value +} +// SetOwner sets the owner property value. The owner property +func (m *BranchRestrictionPolicy_apps) SetOwner(value BranchRestrictionPolicy_apps_ownerable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *BranchRestrictionPolicy_apps) SetPermissions(value BranchRestrictionPolicy_apps_permissionsable)() { + m.permissions = value +} +// SetSlug sets the slug property value. The slug property +func (m *BranchRestrictionPolicy_apps) SetSlug(value *string)() { + m.slug = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *BranchRestrictionPolicy_apps) SetUpdatedAt(value *string)() { + m.updated_at = value +} +type BranchRestrictionPolicy_appsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*string) + GetDescription()(*string) + GetEvents()([]string) + GetExternalUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetOwner()(BranchRestrictionPolicy_apps_ownerable) + GetPermissions()(BranchRestrictionPolicy_apps_permissionsable) + GetSlug()(*string) + GetUpdatedAt()(*string) + SetCreatedAt(value *string)() + SetDescription(value *string)() + SetEvents(value []string)() + SetExternalUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetOwner(value BranchRestrictionPolicy_apps_ownerable)() + SetPermissions(value BranchRestrictionPolicy_apps_permissionsable)() + SetSlug(value *string)() + SetUpdatedAt(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy_apps_owner.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy_apps_owner.go new file mode 100644 index 000000000..af436c8a8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy_apps_owner.go @@ -0,0 +1,718 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchRestrictionPolicy_apps_owner struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The description property + description *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The issues_url property + issues_url *string + // The login property + login *string + // The members_url property + members_url *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The public_members_url property + public_members_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewBranchRestrictionPolicy_apps_owner instantiates a new BranchRestrictionPolicy_apps_owner and sets the default values. +func NewBranchRestrictionPolicy_apps_owner()(*BranchRestrictionPolicy_apps_owner) { + m := &BranchRestrictionPolicy_apps_owner{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchRestrictionPolicy_apps_ownerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchRestrictionPolicy_apps_ownerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchRestrictionPolicy_apps_owner(), 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 *BranchRestrictionPolicy_apps_owner) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetDescription()(*string) { + return m.description +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchRestrictionPolicy_apps_owner) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["public_members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicMembersUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *BranchRestrictionPolicy_apps_owner) GetId()(*int32) { + return m.id +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetLogin()(*string) { + return m.login +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetMembersUrl()(*string) { + return m.members_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetPublicMembersUrl gets the public_members_url property value. The public_members_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetPublicMembersUrl()(*string) { + return m.public_members_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *BranchRestrictionPolicy_apps_owner) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *BranchRestrictionPolicy_apps_owner) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("public_members_url", m.GetPublicMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *BranchRestrictionPolicy_apps_owner) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *BranchRestrictionPolicy_apps_owner) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetDescription sets the description property value. The description property +func (m *BranchRestrictionPolicy_apps_owner) SetDescription(value *string)() { + m.description = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *BranchRestrictionPolicy_apps_owner) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *BranchRestrictionPolicy_apps_owner) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *BranchRestrictionPolicy_apps_owner) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *BranchRestrictionPolicy_apps_owner) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *BranchRestrictionPolicy_apps_owner) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *BranchRestrictionPolicy_apps_owner) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *BranchRestrictionPolicy_apps_owner) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *BranchRestrictionPolicy_apps_owner) SetId(value *int32)() { + m.id = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *BranchRestrictionPolicy_apps_owner) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetLogin sets the login property value. The login property +func (m *BranchRestrictionPolicy_apps_owner) SetLogin(value *string)() { + m.login = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *BranchRestrictionPolicy_apps_owner) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *BranchRestrictionPolicy_apps_owner) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *BranchRestrictionPolicy_apps_owner) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetPublicMembersUrl sets the public_members_url property value. The public_members_url property +func (m *BranchRestrictionPolicy_apps_owner) SetPublicMembersUrl(value *string)() { + m.public_members_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *BranchRestrictionPolicy_apps_owner) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *BranchRestrictionPolicy_apps_owner) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *BranchRestrictionPolicy_apps_owner) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *BranchRestrictionPolicy_apps_owner) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *BranchRestrictionPolicy_apps_owner) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *BranchRestrictionPolicy_apps_owner) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *BranchRestrictionPolicy_apps_owner) SetUrl(value *string)() { + m.url = value +} +type BranchRestrictionPolicy_apps_ownerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetDescription()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssuesUrl()(*string) + GetLogin()(*string) + GetMembersUrl()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetPublicMembersUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetDescription(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssuesUrl(value *string)() + SetLogin(value *string)() + SetMembersUrl(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetPublicMembersUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy_apps_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy_apps_permissions.go new file mode 100644 index 000000000..3a9f9a752 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy_apps_permissions.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchRestrictionPolicy_apps_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The contents property + contents *string + // The issues property + issues *string + // The metadata property + metadata *string + // The single_file property + single_file *string +} +// NewBranchRestrictionPolicy_apps_permissions instantiates a new BranchRestrictionPolicy_apps_permissions and sets the default values. +func NewBranchRestrictionPolicy_apps_permissions()(*BranchRestrictionPolicy_apps_permissions) { + m := &BranchRestrictionPolicy_apps_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchRestrictionPolicy_apps_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchRestrictionPolicy_apps_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchRestrictionPolicy_apps_permissions(), 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 *BranchRestrictionPolicy_apps_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContents gets the contents property value. The contents property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_permissions) GetContents()(*string) { + return m.contents +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchRestrictionPolicy_apps_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["contents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContents(val) + } + return nil + } + res["issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssues(val) + } + return nil + } + res["metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMetadata(val) + } + return nil + } + res["single_file"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSingleFile(val) + } + return nil + } + return res +} +// GetIssues gets the issues property value. The issues property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_permissions) GetIssues()(*string) { + return m.issues +} +// GetMetadata gets the metadata property value. The metadata property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_permissions) GetMetadata()(*string) { + return m.metadata +} +// GetSingleFile gets the single_file property value. The single_file property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_permissions) GetSingleFile()(*string) { + return m.single_file +} +// Serialize serializes information the current object +func (m *BranchRestrictionPolicy_apps_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("contents", m.GetContents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues", m.GetIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("metadata", m.GetMetadata()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("single_file", m.GetSingleFile()) + 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 *BranchRestrictionPolicy_apps_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContents sets the contents property value. The contents property +func (m *BranchRestrictionPolicy_apps_permissions) SetContents(value *string)() { + m.contents = value +} +// SetIssues sets the issues property value. The issues property +func (m *BranchRestrictionPolicy_apps_permissions) SetIssues(value *string)() { + m.issues = value +} +// SetMetadata sets the metadata property value. The metadata property +func (m *BranchRestrictionPolicy_apps_permissions) SetMetadata(value *string)() { + m.metadata = value +} +// SetSingleFile sets the single_file property value. The single_file property +func (m *BranchRestrictionPolicy_apps_permissions) SetSingleFile(value *string)() { + m.single_file = value +} +type BranchRestrictionPolicy_apps_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContents()(*string) + GetIssues()(*string) + GetMetadata()(*string) + GetSingleFile()(*string) + SetContents(value *string)() + SetIssues(value *string)() + SetMetadata(value *string)() + SetSingleFile(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy_teams.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy_teams.go new file mode 100644 index 000000000..b12b2967f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy_teams.go @@ -0,0 +1,428 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchRestrictionPolicy_teams struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The description property + description *string + // The html_url property + html_url *string + // The id property + id *int32 + // The members_url property + members_url *string + // The name property + name *string + // The node_id property + node_id *string + // The notification_setting property + notification_setting *string + // The parent property + parent *string + // The permission property + permission *string + // The privacy property + privacy *string + // The repositories_url property + repositories_url *string + // The slug property + slug *string + // The url property + url *string +} +// NewBranchRestrictionPolicy_teams instantiates a new BranchRestrictionPolicy_teams and sets the default values. +func NewBranchRestrictionPolicy_teams()(*BranchRestrictionPolicy_teams) { + m := &BranchRestrictionPolicy_teams{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchRestrictionPolicy_teamsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchRestrictionPolicy_teamsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchRestrictionPolicy_teams(), 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 *BranchRestrictionPolicy_teams) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchRestrictionPolicy_teams) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notification_setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationSetting(val) + } + return nil + } + res["parent"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetParent(val) + } + return nil + } + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + res["privacy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivacy(val) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *BranchRestrictionPolicy_teams) GetId()(*int32) { + return m.id +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationSetting gets the notification_setting property value. The notification_setting property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetNotificationSetting()(*string) { + return m.notification_setting +} +// GetParent gets the parent property value. The parent property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetParent()(*string) { + return m.parent +} +// GetPermission gets the permission property value. The permission property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetPermission()(*string) { + return m.permission +} +// GetPrivacy gets the privacy property value. The privacy property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetPrivacy()(*string) { + return m.privacy +} +// GetRepositoriesUrl gets the repositories_url property value. The repositories_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetSlug gets the slug property value. The slug property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetSlug()(*string) { + return m.slug +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *BranchRestrictionPolicy_teams) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notification_setting", m.GetNotificationSetting()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("parent", m.GetParent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("permission", m.GetPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("privacy", m.GetPrivacy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *BranchRestrictionPolicy_teams) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description property +func (m *BranchRestrictionPolicy_teams) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *BranchRestrictionPolicy_teams) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *BranchRestrictionPolicy_teams) SetId(value *int32)() { + m.id = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *BranchRestrictionPolicy_teams) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. The name property +func (m *BranchRestrictionPolicy_teams) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *BranchRestrictionPolicy_teams) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationSetting sets the notification_setting property value. The notification_setting property +func (m *BranchRestrictionPolicy_teams) SetNotificationSetting(value *string)() { + m.notification_setting = value +} +// SetParent sets the parent property value. The parent property +func (m *BranchRestrictionPolicy_teams) SetParent(value *string)() { + m.parent = value +} +// SetPermission sets the permission property value. The permission property +func (m *BranchRestrictionPolicy_teams) SetPermission(value *string)() { + m.permission = value +} +// SetPrivacy sets the privacy property value. The privacy property +func (m *BranchRestrictionPolicy_teams) SetPrivacy(value *string)() { + m.privacy = value +} +// SetRepositoriesUrl sets the repositories_url property value. The repositories_url property +func (m *BranchRestrictionPolicy_teams) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetSlug sets the slug property value. The slug property +func (m *BranchRestrictionPolicy_teams) SetSlug(value *string)() { + m.slug = value +} +// SetUrl sets the url property value. The url property +func (m *BranchRestrictionPolicy_teams) SetUrl(value *string)() { + m.url = value +} +type BranchRestrictionPolicy_teamsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationSetting()(*string) + GetParent()(*string) + GetPermission()(*string) + GetPrivacy()(*string) + GetRepositoriesUrl()(*string) + GetSlug()(*string) + GetUrl()(*string) + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationSetting(value *string)() + SetParent(value *string)() + SetPermission(value *string)() + SetPrivacy(value *string)() + SetRepositoriesUrl(value *string)() + SetSlug(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy_users.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy_users.go new file mode 100644 index 000000000..96629f5bd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_restriction_policy_users.go @@ -0,0 +1,573 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchRestrictionPolicy_users struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int64 + // The login property + login *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewBranchRestrictionPolicy_users instantiates a new BranchRestrictionPolicy_users and sets the default values. +func NewBranchRestrictionPolicy_users()(*BranchRestrictionPolicy_users) { + m := &BranchRestrictionPolicy_users{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchRestrictionPolicy_usersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchRestrictionPolicy_usersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchRestrictionPolicy_users(), 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 *BranchRestrictionPolicy_users) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchRestrictionPolicy_users) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *BranchRestrictionPolicy_users) GetId()(*int64) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetLogin()(*string) { + return m.login +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *BranchRestrictionPolicy_users) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *BranchRestrictionPolicy_users) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *BranchRestrictionPolicy_users) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *BranchRestrictionPolicy_users) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *BranchRestrictionPolicy_users) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *BranchRestrictionPolicy_users) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *BranchRestrictionPolicy_users) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *BranchRestrictionPolicy_users) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *BranchRestrictionPolicy_users) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *BranchRestrictionPolicy_users) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *BranchRestrictionPolicy_users) SetId(value *int64)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *BranchRestrictionPolicy_users) SetLogin(value *string)() { + m.login = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *BranchRestrictionPolicy_users) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *BranchRestrictionPolicy_users) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *BranchRestrictionPolicy_users) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *BranchRestrictionPolicy_users) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *BranchRestrictionPolicy_users) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *BranchRestrictionPolicy_users) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *BranchRestrictionPolicy_users) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *BranchRestrictionPolicy_users) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *BranchRestrictionPolicy_users) SetUrl(value *string)() { + m.url = value +} +type BranchRestrictionPolicy_usersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLogin()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLogin(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_short.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_short.go new file mode 100644 index 000000000..7c7c73456 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_short.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// BranchShort branch Short +type BranchShort struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit property + commit BranchShort_commitable + // The name property + name *string + // The protected property + protected *bool +} +// NewBranchShort instantiates a new BranchShort and sets the default values. +func NewBranchShort()(*BranchShort) { + m := &BranchShort{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchShortFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchShortFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchShort(), 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 *BranchShort) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommit gets the commit property value. The commit property +// returns a BranchShort_commitable when successful +func (m *BranchShort) GetCommit()(BranchShort_commitable) { + return m.commit +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchShort) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchShort_commitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommit(val.(BranchShort_commitable)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["protected"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetProtected(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *BranchShort) GetName()(*string) { + return m.name +} +// GetProtected gets the protected property value. The protected property +// returns a *bool when successful +func (m *BranchShort) GetProtected()(*bool) { + return m.protected +} +// Serialize serializes information the current object +func (m *BranchShort) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("commit", m.GetCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("protected", m.GetProtected()) + 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 *BranchShort) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommit sets the commit property value. The commit property +func (m *BranchShort) SetCommit(value BranchShort_commitable)() { + m.commit = value +} +// SetName sets the name property value. The name property +func (m *BranchShort) SetName(value *string)() { + m.name = value +} +// SetProtected sets the protected property value. The protected property +func (m *BranchShort) SetProtected(value *bool)() { + m.protected = value +} +type BranchShortable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommit()(BranchShort_commitable) + GetName()(*string) + GetProtected()(*bool) + SetCommit(value BranchShort_commitable)() + SetName(value *string)() + SetProtected(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_short_commit.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_short_commit.go new file mode 100644 index 000000000..080cf0eaa --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_short_commit.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchShort_commit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The sha property + sha *string + // The url property + url *string +} +// NewBranchShort_commit instantiates a new BranchShort_commit and sets the default values. +func NewBranchShort_commit()(*BranchShort_commit) { + m := &BranchShort_commit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchShort_commitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchShort_commitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchShort_commit(), 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 *BranchShort_commit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchShort_commit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *BranchShort_commit) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BranchShort_commit) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *BranchShort_commit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *BranchShort_commit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *BranchShort_commit) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *BranchShort_commit) SetUrl(value *string)() { + m.url = value +} +type BranchShort_commitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_with_protection.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_with_protection.go new file mode 100644 index 000000000..cc8e99881 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_with_protection.go @@ -0,0 +1,284 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// BranchWithProtection branch With Protection +type BranchWithProtection struct { + // The _links property + _links BranchWithProtection__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Commit + commit Commitable + // The name property + name *string + // The pattern property + pattern *string + // The protected property + protected *bool + // Branch Protection + protection BranchProtectionable + // The protection_url property + protection_url *string + // The required_approving_review_count property + required_approving_review_count *int32 +} +// NewBranchWithProtection instantiates a new BranchWithProtection and sets the default values. +func NewBranchWithProtection()(*BranchWithProtection) { + m := &BranchWithProtection{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchWithProtectionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchWithProtectionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchWithProtection(), 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 *BranchWithProtection) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommit gets the commit property value. Commit +// returns a Commitable when successful +func (m *BranchWithProtection) GetCommit()(Commitable) { + return m.commit +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchWithProtection) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchWithProtection__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(BranchWithProtection__linksable)) + } + return nil + } + res["commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommit(val.(Commitable)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["pattern"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPattern(val) + } + return nil + } + res["protected"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetProtected(val) + } + return nil + } + res["protection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtectionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProtection(val.(BranchProtectionable)) + } + return nil + } + res["protection_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProtectionUrl(val) + } + return nil + } + res["required_approving_review_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRequiredApprovingReviewCount(val) + } + return nil + } + return res +} +// GetLinks gets the _links property value. The _links property +// returns a BranchWithProtection__linksable when successful +func (m *BranchWithProtection) GetLinks()(BranchWithProtection__linksable) { + return m._links +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *BranchWithProtection) GetName()(*string) { + return m.name +} +// GetPattern gets the pattern property value. The pattern property +// returns a *string when successful +func (m *BranchWithProtection) GetPattern()(*string) { + return m.pattern +} +// GetProtected gets the protected property value. The protected property +// returns a *bool when successful +func (m *BranchWithProtection) GetProtected()(*bool) { + return m.protected +} +// GetProtection gets the protection property value. Branch Protection +// returns a BranchProtectionable when successful +func (m *BranchWithProtection) GetProtection()(BranchProtectionable) { + return m.protection +} +// GetProtectionUrl gets the protection_url property value. The protection_url property +// returns a *string when successful +func (m *BranchWithProtection) GetProtectionUrl()(*string) { + return m.protection_url +} +// GetRequiredApprovingReviewCount gets the required_approving_review_count property value. The required_approving_review_count property +// returns a *int32 when successful +func (m *BranchWithProtection) GetRequiredApprovingReviewCount()(*int32) { + return m.required_approving_review_count +} +// Serialize serializes information the current object +func (m *BranchWithProtection) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("commit", m.GetCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pattern", m.GetPattern()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("protected", m.GetProtected()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("protection", m.GetProtection()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("protection_url", m.GetProtectionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("required_approving_review_count", m.GetRequiredApprovingReviewCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *BranchWithProtection) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommit sets the commit property value. Commit +func (m *BranchWithProtection) SetCommit(value Commitable)() { + m.commit = value +} +// SetLinks sets the _links property value. The _links property +func (m *BranchWithProtection) SetLinks(value BranchWithProtection__linksable)() { + m._links = value +} +// SetName sets the name property value. The name property +func (m *BranchWithProtection) SetName(value *string)() { + m.name = value +} +// SetPattern sets the pattern property value. The pattern property +func (m *BranchWithProtection) SetPattern(value *string)() { + m.pattern = value +} +// SetProtected sets the protected property value. The protected property +func (m *BranchWithProtection) SetProtected(value *bool)() { + m.protected = value +} +// SetProtection sets the protection property value. Branch Protection +func (m *BranchWithProtection) SetProtection(value BranchProtectionable)() { + m.protection = value +} +// SetProtectionUrl sets the protection_url property value. The protection_url property +func (m *BranchWithProtection) SetProtectionUrl(value *string)() { + m.protection_url = value +} +// SetRequiredApprovingReviewCount sets the required_approving_review_count property value. The required_approving_review_count property +func (m *BranchWithProtection) SetRequiredApprovingReviewCount(value *int32)() { + m.required_approving_review_count = value +} +type BranchWithProtectionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommit()(Commitable) + GetLinks()(BranchWithProtection__linksable) + GetName()(*string) + GetPattern()(*string) + GetProtected()(*bool) + GetProtection()(BranchProtectionable) + GetProtectionUrl()(*string) + GetRequiredApprovingReviewCount()(*int32) + SetCommit(value Commitable)() + SetLinks(value BranchWithProtection__linksable)() + SetName(value *string)() + SetPattern(value *string)() + SetProtected(value *bool)() + SetProtection(value BranchProtectionable)() + SetProtectionUrl(value *string)() + SetRequiredApprovingReviewCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_with_protection__links.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_with_protection__links.go new file mode 100644 index 000000000..8e03d5248 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/branch_with_protection__links.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchWithProtection__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html property + html *string + // The self property + self *string +} +// NewBranchWithProtection__links instantiates a new BranchWithProtection__links and sets the default values. +func NewBranchWithProtection__links()(*BranchWithProtection__links) { + m := &BranchWithProtection__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchWithProtection__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchWithProtection__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchWithProtection__links(), 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 *BranchWithProtection__links) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchWithProtection__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtml(val) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelf(val) + } + return nil + } + return res +} +// GetHtml gets the html property value. The html property +// returns a *string when successful +func (m *BranchWithProtection__links) GetHtml()(*string) { + return m.html +} +// GetSelf gets the self property value. The self property +// returns a *string when successful +func (m *BranchWithProtection__links) GetSelf()(*string) { + return m.self +} +// Serialize serializes information the current object +func (m *BranchWithProtection__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("self", m.GetSelf()) + 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 *BranchWithProtection__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtml sets the html property value. The html property +func (m *BranchWithProtection__links) SetHtml(value *string)() { + m.html = value +} +// SetSelf sets the self property value. The self property +func (m *BranchWithProtection__links) SetSelf(value *string)() { + m.self = value +} +type BranchWithProtection__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtml()(*string) + GetSelf()(*string) + SetHtml(value *string)() + SetSelf(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/check_annotation.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_annotation.go new file mode 100644 index 000000000..bc268791f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_annotation.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CheckAnnotation check Annotation +type CheckAnnotation struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The annotation_level property + annotation_level *string + // The blob_href property + blob_href *string + // The end_column property + end_column *int32 + // The end_line property + end_line *int32 + // The message property + message *string + // The path property + path *string + // The raw_details property + raw_details *string + // The start_column property + start_column *int32 + // The start_line property + start_line *int32 + // The title property + title *string +} +// NewCheckAnnotation instantiates a new CheckAnnotation and sets the default values. +func NewCheckAnnotation()(*CheckAnnotation) { + m := &CheckAnnotation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckAnnotationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckAnnotationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckAnnotation(), 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 *CheckAnnotation) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAnnotationLevel gets the annotation_level property value. The annotation_level property +// returns a *string when successful +func (m *CheckAnnotation) GetAnnotationLevel()(*string) { + return m.annotation_level +} +// GetBlobHref gets the blob_href property value. The blob_href property +// returns a *string when successful +func (m *CheckAnnotation) GetBlobHref()(*string) { + return m.blob_href +} +// GetEndColumn gets the end_column property value. The end_column property +// returns a *int32 when successful +func (m *CheckAnnotation) GetEndColumn()(*int32) { + return m.end_column +} +// GetEndLine gets the end_line property value. The end_line property +// returns a *int32 when successful +func (m *CheckAnnotation) GetEndLine()(*int32) { + return m.end_line +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CheckAnnotation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["annotation_level"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAnnotationLevel(val) + } + return nil + } + res["blob_href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobHref(val) + } + return nil + } + res["end_column"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetEndColumn(val) + } + return nil + } + res["end_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetEndLine(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(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["raw_details"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRawDetails(val) + } + return nil + } + res["start_column"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartColumn(val) + } + return nil + } + res["start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartLine(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *CheckAnnotation) GetMessage()(*string) { + return m.message +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *CheckAnnotation) GetPath()(*string) { + return m.path +} +// GetRawDetails gets the raw_details property value. The raw_details property +// returns a *string when successful +func (m *CheckAnnotation) GetRawDetails()(*string) { + return m.raw_details +} +// GetStartColumn gets the start_column property value. The start_column property +// returns a *int32 when successful +func (m *CheckAnnotation) GetStartColumn()(*int32) { + return m.start_column +} +// GetStartLine gets the start_line property value. The start_line property +// returns a *int32 when successful +func (m *CheckAnnotation) GetStartLine()(*int32) { + return m.start_line +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *CheckAnnotation) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *CheckAnnotation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("annotation_level", m.GetAnnotationLevel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blob_href", m.GetBlobHref()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("end_column", m.GetEndColumn()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("end_line", m.GetEndLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("raw_details", m.GetRawDetails()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("start_column", m.GetStartColumn()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("start_line", m.GetStartLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *CheckAnnotation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAnnotationLevel sets the annotation_level property value. The annotation_level property +func (m *CheckAnnotation) SetAnnotationLevel(value *string)() { + m.annotation_level = value +} +// SetBlobHref sets the blob_href property value. The blob_href property +func (m *CheckAnnotation) SetBlobHref(value *string)() { + m.blob_href = value +} +// SetEndColumn sets the end_column property value. The end_column property +func (m *CheckAnnotation) SetEndColumn(value *int32)() { + m.end_column = value +} +// SetEndLine sets the end_line property value. The end_line property +func (m *CheckAnnotation) SetEndLine(value *int32)() { + m.end_line = value +} +// SetMessage sets the message property value. The message property +func (m *CheckAnnotation) SetMessage(value *string)() { + m.message = value +} +// SetPath sets the path property value. The path property +func (m *CheckAnnotation) SetPath(value *string)() { + m.path = value +} +// SetRawDetails sets the raw_details property value. The raw_details property +func (m *CheckAnnotation) SetRawDetails(value *string)() { + m.raw_details = value +} +// SetStartColumn sets the start_column property value. The start_column property +func (m *CheckAnnotation) SetStartColumn(value *int32)() { + m.start_column = value +} +// SetStartLine sets the start_line property value. The start_line property +func (m *CheckAnnotation) SetStartLine(value *int32)() { + m.start_line = value +} +// SetTitle sets the title property value. The title property +func (m *CheckAnnotation) SetTitle(value *string)() { + m.title = value +} +type CheckAnnotationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAnnotationLevel()(*string) + GetBlobHref()(*string) + GetEndColumn()(*int32) + GetEndLine()(*int32) + GetMessage()(*string) + GetPath()(*string) + GetRawDetails()(*string) + GetStartColumn()(*int32) + GetStartLine()(*int32) + GetTitle()(*string) + SetAnnotationLevel(value *string)() + SetBlobHref(value *string)() + SetEndColumn(value *int32)() + SetEndLine(value *int32)() + SetMessage(value *string)() + SetPath(value *string)() + SetRawDetails(value *string)() + SetStartColumn(value *int32)() + SetStartLine(value *int32)() + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/check_automated_security_fixes.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_automated_security_fixes.go new file mode 100644 index 000000000..a20c43b66 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_automated_security_fixes.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CheckAutomatedSecurityFixes check Automated Security Fixes +type CheckAutomatedSecurityFixes struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether automated security fixes are enabled for the repository. + enabled *bool + // Whether automated security fixes are paused for the repository. + paused *bool +} +// NewCheckAutomatedSecurityFixes instantiates a new CheckAutomatedSecurityFixes and sets the default values. +func NewCheckAutomatedSecurityFixes()(*CheckAutomatedSecurityFixes) { + m := &CheckAutomatedSecurityFixes{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckAutomatedSecurityFixesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckAutomatedSecurityFixesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckAutomatedSecurityFixes(), 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 *CheckAutomatedSecurityFixes) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. Whether automated security fixes are enabled for the repository. +// returns a *bool when successful +func (m *CheckAutomatedSecurityFixes) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CheckAutomatedSecurityFixes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["paused"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPaused(val) + } + return nil + } + return res +} +// GetPaused gets the paused property value. Whether automated security fixes are paused for the repository. +// returns a *bool when successful +func (m *CheckAutomatedSecurityFixes) GetPaused()(*bool) { + return m.paused +} +// Serialize serializes information the current object +func (m *CheckAutomatedSecurityFixes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("paused", m.GetPaused()) + 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 *CheckAutomatedSecurityFixes) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. Whether automated security fixes are enabled for the repository. +func (m *CheckAutomatedSecurityFixes) SetEnabled(value *bool)() { + m.enabled = value +} +// SetPaused sets the paused property value. Whether automated security fixes are paused for the repository. +func (m *CheckAutomatedSecurityFixes) SetPaused(value *bool)() { + m.paused = value +} +type CheckAutomatedSecurityFixesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + GetPaused()(*bool) + SetEnabled(value *bool)() + SetPaused(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/check_run.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_run.go new file mode 100644 index 000000000..0b7613711 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_run.go @@ -0,0 +1,560 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CheckRun a check performed on the code of a given code change +type CheckRun struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + app NullableIntegrationable + // The check_suite property + check_suite CheckRun_check_suiteable + // The completed_at property + completed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The conclusion property + conclusion *CheckRun_conclusion + // A deployment created as the result of an Actions check run from a workflow that references an environment + deployment DeploymentSimpleable + // The details_url property + details_url *string + // The external_id property + external_id *string + // The SHA of the commit that is being checked. + head_sha *string + // The html_url property + html_url *string + // The id of the check. + id *int32 + // The name of the check. + name *string + // The node_id property + node_id *string + // The output property + output CheckRun_outputable + // Pull requests that are open with a `head_sha` or `head_branch` that matches the check. The returned pull requests do not necessarily indicate pull requests that triggered the check. + pull_requests []PullRequestMinimalable + // The started_at property + started_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The phase of the lifecycle that the check is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check runs. + status *CheckRun_status + // The url property + url *string +} +// NewCheckRun instantiates a new CheckRun and sets the default values. +func NewCheckRun()(*CheckRun) { + m := &CheckRun{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckRunFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckRunFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckRun(), 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 *CheckRun) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApp gets the app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *CheckRun) GetApp()(NullableIntegrationable) { + return m.app +} +// GetCheckSuite gets the check_suite property value. The check_suite property +// returns a CheckRun_check_suiteable when successful +func (m *CheckRun) GetCheckSuite()(CheckRun_check_suiteable) { + return m.check_suite +} +// GetCompletedAt gets the completed_at property value. The completed_at property +// returns a *Time when successful +func (m *CheckRun) GetCompletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.completed_at +} +// GetConclusion gets the conclusion property value. The conclusion property +// returns a *CheckRun_conclusion when successful +func (m *CheckRun) GetConclusion()(*CheckRun_conclusion) { + return m.conclusion +} +// GetDeployment gets the deployment property value. A deployment created as the result of an Actions check run from a workflow that references an environment +// returns a DeploymentSimpleable when successful +func (m *CheckRun) GetDeployment()(DeploymentSimpleable) { + return m.deployment +} +// GetDetailsUrl gets the details_url property value. The details_url property +// returns a *string when successful +func (m *CheckRun) GetDetailsUrl()(*string) { + return m.details_url +} +// GetExternalId gets the external_id property value. The external_id property +// returns a *string when successful +func (m *CheckRun) GetExternalId()(*string) { + return m.external_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CheckRun) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetApp(val.(NullableIntegrationable)) + } + return nil + } + res["check_suite"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCheckRun_check_suiteFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCheckSuite(val.(CheckRun_check_suiteable)) + } + return nil + } + res["completed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCompletedAt(val) + } + return nil + } + res["conclusion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCheckRun_conclusion) + if err != nil { + return err + } + if val != nil { + m.SetConclusion(val.(*CheckRun_conclusion)) + } + return nil + } + res["deployment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDeploymentSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDeployment(val.(DeploymentSimpleable)) + } + return nil + } + res["details_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDetailsUrl(val) + } + return nil + } + res["external_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExternalId(val) + } + return nil + } + res["head_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadSha(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["output"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCheckRun_outputFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOutput(val.(CheckRun_outputable)) + } + return nil + } + res["pull_requests"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePullRequestMinimalFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PullRequestMinimalable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PullRequestMinimalable) + } + } + m.SetPullRequests(res) + } + return nil + } + res["started_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetStartedAt(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCheckRun_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*CheckRun_status)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHeadSha gets the head_sha property value. The SHA of the commit that is being checked. +// returns a *string when successful +func (m *CheckRun) GetHeadSha()(*string) { + return m.head_sha +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CheckRun) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id of the check. +// returns a *int32 when successful +func (m *CheckRun) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name of the check. +// returns a *string when successful +func (m *CheckRun) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *CheckRun) GetNodeId()(*string) { + return m.node_id +} +// GetOutput gets the output property value. The output property +// returns a CheckRun_outputable when successful +func (m *CheckRun) GetOutput()(CheckRun_outputable) { + return m.output +} +// GetPullRequests gets the pull_requests property value. Pull requests that are open with a `head_sha` or `head_branch` that matches the check. The returned pull requests do not necessarily indicate pull requests that triggered the check. +// returns a []PullRequestMinimalable when successful +func (m *CheckRun) GetPullRequests()([]PullRequestMinimalable) { + return m.pull_requests +} +// GetStartedAt gets the started_at property value. The started_at property +// returns a *Time when successful +func (m *CheckRun) GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.started_at +} +// GetStatus gets the status property value. The phase of the lifecycle that the check is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check runs. +// returns a *CheckRun_status when successful +func (m *CheckRun) GetStatus()(*CheckRun_status) { + return m.status +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CheckRun) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CheckRun) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("app", m.GetApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("check_suite", m.GetCheckSuite()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("completed_at", m.GetCompletedAt()) + if err != nil { + return err + } + } + if m.GetConclusion() != nil { + cast := (*m.GetConclusion()).String() + err := writer.WriteStringValue("conclusion", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("deployment", m.GetDeployment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("details_url", m.GetDetailsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("external_id", m.GetExternalId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_sha", m.GetHeadSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("output", m.GetOutput()) + if err != nil { + return err + } + } + if m.GetPullRequests() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetPullRequests())) + for i, v := range m.GetPullRequests() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("pull_requests", cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("started_at", m.GetStartedAt()) + if err != nil { + return err + } + } + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err := writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CheckRun) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApp sets the app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *CheckRun) SetApp(value NullableIntegrationable)() { + m.app = value +} +// SetCheckSuite sets the check_suite property value. The check_suite property +func (m *CheckRun) SetCheckSuite(value CheckRun_check_suiteable)() { + m.check_suite = value +} +// SetCompletedAt sets the completed_at property value. The completed_at property +func (m *CheckRun) SetCompletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.completed_at = value +} +// SetConclusion sets the conclusion property value. The conclusion property +func (m *CheckRun) SetConclusion(value *CheckRun_conclusion)() { + m.conclusion = value +} +// SetDeployment sets the deployment property value. A deployment created as the result of an Actions check run from a workflow that references an environment +func (m *CheckRun) SetDeployment(value DeploymentSimpleable)() { + m.deployment = value +} +// SetDetailsUrl sets the details_url property value. The details_url property +func (m *CheckRun) SetDetailsUrl(value *string)() { + m.details_url = value +} +// SetExternalId sets the external_id property value. The external_id property +func (m *CheckRun) SetExternalId(value *string)() { + m.external_id = value +} +// SetHeadSha sets the head_sha property value. The SHA of the commit that is being checked. +func (m *CheckRun) SetHeadSha(value *string)() { + m.head_sha = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CheckRun) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id of the check. +func (m *CheckRun) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name of the check. +func (m *CheckRun) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *CheckRun) SetNodeId(value *string)() { + m.node_id = value +} +// SetOutput sets the output property value. The output property +func (m *CheckRun) SetOutput(value CheckRun_outputable)() { + m.output = value +} +// SetPullRequests sets the pull_requests property value. Pull requests that are open with a `head_sha` or `head_branch` that matches the check. The returned pull requests do not necessarily indicate pull requests that triggered the check. +func (m *CheckRun) SetPullRequests(value []PullRequestMinimalable)() { + m.pull_requests = value +} +// SetStartedAt sets the started_at property value. The started_at property +func (m *CheckRun) SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.started_at = value +} +// SetStatus sets the status property value. The phase of the lifecycle that the check is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check runs. +func (m *CheckRun) SetStatus(value *CheckRun_status)() { + m.status = value +} +// SetUrl sets the url property value. The url property +func (m *CheckRun) SetUrl(value *string)() { + m.url = value +} +type CheckRunable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApp()(NullableIntegrationable) + GetCheckSuite()(CheckRun_check_suiteable) + GetCompletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetConclusion()(*CheckRun_conclusion) + GetDeployment()(DeploymentSimpleable) + GetDetailsUrl()(*string) + GetExternalId()(*string) + GetHeadSha()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetOutput()(CheckRun_outputable) + GetPullRequests()([]PullRequestMinimalable) + GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetStatus()(*CheckRun_status) + GetUrl()(*string) + SetApp(value NullableIntegrationable)() + SetCheckSuite(value CheckRun_check_suiteable)() + SetCompletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetConclusion(value *CheckRun_conclusion)() + SetDeployment(value DeploymentSimpleable)() + SetDetailsUrl(value *string)() + SetExternalId(value *string)() + SetHeadSha(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetOutput(value CheckRun_outputable)() + SetPullRequests(value []PullRequestMinimalable)() + SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetStatus(value *CheckRun_status)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/check_run_check_suite.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_run_check_suite.go new file mode 100644 index 000000000..8fce07b5a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_run_check_suite.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CheckRun_check_suite struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 +} +// NewCheckRun_check_suite instantiates a new CheckRun_check_suite and sets the default values. +func NewCheckRun_check_suite()(*CheckRun_check_suite) { + m := &CheckRun_check_suite{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckRun_check_suiteFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckRun_check_suiteFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckRun_check_suite(), 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 *CheckRun_check_suite) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CheckRun_check_suite) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *CheckRun_check_suite) GetId()(*int32) { + return m.id +} +// Serialize serializes information the current object +func (m *CheckRun_check_suite) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + 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 *CheckRun_check_suite) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *CheckRun_check_suite) SetId(value *int32)() { + m.id = value +} +type CheckRun_check_suiteable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + SetId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/check_run_conclusion.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_run_conclusion.go new file mode 100644 index 000000000..9a0de6e5d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_run_conclusion.go @@ -0,0 +1,51 @@ +package models +import ( + "errors" +) +type CheckRun_conclusion int + +const ( + SUCCESS_CHECKRUN_CONCLUSION CheckRun_conclusion = iota + FAILURE_CHECKRUN_CONCLUSION + NEUTRAL_CHECKRUN_CONCLUSION + CANCELLED_CHECKRUN_CONCLUSION + SKIPPED_CHECKRUN_CONCLUSION + TIMED_OUT_CHECKRUN_CONCLUSION + ACTION_REQUIRED_CHECKRUN_CONCLUSION +) + +func (i CheckRun_conclusion) String() string { + return []string{"success", "failure", "neutral", "cancelled", "skipped", "timed_out", "action_required"}[i] +} +func ParseCheckRun_conclusion(v string) (any, error) { + result := SUCCESS_CHECKRUN_CONCLUSION + switch v { + case "success": + result = SUCCESS_CHECKRUN_CONCLUSION + case "failure": + result = FAILURE_CHECKRUN_CONCLUSION + case "neutral": + result = NEUTRAL_CHECKRUN_CONCLUSION + case "cancelled": + result = CANCELLED_CHECKRUN_CONCLUSION + case "skipped": + result = SKIPPED_CHECKRUN_CONCLUSION + case "timed_out": + result = TIMED_OUT_CHECKRUN_CONCLUSION + case "action_required": + result = ACTION_REQUIRED_CHECKRUN_CONCLUSION + default: + return 0, errors.New("Unknown CheckRun_conclusion value: " + v) + } + return &result, nil +} +func SerializeCheckRun_conclusion(values []CheckRun_conclusion) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CheckRun_conclusion) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/check_run_output.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_run_output.go new file mode 100644 index 000000000..0efeda152 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_run_output.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CheckRun_output struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The annotations_count property + annotations_count *int32 + // The annotations_url property + annotations_url *string + // The summary property + summary *string + // The text property + text *string + // The title property + title *string +} +// NewCheckRun_output instantiates a new CheckRun_output and sets the default values. +func NewCheckRun_output()(*CheckRun_output) { + m := &CheckRun_output{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckRun_outputFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckRun_outputFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckRun_output(), 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 *CheckRun_output) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAnnotationsCount gets the annotations_count property value. The annotations_count property +// returns a *int32 when successful +func (m *CheckRun_output) GetAnnotationsCount()(*int32) { + return m.annotations_count +} +// GetAnnotationsUrl gets the annotations_url property value. The annotations_url property +// returns a *string when successful +func (m *CheckRun_output) GetAnnotationsUrl()(*string) { + return m.annotations_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CheckRun_output) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["annotations_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAnnotationsCount(val) + } + return nil + } + res["annotations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAnnotationsUrl(val) + } + return nil + } + res["summary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSummary(val) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetSummary gets the summary property value. The summary property +// returns a *string when successful +func (m *CheckRun_output) GetSummary()(*string) { + return m.summary +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *CheckRun_output) GetText()(*string) { + return m.text +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *CheckRun_output) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *CheckRun_output) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("annotations_count", m.GetAnnotationsCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("annotations_url", m.GetAnnotationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("summary", m.GetSummary()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *CheckRun_output) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAnnotationsCount sets the annotations_count property value. The annotations_count property +func (m *CheckRun_output) SetAnnotationsCount(value *int32)() { + m.annotations_count = value +} +// SetAnnotationsUrl sets the annotations_url property value. The annotations_url property +func (m *CheckRun_output) SetAnnotationsUrl(value *string)() { + m.annotations_url = value +} +// SetSummary sets the summary property value. The summary property +func (m *CheckRun_output) SetSummary(value *string)() { + m.summary = value +} +// SetText sets the text property value. The text property +func (m *CheckRun_output) SetText(value *string)() { + m.text = value +} +// SetTitle sets the title property value. The title property +func (m *CheckRun_output) SetTitle(value *string)() { + m.title = value +} +type CheckRun_outputable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAnnotationsCount()(*int32) + GetAnnotationsUrl()(*string) + GetSummary()(*string) + GetText()(*string) + GetTitle()(*string) + SetAnnotationsCount(value *int32)() + SetAnnotationsUrl(value *string)() + SetSummary(value *string)() + SetText(value *string)() + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/check_run_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_run_status.go new file mode 100644 index 000000000..097adf28a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_run_status.go @@ -0,0 +1,49 @@ +package models +import ( + "errors" +) +// The phase of the lifecycle that the check is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check runs. +type CheckRun_status int + +const ( + QUEUED_CHECKRUN_STATUS CheckRun_status = iota + IN_PROGRESS_CHECKRUN_STATUS + COMPLETED_CHECKRUN_STATUS + WAITING_CHECKRUN_STATUS + REQUESTED_CHECKRUN_STATUS + PENDING_CHECKRUN_STATUS +) + +func (i CheckRun_status) String() string { + return []string{"queued", "in_progress", "completed", "waiting", "requested", "pending"}[i] +} +func ParseCheckRun_status(v string) (any, error) { + result := QUEUED_CHECKRUN_STATUS + switch v { + case "queued": + result = QUEUED_CHECKRUN_STATUS + case "in_progress": + result = IN_PROGRESS_CHECKRUN_STATUS + case "completed": + result = COMPLETED_CHECKRUN_STATUS + case "waiting": + result = WAITING_CHECKRUN_STATUS + case "requested": + result = REQUESTED_CHECKRUN_STATUS + case "pending": + result = PENDING_CHECKRUN_STATUS + default: + return 0, errors.New("Unknown CheckRun_status value: " + v) + } + return &result, nil +} +func SerializeCheckRun_status(values []CheckRun_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CheckRun_status) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite.go new file mode 100644 index 000000000..bd0ab8e45 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite.go @@ -0,0 +1,618 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CheckSuite a suite of checks performed on the code of a given code change +type CheckSuite struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The after property + after *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + app NullableIntegrationable + // The before property + before *string + // The check_runs_url property + check_runs_url *string + // The conclusion property + conclusion *CheckSuite_conclusion + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The head_branch property + head_branch *string + // A commit. + head_commit SimpleCommitable + // The SHA of the head commit that is being checked. + head_sha *string + // The id property + id *int32 + // The latest_check_runs_count property + latest_check_runs_count *int32 + // The node_id property + node_id *string + // The pull_requests property + pull_requests []PullRequestMinimalable + // Minimal Repository + repository MinimalRepositoryable + // The rerequestable property + rerequestable *bool + // The runs_rerequestable property + runs_rerequestable *bool + // The phase of the lifecycle that the check suite is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check suites. + status *CheckSuite_status + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewCheckSuite instantiates a new CheckSuite and sets the default values. +func NewCheckSuite()(*CheckSuite) { + m := &CheckSuite{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckSuiteFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckSuiteFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckSuite(), 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 *CheckSuite) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAfter gets the after property value. The after property +// returns a *string when successful +func (m *CheckSuite) GetAfter()(*string) { + return m.after +} +// GetApp gets the app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *CheckSuite) GetApp()(NullableIntegrationable) { + return m.app +} +// GetBefore gets the before property value. The before property +// returns a *string when successful +func (m *CheckSuite) GetBefore()(*string) { + return m.before +} +// GetCheckRunsUrl gets the check_runs_url property value. The check_runs_url property +// returns a *string when successful +func (m *CheckSuite) GetCheckRunsUrl()(*string) { + return m.check_runs_url +} +// GetConclusion gets the conclusion property value. The conclusion property +// returns a *CheckSuite_conclusion when successful +func (m *CheckSuite) GetConclusion()(*CheckSuite_conclusion) { + return m.conclusion +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *CheckSuite) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CheckSuite) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["after"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAfter(val) + } + return nil + } + res["app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetApp(val.(NullableIntegrationable)) + } + return nil + } + res["before"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBefore(val) + } + return nil + } + res["check_runs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCheckRunsUrl(val) + } + return nil + } + res["conclusion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCheckSuite_conclusion) + if err != nil { + return err + } + if val != nil { + m.SetConclusion(val.(*CheckSuite_conclusion)) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["head_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadBranch(val) + } + return nil + } + res["head_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleCommitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHeadCommit(val.(SimpleCommitable)) + } + return nil + } + res["head_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadSha(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["latest_check_runs_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLatestCheckRunsCount(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["pull_requests"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePullRequestMinimalFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PullRequestMinimalable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PullRequestMinimalable) + } + } + m.SetPullRequests(res) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(MinimalRepositoryable)) + } + return nil + } + res["rerequestable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRerequestable(val) + } + return nil + } + res["runs_rerequestable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRunsRerequestable(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCheckSuite_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*CheckSuite_status)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHeadBranch gets the head_branch property value. The head_branch property +// returns a *string when successful +func (m *CheckSuite) GetHeadBranch()(*string) { + return m.head_branch +} +// GetHeadCommit gets the head_commit property value. A commit. +// returns a SimpleCommitable when successful +func (m *CheckSuite) GetHeadCommit()(SimpleCommitable) { + return m.head_commit +} +// GetHeadSha gets the head_sha property value. The SHA of the head commit that is being checked. +// returns a *string when successful +func (m *CheckSuite) GetHeadSha()(*string) { + return m.head_sha +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *CheckSuite) GetId()(*int32) { + return m.id +} +// GetLatestCheckRunsCount gets the latest_check_runs_count property value. The latest_check_runs_count property +// returns a *int32 when successful +func (m *CheckSuite) GetLatestCheckRunsCount()(*int32) { + return m.latest_check_runs_count +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *CheckSuite) GetNodeId()(*string) { + return m.node_id +} +// GetPullRequests gets the pull_requests property value. The pull_requests property +// returns a []PullRequestMinimalable when successful +func (m *CheckSuite) GetPullRequests()([]PullRequestMinimalable) { + return m.pull_requests +} +// GetRepository gets the repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *CheckSuite) GetRepository()(MinimalRepositoryable) { + return m.repository +} +// GetRerequestable gets the rerequestable property value. The rerequestable property +// returns a *bool when successful +func (m *CheckSuite) GetRerequestable()(*bool) { + return m.rerequestable +} +// GetRunsRerequestable gets the runs_rerequestable property value. The runs_rerequestable property +// returns a *bool when successful +func (m *CheckSuite) GetRunsRerequestable()(*bool) { + return m.runs_rerequestable +} +// GetStatus gets the status property value. The phase of the lifecycle that the check suite is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check suites. +// returns a *CheckSuite_status when successful +func (m *CheckSuite) GetStatus()(*CheckSuite_status) { + return m.status +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *CheckSuite) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CheckSuite) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CheckSuite) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("after", m.GetAfter()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("app", m.GetApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("before", m.GetBefore()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("check_runs_url", m.GetCheckRunsUrl()) + if err != nil { + return err + } + } + if m.GetConclusion() != nil { + cast := (*m.GetConclusion()).String() + err := writer.WriteStringValue("conclusion", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_branch", m.GetHeadBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("head_commit", m.GetHeadCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_sha", m.GetHeadSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("latest_check_runs_count", m.GetLatestCheckRunsCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetPullRequests() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetPullRequests())) + for i, v := range m.GetPullRequests() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("pull_requests", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("rerequestable", m.GetRerequestable()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("runs_rerequestable", m.GetRunsRerequestable()) + if err != nil { + return err + } + } + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err := writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CheckSuite) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAfter sets the after property value. The after property +func (m *CheckSuite) SetAfter(value *string)() { + m.after = value +} +// SetApp sets the app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *CheckSuite) SetApp(value NullableIntegrationable)() { + m.app = value +} +// SetBefore sets the before property value. The before property +func (m *CheckSuite) SetBefore(value *string)() { + m.before = value +} +// SetCheckRunsUrl sets the check_runs_url property value. The check_runs_url property +func (m *CheckSuite) SetCheckRunsUrl(value *string)() { + m.check_runs_url = value +} +// SetConclusion sets the conclusion property value. The conclusion property +func (m *CheckSuite) SetConclusion(value *CheckSuite_conclusion)() { + m.conclusion = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *CheckSuite) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHeadBranch sets the head_branch property value. The head_branch property +func (m *CheckSuite) SetHeadBranch(value *string)() { + m.head_branch = value +} +// SetHeadCommit sets the head_commit property value. A commit. +func (m *CheckSuite) SetHeadCommit(value SimpleCommitable)() { + m.head_commit = value +} +// SetHeadSha sets the head_sha property value. The SHA of the head commit that is being checked. +func (m *CheckSuite) SetHeadSha(value *string)() { + m.head_sha = value +} +// SetId sets the id property value. The id property +func (m *CheckSuite) SetId(value *int32)() { + m.id = value +} +// SetLatestCheckRunsCount sets the latest_check_runs_count property value. The latest_check_runs_count property +func (m *CheckSuite) SetLatestCheckRunsCount(value *int32)() { + m.latest_check_runs_count = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *CheckSuite) SetNodeId(value *string)() { + m.node_id = value +} +// SetPullRequests sets the pull_requests property value. The pull_requests property +func (m *CheckSuite) SetPullRequests(value []PullRequestMinimalable)() { + m.pull_requests = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *CheckSuite) SetRepository(value MinimalRepositoryable)() { + m.repository = value +} +// SetRerequestable sets the rerequestable property value. The rerequestable property +func (m *CheckSuite) SetRerequestable(value *bool)() { + m.rerequestable = value +} +// SetRunsRerequestable sets the runs_rerequestable property value. The runs_rerequestable property +func (m *CheckSuite) SetRunsRerequestable(value *bool)() { + m.runs_rerequestable = value +} +// SetStatus sets the status property value. The phase of the lifecycle that the check suite is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check suites. +func (m *CheckSuite) SetStatus(value *CheckSuite_status)() { + m.status = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *CheckSuite) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *CheckSuite) SetUrl(value *string)() { + m.url = value +} +type CheckSuiteable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAfter()(*string) + GetApp()(NullableIntegrationable) + GetBefore()(*string) + GetCheckRunsUrl()(*string) + GetConclusion()(*CheckSuite_conclusion) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHeadBranch()(*string) + GetHeadCommit()(SimpleCommitable) + GetHeadSha()(*string) + GetId()(*int32) + GetLatestCheckRunsCount()(*int32) + GetNodeId()(*string) + GetPullRequests()([]PullRequestMinimalable) + GetRepository()(MinimalRepositoryable) + GetRerequestable()(*bool) + GetRunsRerequestable()(*bool) + GetStatus()(*CheckSuite_status) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAfter(value *string)() + SetApp(value NullableIntegrationable)() + SetBefore(value *string)() + SetCheckRunsUrl(value *string)() + SetConclusion(value *CheckSuite_conclusion)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHeadBranch(value *string)() + SetHeadCommit(value SimpleCommitable)() + SetHeadSha(value *string)() + SetId(value *int32)() + SetLatestCheckRunsCount(value *int32)() + SetNodeId(value *string)() + SetPullRequests(value []PullRequestMinimalable)() + SetRepository(value MinimalRepositoryable)() + SetRerequestable(value *bool)() + SetRunsRerequestable(value *bool)() + SetStatus(value *CheckSuite_status)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite_conclusion.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite_conclusion.go new file mode 100644 index 000000000..2ca71bb67 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite_conclusion.go @@ -0,0 +1,57 @@ +package models +import ( + "errors" +) +type CheckSuite_conclusion int + +const ( + SUCCESS_CHECKSUITE_CONCLUSION CheckSuite_conclusion = iota + FAILURE_CHECKSUITE_CONCLUSION + NEUTRAL_CHECKSUITE_CONCLUSION + CANCELLED_CHECKSUITE_CONCLUSION + SKIPPED_CHECKSUITE_CONCLUSION + TIMED_OUT_CHECKSUITE_CONCLUSION + ACTION_REQUIRED_CHECKSUITE_CONCLUSION + STARTUP_FAILURE_CHECKSUITE_CONCLUSION + STALE_CHECKSUITE_CONCLUSION +) + +func (i CheckSuite_conclusion) String() string { + return []string{"success", "failure", "neutral", "cancelled", "skipped", "timed_out", "action_required", "startup_failure", "stale"}[i] +} +func ParseCheckSuite_conclusion(v string) (any, error) { + result := SUCCESS_CHECKSUITE_CONCLUSION + switch v { + case "success": + result = SUCCESS_CHECKSUITE_CONCLUSION + case "failure": + result = FAILURE_CHECKSUITE_CONCLUSION + case "neutral": + result = NEUTRAL_CHECKSUITE_CONCLUSION + case "cancelled": + result = CANCELLED_CHECKSUITE_CONCLUSION + case "skipped": + result = SKIPPED_CHECKSUITE_CONCLUSION + case "timed_out": + result = TIMED_OUT_CHECKSUITE_CONCLUSION + case "action_required": + result = ACTION_REQUIRED_CHECKSUITE_CONCLUSION + case "startup_failure": + result = STARTUP_FAILURE_CHECKSUITE_CONCLUSION + case "stale": + result = STALE_CHECKSUITE_CONCLUSION + default: + return 0, errors.New("Unknown CheckSuite_conclusion value: " + v) + } + return &result, nil +} +func SerializeCheckSuite_conclusion(values []CheckSuite_conclusion) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CheckSuite_conclusion) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite_preference.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite_preference.go new file mode 100644 index 000000000..3c504dc9e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite_preference.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CheckSuitePreference check suite configuration preferences for a repository. +type CheckSuitePreference struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The preferences property + preferences CheckSuitePreference_preferencesable + // Minimal Repository + repository MinimalRepositoryable +} +// NewCheckSuitePreference instantiates a new CheckSuitePreference and sets the default values. +func NewCheckSuitePreference()(*CheckSuitePreference) { + m := &CheckSuitePreference{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckSuitePreferenceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckSuitePreferenceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckSuitePreference(), 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 *CheckSuitePreference) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CheckSuitePreference) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["preferences"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCheckSuitePreference_preferencesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPreferences(val.(CheckSuitePreference_preferencesable)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(MinimalRepositoryable)) + } + return nil + } + return res +} +// GetPreferences gets the preferences property value. The preferences property +// returns a CheckSuitePreference_preferencesable when successful +func (m *CheckSuitePreference) GetPreferences()(CheckSuitePreference_preferencesable) { + return m.preferences +} +// GetRepository gets the repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *CheckSuitePreference) GetRepository()(MinimalRepositoryable) { + return m.repository +} +// Serialize serializes information the current object +func (m *CheckSuitePreference) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("preferences", m.GetPreferences()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + 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 *CheckSuitePreference) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPreferences sets the preferences property value. The preferences property +func (m *CheckSuitePreference) SetPreferences(value CheckSuitePreference_preferencesable)() { + m.preferences = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *CheckSuitePreference) SetRepository(value MinimalRepositoryable)() { + m.repository = value +} +type CheckSuitePreferenceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPreferences()(CheckSuitePreference_preferencesable) + GetRepository()(MinimalRepositoryable) + SetPreferences(value CheckSuitePreference_preferencesable)() + SetRepository(value MinimalRepositoryable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite_preference_preferences.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite_preference_preferences.go new file mode 100644 index 000000000..5109327e0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite_preference_preferences.go @@ -0,0 +1,92 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CheckSuitePreference_preferences struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The auto_trigger_checks property + auto_trigger_checks []CheckSuitePreference_preferences_auto_trigger_checksable +} +// NewCheckSuitePreference_preferences instantiates a new CheckSuitePreference_preferences and sets the default values. +func NewCheckSuitePreference_preferences()(*CheckSuitePreference_preferences) { + m := &CheckSuitePreference_preferences{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckSuitePreference_preferencesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckSuitePreference_preferencesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckSuitePreference_preferences(), 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 *CheckSuitePreference_preferences) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAutoTriggerChecks gets the auto_trigger_checks property value. The auto_trigger_checks property +// returns a []CheckSuitePreference_preferences_auto_trigger_checksable when successful +func (m *CheckSuitePreference_preferences) GetAutoTriggerChecks()([]CheckSuitePreference_preferences_auto_trigger_checksable) { + return m.auto_trigger_checks +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CheckSuitePreference_preferences) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["auto_trigger_checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCheckSuitePreference_preferences_auto_trigger_checksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CheckSuitePreference_preferences_auto_trigger_checksable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CheckSuitePreference_preferences_auto_trigger_checksable) + } + } + m.SetAutoTriggerChecks(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *CheckSuitePreference_preferences) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAutoTriggerChecks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAutoTriggerChecks())) + for i, v := range m.GetAutoTriggerChecks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("auto_trigger_checks", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CheckSuitePreference_preferences) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAutoTriggerChecks sets the auto_trigger_checks property value. The auto_trigger_checks property +func (m *CheckSuitePreference_preferences) SetAutoTriggerChecks(value []CheckSuitePreference_preferences_auto_trigger_checksable)() { + m.auto_trigger_checks = value +} +type CheckSuitePreference_preferencesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAutoTriggerChecks()([]CheckSuitePreference_preferences_auto_trigger_checksable) + SetAutoTriggerChecks(value []CheckSuitePreference_preferences_auto_trigger_checksable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite_preference_preferences_auto_trigger_checks.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite_preference_preferences_auto_trigger_checks.go new file mode 100644 index 000000000..3c8509784 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite_preference_preferences_auto_trigger_checks.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CheckSuitePreference_preferences_auto_trigger_checks struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The app_id property + app_id *int32 + // The setting property + setting *bool +} +// NewCheckSuitePreference_preferences_auto_trigger_checks instantiates a new CheckSuitePreference_preferences_auto_trigger_checks and sets the default values. +func NewCheckSuitePreference_preferences_auto_trigger_checks()(*CheckSuitePreference_preferences_auto_trigger_checks) { + m := &CheckSuitePreference_preferences_auto_trigger_checks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckSuitePreference_preferences_auto_trigger_checksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckSuitePreference_preferences_auto_trigger_checksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckSuitePreference_preferences_auto_trigger_checks(), 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 *CheckSuitePreference_preferences_auto_trigger_checks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAppId gets the app_id property value. The app_id property +// returns a *int32 when successful +func (m *CheckSuitePreference_preferences_auto_trigger_checks) GetAppId()(*int32) { + return m.app_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CheckSuitePreference_preferences_auto_trigger_checks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSetting(val) + } + return nil + } + return res +} +// GetSetting gets the setting property value. The setting property +// returns a *bool when successful +func (m *CheckSuitePreference_preferences_auto_trigger_checks) GetSetting()(*bool) { + return m.setting +} +// Serialize serializes information the current object +func (m *CheckSuitePreference_preferences_auto_trigger_checks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("app_id", m.GetAppId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("setting", m.GetSetting()) + 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 *CheckSuitePreference_preferences_auto_trigger_checks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAppId sets the app_id property value. The app_id property +func (m *CheckSuitePreference_preferences_auto_trigger_checks) SetAppId(value *int32)() { + m.app_id = value +} +// SetSetting sets the setting property value. The setting property +func (m *CheckSuitePreference_preferences_auto_trigger_checks) SetSetting(value *bool)() { + m.setting = value +} +type CheckSuitePreference_preferences_auto_trigger_checksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppId()(*int32) + GetSetting()(*bool) + SetAppId(value *int32)() + SetSetting(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite_status.go new file mode 100644 index 000000000..d203b469a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/check_suite_status.go @@ -0,0 +1,49 @@ +package models +import ( + "errors" +) +// The phase of the lifecycle that the check suite is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check suites. +type CheckSuite_status int + +const ( + QUEUED_CHECKSUITE_STATUS CheckSuite_status = iota + IN_PROGRESS_CHECKSUITE_STATUS + COMPLETED_CHECKSUITE_STATUS + WAITING_CHECKSUITE_STATUS + REQUESTED_CHECKSUITE_STATUS + PENDING_CHECKSUITE_STATUS +) + +func (i CheckSuite_status) String() string { + return []string{"queued", "in_progress", "completed", "waiting", "requested", "pending"}[i] +} +func ParseCheckSuite_status(v string) (any, error) { + result := QUEUED_CHECKSUITE_STATUS + switch v { + case "queued": + result = QUEUED_CHECKSUITE_STATUS + case "in_progress": + result = IN_PROGRESS_CHECKSUITE_STATUS + case "completed": + result = COMPLETED_CHECKSUITE_STATUS + case "waiting": + result = WAITING_CHECKSUITE_STATUS + case "requested": + result = REQUESTED_CHECKSUITE_STATUS + case "pending": + result = PENDING_CHECKSUITE_STATUS + default: + return 0, errors.New("Unknown CheckSuite_status value: " + v) + } + return &result, nil +} +func SerializeCheckSuite_status(values []CheckSuite_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CheckSuite_status) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/classroom.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/classroom.go new file mode 100644 index 000000000..d37a5f283 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/classroom.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Classroom a GitHub Classroom classroom +type Classroom struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether classroom is archived. + archived *bool + // Unique identifier of the classroom. + id *int32 + // The name of the classroom. + name *string + // A GitHub organization. + organization SimpleClassroomOrganizationable + // The URL of the classroom on GitHub Classroom. + url *string +} +// NewClassroom instantiates a new Classroom and sets the default values. +func NewClassroom()(*Classroom) { + m := &Classroom{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateClassroomFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateClassroomFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewClassroom(), 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 *Classroom) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArchived gets the archived property value. Whether classroom is archived. +// returns a *bool when successful +func (m *Classroom) GetArchived()(*bool) { + return m.archived +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Classroom) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleClassroomOrganizationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrganization(val.(SimpleClassroomOrganizationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the classroom. +// returns a *int32 when successful +func (m *Classroom) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name of the classroom. +// returns a *string when successful +func (m *Classroom) GetName()(*string) { + return m.name +} +// GetOrganization gets the organization property value. A GitHub organization. +// returns a SimpleClassroomOrganizationable when successful +func (m *Classroom) GetOrganization()(SimpleClassroomOrganizationable) { + return m.organization +} +// GetUrl gets the url property value. The URL of the classroom on GitHub Classroom. +// returns a *string when successful +func (m *Classroom) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Classroom) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("organization", m.GetOrganization()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Classroom) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArchived sets the archived property value. Whether classroom is archived. +func (m *Classroom) SetArchived(value *bool)() { + m.archived = value +} +// SetId sets the id property value. Unique identifier of the classroom. +func (m *Classroom) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name of the classroom. +func (m *Classroom) SetName(value *string)() { + m.name = value +} +// SetOrganization sets the organization property value. A GitHub organization. +func (m *Classroom) SetOrganization(value SimpleClassroomOrganizationable)() { + m.organization = value +} +// SetUrl sets the url property value. The URL of the classroom on GitHub Classroom. +func (m *Classroom) SetUrl(value *string)() { + m.url = value +} +type Classroomable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArchived()(*bool) + GetId()(*int32) + GetName()(*string) + GetOrganization()(SimpleClassroomOrganizationable) + GetUrl()(*string) + SetArchived(value *bool)() + SetId(value *int32)() + SetName(value *string)() + SetOrganization(value SimpleClassroomOrganizationable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/classroom_accepted_assignment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/classroom_accepted_assignment.go new file mode 100644 index 000000000..3590afcf6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/classroom_accepted_assignment.go @@ -0,0 +1,296 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ClassroomAcceptedAssignment a GitHub Classroom accepted assignment +type ClassroomAcceptedAssignment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub Classroom assignment + assignment SimpleClassroomAssignmentable + // Count of student commits. + commit_count *int32 + // Most recent grade. + grade *string + // Unique identifier of the repository. + id *int32 + // Whether a submission passed. + passing *bool + // A GitHub repository view for Classroom + repository SimpleClassroomRepositoryable + // The students property + students []SimpleClassroomUserable + // Whether an accepted assignment has been submitted. + submitted *bool +} +// NewClassroomAcceptedAssignment instantiates a new ClassroomAcceptedAssignment and sets the default values. +func NewClassroomAcceptedAssignment()(*ClassroomAcceptedAssignment) { + m := &ClassroomAcceptedAssignment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateClassroomAcceptedAssignmentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateClassroomAcceptedAssignmentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewClassroomAcceptedAssignment(), 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 *ClassroomAcceptedAssignment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignment gets the assignment property value. A GitHub Classroom assignment +// returns a SimpleClassroomAssignmentable when successful +func (m *ClassroomAcceptedAssignment) GetAssignment()(SimpleClassroomAssignmentable) { + return m.assignment +} +// GetCommitCount gets the commit_count property value. Count of student commits. +// returns a *int32 when successful +func (m *ClassroomAcceptedAssignment) GetCommitCount()(*int32) { + return m.commit_count +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ClassroomAcceptedAssignment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["assignment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleClassroomAssignmentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignment(val.(SimpleClassroomAssignmentable)) + } + return nil + } + res["commit_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCommitCount(val) + } + return nil + } + res["grade"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGrade(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["passing"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPassing(val) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleClassroomRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(SimpleClassroomRepositoryable)) + } + return nil + } + res["students"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleClassroomUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleClassroomUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleClassroomUserable) + } + } + m.SetStudents(res) + } + return nil + } + res["submitted"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSubmitted(val) + } + return nil + } + return res +} +// GetGrade gets the grade property value. Most recent grade. +// returns a *string when successful +func (m *ClassroomAcceptedAssignment) GetGrade()(*string) { + return m.grade +} +// GetId gets the id property value. Unique identifier of the repository. +// returns a *int32 when successful +func (m *ClassroomAcceptedAssignment) GetId()(*int32) { + return m.id +} +// GetPassing gets the passing property value. Whether a submission passed. +// returns a *bool when successful +func (m *ClassroomAcceptedAssignment) GetPassing()(*bool) { + return m.passing +} +// GetRepository gets the repository property value. A GitHub repository view for Classroom +// returns a SimpleClassroomRepositoryable when successful +func (m *ClassroomAcceptedAssignment) GetRepository()(SimpleClassroomRepositoryable) { + return m.repository +} +// GetStudents gets the students property value. The students property +// returns a []SimpleClassroomUserable when successful +func (m *ClassroomAcceptedAssignment) GetStudents()([]SimpleClassroomUserable) { + return m.students +} +// GetSubmitted gets the submitted property value. Whether an accepted assignment has been submitted. +// returns a *bool when successful +func (m *ClassroomAcceptedAssignment) GetSubmitted()(*bool) { + return m.submitted +} +// Serialize serializes information the current object +func (m *ClassroomAcceptedAssignment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("assignment", m.GetAssignment()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("commit_count", m.GetCommitCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("grade", m.GetGrade()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("passing", m.GetPassing()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + if m.GetStudents() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetStudents())) + for i, v := range m.GetStudents() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("students", cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("submitted", m.GetSubmitted()) + 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 *ClassroomAcceptedAssignment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignment sets the assignment property value. A GitHub Classroom assignment +func (m *ClassroomAcceptedAssignment) SetAssignment(value SimpleClassroomAssignmentable)() { + m.assignment = value +} +// SetCommitCount sets the commit_count property value. Count of student commits. +func (m *ClassroomAcceptedAssignment) SetCommitCount(value *int32)() { + m.commit_count = value +} +// SetGrade sets the grade property value. Most recent grade. +func (m *ClassroomAcceptedAssignment) SetGrade(value *string)() { + m.grade = value +} +// SetId sets the id property value. Unique identifier of the repository. +func (m *ClassroomAcceptedAssignment) SetId(value *int32)() { + m.id = value +} +// SetPassing sets the passing property value. Whether a submission passed. +func (m *ClassroomAcceptedAssignment) SetPassing(value *bool)() { + m.passing = value +} +// SetRepository sets the repository property value. A GitHub repository view for Classroom +func (m *ClassroomAcceptedAssignment) SetRepository(value SimpleClassroomRepositoryable)() { + m.repository = value +} +// SetStudents sets the students property value. The students property +func (m *ClassroomAcceptedAssignment) SetStudents(value []SimpleClassroomUserable)() { + m.students = value +} +// SetSubmitted sets the submitted property value. Whether an accepted assignment has been submitted. +func (m *ClassroomAcceptedAssignment) SetSubmitted(value *bool)() { + m.submitted = value +} +type ClassroomAcceptedAssignmentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssignment()(SimpleClassroomAssignmentable) + GetCommitCount()(*int32) + GetGrade()(*string) + GetId()(*int32) + GetPassing()(*bool) + GetRepository()(SimpleClassroomRepositoryable) + GetStudents()([]SimpleClassroomUserable) + GetSubmitted()(*bool) + SetAssignment(value SimpleClassroomAssignmentable)() + SetCommitCount(value *int32)() + SetGrade(value *string)() + SetId(value *int32)() + SetPassing(value *bool)() + SetRepository(value SimpleClassroomRepositoryable)() + SetStudents(value []SimpleClassroomUserable)() + SetSubmitted(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/classroom_assignment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/classroom_assignment.go new file mode 100644 index 000000000..889b13610 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/classroom_assignment.go @@ -0,0 +1,605 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ClassroomAssignment a GitHub Classroom assignment +type ClassroomAssignment struct { + // The number of students that have accepted the assignment. + accepted *int32 + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub Classroom classroom + classroom Classroomable + // The time at which the assignment is due. + deadline *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The selected editor for the assignment. + editor *string + // Whether feedback pull request will be created when a student accepts the assignment. + feedback_pull_requests_enabled *bool + // Unique identifier of the repository. + id *int32 + // Whether the invitation link is enabled. Visiting an enabled invitation link will accept the assignment. + invitations_enabled *bool + // The link that a student can use to accept the assignment. + invite_link *string + // The programming language used in the assignment. + language *string + // The maximum allowable members per team. + max_members *int32 + // The maximum allowable teams for the assignment. + max_teams *int32 + // The number of students that have passed the assignment. + passing *int32 + // Whether an accepted assignment creates a public repository. + public_repo *bool + // Sluggified name of the assignment. + slug *string + // A GitHub repository view for Classroom + starter_code_repository SimpleClassroomRepositoryable + // Whether students are admins on created repository when a student accepts the assignment. + students_are_repo_admins *bool + // The number of students that have submitted the assignment. + submitted *int32 + // Assignment title. + title *string + // Whether it's a group assignment or individual assignment. + typeEscaped *ClassroomAssignment_type +} +// NewClassroomAssignment instantiates a new ClassroomAssignment and sets the default values. +func NewClassroomAssignment()(*ClassroomAssignment) { + m := &ClassroomAssignment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateClassroomAssignmentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateClassroomAssignmentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewClassroomAssignment(), nil +} +// GetAccepted gets the accepted property value. The number of students that have accepted the assignment. +// returns a *int32 when successful +func (m *ClassroomAssignment) GetAccepted()(*int32) { + return m.accepted +} +// 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 *ClassroomAssignment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClassroom gets the classroom property value. A GitHub Classroom classroom +// returns a Classroomable when successful +func (m *ClassroomAssignment) GetClassroom()(Classroomable) { + return m.classroom +} +// GetDeadline gets the deadline property value. The time at which the assignment is due. +// returns a *Time when successful +func (m *ClassroomAssignment) GetDeadline()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.deadline +} +// GetEditor gets the editor property value. The selected editor for the assignment. +// returns a *string when successful +func (m *ClassroomAssignment) GetEditor()(*string) { + return m.editor +} +// GetFeedbackPullRequestsEnabled gets the feedback_pull_requests_enabled property value. Whether feedback pull request will be created when a student accepts the assignment. +// returns a *bool when successful +func (m *ClassroomAssignment) GetFeedbackPullRequestsEnabled()(*bool) { + return m.feedback_pull_requests_enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ClassroomAssignment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["accepted"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAccepted(val) + } + return nil + } + res["classroom"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateClassroomFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetClassroom(val.(Classroomable)) + } + return nil + } + res["deadline"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDeadline(val) + } + return nil + } + res["editor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEditor(val) + } + return nil + } + res["feedback_pull_requests_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFeedbackPullRequestsEnabled(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["invitations_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetInvitationsEnabled(val) + } + return nil + } + res["invite_link"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInviteLink(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["max_members"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMaxMembers(val) + } + return nil + } + res["max_teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMaxTeams(val) + } + return nil + } + res["passing"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPassing(val) + } + return nil + } + res["public_repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicRepo(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["starter_code_repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleClassroomRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetStarterCodeRepository(val.(SimpleClassroomRepositoryable)) + } + return nil + } + res["students_are_repo_admins"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetStudentsAreRepoAdmins(val) + } + return nil + } + res["submitted"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSubmitted(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseClassroomAssignment_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*ClassroomAssignment_type)) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the repository. +// returns a *int32 when successful +func (m *ClassroomAssignment) GetId()(*int32) { + return m.id +} +// GetInvitationsEnabled gets the invitations_enabled property value. Whether the invitation link is enabled. Visiting an enabled invitation link will accept the assignment. +// returns a *bool when successful +func (m *ClassroomAssignment) GetInvitationsEnabled()(*bool) { + return m.invitations_enabled +} +// GetInviteLink gets the invite_link property value. The link that a student can use to accept the assignment. +// returns a *string when successful +func (m *ClassroomAssignment) GetInviteLink()(*string) { + return m.invite_link +} +// GetLanguage gets the language property value. The programming language used in the assignment. +// returns a *string when successful +func (m *ClassroomAssignment) GetLanguage()(*string) { + return m.language +} +// GetMaxMembers gets the max_members property value. The maximum allowable members per team. +// returns a *int32 when successful +func (m *ClassroomAssignment) GetMaxMembers()(*int32) { + return m.max_members +} +// GetMaxTeams gets the max_teams property value. The maximum allowable teams for the assignment. +// returns a *int32 when successful +func (m *ClassroomAssignment) GetMaxTeams()(*int32) { + return m.max_teams +} +// GetPassing gets the passing property value. The number of students that have passed the assignment. +// returns a *int32 when successful +func (m *ClassroomAssignment) GetPassing()(*int32) { + return m.passing +} +// GetPublicRepo gets the public_repo property value. Whether an accepted assignment creates a public repository. +// returns a *bool when successful +func (m *ClassroomAssignment) GetPublicRepo()(*bool) { + return m.public_repo +} +// GetSlug gets the slug property value. Sluggified name of the assignment. +// returns a *string when successful +func (m *ClassroomAssignment) GetSlug()(*string) { + return m.slug +} +// GetStarterCodeRepository gets the starter_code_repository property value. A GitHub repository view for Classroom +// returns a SimpleClassroomRepositoryable when successful +func (m *ClassroomAssignment) GetStarterCodeRepository()(SimpleClassroomRepositoryable) { + return m.starter_code_repository +} +// GetStudentsAreRepoAdmins gets the students_are_repo_admins property value. Whether students are admins on created repository when a student accepts the assignment. +// returns a *bool when successful +func (m *ClassroomAssignment) GetStudentsAreRepoAdmins()(*bool) { + return m.students_are_repo_admins +} +// GetSubmitted gets the submitted property value. The number of students that have submitted the assignment. +// returns a *int32 when successful +func (m *ClassroomAssignment) GetSubmitted()(*int32) { + return m.submitted +} +// GetTitle gets the title property value. Assignment title. +// returns a *string when successful +func (m *ClassroomAssignment) GetTitle()(*string) { + return m.title +} +// GetTypeEscaped gets the type property value. Whether it's a group assignment or individual assignment. +// returns a *ClassroomAssignment_type when successful +func (m *ClassroomAssignment) GetTypeEscaped()(*ClassroomAssignment_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *ClassroomAssignment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("accepted", m.GetAccepted()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("classroom", m.GetClassroom()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("deadline", m.GetDeadline()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("editor", m.GetEditor()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("feedback_pull_requests_enabled", m.GetFeedbackPullRequestsEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("invitations_enabled", m.GetInvitationsEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("invite_link", m.GetInviteLink()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("max_members", m.GetMaxMembers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("max_teams", m.GetMaxTeams()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("passing", m.GetPassing()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("public_repo", m.GetPublicRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("starter_code_repository", m.GetStarterCodeRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("students_are_repo_admins", m.GetStudentsAreRepoAdmins()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("submitted", m.GetSubmitted()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccepted sets the accepted property value. The number of students that have accepted the assignment. +func (m *ClassroomAssignment) SetAccepted(value *int32)() { + m.accepted = value +} +// 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 *ClassroomAssignment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClassroom sets the classroom property value. A GitHub Classroom classroom +func (m *ClassroomAssignment) SetClassroom(value Classroomable)() { + m.classroom = value +} +// SetDeadline sets the deadline property value. The time at which the assignment is due. +func (m *ClassroomAssignment) SetDeadline(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.deadline = value +} +// SetEditor sets the editor property value. The selected editor for the assignment. +func (m *ClassroomAssignment) SetEditor(value *string)() { + m.editor = value +} +// SetFeedbackPullRequestsEnabled sets the feedback_pull_requests_enabled property value. Whether feedback pull request will be created when a student accepts the assignment. +func (m *ClassroomAssignment) SetFeedbackPullRequestsEnabled(value *bool)() { + m.feedback_pull_requests_enabled = value +} +// SetId sets the id property value. Unique identifier of the repository. +func (m *ClassroomAssignment) SetId(value *int32)() { + m.id = value +} +// SetInvitationsEnabled sets the invitations_enabled property value. Whether the invitation link is enabled. Visiting an enabled invitation link will accept the assignment. +func (m *ClassroomAssignment) SetInvitationsEnabled(value *bool)() { + m.invitations_enabled = value +} +// SetInviteLink sets the invite_link property value. The link that a student can use to accept the assignment. +func (m *ClassroomAssignment) SetInviteLink(value *string)() { + m.invite_link = value +} +// SetLanguage sets the language property value. The programming language used in the assignment. +func (m *ClassroomAssignment) SetLanguage(value *string)() { + m.language = value +} +// SetMaxMembers sets the max_members property value. The maximum allowable members per team. +func (m *ClassroomAssignment) SetMaxMembers(value *int32)() { + m.max_members = value +} +// SetMaxTeams sets the max_teams property value. The maximum allowable teams for the assignment. +func (m *ClassroomAssignment) SetMaxTeams(value *int32)() { + m.max_teams = value +} +// SetPassing sets the passing property value. The number of students that have passed the assignment. +func (m *ClassroomAssignment) SetPassing(value *int32)() { + m.passing = value +} +// SetPublicRepo sets the public_repo property value. Whether an accepted assignment creates a public repository. +func (m *ClassroomAssignment) SetPublicRepo(value *bool)() { + m.public_repo = value +} +// SetSlug sets the slug property value. Sluggified name of the assignment. +func (m *ClassroomAssignment) SetSlug(value *string)() { + m.slug = value +} +// SetStarterCodeRepository sets the starter_code_repository property value. A GitHub repository view for Classroom +func (m *ClassroomAssignment) SetStarterCodeRepository(value SimpleClassroomRepositoryable)() { + m.starter_code_repository = value +} +// SetStudentsAreRepoAdmins sets the students_are_repo_admins property value. Whether students are admins on created repository when a student accepts the assignment. +func (m *ClassroomAssignment) SetStudentsAreRepoAdmins(value *bool)() { + m.students_are_repo_admins = value +} +// SetSubmitted sets the submitted property value. The number of students that have submitted the assignment. +func (m *ClassroomAssignment) SetSubmitted(value *int32)() { + m.submitted = value +} +// SetTitle sets the title property value. Assignment title. +func (m *ClassroomAssignment) SetTitle(value *string)() { + m.title = value +} +// SetTypeEscaped sets the type property value. Whether it's a group assignment or individual assignment. +func (m *ClassroomAssignment) SetTypeEscaped(value *ClassroomAssignment_type)() { + m.typeEscaped = value +} +type ClassroomAssignmentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccepted()(*int32) + GetClassroom()(Classroomable) + GetDeadline()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEditor()(*string) + GetFeedbackPullRequestsEnabled()(*bool) + GetId()(*int32) + GetInvitationsEnabled()(*bool) + GetInviteLink()(*string) + GetLanguage()(*string) + GetMaxMembers()(*int32) + GetMaxTeams()(*int32) + GetPassing()(*int32) + GetPublicRepo()(*bool) + GetSlug()(*string) + GetStarterCodeRepository()(SimpleClassroomRepositoryable) + GetStudentsAreRepoAdmins()(*bool) + GetSubmitted()(*int32) + GetTitle()(*string) + GetTypeEscaped()(*ClassroomAssignment_type) + SetAccepted(value *int32)() + SetClassroom(value Classroomable)() + SetDeadline(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEditor(value *string)() + SetFeedbackPullRequestsEnabled(value *bool)() + SetId(value *int32)() + SetInvitationsEnabled(value *bool)() + SetInviteLink(value *string)() + SetLanguage(value *string)() + SetMaxMembers(value *int32)() + SetMaxTeams(value *int32)() + SetPassing(value *int32)() + SetPublicRepo(value *bool)() + SetSlug(value *string)() + SetStarterCodeRepository(value SimpleClassroomRepositoryable)() + SetStudentsAreRepoAdmins(value *bool)() + SetSubmitted(value *int32)() + SetTitle(value *string)() + SetTypeEscaped(value *ClassroomAssignment_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/classroom_assignment_grade.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/classroom_assignment_grade.go new file mode 100644 index 000000000..66d3c635f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/classroom_assignment_grade.go @@ -0,0 +1,371 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ClassroomAssignmentGrade grade for a student or groups GitHub Classroom assignment +type ClassroomAssignmentGrade struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Name of the assignment + assignment_name *string + // URL of the assignment + assignment_url *string + // GitHub username of the student + github_username *string + // If a group assignment, name of the group the student is in + group_name *string + // Number of points available for the assignment + points_available *int32 + // Number of points awarded to the student + points_awarded *int32 + // Roster identifier of the student + roster_identifier *string + // URL of the starter code for the assignment + starter_code_url *string + // Name of the student's assignment repository + student_repository_name *string + // URL of the student's assignment repository + student_repository_url *string + // Timestamp of the student's assignment submission + submission_timestamp *string +} +// NewClassroomAssignmentGrade instantiates a new ClassroomAssignmentGrade and sets the default values. +func NewClassroomAssignmentGrade()(*ClassroomAssignmentGrade) { + m := &ClassroomAssignmentGrade{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateClassroomAssignmentGradeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateClassroomAssignmentGradeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewClassroomAssignmentGrade(), 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 *ClassroomAssignmentGrade) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignmentName gets the assignment_name property value. Name of the assignment +// returns a *string when successful +func (m *ClassroomAssignmentGrade) GetAssignmentName()(*string) { + return m.assignment_name +} +// GetAssignmentUrl gets the assignment_url property value. URL of the assignment +// returns a *string when successful +func (m *ClassroomAssignmentGrade) GetAssignmentUrl()(*string) { + return m.assignment_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ClassroomAssignmentGrade) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["assignment_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssignmentName(val) + } + return nil + } + res["assignment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssignmentUrl(val) + } + return nil + } + res["github_username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGithubUsername(val) + } + return nil + } + res["group_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGroupName(val) + } + return nil + } + res["points_available"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPointsAvailable(val) + } + return nil + } + res["points_awarded"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPointsAwarded(val) + } + return nil + } + res["roster_identifier"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRosterIdentifier(val) + } + return nil + } + res["starter_code_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarterCodeUrl(val) + } + return nil + } + res["student_repository_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStudentRepositoryName(val) + } + return nil + } + res["student_repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStudentRepositoryUrl(val) + } + return nil + } + res["submission_timestamp"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubmissionTimestamp(val) + } + return nil + } + return res +} +// GetGithubUsername gets the github_username property value. GitHub username of the student +// returns a *string when successful +func (m *ClassroomAssignmentGrade) GetGithubUsername()(*string) { + return m.github_username +} +// GetGroupName gets the group_name property value. If a group assignment, name of the group the student is in +// returns a *string when successful +func (m *ClassroomAssignmentGrade) GetGroupName()(*string) { + return m.group_name +} +// GetPointsAvailable gets the points_available property value. Number of points available for the assignment +// returns a *int32 when successful +func (m *ClassroomAssignmentGrade) GetPointsAvailable()(*int32) { + return m.points_available +} +// GetPointsAwarded gets the points_awarded property value. Number of points awarded to the student +// returns a *int32 when successful +func (m *ClassroomAssignmentGrade) GetPointsAwarded()(*int32) { + return m.points_awarded +} +// GetRosterIdentifier gets the roster_identifier property value. Roster identifier of the student +// returns a *string when successful +func (m *ClassroomAssignmentGrade) GetRosterIdentifier()(*string) { + return m.roster_identifier +} +// GetStarterCodeUrl gets the starter_code_url property value. URL of the starter code for the assignment +// returns a *string when successful +func (m *ClassroomAssignmentGrade) GetStarterCodeUrl()(*string) { + return m.starter_code_url +} +// GetStudentRepositoryName gets the student_repository_name property value. Name of the student's assignment repository +// returns a *string when successful +func (m *ClassroomAssignmentGrade) GetStudentRepositoryName()(*string) { + return m.student_repository_name +} +// GetStudentRepositoryUrl gets the student_repository_url property value. URL of the student's assignment repository +// returns a *string when successful +func (m *ClassroomAssignmentGrade) GetStudentRepositoryUrl()(*string) { + return m.student_repository_url +} +// GetSubmissionTimestamp gets the submission_timestamp property value. Timestamp of the student's assignment submission +// returns a *string when successful +func (m *ClassroomAssignmentGrade) GetSubmissionTimestamp()(*string) { + return m.submission_timestamp +} +// Serialize serializes information the current object +func (m *ClassroomAssignmentGrade) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("assignment_name", m.GetAssignmentName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignment_url", m.GetAssignmentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("github_username", m.GetGithubUsername()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("group_name", m.GetGroupName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("points_available", m.GetPointsAvailable()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("points_awarded", m.GetPointsAwarded()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("roster_identifier", m.GetRosterIdentifier()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starter_code_url", m.GetStarterCodeUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("student_repository_name", m.GetStudentRepositoryName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("student_repository_url", m.GetStudentRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("submission_timestamp", m.GetSubmissionTimestamp()) + 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 *ClassroomAssignmentGrade) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignmentName sets the assignment_name property value. Name of the assignment +func (m *ClassroomAssignmentGrade) SetAssignmentName(value *string)() { + m.assignment_name = value +} +// SetAssignmentUrl sets the assignment_url property value. URL of the assignment +func (m *ClassroomAssignmentGrade) SetAssignmentUrl(value *string)() { + m.assignment_url = value +} +// SetGithubUsername sets the github_username property value. GitHub username of the student +func (m *ClassroomAssignmentGrade) SetGithubUsername(value *string)() { + m.github_username = value +} +// SetGroupName sets the group_name property value. If a group assignment, name of the group the student is in +func (m *ClassroomAssignmentGrade) SetGroupName(value *string)() { + m.group_name = value +} +// SetPointsAvailable sets the points_available property value. Number of points available for the assignment +func (m *ClassroomAssignmentGrade) SetPointsAvailable(value *int32)() { + m.points_available = value +} +// SetPointsAwarded sets the points_awarded property value. Number of points awarded to the student +func (m *ClassroomAssignmentGrade) SetPointsAwarded(value *int32)() { + m.points_awarded = value +} +// SetRosterIdentifier sets the roster_identifier property value. Roster identifier of the student +func (m *ClassroomAssignmentGrade) SetRosterIdentifier(value *string)() { + m.roster_identifier = value +} +// SetStarterCodeUrl sets the starter_code_url property value. URL of the starter code for the assignment +func (m *ClassroomAssignmentGrade) SetStarterCodeUrl(value *string)() { + m.starter_code_url = value +} +// SetStudentRepositoryName sets the student_repository_name property value. Name of the student's assignment repository +func (m *ClassroomAssignmentGrade) SetStudentRepositoryName(value *string)() { + m.student_repository_name = value +} +// SetStudentRepositoryUrl sets the student_repository_url property value. URL of the student's assignment repository +func (m *ClassroomAssignmentGrade) SetStudentRepositoryUrl(value *string)() { + m.student_repository_url = value +} +// SetSubmissionTimestamp sets the submission_timestamp property value. Timestamp of the student's assignment submission +func (m *ClassroomAssignmentGrade) SetSubmissionTimestamp(value *string)() { + m.submission_timestamp = value +} +type ClassroomAssignmentGradeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssignmentName()(*string) + GetAssignmentUrl()(*string) + GetGithubUsername()(*string) + GetGroupName()(*string) + GetPointsAvailable()(*int32) + GetPointsAwarded()(*int32) + GetRosterIdentifier()(*string) + GetStarterCodeUrl()(*string) + GetStudentRepositoryName()(*string) + GetStudentRepositoryUrl()(*string) + GetSubmissionTimestamp()(*string) + SetAssignmentName(value *string)() + SetAssignmentUrl(value *string)() + SetGithubUsername(value *string)() + SetGroupName(value *string)() + SetPointsAvailable(value *int32)() + SetPointsAwarded(value *int32)() + SetRosterIdentifier(value *string)() + SetStarterCodeUrl(value *string)() + SetStudentRepositoryName(value *string)() + SetStudentRepositoryUrl(value *string)() + SetSubmissionTimestamp(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/classroom_assignment_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/classroom_assignment_type.go new file mode 100644 index 000000000..b4b65e8bd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/classroom_assignment_type.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// Whether it's a group assignment or individual assignment. +type ClassroomAssignment_type int + +const ( + INDIVIDUAL_CLASSROOMASSIGNMENT_TYPE ClassroomAssignment_type = iota + GROUP_CLASSROOMASSIGNMENT_TYPE +) + +func (i ClassroomAssignment_type) String() string { + return []string{"individual", "group"}[i] +} +func ParseClassroomAssignment_type(v string) (any, error) { + result := INDIVIDUAL_CLASSROOMASSIGNMENT_TYPE + switch v { + case "individual": + result = INDIVIDUAL_CLASSROOMASSIGNMENT_TYPE + case "group": + result = GROUP_CLASSROOMASSIGNMENT_TYPE + default: + return 0, errors.New("Unknown ClassroomAssignment_type value: " + v) + } + return &result, nil +} +func SerializeClassroomAssignment_type(values []ClassroomAssignment_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ClassroomAssignment_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/clone_traffic.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/clone_traffic.go new file mode 100644 index 000000000..9dd9525ac --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/clone_traffic.go @@ -0,0 +1,151 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CloneTraffic clone Traffic +type CloneTraffic struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The clones property + clones []Trafficable + // The count property + count *int32 + // The uniques property + uniques *int32 +} +// NewCloneTraffic instantiates a new CloneTraffic and sets the default values. +func NewCloneTraffic()(*CloneTraffic) { + m := &CloneTraffic{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCloneTrafficFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCloneTrafficFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCloneTraffic(), 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 *CloneTraffic) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClones gets the clones property value. The clones property +// returns a []Trafficable when successful +func (m *CloneTraffic) GetClones()([]Trafficable) { + return m.clones +} +// GetCount gets the count property value. The count property +// returns a *int32 when successful +func (m *CloneTraffic) GetCount()(*int32) { + return m.count +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CloneTraffic) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["clones"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTrafficFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Trafficable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Trafficable) + } + } + m.SetClones(res) + } + return nil + } + res["count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCount(val) + } + return nil + } + res["uniques"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUniques(val) + } + return nil + } + return res +} +// GetUniques gets the uniques property value. The uniques property +// returns a *int32 when successful +func (m *CloneTraffic) GetUniques()(*int32) { + return m.uniques +} +// Serialize serializes information the current object +func (m *CloneTraffic) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetClones() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetClones())) + for i, v := range m.GetClones() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("clones", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("count", m.GetCount()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("uniques", m.GetUniques()) + 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 *CloneTraffic) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClones sets the clones property value. The clones property +func (m *CloneTraffic) SetClones(value []Trafficable)() { + m.clones = value +} +// SetCount sets the count property value. The count property +func (m *CloneTraffic) SetCount(value *int32)() { + m.count = value +} +// SetUniques sets the uniques property value. The uniques property +func (m *CloneTraffic) SetUniques(value *int32)() { + m.uniques = value +} +type CloneTrafficable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClones()([]Trafficable) + GetCount()(*int32) + GetUniques()(*int32) + SetClones(value []Trafficable)() + SetCount(value *int32)() + SetUniques(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code.go new file mode 100644 index 000000000..f5b14c369 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code.go @@ -0,0 +1,208 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Code struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The fragment property + fragment *string + // The matches property + matches []Code_matchesable + // The object_type property + object_type *string + // The object_url property + object_url *string + // The property property + property *string +} +// NewCode instantiates a new Code and sets the default values. +func NewCode()(*Code) { + m := &Code{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCode(), 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 *Code) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Code) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["fragment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFragment(val) + } + return nil + } + res["matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCode_matchesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Code_matchesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Code_matchesable) + } + } + m.SetMatches(res) + } + return nil + } + res["object_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectType(val) + } + return nil + } + res["object_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectUrl(val) + } + return nil + } + res["property"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProperty(val) + } + return nil + } + return res +} +// GetFragment gets the fragment property value. The fragment property +// returns a *string when successful +func (m *Code) GetFragment()(*string) { + return m.fragment +} +// GetMatches gets the matches property value. The matches property +// returns a []Code_matchesable when successful +func (m *Code) GetMatches()([]Code_matchesable) { + return m.matches +} +// GetObjectType gets the object_type property value. The object_type property +// returns a *string when successful +func (m *Code) GetObjectType()(*string) { + return m.object_type +} +// GetObjectUrl gets the object_url property value. The object_url property +// returns a *string when successful +func (m *Code) GetObjectUrl()(*string) { + return m.object_url +} +// GetProperty gets the property property value. The property property +// returns a *string when successful +func (m *Code) GetProperty()(*string) { + return m.property +} +// Serialize serializes information the current object +func (m *Code) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("fragment", m.GetFragment()) + if err != nil { + return err + } + } + if m.GetMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMatches())) + for i, v := range m.GetMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_type", m.GetObjectType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_url", m.GetObjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("property", m.GetProperty()) + 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 *Code) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFragment sets the fragment property value. The fragment property +func (m *Code) SetFragment(value *string)() { + m.fragment = value +} +// SetMatches sets the matches property value. The matches property +func (m *Code) SetMatches(value []Code_matchesable)() { + m.matches = value +} +// SetObjectType sets the object_type property value. The object_type property +func (m *Code) SetObjectType(value *string)() { + m.object_type = value +} +// SetObjectUrl sets the object_url property value. The object_url property +func (m *Code) SetObjectUrl(value *string)() { + m.object_url = value +} +// SetProperty sets the property property value. The property property +func (m *Code) SetProperty(value *string)() { + m.property = value +} +type Codeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFragment()(*string) + GetMatches()([]Code_matchesable) + GetObjectType()(*string) + GetObjectUrl()(*string) + GetProperty()(*string) + SetFragment(value *string)() + SetMatches(value []Code_matchesable)() + SetObjectType(value *string)() + SetObjectUrl(value *string)() + SetProperty(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code503_error.go new file mode 100644 index 000000000..f54f2baed --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Code503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewCode503Error instantiates a new Code503Error and sets the default values. +func NewCode503Error()(*Code503Error) { + m := &Code503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCode503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCode503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCode503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Code503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Code503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Code503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Code503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Code503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Code503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Code503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *Code503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Code503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Code503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Code503Error) SetMessage(value *string)() { + m.message = value +} +type Code503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_matches.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_matches.go new file mode 100644 index 000000000..48e24f513 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_matches.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Code_matches struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The indices property + indices []int32 + // The text property + text *string +} +// NewCode_matches instantiates a new Code_matches and sets the default values. +func NewCode_matches()(*Code_matches) { + m := &Code_matches{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCode_matchesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCode_matchesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCode_matches(), 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 *Code_matches) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Code_matches) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["indices"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetIndices(res) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetIndices gets the indices property value. The indices property +// returns a []int32 when successful +func (m *Code_matches) GetIndices()([]int32) { + return m.indices +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *Code_matches) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *Code_matches) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIndices() != nil { + err := writer.WriteCollectionOfInt32Values("indices", m.GetIndices()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + 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 *Code_matches) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIndices sets the indices property value. The indices property +func (m *Code_matches) SetIndices(value []int32)() { + m.indices = value +} +// SetText sets the text property value. The text property +func (m *Code_matches) SetText(value *string)() { + m.text = value +} +type Code_matchesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIndices()([]int32) + GetText()(*string) + SetIndices(value []int32)() + SetText(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_of_conduct.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_of_conduct.go new file mode 100644 index 000000000..cfe785f78 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_of_conduct.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeOfConduct code Of Conduct +type CodeOfConduct struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The body property + body *string + // The html_url property + html_url *string + // The key property + key *string + // The name property + name *string + // The url property + url *string +} +// NewCodeOfConduct instantiates a new CodeOfConduct and sets the default values. +func NewCodeOfConduct()(*CodeOfConduct) { + m := &CodeOfConduct{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeOfConductFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeOfConductFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeOfConduct(), 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 *CodeOfConduct) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *CodeOfConduct) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeOfConduct) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CodeOfConduct) GetHtmlUrl()(*string) { + return m.html_url +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *CodeOfConduct) GetKey()(*string) { + return m.key +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *CodeOfConduct) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CodeOfConduct) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CodeOfConduct) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CodeOfConduct) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The body property +func (m *CodeOfConduct) SetBody(value *string)() { + m.body = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CodeOfConduct) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetKey sets the key property value. The key property +func (m *CodeOfConduct) SetKey(value *string)() { + m.key = value +} +// SetName sets the name property value. The name property +func (m *CodeOfConduct) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url property +func (m *CodeOfConduct) SetUrl(value *string)() { + m.url = value +} +type CodeOfConductable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetHtmlUrl()(*string) + GetKey()(*string) + GetName()(*string) + GetUrl()(*string) + SetBody(value *string)() + SetHtmlUrl(value *string)() + SetKey(value *string)() + SetName(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_of_conduct_simple.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_of_conduct_simple.go new file mode 100644 index 000000000..81e592433 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_of_conduct_simple.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeOfConductSimple code of Conduct Simple +type CodeOfConductSimple struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html_url property + html_url *string + // The key property + key *string + // The name property + name *string + // The url property + url *string +} +// NewCodeOfConductSimple instantiates a new CodeOfConductSimple and sets the default values. +func NewCodeOfConductSimple()(*CodeOfConductSimple) { + m := &CodeOfConductSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeOfConductSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeOfConductSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeOfConductSimple(), 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 *CodeOfConductSimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeOfConductSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CodeOfConductSimple) GetHtmlUrl()(*string) { + return m.html_url +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *CodeOfConductSimple) GetKey()(*string) { + return m.key +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *CodeOfConductSimple) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CodeOfConductSimple) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CodeOfConductSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CodeOfConductSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CodeOfConductSimple) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetKey sets the key property value. The key property +func (m *CodeOfConductSimple) SetKey(value *string)() { + m.key = value +} +// SetName sets the name property value. The name property +func (m *CodeOfConductSimple) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url property +func (m *CodeOfConductSimple) SetUrl(value *string)() { + m.url = value +} +type CodeOfConductSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetKey()(*string) + GetName()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetKey(value *string)() + SetName(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert.go new file mode 100644 index 000000000..125b73c0f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert.go @@ -0,0 +1,441 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAlert struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + dismissed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + dismissed_by NullableSimpleUserable + // The dismissal comment associated with the dismissal of the alert. + dismissed_comment *string + // **Required when the state is dismissed.** The reason for dismissing or closing the alert. + dismissed_reason *CodeScanningAlertDismissedReason + // The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + fixed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The GitHub URL of the alert resource. + html_url *string + // The REST API URL for fetching the list of instances for an alert. + instances_url *string + // The most_recent_instance property + most_recent_instance CodeScanningAlertInstanceable + // The security alert number. + number *int32 + // The rule property + rule CodeScanningAlertRuleable + // State of a code scanning alert. + state *CodeScanningAlertState + // The tool property + tool CodeScanningAnalysisToolable + // The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The REST API URL of the alert resource. + url *string +} +// NewCodeScanningAlert instantiates a new CodeScanningAlert and sets the default values. +func NewCodeScanningAlert()(*CodeScanningAlert) { + m := &CodeScanningAlert{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAlertFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAlertFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAlert(), 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 *CodeScanningAlert) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAlert) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDismissedAt gets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAlert) GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.dismissed_at +} +// GetDismissedBy gets the dismissed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *CodeScanningAlert) GetDismissedBy()(NullableSimpleUserable) { + return m.dismissed_by +} +// GetDismissedComment gets the dismissed_comment property value. The dismissal comment associated with the dismissal of the alert. +// returns a *string when successful +func (m *CodeScanningAlert) GetDismissedComment()(*string) { + return m.dismissed_comment +} +// GetDismissedReason gets the dismissed_reason property value. **Required when the state is dismissed.** The reason for dismissing or closing the alert. +// returns a *CodeScanningAlertDismissedReason when successful +func (m *CodeScanningAlert) GetDismissedReason()(*CodeScanningAlertDismissedReason) { + return m.dismissed_reason +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAlert) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["dismissed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedAt(val) + } + return nil + } + res["dismissed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["dismissed_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedComment(val) + } + return nil + } + res["dismissed_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertDismissedReason) + if err != nil { + return err + } + if val != nil { + m.SetDismissedReason(val.(*CodeScanningAlertDismissedReason)) + } + return nil + } + res["fixed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetFixedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["instances_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInstancesUrl(val) + } + return nil + } + res["most_recent_instance"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAlertInstanceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMostRecentInstance(val.(CodeScanningAlertInstanceable)) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["rule"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAlertRuleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRule(val.(CodeScanningAlertRuleable)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*CodeScanningAlertState)) + } + return nil + } + res["tool"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAnalysisToolFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTool(val.(CodeScanningAnalysisToolable)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFixedAt gets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAlert) GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.fixed_at +} +// GetHtmlUrl gets the html_url property value. The GitHub URL of the alert resource. +// returns a *string when successful +func (m *CodeScanningAlert) GetHtmlUrl()(*string) { + return m.html_url +} +// GetInstancesUrl gets the instances_url property value. The REST API URL for fetching the list of instances for an alert. +// returns a *string when successful +func (m *CodeScanningAlert) GetInstancesUrl()(*string) { + return m.instances_url +} +// GetMostRecentInstance gets the most_recent_instance property value. The most_recent_instance property +// returns a CodeScanningAlertInstanceable when successful +func (m *CodeScanningAlert) GetMostRecentInstance()(CodeScanningAlertInstanceable) { + return m.most_recent_instance +} +// GetNumber gets the number property value. The security alert number. +// returns a *int32 when successful +func (m *CodeScanningAlert) GetNumber()(*int32) { + return m.number +} +// GetRule gets the rule property value. The rule property +// returns a CodeScanningAlertRuleable when successful +func (m *CodeScanningAlert) GetRule()(CodeScanningAlertRuleable) { + return m.rule +} +// GetState gets the state property value. State of a code scanning alert. +// returns a *CodeScanningAlertState when successful +func (m *CodeScanningAlert) GetState()(*CodeScanningAlertState) { + return m.state +} +// GetTool gets the tool property value. The tool property +// returns a CodeScanningAnalysisToolable when successful +func (m *CodeScanningAlert) GetTool()(CodeScanningAnalysisToolable) { + return m.tool +} +// GetUpdatedAt gets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAlert) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The REST API URL of the alert resource. +// returns a *string when successful +func (m *CodeScanningAlert) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CodeScanningAlert) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("dismissed_by", m.GetDismissedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("dismissed_comment", m.GetDismissedComment()) + if err != nil { + return err + } + } + if m.GetDismissedReason() != nil { + cast := (*m.GetDismissedReason()).String() + err := writer.WriteStringValue("dismissed_reason", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("most_recent_instance", m.GetMostRecentInstance()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("rule", m.GetRule()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tool", m.GetTool()) + 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 *CodeScanningAlert) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAlert) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDismissedAt sets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAlert) SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.dismissed_at = value +} +// SetDismissedBy sets the dismissed_by property value. A GitHub user. +func (m *CodeScanningAlert) SetDismissedBy(value NullableSimpleUserable)() { + m.dismissed_by = value +} +// SetDismissedComment sets the dismissed_comment property value. The dismissal comment associated with the dismissal of the alert. +func (m *CodeScanningAlert) SetDismissedComment(value *string)() { + m.dismissed_comment = value +} +// SetDismissedReason sets the dismissed_reason property value. **Required when the state is dismissed.** The reason for dismissing or closing the alert. +func (m *CodeScanningAlert) SetDismissedReason(value *CodeScanningAlertDismissedReason)() { + m.dismissed_reason = value +} +// SetFixedAt sets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAlert) SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.fixed_at = value +} +// SetHtmlUrl sets the html_url property value. The GitHub URL of the alert resource. +func (m *CodeScanningAlert) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetInstancesUrl sets the instances_url property value. The REST API URL for fetching the list of instances for an alert. +func (m *CodeScanningAlert) SetInstancesUrl(value *string)() { + m.instances_url = value +} +// SetMostRecentInstance sets the most_recent_instance property value. The most_recent_instance property +func (m *CodeScanningAlert) SetMostRecentInstance(value CodeScanningAlertInstanceable)() { + m.most_recent_instance = value +} +// SetNumber sets the number property value. The security alert number. +func (m *CodeScanningAlert) SetNumber(value *int32)() { + m.number = value +} +// SetRule sets the rule property value. The rule property +func (m *CodeScanningAlert) SetRule(value CodeScanningAlertRuleable)() { + m.rule = value +} +// SetState sets the state property value. State of a code scanning alert. +func (m *CodeScanningAlert) SetState(value *CodeScanningAlertState)() { + m.state = value +} +// SetTool sets the tool property value. The tool property +func (m *CodeScanningAlert) SetTool(value CodeScanningAnalysisToolable)() { + m.tool = value +} +// SetUpdatedAt sets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAlert) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The REST API URL of the alert resource. +func (m *CodeScanningAlert) SetUrl(value *string)() { + m.url = value +} +type CodeScanningAlertable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedBy()(NullableSimpleUserable) + GetDismissedComment()(*string) + GetDismissedReason()(*CodeScanningAlertDismissedReason) + GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetInstancesUrl()(*string) + GetMostRecentInstance()(CodeScanningAlertInstanceable) + GetNumber()(*int32) + GetRule()(CodeScanningAlertRuleable) + GetState()(*CodeScanningAlertState) + GetTool()(CodeScanningAnalysisToolable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedBy(value NullableSimpleUserable)() + SetDismissedComment(value *string)() + SetDismissedReason(value *CodeScanningAlertDismissedReason)() + SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetInstancesUrl(value *string)() + SetMostRecentInstance(value CodeScanningAlertInstanceable)() + SetNumber(value *int32)() + SetRule(value CodeScanningAlertRuleable)() + SetState(value *CodeScanningAlertState)() + SetTool(value CodeScanningAnalysisToolable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert503_error.go new file mode 100644 index 000000000..930cea8e2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAlert503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewCodeScanningAlert503Error instantiates a new CodeScanningAlert503Error and sets the default values. +func NewCodeScanningAlert503Error()(*CodeScanningAlert503Error) { + m := &CodeScanningAlert503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAlert503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAlert503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAlert503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodeScanningAlert503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CodeScanningAlert503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodeScanningAlert503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodeScanningAlert503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAlert503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *CodeScanningAlert503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodeScanningAlert503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *CodeScanningAlert503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodeScanningAlert503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodeScanningAlert503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningAlert503Error) SetMessage(value *string)() { + m.message = value +} +type CodeScanningAlert503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_classification.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_classification.go new file mode 100644 index 000000000..b3b2d7efd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_classification.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// A classification of the file. For example to identify it as generated. +type CodeScanningAlertClassification int + +const ( + SOURCE_CODESCANNINGALERTCLASSIFICATION CodeScanningAlertClassification = iota + GENERATED_CODESCANNINGALERTCLASSIFICATION + TEST_CODESCANNINGALERTCLASSIFICATION + LIBRARY_CODESCANNINGALERTCLASSIFICATION +) + +func (i CodeScanningAlertClassification) String() string { + return []string{"source", "generated", "test", "library"}[i] +} +func ParseCodeScanningAlertClassification(v string) (any, error) { + result := SOURCE_CODESCANNINGALERTCLASSIFICATION + switch v { + case "source": + result = SOURCE_CODESCANNINGALERTCLASSIFICATION + case "generated": + result = GENERATED_CODESCANNINGALERTCLASSIFICATION + case "test": + result = TEST_CODESCANNINGALERTCLASSIFICATION + case "library": + result = LIBRARY_CODESCANNINGALERTCLASSIFICATION + default: + return 0, errors.New("Unknown CodeScanningAlertClassification value: " + v) + } + return &result, nil +} +func SerializeCodeScanningAlertClassification(values []CodeScanningAlertClassification) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertClassification) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_dismissed_reason.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_dismissed_reason.go new file mode 100644 index 000000000..1f4a23bed --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_dismissed_reason.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// **Required when the state is dismissed.** The reason for dismissing or closing the alert. +type CodeScanningAlertDismissedReason int + +const ( + FALSEPOSITIVE_CODESCANNINGALERTDISMISSEDREASON CodeScanningAlertDismissedReason = iota + WONTFIX_CODESCANNINGALERTDISMISSEDREASON + USEDINTESTS_CODESCANNINGALERTDISMISSEDREASON +) + +func (i CodeScanningAlertDismissedReason) String() string { + return []string{"false positive", "won't fix", "used in tests"}[i] +} +func ParseCodeScanningAlertDismissedReason(v string) (any, error) { + result := FALSEPOSITIVE_CODESCANNINGALERTDISMISSEDREASON + switch v { + case "false positive": + result = FALSEPOSITIVE_CODESCANNINGALERTDISMISSEDREASON + case "won't fix": + result = WONTFIX_CODESCANNINGALERTDISMISSEDREASON + case "used in tests": + result = USEDINTESTS_CODESCANNINGALERTDISMISSEDREASON + default: + return 0, errors.New("Unknown CodeScanningAlertDismissedReason value: " + v) + } + return &result, nil +} +func SerializeCodeScanningAlertDismissedReason(values []CodeScanningAlertDismissedReason) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertDismissedReason) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_instance.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_instance.go new file mode 100644 index 000000000..b4132faed --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_instance.go @@ -0,0 +1,348 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAlertInstance struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. + analysis_key *string + // Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. + category *string + // Classifications that have been applied to the file that triggered the alert.For example identifying it as documentation, or a generated file. + classifications []CodeScanningAlertClassification + // The commit_sha property + commit_sha *string + // Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. + environment *string + // The html_url property + html_url *string + // Describe a region within a file for the alert. + location CodeScanningAlertLocationable + // The message property + message CodeScanningAlertInstance_messageable + // The Git reference, formatted as `refs/pull//merge`, `refs/pull//head`,`refs/heads/` or simply ``. + ref *string + // State of a code scanning alert. + state *CodeScanningAlertState +} +// NewCodeScanningAlertInstance instantiates a new CodeScanningAlertInstance and sets the default values. +func NewCodeScanningAlertInstance()(*CodeScanningAlertInstance) { + m := &CodeScanningAlertInstance{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAlertInstanceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAlertInstanceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAlertInstance(), 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 *CodeScanningAlertInstance) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAnalysisKey gets the analysis_key property value. Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. +// returns a *string when successful +func (m *CodeScanningAlertInstance) GetAnalysisKey()(*string) { + return m.analysis_key +} +// GetCategory gets the category property value. Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. +// returns a *string when successful +func (m *CodeScanningAlertInstance) GetCategory()(*string) { + return m.category +} +// GetClassifications gets the classifications property value. Classifications that have been applied to the file that triggered the alert.For example identifying it as documentation, or a generated file. +// returns a []CodeScanningAlertClassification when successful +func (m *CodeScanningAlertInstance) GetClassifications()([]CodeScanningAlertClassification) { + return m.classifications +} +// GetCommitSha gets the commit_sha property value. The commit_sha property +// returns a *string when successful +func (m *CodeScanningAlertInstance) GetCommitSha()(*string) { + return m.commit_sha +} +// GetEnvironment gets the environment property value. Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. +// returns a *string when successful +func (m *CodeScanningAlertInstance) GetEnvironment()(*string) { + return m.environment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAlertInstance) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["analysis_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAnalysisKey(val) + } + return nil + } + res["category"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCategory(val) + } + return nil + } + res["classifications"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(ParseCodeScanningAlertClassification) + if err != nil { + return err + } + if val != nil { + res := make([]CodeScanningAlertClassification, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*CodeScanningAlertClassification)) + } + } + m.SetClassifications(res) + } + 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["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAlertLocationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLocation(val.(CodeScanningAlertLocationable)) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAlertInstance_messageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMessage(val.(CodeScanningAlertInstance_messageable)) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*CodeScanningAlertState)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CodeScanningAlertInstance) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLocation gets the location property value. Describe a region within a file for the alert. +// returns a CodeScanningAlertLocationable when successful +func (m *CodeScanningAlertInstance) GetLocation()(CodeScanningAlertLocationable) { + return m.location +} +// GetMessage gets the message property value. The message property +// returns a CodeScanningAlertInstance_messageable when successful +func (m *CodeScanningAlertInstance) GetMessage()(CodeScanningAlertInstance_messageable) { + return m.message +} +// GetRef gets the ref property value. The Git reference, formatted as `refs/pull//merge`, `refs/pull//head`,`refs/heads/` or simply ``. +// returns a *string when successful +func (m *CodeScanningAlertInstance) GetRef()(*string) { + return m.ref +} +// GetState gets the state property value. State of a code scanning alert. +// returns a *CodeScanningAlertState when successful +func (m *CodeScanningAlertInstance) GetState()(*CodeScanningAlertState) { + return m.state +} +// Serialize serializes information the current object +func (m *CodeScanningAlertInstance) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("analysis_key", m.GetAnalysisKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("category", m.GetCategory()) + if err != nil { + return err + } + } + if m.GetClassifications() != nil { + err := writer.WriteCollectionOfStringValues("classifications", SerializeCodeScanningAlertClassification(m.GetClassifications())) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_sha", m.GetCommitSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CodeScanningAlertInstance) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAnalysisKey sets the analysis_key property value. Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. +func (m *CodeScanningAlertInstance) SetAnalysisKey(value *string)() { + m.analysis_key = value +} +// SetCategory sets the category property value. Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. +func (m *CodeScanningAlertInstance) SetCategory(value *string)() { + m.category = value +} +// SetClassifications sets the classifications property value. Classifications that have been applied to the file that triggered the alert.For example identifying it as documentation, or a generated file. +func (m *CodeScanningAlertInstance) SetClassifications(value []CodeScanningAlertClassification)() { + m.classifications = value +} +// SetCommitSha sets the commit_sha property value. The commit_sha property +func (m *CodeScanningAlertInstance) SetCommitSha(value *string)() { + m.commit_sha = value +} +// SetEnvironment sets the environment property value. Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. +func (m *CodeScanningAlertInstance) SetEnvironment(value *string)() { + m.environment = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CodeScanningAlertInstance) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLocation sets the location property value. Describe a region within a file for the alert. +func (m *CodeScanningAlertInstance) SetLocation(value CodeScanningAlertLocationable)() { + m.location = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningAlertInstance) SetMessage(value CodeScanningAlertInstance_messageable)() { + m.message = value +} +// SetRef sets the ref property value. The Git reference, formatted as `refs/pull//merge`, `refs/pull//head`,`refs/heads/` or simply ``. +func (m *CodeScanningAlertInstance) SetRef(value *string)() { + m.ref = value +} +// SetState sets the state property value. State of a code scanning alert. +func (m *CodeScanningAlertInstance) SetState(value *CodeScanningAlertState)() { + m.state = value +} +type CodeScanningAlertInstanceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAnalysisKey()(*string) + GetCategory()(*string) + GetClassifications()([]CodeScanningAlertClassification) + GetCommitSha()(*string) + GetEnvironment()(*string) + GetHtmlUrl()(*string) + GetLocation()(CodeScanningAlertLocationable) + GetMessage()(CodeScanningAlertInstance_messageable) + GetRef()(*string) + GetState()(*CodeScanningAlertState) + SetAnalysisKey(value *string)() + SetCategory(value *string)() + SetClassifications(value []CodeScanningAlertClassification)() + SetCommitSha(value *string)() + SetEnvironment(value *string)() + SetHtmlUrl(value *string)() + SetLocation(value CodeScanningAlertLocationable)() + SetMessage(value CodeScanningAlertInstance_messageable)() + SetRef(value *string)() + SetState(value *CodeScanningAlertState)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_instance_message.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_instance_message.go new file mode 100644 index 000000000..83a574c55 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_instance_message.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAlertInstance_message struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The text property + text *string +} +// NewCodeScanningAlertInstance_message instantiates a new CodeScanningAlertInstance_message and sets the default values. +func NewCodeScanningAlertInstance_message()(*CodeScanningAlertInstance_message) { + m := &CodeScanningAlertInstance_message{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAlertInstance_messageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAlertInstance_messageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAlertInstance_message(), 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 *CodeScanningAlertInstance_message) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAlertInstance_message) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *CodeScanningAlertInstance_message) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *CodeScanningAlertInstance_message) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("text", m.GetText()) + 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 *CodeScanningAlertInstance_message) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetText sets the text property value. The text property +func (m *CodeScanningAlertInstance_message) SetText(value *string)() { + m.text = value +} +type CodeScanningAlertInstance_messageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetText()(*string) + SetText(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_items.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_items.go new file mode 100644 index 000000000..1bc9aa202 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_items.go @@ -0,0 +1,441 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAlertItems struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + dismissed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + dismissed_by NullableSimpleUserable + // The dismissal comment associated with the dismissal of the alert. + dismissed_comment *string + // **Required when the state is dismissed.** The reason for dismissing or closing the alert. + dismissed_reason *CodeScanningAlertDismissedReason + // The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + fixed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The GitHub URL of the alert resource. + html_url *string + // The REST API URL for fetching the list of instances for an alert. + instances_url *string + // The most_recent_instance property + most_recent_instance CodeScanningAlertInstanceable + // The security alert number. + number *int32 + // The rule property + rule CodeScanningAlertRuleSummaryable + // State of a code scanning alert. + state *CodeScanningAlertState + // The tool property + tool CodeScanningAnalysisToolable + // The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The REST API URL of the alert resource. + url *string +} +// NewCodeScanningAlertItems instantiates a new CodeScanningAlertItems and sets the default values. +func NewCodeScanningAlertItems()(*CodeScanningAlertItems) { + m := &CodeScanningAlertItems{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAlertItemsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAlertItemsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAlertItems(), 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 *CodeScanningAlertItems) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAlertItems) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDismissedAt gets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAlertItems) GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.dismissed_at +} +// GetDismissedBy gets the dismissed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *CodeScanningAlertItems) GetDismissedBy()(NullableSimpleUserable) { + return m.dismissed_by +} +// GetDismissedComment gets the dismissed_comment property value. The dismissal comment associated with the dismissal of the alert. +// returns a *string when successful +func (m *CodeScanningAlertItems) GetDismissedComment()(*string) { + return m.dismissed_comment +} +// GetDismissedReason gets the dismissed_reason property value. **Required when the state is dismissed.** The reason for dismissing or closing the alert. +// returns a *CodeScanningAlertDismissedReason when successful +func (m *CodeScanningAlertItems) GetDismissedReason()(*CodeScanningAlertDismissedReason) { + return m.dismissed_reason +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAlertItems) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["dismissed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedAt(val) + } + return nil + } + res["dismissed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["dismissed_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedComment(val) + } + return nil + } + res["dismissed_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertDismissedReason) + if err != nil { + return err + } + if val != nil { + m.SetDismissedReason(val.(*CodeScanningAlertDismissedReason)) + } + return nil + } + res["fixed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetFixedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["instances_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInstancesUrl(val) + } + return nil + } + res["most_recent_instance"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAlertInstanceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMostRecentInstance(val.(CodeScanningAlertInstanceable)) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["rule"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAlertRuleSummaryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRule(val.(CodeScanningAlertRuleSummaryable)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*CodeScanningAlertState)) + } + return nil + } + res["tool"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAnalysisToolFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTool(val.(CodeScanningAnalysisToolable)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFixedAt gets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAlertItems) GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.fixed_at +} +// GetHtmlUrl gets the html_url property value. The GitHub URL of the alert resource. +// returns a *string when successful +func (m *CodeScanningAlertItems) GetHtmlUrl()(*string) { + return m.html_url +} +// GetInstancesUrl gets the instances_url property value. The REST API URL for fetching the list of instances for an alert. +// returns a *string when successful +func (m *CodeScanningAlertItems) GetInstancesUrl()(*string) { + return m.instances_url +} +// GetMostRecentInstance gets the most_recent_instance property value. The most_recent_instance property +// returns a CodeScanningAlertInstanceable when successful +func (m *CodeScanningAlertItems) GetMostRecentInstance()(CodeScanningAlertInstanceable) { + return m.most_recent_instance +} +// GetNumber gets the number property value. The security alert number. +// returns a *int32 when successful +func (m *CodeScanningAlertItems) GetNumber()(*int32) { + return m.number +} +// GetRule gets the rule property value. The rule property +// returns a CodeScanningAlertRuleSummaryable when successful +func (m *CodeScanningAlertItems) GetRule()(CodeScanningAlertRuleSummaryable) { + return m.rule +} +// GetState gets the state property value. State of a code scanning alert. +// returns a *CodeScanningAlertState when successful +func (m *CodeScanningAlertItems) GetState()(*CodeScanningAlertState) { + return m.state +} +// GetTool gets the tool property value. The tool property +// returns a CodeScanningAnalysisToolable when successful +func (m *CodeScanningAlertItems) GetTool()(CodeScanningAnalysisToolable) { + return m.tool +} +// GetUpdatedAt gets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAlertItems) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The REST API URL of the alert resource. +// returns a *string when successful +func (m *CodeScanningAlertItems) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CodeScanningAlertItems) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("dismissed_by", m.GetDismissedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("dismissed_comment", m.GetDismissedComment()) + if err != nil { + return err + } + } + if m.GetDismissedReason() != nil { + cast := (*m.GetDismissedReason()).String() + err := writer.WriteStringValue("dismissed_reason", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("most_recent_instance", m.GetMostRecentInstance()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("rule", m.GetRule()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tool", m.GetTool()) + 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 *CodeScanningAlertItems) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAlertItems) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDismissedAt sets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAlertItems) SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.dismissed_at = value +} +// SetDismissedBy sets the dismissed_by property value. A GitHub user. +func (m *CodeScanningAlertItems) SetDismissedBy(value NullableSimpleUserable)() { + m.dismissed_by = value +} +// SetDismissedComment sets the dismissed_comment property value. The dismissal comment associated with the dismissal of the alert. +func (m *CodeScanningAlertItems) SetDismissedComment(value *string)() { + m.dismissed_comment = value +} +// SetDismissedReason sets the dismissed_reason property value. **Required when the state is dismissed.** The reason for dismissing or closing the alert. +func (m *CodeScanningAlertItems) SetDismissedReason(value *CodeScanningAlertDismissedReason)() { + m.dismissed_reason = value +} +// SetFixedAt sets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAlertItems) SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.fixed_at = value +} +// SetHtmlUrl sets the html_url property value. The GitHub URL of the alert resource. +func (m *CodeScanningAlertItems) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetInstancesUrl sets the instances_url property value. The REST API URL for fetching the list of instances for an alert. +func (m *CodeScanningAlertItems) SetInstancesUrl(value *string)() { + m.instances_url = value +} +// SetMostRecentInstance sets the most_recent_instance property value. The most_recent_instance property +func (m *CodeScanningAlertItems) SetMostRecentInstance(value CodeScanningAlertInstanceable)() { + m.most_recent_instance = value +} +// SetNumber sets the number property value. The security alert number. +func (m *CodeScanningAlertItems) SetNumber(value *int32)() { + m.number = value +} +// SetRule sets the rule property value. The rule property +func (m *CodeScanningAlertItems) SetRule(value CodeScanningAlertRuleSummaryable)() { + m.rule = value +} +// SetState sets the state property value. State of a code scanning alert. +func (m *CodeScanningAlertItems) SetState(value *CodeScanningAlertState)() { + m.state = value +} +// SetTool sets the tool property value. The tool property +func (m *CodeScanningAlertItems) SetTool(value CodeScanningAnalysisToolable)() { + m.tool = value +} +// SetUpdatedAt sets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAlertItems) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The REST API URL of the alert resource. +func (m *CodeScanningAlertItems) SetUrl(value *string)() { + m.url = value +} +type CodeScanningAlertItemsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedBy()(NullableSimpleUserable) + GetDismissedComment()(*string) + GetDismissedReason()(*CodeScanningAlertDismissedReason) + GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetInstancesUrl()(*string) + GetMostRecentInstance()(CodeScanningAlertInstanceable) + GetNumber()(*int32) + GetRule()(CodeScanningAlertRuleSummaryable) + GetState()(*CodeScanningAlertState) + GetTool()(CodeScanningAnalysisToolable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedBy(value NullableSimpleUserable)() + SetDismissedComment(value *string)() + SetDismissedReason(value *CodeScanningAlertDismissedReason)() + SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetInstancesUrl(value *string)() + SetMostRecentInstance(value CodeScanningAlertInstanceable)() + SetNumber(value *int32)() + SetRule(value CodeScanningAlertRuleSummaryable)() + SetState(value *CodeScanningAlertState)() + SetTool(value CodeScanningAnalysisToolable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_location.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_location.go new file mode 100644 index 000000000..632819d06 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_location.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeScanningAlertLocation describe a region within a file for the alert. +type CodeScanningAlertLocation struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The end_column property + end_column *int32 + // The end_line property + end_line *int32 + // The path property + path *string + // The start_column property + start_column *int32 + // The start_line property + start_line *int32 +} +// NewCodeScanningAlertLocation instantiates a new CodeScanningAlertLocation and sets the default values. +func NewCodeScanningAlertLocation()(*CodeScanningAlertLocation) { + m := &CodeScanningAlertLocation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAlertLocationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAlertLocationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAlertLocation(), 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 *CodeScanningAlertLocation) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEndColumn gets the end_column property value. The end_column property +// returns a *int32 when successful +func (m *CodeScanningAlertLocation) GetEndColumn()(*int32) { + return m.end_column +} +// GetEndLine gets the end_line property value. The end_line property +// returns a *int32 when successful +func (m *CodeScanningAlertLocation) GetEndLine()(*int32) { + return m.end_line +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAlertLocation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["end_column"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetEndColumn(val) + } + return nil + } + res["end_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetEndLine(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.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartColumn(val) + } + return nil + } + res["start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartLine(val) + } + return nil + } + return res +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *CodeScanningAlertLocation) GetPath()(*string) { + return m.path +} +// GetStartColumn gets the start_column property value. The start_column property +// returns a *int32 when successful +func (m *CodeScanningAlertLocation) GetStartColumn()(*int32) { + return m.start_column +} +// GetStartLine gets the start_line property value. The start_line property +// returns a *int32 when successful +func (m *CodeScanningAlertLocation) GetStartLine()(*int32) { + return m.start_line +} +// Serialize serializes information the current object +func (m *CodeScanningAlertLocation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("end_column", m.GetEndColumn()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("end_line", m.GetEndLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("start_column", m.GetStartColumn()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("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 *CodeScanningAlertLocation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEndColumn sets the end_column property value. The end_column property +func (m *CodeScanningAlertLocation) SetEndColumn(value *int32)() { + m.end_column = value +} +// SetEndLine sets the end_line property value. The end_line property +func (m *CodeScanningAlertLocation) SetEndLine(value *int32)() { + m.end_line = value +} +// SetPath sets the path property value. The path property +func (m *CodeScanningAlertLocation) SetPath(value *string)() { + m.path = value +} +// SetStartColumn sets the start_column property value. The start_column property +func (m *CodeScanningAlertLocation) SetStartColumn(value *int32)() { + m.start_column = value +} +// SetStartLine sets the start_line property value. The start_line property +func (m *CodeScanningAlertLocation) SetStartLine(value *int32)() { + m.start_line = value +} +type CodeScanningAlertLocationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEndColumn()(*int32) + GetEndLine()(*int32) + GetPath()(*string) + GetStartColumn()(*int32) + GetStartLine()(*int32) + SetEndColumn(value *int32)() + SetEndLine(value *int32)() + SetPath(value *string)() + SetStartColumn(value *int32)() + SetStartLine(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule.go new file mode 100644 index 000000000..f6524c837 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule.go @@ -0,0 +1,320 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAlertRule struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A short description of the rule used to detect the alert. + description *string + // description of the rule used to detect the alert. + full_description *string + // Detailed documentation for the rule as GitHub Flavored Markdown. + help *string + // A link to the documentation for the rule used to detect the alert. + help_uri *string + // A unique identifier for the rule used to detect the alert. + id *string + // The name of the rule used to detect the alert. + name *string + // The security severity of the alert. + security_severity_level *CodeScanningAlertRule_security_severity_level + // The severity of the alert. + severity *CodeScanningAlertRule_severity + // A set of tags applicable for the rule. + tags []string +} +// NewCodeScanningAlertRule instantiates a new CodeScanningAlertRule and sets the default values. +func NewCodeScanningAlertRule()(*CodeScanningAlertRule) { + m := &CodeScanningAlertRule{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAlertRuleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAlertRuleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAlertRule(), 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 *CodeScanningAlertRule) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. A short description of the rule used to detect the alert. +// returns a *string when successful +func (m *CodeScanningAlertRule) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAlertRule) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["full_description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullDescription(val) + } + return nil + } + res["help"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHelp(val) + } + return nil + } + res["help_uri"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHelpUri(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["security_severity_level"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertRule_security_severity_level) + if err != nil { + return err + } + if val != nil { + m.SetSecuritySeverityLevel(val.(*CodeScanningAlertRule_security_severity_level)) + } + return nil + } + res["severity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertRule_severity) + if err != nil { + return err + } + if val != nil { + m.SetSeverity(val.(*CodeScanningAlertRule_severity)) + } + return nil + } + res["tags"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTags(res) + } + return nil + } + return res +} +// GetFullDescription gets the full_description property value. description of the rule used to detect the alert. +// returns a *string when successful +func (m *CodeScanningAlertRule) GetFullDescription()(*string) { + return m.full_description +} +// GetHelp gets the help property value. Detailed documentation for the rule as GitHub Flavored Markdown. +// returns a *string when successful +func (m *CodeScanningAlertRule) GetHelp()(*string) { + return m.help +} +// GetHelpUri gets the help_uri property value. A link to the documentation for the rule used to detect the alert. +// returns a *string when successful +func (m *CodeScanningAlertRule) GetHelpUri()(*string) { + return m.help_uri +} +// GetId gets the id property value. A unique identifier for the rule used to detect the alert. +// returns a *string when successful +func (m *CodeScanningAlertRule) GetId()(*string) { + return m.id +} +// GetName gets the name property value. The name of the rule used to detect the alert. +// returns a *string when successful +func (m *CodeScanningAlertRule) GetName()(*string) { + return m.name +} +// GetSecuritySeverityLevel gets the security_severity_level property value. The security severity of the alert. +// returns a *CodeScanningAlertRule_security_severity_level when successful +func (m *CodeScanningAlertRule) GetSecuritySeverityLevel()(*CodeScanningAlertRule_security_severity_level) { + return m.security_severity_level +} +// GetSeverity gets the severity property value. The severity of the alert. +// returns a *CodeScanningAlertRule_severity when successful +func (m *CodeScanningAlertRule) GetSeverity()(*CodeScanningAlertRule_severity) { + return m.severity +} +// GetTags gets the tags property value. A set of tags applicable for the rule. +// returns a []string when successful +func (m *CodeScanningAlertRule) GetTags()([]string) { + return m.tags +} +// Serialize serializes information the current object +func (m *CodeScanningAlertRule) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_description", m.GetFullDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("help", m.GetHelp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("help_uri", m.GetHelpUri()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetSecuritySeverityLevel() != nil { + cast := (*m.GetSecuritySeverityLevel()).String() + err := writer.WriteStringValue("security_severity_level", &cast) + if err != nil { + return err + } + } + if m.GetSeverity() != nil { + cast := (*m.GetSeverity()).String() + err := writer.WriteStringValue("severity", &cast) + if err != nil { + return err + } + } + if m.GetTags() != nil { + err := writer.WriteCollectionOfStringValues("tags", m.GetTags()) + 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 *CodeScanningAlertRule) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. A short description of the rule used to detect the alert. +func (m *CodeScanningAlertRule) SetDescription(value *string)() { + m.description = value +} +// SetFullDescription sets the full_description property value. description of the rule used to detect the alert. +func (m *CodeScanningAlertRule) SetFullDescription(value *string)() { + m.full_description = value +} +// SetHelp sets the help property value. Detailed documentation for the rule as GitHub Flavored Markdown. +func (m *CodeScanningAlertRule) SetHelp(value *string)() { + m.help = value +} +// SetHelpUri sets the help_uri property value. A link to the documentation for the rule used to detect the alert. +func (m *CodeScanningAlertRule) SetHelpUri(value *string)() { + m.help_uri = value +} +// SetId sets the id property value. A unique identifier for the rule used to detect the alert. +func (m *CodeScanningAlertRule) SetId(value *string)() { + m.id = value +} +// SetName sets the name property value. The name of the rule used to detect the alert. +func (m *CodeScanningAlertRule) SetName(value *string)() { + m.name = value +} +// SetSecuritySeverityLevel sets the security_severity_level property value. The security severity of the alert. +func (m *CodeScanningAlertRule) SetSecuritySeverityLevel(value *CodeScanningAlertRule_security_severity_level)() { + m.security_severity_level = value +} +// SetSeverity sets the severity property value. The severity of the alert. +func (m *CodeScanningAlertRule) SetSeverity(value *CodeScanningAlertRule_severity)() { + m.severity = value +} +// SetTags sets the tags property value. A set of tags applicable for the rule. +func (m *CodeScanningAlertRule) SetTags(value []string)() { + m.tags = value +} +type CodeScanningAlertRuleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetFullDescription()(*string) + GetHelp()(*string) + GetHelpUri()(*string) + GetId()(*string) + GetName()(*string) + GetSecuritySeverityLevel()(*CodeScanningAlertRule_security_severity_level) + GetSeverity()(*CodeScanningAlertRule_severity) + GetTags()([]string) + SetDescription(value *string)() + SetFullDescription(value *string)() + SetHelp(value *string)() + SetHelpUri(value *string)() + SetId(value *string)() + SetName(value *string)() + SetSecuritySeverityLevel(value *CodeScanningAlertRule_security_severity_level)() + SetSeverity(value *CodeScanningAlertRule_severity)() + SetTags(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule_security_severity_level.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule_security_severity_level.go new file mode 100644 index 000000000..9119dc4be --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule_security_severity_level.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The security severity of the alert. +type CodeScanningAlertRule_security_severity_level int + +const ( + LOW_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL CodeScanningAlertRule_security_severity_level = iota + MEDIUM_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL + HIGH_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL + CRITICAL_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL +) + +func (i CodeScanningAlertRule_security_severity_level) String() string { + return []string{"low", "medium", "high", "critical"}[i] +} +func ParseCodeScanningAlertRule_security_severity_level(v string) (any, error) { + result := LOW_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL + switch v { + case "low": + result = LOW_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL + case "medium": + result = MEDIUM_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL + case "high": + result = HIGH_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL + case "critical": + result = CRITICAL_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL + default: + return 0, errors.New("Unknown CodeScanningAlertRule_security_severity_level value: " + v) + } + return &result, nil +} +func SerializeCodeScanningAlertRule_security_severity_level(values []CodeScanningAlertRule_security_severity_level) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertRule_security_severity_level) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule_severity.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule_severity.go new file mode 100644 index 000000000..179b9d7eb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule_severity.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The severity of the alert. +type CodeScanningAlertRule_severity int + +const ( + NONE_CODESCANNINGALERTRULE_SEVERITY CodeScanningAlertRule_severity = iota + NOTE_CODESCANNINGALERTRULE_SEVERITY + WARNING_CODESCANNINGALERTRULE_SEVERITY + ERROR_CODESCANNINGALERTRULE_SEVERITY +) + +func (i CodeScanningAlertRule_severity) String() string { + return []string{"none", "note", "warning", "error"}[i] +} +func ParseCodeScanningAlertRule_severity(v string) (any, error) { + result := NONE_CODESCANNINGALERTRULE_SEVERITY + switch v { + case "none": + result = NONE_CODESCANNINGALERTRULE_SEVERITY + case "note": + result = NOTE_CODESCANNINGALERTRULE_SEVERITY + case "warning": + result = WARNING_CODESCANNINGALERTRULE_SEVERITY + case "error": + result = ERROR_CODESCANNINGALERTRULE_SEVERITY + default: + return 0, errors.New("Unknown CodeScanningAlertRule_severity value: " + v) + } + return &result, nil +} +func SerializeCodeScanningAlertRule_severity(values []CodeScanningAlertRule_severity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertRule_severity) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule_summary.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule_summary.go new file mode 100644 index 000000000..774db6148 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule_summary.go @@ -0,0 +1,233 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAlertRuleSummary struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A short description of the rule used to detect the alert. + description *string + // A unique identifier for the rule used to detect the alert. + id *string + // The name of the rule used to detect the alert. + name *string + // The security severity of the alert. + security_severity_level *CodeScanningAlertRuleSummary_security_severity_level + // The severity of the alert. + severity *CodeScanningAlertRuleSummary_severity + // A set of tags applicable for the rule. + tags []string +} +// NewCodeScanningAlertRuleSummary instantiates a new CodeScanningAlertRuleSummary and sets the default values. +func NewCodeScanningAlertRuleSummary()(*CodeScanningAlertRuleSummary) { + m := &CodeScanningAlertRuleSummary{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAlertRuleSummaryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAlertRuleSummaryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAlertRuleSummary(), 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 *CodeScanningAlertRuleSummary) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. A short description of the rule used to detect the alert. +// returns a *string when successful +func (m *CodeScanningAlertRuleSummary) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAlertRuleSummary) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["security_severity_level"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertRuleSummary_security_severity_level) + if err != nil { + return err + } + if val != nil { + m.SetSecuritySeverityLevel(val.(*CodeScanningAlertRuleSummary_security_severity_level)) + } + return nil + } + res["severity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertRuleSummary_severity) + if err != nil { + return err + } + if val != nil { + m.SetSeverity(val.(*CodeScanningAlertRuleSummary_severity)) + } + return nil + } + res["tags"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTags(res) + } + return nil + } + return res +} +// GetId gets the id property value. A unique identifier for the rule used to detect the alert. +// returns a *string when successful +func (m *CodeScanningAlertRuleSummary) GetId()(*string) { + return m.id +} +// GetName gets the name property value. The name of the rule used to detect the alert. +// returns a *string when successful +func (m *CodeScanningAlertRuleSummary) GetName()(*string) { + return m.name +} +// GetSecuritySeverityLevel gets the security_severity_level property value. The security severity of the alert. +// returns a *CodeScanningAlertRuleSummary_security_severity_level when successful +func (m *CodeScanningAlertRuleSummary) GetSecuritySeverityLevel()(*CodeScanningAlertRuleSummary_security_severity_level) { + return m.security_severity_level +} +// GetSeverity gets the severity property value. The severity of the alert. +// returns a *CodeScanningAlertRuleSummary_severity when successful +func (m *CodeScanningAlertRuleSummary) GetSeverity()(*CodeScanningAlertRuleSummary_severity) { + return m.severity +} +// GetTags gets the tags property value. A set of tags applicable for the rule. +// returns a []string when successful +func (m *CodeScanningAlertRuleSummary) GetTags()([]string) { + return m.tags +} +// Serialize serializes information the current object +func (m *CodeScanningAlertRuleSummary) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetSecuritySeverityLevel() != nil { + cast := (*m.GetSecuritySeverityLevel()).String() + err := writer.WriteStringValue("security_severity_level", &cast) + if err != nil { + return err + } + } + if m.GetSeverity() != nil { + cast := (*m.GetSeverity()).String() + err := writer.WriteStringValue("severity", &cast) + if err != nil { + return err + } + } + if m.GetTags() != nil { + err := writer.WriteCollectionOfStringValues("tags", m.GetTags()) + 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 *CodeScanningAlertRuleSummary) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. A short description of the rule used to detect the alert. +func (m *CodeScanningAlertRuleSummary) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. A unique identifier for the rule used to detect the alert. +func (m *CodeScanningAlertRuleSummary) SetId(value *string)() { + m.id = value +} +// SetName sets the name property value. The name of the rule used to detect the alert. +func (m *CodeScanningAlertRuleSummary) SetName(value *string)() { + m.name = value +} +// SetSecuritySeverityLevel sets the security_severity_level property value. The security severity of the alert. +func (m *CodeScanningAlertRuleSummary) SetSecuritySeverityLevel(value *CodeScanningAlertRuleSummary_security_severity_level)() { + m.security_severity_level = value +} +// SetSeverity sets the severity property value. The severity of the alert. +func (m *CodeScanningAlertRuleSummary) SetSeverity(value *CodeScanningAlertRuleSummary_severity)() { + m.severity = value +} +// SetTags sets the tags property value. A set of tags applicable for the rule. +func (m *CodeScanningAlertRuleSummary) SetTags(value []string)() { + m.tags = value +} +type CodeScanningAlertRuleSummaryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetId()(*string) + GetName()(*string) + GetSecuritySeverityLevel()(*CodeScanningAlertRuleSummary_security_severity_level) + GetSeverity()(*CodeScanningAlertRuleSummary_severity) + GetTags()([]string) + SetDescription(value *string)() + SetId(value *string)() + SetName(value *string)() + SetSecuritySeverityLevel(value *CodeScanningAlertRuleSummary_security_severity_level)() + SetSeverity(value *CodeScanningAlertRuleSummary_severity)() + SetTags(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule_summary_security_severity_level.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule_summary_security_severity_level.go new file mode 100644 index 000000000..ae3e8a32a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule_summary_security_severity_level.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The security severity of the alert. +type CodeScanningAlertRuleSummary_security_severity_level int + +const ( + LOW_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL CodeScanningAlertRuleSummary_security_severity_level = iota + MEDIUM_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL + HIGH_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL + CRITICAL_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL +) + +func (i CodeScanningAlertRuleSummary_security_severity_level) String() string { + return []string{"low", "medium", "high", "critical"}[i] +} +func ParseCodeScanningAlertRuleSummary_security_severity_level(v string) (any, error) { + result := LOW_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL + switch v { + case "low": + result = LOW_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL + case "medium": + result = MEDIUM_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL + case "high": + result = HIGH_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL + case "critical": + result = CRITICAL_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL + default: + return 0, errors.New("Unknown CodeScanningAlertRuleSummary_security_severity_level value: " + v) + } + return &result, nil +} +func SerializeCodeScanningAlertRuleSummary_security_severity_level(values []CodeScanningAlertRuleSummary_security_severity_level) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertRuleSummary_security_severity_level) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule_summary_severity.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule_summary_severity.go new file mode 100644 index 000000000..70a128440 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_rule_summary_severity.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The severity of the alert. +type CodeScanningAlertRuleSummary_severity int + +const ( + NONE_CODESCANNINGALERTRULESUMMARY_SEVERITY CodeScanningAlertRuleSummary_severity = iota + NOTE_CODESCANNINGALERTRULESUMMARY_SEVERITY + WARNING_CODESCANNINGALERTRULESUMMARY_SEVERITY + ERROR_CODESCANNINGALERTRULESUMMARY_SEVERITY +) + +func (i CodeScanningAlertRuleSummary_severity) String() string { + return []string{"none", "note", "warning", "error"}[i] +} +func ParseCodeScanningAlertRuleSummary_severity(v string) (any, error) { + result := NONE_CODESCANNINGALERTRULESUMMARY_SEVERITY + switch v { + case "none": + result = NONE_CODESCANNINGALERTRULESUMMARY_SEVERITY + case "note": + result = NOTE_CODESCANNINGALERTRULESUMMARY_SEVERITY + case "warning": + result = WARNING_CODESCANNINGALERTRULESUMMARY_SEVERITY + case "error": + result = ERROR_CODESCANNINGALERTRULESUMMARY_SEVERITY + default: + return 0, errors.New("Unknown CodeScanningAlertRuleSummary_severity value: " + v) + } + return &result, nil +} +func SerializeCodeScanningAlertRuleSummary_severity(values []CodeScanningAlertRuleSummary_severity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertRuleSummary_severity) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_set_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_set_state.go new file mode 100644 index 000000000..8caa6ce05 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_set_state.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// Sets the state of the code scanning alert. You must provide `dismissed_reason` when you set the state to `dismissed`. +type CodeScanningAlertSetState int + +const ( + OPEN_CODESCANNINGALERTSETSTATE CodeScanningAlertSetState = iota + DISMISSED_CODESCANNINGALERTSETSTATE +) + +func (i CodeScanningAlertSetState) String() string { + return []string{"open", "dismissed"}[i] +} +func ParseCodeScanningAlertSetState(v string) (any, error) { + result := OPEN_CODESCANNINGALERTSETSTATE + switch v { + case "open": + result = OPEN_CODESCANNINGALERTSETSTATE + case "dismissed": + result = DISMISSED_CODESCANNINGALERTSETSTATE + default: + return 0, errors.New("Unknown CodeScanningAlertSetState value: " + v) + } + return &result, nil +} +func SerializeCodeScanningAlertSetState(values []CodeScanningAlertSetState) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertSetState) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_severity.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_severity.go new file mode 100644 index 000000000..7354b254f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_severity.go @@ -0,0 +1,52 @@ +package models +import ( + "errors" +) +// Severity of a code scanning alert. +type CodeScanningAlertSeverity int + +const ( + CRITICAL_CODESCANNINGALERTSEVERITY CodeScanningAlertSeverity = iota + HIGH_CODESCANNINGALERTSEVERITY + MEDIUM_CODESCANNINGALERTSEVERITY + LOW_CODESCANNINGALERTSEVERITY + WARNING_CODESCANNINGALERTSEVERITY + NOTE_CODESCANNINGALERTSEVERITY + ERROR_CODESCANNINGALERTSEVERITY +) + +func (i CodeScanningAlertSeverity) String() string { + return []string{"critical", "high", "medium", "low", "warning", "note", "error"}[i] +} +func ParseCodeScanningAlertSeverity(v string) (any, error) { + result := CRITICAL_CODESCANNINGALERTSEVERITY + switch v { + case "critical": + result = CRITICAL_CODESCANNINGALERTSEVERITY + case "high": + result = HIGH_CODESCANNINGALERTSEVERITY + case "medium": + result = MEDIUM_CODESCANNINGALERTSEVERITY + case "low": + result = LOW_CODESCANNINGALERTSEVERITY + case "warning": + result = WARNING_CODESCANNINGALERTSEVERITY + case "note": + result = NOTE_CODESCANNINGALERTSEVERITY + case "error": + result = ERROR_CODESCANNINGALERTSEVERITY + default: + return 0, errors.New("Unknown CodeScanningAlertSeverity value: " + v) + } + return &result, nil +} +func SerializeCodeScanningAlertSeverity(values []CodeScanningAlertSeverity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertSeverity) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_state.go new file mode 100644 index 000000000..fd3ce894e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_state.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// State of a code scanning alert. +type CodeScanningAlertState int + +const ( + OPEN_CODESCANNINGALERTSTATE CodeScanningAlertState = iota + DISMISSED_CODESCANNINGALERTSTATE + FIXED_CODESCANNINGALERTSTATE +) + +func (i CodeScanningAlertState) String() string { + return []string{"open", "dismissed", "fixed"}[i] +} +func ParseCodeScanningAlertState(v string) (any, error) { + result := OPEN_CODESCANNINGALERTSTATE + switch v { + case "open": + result = OPEN_CODESCANNINGALERTSTATE + case "dismissed": + result = DISMISSED_CODESCANNINGALERTSTATE + case "fixed": + result = FIXED_CODESCANNINGALERTSTATE + default: + return 0, errors.New("Unknown CodeScanningAlertState value: " + v) + } + return &result, nil +} +func SerializeCodeScanningAlertState(values []CodeScanningAlertState) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertState) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_state_query.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_state_query.go new file mode 100644 index 000000000..c571d6c41 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_alert_state_query.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// State of a code scanning alert. +type CodeScanningAlertStateQuery int + +const ( + OPEN_CODESCANNINGALERTSTATEQUERY CodeScanningAlertStateQuery = iota + CLOSED_CODESCANNINGALERTSTATEQUERY + DISMISSED_CODESCANNINGALERTSTATEQUERY + FIXED_CODESCANNINGALERTSTATEQUERY +) + +func (i CodeScanningAlertStateQuery) String() string { + return []string{"open", "closed", "dismissed", "fixed"}[i] +} +func ParseCodeScanningAlertStateQuery(v string) (any, error) { + result := OPEN_CODESCANNINGALERTSTATEQUERY + switch v { + case "open": + result = OPEN_CODESCANNINGALERTSTATEQUERY + case "closed": + result = CLOSED_CODESCANNINGALERTSTATEQUERY + case "dismissed": + result = DISMISSED_CODESCANNINGALERTSTATEQUERY + case "fixed": + result = FIXED_CODESCANNINGALERTSTATEQUERY + default: + return 0, errors.New("Unknown CodeScanningAlertStateQuery value: " + v) + } + return &result, nil +} +func SerializeCodeScanningAlertStateQuery(values []CodeScanningAlertStateQuery) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertStateQuery) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_analysis.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_analysis.go new file mode 100644 index 000000000..a0ddd3b7a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_analysis.go @@ -0,0 +1,475 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAnalysis struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. + analysis_key *string + // Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. + category *string + // The SHA of the commit to which the analysis you are uploading relates. + commit_sha *string + // The time that the analysis was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The deletable property + deletable *bool + // Identifies the variable values associated with the environment in which this analysis was performed. + environment *string + // The error property + error *string + // Unique identifier for this analysis. + id *int32 + // The Git reference, formatted as `refs/pull//merge`, `refs/pull//head`,`refs/heads/` or simply ``. + ref *string + // The total number of results in the analysis. + results_count *int32 + // The total number of rules used in the analysis. + rules_count *int32 + // An identifier for the upload. + sarif_id *string + // The tool property + tool CodeScanningAnalysisToolable + // The REST API URL of the analysis resource. + url *string + // Warning generated when processing the analysis + warning *string +} +// NewCodeScanningAnalysis instantiates a new CodeScanningAnalysis and sets the default values. +func NewCodeScanningAnalysis()(*CodeScanningAnalysis) { + m := &CodeScanningAnalysis{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAnalysisFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAnalysisFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAnalysis(), 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 *CodeScanningAnalysis) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAnalysisKey gets the analysis_key property value. Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. +// returns a *string when successful +func (m *CodeScanningAnalysis) GetAnalysisKey()(*string) { + return m.analysis_key +} +// GetCategory gets the category property value. Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. +// returns a *string when successful +func (m *CodeScanningAnalysis) GetCategory()(*string) { + return m.category +} +// GetCommitSha gets the commit_sha property value. The SHA of the commit to which the analysis you are uploading relates. +// returns a *string when successful +func (m *CodeScanningAnalysis) GetCommitSha()(*string) { + return m.commit_sha +} +// GetCreatedAt gets the created_at property value. The time that the analysis was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAnalysis) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDeletable gets the deletable property value. The deletable property +// returns a *bool when successful +func (m *CodeScanningAnalysis) GetDeletable()(*bool) { + return m.deletable +} +// GetEnvironment gets the environment property value. Identifies the variable values associated with the environment in which this analysis was performed. +// returns a *string when successful +func (m *CodeScanningAnalysis) GetEnvironment()(*string) { + return m.environment +} +// GetError gets the error property value. The error property +// returns a *string when successful +func (m *CodeScanningAnalysis) GetError()(*string) { + return m.error +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAnalysis) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["analysis_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAnalysisKey(val) + } + return nil + } + res["category"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCategory(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["deletable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeletable(val) + } + return nil + } + res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val) + } + return nil + } + res["error"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetError(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["results_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetResultsCount(val) + } + return nil + } + res["rules_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRulesCount(val) + } + return nil + } + res["sarif_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSarifId(val) + } + return nil + } + res["tool"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAnalysisToolFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTool(val.(CodeScanningAnalysisToolable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["warning"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWarning(val) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier for this analysis. +// returns a *int32 when successful +func (m *CodeScanningAnalysis) GetId()(*int32) { + return m.id +} +// GetRef gets the ref property value. The Git reference, formatted as `refs/pull//merge`, `refs/pull//head`,`refs/heads/` or simply ``. +// returns a *string when successful +func (m *CodeScanningAnalysis) GetRef()(*string) { + return m.ref +} +// GetResultsCount gets the results_count property value. The total number of results in the analysis. +// returns a *int32 when successful +func (m *CodeScanningAnalysis) GetResultsCount()(*int32) { + return m.results_count +} +// GetRulesCount gets the rules_count property value. The total number of rules used in the analysis. +// returns a *int32 when successful +func (m *CodeScanningAnalysis) GetRulesCount()(*int32) { + return m.rules_count +} +// GetSarifId gets the sarif_id property value. An identifier for the upload. +// returns a *string when successful +func (m *CodeScanningAnalysis) GetSarifId()(*string) { + return m.sarif_id +} +// GetTool gets the tool property value. The tool property +// returns a CodeScanningAnalysisToolable when successful +func (m *CodeScanningAnalysis) GetTool()(CodeScanningAnalysisToolable) { + return m.tool +} +// GetUrl gets the url property value. The REST API URL of the analysis resource. +// returns a *string when successful +func (m *CodeScanningAnalysis) GetUrl()(*string) { + return m.url +} +// GetWarning gets the warning property value. Warning generated when processing the analysis +// returns a *string when successful +func (m *CodeScanningAnalysis) GetWarning()(*string) { + return m.warning +} +// Serialize serializes information the current object +func (m *CodeScanningAnalysis) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("analysis_key", m.GetAnalysisKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("category", m.GetCategory()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_sha", m.GetCommitSha()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("deletable", m.GetDeletable()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("error", m.GetError()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("results_count", m.GetResultsCount()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("rules_count", m.GetRulesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sarif_id", m.GetSarifId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tool", m.GetTool()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("warning", m.GetWarning()) + 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 *CodeScanningAnalysis) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAnalysisKey sets the analysis_key property value. Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. +func (m *CodeScanningAnalysis) SetAnalysisKey(value *string)() { + m.analysis_key = value +} +// SetCategory sets the category property value. Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. +func (m *CodeScanningAnalysis) SetCategory(value *string)() { + m.category = value +} +// SetCommitSha sets the commit_sha property value. The SHA of the commit to which the analysis you are uploading relates. +func (m *CodeScanningAnalysis) SetCommitSha(value *string)() { + m.commit_sha = value +} +// SetCreatedAt sets the created_at property value. The time that the analysis was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAnalysis) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDeletable sets the deletable property value. The deletable property +func (m *CodeScanningAnalysis) SetDeletable(value *bool)() { + m.deletable = value +} +// SetEnvironment sets the environment property value. Identifies the variable values associated with the environment in which this analysis was performed. +func (m *CodeScanningAnalysis) SetEnvironment(value *string)() { + m.environment = value +} +// SetError sets the error property value. The error property +func (m *CodeScanningAnalysis) SetError(value *string)() { + m.error = value +} +// SetId sets the id property value. Unique identifier for this analysis. +func (m *CodeScanningAnalysis) SetId(value *int32)() { + m.id = value +} +// SetRef sets the ref property value. The Git reference, formatted as `refs/pull//merge`, `refs/pull//head`,`refs/heads/` or simply ``. +func (m *CodeScanningAnalysis) SetRef(value *string)() { + m.ref = value +} +// SetResultsCount sets the results_count property value. The total number of results in the analysis. +func (m *CodeScanningAnalysis) SetResultsCount(value *int32)() { + m.results_count = value +} +// SetRulesCount sets the rules_count property value. The total number of rules used in the analysis. +func (m *CodeScanningAnalysis) SetRulesCount(value *int32)() { + m.rules_count = value +} +// SetSarifId sets the sarif_id property value. An identifier for the upload. +func (m *CodeScanningAnalysis) SetSarifId(value *string)() { + m.sarif_id = value +} +// SetTool sets the tool property value. The tool property +func (m *CodeScanningAnalysis) SetTool(value CodeScanningAnalysisToolable)() { + m.tool = value +} +// SetUrl sets the url property value. The REST API URL of the analysis resource. +func (m *CodeScanningAnalysis) SetUrl(value *string)() { + m.url = value +} +// SetWarning sets the warning property value. Warning generated when processing the analysis +func (m *CodeScanningAnalysis) SetWarning(value *string)() { + m.warning = value +} +type CodeScanningAnalysisable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAnalysisKey()(*string) + GetCategory()(*string) + GetCommitSha()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDeletable()(*bool) + GetEnvironment()(*string) + GetError()(*string) + GetId()(*int32) + GetRef()(*string) + GetResultsCount()(*int32) + GetRulesCount()(*int32) + GetSarifId()(*string) + GetTool()(CodeScanningAnalysisToolable) + GetUrl()(*string) + GetWarning()(*string) + SetAnalysisKey(value *string)() + SetCategory(value *string)() + SetCommitSha(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDeletable(value *bool)() + SetEnvironment(value *string)() + SetError(value *string)() + SetId(value *int32)() + SetRef(value *string)() + SetResultsCount(value *int32)() + SetRulesCount(value *int32)() + SetSarifId(value *string)() + SetTool(value CodeScanningAnalysisToolable)() + SetUrl(value *string)() + SetWarning(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_analysis503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_analysis503_error.go new file mode 100644 index 000000000..888313c90 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_analysis503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAnalysis503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewCodeScanningAnalysis503Error instantiates a new CodeScanningAnalysis503Error and sets the default values. +func NewCodeScanningAnalysis503Error()(*CodeScanningAnalysis503Error) { + m := &CodeScanningAnalysis503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAnalysis503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAnalysis503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAnalysis503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodeScanningAnalysis503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CodeScanningAnalysis503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodeScanningAnalysis503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodeScanningAnalysis503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAnalysis503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *CodeScanningAnalysis503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodeScanningAnalysis503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *CodeScanningAnalysis503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodeScanningAnalysis503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodeScanningAnalysis503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningAnalysis503Error) SetMessage(value *string)() { + m.message = value +} +type CodeScanningAnalysis503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_analysis_deletion.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_analysis_deletion.go new file mode 100644 index 000000000..0e104ce9a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_analysis_deletion.go @@ -0,0 +1,98 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeScanningAnalysisDeletion successful deletion of a code scanning analysis +type CodeScanningAnalysisDeletion struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Next deletable analysis in chain, with last analysis deletion confirmation + confirm_delete_url *string + // Next deletable analysis in chain, without last analysis deletion confirmation + next_analysis_url *string +} +// NewCodeScanningAnalysisDeletion instantiates a new CodeScanningAnalysisDeletion and sets the default values. +func NewCodeScanningAnalysisDeletion()(*CodeScanningAnalysisDeletion) { + m := &CodeScanningAnalysisDeletion{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAnalysisDeletionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAnalysisDeletionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAnalysisDeletion(), 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 *CodeScanningAnalysisDeletion) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfirmDeleteUrl gets the confirm_delete_url property value. Next deletable analysis in chain, with last analysis deletion confirmation +// returns a *string when successful +func (m *CodeScanningAnalysisDeletion) GetConfirmDeleteUrl()(*string) { + return m.confirm_delete_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAnalysisDeletion) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["confirm_delete_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetConfirmDeleteUrl(val) + } + return nil + } + res["next_analysis_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNextAnalysisUrl(val) + } + return nil + } + return res +} +// GetNextAnalysisUrl gets the next_analysis_url property value. Next deletable analysis in chain, without last analysis deletion confirmation +// returns a *string when successful +func (m *CodeScanningAnalysisDeletion) GetNextAnalysisUrl()(*string) { + return m.next_analysis_url +} +// Serialize serializes information the current object +func (m *CodeScanningAnalysisDeletion) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *CodeScanningAnalysisDeletion) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfirmDeleteUrl sets the confirm_delete_url property value. Next deletable analysis in chain, with last analysis deletion confirmation +func (m *CodeScanningAnalysisDeletion) SetConfirmDeleteUrl(value *string)() { + m.confirm_delete_url = value +} +// SetNextAnalysisUrl sets the next_analysis_url property value. Next deletable analysis in chain, without last analysis deletion confirmation +func (m *CodeScanningAnalysisDeletion) SetNextAnalysisUrl(value *string)() { + m.next_analysis_url = value +} +type CodeScanningAnalysisDeletionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetConfirmDeleteUrl()(*string) + GetNextAnalysisUrl()(*string) + SetConfirmDeleteUrl(value *string)() + SetNextAnalysisUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_analysis_deletion503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_analysis_deletion503_error.go new file mode 100644 index 000000000..9a69878c4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_analysis_deletion503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAnalysisDeletion503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewCodeScanningAnalysisDeletion503Error instantiates a new CodeScanningAnalysisDeletion503Error and sets the default values. +func NewCodeScanningAnalysisDeletion503Error()(*CodeScanningAnalysisDeletion503Error) { + m := &CodeScanningAnalysisDeletion503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAnalysisDeletion503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAnalysisDeletion503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAnalysisDeletion503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodeScanningAnalysisDeletion503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CodeScanningAnalysisDeletion503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodeScanningAnalysisDeletion503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodeScanningAnalysisDeletion503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAnalysisDeletion503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *CodeScanningAnalysisDeletion503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodeScanningAnalysisDeletion503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *CodeScanningAnalysisDeletion503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodeScanningAnalysisDeletion503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodeScanningAnalysisDeletion503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningAnalysisDeletion503Error) SetMessage(value *string)() { + m.message = value +} +type CodeScanningAnalysisDeletion503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_analysis_tool.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_analysis_tool.go new file mode 100644 index 000000000..075ba5417 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_analysis_tool.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAnalysisTool struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The GUID of the tool used to generate the code scanning analysis, if provided in the uploaded SARIF data. + guid *string + // The name of the tool used to generate the code scanning analysis. + name *string + // The version of the tool used to generate the code scanning analysis. + version *string +} +// NewCodeScanningAnalysisTool instantiates a new CodeScanningAnalysisTool and sets the default values. +func NewCodeScanningAnalysisTool()(*CodeScanningAnalysisTool) { + m := &CodeScanningAnalysisTool{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAnalysisToolFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAnalysisToolFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAnalysisTool(), 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 *CodeScanningAnalysisTool) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAnalysisTool) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["guid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGuid(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + return res +} +// GetGuid gets the guid property value. The GUID of the tool used to generate the code scanning analysis, if provided in the uploaded SARIF data. +// returns a *string when successful +func (m *CodeScanningAnalysisTool) GetGuid()(*string) { + return m.guid +} +// GetName gets the name property value. The name of the tool used to generate the code scanning analysis. +// returns a *string when successful +func (m *CodeScanningAnalysisTool) GetName()(*string) { + return m.name +} +// GetVersion gets the version property value. The version of the tool used to generate the code scanning analysis. +// returns a *string when successful +func (m *CodeScanningAnalysisTool) GetVersion()(*string) { + return m.version +} +// Serialize serializes information the current object +func (m *CodeScanningAnalysisTool) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("guid", m.GetGuid()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("version", m.GetVersion()) + 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 *CodeScanningAnalysisTool) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGuid sets the guid property value. The GUID of the tool used to generate the code scanning analysis, if provided in the uploaded SARIF data. +func (m *CodeScanningAnalysisTool) SetGuid(value *string)() { + m.guid = value +} +// SetName sets the name property value. The name of the tool used to generate the code scanning analysis. +func (m *CodeScanningAnalysisTool) SetName(value *string)() { + m.name = value +} +// SetVersion sets the version property value. The version of the tool used to generate the code scanning analysis. +func (m *CodeScanningAnalysisTool) SetVersion(value *string)() { + m.version = value +} +type CodeScanningAnalysisToolable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGuid()(*string) + GetName()(*string) + GetVersion()(*string) + SetGuid(value *string)() + SetName(value *string)() + SetVersion(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_codeql_database.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_codeql_database.go new file mode 100644 index 000000000..3f255e591 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_codeql_database.go @@ -0,0 +1,343 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeScanningCodeqlDatabase a CodeQL database. +type CodeScanningCodeqlDatabase struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit SHA of the repository at the time the CodeQL database was created. + commit_oid *string + // The MIME type of the CodeQL database file. + content_type *string + // The date and time at which the CodeQL database was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The ID of the CodeQL database. + id *int32 + // The language of the CodeQL database. + language *string + // The name of the CodeQL database. + name *string + // The size of the CodeQL database file in bytes. + size *int32 + // The date and time at which the CodeQL database was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + uploader SimpleUserable + // The URL at which to download the CodeQL database. The `Accept` header must be set to the value of the `content_type` property. + url *string +} +// NewCodeScanningCodeqlDatabase instantiates a new CodeScanningCodeqlDatabase and sets the default values. +func NewCodeScanningCodeqlDatabase()(*CodeScanningCodeqlDatabase) { + m := &CodeScanningCodeqlDatabase{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningCodeqlDatabaseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningCodeqlDatabaseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningCodeqlDatabase(), 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 *CodeScanningCodeqlDatabase) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitOid gets the commit_oid property value. The commit SHA of the repository at the time the CodeQL database was created. +// returns a *string when successful +func (m *CodeScanningCodeqlDatabase) GetCommitOid()(*string) { + return m.commit_oid +} +// GetContentType gets the content_type property value. The MIME type of the CodeQL database file. +// returns a *string when successful +func (m *CodeScanningCodeqlDatabase) GetContentType()(*string) { + return m.content_type +} +// GetCreatedAt gets the created_at property value. The date and time at which the CodeQL database was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +// returns a *Time when successful +func (m *CodeScanningCodeqlDatabase) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningCodeqlDatabase) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["commit_oid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitOid(val) + } + return nil + } + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["uploader"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUploader(val.(SimpleUserable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The ID of the CodeQL database. +// returns a *int32 when successful +func (m *CodeScanningCodeqlDatabase) GetId()(*int32) { + return m.id +} +// GetLanguage gets the language property value. The language of the CodeQL database. +// returns a *string when successful +func (m *CodeScanningCodeqlDatabase) GetLanguage()(*string) { + return m.language +} +// GetName gets the name property value. The name of the CodeQL database. +// returns a *string when successful +func (m *CodeScanningCodeqlDatabase) GetName()(*string) { + return m.name +} +// GetSize gets the size property value. The size of the CodeQL database file in bytes. +// returns a *int32 when successful +func (m *CodeScanningCodeqlDatabase) GetSize()(*int32) { + return m.size +} +// GetUpdatedAt gets the updated_at property value. The date and time at which the CodeQL database was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +// returns a *Time when successful +func (m *CodeScanningCodeqlDatabase) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUploader gets the uploader property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *CodeScanningCodeqlDatabase) GetUploader()(SimpleUserable) { + return m.uploader +} +// GetUrl gets the url property value. The URL at which to download the CodeQL database. The `Accept` header must be set to the value of the `content_type` property. +// returns a *string when successful +func (m *CodeScanningCodeqlDatabase) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CodeScanningCodeqlDatabase) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("commit_oid", m.GetCommitOid()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("uploader", m.GetUploader()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CodeScanningCodeqlDatabase) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitOid sets the commit_oid property value. The commit SHA of the repository at the time the CodeQL database was created. +func (m *CodeScanningCodeqlDatabase) SetCommitOid(value *string)() { + m.commit_oid = value +} +// SetContentType sets the content_type property value. The MIME type of the CodeQL database file. +func (m *CodeScanningCodeqlDatabase) SetContentType(value *string)() { + m.content_type = value +} +// SetCreatedAt sets the created_at property value. The date and time at which the CodeQL database was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +func (m *CodeScanningCodeqlDatabase) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The ID of the CodeQL database. +func (m *CodeScanningCodeqlDatabase) SetId(value *int32)() { + m.id = value +} +// SetLanguage sets the language property value. The language of the CodeQL database. +func (m *CodeScanningCodeqlDatabase) SetLanguage(value *string)() { + m.language = value +} +// SetName sets the name property value. The name of the CodeQL database. +func (m *CodeScanningCodeqlDatabase) SetName(value *string)() { + m.name = value +} +// SetSize sets the size property value. The size of the CodeQL database file in bytes. +func (m *CodeScanningCodeqlDatabase) SetSize(value *int32)() { + m.size = value +} +// SetUpdatedAt sets the updated_at property value. The date and time at which the CodeQL database was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +func (m *CodeScanningCodeqlDatabase) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUploader sets the uploader property value. A GitHub user. +func (m *CodeScanningCodeqlDatabase) SetUploader(value SimpleUserable)() { + m.uploader = value +} +// SetUrl sets the url property value. The URL at which to download the CodeQL database. The `Accept` header must be set to the value of the `content_type` property. +func (m *CodeScanningCodeqlDatabase) SetUrl(value *string)() { + m.url = value +} +type CodeScanningCodeqlDatabaseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommitOid()(*string) + GetContentType()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int32) + GetLanguage()(*string) + GetName()(*string) + GetSize()(*int32) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUploader()(SimpleUserable) + GetUrl()(*string) + SetCommitOid(value *string)() + SetContentType(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int32)() + SetLanguage(value *string)() + SetName(value *string)() + SetSize(value *int32)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUploader(value SimpleUserable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_codeql_database503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_codeql_database503_error.go new file mode 100644 index 000000000..0d21359e4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_codeql_database503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningCodeqlDatabase503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewCodeScanningCodeqlDatabase503Error instantiates a new CodeScanningCodeqlDatabase503Error and sets the default values. +func NewCodeScanningCodeqlDatabase503Error()(*CodeScanningCodeqlDatabase503Error) { + m := &CodeScanningCodeqlDatabase503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningCodeqlDatabase503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningCodeqlDatabase503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningCodeqlDatabase503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodeScanningCodeqlDatabase503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CodeScanningCodeqlDatabase503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodeScanningCodeqlDatabase503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodeScanningCodeqlDatabase503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningCodeqlDatabase503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *CodeScanningCodeqlDatabase503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodeScanningCodeqlDatabase503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *CodeScanningCodeqlDatabase503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodeScanningCodeqlDatabase503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodeScanningCodeqlDatabase503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningCodeqlDatabase503Error) SetMessage(value *string)() { + m.message = value +} +type CodeScanningCodeqlDatabase503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup.go new file mode 100644 index 000000000..01af17527 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup.go @@ -0,0 +1,207 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeScanningDefaultSetup configuration for code scanning default setup. +type CodeScanningDefaultSetup struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Languages to be analyzed. + languages []CodeScanningDefaultSetup_languages + // CodeQL query suite to be used. + query_suite *CodeScanningDefaultSetup_query_suite + // The frequency of the periodic analysis. + schedule *CodeScanningDefaultSetup_schedule + // Code scanning default setup has been configured or not. + state *CodeScanningDefaultSetup_state + // Timestamp of latest configuration update. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewCodeScanningDefaultSetup instantiates a new CodeScanningDefaultSetup and sets the default values. +func NewCodeScanningDefaultSetup()(*CodeScanningDefaultSetup) { + m := &CodeScanningDefaultSetup{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningDefaultSetupFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningDefaultSetupFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningDefaultSetup(), 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 *CodeScanningDefaultSetup) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningDefaultSetup) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["languages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(ParseCodeScanningDefaultSetup_languages) + if err != nil { + return err + } + if val != nil { + res := make([]CodeScanningDefaultSetup_languages, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*CodeScanningDefaultSetup_languages)) + } + } + m.SetLanguages(res) + } + return nil + } + res["query_suite"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningDefaultSetup_query_suite) + if err != nil { + return err + } + if val != nil { + m.SetQuerySuite(val.(*CodeScanningDefaultSetup_query_suite)) + } + return nil + } + res["schedule"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningDefaultSetup_schedule) + if err != nil { + return err + } + if val != nil { + m.SetSchedule(val.(*CodeScanningDefaultSetup_schedule)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningDefaultSetup_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*CodeScanningDefaultSetup_state)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetLanguages gets the languages property value. Languages to be analyzed. +// returns a []CodeScanningDefaultSetup_languages when successful +func (m *CodeScanningDefaultSetup) GetLanguages()([]CodeScanningDefaultSetup_languages) { + return m.languages +} +// GetQuerySuite gets the query_suite property value. CodeQL query suite to be used. +// returns a *CodeScanningDefaultSetup_query_suite when successful +func (m *CodeScanningDefaultSetup) GetQuerySuite()(*CodeScanningDefaultSetup_query_suite) { + return m.query_suite +} +// GetSchedule gets the schedule property value. The frequency of the periodic analysis. +// returns a *CodeScanningDefaultSetup_schedule when successful +func (m *CodeScanningDefaultSetup) GetSchedule()(*CodeScanningDefaultSetup_schedule) { + return m.schedule +} +// GetState gets the state property value. Code scanning default setup has been configured or not. +// returns a *CodeScanningDefaultSetup_state when successful +func (m *CodeScanningDefaultSetup) GetState()(*CodeScanningDefaultSetup_state) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. Timestamp of latest configuration update. +// returns a *Time when successful +func (m *CodeScanningDefaultSetup) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *CodeScanningDefaultSetup) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLanguages() != nil { + err := writer.WriteCollectionOfStringValues("languages", SerializeCodeScanningDefaultSetup_languages(m.GetLanguages())) + if err != nil { + return err + } + } + if m.GetQuerySuite() != nil { + cast := (*m.GetQuerySuite()).String() + err := writer.WriteStringValue("query_suite", &cast) + if err != nil { + return err + } + } + if m.GetSchedule() != nil { + cast := (*m.GetSchedule()).String() + err := writer.WriteStringValue("schedule", &cast) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + 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 *CodeScanningDefaultSetup) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLanguages sets the languages property value. Languages to be analyzed. +func (m *CodeScanningDefaultSetup) SetLanguages(value []CodeScanningDefaultSetup_languages)() { + m.languages = value +} +// SetQuerySuite sets the query_suite property value. CodeQL query suite to be used. +func (m *CodeScanningDefaultSetup) SetQuerySuite(value *CodeScanningDefaultSetup_query_suite)() { + m.query_suite = value +} +// SetSchedule sets the schedule property value. The frequency of the periodic analysis. +func (m *CodeScanningDefaultSetup) SetSchedule(value *CodeScanningDefaultSetup_schedule)() { + m.schedule = value +} +// SetState sets the state property value. Code scanning default setup has been configured or not. +func (m *CodeScanningDefaultSetup) SetState(value *CodeScanningDefaultSetup_state)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. Timestamp of latest configuration update. +func (m *CodeScanningDefaultSetup) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type CodeScanningDefaultSetupable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLanguages()([]CodeScanningDefaultSetup_languages) + GetQuerySuite()(*CodeScanningDefaultSetup_query_suite) + GetSchedule()(*CodeScanningDefaultSetup_schedule) + GetState()(*CodeScanningDefaultSetup_state) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetLanguages(value []CodeScanningDefaultSetup_languages)() + SetQuerySuite(value *CodeScanningDefaultSetup_query_suite)() + SetSchedule(value *CodeScanningDefaultSetup_schedule)() + SetState(value *CodeScanningDefaultSetup_state)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup503_error.go new file mode 100644 index 000000000..80210d361 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningDefaultSetup503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewCodeScanningDefaultSetup503Error instantiates a new CodeScanningDefaultSetup503Error and sets the default values. +func NewCodeScanningDefaultSetup503Error()(*CodeScanningDefaultSetup503Error) { + m := &CodeScanningDefaultSetup503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningDefaultSetup503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningDefaultSetup503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningDefaultSetup503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodeScanningDefaultSetup503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CodeScanningDefaultSetup503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodeScanningDefaultSetup503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodeScanningDefaultSetup503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningDefaultSetup503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *CodeScanningDefaultSetup503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodeScanningDefaultSetup503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *CodeScanningDefaultSetup503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodeScanningDefaultSetup503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodeScanningDefaultSetup503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningDefaultSetup503Error) SetMessage(value *string)() { + m.message = value +} +type CodeScanningDefaultSetup503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_languages.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_languages.go new file mode 100644 index 000000000..e5bdd501f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_languages.go @@ -0,0 +1,60 @@ +package models +import ( + "errors" +) +type CodeScanningDefaultSetup_languages int + +const ( + CCPP_CODESCANNINGDEFAULTSETUP_LANGUAGES CodeScanningDefaultSetup_languages = iota + CSHARP_CODESCANNINGDEFAULTSETUP_LANGUAGES + GO_CODESCANNINGDEFAULTSETUP_LANGUAGES + JAVAKOTLIN_CODESCANNINGDEFAULTSETUP_LANGUAGES + JAVASCRIPTTYPESCRIPT_CODESCANNINGDEFAULTSETUP_LANGUAGES + JAVASCRIPT_CODESCANNINGDEFAULTSETUP_LANGUAGES + PYTHON_CODESCANNINGDEFAULTSETUP_LANGUAGES + RUBY_CODESCANNINGDEFAULTSETUP_LANGUAGES + TYPESCRIPT_CODESCANNINGDEFAULTSETUP_LANGUAGES + SWIFT_CODESCANNINGDEFAULTSETUP_LANGUAGES +) + +func (i CodeScanningDefaultSetup_languages) String() string { + return []string{"c-cpp", "csharp", "go", "java-kotlin", "javascript-typescript", "javascript", "python", "ruby", "typescript", "swift"}[i] +} +func ParseCodeScanningDefaultSetup_languages(v string) (any, error) { + result := CCPP_CODESCANNINGDEFAULTSETUP_LANGUAGES + switch v { + case "c-cpp": + result = CCPP_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "csharp": + result = CSHARP_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "go": + result = GO_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "java-kotlin": + result = JAVAKOTLIN_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "javascript-typescript": + result = JAVASCRIPTTYPESCRIPT_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "javascript": + result = JAVASCRIPT_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "python": + result = PYTHON_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "ruby": + result = RUBY_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "typescript": + result = TYPESCRIPT_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "swift": + result = SWIFT_CODESCANNINGDEFAULTSETUP_LANGUAGES + default: + return 0, errors.New("Unknown CodeScanningDefaultSetup_languages value: " + v) + } + return &result, nil +} +func SerializeCodeScanningDefaultSetup_languages(values []CodeScanningDefaultSetup_languages) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningDefaultSetup_languages) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_query_suite.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_query_suite.go new file mode 100644 index 000000000..ac529a4bb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_query_suite.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// CodeQL query suite to be used. +type CodeScanningDefaultSetup_query_suite int + +const ( + DEFAULT_CODESCANNINGDEFAULTSETUP_QUERY_SUITE CodeScanningDefaultSetup_query_suite = iota + EXTENDED_CODESCANNINGDEFAULTSETUP_QUERY_SUITE +) + +func (i CodeScanningDefaultSetup_query_suite) String() string { + return []string{"default", "extended"}[i] +} +func ParseCodeScanningDefaultSetup_query_suite(v string) (any, error) { + result := DEFAULT_CODESCANNINGDEFAULTSETUP_QUERY_SUITE + switch v { + case "default": + result = DEFAULT_CODESCANNINGDEFAULTSETUP_QUERY_SUITE + case "extended": + result = EXTENDED_CODESCANNINGDEFAULTSETUP_QUERY_SUITE + default: + return 0, errors.New("Unknown CodeScanningDefaultSetup_query_suite value: " + v) + } + return &result, nil +} +func SerializeCodeScanningDefaultSetup_query_suite(values []CodeScanningDefaultSetup_query_suite) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningDefaultSetup_query_suite) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_schedule.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_schedule.go new file mode 100644 index 000000000..341dff8ad --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_schedule.go @@ -0,0 +1,34 @@ +package models +import ( + "errors" +) +// The frequency of the periodic analysis. +type CodeScanningDefaultSetup_schedule int + +const ( + WEEKLY_CODESCANNINGDEFAULTSETUP_SCHEDULE CodeScanningDefaultSetup_schedule = iota +) + +func (i CodeScanningDefaultSetup_schedule) String() string { + return []string{"weekly"}[i] +} +func ParseCodeScanningDefaultSetup_schedule(v string) (any, error) { + result := WEEKLY_CODESCANNINGDEFAULTSETUP_SCHEDULE + switch v { + case "weekly": + result = WEEKLY_CODESCANNINGDEFAULTSETUP_SCHEDULE + default: + return 0, errors.New("Unknown CodeScanningDefaultSetup_schedule value: " + v) + } + return &result, nil +} +func SerializeCodeScanningDefaultSetup_schedule(values []CodeScanningDefaultSetup_schedule) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningDefaultSetup_schedule) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_state.go new file mode 100644 index 000000000..60ecd6e20 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_state.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// Code scanning default setup has been configured or not. +type CodeScanningDefaultSetup_state int + +const ( + CONFIGURED_CODESCANNINGDEFAULTSETUP_STATE CodeScanningDefaultSetup_state = iota + NOTCONFIGURED_CODESCANNINGDEFAULTSETUP_STATE +) + +func (i CodeScanningDefaultSetup_state) String() string { + return []string{"configured", "not-configured"}[i] +} +func ParseCodeScanningDefaultSetup_state(v string) (any, error) { + result := CONFIGURED_CODESCANNINGDEFAULTSETUP_STATE + switch v { + case "configured": + result = CONFIGURED_CODESCANNINGDEFAULTSETUP_STATE + case "not-configured": + result = NOTCONFIGURED_CODESCANNINGDEFAULTSETUP_STATE + default: + return 0, errors.New("Unknown CodeScanningDefaultSetup_state value: " + v) + } + return &result, nil +} +func SerializeCodeScanningDefaultSetup_state(values []CodeScanningDefaultSetup_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningDefaultSetup_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_update.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_update.go new file mode 100644 index 000000000..afe9a8c21 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_update.go @@ -0,0 +1,128 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeScanningDefaultSetupUpdate configuration for code scanning default setup. +type CodeScanningDefaultSetupUpdate struct { + // CodeQL languages to be analyzed. + languages []CodeScanningDefaultSetupUpdate_languages + // CodeQL query suite to be used. + query_suite *CodeScanningDefaultSetupUpdate_query_suite + // The desired state of code scanning default setup. + state *CodeScanningDefaultSetupUpdate_state +} +// NewCodeScanningDefaultSetupUpdate instantiates a new CodeScanningDefaultSetupUpdate and sets the default values. +func NewCodeScanningDefaultSetupUpdate()(*CodeScanningDefaultSetupUpdate) { + m := &CodeScanningDefaultSetupUpdate{ + } + return m +} +// CreateCodeScanningDefaultSetupUpdateFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningDefaultSetupUpdateFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningDefaultSetupUpdate(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningDefaultSetupUpdate) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["languages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(ParseCodeScanningDefaultSetupUpdate_languages) + if err != nil { + return err + } + if val != nil { + res := make([]CodeScanningDefaultSetupUpdate_languages, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*CodeScanningDefaultSetupUpdate_languages)) + } + } + m.SetLanguages(res) + } + return nil + } + res["query_suite"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningDefaultSetupUpdate_query_suite) + if err != nil { + return err + } + if val != nil { + m.SetQuerySuite(val.(*CodeScanningDefaultSetupUpdate_query_suite)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningDefaultSetupUpdate_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*CodeScanningDefaultSetupUpdate_state)) + } + return nil + } + return res +} +// GetLanguages gets the languages property value. CodeQL languages to be analyzed. +// returns a []CodeScanningDefaultSetupUpdate_languages when successful +func (m *CodeScanningDefaultSetupUpdate) GetLanguages()([]CodeScanningDefaultSetupUpdate_languages) { + return m.languages +} +// GetQuerySuite gets the query_suite property value. CodeQL query suite to be used. +// returns a *CodeScanningDefaultSetupUpdate_query_suite when successful +func (m *CodeScanningDefaultSetupUpdate) GetQuerySuite()(*CodeScanningDefaultSetupUpdate_query_suite) { + return m.query_suite +} +// GetState gets the state property value. The desired state of code scanning default setup. +// returns a *CodeScanningDefaultSetupUpdate_state when successful +func (m *CodeScanningDefaultSetupUpdate) GetState()(*CodeScanningDefaultSetupUpdate_state) { + return m.state +} +// Serialize serializes information the current object +func (m *CodeScanningDefaultSetupUpdate) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLanguages() != nil { + err := writer.WriteCollectionOfStringValues("languages", SerializeCodeScanningDefaultSetupUpdate_languages(m.GetLanguages())) + if err != nil { + return err + } + } + if m.GetQuerySuite() != nil { + cast := (*m.GetQuerySuite()).String() + err := writer.WriteStringValue("query_suite", &cast) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + return nil +} +// SetLanguages sets the languages property value. CodeQL languages to be analyzed. +func (m *CodeScanningDefaultSetupUpdate) SetLanguages(value []CodeScanningDefaultSetupUpdate_languages)() { + m.languages = value +} +// SetQuerySuite sets the query_suite property value. CodeQL query suite to be used. +func (m *CodeScanningDefaultSetupUpdate) SetQuerySuite(value *CodeScanningDefaultSetupUpdate_query_suite)() { + m.query_suite = value +} +// SetState sets the state property value. The desired state of code scanning default setup. +func (m *CodeScanningDefaultSetupUpdate) SetState(value *CodeScanningDefaultSetupUpdate_state)() { + m.state = value +} +type CodeScanningDefaultSetupUpdateable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLanguages()([]CodeScanningDefaultSetupUpdate_languages) + GetQuerySuite()(*CodeScanningDefaultSetupUpdate_query_suite) + GetState()(*CodeScanningDefaultSetupUpdate_state) + SetLanguages(value []CodeScanningDefaultSetupUpdate_languages)() + SetQuerySuite(value *CodeScanningDefaultSetupUpdate_query_suite)() + SetState(value *CodeScanningDefaultSetupUpdate_state)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_update_languages.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_update_languages.go new file mode 100644 index 000000000..555d19c76 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_update_languages.go @@ -0,0 +1,54 @@ +package models +import ( + "errors" +) +type CodeScanningDefaultSetupUpdate_languages int + +const ( + CCPP_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES CodeScanningDefaultSetupUpdate_languages = iota + CSHARP_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + GO_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + JAVAKOTLIN_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + JAVASCRIPTTYPESCRIPT_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + PYTHON_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + RUBY_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + SWIFT_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES +) + +func (i CodeScanningDefaultSetupUpdate_languages) String() string { + return []string{"c-cpp", "csharp", "go", "java-kotlin", "javascript-typescript", "python", "ruby", "swift"}[i] +} +func ParseCodeScanningDefaultSetupUpdate_languages(v string) (any, error) { + result := CCPP_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + switch v { + case "c-cpp": + result = CCPP_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + case "csharp": + result = CSHARP_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + case "go": + result = GO_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + case "java-kotlin": + result = JAVAKOTLIN_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + case "javascript-typescript": + result = JAVASCRIPTTYPESCRIPT_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + case "python": + result = PYTHON_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + case "ruby": + result = RUBY_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + case "swift": + result = SWIFT_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + default: + return 0, errors.New("Unknown CodeScanningDefaultSetupUpdate_languages value: " + v) + } + return &result, nil +} +func SerializeCodeScanningDefaultSetupUpdate_languages(values []CodeScanningDefaultSetupUpdate_languages) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningDefaultSetupUpdate_languages) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_update_query_suite.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_update_query_suite.go new file mode 100644 index 000000000..3ec3c5e56 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_update_query_suite.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// CodeQL query suite to be used. +type CodeScanningDefaultSetupUpdate_query_suite int + +const ( + DEFAULT_CODESCANNINGDEFAULTSETUPUPDATE_QUERY_SUITE CodeScanningDefaultSetupUpdate_query_suite = iota + EXTENDED_CODESCANNINGDEFAULTSETUPUPDATE_QUERY_SUITE +) + +func (i CodeScanningDefaultSetupUpdate_query_suite) String() string { + return []string{"default", "extended"}[i] +} +func ParseCodeScanningDefaultSetupUpdate_query_suite(v string) (any, error) { + result := DEFAULT_CODESCANNINGDEFAULTSETUPUPDATE_QUERY_SUITE + switch v { + case "default": + result = DEFAULT_CODESCANNINGDEFAULTSETUPUPDATE_QUERY_SUITE + case "extended": + result = EXTENDED_CODESCANNINGDEFAULTSETUPUPDATE_QUERY_SUITE + default: + return 0, errors.New("Unknown CodeScanningDefaultSetupUpdate_query_suite value: " + v) + } + return &result, nil +} +func SerializeCodeScanningDefaultSetupUpdate_query_suite(values []CodeScanningDefaultSetupUpdate_query_suite) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningDefaultSetupUpdate_query_suite) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_update_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_update_state.go new file mode 100644 index 000000000..62a21fb4f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_default_setup_update_state.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The desired state of code scanning default setup. +type CodeScanningDefaultSetupUpdate_state int + +const ( + CONFIGURED_CODESCANNINGDEFAULTSETUPUPDATE_STATE CodeScanningDefaultSetupUpdate_state = iota + NOTCONFIGURED_CODESCANNINGDEFAULTSETUPUPDATE_STATE +) + +func (i CodeScanningDefaultSetupUpdate_state) String() string { + return []string{"configured", "not-configured"}[i] +} +func ParseCodeScanningDefaultSetupUpdate_state(v string) (any, error) { + result := CONFIGURED_CODESCANNINGDEFAULTSETUPUPDATE_STATE + switch v { + case "configured": + result = CONFIGURED_CODESCANNINGDEFAULTSETUPUPDATE_STATE + case "not-configured": + result = NOTCONFIGURED_CODESCANNINGDEFAULTSETUPUPDATE_STATE + default: + return 0, errors.New("Unknown CodeScanningDefaultSetupUpdate_state value: " + v) + } + return &result, nil +} +func SerializeCodeScanningDefaultSetupUpdate_state(values []CodeScanningDefaultSetupUpdate_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningDefaultSetupUpdate_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_organization_alert_items.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_organization_alert_items.go new file mode 100644 index 000000000..c35910ab7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_organization_alert_items.go @@ -0,0 +1,470 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningOrganizationAlertItems struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + dismissed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + dismissed_by NullableSimpleUserable + // The dismissal comment associated with the dismissal of the alert. + dismissed_comment *string + // **Required when the state is dismissed.** The reason for dismissing or closing the alert. + dismissed_reason *CodeScanningAlertDismissedReason + // The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + fixed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The GitHub URL of the alert resource. + html_url *string + // The REST API URL for fetching the list of instances for an alert. + instances_url *string + // The most_recent_instance property + most_recent_instance CodeScanningAlertInstanceable + // The security alert number. + number *int32 + // A GitHub repository. + repository SimpleRepositoryable + // The rule property + rule CodeScanningAlertRuleSummaryable + // State of a code scanning alert. + state *CodeScanningAlertState + // The tool property + tool CodeScanningAnalysisToolable + // The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The REST API URL of the alert resource. + url *string +} +// NewCodeScanningOrganizationAlertItems instantiates a new CodeScanningOrganizationAlertItems and sets the default values. +func NewCodeScanningOrganizationAlertItems()(*CodeScanningOrganizationAlertItems) { + m := &CodeScanningOrganizationAlertItems{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningOrganizationAlertItemsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningOrganizationAlertItemsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningOrganizationAlertItems(), 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 *CodeScanningOrganizationAlertItems) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningOrganizationAlertItems) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDismissedAt gets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningOrganizationAlertItems) GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.dismissed_at +} +// GetDismissedBy gets the dismissed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *CodeScanningOrganizationAlertItems) GetDismissedBy()(NullableSimpleUserable) { + return m.dismissed_by +} +// GetDismissedComment gets the dismissed_comment property value. The dismissal comment associated with the dismissal of the alert. +// returns a *string when successful +func (m *CodeScanningOrganizationAlertItems) GetDismissedComment()(*string) { + return m.dismissed_comment +} +// GetDismissedReason gets the dismissed_reason property value. **Required when the state is dismissed.** The reason for dismissing or closing the alert. +// returns a *CodeScanningAlertDismissedReason when successful +func (m *CodeScanningOrganizationAlertItems) GetDismissedReason()(*CodeScanningAlertDismissedReason) { + return m.dismissed_reason +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningOrganizationAlertItems) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["dismissed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedAt(val) + } + return nil + } + res["dismissed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["dismissed_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedComment(val) + } + return nil + } + res["dismissed_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertDismissedReason) + if err != nil { + return err + } + if val != nil { + m.SetDismissedReason(val.(*CodeScanningAlertDismissedReason)) + } + return nil + } + res["fixed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetFixedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["instances_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInstancesUrl(val) + } + return nil + } + res["most_recent_instance"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAlertInstanceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMostRecentInstance(val.(CodeScanningAlertInstanceable)) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(SimpleRepositoryable)) + } + return nil + } + res["rule"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAlertRuleSummaryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRule(val.(CodeScanningAlertRuleSummaryable)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*CodeScanningAlertState)) + } + return nil + } + res["tool"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAnalysisToolFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTool(val.(CodeScanningAnalysisToolable)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFixedAt gets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningOrganizationAlertItems) GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.fixed_at +} +// GetHtmlUrl gets the html_url property value. The GitHub URL of the alert resource. +// returns a *string when successful +func (m *CodeScanningOrganizationAlertItems) GetHtmlUrl()(*string) { + return m.html_url +} +// GetInstancesUrl gets the instances_url property value. The REST API URL for fetching the list of instances for an alert. +// returns a *string when successful +func (m *CodeScanningOrganizationAlertItems) GetInstancesUrl()(*string) { + return m.instances_url +} +// GetMostRecentInstance gets the most_recent_instance property value. The most_recent_instance property +// returns a CodeScanningAlertInstanceable when successful +func (m *CodeScanningOrganizationAlertItems) GetMostRecentInstance()(CodeScanningAlertInstanceable) { + return m.most_recent_instance +} +// GetNumber gets the number property value. The security alert number. +// returns a *int32 when successful +func (m *CodeScanningOrganizationAlertItems) GetNumber()(*int32) { + return m.number +} +// GetRepository gets the repository property value. A GitHub repository. +// returns a SimpleRepositoryable when successful +func (m *CodeScanningOrganizationAlertItems) GetRepository()(SimpleRepositoryable) { + return m.repository +} +// GetRule gets the rule property value. The rule property +// returns a CodeScanningAlertRuleSummaryable when successful +func (m *CodeScanningOrganizationAlertItems) GetRule()(CodeScanningAlertRuleSummaryable) { + return m.rule +} +// GetState gets the state property value. State of a code scanning alert. +// returns a *CodeScanningAlertState when successful +func (m *CodeScanningOrganizationAlertItems) GetState()(*CodeScanningAlertState) { + return m.state +} +// GetTool gets the tool property value. The tool property +// returns a CodeScanningAnalysisToolable when successful +func (m *CodeScanningOrganizationAlertItems) GetTool()(CodeScanningAnalysisToolable) { + return m.tool +} +// GetUpdatedAt gets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningOrganizationAlertItems) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The REST API URL of the alert resource. +// returns a *string when successful +func (m *CodeScanningOrganizationAlertItems) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CodeScanningOrganizationAlertItems) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("dismissed_by", m.GetDismissedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("dismissed_comment", m.GetDismissedComment()) + if err != nil { + return err + } + } + if m.GetDismissedReason() != nil { + cast := (*m.GetDismissedReason()).String() + err := writer.WriteStringValue("dismissed_reason", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("most_recent_instance", m.GetMostRecentInstance()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("rule", m.GetRule()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tool", m.GetTool()) + 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 *CodeScanningOrganizationAlertItems) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningOrganizationAlertItems) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDismissedAt sets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningOrganizationAlertItems) SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.dismissed_at = value +} +// SetDismissedBy sets the dismissed_by property value. A GitHub user. +func (m *CodeScanningOrganizationAlertItems) SetDismissedBy(value NullableSimpleUserable)() { + m.dismissed_by = value +} +// SetDismissedComment sets the dismissed_comment property value. The dismissal comment associated with the dismissal of the alert. +func (m *CodeScanningOrganizationAlertItems) SetDismissedComment(value *string)() { + m.dismissed_comment = value +} +// SetDismissedReason sets the dismissed_reason property value. **Required when the state is dismissed.** The reason for dismissing or closing the alert. +func (m *CodeScanningOrganizationAlertItems) SetDismissedReason(value *CodeScanningAlertDismissedReason)() { + m.dismissed_reason = value +} +// SetFixedAt sets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningOrganizationAlertItems) SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.fixed_at = value +} +// SetHtmlUrl sets the html_url property value. The GitHub URL of the alert resource. +func (m *CodeScanningOrganizationAlertItems) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetInstancesUrl sets the instances_url property value. The REST API URL for fetching the list of instances for an alert. +func (m *CodeScanningOrganizationAlertItems) SetInstancesUrl(value *string)() { + m.instances_url = value +} +// SetMostRecentInstance sets the most_recent_instance property value. The most_recent_instance property +func (m *CodeScanningOrganizationAlertItems) SetMostRecentInstance(value CodeScanningAlertInstanceable)() { + m.most_recent_instance = value +} +// SetNumber sets the number property value. The security alert number. +func (m *CodeScanningOrganizationAlertItems) SetNumber(value *int32)() { + m.number = value +} +// SetRepository sets the repository property value. A GitHub repository. +func (m *CodeScanningOrganizationAlertItems) SetRepository(value SimpleRepositoryable)() { + m.repository = value +} +// SetRule sets the rule property value. The rule property +func (m *CodeScanningOrganizationAlertItems) SetRule(value CodeScanningAlertRuleSummaryable)() { + m.rule = value +} +// SetState sets the state property value. State of a code scanning alert. +func (m *CodeScanningOrganizationAlertItems) SetState(value *CodeScanningAlertState)() { + m.state = value +} +// SetTool sets the tool property value. The tool property +func (m *CodeScanningOrganizationAlertItems) SetTool(value CodeScanningAnalysisToolable)() { + m.tool = value +} +// SetUpdatedAt sets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningOrganizationAlertItems) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The REST API URL of the alert resource. +func (m *CodeScanningOrganizationAlertItems) SetUrl(value *string)() { + m.url = value +} +type CodeScanningOrganizationAlertItemsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedBy()(NullableSimpleUserable) + GetDismissedComment()(*string) + GetDismissedReason()(*CodeScanningAlertDismissedReason) + GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetInstancesUrl()(*string) + GetMostRecentInstance()(CodeScanningAlertInstanceable) + GetNumber()(*int32) + GetRepository()(SimpleRepositoryable) + GetRule()(CodeScanningAlertRuleSummaryable) + GetState()(*CodeScanningAlertState) + GetTool()(CodeScanningAnalysisToolable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedBy(value NullableSimpleUserable)() + SetDismissedComment(value *string)() + SetDismissedReason(value *CodeScanningAlertDismissedReason)() + SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetInstancesUrl(value *string)() + SetMostRecentInstance(value CodeScanningAlertInstanceable)() + SetNumber(value *int32)() + SetRepository(value SimpleRepositoryable)() + SetRule(value CodeScanningAlertRuleSummaryable)() + SetState(value *CodeScanningAlertState)() + SetTool(value CodeScanningAnalysisToolable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_sarifs_receipt.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_sarifs_receipt.go new file mode 100644 index 000000000..ad7bebb7f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_sarifs_receipt.go @@ -0,0 +1,103 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningSarifsReceipt struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // An identifier for the upload. + id *string + // The REST API URL for checking the status of the upload. + url *string +} +// NewCodeScanningSarifsReceipt instantiates a new CodeScanningSarifsReceipt and sets the default values. +func NewCodeScanningSarifsReceipt()(*CodeScanningSarifsReceipt) { + m := &CodeScanningSarifsReceipt{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningSarifsReceiptFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningSarifsReceiptFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningSarifsReceipt(), 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 *CodeScanningSarifsReceipt) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningSarifsReceipt) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. An identifier for the upload. +// returns a *string when successful +func (m *CodeScanningSarifsReceipt) GetId()(*string) { + return m.id +} +// GetUrl gets the url property value. The REST API URL for checking the status of the upload. +// returns a *string when successful +func (m *CodeScanningSarifsReceipt) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CodeScanningSarifsReceipt) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("id", m.GetId()) + 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 *CodeScanningSarifsReceipt) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. An identifier for the upload. +func (m *CodeScanningSarifsReceipt) SetId(value *string)() { + m.id = value +} +// SetUrl sets the url property value. The REST API URL for checking the status of the upload. +func (m *CodeScanningSarifsReceipt) SetUrl(value *string)() { + m.url = value +} +type CodeScanningSarifsReceiptable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*string) + GetUrl()(*string) + SetId(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_sarifs_receipt503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_sarifs_receipt503_error.go new file mode 100644 index 000000000..858708498 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_sarifs_receipt503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningSarifsReceipt503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewCodeScanningSarifsReceipt503Error instantiates a new CodeScanningSarifsReceipt503Error and sets the default values. +func NewCodeScanningSarifsReceipt503Error()(*CodeScanningSarifsReceipt503Error) { + m := &CodeScanningSarifsReceipt503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningSarifsReceipt503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningSarifsReceipt503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningSarifsReceipt503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodeScanningSarifsReceipt503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CodeScanningSarifsReceipt503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodeScanningSarifsReceipt503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodeScanningSarifsReceipt503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningSarifsReceipt503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *CodeScanningSarifsReceipt503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodeScanningSarifsReceipt503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *CodeScanningSarifsReceipt503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodeScanningSarifsReceipt503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodeScanningSarifsReceipt503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningSarifsReceipt503Error) SetMessage(value *string)() { + m.message = value +} +type CodeScanningSarifsReceipt503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_sarifs_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_sarifs_status.go new file mode 100644 index 000000000..43202aec2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_sarifs_status.go @@ -0,0 +1,133 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningSarifsStatus struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The REST API URL for getting the analyses associated with the upload. + analyses_url *string + // Any errors that ocurred during processing of the delivery. + errors []string + // `pending` files have not yet been processed, while `complete` means results from the SARIF have been stored. `failed` files have either not been processed at all, or could only be partially processed. + processing_status *CodeScanningSarifsStatus_processing_status +} +// NewCodeScanningSarifsStatus instantiates a new CodeScanningSarifsStatus and sets the default values. +func NewCodeScanningSarifsStatus()(*CodeScanningSarifsStatus) { + m := &CodeScanningSarifsStatus{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningSarifsStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningSarifsStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningSarifsStatus(), 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 *CodeScanningSarifsStatus) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAnalysesUrl gets the analyses_url property value. The REST API URL for getting the analyses associated with the upload. +// returns a *string when successful +func (m *CodeScanningSarifsStatus) GetAnalysesUrl()(*string) { + return m.analyses_url +} +// GetErrors gets the errors property value. Any errors that ocurred during processing of the delivery. +// returns a []string when successful +func (m *CodeScanningSarifsStatus) GetErrors()([]string) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningSarifsStatus) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["analyses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAnalysesUrl(val) + } + return nil + } + res["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetErrors(res) + } + return nil + } + res["processing_status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningSarifsStatus_processing_status) + if err != nil { + return err + } + if val != nil { + m.SetProcessingStatus(val.(*CodeScanningSarifsStatus_processing_status)) + } + return nil + } + return res +} +// GetProcessingStatus gets the processing_status property value. `pending` files have not yet been processed, while `complete` means results from the SARIF have been stored. `failed` files have either not been processed at all, or could only be partially processed. +// returns a *CodeScanningSarifsStatus_processing_status when successful +func (m *CodeScanningSarifsStatus) GetProcessingStatus()(*CodeScanningSarifsStatus_processing_status) { + return m.processing_status +} +// Serialize serializes information the current object +func (m *CodeScanningSarifsStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetProcessingStatus() != nil { + cast := (*m.GetProcessingStatus()).String() + err := writer.WriteStringValue("processing_status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CodeScanningSarifsStatus) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAnalysesUrl sets the analyses_url property value. The REST API URL for getting the analyses associated with the upload. +func (m *CodeScanningSarifsStatus) SetAnalysesUrl(value *string)() { + m.analyses_url = value +} +// SetErrors sets the errors property value. Any errors that ocurred during processing of the delivery. +func (m *CodeScanningSarifsStatus) SetErrors(value []string)() { + m.errors = value +} +// SetProcessingStatus sets the processing_status property value. `pending` files have not yet been processed, while `complete` means results from the SARIF have been stored. `failed` files have either not been processed at all, or could only be partially processed. +func (m *CodeScanningSarifsStatus) SetProcessingStatus(value *CodeScanningSarifsStatus_processing_status)() { + m.processing_status = value +} +type CodeScanningSarifsStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAnalysesUrl()(*string) + GetErrors()([]string) + GetProcessingStatus()(*CodeScanningSarifsStatus_processing_status) + SetAnalysesUrl(value *string)() + SetErrors(value []string)() + SetProcessingStatus(value *CodeScanningSarifsStatus_processing_status)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_sarifs_status503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_sarifs_status503_error.go new file mode 100644 index 000000000..fce60ffb9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_sarifs_status503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningSarifsStatus503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewCodeScanningSarifsStatus503Error instantiates a new CodeScanningSarifsStatus503Error and sets the default values. +func NewCodeScanningSarifsStatus503Error()(*CodeScanningSarifsStatus503Error) { + m := &CodeScanningSarifsStatus503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningSarifsStatus503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningSarifsStatus503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningSarifsStatus503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodeScanningSarifsStatus503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CodeScanningSarifsStatus503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodeScanningSarifsStatus503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodeScanningSarifsStatus503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningSarifsStatus503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *CodeScanningSarifsStatus503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodeScanningSarifsStatus503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *CodeScanningSarifsStatus503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodeScanningSarifsStatus503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodeScanningSarifsStatus503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningSarifsStatus503Error) SetMessage(value *string)() { + m.message = value +} +type CodeScanningSarifsStatus503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_sarifs_status_processing_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_sarifs_status_processing_status.go new file mode 100644 index 000000000..3f3814d17 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_sarifs_status_processing_status.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// `pending` files have not yet been processed, while `complete` means results from the SARIF have been stored. `failed` files have either not been processed at all, or could only be partially processed. +type CodeScanningSarifsStatus_processing_status int + +const ( + PENDING_CODESCANNINGSARIFSSTATUS_PROCESSING_STATUS CodeScanningSarifsStatus_processing_status = iota + COMPLETE_CODESCANNINGSARIFSSTATUS_PROCESSING_STATUS + FAILED_CODESCANNINGSARIFSSTATUS_PROCESSING_STATUS +) + +func (i CodeScanningSarifsStatus_processing_status) String() string { + return []string{"pending", "complete", "failed"}[i] +} +func ParseCodeScanningSarifsStatus_processing_status(v string) (any, error) { + result := PENDING_CODESCANNINGSARIFSSTATUS_PROCESSING_STATUS + switch v { + case "pending": + result = PENDING_CODESCANNINGSARIFSSTATUS_PROCESSING_STATUS + case "complete": + result = COMPLETE_CODESCANNINGSARIFSSTATUS_PROCESSING_STATUS + case "failed": + result = FAILED_CODESCANNINGSARIFSSTATUS_PROCESSING_STATUS + default: + return 0, errors.New("Unknown CodeScanningSarifsStatus_processing_status value: " + v) + } + return &result, nil +} +func SerializeCodeScanningSarifsStatus_processing_status(values []CodeScanningSarifsStatus_processing_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningSarifsStatus_processing_status) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis.go new file mode 100644 index 000000000..e2cd02470 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis.go @@ -0,0 +1,445 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeScanningVariantAnalysis a run of a CodeQL query against one or more repositories. +type CodeScanningVariantAnalysis struct { + // The GitHub Actions workflow run used to execute this variant analysis. This is only available if the workflow run has started. + actions_workflow_run_id *int32 + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The date and time at which the variant analysis was completed, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. Will be null if the variant analysis has not yet completed or this information is not available. + completed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub repository. + controller_repo SimpleRepositoryable + // The date and time at which the variant analysis was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The reason for a failure of the variant analysis. This is only available if the variant analysis has failed. + failure_reason *CodeScanningVariantAnalysis_failure_reason + // The ID of the variant analysis. + id *int32 + // The language targeted by the CodeQL query + query_language *CodeScanningVariantAnalysisLanguage + // The download url for the query pack. + query_pack_url *string + // The scanned_repositories property + scanned_repositories []CodeScanningVariantAnalysis_scanned_repositoriesable + // Information about repositories that were skipped from processing. This information is only available to the user that initiated the variant analysis. + skipped_repositories CodeScanningVariantAnalysis_skipped_repositoriesable + // The status property + status *CodeScanningVariantAnalysisStatus + // The date and time at which the variant analysis was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewCodeScanningVariantAnalysis instantiates a new CodeScanningVariantAnalysis and sets the default values. +func NewCodeScanningVariantAnalysis()(*CodeScanningVariantAnalysis) { + m := &CodeScanningVariantAnalysis{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningVariantAnalysisFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningVariantAnalysisFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningVariantAnalysis(), nil +} +// GetActionsWorkflowRunId gets the actions_workflow_run_id property value. The GitHub Actions workflow run used to execute this variant analysis. This is only available if the workflow run has started. +// returns a *int32 when successful +func (m *CodeScanningVariantAnalysis) GetActionsWorkflowRunId()(*int32) { + return m.actions_workflow_run_id +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *CodeScanningVariantAnalysis) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *CodeScanningVariantAnalysis) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCompletedAt gets the completed_at property value. The date and time at which the variant analysis was completed, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. Will be null if the variant analysis has not yet completed or this information is not available. +// returns a *Time when successful +func (m *CodeScanningVariantAnalysis) GetCompletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.completed_at +} +// GetControllerRepo gets the controller_repo property value. A GitHub repository. +// returns a SimpleRepositoryable when successful +func (m *CodeScanningVariantAnalysis) GetControllerRepo()(SimpleRepositoryable) { + return m.controller_repo +} +// GetCreatedAt gets the created_at property value. The date and time at which the variant analysis was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +// returns a *Time when successful +func (m *CodeScanningVariantAnalysis) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFailureReason gets the failure_reason property value. The reason for a failure of the variant analysis. This is only available if the variant analysis has failed. +// returns a *CodeScanningVariantAnalysis_failure_reason when successful +func (m *CodeScanningVariantAnalysis) GetFailureReason()(*CodeScanningVariantAnalysis_failure_reason) { + return m.failure_reason +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningVariantAnalysis) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actions_workflow_run_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetActionsWorkflowRunId(val) + } + return nil + } + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["completed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCompletedAt(val) + } + return nil + } + res["controller_repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetControllerRepo(val.(SimpleRepositoryable)) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["failure_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningVariantAnalysis_failure_reason) + if err != nil { + return err + } + if val != nil { + m.SetFailureReason(val.(*CodeScanningVariantAnalysis_failure_reason)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["query_language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningVariantAnalysisLanguage) + if err != nil { + return err + } + if val != nil { + m.SetQueryLanguage(val.(*CodeScanningVariantAnalysisLanguage)) + } + return nil + } + res["query_pack_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetQueryPackUrl(val) + } + return nil + } + res["scanned_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCodeScanningVariantAnalysis_scanned_repositoriesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CodeScanningVariantAnalysis_scanned_repositoriesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CodeScanningVariantAnalysis_scanned_repositoriesable) + } + } + m.SetScannedRepositories(res) + } + return nil + } + res["skipped_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningVariantAnalysis_skipped_repositoriesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSkippedRepositories(val.(CodeScanningVariantAnalysis_skipped_repositoriesable)) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningVariantAnalysisStatus) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*CodeScanningVariantAnalysisStatus)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetId gets the id property value. The ID of the variant analysis. +// returns a *int32 when successful +func (m *CodeScanningVariantAnalysis) GetId()(*int32) { + return m.id +} +// GetQueryLanguage gets the query_language property value. The language targeted by the CodeQL query +// returns a *CodeScanningVariantAnalysisLanguage when successful +func (m *CodeScanningVariantAnalysis) GetQueryLanguage()(*CodeScanningVariantAnalysisLanguage) { + return m.query_language +} +// GetQueryPackUrl gets the query_pack_url property value. The download url for the query pack. +// returns a *string when successful +func (m *CodeScanningVariantAnalysis) GetQueryPackUrl()(*string) { + return m.query_pack_url +} +// GetScannedRepositories gets the scanned_repositories property value. The scanned_repositories property +// returns a []CodeScanningVariantAnalysis_scanned_repositoriesable when successful +func (m *CodeScanningVariantAnalysis) GetScannedRepositories()([]CodeScanningVariantAnalysis_scanned_repositoriesable) { + return m.scanned_repositories +} +// GetSkippedRepositories gets the skipped_repositories property value. Information about repositories that were skipped from processing. This information is only available to the user that initiated the variant analysis. +// returns a CodeScanningVariantAnalysis_skipped_repositoriesable when successful +func (m *CodeScanningVariantAnalysis) GetSkippedRepositories()(CodeScanningVariantAnalysis_skipped_repositoriesable) { + return m.skipped_repositories +} +// GetStatus gets the status property value. The status property +// returns a *CodeScanningVariantAnalysisStatus when successful +func (m *CodeScanningVariantAnalysis) GetStatus()(*CodeScanningVariantAnalysisStatus) { + return m.status +} +// GetUpdatedAt gets the updated_at property value. The date and time at which the variant analysis was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +// returns a *Time when successful +func (m *CodeScanningVariantAnalysis) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *CodeScanningVariantAnalysis) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("actions_workflow_run_id", m.GetActionsWorkflowRunId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("completed_at", m.GetCompletedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("controller_repo", m.GetControllerRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + if m.GetFailureReason() != nil { + cast := (*m.GetFailureReason()).String() + err := writer.WriteStringValue("failure_reason", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + if m.GetQueryLanguage() != nil { + cast := (*m.GetQueryLanguage()).String() + err := writer.WriteStringValue("query_language", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("query_pack_url", m.GetQueryPackUrl()) + if err != nil { + return err + } + } + if m.GetScannedRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetScannedRepositories())) + for i, v := range m.GetScannedRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("scanned_repositories", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("skipped_repositories", m.GetSkippedRepositories()) + if err != nil { + return err + } + } + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err := writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActionsWorkflowRunId sets the actions_workflow_run_id property value. The GitHub Actions workflow run used to execute this variant analysis. This is only available if the workflow run has started. +func (m *CodeScanningVariantAnalysis) SetActionsWorkflowRunId(value *int32)() { + m.actions_workflow_run_id = value +} +// SetActor sets the actor property value. A GitHub user. +func (m *CodeScanningVariantAnalysis) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *CodeScanningVariantAnalysis) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCompletedAt sets the completed_at property value. The date and time at which the variant analysis was completed, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. Will be null if the variant analysis has not yet completed or this information is not available. +func (m *CodeScanningVariantAnalysis) SetCompletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.completed_at = value +} +// SetControllerRepo sets the controller_repo property value. A GitHub repository. +func (m *CodeScanningVariantAnalysis) SetControllerRepo(value SimpleRepositoryable)() { + m.controller_repo = value +} +// SetCreatedAt sets the created_at property value. The date and time at which the variant analysis was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +func (m *CodeScanningVariantAnalysis) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetFailureReason sets the failure_reason property value. The reason for a failure of the variant analysis. This is only available if the variant analysis has failed. +func (m *CodeScanningVariantAnalysis) SetFailureReason(value *CodeScanningVariantAnalysis_failure_reason)() { + m.failure_reason = value +} +// SetId sets the id property value. The ID of the variant analysis. +func (m *CodeScanningVariantAnalysis) SetId(value *int32)() { + m.id = value +} +// SetQueryLanguage sets the query_language property value. The language targeted by the CodeQL query +func (m *CodeScanningVariantAnalysis) SetQueryLanguage(value *CodeScanningVariantAnalysisLanguage)() { + m.query_language = value +} +// SetQueryPackUrl sets the query_pack_url property value. The download url for the query pack. +func (m *CodeScanningVariantAnalysis) SetQueryPackUrl(value *string)() { + m.query_pack_url = value +} +// SetScannedRepositories sets the scanned_repositories property value. The scanned_repositories property +func (m *CodeScanningVariantAnalysis) SetScannedRepositories(value []CodeScanningVariantAnalysis_scanned_repositoriesable)() { + m.scanned_repositories = value +} +// SetSkippedRepositories sets the skipped_repositories property value. Information about repositories that were skipped from processing. This information is only available to the user that initiated the variant analysis. +func (m *CodeScanningVariantAnalysis) SetSkippedRepositories(value CodeScanningVariantAnalysis_skipped_repositoriesable)() { + m.skipped_repositories = value +} +// SetStatus sets the status property value. The status property +func (m *CodeScanningVariantAnalysis) SetStatus(value *CodeScanningVariantAnalysisStatus)() { + m.status = value +} +// SetUpdatedAt sets the updated_at property value. The date and time at which the variant analysis was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +func (m *CodeScanningVariantAnalysis) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type CodeScanningVariantAnalysisable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActionsWorkflowRunId()(*int32) + GetActor()(SimpleUserable) + GetCompletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetControllerRepo()(SimpleRepositoryable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetFailureReason()(*CodeScanningVariantAnalysis_failure_reason) + GetId()(*int32) + GetQueryLanguage()(*CodeScanningVariantAnalysisLanguage) + GetQueryPackUrl()(*string) + GetScannedRepositories()([]CodeScanningVariantAnalysis_scanned_repositoriesable) + GetSkippedRepositories()(CodeScanningVariantAnalysis_skipped_repositoriesable) + GetStatus()(*CodeScanningVariantAnalysisStatus) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetActionsWorkflowRunId(value *int32)() + SetActor(value SimpleUserable)() + SetCompletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetControllerRepo(value SimpleRepositoryable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetFailureReason(value *CodeScanningVariantAnalysis_failure_reason)() + SetId(value *int32)() + SetQueryLanguage(value *CodeScanningVariantAnalysisLanguage)() + SetQueryPackUrl(value *string)() + SetScannedRepositories(value []CodeScanningVariantAnalysis_scanned_repositoriesable)() + SetSkippedRepositories(value CodeScanningVariantAnalysis_skipped_repositoriesable)() + SetStatus(value *CodeScanningVariantAnalysisStatus)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis503_error.go new file mode 100644 index 000000000..ba958c716 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningVariantAnalysis503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewCodeScanningVariantAnalysis503Error instantiates a new CodeScanningVariantAnalysis503Error and sets the default values. +func NewCodeScanningVariantAnalysis503Error()(*CodeScanningVariantAnalysis503Error) { + m := &CodeScanningVariantAnalysis503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningVariantAnalysis503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningVariantAnalysis503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningVariantAnalysis503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodeScanningVariantAnalysis503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CodeScanningVariantAnalysis503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodeScanningVariantAnalysis503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodeScanningVariantAnalysis503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningVariantAnalysis503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *CodeScanningVariantAnalysis503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodeScanningVariantAnalysis503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *CodeScanningVariantAnalysis503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodeScanningVariantAnalysis503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodeScanningVariantAnalysis503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningVariantAnalysis503Error) SetMessage(value *string)() { + m.message = value +} +type CodeScanningVariantAnalysis503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_failure_reason.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_failure_reason.go new file mode 100644 index 000000000..255c83bc5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_failure_reason.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The reason for a failure of the variant analysis. This is only available if the variant analysis has failed. +type CodeScanningVariantAnalysis_failure_reason int + +const ( + NO_REPOS_QUERIED_CODESCANNINGVARIANTANALYSIS_FAILURE_REASON CodeScanningVariantAnalysis_failure_reason = iota + ACTIONS_WORKFLOW_RUN_FAILED_CODESCANNINGVARIANTANALYSIS_FAILURE_REASON + INTERNAL_ERROR_CODESCANNINGVARIANTANALYSIS_FAILURE_REASON +) + +func (i CodeScanningVariantAnalysis_failure_reason) String() string { + return []string{"no_repos_queried", "actions_workflow_run_failed", "internal_error"}[i] +} +func ParseCodeScanningVariantAnalysis_failure_reason(v string) (any, error) { + result := NO_REPOS_QUERIED_CODESCANNINGVARIANTANALYSIS_FAILURE_REASON + switch v { + case "no_repos_queried": + result = NO_REPOS_QUERIED_CODESCANNINGVARIANTANALYSIS_FAILURE_REASON + case "actions_workflow_run_failed": + result = ACTIONS_WORKFLOW_RUN_FAILED_CODESCANNINGVARIANTANALYSIS_FAILURE_REASON + case "internal_error": + result = INTERNAL_ERROR_CODESCANNINGVARIANTANALYSIS_FAILURE_REASON + default: + return 0, errors.New("Unknown CodeScanningVariantAnalysis_failure_reason value: " + v) + } + return &result, nil +} +func SerializeCodeScanningVariantAnalysis_failure_reason(values []CodeScanningVariantAnalysis_failure_reason) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningVariantAnalysis_failure_reason) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_language.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_language.go new file mode 100644 index 000000000..2e13b31f4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_language.go @@ -0,0 +1,55 @@ +package models +import ( + "errors" +) +// The language targeted by the CodeQL query +type CodeScanningVariantAnalysisLanguage int + +const ( + CPP_CODESCANNINGVARIANTANALYSISLANGUAGE CodeScanningVariantAnalysisLanguage = iota + CSHARP_CODESCANNINGVARIANTANALYSISLANGUAGE + GO_CODESCANNINGVARIANTANALYSISLANGUAGE + JAVA_CODESCANNINGVARIANTANALYSISLANGUAGE + JAVASCRIPT_CODESCANNINGVARIANTANALYSISLANGUAGE + PYTHON_CODESCANNINGVARIANTANALYSISLANGUAGE + RUBY_CODESCANNINGVARIANTANALYSISLANGUAGE + SWIFT_CODESCANNINGVARIANTANALYSISLANGUAGE +) + +func (i CodeScanningVariantAnalysisLanguage) String() string { + return []string{"cpp", "csharp", "go", "java", "javascript", "python", "ruby", "swift"}[i] +} +func ParseCodeScanningVariantAnalysisLanguage(v string) (any, error) { + result := CPP_CODESCANNINGVARIANTANALYSISLANGUAGE + switch v { + case "cpp": + result = CPP_CODESCANNINGVARIANTANALYSISLANGUAGE + case "csharp": + result = CSHARP_CODESCANNINGVARIANTANALYSISLANGUAGE + case "go": + result = GO_CODESCANNINGVARIANTANALYSISLANGUAGE + case "java": + result = JAVA_CODESCANNINGVARIANTANALYSISLANGUAGE + case "javascript": + result = JAVASCRIPT_CODESCANNINGVARIANTANALYSISLANGUAGE + case "python": + result = PYTHON_CODESCANNINGVARIANTANALYSISLANGUAGE + case "ruby": + result = RUBY_CODESCANNINGVARIANTANALYSISLANGUAGE + case "swift": + result = SWIFT_CODESCANNINGVARIANTANALYSISLANGUAGE + default: + return 0, errors.New("Unknown CodeScanningVariantAnalysisLanguage value: " + v) + } + return &result, nil +} +func SerializeCodeScanningVariantAnalysisLanguage(values []CodeScanningVariantAnalysisLanguage) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningVariantAnalysisLanguage) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_repo_task.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_repo_task.go new file mode 100644 index 000000000..8f74628a2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_repo_task.go @@ -0,0 +1,284 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningVariantAnalysisRepoTask struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The new status of the CodeQL variant analysis repository task. + analysis_status *CodeScanningVariantAnalysisStatus + // The size of the artifact. This is only available for successful analyses. + artifact_size_in_bytes *int32 + // The URL of the artifact. This is only available for successful analyses. + artifact_url *string + // The SHA of the commit the CodeQL database was built against. This is only available for successful analyses. + database_commit_sha *string + // The reason of the failure of this repo task. This is only available if the repository task has failed. + failure_message *string + // A GitHub repository. + repository SimpleRepositoryable + // The number of results in the case of a successful analysis. This is only available for successful analyses. + result_count *int32 + // The source location prefix to use. This is only available for successful analyses. + source_location_prefix *string +} +// NewCodeScanningVariantAnalysisRepoTask instantiates a new CodeScanningVariantAnalysisRepoTask and sets the default values. +func NewCodeScanningVariantAnalysisRepoTask()(*CodeScanningVariantAnalysisRepoTask) { + m := &CodeScanningVariantAnalysisRepoTask{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningVariantAnalysisRepoTaskFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningVariantAnalysisRepoTaskFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningVariantAnalysisRepoTask(), 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 *CodeScanningVariantAnalysisRepoTask) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAnalysisStatus gets the analysis_status property value. The new status of the CodeQL variant analysis repository task. +// returns a *CodeScanningVariantAnalysisStatus when successful +func (m *CodeScanningVariantAnalysisRepoTask) GetAnalysisStatus()(*CodeScanningVariantAnalysisStatus) { + return m.analysis_status +} +// GetArtifactSizeInBytes gets the artifact_size_in_bytes property value. The size of the artifact. This is only available for successful analyses. +// returns a *int32 when successful +func (m *CodeScanningVariantAnalysisRepoTask) GetArtifactSizeInBytes()(*int32) { + return m.artifact_size_in_bytes +} +// GetArtifactUrl gets the artifact_url property value. The URL of the artifact. This is only available for successful analyses. +// returns a *string when successful +func (m *CodeScanningVariantAnalysisRepoTask) GetArtifactUrl()(*string) { + return m.artifact_url +} +// GetDatabaseCommitSha gets the database_commit_sha property value. The SHA of the commit the CodeQL database was built against. This is only available for successful analyses. +// returns a *string when successful +func (m *CodeScanningVariantAnalysisRepoTask) GetDatabaseCommitSha()(*string) { + return m.database_commit_sha +} +// GetFailureMessage gets the failure_message property value. The reason of the failure of this repo task. This is only available if the repository task has failed. +// returns a *string when successful +func (m *CodeScanningVariantAnalysisRepoTask) GetFailureMessage()(*string) { + return m.failure_message +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningVariantAnalysisRepoTask) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["analysis_status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningVariantAnalysisStatus) + if err != nil { + return err + } + if val != nil { + m.SetAnalysisStatus(val.(*CodeScanningVariantAnalysisStatus)) + } + return nil + } + res["artifact_size_in_bytes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetArtifactSizeInBytes(val) + } + return nil + } + res["artifact_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArtifactUrl(val) + } + return nil + } + res["database_commit_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDatabaseCommitSha(val) + } + return nil + } + res["failure_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFailureMessage(val) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(SimpleRepositoryable)) + } + return nil + } + res["result_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetResultCount(val) + } + return nil + } + res["source_location_prefix"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSourceLocationPrefix(val) + } + return nil + } + return res +} +// GetRepository gets the repository property value. A GitHub repository. +// returns a SimpleRepositoryable when successful +func (m *CodeScanningVariantAnalysisRepoTask) GetRepository()(SimpleRepositoryable) { + return m.repository +} +// GetResultCount gets the result_count property value. The number of results in the case of a successful analysis. This is only available for successful analyses. +// returns a *int32 when successful +func (m *CodeScanningVariantAnalysisRepoTask) GetResultCount()(*int32) { + return m.result_count +} +// GetSourceLocationPrefix gets the source_location_prefix property value. The source location prefix to use. This is only available for successful analyses. +// returns a *string when successful +func (m *CodeScanningVariantAnalysisRepoTask) GetSourceLocationPrefix()(*string) { + return m.source_location_prefix +} +// Serialize serializes information the current object +func (m *CodeScanningVariantAnalysisRepoTask) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAnalysisStatus() != nil { + cast := (*m.GetAnalysisStatus()).String() + err := writer.WriteStringValue("analysis_status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("artifact_size_in_bytes", m.GetArtifactSizeInBytes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("artifact_url", m.GetArtifactUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("database_commit_sha", m.GetDatabaseCommitSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("failure_message", m.GetFailureMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("result_count", m.GetResultCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("source_location_prefix", m.GetSourceLocationPrefix()) + 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 *CodeScanningVariantAnalysisRepoTask) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAnalysisStatus sets the analysis_status property value. The new status of the CodeQL variant analysis repository task. +func (m *CodeScanningVariantAnalysisRepoTask) SetAnalysisStatus(value *CodeScanningVariantAnalysisStatus)() { + m.analysis_status = value +} +// SetArtifactSizeInBytes sets the artifact_size_in_bytes property value. The size of the artifact. This is only available for successful analyses. +func (m *CodeScanningVariantAnalysisRepoTask) SetArtifactSizeInBytes(value *int32)() { + m.artifact_size_in_bytes = value +} +// SetArtifactUrl sets the artifact_url property value. The URL of the artifact. This is only available for successful analyses. +func (m *CodeScanningVariantAnalysisRepoTask) SetArtifactUrl(value *string)() { + m.artifact_url = value +} +// SetDatabaseCommitSha sets the database_commit_sha property value. The SHA of the commit the CodeQL database was built against. This is only available for successful analyses. +func (m *CodeScanningVariantAnalysisRepoTask) SetDatabaseCommitSha(value *string)() { + m.database_commit_sha = value +} +// SetFailureMessage sets the failure_message property value. The reason of the failure of this repo task. This is only available if the repository task has failed. +func (m *CodeScanningVariantAnalysisRepoTask) SetFailureMessage(value *string)() { + m.failure_message = value +} +// SetRepository sets the repository property value. A GitHub repository. +func (m *CodeScanningVariantAnalysisRepoTask) SetRepository(value SimpleRepositoryable)() { + m.repository = value +} +// SetResultCount sets the result_count property value. The number of results in the case of a successful analysis. This is only available for successful analyses. +func (m *CodeScanningVariantAnalysisRepoTask) SetResultCount(value *int32)() { + m.result_count = value +} +// SetSourceLocationPrefix sets the source_location_prefix property value. The source location prefix to use. This is only available for successful analyses. +func (m *CodeScanningVariantAnalysisRepoTask) SetSourceLocationPrefix(value *string)() { + m.source_location_prefix = value +} +type CodeScanningVariantAnalysisRepoTaskable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAnalysisStatus()(*CodeScanningVariantAnalysisStatus) + GetArtifactSizeInBytes()(*int32) + GetArtifactUrl()(*string) + GetDatabaseCommitSha()(*string) + GetFailureMessage()(*string) + GetRepository()(SimpleRepositoryable) + GetResultCount()(*int32) + GetSourceLocationPrefix()(*string) + SetAnalysisStatus(value *CodeScanningVariantAnalysisStatus)() + SetArtifactSizeInBytes(value *int32)() + SetArtifactUrl(value *string)() + SetDatabaseCommitSha(value *string)() + SetFailureMessage(value *string)() + SetRepository(value SimpleRepositoryable)() + SetResultCount(value *int32)() + SetSourceLocationPrefix(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_repo_task503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_repo_task503_error.go new file mode 100644 index 000000000..e6f929fad --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_repo_task503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningVariantAnalysisRepoTask503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewCodeScanningVariantAnalysisRepoTask503Error instantiates a new CodeScanningVariantAnalysisRepoTask503Error and sets the default values. +func NewCodeScanningVariantAnalysisRepoTask503Error()(*CodeScanningVariantAnalysisRepoTask503Error) { + m := &CodeScanningVariantAnalysisRepoTask503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningVariantAnalysisRepoTask503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningVariantAnalysisRepoTask503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningVariantAnalysisRepoTask503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodeScanningVariantAnalysisRepoTask503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CodeScanningVariantAnalysisRepoTask503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodeScanningVariantAnalysisRepoTask503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodeScanningVariantAnalysisRepoTask503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningVariantAnalysisRepoTask503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *CodeScanningVariantAnalysisRepoTask503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodeScanningVariantAnalysisRepoTask503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *CodeScanningVariantAnalysisRepoTask503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodeScanningVariantAnalysisRepoTask503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodeScanningVariantAnalysisRepoTask503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningVariantAnalysisRepoTask503Error) SetMessage(value *string)() { + m.message = value +} +type CodeScanningVariantAnalysisRepoTask503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_repository.go new file mode 100644 index 000000000..ecf693bf0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_repository.go @@ -0,0 +1,227 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeScanningVariantAnalysisRepository repository Identifier +type CodeScanningVariantAnalysisRepository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The full, globally unique, name of the repository. + full_name *string + // A unique identifier of the repository. + id *int32 + // The name of the repository. + name *string + // Whether the repository is private. + private *bool + // The stargazers_count property + stargazers_count *int32 + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewCodeScanningVariantAnalysisRepository instantiates a new CodeScanningVariantAnalysisRepository and sets the default values. +func NewCodeScanningVariantAnalysisRepository()(*CodeScanningVariantAnalysisRepository) { + m := &CodeScanningVariantAnalysisRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningVariantAnalysisRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningVariantAnalysisRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningVariantAnalysisRepository(), 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 *CodeScanningVariantAnalysisRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningVariantAnalysisRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetFullName gets the full_name property value. The full, globally unique, name of the repository. +// returns a *string when successful +func (m *CodeScanningVariantAnalysisRepository) GetFullName()(*string) { + return m.full_name +} +// GetId gets the id property value. A unique identifier of the repository. +// returns a *int32 when successful +func (m *CodeScanningVariantAnalysisRepository) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name of the repository. +// returns a *string when successful +func (m *CodeScanningVariantAnalysisRepository) GetName()(*string) { + return m.name +} +// GetPrivate gets the private property value. Whether the repository is private. +// returns a *bool when successful +func (m *CodeScanningVariantAnalysisRepository) GetPrivate()(*bool) { + return m.private +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *CodeScanningVariantAnalysisRepository) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *CodeScanningVariantAnalysisRepository) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *CodeScanningVariantAnalysisRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + 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 *CodeScanningVariantAnalysisRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFullName sets the full_name property value. The full, globally unique, name of the repository. +func (m *CodeScanningVariantAnalysisRepository) SetFullName(value *string)() { + m.full_name = value +} +// SetId sets the id property value. A unique identifier of the repository. +func (m *CodeScanningVariantAnalysisRepository) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name of the repository. +func (m *CodeScanningVariantAnalysisRepository) SetName(value *string)() { + m.name = value +} +// SetPrivate sets the private property value. Whether the repository is private. +func (m *CodeScanningVariantAnalysisRepository) SetPrivate(value *bool)() { + m.private = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *CodeScanningVariantAnalysisRepository) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *CodeScanningVariantAnalysisRepository) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type CodeScanningVariantAnalysisRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFullName()(*string) + GetId()(*int32) + GetName()(*string) + GetPrivate()(*bool) + GetStargazersCount()(*int32) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetFullName(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetPrivate(value *bool)() + SetStargazersCount(value *int32)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_scanned_repositories.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_scanned_repositories.go new file mode 100644 index 000000000..f860e45a3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_scanned_repositories.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningVariantAnalysis_scanned_repositories struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The new status of the CodeQL variant analysis repository task. + analysis_status *CodeScanningVariantAnalysisStatus + // The size of the artifact. This is only available for successful analyses. + artifact_size_in_bytes *int32 + // The reason of the failure of this repo task. This is only available if the repository task has failed. + failure_message *string + // Repository Identifier + repository CodeScanningVariantAnalysisRepositoryable + // The number of results in the case of a successful analysis. This is only available for successful analyses. + result_count *int32 +} +// NewCodeScanningVariantAnalysis_scanned_repositories instantiates a new CodeScanningVariantAnalysis_scanned_repositories and sets the default values. +func NewCodeScanningVariantAnalysis_scanned_repositories()(*CodeScanningVariantAnalysis_scanned_repositories) { + m := &CodeScanningVariantAnalysis_scanned_repositories{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningVariantAnalysis_scanned_repositoriesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningVariantAnalysis_scanned_repositoriesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningVariantAnalysis_scanned_repositories(), 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 *CodeScanningVariantAnalysis_scanned_repositories) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAnalysisStatus gets the analysis_status property value. The new status of the CodeQL variant analysis repository task. +// returns a *CodeScanningVariantAnalysisStatus when successful +func (m *CodeScanningVariantAnalysis_scanned_repositories) GetAnalysisStatus()(*CodeScanningVariantAnalysisStatus) { + return m.analysis_status +} +// GetArtifactSizeInBytes gets the artifact_size_in_bytes property value. The size of the artifact. This is only available for successful analyses. +// returns a *int32 when successful +func (m *CodeScanningVariantAnalysis_scanned_repositories) GetArtifactSizeInBytes()(*int32) { + return m.artifact_size_in_bytes +} +// GetFailureMessage gets the failure_message property value. The reason of the failure of this repo task. This is only available if the repository task has failed. +// returns a *string when successful +func (m *CodeScanningVariantAnalysis_scanned_repositories) GetFailureMessage()(*string) { + return m.failure_message +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningVariantAnalysis_scanned_repositories) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["analysis_status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningVariantAnalysisStatus) + if err != nil { + return err + } + if val != nil { + m.SetAnalysisStatus(val.(*CodeScanningVariantAnalysisStatus)) + } + return nil + } + res["artifact_size_in_bytes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetArtifactSizeInBytes(val) + } + return nil + } + res["failure_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFailureMessage(val) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningVariantAnalysisRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(CodeScanningVariantAnalysisRepositoryable)) + } + return nil + } + res["result_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetResultCount(val) + } + return nil + } + return res +} +// GetRepository gets the repository property value. Repository Identifier +// returns a CodeScanningVariantAnalysisRepositoryable when successful +func (m *CodeScanningVariantAnalysis_scanned_repositories) GetRepository()(CodeScanningVariantAnalysisRepositoryable) { + return m.repository +} +// GetResultCount gets the result_count property value. The number of results in the case of a successful analysis. This is only available for successful analyses. +// returns a *int32 when successful +func (m *CodeScanningVariantAnalysis_scanned_repositories) GetResultCount()(*int32) { + return m.result_count +} +// Serialize serializes information the current object +func (m *CodeScanningVariantAnalysis_scanned_repositories) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAnalysisStatus() != nil { + cast := (*m.GetAnalysisStatus()).String() + err := writer.WriteStringValue("analysis_status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("artifact_size_in_bytes", m.GetArtifactSizeInBytes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("failure_message", m.GetFailureMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("result_count", m.GetResultCount()) + 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 *CodeScanningVariantAnalysis_scanned_repositories) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAnalysisStatus sets the analysis_status property value. The new status of the CodeQL variant analysis repository task. +func (m *CodeScanningVariantAnalysis_scanned_repositories) SetAnalysisStatus(value *CodeScanningVariantAnalysisStatus)() { + m.analysis_status = value +} +// SetArtifactSizeInBytes sets the artifact_size_in_bytes property value. The size of the artifact. This is only available for successful analyses. +func (m *CodeScanningVariantAnalysis_scanned_repositories) SetArtifactSizeInBytes(value *int32)() { + m.artifact_size_in_bytes = value +} +// SetFailureMessage sets the failure_message property value. The reason of the failure of this repo task. This is only available if the repository task has failed. +func (m *CodeScanningVariantAnalysis_scanned_repositories) SetFailureMessage(value *string)() { + m.failure_message = value +} +// SetRepository sets the repository property value. Repository Identifier +func (m *CodeScanningVariantAnalysis_scanned_repositories) SetRepository(value CodeScanningVariantAnalysisRepositoryable)() { + m.repository = value +} +// SetResultCount sets the result_count property value. The number of results in the case of a successful analysis. This is only available for successful analyses. +func (m *CodeScanningVariantAnalysis_scanned_repositories) SetResultCount(value *int32)() { + m.result_count = value +} +type CodeScanningVariantAnalysis_scanned_repositoriesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAnalysisStatus()(*CodeScanningVariantAnalysisStatus) + GetArtifactSizeInBytes()(*int32) + GetFailureMessage()(*string) + GetRepository()(CodeScanningVariantAnalysisRepositoryable) + GetResultCount()(*int32) + SetAnalysisStatus(value *CodeScanningVariantAnalysisStatus)() + SetArtifactSizeInBytes(value *int32)() + SetFailureMessage(value *string)() + SetRepository(value CodeScanningVariantAnalysisRepositoryable)() + SetResultCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_skipped_repo_group.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_skipped_repo_group.go new file mode 100644 index 000000000..536ec482f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_skipped_repo_group.go @@ -0,0 +1,121 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningVariantAnalysisSkippedRepoGroup struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A list of repositories that were skipped. This list may not include all repositories that were skipped. This is only available when the repository was found and the user has access to it. + repositories []CodeScanningVariantAnalysisRepositoryable + // The total number of repositories that were skipped for this reason. + repository_count *int32 +} +// NewCodeScanningVariantAnalysisSkippedRepoGroup instantiates a new CodeScanningVariantAnalysisSkippedRepoGroup and sets the default values. +func NewCodeScanningVariantAnalysisSkippedRepoGroup()(*CodeScanningVariantAnalysisSkippedRepoGroup) { + m := &CodeScanningVariantAnalysisSkippedRepoGroup{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningVariantAnalysisSkippedRepoGroupFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningVariantAnalysisSkippedRepoGroupFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningVariantAnalysisSkippedRepoGroup(), 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 *CodeScanningVariantAnalysisSkippedRepoGroup) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningVariantAnalysisSkippedRepoGroup) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCodeScanningVariantAnalysisRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CodeScanningVariantAnalysisRepositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CodeScanningVariantAnalysisRepositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["repository_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryCount(val) + } + return nil + } + return res +} +// GetRepositories gets the repositories property value. A list of repositories that were skipped. This list may not include all repositories that were skipped. This is only available when the repository was found and the user has access to it. +// returns a []CodeScanningVariantAnalysisRepositoryable when successful +func (m *CodeScanningVariantAnalysisSkippedRepoGroup) GetRepositories()([]CodeScanningVariantAnalysisRepositoryable) { + return m.repositories +} +// GetRepositoryCount gets the repository_count property value. The total number of repositories that were skipped for this reason. +// returns a *int32 when successful +func (m *CodeScanningVariantAnalysisSkippedRepoGroup) GetRepositoryCount()(*int32) { + return m.repository_count +} +// Serialize serializes information the current object +func (m *CodeScanningVariantAnalysisSkippedRepoGroup) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_count", m.GetRepositoryCount()) + 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 *CodeScanningVariantAnalysisSkippedRepoGroup) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositories sets the repositories property value. A list of repositories that were skipped. This list may not include all repositories that were skipped. This is only available when the repository was found and the user has access to it. +func (m *CodeScanningVariantAnalysisSkippedRepoGroup) SetRepositories(value []CodeScanningVariantAnalysisRepositoryable)() { + m.repositories = value +} +// SetRepositoryCount sets the repository_count property value. The total number of repositories that were skipped for this reason. +func (m *CodeScanningVariantAnalysisSkippedRepoGroup) SetRepositoryCount(value *int32)() { + m.repository_count = value +} +type CodeScanningVariantAnalysisSkippedRepoGroupable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositories()([]CodeScanningVariantAnalysisRepositoryable) + GetRepositoryCount()(*int32) + SetRepositories(value []CodeScanningVariantAnalysisRepositoryable)() + SetRepositoryCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_skipped_repositories.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_skipped_repositories.go new file mode 100644 index 000000000..2336c1f07 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_skipped_repositories.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeScanningVariantAnalysis_skipped_repositories information about repositories that were skipped from processing. This information is only available to the user that initiated the variant analysis. +type CodeScanningVariantAnalysis_skipped_repositories struct { + // The access_mismatch_repos property + access_mismatch_repos CodeScanningVariantAnalysisSkippedRepoGroupable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The no_codeql_db_repos property + no_codeql_db_repos CodeScanningVariantAnalysisSkippedRepoGroupable + // The not_found_repos property + not_found_repos CodeScanningVariantAnalysis_skipped_repositories_not_found_reposable + // The over_limit_repos property + over_limit_repos CodeScanningVariantAnalysisSkippedRepoGroupable +} +// NewCodeScanningVariantAnalysis_skipped_repositories instantiates a new CodeScanningVariantAnalysis_skipped_repositories and sets the default values. +func NewCodeScanningVariantAnalysis_skipped_repositories()(*CodeScanningVariantAnalysis_skipped_repositories) { + m := &CodeScanningVariantAnalysis_skipped_repositories{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningVariantAnalysis_skipped_repositoriesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningVariantAnalysis_skipped_repositoriesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningVariantAnalysis_skipped_repositories(), nil +} +// GetAccessMismatchRepos gets the access_mismatch_repos property value. The access_mismatch_repos property +// returns a CodeScanningVariantAnalysisSkippedRepoGroupable when successful +func (m *CodeScanningVariantAnalysis_skipped_repositories) GetAccessMismatchRepos()(CodeScanningVariantAnalysisSkippedRepoGroupable) { + return m.access_mismatch_repos +} +// 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 *CodeScanningVariantAnalysis_skipped_repositories) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningVariantAnalysis_skipped_repositories) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["access_mismatch_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningVariantAnalysisSkippedRepoGroupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAccessMismatchRepos(val.(CodeScanningVariantAnalysisSkippedRepoGroupable)) + } + return nil + } + res["no_codeql_db_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningVariantAnalysisSkippedRepoGroupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetNoCodeqlDbRepos(val.(CodeScanningVariantAnalysisSkippedRepoGroupable)) + } + return nil + } + res["not_found_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningVariantAnalysis_skipped_repositories_not_found_reposFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetNotFoundRepos(val.(CodeScanningVariantAnalysis_skipped_repositories_not_found_reposable)) + } + return nil + } + res["over_limit_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningVariantAnalysisSkippedRepoGroupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOverLimitRepos(val.(CodeScanningVariantAnalysisSkippedRepoGroupable)) + } + return nil + } + return res +} +// GetNoCodeqlDbRepos gets the no_codeql_db_repos property value. The no_codeql_db_repos property +// returns a CodeScanningVariantAnalysisSkippedRepoGroupable when successful +func (m *CodeScanningVariantAnalysis_skipped_repositories) GetNoCodeqlDbRepos()(CodeScanningVariantAnalysisSkippedRepoGroupable) { + return m.no_codeql_db_repos +} +// GetNotFoundRepos gets the not_found_repos property value. The not_found_repos property +// returns a CodeScanningVariantAnalysis_skipped_repositories_not_found_reposable when successful +func (m *CodeScanningVariantAnalysis_skipped_repositories) GetNotFoundRepos()(CodeScanningVariantAnalysis_skipped_repositories_not_found_reposable) { + return m.not_found_repos +} +// GetOverLimitRepos gets the over_limit_repos property value. The over_limit_repos property +// returns a CodeScanningVariantAnalysisSkippedRepoGroupable when successful +func (m *CodeScanningVariantAnalysis_skipped_repositories) GetOverLimitRepos()(CodeScanningVariantAnalysisSkippedRepoGroupable) { + return m.over_limit_repos +} +// Serialize serializes information the current object +func (m *CodeScanningVariantAnalysis_skipped_repositories) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("access_mismatch_repos", m.GetAccessMismatchRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("not_found_repos", m.GetNotFoundRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("no_codeql_db_repos", m.GetNoCodeqlDbRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("over_limit_repos", m.GetOverLimitRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccessMismatchRepos sets the access_mismatch_repos property value. The access_mismatch_repos property +func (m *CodeScanningVariantAnalysis_skipped_repositories) SetAccessMismatchRepos(value CodeScanningVariantAnalysisSkippedRepoGroupable)() { + m.access_mismatch_repos = value +} +// 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 *CodeScanningVariantAnalysis_skipped_repositories) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNoCodeqlDbRepos sets the no_codeql_db_repos property value. The no_codeql_db_repos property +func (m *CodeScanningVariantAnalysis_skipped_repositories) SetNoCodeqlDbRepos(value CodeScanningVariantAnalysisSkippedRepoGroupable)() { + m.no_codeql_db_repos = value +} +// SetNotFoundRepos sets the not_found_repos property value. The not_found_repos property +func (m *CodeScanningVariantAnalysis_skipped_repositories) SetNotFoundRepos(value CodeScanningVariantAnalysis_skipped_repositories_not_found_reposable)() { + m.not_found_repos = value +} +// SetOverLimitRepos sets the over_limit_repos property value. The over_limit_repos property +func (m *CodeScanningVariantAnalysis_skipped_repositories) SetOverLimitRepos(value CodeScanningVariantAnalysisSkippedRepoGroupable)() { + m.over_limit_repos = value +} +type CodeScanningVariantAnalysis_skipped_repositoriesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessMismatchRepos()(CodeScanningVariantAnalysisSkippedRepoGroupable) + GetNoCodeqlDbRepos()(CodeScanningVariantAnalysisSkippedRepoGroupable) + GetNotFoundRepos()(CodeScanningVariantAnalysis_skipped_repositories_not_found_reposable) + GetOverLimitRepos()(CodeScanningVariantAnalysisSkippedRepoGroupable) + SetAccessMismatchRepos(value CodeScanningVariantAnalysisSkippedRepoGroupable)() + SetNoCodeqlDbRepos(value CodeScanningVariantAnalysisSkippedRepoGroupable)() + SetNotFoundRepos(value CodeScanningVariantAnalysis_skipped_repositories_not_found_reposable)() + SetOverLimitRepos(value CodeScanningVariantAnalysisSkippedRepoGroupable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_skipped_repositories_not_found_repos.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_skipped_repositories_not_found_repos.go new file mode 100644 index 000000000..64ef70618 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_skipped_repositories_not_found_repos.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningVariantAnalysis_skipped_repositories_not_found_repos struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The total number of repositories that were skipped for this reason. + repository_count *int32 + // A list of full repository names that were skipped. This list may not include all repositories that were skipped. + repository_full_names []string +} +// NewCodeScanningVariantAnalysis_skipped_repositories_not_found_repos instantiates a new CodeScanningVariantAnalysis_skipped_repositories_not_found_repos and sets the default values. +func NewCodeScanningVariantAnalysis_skipped_repositories_not_found_repos()(*CodeScanningVariantAnalysis_skipped_repositories_not_found_repos) { + m := &CodeScanningVariantAnalysis_skipped_repositories_not_found_repos{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningVariantAnalysis_skipped_repositories_not_found_reposFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningVariantAnalysis_skipped_repositories_not_found_reposFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningVariantAnalysis_skipped_repositories_not_found_repos(), 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 *CodeScanningVariantAnalysis_skipped_repositories_not_found_repos) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningVariantAnalysis_skipped_repositories_not_found_repos) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repository_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryCount(val) + } + return nil + } + res["repository_full_names"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRepositoryFullNames(res) + } + return nil + } + return res +} +// GetRepositoryCount gets the repository_count property value. The total number of repositories that were skipped for this reason. +// returns a *int32 when successful +func (m *CodeScanningVariantAnalysis_skipped_repositories_not_found_repos) GetRepositoryCount()(*int32) { + return m.repository_count +} +// GetRepositoryFullNames gets the repository_full_names property value. A list of full repository names that were skipped. This list may not include all repositories that were skipped. +// returns a []string when successful +func (m *CodeScanningVariantAnalysis_skipped_repositories_not_found_repos) GetRepositoryFullNames()([]string) { + return m.repository_full_names +} +// Serialize serializes information the current object +func (m *CodeScanningVariantAnalysis_skipped_repositories_not_found_repos) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("repository_count", m.GetRepositoryCount()) + if err != nil { + return err + } + } + if m.GetRepositoryFullNames() != nil { + err := writer.WriteCollectionOfStringValues("repository_full_names", m.GetRepositoryFullNames()) + 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 *CodeScanningVariantAnalysis_skipped_repositories_not_found_repos) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositoryCount sets the repository_count property value. The total number of repositories that were skipped for this reason. +func (m *CodeScanningVariantAnalysis_skipped_repositories_not_found_repos) SetRepositoryCount(value *int32)() { + m.repository_count = value +} +// SetRepositoryFullNames sets the repository_full_names property value. A list of full repository names that were skipped. This list may not include all repositories that were skipped. +func (m *CodeScanningVariantAnalysis_skipped_repositories_not_found_repos) SetRepositoryFullNames(value []string)() { + m.repository_full_names = value +} +type CodeScanningVariantAnalysis_skipped_repositories_not_found_reposable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositoryCount()(*int32) + GetRepositoryFullNames()([]string) + SetRepositoryCount(value *int32)() + SetRepositoryFullNames(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_status.go new file mode 100644 index 000000000..48d116ca8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_scanning_variant_analysis_status.go @@ -0,0 +1,49 @@ +package models +import ( + "errors" +) +// The new status of the CodeQL variant analysis repository task. +type CodeScanningVariantAnalysisStatus int + +const ( + PENDING_CODESCANNINGVARIANTANALYSISSTATUS CodeScanningVariantAnalysisStatus = iota + IN_PROGRESS_CODESCANNINGVARIANTANALYSISSTATUS + SUCCEEDED_CODESCANNINGVARIANTANALYSISSTATUS + FAILED_CODESCANNINGVARIANTANALYSISSTATUS + CANCELED_CODESCANNINGVARIANTANALYSISSTATUS + TIMED_OUT_CODESCANNINGVARIANTANALYSISSTATUS +) + +func (i CodeScanningVariantAnalysisStatus) String() string { + return []string{"pending", "in_progress", "succeeded", "failed", "canceled", "timed_out"}[i] +} +func ParseCodeScanningVariantAnalysisStatus(v string) (any, error) { + result := PENDING_CODESCANNINGVARIANTANALYSISSTATUS + switch v { + case "pending": + result = PENDING_CODESCANNINGVARIANTANALYSISSTATUS + case "in_progress": + result = IN_PROGRESS_CODESCANNINGVARIANTANALYSISSTATUS + case "succeeded": + result = SUCCEEDED_CODESCANNINGVARIANTANALYSISSTATUS + case "failed": + result = FAILED_CODESCANNINGVARIANTANALYSISSTATUS + case "canceled": + result = CANCELED_CODESCANNINGVARIANTANALYSISSTATUS + case "timed_out": + result = TIMED_OUT_CODESCANNINGVARIANTANALYSISSTATUS + default: + return 0, errors.New("Unknown CodeScanningVariantAnalysisStatus value: " + v) + } + return &result, nil +} +func SerializeCodeScanningVariantAnalysisStatus(values []CodeScanningVariantAnalysisStatus) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningVariantAnalysisStatus) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_search_result_item.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_search_result_item.go new file mode 100644 index 000000000..5305d9f49 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_search_result_item.go @@ -0,0 +1,448 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeSearchResultItem code Search Result Item +type CodeSearchResultItem struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The file_size property + file_size *int32 + // The git_url property + git_url *string + // The html_url property + html_url *string + // The language property + language *string + // The last_modified_at property + last_modified_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The line_numbers property + line_numbers []string + // The name property + name *string + // The path property + path *string + // Minimal Repository + repository MinimalRepositoryable + // The score property + score *float64 + // The sha property + sha *string + // The text_matches property + text_matches []Codeable + // The url property + url *string +} +// NewCodeSearchResultItem instantiates a new CodeSearchResultItem and sets the default values. +func NewCodeSearchResultItem()(*CodeSearchResultItem) { + m := &CodeSearchResultItem{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeSearchResultItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeSearchResultItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeSearchResultItem(), 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 *CodeSearchResultItem) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeSearchResultItem) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["file_size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFileSize(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["last_modified_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastModifiedAt(val) + } + return nil + } + res["line_numbers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetLineNumbers(res) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(MinimalRepositoryable)) + } + return nil + } + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["text_matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Codeable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Codeable) + } + } + m.SetTextMatches(res) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFileSize gets the file_size property value. The file_size property +// returns a *int32 when successful +func (m *CodeSearchResultItem) GetFileSize()(*int32) { + return m.file_size +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *CodeSearchResultItem) GetGitUrl()(*string) { + return m.git_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CodeSearchResultItem) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *CodeSearchResultItem) GetLanguage()(*string) { + return m.language +} +// GetLastModifiedAt gets the last_modified_at property value. The last_modified_at property +// returns a *Time when successful +func (m *CodeSearchResultItem) GetLastModifiedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.last_modified_at +} +// GetLineNumbers gets the line_numbers property value. The line_numbers property +// returns a []string when successful +func (m *CodeSearchResultItem) GetLineNumbers()([]string) { + return m.line_numbers +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *CodeSearchResultItem) GetName()(*string) { + return m.name +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *CodeSearchResultItem) GetPath()(*string) { + return m.path +} +// GetRepository gets the repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *CodeSearchResultItem) GetRepository()(MinimalRepositoryable) { + return m.repository +} +// GetScore gets the score property value. The score property +// returns a *float64 when successful +func (m *CodeSearchResultItem) GetScore()(*float64) { + return m.score +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *CodeSearchResultItem) GetSha()(*string) { + return m.sha +} +// GetTextMatches gets the text_matches property value. The text_matches property +// returns a []Codeable when successful +func (m *CodeSearchResultItem) GetTextMatches()([]Codeable) { + return m.text_matches +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CodeSearchResultItem) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CodeSearchResultItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("file_size", m.GetFileSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("last_modified_at", m.GetLastModifiedAt()) + if err != nil { + return err + } + } + if m.GetLineNumbers() != nil { + err := writer.WriteCollectionOfStringValues("line_numbers", m.GetLineNumbers()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("score", m.GetScore()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + if m.GetTextMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTextMatches())) + for i, v := range m.GetTextMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("text_matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CodeSearchResultItem) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFileSize sets the file_size property value. The file_size property +func (m *CodeSearchResultItem) SetFileSize(value *int32)() { + m.file_size = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *CodeSearchResultItem) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CodeSearchResultItem) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLanguage sets the language property value. The language property +func (m *CodeSearchResultItem) SetLanguage(value *string)() { + m.language = value +} +// SetLastModifiedAt sets the last_modified_at property value. The last_modified_at property +func (m *CodeSearchResultItem) SetLastModifiedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.last_modified_at = value +} +// SetLineNumbers sets the line_numbers property value. The line_numbers property +func (m *CodeSearchResultItem) SetLineNumbers(value []string)() { + m.line_numbers = value +} +// SetName sets the name property value. The name property +func (m *CodeSearchResultItem) SetName(value *string)() { + m.name = value +} +// SetPath sets the path property value. The path property +func (m *CodeSearchResultItem) SetPath(value *string)() { + m.path = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *CodeSearchResultItem) SetRepository(value MinimalRepositoryable)() { + m.repository = value +} +// SetScore sets the score property value. The score property +func (m *CodeSearchResultItem) SetScore(value *float64)() { + m.score = value +} +// SetSha sets the sha property value. The sha property +func (m *CodeSearchResultItem) SetSha(value *string)() { + m.sha = value +} +// SetTextMatches sets the text_matches property value. The text_matches property +func (m *CodeSearchResultItem) SetTextMatches(value []Codeable)() { + m.text_matches = value +} +// SetUrl sets the url property value. The url property +func (m *CodeSearchResultItem) SetUrl(value *string)() { + m.url = value +} +type CodeSearchResultItemable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFileSize()(*int32) + GetGitUrl()(*string) + GetHtmlUrl()(*string) + GetLanguage()(*string) + GetLastModifiedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetLineNumbers()([]string) + GetName()(*string) + GetPath()(*string) + GetRepository()(MinimalRepositoryable) + GetScore()(*float64) + GetSha()(*string) + GetTextMatches()([]Codeable) + GetUrl()(*string) + SetFileSize(value *int32)() + SetGitUrl(value *string)() + SetHtmlUrl(value *string)() + SetLanguage(value *string)() + SetLastModifiedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetLineNumbers(value []string)() + SetName(value *string)() + SetPath(value *string)() + SetRepository(value MinimalRepositoryable)() + SetScore(value *float64)() + SetSha(value *string)() + SetTextMatches(value []Codeable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration.go new file mode 100644 index 000000000..12ef440d4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration.go @@ -0,0 +1,526 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeSecurityConfiguration a code security configuration +type CodeSecurityConfiguration struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The enablement status of GitHub Advanced Security + advanced_security *CodeSecurityConfiguration_advanced_security + // The enablement status of code scanning default setup + code_scanning_default_setup *CodeSecurityConfiguration_code_scanning_default_setup + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The enablement status of Dependabot alerts + dependabot_alerts *CodeSecurityConfiguration_dependabot_alerts + // The enablement status of Dependabot security updates + dependabot_security_updates *CodeSecurityConfiguration_dependabot_security_updates + // The enablement status of Dependency Graph + dependency_graph *CodeSecurityConfiguration_dependency_graph + // A description of the code security configuration + description *string + // The URL of the configuration + html_url *string + // The ID of the code security configuration + id *int32 + // The name of the code security configuration. Must be unique within the organization. + name *string + // The enablement status of private vulnerability reporting + private_vulnerability_reporting *CodeSecurityConfiguration_private_vulnerability_reporting + // The enablement status of secret scanning + secret_scanning *CodeSecurityConfiguration_secret_scanning + // The enablement status of secret scanning push protection + secret_scanning_push_protection *CodeSecurityConfiguration_secret_scanning_push_protection + // The type of the code security configuration. + target_type *CodeSecurityConfiguration_target_type + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The URL of the configuration + url *string +} +// NewCodeSecurityConfiguration instantiates a new CodeSecurityConfiguration and sets the default values. +func NewCodeSecurityConfiguration()(*CodeSecurityConfiguration) { + m := &CodeSecurityConfiguration{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeSecurityConfigurationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeSecurityConfigurationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeSecurityConfiguration(), 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 *CodeSecurityConfiguration) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvancedSecurity gets the advanced_security property value. The enablement status of GitHub Advanced Security +// returns a *CodeSecurityConfiguration_advanced_security when successful +func (m *CodeSecurityConfiguration) GetAdvancedSecurity()(*CodeSecurityConfiguration_advanced_security) { + return m.advanced_security +} +// GetCodeScanningDefaultSetup gets the code_scanning_default_setup property value. The enablement status of code scanning default setup +// returns a *CodeSecurityConfiguration_code_scanning_default_setup when successful +func (m *CodeSecurityConfiguration) GetCodeScanningDefaultSetup()(*CodeSecurityConfiguration_code_scanning_default_setup) { + return m.code_scanning_default_setup +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *CodeSecurityConfiguration) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDependabotAlerts gets the dependabot_alerts property value. The enablement status of Dependabot alerts +// returns a *CodeSecurityConfiguration_dependabot_alerts when successful +func (m *CodeSecurityConfiguration) GetDependabotAlerts()(*CodeSecurityConfiguration_dependabot_alerts) { + return m.dependabot_alerts +} +// GetDependabotSecurityUpdates gets the dependabot_security_updates property value. The enablement status of Dependabot security updates +// returns a *CodeSecurityConfiguration_dependabot_security_updates when successful +func (m *CodeSecurityConfiguration) GetDependabotSecurityUpdates()(*CodeSecurityConfiguration_dependabot_security_updates) { + return m.dependabot_security_updates +} +// GetDependencyGraph gets the dependency_graph property value. The enablement status of Dependency Graph +// returns a *CodeSecurityConfiguration_dependency_graph when successful +func (m *CodeSecurityConfiguration) GetDependencyGraph()(*CodeSecurityConfiguration_dependency_graph) { + return m.dependency_graph +} +// GetDescription gets the description property value. A description of the code security configuration +// returns a *string when successful +func (m *CodeSecurityConfiguration) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeSecurityConfiguration) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["advanced_security"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeSecurityConfiguration_advanced_security) + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurity(val.(*CodeSecurityConfiguration_advanced_security)) + } + return nil + } + res["code_scanning_default_setup"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeSecurityConfiguration_code_scanning_default_setup) + if err != nil { + return err + } + if val != nil { + m.SetCodeScanningDefaultSetup(val.(*CodeSecurityConfiguration_code_scanning_default_setup)) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["dependabot_alerts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeSecurityConfiguration_dependabot_alerts) + if err != nil { + return err + } + if val != nil { + m.SetDependabotAlerts(val.(*CodeSecurityConfiguration_dependabot_alerts)) + } + return nil + } + res["dependabot_security_updates"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeSecurityConfiguration_dependabot_security_updates) + if err != nil { + return err + } + if val != nil { + m.SetDependabotSecurityUpdates(val.(*CodeSecurityConfiguration_dependabot_security_updates)) + } + return nil + } + res["dependency_graph"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeSecurityConfiguration_dependency_graph) + if err != nil { + return err + } + if val != nil { + m.SetDependencyGraph(val.(*CodeSecurityConfiguration_dependency_graph)) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["private_vulnerability_reporting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeSecurityConfiguration_private_vulnerability_reporting) + if err != nil { + return err + } + if val != nil { + m.SetPrivateVulnerabilityReporting(val.(*CodeSecurityConfiguration_private_vulnerability_reporting)) + } + return nil + } + res["secret_scanning"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeSecurityConfiguration_secret_scanning) + if err != nil { + return err + } + if val != nil { + m.SetSecretScanning(val.(*CodeSecurityConfiguration_secret_scanning)) + } + return nil + } + res["secret_scanning_push_protection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeSecurityConfiguration_secret_scanning_push_protection) + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtection(val.(*CodeSecurityConfiguration_secret_scanning_push_protection)) + } + return nil + } + res["target_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeSecurityConfiguration_target_type) + if err != nil { + return err + } + if val != nil { + m.SetTargetType(val.(*CodeSecurityConfiguration_target_type)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The URL of the configuration +// returns a *string when successful +func (m *CodeSecurityConfiguration) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The ID of the code security configuration +// returns a *int32 when successful +func (m *CodeSecurityConfiguration) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name of the code security configuration. Must be unique within the organization. +// returns a *string when successful +func (m *CodeSecurityConfiguration) GetName()(*string) { + return m.name +} +// GetPrivateVulnerabilityReporting gets the private_vulnerability_reporting property value. The enablement status of private vulnerability reporting +// returns a *CodeSecurityConfiguration_private_vulnerability_reporting when successful +func (m *CodeSecurityConfiguration) GetPrivateVulnerabilityReporting()(*CodeSecurityConfiguration_private_vulnerability_reporting) { + return m.private_vulnerability_reporting +} +// GetSecretScanning gets the secret_scanning property value. The enablement status of secret scanning +// returns a *CodeSecurityConfiguration_secret_scanning when successful +func (m *CodeSecurityConfiguration) GetSecretScanning()(*CodeSecurityConfiguration_secret_scanning) { + return m.secret_scanning +} +// GetSecretScanningPushProtection gets the secret_scanning_push_protection property value. The enablement status of secret scanning push protection +// returns a *CodeSecurityConfiguration_secret_scanning_push_protection when successful +func (m *CodeSecurityConfiguration) GetSecretScanningPushProtection()(*CodeSecurityConfiguration_secret_scanning_push_protection) { + return m.secret_scanning_push_protection +} +// GetTargetType gets the target_type property value. The type of the code security configuration. +// returns a *CodeSecurityConfiguration_target_type when successful +func (m *CodeSecurityConfiguration) GetTargetType()(*CodeSecurityConfiguration_target_type) { + return m.target_type +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *CodeSecurityConfiguration) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The URL of the configuration +// returns a *string when successful +func (m *CodeSecurityConfiguration) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CodeSecurityConfiguration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAdvancedSecurity() != nil { + cast := (*m.GetAdvancedSecurity()).String() + err := writer.WriteStringValue("advanced_security", &cast) + if err != nil { + return err + } + } + if m.GetCodeScanningDefaultSetup() != nil { + cast := (*m.GetCodeScanningDefaultSetup()).String() + err := writer.WriteStringValue("code_scanning_default_setup", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + if m.GetDependabotAlerts() != nil { + cast := (*m.GetDependabotAlerts()).String() + err := writer.WriteStringValue("dependabot_alerts", &cast) + if err != nil { + return err + } + } + if m.GetDependabotSecurityUpdates() != nil { + cast := (*m.GetDependabotSecurityUpdates()).String() + err := writer.WriteStringValue("dependabot_security_updates", &cast) + if err != nil { + return err + } + } + if m.GetDependencyGraph() != nil { + cast := (*m.GetDependencyGraph()).String() + err := writer.WriteStringValue("dependency_graph", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetPrivateVulnerabilityReporting() != nil { + cast := (*m.GetPrivateVulnerabilityReporting()).String() + err := writer.WriteStringValue("private_vulnerability_reporting", &cast) + if err != nil { + return err + } + } + if m.GetSecretScanning() != nil { + cast := (*m.GetSecretScanning()).String() + err := writer.WriteStringValue("secret_scanning", &cast) + if err != nil { + return err + } + } + if m.GetSecretScanningPushProtection() != nil { + cast := (*m.GetSecretScanningPushProtection()).String() + err := writer.WriteStringValue("secret_scanning_push_protection", &cast) + if err != nil { + return err + } + } + if m.GetTargetType() != nil { + cast := (*m.GetTargetType()).String() + err := writer.WriteStringValue("target_type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CodeSecurityConfiguration) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvancedSecurity sets the advanced_security property value. The enablement status of GitHub Advanced Security +func (m *CodeSecurityConfiguration) SetAdvancedSecurity(value *CodeSecurityConfiguration_advanced_security)() { + m.advanced_security = value +} +// SetCodeScanningDefaultSetup sets the code_scanning_default_setup property value. The enablement status of code scanning default setup +func (m *CodeSecurityConfiguration) SetCodeScanningDefaultSetup(value *CodeSecurityConfiguration_code_scanning_default_setup)() { + m.code_scanning_default_setup = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *CodeSecurityConfiguration) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDependabotAlerts sets the dependabot_alerts property value. The enablement status of Dependabot alerts +func (m *CodeSecurityConfiguration) SetDependabotAlerts(value *CodeSecurityConfiguration_dependabot_alerts)() { + m.dependabot_alerts = value +} +// SetDependabotSecurityUpdates sets the dependabot_security_updates property value. The enablement status of Dependabot security updates +func (m *CodeSecurityConfiguration) SetDependabotSecurityUpdates(value *CodeSecurityConfiguration_dependabot_security_updates)() { + m.dependabot_security_updates = value +} +// SetDependencyGraph sets the dependency_graph property value. The enablement status of Dependency Graph +func (m *CodeSecurityConfiguration) SetDependencyGraph(value *CodeSecurityConfiguration_dependency_graph)() { + m.dependency_graph = value +} +// SetDescription sets the description property value. A description of the code security configuration +func (m *CodeSecurityConfiguration) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The URL of the configuration +func (m *CodeSecurityConfiguration) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The ID of the code security configuration +func (m *CodeSecurityConfiguration) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name of the code security configuration. Must be unique within the organization. +func (m *CodeSecurityConfiguration) SetName(value *string)() { + m.name = value +} +// SetPrivateVulnerabilityReporting sets the private_vulnerability_reporting property value. The enablement status of private vulnerability reporting +func (m *CodeSecurityConfiguration) SetPrivateVulnerabilityReporting(value *CodeSecurityConfiguration_private_vulnerability_reporting)() { + m.private_vulnerability_reporting = value +} +// SetSecretScanning sets the secret_scanning property value. The enablement status of secret scanning +func (m *CodeSecurityConfiguration) SetSecretScanning(value *CodeSecurityConfiguration_secret_scanning)() { + m.secret_scanning = value +} +// SetSecretScanningPushProtection sets the secret_scanning_push_protection property value. The enablement status of secret scanning push protection +func (m *CodeSecurityConfiguration) SetSecretScanningPushProtection(value *CodeSecurityConfiguration_secret_scanning_push_protection)() { + m.secret_scanning_push_protection = value +} +// SetTargetType sets the target_type property value. The type of the code security configuration. +func (m *CodeSecurityConfiguration) SetTargetType(value *CodeSecurityConfiguration_target_type)() { + m.target_type = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *CodeSecurityConfiguration) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The URL of the configuration +func (m *CodeSecurityConfiguration) SetUrl(value *string)() { + m.url = value +} +type CodeSecurityConfigurationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdvancedSecurity()(*CodeSecurityConfiguration_advanced_security) + GetCodeScanningDefaultSetup()(*CodeSecurityConfiguration_code_scanning_default_setup) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDependabotAlerts()(*CodeSecurityConfiguration_dependabot_alerts) + GetDependabotSecurityUpdates()(*CodeSecurityConfiguration_dependabot_security_updates) + GetDependencyGraph()(*CodeSecurityConfiguration_dependency_graph) + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetName()(*string) + GetPrivateVulnerabilityReporting()(*CodeSecurityConfiguration_private_vulnerability_reporting) + GetSecretScanning()(*CodeSecurityConfiguration_secret_scanning) + GetSecretScanningPushProtection()(*CodeSecurityConfiguration_secret_scanning_push_protection) + GetTargetType()(*CodeSecurityConfiguration_target_type) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAdvancedSecurity(value *CodeSecurityConfiguration_advanced_security)() + SetCodeScanningDefaultSetup(value *CodeSecurityConfiguration_code_scanning_default_setup)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDependabotAlerts(value *CodeSecurityConfiguration_dependabot_alerts)() + SetDependabotSecurityUpdates(value *CodeSecurityConfiguration_dependabot_security_updates)() + SetDependencyGraph(value *CodeSecurityConfiguration_dependency_graph)() + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetPrivateVulnerabilityReporting(value *CodeSecurityConfiguration_private_vulnerability_reporting)() + SetSecretScanning(value *CodeSecurityConfiguration_secret_scanning)() + SetSecretScanningPushProtection(value *CodeSecurityConfiguration_secret_scanning_push_protection)() + SetTargetType(value *CodeSecurityConfiguration_target_type)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_advanced_security.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_advanced_security.go new file mode 100644 index 000000000..ddc2cfac3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_advanced_security.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The enablement status of GitHub Advanced Security +type CodeSecurityConfiguration_advanced_security int + +const ( + ENABLED_CODESECURITYCONFIGURATION_ADVANCED_SECURITY CodeSecurityConfiguration_advanced_security = iota + DISABLED_CODESECURITYCONFIGURATION_ADVANCED_SECURITY +) + +func (i CodeSecurityConfiguration_advanced_security) String() string { + return []string{"enabled", "disabled"}[i] +} +func ParseCodeSecurityConfiguration_advanced_security(v string) (any, error) { + result := ENABLED_CODESECURITYCONFIGURATION_ADVANCED_SECURITY + switch v { + case "enabled": + result = ENABLED_CODESECURITYCONFIGURATION_ADVANCED_SECURITY + case "disabled": + result = DISABLED_CODESECURITYCONFIGURATION_ADVANCED_SECURITY + default: + return 0, errors.New("Unknown CodeSecurityConfiguration_advanced_security value: " + v) + } + return &result, nil +} +func SerializeCodeSecurityConfiguration_advanced_security(values []CodeSecurityConfiguration_advanced_security) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeSecurityConfiguration_advanced_security) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_code_scanning_default_setup.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_code_scanning_default_setup.go new file mode 100644 index 000000000..75fecc0b4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_code_scanning_default_setup.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The enablement status of code scanning default setup +type CodeSecurityConfiguration_code_scanning_default_setup int + +const ( + ENABLED_CODESECURITYCONFIGURATION_CODE_SCANNING_DEFAULT_SETUP CodeSecurityConfiguration_code_scanning_default_setup = iota + DISABLED_CODESECURITYCONFIGURATION_CODE_SCANNING_DEFAULT_SETUP + NOT_SET_CODESECURITYCONFIGURATION_CODE_SCANNING_DEFAULT_SETUP +) + +func (i CodeSecurityConfiguration_code_scanning_default_setup) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseCodeSecurityConfiguration_code_scanning_default_setup(v string) (any, error) { + result := ENABLED_CODESECURITYCONFIGURATION_CODE_SCANNING_DEFAULT_SETUP + switch v { + case "enabled": + result = ENABLED_CODESECURITYCONFIGURATION_CODE_SCANNING_DEFAULT_SETUP + case "disabled": + result = DISABLED_CODESECURITYCONFIGURATION_CODE_SCANNING_DEFAULT_SETUP + case "not_set": + result = NOT_SET_CODESECURITYCONFIGURATION_CODE_SCANNING_DEFAULT_SETUP + default: + return 0, errors.New("Unknown CodeSecurityConfiguration_code_scanning_default_setup value: " + v) + } + return &result, nil +} +func SerializeCodeSecurityConfiguration_code_scanning_default_setup(values []CodeSecurityConfiguration_code_scanning_default_setup) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeSecurityConfiguration_code_scanning_default_setup) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_dependabot_alerts.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_dependabot_alerts.go new file mode 100644 index 000000000..f3e1af777 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_dependabot_alerts.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The enablement status of Dependabot alerts +type CodeSecurityConfiguration_dependabot_alerts int + +const ( + ENABLED_CODESECURITYCONFIGURATION_DEPENDABOT_ALERTS CodeSecurityConfiguration_dependabot_alerts = iota + DISABLED_CODESECURITYCONFIGURATION_DEPENDABOT_ALERTS + NOT_SET_CODESECURITYCONFIGURATION_DEPENDABOT_ALERTS +) + +func (i CodeSecurityConfiguration_dependabot_alerts) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseCodeSecurityConfiguration_dependabot_alerts(v string) (any, error) { + result := ENABLED_CODESECURITYCONFIGURATION_DEPENDABOT_ALERTS + switch v { + case "enabled": + result = ENABLED_CODESECURITYCONFIGURATION_DEPENDABOT_ALERTS + case "disabled": + result = DISABLED_CODESECURITYCONFIGURATION_DEPENDABOT_ALERTS + case "not_set": + result = NOT_SET_CODESECURITYCONFIGURATION_DEPENDABOT_ALERTS + default: + return 0, errors.New("Unknown CodeSecurityConfiguration_dependabot_alerts value: " + v) + } + return &result, nil +} +func SerializeCodeSecurityConfiguration_dependabot_alerts(values []CodeSecurityConfiguration_dependabot_alerts) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeSecurityConfiguration_dependabot_alerts) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_dependabot_security_updates.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_dependabot_security_updates.go new file mode 100644 index 000000000..eec6d4e65 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_dependabot_security_updates.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The enablement status of Dependabot security updates +type CodeSecurityConfiguration_dependabot_security_updates int + +const ( + ENABLED_CODESECURITYCONFIGURATION_DEPENDABOT_SECURITY_UPDATES CodeSecurityConfiguration_dependabot_security_updates = iota + DISABLED_CODESECURITYCONFIGURATION_DEPENDABOT_SECURITY_UPDATES + NOT_SET_CODESECURITYCONFIGURATION_DEPENDABOT_SECURITY_UPDATES +) + +func (i CodeSecurityConfiguration_dependabot_security_updates) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseCodeSecurityConfiguration_dependabot_security_updates(v string) (any, error) { + result := ENABLED_CODESECURITYCONFIGURATION_DEPENDABOT_SECURITY_UPDATES + switch v { + case "enabled": + result = ENABLED_CODESECURITYCONFIGURATION_DEPENDABOT_SECURITY_UPDATES + case "disabled": + result = DISABLED_CODESECURITYCONFIGURATION_DEPENDABOT_SECURITY_UPDATES + case "not_set": + result = NOT_SET_CODESECURITYCONFIGURATION_DEPENDABOT_SECURITY_UPDATES + default: + return 0, errors.New("Unknown CodeSecurityConfiguration_dependabot_security_updates value: " + v) + } + return &result, nil +} +func SerializeCodeSecurityConfiguration_dependabot_security_updates(values []CodeSecurityConfiguration_dependabot_security_updates) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeSecurityConfiguration_dependabot_security_updates) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_dependency_graph.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_dependency_graph.go new file mode 100644 index 000000000..e92e1bab4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_dependency_graph.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The enablement status of Dependency Graph +type CodeSecurityConfiguration_dependency_graph int + +const ( + ENABLED_CODESECURITYCONFIGURATION_DEPENDENCY_GRAPH CodeSecurityConfiguration_dependency_graph = iota + DISABLED_CODESECURITYCONFIGURATION_DEPENDENCY_GRAPH + NOT_SET_CODESECURITYCONFIGURATION_DEPENDENCY_GRAPH +) + +func (i CodeSecurityConfiguration_dependency_graph) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseCodeSecurityConfiguration_dependency_graph(v string) (any, error) { + result := ENABLED_CODESECURITYCONFIGURATION_DEPENDENCY_GRAPH + switch v { + case "enabled": + result = ENABLED_CODESECURITYCONFIGURATION_DEPENDENCY_GRAPH + case "disabled": + result = DISABLED_CODESECURITYCONFIGURATION_DEPENDENCY_GRAPH + case "not_set": + result = NOT_SET_CODESECURITYCONFIGURATION_DEPENDENCY_GRAPH + default: + return 0, errors.New("Unknown CodeSecurityConfiguration_dependency_graph value: " + v) + } + return &result, nil +} +func SerializeCodeSecurityConfiguration_dependency_graph(values []CodeSecurityConfiguration_dependency_graph) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeSecurityConfiguration_dependency_graph) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_private_vulnerability_reporting.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_private_vulnerability_reporting.go new file mode 100644 index 000000000..7342de59d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_private_vulnerability_reporting.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The enablement status of private vulnerability reporting +type CodeSecurityConfiguration_private_vulnerability_reporting int + +const ( + ENABLED_CODESECURITYCONFIGURATION_PRIVATE_VULNERABILITY_REPORTING CodeSecurityConfiguration_private_vulnerability_reporting = iota + DISABLED_CODESECURITYCONFIGURATION_PRIVATE_VULNERABILITY_REPORTING + NOT_SET_CODESECURITYCONFIGURATION_PRIVATE_VULNERABILITY_REPORTING +) + +func (i CodeSecurityConfiguration_private_vulnerability_reporting) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseCodeSecurityConfiguration_private_vulnerability_reporting(v string) (any, error) { + result := ENABLED_CODESECURITYCONFIGURATION_PRIVATE_VULNERABILITY_REPORTING + switch v { + case "enabled": + result = ENABLED_CODESECURITYCONFIGURATION_PRIVATE_VULNERABILITY_REPORTING + case "disabled": + result = DISABLED_CODESECURITYCONFIGURATION_PRIVATE_VULNERABILITY_REPORTING + case "not_set": + result = NOT_SET_CODESECURITYCONFIGURATION_PRIVATE_VULNERABILITY_REPORTING + default: + return 0, errors.New("Unknown CodeSecurityConfiguration_private_vulnerability_reporting value: " + v) + } + return &result, nil +} +func SerializeCodeSecurityConfiguration_private_vulnerability_reporting(values []CodeSecurityConfiguration_private_vulnerability_reporting) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeSecurityConfiguration_private_vulnerability_reporting) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_repositories.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_repositories.go new file mode 100644 index 000000000..9ed54627f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_repositories.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeSecurityConfigurationRepositories repositories associated with a code security configuration and attachment status +type CodeSecurityConfigurationRepositories struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub repository. + repository SimpleRepositoryable + // The attachment status of the code security configuration on the repository. + status *CodeSecurityConfigurationRepositories_status +} +// NewCodeSecurityConfigurationRepositories instantiates a new CodeSecurityConfigurationRepositories and sets the default values. +func NewCodeSecurityConfigurationRepositories()(*CodeSecurityConfigurationRepositories) { + m := &CodeSecurityConfigurationRepositories{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeSecurityConfigurationRepositoriesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeSecurityConfigurationRepositoriesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeSecurityConfigurationRepositories(), 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 *CodeSecurityConfigurationRepositories) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeSecurityConfigurationRepositories) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(SimpleRepositoryable)) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeSecurityConfigurationRepositories_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*CodeSecurityConfigurationRepositories_status)) + } + return nil + } + return res +} +// GetRepository gets the repository property value. A GitHub repository. +// returns a SimpleRepositoryable when successful +func (m *CodeSecurityConfigurationRepositories) GetRepository()(SimpleRepositoryable) { + return m.repository +} +// GetStatus gets the status property value. The attachment status of the code security configuration on the repository. +// returns a *CodeSecurityConfigurationRepositories_status when successful +func (m *CodeSecurityConfigurationRepositories) GetStatus()(*CodeSecurityConfigurationRepositories_status) { + return m.status +} +// Serialize serializes information the current object +func (m *CodeSecurityConfigurationRepositories) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err := writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CodeSecurityConfigurationRepositories) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepository sets the repository property value. A GitHub repository. +func (m *CodeSecurityConfigurationRepositories) SetRepository(value SimpleRepositoryable)() { + m.repository = value +} +// SetStatus sets the status property value. The attachment status of the code security configuration on the repository. +func (m *CodeSecurityConfigurationRepositories) SetStatus(value *CodeSecurityConfigurationRepositories_status)() { + m.status = value +} +type CodeSecurityConfigurationRepositoriesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepository()(SimpleRepositoryable) + GetStatus()(*CodeSecurityConfigurationRepositories_status) + SetRepository(value SimpleRepositoryable)() + SetStatus(value *CodeSecurityConfigurationRepositories_status)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_repositories_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_repositories_status.go new file mode 100644 index 000000000..4e0871c72 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_repositories_status.go @@ -0,0 +1,49 @@ +package models +import ( + "errors" +) +// The attachment status of the code security configuration on the repository. +type CodeSecurityConfigurationRepositories_status int + +const ( + ATTACHED_CODESECURITYCONFIGURATIONREPOSITORIES_STATUS CodeSecurityConfigurationRepositories_status = iota + ATTACHING_CODESECURITYCONFIGURATIONREPOSITORIES_STATUS + DETACHED_CODESECURITYCONFIGURATIONREPOSITORIES_STATUS + ENFORCED_CODESECURITYCONFIGURATIONREPOSITORIES_STATUS + FAILED_CODESECURITYCONFIGURATIONREPOSITORIES_STATUS + UPDATING_CODESECURITYCONFIGURATIONREPOSITORIES_STATUS +) + +func (i CodeSecurityConfigurationRepositories_status) String() string { + return []string{"attached", "attaching", "detached", "enforced", "failed", "updating"}[i] +} +func ParseCodeSecurityConfigurationRepositories_status(v string) (any, error) { + result := ATTACHED_CODESECURITYCONFIGURATIONREPOSITORIES_STATUS + switch v { + case "attached": + result = ATTACHED_CODESECURITYCONFIGURATIONREPOSITORIES_STATUS + case "attaching": + result = ATTACHING_CODESECURITYCONFIGURATIONREPOSITORIES_STATUS + case "detached": + result = DETACHED_CODESECURITYCONFIGURATIONREPOSITORIES_STATUS + case "enforced": + result = ENFORCED_CODESECURITYCONFIGURATIONREPOSITORIES_STATUS + case "failed": + result = FAILED_CODESECURITYCONFIGURATIONREPOSITORIES_STATUS + case "updating": + result = UPDATING_CODESECURITYCONFIGURATIONREPOSITORIES_STATUS + default: + return 0, errors.New("Unknown CodeSecurityConfigurationRepositories_status value: " + v) + } + return &result, nil +} +func SerializeCodeSecurityConfigurationRepositories_status(values []CodeSecurityConfigurationRepositories_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeSecurityConfigurationRepositories_status) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_secret_scanning.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_secret_scanning.go new file mode 100644 index 000000000..dbbdae869 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_secret_scanning.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The enablement status of secret scanning +type CodeSecurityConfiguration_secret_scanning int + +const ( + ENABLED_CODESECURITYCONFIGURATION_SECRET_SCANNING CodeSecurityConfiguration_secret_scanning = iota + DISABLED_CODESECURITYCONFIGURATION_SECRET_SCANNING + NOT_SET_CODESECURITYCONFIGURATION_SECRET_SCANNING +) + +func (i CodeSecurityConfiguration_secret_scanning) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseCodeSecurityConfiguration_secret_scanning(v string) (any, error) { + result := ENABLED_CODESECURITYCONFIGURATION_SECRET_SCANNING + switch v { + case "enabled": + result = ENABLED_CODESECURITYCONFIGURATION_SECRET_SCANNING + case "disabled": + result = DISABLED_CODESECURITYCONFIGURATION_SECRET_SCANNING + case "not_set": + result = NOT_SET_CODESECURITYCONFIGURATION_SECRET_SCANNING + default: + return 0, errors.New("Unknown CodeSecurityConfiguration_secret_scanning value: " + v) + } + return &result, nil +} +func SerializeCodeSecurityConfiguration_secret_scanning(values []CodeSecurityConfiguration_secret_scanning) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeSecurityConfiguration_secret_scanning) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_secret_scanning_push_protection.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_secret_scanning_push_protection.go new file mode 100644 index 000000000..c86ab211d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_secret_scanning_push_protection.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The enablement status of secret scanning push protection +type CodeSecurityConfiguration_secret_scanning_push_protection int + +const ( + ENABLED_CODESECURITYCONFIGURATION_SECRET_SCANNING_PUSH_PROTECTION CodeSecurityConfiguration_secret_scanning_push_protection = iota + DISABLED_CODESECURITYCONFIGURATION_SECRET_SCANNING_PUSH_PROTECTION + NOT_SET_CODESECURITYCONFIGURATION_SECRET_SCANNING_PUSH_PROTECTION +) + +func (i CodeSecurityConfiguration_secret_scanning_push_protection) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseCodeSecurityConfiguration_secret_scanning_push_protection(v string) (any, error) { + result := ENABLED_CODESECURITYCONFIGURATION_SECRET_SCANNING_PUSH_PROTECTION + switch v { + case "enabled": + result = ENABLED_CODESECURITYCONFIGURATION_SECRET_SCANNING_PUSH_PROTECTION + case "disabled": + result = DISABLED_CODESECURITYCONFIGURATION_SECRET_SCANNING_PUSH_PROTECTION + case "not_set": + result = NOT_SET_CODESECURITYCONFIGURATION_SECRET_SCANNING_PUSH_PROTECTION + default: + return 0, errors.New("Unknown CodeSecurityConfiguration_secret_scanning_push_protection value: " + v) + } + return &result, nil +} +func SerializeCodeSecurityConfiguration_secret_scanning_push_protection(values []CodeSecurityConfiguration_secret_scanning_push_protection) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeSecurityConfiguration_secret_scanning_push_protection) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_target_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_target_type.go new file mode 100644 index 000000000..3cd9704ce --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_configuration_target_type.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The type of the code security configuration. +type CodeSecurityConfiguration_target_type int + +const ( + GLOBAL_CODESECURITYCONFIGURATION_TARGET_TYPE CodeSecurityConfiguration_target_type = iota + ORGANIZATION_CODESECURITYCONFIGURATION_TARGET_TYPE +) + +func (i CodeSecurityConfiguration_target_type) String() string { + return []string{"global", "organization"}[i] +} +func ParseCodeSecurityConfiguration_target_type(v string) (any, error) { + result := GLOBAL_CODESECURITYCONFIGURATION_TARGET_TYPE + switch v { + case "global": + result = GLOBAL_CODESECURITYCONFIGURATION_TARGET_TYPE + case "organization": + result = ORGANIZATION_CODESECURITYCONFIGURATION_TARGET_TYPE + default: + return 0, errors.New("Unknown CodeSecurityConfiguration_target_type value: " + v) + } + return &result, nil +} +func SerializeCodeSecurityConfiguration_target_type(values []CodeSecurityConfiguration_target_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeSecurityConfiguration_target_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_default_configurations.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_default_configurations.go new file mode 100644 index 000000000..973a19282 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_default_configurations.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeSecurityDefaultConfigurations struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A code security configuration + configuration CodeSecurityConfigurationable + // The visibility of newly created repositories for which the code security configuration will be applied to by default + default_for_new_repos *CodeSecurityDefaultConfigurations_default_for_new_repos +} +// NewCodeSecurityDefaultConfigurations instantiates a new CodeSecurityDefaultConfigurations and sets the default values. +func NewCodeSecurityDefaultConfigurations()(*CodeSecurityDefaultConfigurations) { + m := &CodeSecurityDefaultConfigurations{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeSecurityDefaultConfigurationsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeSecurityDefaultConfigurationsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeSecurityDefaultConfigurations(), 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 *CodeSecurityDefaultConfigurations) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfiguration gets the configuration property value. A code security configuration +// returns a CodeSecurityConfigurationable when successful +func (m *CodeSecurityDefaultConfigurations) GetConfiguration()(CodeSecurityConfigurationable) { + return m.configuration +} +// GetDefaultForNewRepos gets the default_for_new_repos property value. The visibility of newly created repositories for which the code security configuration will be applied to by default +// returns a *CodeSecurityDefaultConfigurations_default_for_new_repos when successful +func (m *CodeSecurityDefaultConfigurations) GetDefaultForNewRepos()(*CodeSecurityDefaultConfigurations_default_for_new_repos) { + return m.default_for_new_repos +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeSecurityDefaultConfigurations) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["configuration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeSecurityConfigurationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfiguration(val.(CodeSecurityConfigurationable)) + } + return nil + } + res["default_for_new_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeSecurityDefaultConfigurations_default_for_new_repos) + if err != nil { + return err + } + if val != nil { + m.SetDefaultForNewRepos(val.(*CodeSecurityDefaultConfigurations_default_for_new_repos)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *CodeSecurityDefaultConfigurations) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("configuration", m.GetConfiguration()) + if err != nil { + return err + } + } + if m.GetDefaultForNewRepos() != nil { + cast := (*m.GetDefaultForNewRepos()).String() + err := writer.WriteStringValue("default_for_new_repos", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CodeSecurityDefaultConfigurations) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfiguration sets the configuration property value. A code security configuration +func (m *CodeSecurityDefaultConfigurations) SetConfiguration(value CodeSecurityConfigurationable)() { + m.configuration = value +} +// SetDefaultForNewRepos sets the default_for_new_repos property value. The visibility of newly created repositories for which the code security configuration will be applied to by default +func (m *CodeSecurityDefaultConfigurations) SetDefaultForNewRepos(value *CodeSecurityDefaultConfigurations_default_for_new_repos)() { + m.default_for_new_repos = value +} +type CodeSecurityDefaultConfigurationsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetConfiguration()(CodeSecurityConfigurationable) + GetDefaultForNewRepos()(*CodeSecurityDefaultConfigurations_default_for_new_repos) + SetConfiguration(value CodeSecurityConfigurationable)() + SetDefaultForNewRepos(value *CodeSecurityDefaultConfigurations_default_for_new_repos)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_default_configurations_default_for_new_repos.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_default_configurations_default_for_new_repos.go new file mode 100644 index 000000000..bbb7cbed3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/code_security_default_configurations_default_for_new_repos.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The visibility of newly created repositories for which the code security configuration will be applied to by default +type CodeSecurityDefaultConfigurations_default_for_new_repos int + +const ( + PUBLIC_CODESECURITYDEFAULTCONFIGURATIONS_DEFAULT_FOR_NEW_REPOS CodeSecurityDefaultConfigurations_default_for_new_repos = iota + PRIVATE_AND_INTERNAL_CODESECURITYDEFAULTCONFIGURATIONS_DEFAULT_FOR_NEW_REPOS + ALL_CODESECURITYDEFAULTCONFIGURATIONS_DEFAULT_FOR_NEW_REPOS +) + +func (i CodeSecurityDefaultConfigurations_default_for_new_repos) String() string { + return []string{"public", "private_and_internal", "all"}[i] +} +func ParseCodeSecurityDefaultConfigurations_default_for_new_repos(v string) (any, error) { + result := PUBLIC_CODESECURITYDEFAULTCONFIGURATIONS_DEFAULT_FOR_NEW_REPOS + switch v { + case "public": + result = PUBLIC_CODESECURITYDEFAULTCONFIGURATIONS_DEFAULT_FOR_NEW_REPOS + case "private_and_internal": + result = PRIVATE_AND_INTERNAL_CODESECURITYDEFAULTCONFIGURATIONS_DEFAULT_FOR_NEW_REPOS + case "all": + result = ALL_CODESECURITYDEFAULTCONFIGURATIONS_DEFAULT_FOR_NEW_REPOS + default: + return 0, errors.New("Unknown CodeSecurityDefaultConfigurations_default_for_new_repos value: " + v) + } + return &result, nil +} +func SerializeCodeSecurityDefaultConfigurations_default_for_new_repos(values []CodeSecurityDefaultConfigurations_default_for_new_repos) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeSecurityDefaultConfigurations_default_for_new_repos) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codeowners_errors.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codeowners_errors.go new file mode 100644 index 000000000..11730baf0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codeowners_errors.go @@ -0,0 +1,93 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeownersErrors a list of errors found in a repo's CODEOWNERS file +type CodeownersErrors struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The errors property + errors []CodeownersErrors_errorsable +} +// NewCodeownersErrors instantiates a new CodeownersErrors and sets the default values. +func NewCodeownersErrors()(*CodeownersErrors) { + m := &CodeownersErrors{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeownersErrorsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeownersErrorsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeownersErrors(), 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 *CodeownersErrors) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetErrors gets the errors property value. The errors property +// returns a []CodeownersErrors_errorsable when successful +func (m *CodeownersErrors) GetErrors()([]CodeownersErrors_errorsable) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeownersErrors) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCodeownersErrors_errorsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CodeownersErrors_errorsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CodeownersErrors_errorsable) + } + } + m.SetErrors(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *CodeownersErrors) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetErrors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetErrors())) + for i, v := range m.GetErrors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("errors", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CodeownersErrors) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetErrors sets the errors property value. The errors property +func (m *CodeownersErrors) SetErrors(value []CodeownersErrors_errorsable)() { + m.errors = value +} +type CodeownersErrorsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetErrors()([]CodeownersErrors_errorsable) + SetErrors(value []CodeownersErrors_errorsable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codeowners_errors_errors.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codeowners_errors_errors.go new file mode 100644 index 000000000..267227b43 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codeowners_errors_errors.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeownersErrors_errors struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The column number where this errors occurs. + column *int32 + // The type of error. + kind *string + // The line number where this errors occurs. + line *int32 + // A human-readable description of the error, combining information from multiple fields, laid out for display in a monospaced typeface (for example, a command-line setting). + message *string + // The path of the file where the error occured. + path *string + // The contents of the line where the error occurs. + source *string + // Suggested action to fix the error. This will usually be `null`, but is provided for some common errors. + suggestion *string +} +// NewCodeownersErrors_errors instantiates a new CodeownersErrors_errors and sets the default values. +func NewCodeownersErrors_errors()(*CodeownersErrors_errors) { + m := &CodeownersErrors_errors{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeownersErrors_errorsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeownersErrors_errorsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeownersErrors_errors(), 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 *CodeownersErrors_errors) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColumn gets the column property value. The column number where this errors occurs. +// returns a *int32 when successful +func (m *CodeownersErrors_errors) GetColumn()(*int32) { + return m.column +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeownersErrors_errors) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["column"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetColumn(val) + } + return nil + } + res["kind"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKind(val) + } + return nil + } + res["line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLine(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(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["source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSource(val) + } + return nil + } + res["suggestion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSuggestion(val) + } + return nil + } + return res +} +// GetKind gets the kind property value. The type of error. +// returns a *string when successful +func (m *CodeownersErrors_errors) GetKind()(*string) { + return m.kind +} +// GetLine gets the line property value. The line number where this errors occurs. +// returns a *int32 when successful +func (m *CodeownersErrors_errors) GetLine()(*int32) { + return m.line +} +// GetMessage gets the message property value. A human-readable description of the error, combining information from multiple fields, laid out for display in a monospaced typeface (for example, a command-line setting). +// returns a *string when successful +func (m *CodeownersErrors_errors) GetMessage()(*string) { + return m.message +} +// GetPath gets the path property value. The path of the file where the error occured. +// returns a *string when successful +func (m *CodeownersErrors_errors) GetPath()(*string) { + return m.path +} +// GetSource gets the source property value. The contents of the line where the error occurs. +// returns a *string when successful +func (m *CodeownersErrors_errors) GetSource()(*string) { + return m.source +} +// GetSuggestion gets the suggestion property value. Suggested action to fix the error. This will usually be `null`, but is provided for some common errors. +// returns a *string when successful +func (m *CodeownersErrors_errors) GetSuggestion()(*string) { + return m.suggestion +} +// Serialize serializes information the current object +func (m *CodeownersErrors_errors) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("column", m.GetColumn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("kind", m.GetKind()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("line", m.GetLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("source", m.GetSource()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("suggestion", m.GetSuggestion()) + 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 *CodeownersErrors_errors) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColumn sets the column property value. The column number where this errors occurs. +func (m *CodeownersErrors_errors) SetColumn(value *int32)() { + m.column = value +} +// SetKind sets the kind property value. The type of error. +func (m *CodeownersErrors_errors) SetKind(value *string)() { + m.kind = value +} +// SetLine sets the line property value. The line number where this errors occurs. +func (m *CodeownersErrors_errors) SetLine(value *int32)() { + m.line = value +} +// SetMessage sets the message property value. A human-readable description of the error, combining information from multiple fields, laid out for display in a monospaced typeface (for example, a command-line setting). +func (m *CodeownersErrors_errors) SetMessage(value *string)() { + m.message = value +} +// SetPath sets the path property value. The path of the file where the error occured. +func (m *CodeownersErrors_errors) SetPath(value *string)() { + m.path = value +} +// SetSource sets the source property value. The contents of the line where the error occurs. +func (m *CodeownersErrors_errors) SetSource(value *string)() { + m.source = value +} +// SetSuggestion sets the suggestion property value. Suggested action to fix the error. This will usually be `null`, but is provided for some common errors. +func (m *CodeownersErrors_errors) SetSuggestion(value *string)() { + m.suggestion = value +} +type CodeownersErrors_errorsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColumn()(*int32) + GetKind()(*string) + GetLine()(*int32) + GetMessage()(*string) + GetPath()(*string) + GetSource()(*string) + GetSuggestion()(*string) + SetColumn(value *int32)() + SetKind(value *string)() + SetLine(value *int32)() + SetMessage(value *string)() + SetPath(value *string)() + SetSource(value *string)() + SetSuggestion(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace.go new file mode 100644 index 000000000..b2b282668 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace.go @@ -0,0 +1,989 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Codespace a codespace. +type Codespace struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + billable_owner SimpleUserable + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Path to devcontainer.json from repo root used to create Codespace. + devcontainer_path *string + // Display name for this codespace. + display_name *string + // UUID identifying this codespace's environment. + environment_id *string + // Details about the codespace's git repository. + git_status Codespace_git_statusable + // The id property + id *int64 + // The number of minutes of inactivity after which this codespace will be automatically stopped. + idle_timeout_minutes *int32 + // Text to show user when codespace idle timeout minutes has been overriden by an organization policy + idle_timeout_notice *string + // The text to display to a user when a codespace has been stopped for a potentially actionable reason. + last_known_stop_notice *string + // Last known time this codespace was started. + last_used_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The initally assigned location of a new codespace. + location *Codespace_location + // A description of the machine powering a codespace. + machine NullableCodespaceMachineable + // API URL to access available alternate machine types for this codespace. + machines_url *string + // Automatically generated name of this codespace. + name *string + // A GitHub user. + owner SimpleUserable + // Whether or not a codespace has a pending async operation. This would mean that the codespace is temporarily unavailable. The only thing that you can do with a codespace in this state is delete it. + pending_operation *bool + // Text to show user when codespace is disabled by a pending operation + pending_operation_disabled_reason *string + // Whether the codespace was created from a prebuild. + prebuild *bool + // API URL to publish this codespace to a new repository. + publish_url *string + // API URL for the Pull Request associated with this codespace, if any. + pulls_url *string + // The recent_folders property + recent_folders []string + // Minimal Repository + repository MinimalRepositoryable + // When a codespace will be auto-deleted based on the "retention_period_minutes" and "last_used_at" + retention_expires_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days). + retention_period_minutes *int32 + // The runtime_constraints property + runtime_constraints Codespace_runtime_constraintsable + // API URL to start this codespace. + start_url *string + // State of this codespace. + state *Codespace_state + // API URL to stop this codespace. + stop_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // API URL for this codespace. + url *string + // URL to access this codespace on the web. + web_url *string +} +// NewCodespace instantiates a new Codespace and sets the default values. +func NewCodespace()(*Codespace) { + m := &Codespace{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespaceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespaceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespace(), 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 *Codespace) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBillableOwner gets the billable_owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *Codespace) GetBillableOwner()(SimpleUserable) { + return m.billable_owner +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Codespace) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDevcontainerPath gets the devcontainer_path property value. Path to devcontainer.json from repo root used to create Codespace. +// returns a *string when successful +func (m *Codespace) GetDevcontainerPath()(*string) { + return m.devcontainer_path +} +// GetDisplayName gets the display_name property value. Display name for this codespace. +// returns a *string when successful +func (m *Codespace) GetDisplayName()(*string) { + return m.display_name +} +// GetEnvironmentId gets the environment_id property value. UUID identifying this codespace's environment. +// returns a *string when successful +func (m *Codespace) GetEnvironmentId()(*string) { + return m.environment_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Codespace) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["billable_owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBillableOwner(val.(SimpleUserable)) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["devcontainer_path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDevcontainerPath(val) + } + return nil + } + res["display_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["environment_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironmentId(val) + } + return nil + } + res["git_status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodespace_git_statusFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetGitStatus(val.(Codespace_git_statusable)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["idle_timeout_minutes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetIdleTimeoutMinutes(val) + } + return nil + } + res["idle_timeout_notice"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIdleTimeoutNotice(val) + } + return nil + } + res["last_known_stop_notice"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLastKnownStopNotice(val) + } + return nil + } + res["last_used_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastUsedAt(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodespace_location) + if err != nil { + return err + } + if val != nil { + m.SetLocation(val.(*Codespace_location)) + } + return nil + } + res["machine"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableCodespaceMachineFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMachine(val.(NullableCodespaceMachineable)) + } + return nil + } + res["machines_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMachinesUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["pending_operation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPendingOperation(val) + } + return nil + } + res["pending_operation_disabled_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPendingOperationDisabledReason(val) + } + return nil + } + res["prebuild"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrebuild(val) + } + return nil + } + res["publish_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublishUrl(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["recent_folders"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRecentFolders(res) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(MinimalRepositoryable)) + } + return nil + } + res["retention_expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetRetentionExpiresAt(val) + } + return nil + } + res["retention_period_minutes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRetentionPeriodMinutes(val) + } + return nil + } + res["runtime_constraints"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodespace_runtime_constraintsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRuntimeConstraints(val.(Codespace_runtime_constraintsable)) + } + return nil + } + res["start_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStartUrl(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodespace_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*Codespace_state)) + } + return nil + } + res["stop_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStopUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["web_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWebUrl(val) + } + return nil + } + return res +} +// GetGitStatus gets the git_status property value. Details about the codespace's git repository. +// returns a Codespace_git_statusable when successful +func (m *Codespace) GetGitStatus()(Codespace_git_statusable) { + return m.git_status +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *Codespace) GetId()(*int64) { + return m.id +} +// GetIdleTimeoutMinutes gets the idle_timeout_minutes property value. The number of minutes of inactivity after which this codespace will be automatically stopped. +// returns a *int32 when successful +func (m *Codespace) GetIdleTimeoutMinutes()(*int32) { + return m.idle_timeout_minutes +} +// GetIdleTimeoutNotice gets the idle_timeout_notice property value. Text to show user when codespace idle timeout minutes has been overriden by an organization policy +// returns a *string when successful +func (m *Codespace) GetIdleTimeoutNotice()(*string) { + return m.idle_timeout_notice +} +// GetLastKnownStopNotice gets the last_known_stop_notice property value. The text to display to a user when a codespace has been stopped for a potentially actionable reason. +// returns a *string when successful +func (m *Codespace) GetLastKnownStopNotice()(*string) { + return m.last_known_stop_notice +} +// GetLastUsedAt gets the last_used_at property value. Last known time this codespace was started. +// returns a *Time when successful +func (m *Codespace) GetLastUsedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.last_used_at +} +// GetLocation gets the location property value. The initally assigned location of a new codespace. +// returns a *Codespace_location when successful +func (m *Codespace) GetLocation()(*Codespace_location) { + return m.location +} +// GetMachine gets the machine property value. A description of the machine powering a codespace. +// returns a NullableCodespaceMachineable when successful +func (m *Codespace) GetMachine()(NullableCodespaceMachineable) { + return m.machine +} +// GetMachinesUrl gets the machines_url property value. API URL to access available alternate machine types for this codespace. +// returns a *string when successful +func (m *Codespace) GetMachinesUrl()(*string) { + return m.machines_url +} +// GetName gets the name property value. Automatically generated name of this codespace. +// returns a *string when successful +func (m *Codespace) GetName()(*string) { + return m.name +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *Codespace) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPendingOperation gets the pending_operation property value. Whether or not a codespace has a pending async operation. This would mean that the codespace is temporarily unavailable. The only thing that you can do with a codespace in this state is delete it. +// returns a *bool when successful +func (m *Codespace) GetPendingOperation()(*bool) { + return m.pending_operation +} +// GetPendingOperationDisabledReason gets the pending_operation_disabled_reason property value. Text to show user when codespace is disabled by a pending operation +// returns a *string when successful +func (m *Codespace) GetPendingOperationDisabledReason()(*string) { + return m.pending_operation_disabled_reason +} +// GetPrebuild gets the prebuild property value. Whether the codespace was created from a prebuild. +// returns a *bool when successful +func (m *Codespace) GetPrebuild()(*bool) { + return m.prebuild +} +// GetPublishUrl gets the publish_url property value. API URL to publish this codespace to a new repository. +// returns a *string when successful +func (m *Codespace) GetPublishUrl()(*string) { + return m.publish_url +} +// GetPullsUrl gets the pulls_url property value. API URL for the Pull Request associated with this codespace, if any. +// returns a *string when successful +func (m *Codespace) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetRecentFolders gets the recent_folders property value. The recent_folders property +// returns a []string when successful +func (m *Codespace) GetRecentFolders()([]string) { + return m.recent_folders +} +// GetRepository gets the repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *Codespace) GetRepository()(MinimalRepositoryable) { + return m.repository +} +// GetRetentionExpiresAt gets the retention_expires_at property value. When a codespace will be auto-deleted based on the "retention_period_minutes" and "last_used_at" +// returns a *Time when successful +func (m *Codespace) GetRetentionExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.retention_expires_at +} +// GetRetentionPeriodMinutes gets the retention_period_minutes property value. Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days). +// returns a *int32 when successful +func (m *Codespace) GetRetentionPeriodMinutes()(*int32) { + return m.retention_period_minutes +} +// GetRuntimeConstraints gets the runtime_constraints property value. The runtime_constraints property +// returns a Codespace_runtime_constraintsable when successful +func (m *Codespace) GetRuntimeConstraints()(Codespace_runtime_constraintsable) { + return m.runtime_constraints +} +// GetStartUrl gets the start_url property value. API URL to start this codespace. +// returns a *string when successful +func (m *Codespace) GetStartUrl()(*string) { + return m.start_url +} +// GetState gets the state property value. State of this codespace. +// returns a *Codespace_state when successful +func (m *Codespace) GetState()(*Codespace_state) { + return m.state +} +// GetStopUrl gets the stop_url property value. API URL to stop this codespace. +// returns a *string when successful +func (m *Codespace) GetStopUrl()(*string) { + return m.stop_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Codespace) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. API URL for this codespace. +// returns a *string when successful +func (m *Codespace) GetUrl()(*string) { + return m.url +} +// GetWebUrl gets the web_url property value. URL to access this codespace on the web. +// returns a *string when successful +func (m *Codespace) GetWebUrl()(*string) { + return m.web_url +} +// Serialize serializes information the current object +func (m *Codespace) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("billable_owner", m.GetBillableOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("devcontainer_path", m.GetDevcontainerPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("display_name", m.GetDisplayName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment_id", m.GetEnvironmentId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("git_status", m.GetGitStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("idle_timeout_minutes", m.GetIdleTimeoutMinutes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("idle_timeout_notice", m.GetIdleTimeoutNotice()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("last_known_stop_notice", m.GetLastKnownStopNotice()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("last_used_at", m.GetLastUsedAt()) + if err != nil { + return err + } + } + if m.GetLocation() != nil { + cast := (*m.GetLocation()).String() + err := writer.WriteStringValue("location", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("machine", m.GetMachine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("machines_url", m.GetMachinesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pending_operation", m.GetPendingOperation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pending_operation_disabled_reason", m.GetPendingOperationDisabledReason()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("prebuild", m.GetPrebuild()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("publish_url", m.GetPublishUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + if m.GetRecentFolders() != nil { + err := writer.WriteCollectionOfStringValues("recent_folders", m.GetRecentFolders()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("retention_expires_at", m.GetRetentionExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("retention_period_minutes", m.GetRetentionPeriodMinutes()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("runtime_constraints", m.GetRuntimeConstraints()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("start_url", m.GetStartUrl()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stop_url", m.GetStopUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("web_url", m.GetWebUrl()) + 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 *Codespace) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBillableOwner sets the billable_owner property value. A GitHub user. +func (m *Codespace) SetBillableOwner(value SimpleUserable)() { + m.billable_owner = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Codespace) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDevcontainerPath sets the devcontainer_path property value. Path to devcontainer.json from repo root used to create Codespace. +func (m *Codespace) SetDevcontainerPath(value *string)() { + m.devcontainer_path = value +} +// SetDisplayName sets the display_name property value. Display name for this codespace. +func (m *Codespace) SetDisplayName(value *string)() { + m.display_name = value +} +// SetEnvironmentId sets the environment_id property value. UUID identifying this codespace's environment. +func (m *Codespace) SetEnvironmentId(value *string)() { + m.environment_id = value +} +// SetGitStatus sets the git_status property value. Details about the codespace's git repository. +func (m *Codespace) SetGitStatus(value Codespace_git_statusable)() { + m.git_status = value +} +// SetId sets the id property value. The id property +func (m *Codespace) SetId(value *int64)() { + m.id = value +} +// SetIdleTimeoutMinutes sets the idle_timeout_minutes property value. The number of minutes of inactivity after which this codespace will be automatically stopped. +func (m *Codespace) SetIdleTimeoutMinutes(value *int32)() { + m.idle_timeout_minutes = value +} +// SetIdleTimeoutNotice sets the idle_timeout_notice property value. Text to show user when codespace idle timeout minutes has been overriden by an organization policy +func (m *Codespace) SetIdleTimeoutNotice(value *string)() { + m.idle_timeout_notice = value +} +// SetLastKnownStopNotice sets the last_known_stop_notice property value. The text to display to a user when a codespace has been stopped for a potentially actionable reason. +func (m *Codespace) SetLastKnownStopNotice(value *string)() { + m.last_known_stop_notice = value +} +// SetLastUsedAt sets the last_used_at property value. Last known time this codespace was started. +func (m *Codespace) SetLastUsedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.last_used_at = value +} +// SetLocation sets the location property value. The initally assigned location of a new codespace. +func (m *Codespace) SetLocation(value *Codespace_location)() { + m.location = value +} +// SetMachine sets the machine property value. A description of the machine powering a codespace. +func (m *Codespace) SetMachine(value NullableCodespaceMachineable)() { + m.machine = value +} +// SetMachinesUrl sets the machines_url property value. API URL to access available alternate machine types for this codespace. +func (m *Codespace) SetMachinesUrl(value *string)() { + m.machines_url = value +} +// SetName sets the name property value. Automatically generated name of this codespace. +func (m *Codespace) SetName(value *string)() { + m.name = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *Codespace) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPendingOperation sets the pending_operation property value. Whether or not a codespace has a pending async operation. This would mean that the codespace is temporarily unavailable. The only thing that you can do with a codespace in this state is delete it. +func (m *Codespace) SetPendingOperation(value *bool)() { + m.pending_operation = value +} +// SetPendingOperationDisabledReason sets the pending_operation_disabled_reason property value. Text to show user when codespace is disabled by a pending operation +func (m *Codespace) SetPendingOperationDisabledReason(value *string)() { + m.pending_operation_disabled_reason = value +} +// SetPrebuild sets the prebuild property value. Whether the codespace was created from a prebuild. +func (m *Codespace) SetPrebuild(value *bool)() { + m.prebuild = value +} +// SetPublishUrl sets the publish_url property value. API URL to publish this codespace to a new repository. +func (m *Codespace) SetPublishUrl(value *string)() { + m.publish_url = value +} +// SetPullsUrl sets the pulls_url property value. API URL for the Pull Request associated with this codespace, if any. +func (m *Codespace) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetRecentFolders sets the recent_folders property value. The recent_folders property +func (m *Codespace) SetRecentFolders(value []string)() { + m.recent_folders = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *Codespace) SetRepository(value MinimalRepositoryable)() { + m.repository = value +} +// SetRetentionExpiresAt sets the retention_expires_at property value. When a codespace will be auto-deleted based on the "retention_period_minutes" and "last_used_at" +func (m *Codespace) SetRetentionExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.retention_expires_at = value +} +// SetRetentionPeriodMinutes sets the retention_period_minutes property value. Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days). +func (m *Codespace) SetRetentionPeriodMinutes(value *int32)() { + m.retention_period_minutes = value +} +// SetRuntimeConstraints sets the runtime_constraints property value. The runtime_constraints property +func (m *Codespace) SetRuntimeConstraints(value Codespace_runtime_constraintsable)() { + m.runtime_constraints = value +} +// SetStartUrl sets the start_url property value. API URL to start this codespace. +func (m *Codespace) SetStartUrl(value *string)() { + m.start_url = value +} +// SetState sets the state property value. State of this codespace. +func (m *Codespace) SetState(value *Codespace_state)() { + m.state = value +} +// SetStopUrl sets the stop_url property value. API URL to stop this codespace. +func (m *Codespace) SetStopUrl(value *string)() { + m.stop_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Codespace) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. API URL for this codespace. +func (m *Codespace) SetUrl(value *string)() { + m.url = value +} +// SetWebUrl sets the web_url property value. URL to access this codespace on the web. +func (m *Codespace) SetWebUrl(value *string)() { + m.web_url = value +} +type Codespaceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBillableOwner()(SimpleUserable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDevcontainerPath()(*string) + GetDisplayName()(*string) + GetEnvironmentId()(*string) + GetGitStatus()(Codespace_git_statusable) + GetId()(*int64) + GetIdleTimeoutMinutes()(*int32) + GetIdleTimeoutNotice()(*string) + GetLastKnownStopNotice()(*string) + GetLastUsedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetLocation()(*Codespace_location) + GetMachine()(NullableCodespaceMachineable) + GetMachinesUrl()(*string) + GetName()(*string) + GetOwner()(SimpleUserable) + GetPendingOperation()(*bool) + GetPendingOperationDisabledReason()(*string) + GetPrebuild()(*bool) + GetPublishUrl()(*string) + GetPullsUrl()(*string) + GetRecentFolders()([]string) + GetRepository()(MinimalRepositoryable) + GetRetentionExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetRetentionPeriodMinutes()(*int32) + GetRuntimeConstraints()(Codespace_runtime_constraintsable) + GetStartUrl()(*string) + GetState()(*Codespace_state) + GetStopUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetWebUrl()(*string) + SetBillableOwner(value SimpleUserable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDevcontainerPath(value *string)() + SetDisplayName(value *string)() + SetEnvironmentId(value *string)() + SetGitStatus(value Codespace_git_statusable)() + SetId(value *int64)() + SetIdleTimeoutMinutes(value *int32)() + SetIdleTimeoutNotice(value *string)() + SetLastKnownStopNotice(value *string)() + SetLastUsedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetLocation(value *Codespace_location)() + SetMachine(value NullableCodespaceMachineable)() + SetMachinesUrl(value *string)() + SetName(value *string)() + SetOwner(value SimpleUserable)() + SetPendingOperation(value *bool)() + SetPendingOperationDisabledReason(value *string)() + SetPrebuild(value *bool)() + SetPublishUrl(value *string)() + SetPullsUrl(value *string)() + SetRecentFolders(value []string)() + SetRepository(value MinimalRepositoryable)() + SetRetentionExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetRetentionPeriodMinutes(value *int32)() + SetRuntimeConstraints(value Codespace_runtime_constraintsable)() + SetStartUrl(value *string)() + SetState(value *Codespace_state)() + SetStopUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetWebUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace503_error.go new file mode 100644 index 000000000..15e579952 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Codespace503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewCodespace503Error instantiates a new Codespace503Error and sets the default values. +func NewCodespace503Error()(*Codespace503Error) { + m := &Codespace503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespace503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespace503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespace503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Codespace503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Codespace503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Codespace503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Codespace503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Codespace503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Codespace503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Codespace503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *Codespace503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Codespace503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Codespace503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Codespace503Error) SetMessage(value *string)() { + m.message = value +} +type Codespace503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_export_details.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_export_details.go new file mode 100644 index 000000000..df4321757 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_export_details.go @@ -0,0 +1,256 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodespaceExportDetails an export of a codespace. Also, latest export details for a codespace can be fetched with id = latest +type CodespaceExportDetails struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Name of the exported branch + branch *string + // Completion time of the last export operation + completed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Url for fetching export details + export_url *string + // Web url for the exported branch + html_url *string + // Id for the export details + id *string + // Git commit SHA of the exported branch + sha *string + // State of the latest export + state *string +} +// NewCodespaceExportDetails instantiates a new CodespaceExportDetails and sets the default values. +func NewCodespaceExportDetails()(*CodespaceExportDetails) { + m := &CodespaceExportDetails{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespaceExportDetailsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespaceExportDetailsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespaceExportDetails(), 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 *CodespaceExportDetails) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBranch gets the branch property value. Name of the exported branch +// returns a *string when successful +func (m *CodespaceExportDetails) GetBranch()(*string) { + return m.branch +} +// GetCompletedAt gets the completed_at property value. Completion time of the last export operation +// returns a *Time when successful +func (m *CodespaceExportDetails) GetCompletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.completed_at +} +// GetExportUrl gets the export_url property value. Url for fetching export details +// returns a *string when successful +func (m *CodespaceExportDetails) GetExportUrl()(*string) { + return m.export_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespaceExportDetails) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranch(val) + } + return nil + } + res["completed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCompletedAt(val) + } + return nil + } + res["export_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExportUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. Web url for the exported branch +// returns a *string when successful +func (m *CodespaceExportDetails) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Id for the export details +// returns a *string when successful +func (m *CodespaceExportDetails) GetId()(*string) { + return m.id +} +// GetSha gets the sha property value. Git commit SHA of the exported branch +// returns a *string when successful +func (m *CodespaceExportDetails) GetSha()(*string) { + return m.sha +} +// GetState gets the state property value. State of the latest export +// returns a *string when successful +func (m *CodespaceExportDetails) GetState()(*string) { + return m.state +} +// Serialize serializes information the current object +func (m *CodespaceExportDetails) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("branch", m.GetBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("completed_at", m.GetCompletedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("export_url", m.GetExportUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + 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 *CodespaceExportDetails) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBranch sets the branch property value. Name of the exported branch +func (m *CodespaceExportDetails) SetBranch(value *string)() { + m.branch = value +} +// SetCompletedAt sets the completed_at property value. Completion time of the last export operation +func (m *CodespaceExportDetails) SetCompletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.completed_at = value +} +// SetExportUrl sets the export_url property value. Url for fetching export details +func (m *CodespaceExportDetails) SetExportUrl(value *string)() { + m.export_url = value +} +// SetHtmlUrl sets the html_url property value. Web url for the exported branch +func (m *CodespaceExportDetails) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Id for the export details +func (m *CodespaceExportDetails) SetId(value *string)() { + m.id = value +} +// SetSha sets the sha property value. Git commit SHA of the exported branch +func (m *CodespaceExportDetails) SetSha(value *string)() { + m.sha = value +} +// SetState sets the state property value. State of the latest export +func (m *CodespaceExportDetails) SetState(value *string)() { + m.state = value +} +type CodespaceExportDetailsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBranch()(*string) + GetCompletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetExportUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*string) + GetSha()(*string) + GetState()(*string) + SetBranch(value *string)() + SetCompletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetExportUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *string)() + SetSha(value *string)() + SetState(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_git_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_git_status.go new file mode 100644 index 000000000..f51574a57 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_git_status.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Codespace_git_status details about the codespace's git repository. +type Codespace_git_status struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The number of commits the local repository is ahead of the remote. + ahead *int32 + // The number of commits the local repository is behind the remote. + behind *int32 + // Whether the local repository has uncommitted changes. + has_uncommitted_changes *bool + // Whether the local repository has unpushed changes. + has_unpushed_changes *bool + // The current branch (or SHA if in detached HEAD state) of the local repository. + ref *string +} +// NewCodespace_git_status instantiates a new Codespace_git_status and sets the default values. +func NewCodespace_git_status()(*Codespace_git_status) { + m := &Codespace_git_status{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespace_git_statusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespace_git_statusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespace_git_status(), 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 *Codespace_git_status) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAhead gets the ahead property value. The number of commits the local repository is ahead of the remote. +// returns a *int32 when successful +func (m *Codespace_git_status) GetAhead()(*int32) { + return m.ahead +} +// GetBehind gets the behind property value. The number of commits the local repository is behind the remote. +// returns a *int32 when successful +func (m *Codespace_git_status) GetBehind()(*int32) { + return m.behind +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Codespace_git_status) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ahead"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAhead(val) + } + return nil + } + res["behind"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetBehind(val) + } + return nil + } + res["has_uncommitted_changes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasUncommittedChanges(val) + } + return nil + } + res["has_unpushed_changes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasUnpushedChanges(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + return res +} +// GetHasUncommittedChanges gets the has_uncommitted_changes property value. Whether the local repository has uncommitted changes. +// returns a *bool when successful +func (m *Codespace_git_status) GetHasUncommittedChanges()(*bool) { + return m.has_uncommitted_changes +} +// GetHasUnpushedChanges gets the has_unpushed_changes property value. Whether the local repository has unpushed changes. +// returns a *bool when successful +func (m *Codespace_git_status) GetHasUnpushedChanges()(*bool) { + return m.has_unpushed_changes +} +// GetRef gets the ref property value. The current branch (or SHA if in detached HEAD state) of the local repository. +// returns a *string when successful +func (m *Codespace_git_status) GetRef()(*string) { + return m.ref +} +// Serialize serializes information the current object +func (m *Codespace_git_status) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("ahead", m.GetAhead()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("behind", m.GetBehind()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_uncommitted_changes", m.GetHasUncommittedChanges()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_unpushed_changes", m.GetHasUnpushedChanges()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + 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 *Codespace_git_status) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAhead sets the ahead property value. The number of commits the local repository is ahead of the remote. +func (m *Codespace_git_status) SetAhead(value *int32)() { + m.ahead = value +} +// SetBehind sets the behind property value. The number of commits the local repository is behind the remote. +func (m *Codespace_git_status) SetBehind(value *int32)() { + m.behind = value +} +// SetHasUncommittedChanges sets the has_uncommitted_changes property value. Whether the local repository has uncommitted changes. +func (m *Codespace_git_status) SetHasUncommittedChanges(value *bool)() { + m.has_uncommitted_changes = value +} +// SetHasUnpushedChanges sets the has_unpushed_changes property value. Whether the local repository has unpushed changes. +func (m *Codespace_git_status) SetHasUnpushedChanges(value *bool)() { + m.has_unpushed_changes = value +} +// SetRef sets the ref property value. The current branch (or SHA if in detached HEAD state) of the local repository. +func (m *Codespace_git_status) SetRef(value *string)() { + m.ref = value +} +type Codespace_git_statusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAhead()(*int32) + GetBehind()(*int32) + GetHasUncommittedChanges()(*bool) + GetHasUnpushedChanges()(*bool) + GetRef()(*string) + SetAhead(value *int32)() + SetBehind(value *int32)() + SetHasUncommittedChanges(value *bool)() + SetHasUnpushedChanges(value *bool)() + SetRef(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_location.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_location.go new file mode 100644 index 000000000..c1cb0f66d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_location.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The initally assigned location of a new codespace. +type Codespace_location int + +const ( + EASTUS_CODESPACE_LOCATION Codespace_location = iota + SOUTHEASTASIA_CODESPACE_LOCATION + WESTEUROPE_CODESPACE_LOCATION + WESTUS2_CODESPACE_LOCATION +) + +func (i Codespace_location) String() string { + return []string{"EastUs", "SouthEastAsia", "WestEurope", "WestUs2"}[i] +} +func ParseCodespace_location(v string) (any, error) { + result := EASTUS_CODESPACE_LOCATION + switch v { + case "EastUs": + result = EASTUS_CODESPACE_LOCATION + case "SouthEastAsia": + result = SOUTHEASTASIA_CODESPACE_LOCATION + case "WestEurope": + result = WESTEUROPE_CODESPACE_LOCATION + case "WestUs2": + result = WESTUS2_CODESPACE_LOCATION + default: + return 0, errors.New("Unknown Codespace_location value: " + v) + } + return &result, nil +} +func SerializeCodespace_location(values []Codespace_location) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Codespace_location) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_machine.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_machine.go new file mode 100644 index 000000000..0af3a340b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_machine.go @@ -0,0 +1,256 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodespaceMachine a description of the machine powering a codespace. +type CodespaceMachine struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How many cores are available to the codespace. + cpus *int32 + // The display name of the machine includes cores, memory, and storage. + display_name *string + // How much memory is available to the codespace. + memory_in_bytes *int32 + // The name of the machine. + name *string + // The operating system of the machine. + operating_system *string + // Whether a prebuild is currently available when creating a codespace for this machine and repository. If a branch was not specified as a ref, the default branch will be assumed. Value will be "null" if prebuilds are not supported or prebuild availability could not be determined. Value will be "none" if no prebuild is available. Latest values "ready" and "in_progress" indicate the prebuild availability status. + prebuild_availability *CodespaceMachine_prebuild_availability + // How much storage is available to the codespace. + storage_in_bytes *int32 +} +// NewCodespaceMachine instantiates a new CodespaceMachine and sets the default values. +func NewCodespaceMachine()(*CodespaceMachine) { + m := &CodespaceMachine{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespaceMachineFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespaceMachineFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespaceMachine(), 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 *CodespaceMachine) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCpus gets the cpus property value. How many cores are available to the codespace. +// returns a *int32 when successful +func (m *CodespaceMachine) GetCpus()(*int32) { + return m.cpus +} +// GetDisplayName gets the display_name property value. The display name of the machine includes cores, memory, and storage. +// returns a *string when successful +func (m *CodespaceMachine) GetDisplayName()(*string) { + return m.display_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespaceMachine) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cpus"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCpus(val) + } + return nil + } + res["display_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["memory_in_bytes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMemoryInBytes(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["operating_system"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOperatingSystem(val) + } + return nil + } + res["prebuild_availability"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodespaceMachine_prebuild_availability) + if err != nil { + return err + } + if val != nil { + m.SetPrebuildAvailability(val.(*CodespaceMachine_prebuild_availability)) + } + return nil + } + res["storage_in_bytes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStorageInBytes(val) + } + return nil + } + return res +} +// GetMemoryInBytes gets the memory_in_bytes property value. How much memory is available to the codespace. +// returns a *int32 when successful +func (m *CodespaceMachine) GetMemoryInBytes()(*int32) { + return m.memory_in_bytes +} +// GetName gets the name property value. The name of the machine. +// returns a *string when successful +func (m *CodespaceMachine) GetName()(*string) { + return m.name +} +// GetOperatingSystem gets the operating_system property value. The operating system of the machine. +// returns a *string when successful +func (m *CodespaceMachine) GetOperatingSystem()(*string) { + return m.operating_system +} +// GetPrebuildAvailability gets the prebuild_availability property value. Whether a prebuild is currently available when creating a codespace for this machine and repository. If a branch was not specified as a ref, the default branch will be assumed. Value will be "null" if prebuilds are not supported or prebuild availability could not be determined. Value will be "none" if no prebuild is available. Latest values "ready" and "in_progress" indicate the prebuild availability status. +// returns a *CodespaceMachine_prebuild_availability when successful +func (m *CodespaceMachine) GetPrebuildAvailability()(*CodespaceMachine_prebuild_availability) { + return m.prebuild_availability +} +// GetStorageInBytes gets the storage_in_bytes property value. How much storage is available to the codespace. +// returns a *int32 when successful +func (m *CodespaceMachine) GetStorageInBytes()(*int32) { + return m.storage_in_bytes +} +// Serialize serializes information the current object +func (m *CodespaceMachine) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("cpus", m.GetCpus()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("display_name", m.GetDisplayName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("memory_in_bytes", m.GetMemoryInBytes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("operating_system", m.GetOperatingSystem()) + if err != nil { + return err + } + } + if m.GetPrebuildAvailability() != nil { + cast := (*m.GetPrebuildAvailability()).String() + err := writer.WriteStringValue("prebuild_availability", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("storage_in_bytes", m.GetStorageInBytes()) + 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 *CodespaceMachine) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCpus sets the cpus property value. How many cores are available to the codespace. +func (m *CodespaceMachine) SetCpus(value *int32)() { + m.cpus = value +} +// SetDisplayName sets the display_name property value. The display name of the machine includes cores, memory, and storage. +func (m *CodespaceMachine) SetDisplayName(value *string)() { + m.display_name = value +} +// SetMemoryInBytes sets the memory_in_bytes property value. How much memory is available to the codespace. +func (m *CodespaceMachine) SetMemoryInBytes(value *int32)() { + m.memory_in_bytes = value +} +// SetName sets the name property value. The name of the machine. +func (m *CodespaceMachine) SetName(value *string)() { + m.name = value +} +// SetOperatingSystem sets the operating_system property value. The operating system of the machine. +func (m *CodespaceMachine) SetOperatingSystem(value *string)() { + m.operating_system = value +} +// SetPrebuildAvailability sets the prebuild_availability property value. Whether a prebuild is currently available when creating a codespace for this machine and repository. If a branch was not specified as a ref, the default branch will be assumed. Value will be "null" if prebuilds are not supported or prebuild availability could not be determined. Value will be "none" if no prebuild is available. Latest values "ready" and "in_progress" indicate the prebuild availability status. +func (m *CodespaceMachine) SetPrebuildAvailability(value *CodespaceMachine_prebuild_availability)() { + m.prebuild_availability = value +} +// SetStorageInBytes sets the storage_in_bytes property value. How much storage is available to the codespace. +func (m *CodespaceMachine) SetStorageInBytes(value *int32)() { + m.storage_in_bytes = value +} +type CodespaceMachineable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCpus()(*int32) + GetDisplayName()(*string) + GetMemoryInBytes()(*int32) + GetName()(*string) + GetOperatingSystem()(*string) + GetPrebuildAvailability()(*CodespaceMachine_prebuild_availability) + GetStorageInBytes()(*int32) + SetCpus(value *int32)() + SetDisplayName(value *string)() + SetMemoryInBytes(value *int32)() + SetName(value *string)() + SetOperatingSystem(value *string)() + SetPrebuildAvailability(value *CodespaceMachine_prebuild_availability)() + SetStorageInBytes(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_machine_prebuild_availability.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_machine_prebuild_availability.go new file mode 100644 index 000000000..a32badf1f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_machine_prebuild_availability.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// Whether a prebuild is currently available when creating a codespace for this machine and repository. If a branch was not specified as a ref, the default branch will be assumed. Value will be "null" if prebuilds are not supported or prebuild availability could not be determined. Value will be "none" if no prebuild is available. Latest values "ready" and "in_progress" indicate the prebuild availability status. +type CodespaceMachine_prebuild_availability int + +const ( + NONE_CODESPACEMACHINE_PREBUILD_AVAILABILITY CodespaceMachine_prebuild_availability = iota + READY_CODESPACEMACHINE_PREBUILD_AVAILABILITY + IN_PROGRESS_CODESPACEMACHINE_PREBUILD_AVAILABILITY +) + +func (i CodespaceMachine_prebuild_availability) String() string { + return []string{"none", "ready", "in_progress"}[i] +} +func ParseCodespaceMachine_prebuild_availability(v string) (any, error) { + result := NONE_CODESPACEMACHINE_PREBUILD_AVAILABILITY + switch v { + case "none": + result = NONE_CODESPACEMACHINE_PREBUILD_AVAILABILITY + case "ready": + result = READY_CODESPACEMACHINE_PREBUILD_AVAILABILITY + case "in_progress": + result = IN_PROGRESS_CODESPACEMACHINE_PREBUILD_AVAILABILITY + default: + return 0, errors.New("Unknown CodespaceMachine_prebuild_availability value: " + v) + } + return &result, nil +} +func SerializeCodespaceMachine_prebuild_availability(values []CodespaceMachine_prebuild_availability) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodespaceMachine_prebuild_availability) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_runtime_constraints.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_runtime_constraints.go new file mode 100644 index 000000000..db25b3ff8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_runtime_constraints.go @@ -0,0 +1,86 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Codespace_runtime_constraints struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The privacy settings a user can select from when forwarding a port. + allowed_port_privacy_settings []string +} +// NewCodespace_runtime_constraints instantiates a new Codespace_runtime_constraints and sets the default values. +func NewCodespace_runtime_constraints()(*Codespace_runtime_constraints) { + m := &Codespace_runtime_constraints{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespace_runtime_constraintsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespace_runtime_constraintsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespace_runtime_constraints(), 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 *Codespace_runtime_constraints) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowedPortPrivacySettings gets the allowed_port_privacy_settings property value. The privacy settings a user can select from when forwarding a port. +// returns a []string when successful +func (m *Codespace_runtime_constraints) GetAllowedPortPrivacySettings()([]string) { + return m.allowed_port_privacy_settings +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Codespace_runtime_constraints) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allowed_port_privacy_settings"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetAllowedPortPrivacySettings(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *Codespace_runtime_constraints) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAllowedPortPrivacySettings() != nil { + err := writer.WriteCollectionOfStringValues("allowed_port_privacy_settings", m.GetAllowedPortPrivacySettings()) + 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 *Codespace_runtime_constraints) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowedPortPrivacySettings sets the allowed_port_privacy_settings property value. The privacy settings a user can select from when forwarding a port. +func (m *Codespace_runtime_constraints) SetAllowedPortPrivacySettings(value []string)() { + m.allowed_port_privacy_settings = value +} +type Codespace_runtime_constraintsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowedPortPrivacySettings()([]string) + SetAllowedPortPrivacySettings(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_state.go new file mode 100644 index 000000000..c46339508 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_state.go @@ -0,0 +1,82 @@ +package models +import ( + "errors" +) +// State of this codespace. +type Codespace_state int + +const ( + UNKNOWN_CODESPACE_STATE Codespace_state = iota + CREATED_CODESPACE_STATE + QUEUED_CODESPACE_STATE + PROVISIONING_CODESPACE_STATE + AVAILABLE_CODESPACE_STATE + AWAITING_CODESPACE_STATE + UNAVAILABLE_CODESPACE_STATE + DELETED_CODESPACE_STATE + MOVED_CODESPACE_STATE + SHUTDOWN_CODESPACE_STATE + ARCHIVED_CODESPACE_STATE + STARTING_CODESPACE_STATE + SHUTTINGDOWN_CODESPACE_STATE + FAILED_CODESPACE_STATE + EXPORTING_CODESPACE_STATE + UPDATING_CODESPACE_STATE + REBUILDING_CODESPACE_STATE +) + +func (i Codespace_state) String() string { + return []string{"Unknown", "Created", "Queued", "Provisioning", "Available", "Awaiting", "Unavailable", "Deleted", "Moved", "Shutdown", "Archived", "Starting", "ShuttingDown", "Failed", "Exporting", "Updating", "Rebuilding"}[i] +} +func ParseCodespace_state(v string) (any, error) { + result := UNKNOWN_CODESPACE_STATE + switch v { + case "Unknown": + result = UNKNOWN_CODESPACE_STATE + case "Created": + result = CREATED_CODESPACE_STATE + case "Queued": + result = QUEUED_CODESPACE_STATE + case "Provisioning": + result = PROVISIONING_CODESPACE_STATE + case "Available": + result = AVAILABLE_CODESPACE_STATE + case "Awaiting": + result = AWAITING_CODESPACE_STATE + case "Unavailable": + result = UNAVAILABLE_CODESPACE_STATE + case "Deleted": + result = DELETED_CODESPACE_STATE + case "Moved": + result = MOVED_CODESPACE_STATE + case "Shutdown": + result = SHUTDOWN_CODESPACE_STATE + case "Archived": + result = ARCHIVED_CODESPACE_STATE + case "Starting": + result = STARTING_CODESPACE_STATE + case "ShuttingDown": + result = SHUTTINGDOWN_CODESPACE_STATE + case "Failed": + result = FAILED_CODESPACE_STATE + case "Exporting": + result = EXPORTING_CODESPACE_STATE + case "Updating": + result = UPDATING_CODESPACE_STATE + case "Rebuilding": + result = REBUILDING_CODESPACE_STATE + default: + return 0, errors.New("Unknown Codespace_state value: " + v) + } + return &result, nil +} +func SerializeCodespace_state(values []Codespace_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Codespace_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_with_full_repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_with_full_repository.go new file mode 100644 index 000000000..8bcc876b7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_with_full_repository.go @@ -0,0 +1,960 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodespaceWithFullRepository a codespace. +type CodespaceWithFullRepository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + billable_owner SimpleUserable + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Path to devcontainer.json from repo root used to create Codespace. + devcontainer_path *string + // Display name for this codespace. + display_name *string + // UUID identifying this codespace's environment. + environment_id *string + // Details about the codespace's git repository. + git_status CodespaceWithFullRepository_git_statusable + // The id property + id *int64 + // The number of minutes of inactivity after which this codespace will be automatically stopped. + idle_timeout_minutes *int32 + // Text to show user when codespace idle timeout minutes has been overriden by an organization policy + idle_timeout_notice *string + // Last known time this codespace was started. + last_used_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The initally assigned location of a new codespace. + location *CodespaceWithFullRepository_location + // A description of the machine powering a codespace. + machine NullableCodespaceMachineable + // API URL to access available alternate machine types for this codespace. + machines_url *string + // Automatically generated name of this codespace. + name *string + // A GitHub user. + owner SimpleUserable + // Whether or not a codespace has a pending async operation. This would mean that the codespace is temporarily unavailable. The only thing that you can do with a codespace in this state is delete it. + pending_operation *bool + // Text to show user when codespace is disabled by a pending operation + pending_operation_disabled_reason *string + // Whether the codespace was created from a prebuild. + prebuild *bool + // API URL to publish this codespace to a new repository. + publish_url *string + // API URL for the Pull Request associated with this codespace, if any. + pulls_url *string + // The recent_folders property + recent_folders []string + // Full Repository + repository FullRepositoryable + // When a codespace will be auto-deleted based on the "retention_period_minutes" and "last_used_at" + retention_expires_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days). + retention_period_minutes *int32 + // The runtime_constraints property + runtime_constraints CodespaceWithFullRepository_runtime_constraintsable + // API URL to start this codespace. + start_url *string + // State of this codespace. + state *CodespaceWithFullRepository_state + // API URL to stop this codespace. + stop_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // API URL for this codespace. + url *string + // URL to access this codespace on the web. + web_url *string +} +// NewCodespaceWithFullRepository instantiates a new CodespaceWithFullRepository and sets the default values. +func NewCodespaceWithFullRepository()(*CodespaceWithFullRepository) { + m := &CodespaceWithFullRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespaceWithFullRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespaceWithFullRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespaceWithFullRepository(), 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 *CodespaceWithFullRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBillableOwner gets the billable_owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *CodespaceWithFullRepository) GetBillableOwner()(SimpleUserable) { + return m.billable_owner +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *CodespaceWithFullRepository) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDevcontainerPath gets the devcontainer_path property value. Path to devcontainer.json from repo root used to create Codespace. +// returns a *string when successful +func (m *CodespaceWithFullRepository) GetDevcontainerPath()(*string) { + return m.devcontainer_path +} +// GetDisplayName gets the display_name property value. Display name for this codespace. +// returns a *string when successful +func (m *CodespaceWithFullRepository) GetDisplayName()(*string) { + return m.display_name +} +// GetEnvironmentId gets the environment_id property value. UUID identifying this codespace's environment. +// returns a *string when successful +func (m *CodespaceWithFullRepository) GetEnvironmentId()(*string) { + return m.environment_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespaceWithFullRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["billable_owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBillableOwner(val.(SimpleUserable)) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["devcontainer_path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDevcontainerPath(val) + } + return nil + } + res["display_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["environment_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironmentId(val) + } + return nil + } + res["git_status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodespaceWithFullRepository_git_statusFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetGitStatus(val.(CodespaceWithFullRepository_git_statusable)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["idle_timeout_minutes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetIdleTimeoutMinutes(val) + } + return nil + } + res["idle_timeout_notice"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIdleTimeoutNotice(val) + } + return nil + } + res["last_used_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastUsedAt(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodespaceWithFullRepository_location) + if err != nil { + return err + } + if val != nil { + m.SetLocation(val.(*CodespaceWithFullRepository_location)) + } + return nil + } + res["machine"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableCodespaceMachineFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMachine(val.(NullableCodespaceMachineable)) + } + return nil + } + res["machines_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMachinesUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["pending_operation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPendingOperation(val) + } + return nil + } + res["pending_operation_disabled_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPendingOperationDisabledReason(val) + } + return nil + } + res["prebuild"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrebuild(val) + } + return nil + } + res["publish_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublishUrl(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["recent_folders"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRecentFolders(res) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFullRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(FullRepositoryable)) + } + return nil + } + res["retention_expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetRetentionExpiresAt(val) + } + return nil + } + res["retention_period_minutes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRetentionPeriodMinutes(val) + } + return nil + } + res["runtime_constraints"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodespaceWithFullRepository_runtime_constraintsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRuntimeConstraints(val.(CodespaceWithFullRepository_runtime_constraintsable)) + } + return nil + } + res["start_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStartUrl(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodespaceWithFullRepository_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*CodespaceWithFullRepository_state)) + } + return nil + } + res["stop_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStopUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["web_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWebUrl(val) + } + return nil + } + return res +} +// GetGitStatus gets the git_status property value. Details about the codespace's git repository. +// returns a CodespaceWithFullRepository_git_statusable when successful +func (m *CodespaceWithFullRepository) GetGitStatus()(CodespaceWithFullRepository_git_statusable) { + return m.git_status +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *CodespaceWithFullRepository) GetId()(*int64) { + return m.id +} +// GetIdleTimeoutMinutes gets the idle_timeout_minutes property value. The number of minutes of inactivity after which this codespace will be automatically stopped. +// returns a *int32 when successful +func (m *CodespaceWithFullRepository) GetIdleTimeoutMinutes()(*int32) { + return m.idle_timeout_minutes +} +// GetIdleTimeoutNotice gets the idle_timeout_notice property value. Text to show user when codespace idle timeout minutes has been overriden by an organization policy +// returns a *string when successful +func (m *CodespaceWithFullRepository) GetIdleTimeoutNotice()(*string) { + return m.idle_timeout_notice +} +// GetLastUsedAt gets the last_used_at property value. Last known time this codespace was started. +// returns a *Time when successful +func (m *CodespaceWithFullRepository) GetLastUsedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.last_used_at +} +// GetLocation gets the location property value. The initally assigned location of a new codespace. +// returns a *CodespaceWithFullRepository_location when successful +func (m *CodespaceWithFullRepository) GetLocation()(*CodespaceWithFullRepository_location) { + return m.location +} +// GetMachine gets the machine property value. A description of the machine powering a codespace. +// returns a NullableCodespaceMachineable when successful +func (m *CodespaceWithFullRepository) GetMachine()(NullableCodespaceMachineable) { + return m.machine +} +// GetMachinesUrl gets the machines_url property value. API URL to access available alternate machine types for this codespace. +// returns a *string when successful +func (m *CodespaceWithFullRepository) GetMachinesUrl()(*string) { + return m.machines_url +} +// GetName gets the name property value. Automatically generated name of this codespace. +// returns a *string when successful +func (m *CodespaceWithFullRepository) GetName()(*string) { + return m.name +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *CodespaceWithFullRepository) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPendingOperation gets the pending_operation property value. Whether or not a codespace has a pending async operation. This would mean that the codespace is temporarily unavailable. The only thing that you can do with a codespace in this state is delete it. +// returns a *bool when successful +func (m *CodespaceWithFullRepository) GetPendingOperation()(*bool) { + return m.pending_operation +} +// GetPendingOperationDisabledReason gets the pending_operation_disabled_reason property value. Text to show user when codespace is disabled by a pending operation +// returns a *string when successful +func (m *CodespaceWithFullRepository) GetPendingOperationDisabledReason()(*string) { + return m.pending_operation_disabled_reason +} +// GetPrebuild gets the prebuild property value. Whether the codespace was created from a prebuild. +// returns a *bool when successful +func (m *CodespaceWithFullRepository) GetPrebuild()(*bool) { + return m.prebuild +} +// GetPublishUrl gets the publish_url property value. API URL to publish this codespace to a new repository. +// returns a *string when successful +func (m *CodespaceWithFullRepository) GetPublishUrl()(*string) { + return m.publish_url +} +// GetPullsUrl gets the pulls_url property value. API URL for the Pull Request associated with this codespace, if any. +// returns a *string when successful +func (m *CodespaceWithFullRepository) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetRecentFolders gets the recent_folders property value. The recent_folders property +// returns a []string when successful +func (m *CodespaceWithFullRepository) GetRecentFolders()([]string) { + return m.recent_folders +} +// GetRepository gets the repository property value. Full Repository +// returns a FullRepositoryable when successful +func (m *CodespaceWithFullRepository) GetRepository()(FullRepositoryable) { + return m.repository +} +// GetRetentionExpiresAt gets the retention_expires_at property value. When a codespace will be auto-deleted based on the "retention_period_minutes" and "last_used_at" +// returns a *Time when successful +func (m *CodespaceWithFullRepository) GetRetentionExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.retention_expires_at +} +// GetRetentionPeriodMinutes gets the retention_period_minutes property value. Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days). +// returns a *int32 when successful +func (m *CodespaceWithFullRepository) GetRetentionPeriodMinutes()(*int32) { + return m.retention_period_minutes +} +// GetRuntimeConstraints gets the runtime_constraints property value. The runtime_constraints property +// returns a CodespaceWithFullRepository_runtime_constraintsable when successful +func (m *CodespaceWithFullRepository) GetRuntimeConstraints()(CodespaceWithFullRepository_runtime_constraintsable) { + return m.runtime_constraints +} +// GetStartUrl gets the start_url property value. API URL to start this codespace. +// returns a *string when successful +func (m *CodespaceWithFullRepository) GetStartUrl()(*string) { + return m.start_url +} +// GetState gets the state property value. State of this codespace. +// returns a *CodespaceWithFullRepository_state when successful +func (m *CodespaceWithFullRepository) GetState()(*CodespaceWithFullRepository_state) { + return m.state +} +// GetStopUrl gets the stop_url property value. API URL to stop this codespace. +// returns a *string when successful +func (m *CodespaceWithFullRepository) GetStopUrl()(*string) { + return m.stop_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *CodespaceWithFullRepository) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. API URL for this codespace. +// returns a *string when successful +func (m *CodespaceWithFullRepository) GetUrl()(*string) { + return m.url +} +// GetWebUrl gets the web_url property value. URL to access this codespace on the web. +// returns a *string when successful +func (m *CodespaceWithFullRepository) GetWebUrl()(*string) { + return m.web_url +} +// Serialize serializes information the current object +func (m *CodespaceWithFullRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("billable_owner", m.GetBillableOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("devcontainer_path", m.GetDevcontainerPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("display_name", m.GetDisplayName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment_id", m.GetEnvironmentId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("git_status", m.GetGitStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("idle_timeout_minutes", m.GetIdleTimeoutMinutes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("idle_timeout_notice", m.GetIdleTimeoutNotice()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("last_used_at", m.GetLastUsedAt()) + if err != nil { + return err + } + } + if m.GetLocation() != nil { + cast := (*m.GetLocation()).String() + err := writer.WriteStringValue("location", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("machine", m.GetMachine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("machines_url", m.GetMachinesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pending_operation", m.GetPendingOperation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pending_operation_disabled_reason", m.GetPendingOperationDisabledReason()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("prebuild", m.GetPrebuild()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("publish_url", m.GetPublishUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + if m.GetRecentFolders() != nil { + err := writer.WriteCollectionOfStringValues("recent_folders", m.GetRecentFolders()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("retention_expires_at", m.GetRetentionExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("retention_period_minutes", m.GetRetentionPeriodMinutes()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("runtime_constraints", m.GetRuntimeConstraints()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("start_url", m.GetStartUrl()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stop_url", m.GetStopUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("web_url", m.GetWebUrl()) + 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 *CodespaceWithFullRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBillableOwner sets the billable_owner property value. A GitHub user. +func (m *CodespaceWithFullRepository) SetBillableOwner(value SimpleUserable)() { + m.billable_owner = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *CodespaceWithFullRepository) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDevcontainerPath sets the devcontainer_path property value. Path to devcontainer.json from repo root used to create Codespace. +func (m *CodespaceWithFullRepository) SetDevcontainerPath(value *string)() { + m.devcontainer_path = value +} +// SetDisplayName sets the display_name property value. Display name for this codespace. +func (m *CodespaceWithFullRepository) SetDisplayName(value *string)() { + m.display_name = value +} +// SetEnvironmentId sets the environment_id property value. UUID identifying this codespace's environment. +func (m *CodespaceWithFullRepository) SetEnvironmentId(value *string)() { + m.environment_id = value +} +// SetGitStatus sets the git_status property value. Details about the codespace's git repository. +func (m *CodespaceWithFullRepository) SetGitStatus(value CodespaceWithFullRepository_git_statusable)() { + m.git_status = value +} +// SetId sets the id property value. The id property +func (m *CodespaceWithFullRepository) SetId(value *int64)() { + m.id = value +} +// SetIdleTimeoutMinutes sets the idle_timeout_minutes property value. The number of minutes of inactivity after which this codespace will be automatically stopped. +func (m *CodespaceWithFullRepository) SetIdleTimeoutMinutes(value *int32)() { + m.idle_timeout_minutes = value +} +// SetIdleTimeoutNotice sets the idle_timeout_notice property value. Text to show user when codespace idle timeout minutes has been overriden by an organization policy +func (m *CodespaceWithFullRepository) SetIdleTimeoutNotice(value *string)() { + m.idle_timeout_notice = value +} +// SetLastUsedAt sets the last_used_at property value. Last known time this codespace was started. +func (m *CodespaceWithFullRepository) SetLastUsedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.last_used_at = value +} +// SetLocation sets the location property value. The initally assigned location of a new codespace. +func (m *CodespaceWithFullRepository) SetLocation(value *CodespaceWithFullRepository_location)() { + m.location = value +} +// SetMachine sets the machine property value. A description of the machine powering a codespace. +func (m *CodespaceWithFullRepository) SetMachine(value NullableCodespaceMachineable)() { + m.machine = value +} +// SetMachinesUrl sets the machines_url property value. API URL to access available alternate machine types for this codespace. +func (m *CodespaceWithFullRepository) SetMachinesUrl(value *string)() { + m.machines_url = value +} +// SetName sets the name property value. Automatically generated name of this codespace. +func (m *CodespaceWithFullRepository) SetName(value *string)() { + m.name = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *CodespaceWithFullRepository) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPendingOperation sets the pending_operation property value. Whether or not a codespace has a pending async operation. This would mean that the codespace is temporarily unavailable. The only thing that you can do with a codespace in this state is delete it. +func (m *CodespaceWithFullRepository) SetPendingOperation(value *bool)() { + m.pending_operation = value +} +// SetPendingOperationDisabledReason sets the pending_operation_disabled_reason property value. Text to show user when codespace is disabled by a pending operation +func (m *CodespaceWithFullRepository) SetPendingOperationDisabledReason(value *string)() { + m.pending_operation_disabled_reason = value +} +// SetPrebuild sets the prebuild property value. Whether the codespace was created from a prebuild. +func (m *CodespaceWithFullRepository) SetPrebuild(value *bool)() { + m.prebuild = value +} +// SetPublishUrl sets the publish_url property value. API URL to publish this codespace to a new repository. +func (m *CodespaceWithFullRepository) SetPublishUrl(value *string)() { + m.publish_url = value +} +// SetPullsUrl sets the pulls_url property value. API URL for the Pull Request associated with this codespace, if any. +func (m *CodespaceWithFullRepository) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetRecentFolders sets the recent_folders property value. The recent_folders property +func (m *CodespaceWithFullRepository) SetRecentFolders(value []string)() { + m.recent_folders = value +} +// SetRepository sets the repository property value. Full Repository +func (m *CodespaceWithFullRepository) SetRepository(value FullRepositoryable)() { + m.repository = value +} +// SetRetentionExpiresAt sets the retention_expires_at property value. When a codespace will be auto-deleted based on the "retention_period_minutes" and "last_used_at" +func (m *CodespaceWithFullRepository) SetRetentionExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.retention_expires_at = value +} +// SetRetentionPeriodMinutes sets the retention_period_minutes property value. Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days). +func (m *CodespaceWithFullRepository) SetRetentionPeriodMinutes(value *int32)() { + m.retention_period_minutes = value +} +// SetRuntimeConstraints sets the runtime_constraints property value. The runtime_constraints property +func (m *CodespaceWithFullRepository) SetRuntimeConstraints(value CodespaceWithFullRepository_runtime_constraintsable)() { + m.runtime_constraints = value +} +// SetStartUrl sets the start_url property value. API URL to start this codespace. +func (m *CodespaceWithFullRepository) SetStartUrl(value *string)() { + m.start_url = value +} +// SetState sets the state property value. State of this codespace. +func (m *CodespaceWithFullRepository) SetState(value *CodespaceWithFullRepository_state)() { + m.state = value +} +// SetStopUrl sets the stop_url property value. API URL to stop this codespace. +func (m *CodespaceWithFullRepository) SetStopUrl(value *string)() { + m.stop_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *CodespaceWithFullRepository) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. API URL for this codespace. +func (m *CodespaceWithFullRepository) SetUrl(value *string)() { + m.url = value +} +// SetWebUrl sets the web_url property value. URL to access this codespace on the web. +func (m *CodespaceWithFullRepository) SetWebUrl(value *string)() { + m.web_url = value +} +type CodespaceWithFullRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBillableOwner()(SimpleUserable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDevcontainerPath()(*string) + GetDisplayName()(*string) + GetEnvironmentId()(*string) + GetGitStatus()(CodespaceWithFullRepository_git_statusable) + GetId()(*int64) + GetIdleTimeoutMinutes()(*int32) + GetIdleTimeoutNotice()(*string) + GetLastUsedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetLocation()(*CodespaceWithFullRepository_location) + GetMachine()(NullableCodespaceMachineable) + GetMachinesUrl()(*string) + GetName()(*string) + GetOwner()(SimpleUserable) + GetPendingOperation()(*bool) + GetPendingOperationDisabledReason()(*string) + GetPrebuild()(*bool) + GetPublishUrl()(*string) + GetPullsUrl()(*string) + GetRecentFolders()([]string) + GetRepository()(FullRepositoryable) + GetRetentionExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetRetentionPeriodMinutes()(*int32) + GetRuntimeConstraints()(CodespaceWithFullRepository_runtime_constraintsable) + GetStartUrl()(*string) + GetState()(*CodespaceWithFullRepository_state) + GetStopUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetWebUrl()(*string) + SetBillableOwner(value SimpleUserable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDevcontainerPath(value *string)() + SetDisplayName(value *string)() + SetEnvironmentId(value *string)() + SetGitStatus(value CodespaceWithFullRepository_git_statusable)() + SetId(value *int64)() + SetIdleTimeoutMinutes(value *int32)() + SetIdleTimeoutNotice(value *string)() + SetLastUsedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetLocation(value *CodespaceWithFullRepository_location)() + SetMachine(value NullableCodespaceMachineable)() + SetMachinesUrl(value *string)() + SetName(value *string)() + SetOwner(value SimpleUserable)() + SetPendingOperation(value *bool)() + SetPendingOperationDisabledReason(value *string)() + SetPrebuild(value *bool)() + SetPublishUrl(value *string)() + SetPullsUrl(value *string)() + SetRecentFolders(value []string)() + SetRepository(value FullRepositoryable)() + SetRetentionExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetRetentionPeriodMinutes(value *int32)() + SetRuntimeConstraints(value CodespaceWithFullRepository_runtime_constraintsable)() + SetStartUrl(value *string)() + SetState(value *CodespaceWithFullRepository_state)() + SetStopUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetWebUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_with_full_repository_git_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_with_full_repository_git_status.go new file mode 100644 index 000000000..2a503bfdd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_with_full_repository_git_status.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodespaceWithFullRepository_git_status details about the codespace's git repository. +type CodespaceWithFullRepository_git_status struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The number of commits the local repository is ahead of the remote. + ahead *int32 + // The number of commits the local repository is behind the remote. + behind *int32 + // Whether the local repository has uncommitted changes. + has_uncommitted_changes *bool + // Whether the local repository has unpushed changes. + has_unpushed_changes *bool + // The current branch (or SHA if in detached HEAD state) of the local repository. + ref *string +} +// NewCodespaceWithFullRepository_git_status instantiates a new CodespaceWithFullRepository_git_status and sets the default values. +func NewCodespaceWithFullRepository_git_status()(*CodespaceWithFullRepository_git_status) { + m := &CodespaceWithFullRepository_git_status{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespaceWithFullRepository_git_statusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespaceWithFullRepository_git_statusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespaceWithFullRepository_git_status(), 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 *CodespaceWithFullRepository_git_status) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAhead gets the ahead property value. The number of commits the local repository is ahead of the remote. +// returns a *int32 when successful +func (m *CodespaceWithFullRepository_git_status) GetAhead()(*int32) { + return m.ahead +} +// GetBehind gets the behind property value. The number of commits the local repository is behind the remote. +// returns a *int32 when successful +func (m *CodespaceWithFullRepository_git_status) GetBehind()(*int32) { + return m.behind +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespaceWithFullRepository_git_status) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ahead"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAhead(val) + } + return nil + } + res["behind"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetBehind(val) + } + return nil + } + res["has_uncommitted_changes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasUncommittedChanges(val) + } + return nil + } + res["has_unpushed_changes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasUnpushedChanges(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + return res +} +// GetHasUncommittedChanges gets the has_uncommitted_changes property value. Whether the local repository has uncommitted changes. +// returns a *bool when successful +func (m *CodespaceWithFullRepository_git_status) GetHasUncommittedChanges()(*bool) { + return m.has_uncommitted_changes +} +// GetHasUnpushedChanges gets the has_unpushed_changes property value. Whether the local repository has unpushed changes. +// returns a *bool when successful +func (m *CodespaceWithFullRepository_git_status) GetHasUnpushedChanges()(*bool) { + return m.has_unpushed_changes +} +// GetRef gets the ref property value. The current branch (or SHA if in detached HEAD state) of the local repository. +// returns a *string when successful +func (m *CodespaceWithFullRepository_git_status) GetRef()(*string) { + return m.ref +} +// Serialize serializes information the current object +func (m *CodespaceWithFullRepository_git_status) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("ahead", m.GetAhead()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("behind", m.GetBehind()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_uncommitted_changes", m.GetHasUncommittedChanges()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_unpushed_changes", m.GetHasUnpushedChanges()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + 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 *CodespaceWithFullRepository_git_status) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAhead sets the ahead property value. The number of commits the local repository is ahead of the remote. +func (m *CodespaceWithFullRepository_git_status) SetAhead(value *int32)() { + m.ahead = value +} +// SetBehind sets the behind property value. The number of commits the local repository is behind the remote. +func (m *CodespaceWithFullRepository_git_status) SetBehind(value *int32)() { + m.behind = value +} +// SetHasUncommittedChanges sets the has_uncommitted_changes property value. Whether the local repository has uncommitted changes. +func (m *CodespaceWithFullRepository_git_status) SetHasUncommittedChanges(value *bool)() { + m.has_uncommitted_changes = value +} +// SetHasUnpushedChanges sets the has_unpushed_changes property value. Whether the local repository has unpushed changes. +func (m *CodespaceWithFullRepository_git_status) SetHasUnpushedChanges(value *bool)() { + m.has_unpushed_changes = value +} +// SetRef sets the ref property value. The current branch (or SHA if in detached HEAD state) of the local repository. +func (m *CodespaceWithFullRepository_git_status) SetRef(value *string)() { + m.ref = value +} +type CodespaceWithFullRepository_git_statusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAhead()(*int32) + GetBehind()(*int32) + GetHasUncommittedChanges()(*bool) + GetHasUnpushedChanges()(*bool) + GetRef()(*string) + SetAhead(value *int32)() + SetBehind(value *int32)() + SetHasUncommittedChanges(value *bool)() + SetHasUnpushedChanges(value *bool)() + SetRef(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_with_full_repository_location.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_with_full_repository_location.go new file mode 100644 index 000000000..b972709ee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_with_full_repository_location.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The initally assigned location of a new codespace. +type CodespaceWithFullRepository_location int + +const ( + EASTUS_CODESPACEWITHFULLREPOSITORY_LOCATION CodespaceWithFullRepository_location = iota + SOUTHEASTASIA_CODESPACEWITHFULLREPOSITORY_LOCATION + WESTEUROPE_CODESPACEWITHFULLREPOSITORY_LOCATION + WESTUS2_CODESPACEWITHFULLREPOSITORY_LOCATION +) + +func (i CodespaceWithFullRepository_location) String() string { + return []string{"EastUs", "SouthEastAsia", "WestEurope", "WestUs2"}[i] +} +func ParseCodespaceWithFullRepository_location(v string) (any, error) { + result := EASTUS_CODESPACEWITHFULLREPOSITORY_LOCATION + switch v { + case "EastUs": + result = EASTUS_CODESPACEWITHFULLREPOSITORY_LOCATION + case "SouthEastAsia": + result = SOUTHEASTASIA_CODESPACEWITHFULLREPOSITORY_LOCATION + case "WestEurope": + result = WESTEUROPE_CODESPACEWITHFULLREPOSITORY_LOCATION + case "WestUs2": + result = WESTUS2_CODESPACEWITHFULLREPOSITORY_LOCATION + default: + return 0, errors.New("Unknown CodespaceWithFullRepository_location value: " + v) + } + return &result, nil +} +func SerializeCodespaceWithFullRepository_location(values []CodespaceWithFullRepository_location) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodespaceWithFullRepository_location) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_with_full_repository_runtime_constraints.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_with_full_repository_runtime_constraints.go new file mode 100644 index 000000000..66c441f99 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_with_full_repository_runtime_constraints.go @@ -0,0 +1,86 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodespaceWithFullRepository_runtime_constraints struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The privacy settings a user can select from when forwarding a port. + allowed_port_privacy_settings []string +} +// NewCodespaceWithFullRepository_runtime_constraints instantiates a new CodespaceWithFullRepository_runtime_constraints and sets the default values. +func NewCodespaceWithFullRepository_runtime_constraints()(*CodespaceWithFullRepository_runtime_constraints) { + m := &CodespaceWithFullRepository_runtime_constraints{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespaceWithFullRepository_runtime_constraintsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespaceWithFullRepository_runtime_constraintsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespaceWithFullRepository_runtime_constraints(), 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 *CodespaceWithFullRepository_runtime_constraints) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowedPortPrivacySettings gets the allowed_port_privacy_settings property value. The privacy settings a user can select from when forwarding a port. +// returns a []string when successful +func (m *CodespaceWithFullRepository_runtime_constraints) GetAllowedPortPrivacySettings()([]string) { + return m.allowed_port_privacy_settings +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespaceWithFullRepository_runtime_constraints) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allowed_port_privacy_settings"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetAllowedPortPrivacySettings(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *CodespaceWithFullRepository_runtime_constraints) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAllowedPortPrivacySettings() != nil { + err := writer.WriteCollectionOfStringValues("allowed_port_privacy_settings", m.GetAllowedPortPrivacySettings()) + 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 *CodespaceWithFullRepository_runtime_constraints) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowedPortPrivacySettings sets the allowed_port_privacy_settings property value. The privacy settings a user can select from when forwarding a port. +func (m *CodespaceWithFullRepository_runtime_constraints) SetAllowedPortPrivacySettings(value []string)() { + m.allowed_port_privacy_settings = value +} +type CodespaceWithFullRepository_runtime_constraintsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowedPortPrivacySettings()([]string) + SetAllowedPortPrivacySettings(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_with_full_repository_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_with_full_repository_state.go new file mode 100644 index 000000000..d8cb98bc3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespace_with_full_repository_state.go @@ -0,0 +1,82 @@ +package models +import ( + "errors" +) +// State of this codespace. +type CodespaceWithFullRepository_state int + +const ( + UNKNOWN_CODESPACEWITHFULLREPOSITORY_STATE CodespaceWithFullRepository_state = iota + CREATED_CODESPACEWITHFULLREPOSITORY_STATE + QUEUED_CODESPACEWITHFULLREPOSITORY_STATE + PROVISIONING_CODESPACEWITHFULLREPOSITORY_STATE + AVAILABLE_CODESPACEWITHFULLREPOSITORY_STATE + AWAITING_CODESPACEWITHFULLREPOSITORY_STATE + UNAVAILABLE_CODESPACEWITHFULLREPOSITORY_STATE + DELETED_CODESPACEWITHFULLREPOSITORY_STATE + MOVED_CODESPACEWITHFULLREPOSITORY_STATE + SHUTDOWN_CODESPACEWITHFULLREPOSITORY_STATE + ARCHIVED_CODESPACEWITHFULLREPOSITORY_STATE + STARTING_CODESPACEWITHFULLREPOSITORY_STATE + SHUTTINGDOWN_CODESPACEWITHFULLREPOSITORY_STATE + FAILED_CODESPACEWITHFULLREPOSITORY_STATE + EXPORTING_CODESPACEWITHFULLREPOSITORY_STATE + UPDATING_CODESPACEWITHFULLREPOSITORY_STATE + REBUILDING_CODESPACEWITHFULLREPOSITORY_STATE +) + +func (i CodespaceWithFullRepository_state) String() string { + return []string{"Unknown", "Created", "Queued", "Provisioning", "Available", "Awaiting", "Unavailable", "Deleted", "Moved", "Shutdown", "Archived", "Starting", "ShuttingDown", "Failed", "Exporting", "Updating", "Rebuilding"}[i] +} +func ParseCodespaceWithFullRepository_state(v string) (any, error) { + result := UNKNOWN_CODESPACEWITHFULLREPOSITORY_STATE + switch v { + case "Unknown": + result = UNKNOWN_CODESPACEWITHFULLREPOSITORY_STATE + case "Created": + result = CREATED_CODESPACEWITHFULLREPOSITORY_STATE + case "Queued": + result = QUEUED_CODESPACEWITHFULLREPOSITORY_STATE + case "Provisioning": + result = PROVISIONING_CODESPACEWITHFULLREPOSITORY_STATE + case "Available": + result = AVAILABLE_CODESPACEWITHFULLREPOSITORY_STATE + case "Awaiting": + result = AWAITING_CODESPACEWITHFULLREPOSITORY_STATE + case "Unavailable": + result = UNAVAILABLE_CODESPACEWITHFULLREPOSITORY_STATE + case "Deleted": + result = DELETED_CODESPACEWITHFULLREPOSITORY_STATE + case "Moved": + result = MOVED_CODESPACEWITHFULLREPOSITORY_STATE + case "Shutdown": + result = SHUTDOWN_CODESPACEWITHFULLREPOSITORY_STATE + case "Archived": + result = ARCHIVED_CODESPACEWITHFULLREPOSITORY_STATE + case "Starting": + result = STARTING_CODESPACEWITHFULLREPOSITORY_STATE + case "ShuttingDown": + result = SHUTTINGDOWN_CODESPACEWITHFULLREPOSITORY_STATE + case "Failed": + result = FAILED_CODESPACEWITHFULLREPOSITORY_STATE + case "Exporting": + result = EXPORTING_CODESPACEWITHFULLREPOSITORY_STATE + case "Updating": + result = UPDATING_CODESPACEWITHFULLREPOSITORY_STATE + case "Rebuilding": + result = REBUILDING_CODESPACEWITHFULLREPOSITORY_STATE + default: + return 0, errors.New("Unknown CodespaceWithFullRepository_state value: " + v) + } + return &result, nil +} +func SerializeCodespaceWithFullRepository_state(values []CodespaceWithFullRepository_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodespaceWithFullRepository_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_org_secret.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_org_secret.go new file mode 100644 index 000000000..3e855d982 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_org_secret.go @@ -0,0 +1,199 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodespacesOrgSecret secrets for a GitHub Codespace. +type CodespacesOrgSecret struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The date and time at which the secret was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the secret + name *string + // The API URL at which the list of repositories this secret is visible to can be retrieved + selected_repositories_url *string + // The date and time at which the secret was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The type of repositories in the organization that the secret is visible to + visibility *CodespacesOrgSecret_visibility +} +// NewCodespacesOrgSecret instantiates a new CodespacesOrgSecret and sets the default values. +func NewCodespacesOrgSecret()(*CodespacesOrgSecret) { + m := &CodespacesOrgSecret{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesOrgSecretFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesOrgSecretFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesOrgSecret(), 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 *CodespacesOrgSecret) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The date and time at which the secret was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +// returns a *Time when successful +func (m *CodespacesOrgSecret) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesOrgSecret) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["selected_repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedRepositoriesUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodespacesOrgSecret_visibility) + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val.(*CodespacesOrgSecret_visibility)) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the secret +// returns a *string when successful +func (m *CodespacesOrgSecret) GetName()(*string) { + return m.name +} +// GetSelectedRepositoriesUrl gets the selected_repositories_url property value. The API URL at which the list of repositories this secret is visible to can be retrieved +// returns a *string when successful +func (m *CodespacesOrgSecret) GetSelectedRepositoriesUrl()(*string) { + return m.selected_repositories_url +} +// GetUpdatedAt gets the updated_at property value. The date and time at which the secret was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +// returns a *Time when successful +func (m *CodespacesOrgSecret) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetVisibility gets the visibility property value. The type of repositories in the organization that the secret is visible to +// returns a *CodespacesOrgSecret_visibility when successful +func (m *CodespacesOrgSecret) GetVisibility()(*CodespacesOrgSecret_visibility) { + return m.visibility +} +// Serialize serializes information the current object +func (m *CodespacesOrgSecret) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("selected_repositories_url", m.GetSelectedRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + if m.GetVisibility() != nil { + cast := (*m.GetVisibility()).String() + err := writer.WriteStringValue("visibility", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CodespacesOrgSecret) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The date and time at which the secret was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +func (m *CodespacesOrgSecret) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetName sets the name property value. The name of the secret +func (m *CodespacesOrgSecret) SetName(value *string)() { + m.name = value +} +// SetSelectedRepositoriesUrl sets the selected_repositories_url property value. The API URL at which the list of repositories this secret is visible to can be retrieved +func (m *CodespacesOrgSecret) SetSelectedRepositoriesUrl(value *string)() { + m.selected_repositories_url = value +} +// SetUpdatedAt sets the updated_at property value. The date and time at which the secret was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +func (m *CodespacesOrgSecret) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetVisibility sets the visibility property value. The type of repositories in the organization that the secret is visible to +func (m *CodespacesOrgSecret) SetVisibility(value *CodespacesOrgSecret_visibility)() { + m.visibility = value +} +type CodespacesOrgSecretable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetSelectedRepositoriesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetVisibility()(*CodespacesOrgSecret_visibility) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetSelectedRepositoriesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetVisibility(value *CodespacesOrgSecret_visibility)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_org_secret_visibility.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_org_secret_visibility.go new file mode 100644 index 000000000..d0769f221 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_org_secret_visibility.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The type of repositories in the organization that the secret is visible to +type CodespacesOrgSecret_visibility int + +const ( + ALL_CODESPACESORGSECRET_VISIBILITY CodespacesOrgSecret_visibility = iota + PRIVATE_CODESPACESORGSECRET_VISIBILITY + SELECTED_CODESPACESORGSECRET_VISIBILITY +) + +func (i CodespacesOrgSecret_visibility) String() string { + return []string{"all", "private", "selected"}[i] +} +func ParseCodespacesOrgSecret_visibility(v string) (any, error) { + result := ALL_CODESPACESORGSECRET_VISIBILITY + switch v { + case "all": + result = ALL_CODESPACESORGSECRET_VISIBILITY + case "private": + result = PRIVATE_CODESPACESORGSECRET_VISIBILITY + case "selected": + result = SELECTED_CODESPACESORGSECRET_VISIBILITY + default: + return 0, errors.New("Unknown CodespacesOrgSecret_visibility value: " + v) + } + return &result, nil +} +func SerializeCodespacesOrgSecret_visibility(values []CodespacesOrgSecret_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodespacesOrgSecret_visibility) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_permissions_check_for_devcontainer.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_permissions_check_for_devcontainer.go new file mode 100644 index 000000000..10718a7bf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_permissions_check_for_devcontainer.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodespacesPermissionsCheckForDevcontainer permission check result for a given devcontainer config. +type CodespacesPermissionsCheckForDevcontainer struct { + // Whether the user has accepted the permissions defined by the devcontainer config + accepted *bool + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewCodespacesPermissionsCheckForDevcontainer instantiates a new CodespacesPermissionsCheckForDevcontainer and sets the default values. +func NewCodespacesPermissionsCheckForDevcontainer()(*CodespacesPermissionsCheckForDevcontainer) { + m := &CodespacesPermissionsCheckForDevcontainer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesPermissionsCheckForDevcontainerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesPermissionsCheckForDevcontainerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesPermissionsCheckForDevcontainer(), nil +} +// GetAccepted gets the accepted property value. Whether the user has accepted the permissions defined by the devcontainer config +// returns a *bool when successful +func (m *CodespacesPermissionsCheckForDevcontainer) GetAccepted()(*bool) { + return m.accepted +} +// 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 *CodespacesPermissionsCheckForDevcontainer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesPermissionsCheckForDevcontainer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["accepted"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAccepted(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *CodespacesPermissionsCheckForDevcontainer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("accepted", m.GetAccepted()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccepted sets the accepted property value. Whether the user has accepted the permissions defined by the devcontainer config +func (m *CodespacesPermissionsCheckForDevcontainer) SetAccepted(value *bool)() { + m.accepted = value +} +// 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 *CodespacesPermissionsCheckForDevcontainer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type CodespacesPermissionsCheckForDevcontainerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccepted()(*bool) + SetAccepted(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_permissions_check_for_devcontainer503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_permissions_check_for_devcontainer503_error.go new file mode 100644 index 000000000..c9f50863b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_permissions_check_for_devcontainer503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodespacesPermissionsCheckForDevcontainer503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewCodespacesPermissionsCheckForDevcontainer503Error instantiates a new CodespacesPermissionsCheckForDevcontainer503Error and sets the default values. +func NewCodespacesPermissionsCheckForDevcontainer503Error()(*CodespacesPermissionsCheckForDevcontainer503Error) { + m := &CodespacesPermissionsCheckForDevcontainer503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesPermissionsCheckForDevcontainer503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesPermissionsCheckForDevcontainer503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesPermissionsCheckForDevcontainer503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodespacesPermissionsCheckForDevcontainer503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CodespacesPermissionsCheckForDevcontainer503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodespacesPermissionsCheckForDevcontainer503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodespacesPermissionsCheckForDevcontainer503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesPermissionsCheckForDevcontainer503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *CodespacesPermissionsCheckForDevcontainer503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodespacesPermissionsCheckForDevcontainer503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *CodespacesPermissionsCheckForDevcontainer503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodespacesPermissionsCheckForDevcontainer503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodespacesPermissionsCheckForDevcontainer503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodespacesPermissionsCheckForDevcontainer503Error) SetMessage(value *string)() { + m.message = value +} +type CodespacesPermissionsCheckForDevcontainer503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_public_key.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_public_key.go new file mode 100644 index 000000000..980f32e05 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_public_key.go @@ -0,0 +1,226 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodespacesPublicKey the public key used for setting Codespaces secrets. +type CodespacesPublicKey struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *string + // The id property + id *int32 + // The Base64 encoded public key. + key *string + // The identifier for the key. + key_id *string + // The title property + title *string + // The url property + url *string +} +// NewCodespacesPublicKey instantiates a new CodespacesPublicKey and sets the default values. +func NewCodespacesPublicKey()(*CodespacesPublicKey) { + m := &CodespacesPublicKey{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesPublicKeyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesPublicKeyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesPublicKey(), 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 *CodespacesPublicKey) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *CodespacesPublicKey) GetCreatedAt()(*string) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesPublicKey) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *CodespacesPublicKey) GetId()(*int32) { + return m.id +} +// GetKey gets the key property value. The Base64 encoded public key. +// returns a *string when successful +func (m *CodespacesPublicKey) GetKey()(*string) { + return m.key +} +// GetKeyId gets the key_id property value. The identifier for the key. +// returns a *string when successful +func (m *CodespacesPublicKey) GetKeyId()(*string) { + return m.key_id +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *CodespacesPublicKey) GetTitle()(*string) { + return m.title +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CodespacesPublicKey) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CodespacesPublicKey) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CodespacesPublicKey) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *CodespacesPublicKey) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *CodespacesPublicKey) SetId(value *int32)() { + m.id = value +} +// SetKey sets the key property value. The Base64 encoded public key. +func (m *CodespacesPublicKey) SetKey(value *string)() { + m.key = value +} +// SetKeyId sets the key_id property value. The identifier for the key. +func (m *CodespacesPublicKey) SetKeyId(value *string)() { + m.key_id = value +} +// SetTitle sets the title property value. The title property +func (m *CodespacesPublicKey) SetTitle(value *string)() { + m.title = value +} +// SetUrl sets the url property value. The url property +func (m *CodespacesPublicKey) SetUrl(value *string)() { + m.url = value +} +type CodespacesPublicKeyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*string) + GetId()(*int32) + GetKey()(*string) + GetKeyId()(*string) + GetTitle()(*string) + GetUrl()(*string) + SetCreatedAt(value *string)() + SetId(value *int32)() + SetKey(value *string)() + SetKeyId(value *string)() + SetTitle(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_secret.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_secret.go new file mode 100644 index 000000000..94d86db7f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_secret.go @@ -0,0 +1,199 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodespacesSecret secrets for a GitHub Codespace. +type CodespacesSecret struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The date and time at which the secret was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the secret + name *string + // The API URL at which the list of repositories this secret is visible to can be retrieved + selected_repositories_url *string + // The date and time at which the secret was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The type of repositories in the organization that the secret is visible to + visibility *CodespacesSecret_visibility +} +// NewCodespacesSecret instantiates a new CodespacesSecret and sets the default values. +func NewCodespacesSecret()(*CodespacesSecret) { + m := &CodespacesSecret{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesSecretFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesSecretFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesSecret(), 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 *CodespacesSecret) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The date and time at which the secret was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +// returns a *Time when successful +func (m *CodespacesSecret) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesSecret) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["selected_repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedRepositoriesUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodespacesSecret_visibility) + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val.(*CodespacesSecret_visibility)) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the secret +// returns a *string when successful +func (m *CodespacesSecret) GetName()(*string) { + return m.name +} +// GetSelectedRepositoriesUrl gets the selected_repositories_url property value. The API URL at which the list of repositories this secret is visible to can be retrieved +// returns a *string when successful +func (m *CodespacesSecret) GetSelectedRepositoriesUrl()(*string) { + return m.selected_repositories_url +} +// GetUpdatedAt gets the updated_at property value. The date and time at which the secret was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +// returns a *Time when successful +func (m *CodespacesSecret) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetVisibility gets the visibility property value. The type of repositories in the organization that the secret is visible to +// returns a *CodespacesSecret_visibility when successful +func (m *CodespacesSecret) GetVisibility()(*CodespacesSecret_visibility) { + return m.visibility +} +// Serialize serializes information the current object +func (m *CodespacesSecret) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("selected_repositories_url", m.GetSelectedRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + if m.GetVisibility() != nil { + cast := (*m.GetVisibility()).String() + err := writer.WriteStringValue("visibility", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CodespacesSecret) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The date and time at which the secret was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +func (m *CodespacesSecret) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetName sets the name property value. The name of the secret +func (m *CodespacesSecret) SetName(value *string)() { + m.name = value +} +// SetSelectedRepositoriesUrl sets the selected_repositories_url property value. The API URL at which the list of repositories this secret is visible to can be retrieved +func (m *CodespacesSecret) SetSelectedRepositoriesUrl(value *string)() { + m.selected_repositories_url = value +} +// SetUpdatedAt sets the updated_at property value. The date and time at which the secret was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +func (m *CodespacesSecret) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetVisibility sets the visibility property value. The type of repositories in the organization that the secret is visible to +func (m *CodespacesSecret) SetVisibility(value *CodespacesSecret_visibility)() { + m.visibility = value +} +type CodespacesSecretable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetSelectedRepositoriesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetVisibility()(*CodespacesSecret_visibility) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetSelectedRepositoriesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetVisibility(value *CodespacesSecret_visibility)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_secret_visibility.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_secret_visibility.go new file mode 100644 index 000000000..8d3552abf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_secret_visibility.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The type of repositories in the organization that the secret is visible to +type CodespacesSecret_visibility int + +const ( + ALL_CODESPACESSECRET_VISIBILITY CodespacesSecret_visibility = iota + PRIVATE_CODESPACESSECRET_VISIBILITY + SELECTED_CODESPACESSECRET_VISIBILITY +) + +func (i CodespacesSecret_visibility) String() string { + return []string{"all", "private", "selected"}[i] +} +func ParseCodespacesSecret_visibility(v string) (any, error) { + result := ALL_CODESPACESSECRET_VISIBILITY + switch v { + case "all": + result = ALL_CODESPACESSECRET_VISIBILITY + case "private": + result = PRIVATE_CODESPACESSECRET_VISIBILITY + case "selected": + result = SELECTED_CODESPACESSECRET_VISIBILITY + default: + return 0, errors.New("Unknown CodespacesSecret_visibility value: " + v) + } + return &result, nil +} +func SerializeCodespacesSecret_visibility(values []CodespacesSecret_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodespacesSecret_visibility) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_user_public_key.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_user_public_key.go new file mode 100644 index 000000000..d548504cf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/codespaces_user_public_key.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodespacesUserPublicKey the public key used for setting user Codespaces' Secrets. +type CodespacesUserPublicKey struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The Base64 encoded public key. + key *string + // The identifier for the key. + key_id *string +} +// NewCodespacesUserPublicKey instantiates a new CodespacesUserPublicKey and sets the default values. +func NewCodespacesUserPublicKey()(*CodespacesUserPublicKey) { + m := &CodespacesUserPublicKey{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesUserPublicKeyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesUserPublicKeyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesUserPublicKey(), 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 *CodespacesUserPublicKey) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesUserPublicKey) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The Base64 encoded public key. +// returns a *string when successful +func (m *CodespacesUserPublicKey) GetKey()(*string) { + return m.key +} +// GetKeyId gets the key_id property value. The identifier for the key. +// returns a *string when successful +func (m *CodespacesUserPublicKey) GetKeyId()(*string) { + return m.key_id +} +// Serialize serializes information the current object +func (m *CodespacesUserPublicKey) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CodespacesUserPublicKey) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The Base64 encoded public key. +func (m *CodespacesUserPublicKey) SetKey(value *string)() { + m.key = value +} +// SetKeyId sets the key_id property value. The identifier for the key. +func (m *CodespacesUserPublicKey) SetKeyId(value *string)() { + m.key_id = value +} +type CodespacesUserPublicKeyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetKeyId()(*string) + SetKey(value *string)() + SetKeyId(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/collaborator.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/collaborator.go new file mode 100644 index 000000000..051146855 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/collaborator.go @@ -0,0 +1,690 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Collaborator collaborator +type Collaborator struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The email property + email *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int64 + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The permissions property + permissions Collaborator_permissionsable + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The role_name property + role_name *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewCollaborator instantiates a new Collaborator and sets the default values. +func NewCollaborator()(*Collaborator) { + m := &Collaborator{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCollaboratorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCollaboratorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCollaborator(), 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 *Collaborator) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *Collaborator) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *Collaborator) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *Collaborator) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Collaborator) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCollaborator_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(Collaborator_permissionsable)) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["role_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRoleName(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *Collaborator) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *Collaborator) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *Collaborator) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *Collaborator) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Collaborator) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *Collaborator) GetId()(*int64) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *Collaborator) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *Collaborator) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Collaborator) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *Collaborator) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetPermissions gets the permissions property value. The permissions property +// returns a Collaborator_permissionsable when successful +func (m *Collaborator) GetPermissions()(Collaborator_permissionsable) { + return m.permissions +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *Collaborator) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *Collaborator) GetReposUrl()(*string) { + return m.repos_url +} +// GetRoleName gets the role_name property value. The role_name property +// returns a *string when successful +func (m *Collaborator) GetRoleName()(*string) { + return m.role_name +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *Collaborator) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *Collaborator) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *Collaborator) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *Collaborator) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Collaborator) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Collaborator) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("role_name", m.GetRoleName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Collaborator) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *Collaborator) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEmail sets the email property value. The email property +func (m *Collaborator) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *Collaborator) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *Collaborator) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *Collaborator) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *Collaborator) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *Collaborator) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Collaborator) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Collaborator) SetId(value *int64)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *Collaborator) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *Collaborator) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Collaborator) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *Collaborator) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *Collaborator) SetPermissions(value Collaborator_permissionsable)() { + m.permissions = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *Collaborator) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *Collaborator) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetRoleName sets the role_name property value. The role_name property +func (m *Collaborator) SetRoleName(value *string)() { + m.role_name = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *Collaborator) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *Collaborator) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *Collaborator) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Collaborator) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *Collaborator) SetUrl(value *string)() { + m.url = value +} +type Collaboratorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetPermissions()(Collaborator_permissionsable) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetRoleName()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetPermissions(value Collaborator_permissionsable)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetRoleName(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/collaborator_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/collaborator_permissions.go new file mode 100644 index 000000000..098a45028 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/collaborator_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Collaborator_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewCollaborator_permissions instantiates a new Collaborator_permissions and sets the default values. +func NewCollaborator_permissions()(*Collaborator_permissions) { + m := &Collaborator_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCollaborator_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCollaborator_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCollaborator_permissions(), 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 *Collaborator_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *Collaborator_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Collaborator_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *Collaborator_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *Collaborator_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *Collaborator_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *Collaborator_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *Collaborator_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *Collaborator_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *Collaborator_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *Collaborator_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *Collaborator_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *Collaborator_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *Collaborator_permissions) SetTriage(value *bool)() { + m.triage = value +} +type Collaborator_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/combined_billing_usage.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/combined_billing_usage.go new file mode 100644 index 000000000..087b2e2f1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/combined_billing_usage.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CombinedBillingUsage struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Numbers of days left in billing cycle. + days_left_in_billing_cycle *int32 + // Estimated storage space (GB) used in billing cycle. + estimated_paid_storage_for_month *int32 + // Estimated sum of free and paid storage space (GB) used in billing cycle. + estimated_storage_for_month *int32 +} +// NewCombinedBillingUsage instantiates a new CombinedBillingUsage and sets the default values. +func NewCombinedBillingUsage()(*CombinedBillingUsage) { + m := &CombinedBillingUsage{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCombinedBillingUsageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCombinedBillingUsageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCombinedBillingUsage(), 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 *CombinedBillingUsage) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDaysLeftInBillingCycle gets the days_left_in_billing_cycle property value. Numbers of days left in billing cycle. +// returns a *int32 when successful +func (m *CombinedBillingUsage) GetDaysLeftInBillingCycle()(*int32) { + return m.days_left_in_billing_cycle +} +// GetEstimatedPaidStorageForMonth gets the estimated_paid_storage_for_month property value. Estimated storage space (GB) used in billing cycle. +// returns a *int32 when successful +func (m *CombinedBillingUsage) GetEstimatedPaidStorageForMonth()(*int32) { + return m.estimated_paid_storage_for_month +} +// GetEstimatedStorageForMonth gets the estimated_storage_for_month property value. Estimated sum of free and paid storage space (GB) used in billing cycle. +// returns a *int32 when successful +func (m *CombinedBillingUsage) GetEstimatedStorageForMonth()(*int32) { + return m.estimated_storage_for_month +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CombinedBillingUsage) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["days_left_in_billing_cycle"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDaysLeftInBillingCycle(val) + } + return nil + } + res["estimated_paid_storage_for_month"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetEstimatedPaidStorageForMonth(val) + } + return nil + } + res["estimated_storage_for_month"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetEstimatedStorageForMonth(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *CombinedBillingUsage) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("days_left_in_billing_cycle", m.GetDaysLeftInBillingCycle()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("estimated_paid_storage_for_month", m.GetEstimatedPaidStorageForMonth()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("estimated_storage_for_month", m.GetEstimatedStorageForMonth()) + 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 *CombinedBillingUsage) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDaysLeftInBillingCycle sets the days_left_in_billing_cycle property value. Numbers of days left in billing cycle. +func (m *CombinedBillingUsage) SetDaysLeftInBillingCycle(value *int32)() { + m.days_left_in_billing_cycle = value +} +// SetEstimatedPaidStorageForMonth sets the estimated_paid_storage_for_month property value. Estimated storage space (GB) used in billing cycle. +func (m *CombinedBillingUsage) SetEstimatedPaidStorageForMonth(value *int32)() { + m.estimated_paid_storage_for_month = value +} +// SetEstimatedStorageForMonth sets the estimated_storage_for_month property value. Estimated sum of free and paid storage space (GB) used in billing cycle. +func (m *CombinedBillingUsage) SetEstimatedStorageForMonth(value *int32)() { + m.estimated_storage_for_month = value +} +type CombinedBillingUsageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDaysLeftInBillingCycle()(*int32) + GetEstimatedPaidStorageForMonth()(*int32) + GetEstimatedStorageForMonth()(*int32) + SetDaysLeftInBillingCycle(value *int32)() + SetEstimatedPaidStorageForMonth(value *int32)() + SetEstimatedStorageForMonth(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/combined_commit_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/combined_commit_status.go new file mode 100644 index 000000000..2d21556fc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/combined_commit_status.go @@ -0,0 +1,267 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CombinedCommitStatus combined Commit Status +type CombinedCommitStatus struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_url property + commit_url *string + // Minimal Repository + repository MinimalRepositoryable + // The sha property + sha *string + // The state property + state *string + // The statuses property + statuses []SimpleCommitStatusable + // The total_count property + total_count *int32 + // The url property + url *string +} +// NewCombinedCommitStatus instantiates a new CombinedCommitStatus and sets the default values. +func NewCombinedCommitStatus()(*CombinedCommitStatus) { + m := &CombinedCommitStatus{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCombinedCommitStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCombinedCommitStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCombinedCommitStatus(), 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 *CombinedCommitStatus) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *CombinedCommitStatus) GetCommitUrl()(*string) { + return m.commit_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CombinedCommitStatus) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(MinimalRepositoryable)) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["statuses"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleCommitStatusFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleCommitStatusable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleCommitStatusable) + } + } + m.SetStatuses(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetRepository gets the repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *CombinedCommitStatus) GetRepository()(MinimalRepositoryable) { + return m.repository +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *CombinedCommitStatus) GetSha()(*string) { + return m.sha +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *CombinedCommitStatus) GetState()(*string) { + return m.state +} +// GetStatuses gets the statuses property value. The statuses property +// returns a []SimpleCommitStatusable when successful +func (m *CombinedCommitStatus) GetStatuses()([]SimpleCommitStatusable) { + return m.statuses +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *CombinedCommitStatus) GetTotalCount()(*int32) { + return m.total_count +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CombinedCommitStatus) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CombinedCommitStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + if m.GetStatuses() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetStatuses())) + for i, v := range m.GetStatuses() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("statuses", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CombinedCommitStatus) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *CombinedCommitStatus) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *CombinedCommitStatus) SetRepository(value MinimalRepositoryable)() { + m.repository = value +} +// SetSha sets the sha property value. The sha property +func (m *CombinedCommitStatus) SetSha(value *string)() { + m.sha = value +} +// SetState sets the state property value. The state property +func (m *CombinedCommitStatus) SetState(value *string)() { + m.state = value +} +// SetStatuses sets the statuses property value. The statuses property +func (m *CombinedCommitStatus) SetStatuses(value []SimpleCommitStatusable)() { + m.statuses = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *CombinedCommitStatus) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetUrl sets the url property value. The url property +func (m *CombinedCommitStatus) SetUrl(value *string)() { + m.url = value +} +type CombinedCommitStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommitUrl()(*string) + GetRepository()(MinimalRepositoryable) + GetSha()(*string) + GetState()(*string) + GetStatuses()([]SimpleCommitStatusable) + GetTotalCount()(*int32) + GetUrl()(*string) + SetCommitUrl(value *string)() + SetRepository(value MinimalRepositoryable)() + SetSha(value *string)() + SetState(value *string)() + SetStatuses(value []SimpleCommitStatusable)() + SetTotalCount(value *int32)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commit.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit.go new file mode 100644 index 000000000..9b1f9a366 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit.go @@ -0,0 +1,395 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Commit commit +type Commit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + author NullableSimpleUserable + // The comments_url property + comments_url *string + // The commit property + commit Commit_commitable + // A GitHub user. + committer NullableSimpleUserable + // The files property + files []DiffEntryable + // The html_url property + html_url *string + // The node_id property + node_id *string + // The parents property + parents []Commit_parentsable + // The sha property + sha *string + // The stats property + stats Commit_statsable + // The url property + url *string +} +// NewCommit instantiates a new Commit and sets the default values. +func NewCommit()(*Commit) { + m := &Commit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommit(), 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 *Commit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Commit) GetAuthor()(NullableSimpleUserable) { + return m.author +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *Commit) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommit gets the commit property value. The commit property +// returns a Commit_commitable when successful +func (m *Commit) GetCommit()(Commit_commitable) { + return m.commit +} +// GetCommitter gets the committer property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Commit) GetCommitter()(NullableSimpleUserable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Commit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(NullableSimpleUserable)) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommit_commitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommit(val.(Commit_commitable)) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(NullableSimpleUserable)) + } + return nil + } + res["files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDiffEntryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DiffEntryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DiffEntryable) + } + } + m.SetFiles(res) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["parents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCommit_parentsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Commit_parentsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Commit_parentsable) + } + } + m.SetParents(res) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["stats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommit_statsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetStats(val.(Commit_statsable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFiles gets the files property value. The files property +// returns a []DiffEntryable when successful +func (m *Commit) GetFiles()([]DiffEntryable) { + return m.files +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Commit) GetHtmlUrl()(*string) { + return m.html_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Commit) GetNodeId()(*string) { + return m.node_id +} +// GetParents gets the parents property value. The parents property +// returns a []Commit_parentsable when successful +func (m *Commit) GetParents()([]Commit_parentsable) { + return m.parents +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *Commit) GetSha()(*string) { + return m.sha +} +// GetStats gets the stats property value. The stats property +// returns a Commit_statsable when successful +func (m *Commit) GetStats()(Commit_statsable) { + return m.stats +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Commit) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Commit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("commit", m.GetCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + if m.GetFiles() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetFiles())) + for i, v := range m.GetFiles() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("files", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetParents() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetParents())) + for i, v := range m.GetParents() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("parents", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("stats", m.GetStats()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Commit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. A GitHub user. +func (m *Commit) SetAuthor(value NullableSimpleUserable)() { + m.author = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *Commit) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommit sets the commit property value. The commit property +func (m *Commit) SetCommit(value Commit_commitable)() { + m.commit = value +} +// SetCommitter sets the committer property value. A GitHub user. +func (m *Commit) SetCommitter(value NullableSimpleUserable)() { + m.committer = value +} +// SetFiles sets the files property value. The files property +func (m *Commit) SetFiles(value []DiffEntryable)() { + m.files = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Commit) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Commit) SetNodeId(value *string)() { + m.node_id = value +} +// SetParents sets the parents property value. The parents property +func (m *Commit) SetParents(value []Commit_parentsable)() { + m.parents = value +} +// SetSha sets the sha property value. The sha property +func (m *Commit) SetSha(value *string)() { + m.sha = value +} +// SetStats sets the stats property value. The stats property +func (m *Commit) SetStats(value Commit_statsable)() { + m.stats = value +} +// SetUrl sets the url property value. The url property +func (m *Commit) SetUrl(value *string)() { + m.url = value +} +type Commitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(NullableSimpleUserable) + GetCommentsUrl()(*string) + GetCommit()(Commit_commitable) + GetCommitter()(NullableSimpleUserable) + GetFiles()([]DiffEntryable) + GetHtmlUrl()(*string) + GetNodeId()(*string) + GetParents()([]Commit_parentsable) + GetSha()(*string) + GetStats()(Commit_statsable) + GetUrl()(*string) + SetAuthor(value NullableSimpleUserable)() + SetCommentsUrl(value *string)() + SetCommit(value Commit_commitable)() + SetCommitter(value NullableSimpleUserable)() + SetFiles(value []DiffEntryable)() + SetHtmlUrl(value *string)() + SetNodeId(value *string)() + SetParents(value []Commit_parentsable)() + SetSha(value *string)() + SetStats(value Commit_statsable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commit503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit503_error.go new file mode 100644 index 000000000..1e17d9006 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Commit503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewCommit503Error instantiates a new Commit503Error and sets the default values. +func NewCommit503Error()(*Commit503Error) { + m := &Commit503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommit503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommit503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommit503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Commit503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Commit503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Commit503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Commit503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Commit503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Commit503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Commit503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *Commit503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Commit503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Commit503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Commit503Error) SetMessage(value *string)() { + m.message = value +} +type Commit503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_activity.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_activity.go new file mode 100644 index 000000000..58c70d836 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_activity.go @@ -0,0 +1,145 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CommitActivity commit Activity +type CommitActivity struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The days property + days []int32 + // The total property + total *int32 + // The week property + week *int32 +} +// NewCommitActivity instantiates a new CommitActivity and sets the default values. +func NewCommitActivity()(*CommitActivity) { + m := &CommitActivity{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitActivityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitActivityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitActivity(), 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 *CommitActivity) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDays gets the days property value. The days property +// returns a []int32 when successful +func (m *CommitActivity) GetDays()([]int32) { + return m.days +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CommitActivity) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["days"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetDays(res) + } + return nil + } + res["total"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotal(val) + } + return nil + } + res["week"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWeek(val) + } + return nil + } + return res +} +// GetTotal gets the total property value. The total property +// returns a *int32 when successful +func (m *CommitActivity) GetTotal()(*int32) { + return m.total +} +// GetWeek gets the week property value. The week property +// returns a *int32 when successful +func (m *CommitActivity) GetWeek()(*int32) { + return m.week +} +// Serialize serializes information the current object +func (m *CommitActivity) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetDays() != nil { + err := writer.WriteCollectionOfInt32Values("days", m.GetDays()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total", m.GetTotal()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("week", m.GetWeek()) + 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 *CommitActivity) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDays sets the days property value. The days property +func (m *CommitActivity) SetDays(value []int32)() { + m.days = value +} +// SetTotal sets the total property value. The total property +func (m *CommitActivity) SetTotal(value *int32)() { + m.total = value +} +// SetWeek sets the week property value. The week property +func (m *CommitActivity) SetWeek(value *int32)() { + m.week = value +} +type CommitActivityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDays()([]int32) + GetTotal()(*int32) + GetWeek()(*int32) + SetDays(value []int32)() + SetTotal(value *int32)() + SetWeek(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_comment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_comment.go new file mode 100644 index 000000000..434276599 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_comment.go @@ -0,0 +1,460 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CommitComment commit Comment +type CommitComment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How the author is associated with the repository. + author_association *AuthorAssociation + // The body property + body *string + // The commit_id property + commit_id *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The html_url property + html_url *string + // The id property + id *int32 + // The line property + line *int32 + // The node_id property + node_id *string + // The path property + path *string + // The position property + position *int32 + // The reactions property + reactions ReactionRollupable + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewCommitComment instantiates a new CommitComment and sets the default values. +func NewCommitComment()(*CommitComment) { + m := &CommitComment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitComment(), 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 *CommitComment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *CommitComment) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *CommitComment) GetBody()(*string) { + return m.body +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *CommitComment) GetCommitId()(*string) { + return m.commit_id +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *CommitComment) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CommitComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLine(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(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["position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPosition(val) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CommitComment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *CommitComment) GetId()(*int32) { + return m.id +} +// GetLine gets the line property value. The line property +// returns a *int32 when successful +func (m *CommitComment) GetLine()(*int32) { + return m.line +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *CommitComment) GetNodeId()(*string) { + return m.node_id +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *CommitComment) GetPath()(*string) { + return m.path +} +// GetPosition gets the position property value. The position property +// returns a *int32 when successful +func (m *CommitComment) GetPosition()(*int32) { + return m.position +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *CommitComment) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *CommitComment) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CommitComment) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *CommitComment) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *CommitComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("line", m.GetLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("position", m.GetPosition()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *CommitComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *CommitComment) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. The body property +func (m *CommitComment) SetBody(value *string)() { + m.body = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *CommitComment) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *CommitComment) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CommitComment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *CommitComment) SetId(value *int32)() { + m.id = value +} +// SetLine sets the line property value. The line property +func (m *CommitComment) SetLine(value *int32)() { + m.line = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *CommitComment) SetNodeId(value *string)() { + m.node_id = value +} +// SetPath sets the path property value. The path property +func (m *CommitComment) SetPath(value *string)() { + m.path = value +} +// SetPosition sets the position property value. The position property +func (m *CommitComment) SetPosition(value *int32)() { + m.position = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *CommitComment) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *CommitComment) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *CommitComment) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *CommitComment) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type CommitCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetCommitId()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLine()(*int32) + GetNodeId()(*string) + GetPath()(*string) + GetPosition()(*int32) + GetReactions()(ReactionRollupable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetCommitId(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLine(value *int32)() + SetNodeId(value *string)() + SetPath(value *string)() + SetPosition(value *int32)() + SetReactions(value ReactionRollupable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_commit.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_commit.go new file mode 100644 index 000000000..0ce6d825e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_commit.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Commit_commit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Metaproperties for Git author/committer information. + author NullableGitUserable + // The comment_count property + comment_count *int32 + // Metaproperties for Git author/committer information. + committer NullableGitUserable + // The message property + message *string + // The tree property + tree Commit_commit_treeable + // The url property + url *string + // The verification property + verification Verificationable +} +// NewCommit_commit instantiates a new Commit_commit and sets the default values. +func NewCommit_commit()(*Commit_commit) { + m := &Commit_commit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommit_commitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommit_commitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommit_commit(), 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 *Commit_commit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. Metaproperties for Git author/committer information. +// returns a NullableGitUserable when successful +func (m *Commit_commit) GetAuthor()(NullableGitUserable) { + return m.author +} +// GetCommentCount gets the comment_count property value. The comment_count property +// returns a *int32 when successful +func (m *Commit_commit) GetCommentCount()(*int32) { + return m.comment_count +} +// GetCommitter gets the committer property value. Metaproperties for Git author/committer information. +// returns a NullableGitUserable when successful +func (m *Commit_commit) GetCommitter()(NullableGitUserable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Commit_commit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableGitUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(NullableGitUserable)) + } + return nil + } + res["comment_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCommentCount(val) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableGitUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(NullableGitUserable)) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommit_commit_treeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTree(val.(Commit_commit_treeable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["verification"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateVerificationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerification(val.(Verificationable)) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Commit_commit) GetMessage()(*string) { + return m.message +} +// GetTree gets the tree property value. The tree property +// returns a Commit_commit_treeable when successful +func (m *Commit_commit) GetTree()(Commit_commit_treeable) { + return m.tree +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Commit_commit) GetUrl()(*string) { + return m.url +} +// GetVerification gets the verification property value. The verification property +// returns a Verificationable when successful +func (m *Commit_commit) GetVerification()(Verificationable) { + return m.verification +} +// Serialize serializes information the current object +func (m *Commit_commit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("comment_count", m.GetCommentCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tree", m.GetTree()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("verification", m.GetVerification()) + 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 *Commit_commit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. Metaproperties for Git author/committer information. +func (m *Commit_commit) SetAuthor(value NullableGitUserable)() { + m.author = value +} +// SetCommentCount sets the comment_count property value. The comment_count property +func (m *Commit_commit) SetCommentCount(value *int32)() { + m.comment_count = value +} +// SetCommitter sets the committer property value. Metaproperties for Git author/committer information. +func (m *Commit_commit) SetCommitter(value NullableGitUserable)() { + m.committer = value +} +// SetMessage sets the message property value. The message property +func (m *Commit_commit) SetMessage(value *string)() { + m.message = value +} +// SetTree sets the tree property value. The tree property +func (m *Commit_commit) SetTree(value Commit_commit_treeable)() { + m.tree = value +} +// SetUrl sets the url property value. The url property +func (m *Commit_commit) SetUrl(value *string)() { + m.url = value +} +// SetVerification sets the verification property value. The verification property +func (m *Commit_commit) SetVerification(value Verificationable)() { + m.verification = value +} +type Commit_commitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(NullableGitUserable) + GetCommentCount()(*int32) + GetCommitter()(NullableGitUserable) + GetMessage()(*string) + GetTree()(Commit_commit_treeable) + GetUrl()(*string) + GetVerification()(Verificationable) + SetAuthor(value NullableGitUserable)() + SetCommentCount(value *int32)() + SetCommitter(value NullableGitUserable)() + SetMessage(value *string)() + SetTree(value Commit_commit_treeable)() + SetUrl(value *string)() + SetVerification(value Verificationable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_commit_tree.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_commit_tree.go new file mode 100644 index 000000000..9620aa871 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_commit_tree.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Commit_commit_tree struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The sha property + sha *string + // The url property + url *string +} +// NewCommit_commit_tree instantiates a new Commit_commit_tree and sets the default values. +func NewCommit_commit_tree()(*Commit_commit_tree) { + m := &Commit_commit_tree{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommit_commit_treeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommit_commit_treeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommit_commit_tree(), 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 *Commit_commit_tree) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Commit_commit_tree) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *Commit_commit_tree) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Commit_commit_tree) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Commit_commit_tree) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Commit_commit_tree) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *Commit_commit_tree) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *Commit_commit_tree) SetUrl(value *string)() { + m.url = value +} +type Commit_commit_treeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_comparison.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_comparison.go new file mode 100644 index 000000000..6b2a9f75f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_comparison.go @@ -0,0 +1,454 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CommitComparison commit Comparison +type CommitComparison struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The ahead_by property + ahead_by *int32 + // Commit + base_commit Commitable + // The behind_by property + behind_by *int32 + // The commits property + commits []Commitable + // The diff_url property + diff_url *string + // The files property + files []DiffEntryable + // The html_url property + html_url *string + // Commit + merge_base_commit Commitable + // The patch_url property + patch_url *string + // The permalink_url property + permalink_url *string + // The status property + status *CommitComparison_status + // The total_commits property + total_commits *int32 + // The url property + url *string +} +// NewCommitComparison instantiates a new CommitComparison and sets the default values. +func NewCommitComparison()(*CommitComparison) { + m := &CommitComparison{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitComparisonFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitComparisonFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitComparison(), 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 *CommitComparison) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAheadBy gets the ahead_by property value. The ahead_by property +// returns a *int32 when successful +func (m *CommitComparison) GetAheadBy()(*int32) { + return m.ahead_by +} +// GetBaseCommit gets the base_commit property value. Commit +// returns a Commitable when successful +func (m *CommitComparison) GetBaseCommit()(Commitable) { + return m.base_commit +} +// GetBehindBy gets the behind_by property value. The behind_by property +// returns a *int32 when successful +func (m *CommitComparison) GetBehindBy()(*int32) { + return m.behind_by +} +// GetCommits gets the commits property value. The commits property +// returns a []Commitable when successful +func (m *CommitComparison) GetCommits()([]Commitable) { + return m.commits +} +// GetDiffUrl gets the diff_url property value. The diff_url property +// returns a *string when successful +func (m *CommitComparison) GetDiffUrl()(*string) { + return m.diff_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CommitComparison) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ahead_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAheadBy(val) + } + return nil + } + res["base_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBaseCommit(val.(Commitable)) + } + return nil + } + res["behind_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetBehindBy(val) + } + return nil + } + res["commits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCommitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Commitable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Commitable) + } + } + m.SetCommits(res) + } + return nil + } + res["diff_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiffUrl(val) + } + return nil + } + res["files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDiffEntryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DiffEntryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DiffEntryable) + } + } + m.SetFiles(res) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["merge_base_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMergeBaseCommit(val.(Commitable)) + } + return nil + } + res["patch_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatchUrl(val) + } + return nil + } + res["permalink_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermalinkUrl(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCommitComparison_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*CommitComparison_status)) + } + return nil + } + res["total_commits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCommits(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFiles gets the files property value. The files property +// returns a []DiffEntryable when successful +func (m *CommitComparison) GetFiles()([]DiffEntryable) { + return m.files +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CommitComparison) GetHtmlUrl()(*string) { + return m.html_url +} +// GetMergeBaseCommit gets the merge_base_commit property value. Commit +// returns a Commitable when successful +func (m *CommitComparison) GetMergeBaseCommit()(Commitable) { + return m.merge_base_commit +} +// GetPatchUrl gets the patch_url property value. The patch_url property +// returns a *string when successful +func (m *CommitComparison) GetPatchUrl()(*string) { + return m.patch_url +} +// GetPermalinkUrl gets the permalink_url property value. The permalink_url property +// returns a *string when successful +func (m *CommitComparison) GetPermalinkUrl()(*string) { + return m.permalink_url +} +// GetStatus gets the status property value. The status property +// returns a *CommitComparison_status when successful +func (m *CommitComparison) GetStatus()(*CommitComparison_status) { + return m.status +} +// GetTotalCommits gets the total_commits property value. The total_commits property +// returns a *int32 when successful +func (m *CommitComparison) GetTotalCommits()(*int32) { + return m.total_commits +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CommitComparison) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CommitComparison) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("ahead_by", m.GetAheadBy()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("base_commit", m.GetBaseCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("behind_by", m.GetBehindBy()) + if err != nil { + return err + } + } + if m.GetCommits() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCommits())) + for i, v := range m.GetCommits() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("commits", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("diff_url", m.GetDiffUrl()) + if err != nil { + return err + } + } + if m.GetFiles() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetFiles())) + for i, v := range m.GetFiles() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("files", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("merge_base_commit", m.GetMergeBaseCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patch_url", m.GetPatchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("permalink_url", m.GetPermalinkUrl()) + if err != nil { + return err + } + } + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err := writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_commits", m.GetTotalCommits()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CommitComparison) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAheadBy sets the ahead_by property value. The ahead_by property +func (m *CommitComparison) SetAheadBy(value *int32)() { + m.ahead_by = value +} +// SetBaseCommit sets the base_commit property value. Commit +func (m *CommitComparison) SetBaseCommit(value Commitable)() { + m.base_commit = value +} +// SetBehindBy sets the behind_by property value. The behind_by property +func (m *CommitComparison) SetBehindBy(value *int32)() { + m.behind_by = value +} +// SetCommits sets the commits property value. The commits property +func (m *CommitComparison) SetCommits(value []Commitable)() { + m.commits = value +} +// SetDiffUrl sets the diff_url property value. The diff_url property +func (m *CommitComparison) SetDiffUrl(value *string)() { + m.diff_url = value +} +// SetFiles sets the files property value. The files property +func (m *CommitComparison) SetFiles(value []DiffEntryable)() { + m.files = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CommitComparison) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetMergeBaseCommit sets the merge_base_commit property value. Commit +func (m *CommitComparison) SetMergeBaseCommit(value Commitable)() { + m.merge_base_commit = value +} +// SetPatchUrl sets the patch_url property value. The patch_url property +func (m *CommitComparison) SetPatchUrl(value *string)() { + m.patch_url = value +} +// SetPermalinkUrl sets the permalink_url property value. The permalink_url property +func (m *CommitComparison) SetPermalinkUrl(value *string)() { + m.permalink_url = value +} +// SetStatus sets the status property value. The status property +func (m *CommitComparison) SetStatus(value *CommitComparison_status)() { + m.status = value +} +// SetTotalCommits sets the total_commits property value. The total_commits property +func (m *CommitComparison) SetTotalCommits(value *int32)() { + m.total_commits = value +} +// SetUrl sets the url property value. The url property +func (m *CommitComparison) SetUrl(value *string)() { + m.url = value +} +type CommitComparisonable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAheadBy()(*int32) + GetBaseCommit()(Commitable) + GetBehindBy()(*int32) + GetCommits()([]Commitable) + GetDiffUrl()(*string) + GetFiles()([]DiffEntryable) + GetHtmlUrl()(*string) + GetMergeBaseCommit()(Commitable) + GetPatchUrl()(*string) + GetPermalinkUrl()(*string) + GetStatus()(*CommitComparison_status) + GetTotalCommits()(*int32) + GetUrl()(*string) + SetAheadBy(value *int32)() + SetBaseCommit(value Commitable)() + SetBehindBy(value *int32)() + SetCommits(value []Commitable)() + SetDiffUrl(value *string)() + SetFiles(value []DiffEntryable)() + SetHtmlUrl(value *string)() + SetMergeBaseCommit(value Commitable)() + SetPatchUrl(value *string)() + SetPermalinkUrl(value *string)() + SetStatus(value *CommitComparison_status)() + SetTotalCommits(value *int32)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_comparison503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_comparison503_error.go new file mode 100644 index 000000000..cd2f8371e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_comparison503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CommitComparison503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewCommitComparison503Error instantiates a new CommitComparison503Error and sets the default values. +func NewCommitComparison503Error()(*CommitComparison503Error) { + m := &CommitComparison503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitComparison503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitComparison503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitComparison503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CommitComparison503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CommitComparison503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CommitComparison503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CommitComparison503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CommitComparison503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *CommitComparison503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CommitComparison503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *CommitComparison503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CommitComparison503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CommitComparison503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CommitComparison503Error) SetMessage(value *string)() { + m.message = value +} +type CommitComparison503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_comparison_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_comparison_status.go new file mode 100644 index 000000000..e67c8e0cb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_comparison_status.go @@ -0,0 +1,42 @@ +package models +import ( + "errors" +) +type CommitComparison_status int + +const ( + DIVERGED_COMMITCOMPARISON_STATUS CommitComparison_status = iota + AHEAD_COMMITCOMPARISON_STATUS + BEHIND_COMMITCOMPARISON_STATUS + IDENTICAL_COMMITCOMPARISON_STATUS +) + +func (i CommitComparison_status) String() string { + return []string{"diverged", "ahead", "behind", "identical"}[i] +} +func ParseCommitComparison_status(v string) (any, error) { + result := DIVERGED_COMMITCOMPARISON_STATUS + switch v { + case "diverged": + result = DIVERGED_COMMITCOMPARISON_STATUS + case "ahead": + result = AHEAD_COMMITCOMPARISON_STATUS + case "behind": + result = BEHIND_COMMITCOMPARISON_STATUS + case "identical": + result = IDENTICAL_COMMITCOMPARISON_STATUS + default: + return 0, errors.New("Unknown CommitComparison_status value: " + v) + } + return &result, nil +} +func SerializeCommitComparison_status(values []CommitComparison_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CommitComparison_status) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_parents.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_parents.go new file mode 100644 index 000000000..5c2fa420d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_parents.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Commit_parents struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html_url property + html_url *string + // The sha property + sha *string + // The url property + url *string +} +// NewCommit_parents instantiates a new Commit_parents and sets the default values. +func NewCommit_parents()(*Commit_parents) { + m := &Commit_parents{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommit_parentsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommit_parentsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommit_parents(), 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 *Commit_parents) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Commit_parents) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Commit_parents) GetHtmlUrl()(*string) { + return m.html_url +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *Commit_parents) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Commit_parents) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Commit_parents) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Commit_parents) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Commit_parents) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetSha sets the sha property value. The sha property +func (m *Commit_parents) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *Commit_parents) SetUrl(value *string)() { + m.url = value +} +type Commit_parentsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetSha()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_search_result_item.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_search_result_item.go new file mode 100644 index 000000000..0838814b7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_search_result_item.go @@ -0,0 +1,424 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CommitSearchResultItem commit Search Result Item +type CommitSearchResultItem struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + author NullableSimpleUserable + // The comments_url property + comments_url *string + // The commit property + commit CommitSearchResultItem_commitable + // Metaproperties for Git author/committer information. + committer NullableGitUserable + // The html_url property + html_url *string + // The node_id property + node_id *string + // The parents property + parents []CommitSearchResultItem_parentsable + // Minimal Repository + repository MinimalRepositoryable + // The score property + score *float64 + // The sha property + sha *string + // The text_matches property + text_matches []Commitsable + // The url property + url *string +} +// NewCommitSearchResultItem instantiates a new CommitSearchResultItem and sets the default values. +func NewCommitSearchResultItem()(*CommitSearchResultItem) { + m := &CommitSearchResultItem{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitSearchResultItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitSearchResultItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitSearchResultItem(), 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 *CommitSearchResultItem) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *CommitSearchResultItem) GetAuthor()(NullableSimpleUserable) { + return m.author +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *CommitSearchResultItem) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommit gets the commit property value. The commit property +// returns a CommitSearchResultItem_commitable when successful +func (m *CommitSearchResultItem) GetCommit()(CommitSearchResultItem_commitable) { + return m.commit +} +// GetCommitter gets the committer property value. Metaproperties for Git author/committer information. +// returns a NullableGitUserable when successful +func (m *CommitSearchResultItem) GetCommitter()(NullableGitUserable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CommitSearchResultItem) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(NullableSimpleUserable)) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommitSearchResultItem_commitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommit(val.(CommitSearchResultItem_commitable)) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableGitUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(NullableGitUserable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["parents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCommitSearchResultItem_parentsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CommitSearchResultItem_parentsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CommitSearchResultItem_parentsable) + } + } + m.SetParents(res) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(MinimalRepositoryable)) + } + return nil + } + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["text_matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCommitsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Commitsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Commitsable) + } + } + m.SetTextMatches(res) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CommitSearchResultItem) GetHtmlUrl()(*string) { + return m.html_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *CommitSearchResultItem) GetNodeId()(*string) { + return m.node_id +} +// GetParents gets the parents property value. The parents property +// returns a []CommitSearchResultItem_parentsable when successful +func (m *CommitSearchResultItem) GetParents()([]CommitSearchResultItem_parentsable) { + return m.parents +} +// GetRepository gets the repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *CommitSearchResultItem) GetRepository()(MinimalRepositoryable) { + return m.repository +} +// GetScore gets the score property value. The score property +// returns a *float64 when successful +func (m *CommitSearchResultItem) GetScore()(*float64) { + return m.score +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *CommitSearchResultItem) GetSha()(*string) { + return m.sha +} +// GetTextMatches gets the text_matches property value. The text_matches property +// returns a []Commitsable when successful +func (m *CommitSearchResultItem) GetTextMatches()([]Commitsable) { + return m.text_matches +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CommitSearchResultItem) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CommitSearchResultItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("commit", m.GetCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetParents() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetParents())) + for i, v := range m.GetParents() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("parents", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("score", m.GetScore()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + if m.GetTextMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTextMatches())) + for i, v := range m.GetTextMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("text_matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CommitSearchResultItem) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. A GitHub user. +func (m *CommitSearchResultItem) SetAuthor(value NullableSimpleUserable)() { + m.author = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *CommitSearchResultItem) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommit sets the commit property value. The commit property +func (m *CommitSearchResultItem) SetCommit(value CommitSearchResultItem_commitable)() { + m.commit = value +} +// SetCommitter sets the committer property value. Metaproperties for Git author/committer information. +func (m *CommitSearchResultItem) SetCommitter(value NullableGitUserable)() { + m.committer = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CommitSearchResultItem) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *CommitSearchResultItem) SetNodeId(value *string)() { + m.node_id = value +} +// SetParents sets the parents property value. The parents property +func (m *CommitSearchResultItem) SetParents(value []CommitSearchResultItem_parentsable)() { + m.parents = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *CommitSearchResultItem) SetRepository(value MinimalRepositoryable)() { + m.repository = value +} +// SetScore sets the score property value. The score property +func (m *CommitSearchResultItem) SetScore(value *float64)() { + m.score = value +} +// SetSha sets the sha property value. The sha property +func (m *CommitSearchResultItem) SetSha(value *string)() { + m.sha = value +} +// SetTextMatches sets the text_matches property value. The text_matches property +func (m *CommitSearchResultItem) SetTextMatches(value []Commitsable)() { + m.text_matches = value +} +// SetUrl sets the url property value. The url property +func (m *CommitSearchResultItem) SetUrl(value *string)() { + m.url = value +} +type CommitSearchResultItemable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(NullableSimpleUserable) + GetCommentsUrl()(*string) + GetCommit()(CommitSearchResultItem_commitable) + GetCommitter()(NullableGitUserable) + GetHtmlUrl()(*string) + GetNodeId()(*string) + GetParents()([]CommitSearchResultItem_parentsable) + GetRepository()(MinimalRepositoryable) + GetScore()(*float64) + GetSha()(*string) + GetTextMatches()([]Commitsable) + GetUrl()(*string) + SetAuthor(value NullableSimpleUserable)() + SetCommentsUrl(value *string)() + SetCommit(value CommitSearchResultItem_commitable)() + SetCommitter(value NullableGitUserable)() + SetHtmlUrl(value *string)() + SetNodeId(value *string)() + SetParents(value []CommitSearchResultItem_parentsable)() + SetRepository(value MinimalRepositoryable)() + SetScore(value *float64)() + SetSha(value *string)() + SetTextMatches(value []Commitsable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_search_result_item_commit.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_search_result_item_commit.go new file mode 100644 index 000000000..d734c2bc1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_search_result_item_commit.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CommitSearchResultItem_commit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The author property + author CommitSearchResultItem_commit_authorable + // The comment_count property + comment_count *int32 + // Metaproperties for Git author/committer information. + committer NullableGitUserable + // The message property + message *string + // The tree property + tree CommitSearchResultItem_commit_treeable + // The url property + url *string + // The verification property + verification Verificationable +} +// NewCommitSearchResultItem_commit instantiates a new CommitSearchResultItem_commit and sets the default values. +func NewCommitSearchResultItem_commit()(*CommitSearchResultItem_commit) { + m := &CommitSearchResultItem_commit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitSearchResultItem_commitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitSearchResultItem_commitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitSearchResultItem_commit(), 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 *CommitSearchResultItem_commit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. The author property +// returns a CommitSearchResultItem_commit_authorable when successful +func (m *CommitSearchResultItem_commit) GetAuthor()(CommitSearchResultItem_commit_authorable) { + return m.author +} +// GetCommentCount gets the comment_count property value. The comment_count property +// returns a *int32 when successful +func (m *CommitSearchResultItem_commit) GetCommentCount()(*int32) { + return m.comment_count +} +// GetCommitter gets the committer property value. Metaproperties for Git author/committer information. +// returns a NullableGitUserable when successful +func (m *CommitSearchResultItem_commit) GetCommitter()(NullableGitUserable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CommitSearchResultItem_commit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommitSearchResultItem_commit_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(CommitSearchResultItem_commit_authorable)) + } + return nil + } + res["comment_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCommentCount(val) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableGitUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(NullableGitUserable)) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommitSearchResultItem_commit_treeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTree(val.(CommitSearchResultItem_commit_treeable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["verification"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateVerificationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerification(val.(Verificationable)) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *CommitSearchResultItem_commit) GetMessage()(*string) { + return m.message +} +// GetTree gets the tree property value. The tree property +// returns a CommitSearchResultItem_commit_treeable when successful +func (m *CommitSearchResultItem_commit) GetTree()(CommitSearchResultItem_commit_treeable) { + return m.tree +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CommitSearchResultItem_commit) GetUrl()(*string) { + return m.url +} +// GetVerification gets the verification property value. The verification property +// returns a Verificationable when successful +func (m *CommitSearchResultItem_commit) GetVerification()(Verificationable) { + return m.verification +} +// Serialize serializes information the current object +func (m *CommitSearchResultItem_commit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("comment_count", m.GetCommentCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tree", m.GetTree()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("verification", m.GetVerification()) + 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 *CommitSearchResultItem_commit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. The author property +func (m *CommitSearchResultItem_commit) SetAuthor(value CommitSearchResultItem_commit_authorable)() { + m.author = value +} +// SetCommentCount sets the comment_count property value. The comment_count property +func (m *CommitSearchResultItem_commit) SetCommentCount(value *int32)() { + m.comment_count = value +} +// SetCommitter sets the committer property value. Metaproperties for Git author/committer information. +func (m *CommitSearchResultItem_commit) SetCommitter(value NullableGitUserable)() { + m.committer = value +} +// SetMessage sets the message property value. The message property +func (m *CommitSearchResultItem_commit) SetMessage(value *string)() { + m.message = value +} +// SetTree sets the tree property value. The tree property +func (m *CommitSearchResultItem_commit) SetTree(value CommitSearchResultItem_commit_treeable)() { + m.tree = value +} +// SetUrl sets the url property value. The url property +func (m *CommitSearchResultItem_commit) SetUrl(value *string)() { + m.url = value +} +// SetVerification sets the verification property value. The verification property +func (m *CommitSearchResultItem_commit) SetVerification(value Verificationable)() { + m.verification = value +} +type CommitSearchResultItem_commitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(CommitSearchResultItem_commit_authorable) + GetCommentCount()(*int32) + GetCommitter()(NullableGitUserable) + GetMessage()(*string) + GetTree()(CommitSearchResultItem_commit_treeable) + GetUrl()(*string) + GetVerification()(Verificationable) + SetAuthor(value CommitSearchResultItem_commit_authorable)() + SetCommentCount(value *int32)() + SetCommitter(value NullableGitUserable)() + SetMessage(value *string)() + SetTree(value CommitSearchResultItem_commit_treeable)() + SetUrl(value *string)() + SetVerification(value Verificationable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_search_result_item_commit_author.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_search_result_item_commit_author.go new file mode 100644 index 000000000..c6ee82276 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_search_result_item_commit_author.go @@ -0,0 +1,139 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CommitSearchResultItem_commit_author struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The date property + date *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The email property + email *string + // The name property + name *string +} +// NewCommitSearchResultItem_commit_author instantiates a new CommitSearchResultItem_commit_author and sets the default values. +func NewCommitSearchResultItem_commit_author()(*CommitSearchResultItem_commit_author) { + m := &CommitSearchResultItem_commit_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitSearchResultItem_commit_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitSearchResultItem_commit_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitSearchResultItem_commit_author(), 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 *CommitSearchResultItem_commit_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. The date property +// returns a *Time when successful +func (m *CommitSearchResultItem_commit_author) GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.date +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *CommitSearchResultItem_commit_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CommitSearchResultItem_commit_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *CommitSearchResultItem_commit_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *CommitSearchResultItem_commit_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *CommitSearchResultItem_commit_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. The date property +func (m *CommitSearchResultItem_commit_author) SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.date = value +} +// SetEmail sets the email property value. The email property +func (m *CommitSearchResultItem_commit_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name property +func (m *CommitSearchResultItem_commit_author) SetName(value *string)() { + m.name = value +} +type CommitSearchResultItem_commit_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetName()(*string) + SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_search_result_item_commit_tree.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_search_result_item_commit_tree.go new file mode 100644 index 000000000..4291d57d0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_search_result_item_commit_tree.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CommitSearchResultItem_commit_tree struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The sha property + sha *string + // The url property + url *string +} +// NewCommitSearchResultItem_commit_tree instantiates a new CommitSearchResultItem_commit_tree and sets the default values. +func NewCommitSearchResultItem_commit_tree()(*CommitSearchResultItem_commit_tree) { + m := &CommitSearchResultItem_commit_tree{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitSearchResultItem_commit_treeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitSearchResultItem_commit_treeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitSearchResultItem_commit_tree(), 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 *CommitSearchResultItem_commit_tree) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CommitSearchResultItem_commit_tree) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *CommitSearchResultItem_commit_tree) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CommitSearchResultItem_commit_tree) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CommitSearchResultItem_commit_tree) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CommitSearchResultItem_commit_tree) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *CommitSearchResultItem_commit_tree) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *CommitSearchResultItem_commit_tree) SetUrl(value *string)() { + m.url = value +} +type CommitSearchResultItem_commit_treeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_search_result_item_parents.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_search_result_item_parents.go new file mode 100644 index 000000000..f323c79e8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_search_result_item_parents.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CommitSearchResultItem_parents struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html_url property + html_url *string + // The sha property + sha *string + // The url property + url *string +} +// NewCommitSearchResultItem_parents instantiates a new CommitSearchResultItem_parents and sets the default values. +func NewCommitSearchResultItem_parents()(*CommitSearchResultItem_parents) { + m := &CommitSearchResultItem_parents{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitSearchResultItem_parentsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitSearchResultItem_parentsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitSearchResultItem_parents(), 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 *CommitSearchResultItem_parents) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CommitSearchResultItem_parents) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CommitSearchResultItem_parents) GetHtmlUrl()(*string) { + return m.html_url +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *CommitSearchResultItem_parents) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CommitSearchResultItem_parents) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CommitSearchResultItem_parents) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CommitSearchResultItem_parents) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CommitSearchResultItem_parents) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetSha sets the sha property value. The sha property +func (m *CommitSearchResultItem_parents) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *CommitSearchResultItem_parents) SetUrl(value *string)() { + m.url = value +} +type CommitSearchResultItem_parentsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetSha()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_stats.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_stats.go new file mode 100644 index 000000000..2105df61a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commit_stats.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Commit_stats struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The additions property + additions *int32 + // The deletions property + deletions *int32 + // The total property + total *int32 +} +// NewCommit_stats instantiates a new Commit_stats and sets the default values. +func NewCommit_stats()(*Commit_stats) { + m := &Commit_stats{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommit_statsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommit_statsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommit_stats(), 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 *Commit_stats) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdditions gets the additions property value. The additions property +// returns a *int32 when successful +func (m *Commit_stats) GetAdditions()(*int32) { + return m.additions +} +// GetDeletions gets the deletions property value. The deletions property +// returns a *int32 when successful +func (m *Commit_stats) GetDeletions()(*int32) { + return m.deletions +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Commit_stats) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["additions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAdditions(val) + } + return nil + } + res["deletions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDeletions(val) + } + return nil + } + res["total"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotal(val) + } + return nil + } + return res +} +// GetTotal gets the total property value. The total property +// returns a *int32 when successful +func (m *Commit_stats) GetTotal()(*int32) { + return m.total +} +// Serialize serializes information the current object +func (m *Commit_stats) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("additions", m.GetAdditions()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("deletions", m.GetDeletions()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total", m.GetTotal()) + 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 *Commit_stats) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdditions sets the additions property value. The additions property +func (m *Commit_stats) SetAdditions(value *int32)() { + m.additions = value +} +// SetDeletions sets the deletions property value. The deletions property +func (m *Commit_stats) SetDeletions(value *int32)() { + m.deletions = value +} +// SetTotal sets the total property value. The total property +func (m *Commit_stats) SetTotal(value *int32)() { + m.total = value +} +type Commit_statsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdditions()(*int32) + GetDeletions()(*int32) + GetTotal()(*int32) + SetAdditions(value *int32)() + SetDeletions(value *int32)() + SetTotal(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commits.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commits.go new file mode 100644 index 000000000..9cf7039cc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commits.go @@ -0,0 +1,208 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Commits struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The fragment property + fragment *string + // The matches property + matches []Commits_matchesable + // The object_type property + object_type *string + // The object_url property + object_url *string + // The property property + property *string +} +// NewCommits instantiates a new Commits and sets the default values. +func NewCommits()(*Commits) { + m := &Commits{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommits(), 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 *Commits) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Commits) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["fragment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFragment(val) + } + return nil + } + res["matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCommits_matchesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Commits_matchesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Commits_matchesable) + } + } + m.SetMatches(res) + } + return nil + } + res["object_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectType(val) + } + return nil + } + res["object_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectUrl(val) + } + return nil + } + res["property"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProperty(val) + } + return nil + } + return res +} +// GetFragment gets the fragment property value. The fragment property +// returns a *string when successful +func (m *Commits) GetFragment()(*string) { + return m.fragment +} +// GetMatches gets the matches property value. The matches property +// returns a []Commits_matchesable when successful +func (m *Commits) GetMatches()([]Commits_matchesable) { + return m.matches +} +// GetObjectType gets the object_type property value. The object_type property +// returns a *string when successful +func (m *Commits) GetObjectType()(*string) { + return m.object_type +} +// GetObjectUrl gets the object_url property value. The object_url property +// returns a *string when successful +func (m *Commits) GetObjectUrl()(*string) { + return m.object_url +} +// GetProperty gets the property property value. The property property +// returns a *string when successful +func (m *Commits) GetProperty()(*string) { + return m.property +} +// Serialize serializes information the current object +func (m *Commits) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("fragment", m.GetFragment()) + if err != nil { + return err + } + } + if m.GetMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMatches())) + for i, v := range m.GetMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_type", m.GetObjectType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_url", m.GetObjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("property", m.GetProperty()) + 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 *Commits) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFragment sets the fragment property value. The fragment property +func (m *Commits) SetFragment(value *string)() { + m.fragment = value +} +// SetMatches sets the matches property value. The matches property +func (m *Commits) SetMatches(value []Commits_matchesable)() { + m.matches = value +} +// SetObjectType sets the object_type property value. The object_type property +func (m *Commits) SetObjectType(value *string)() { + m.object_type = value +} +// SetObjectUrl sets the object_url property value. The object_url property +func (m *Commits) SetObjectUrl(value *string)() { + m.object_url = value +} +// SetProperty sets the property property value. The property property +func (m *Commits) SetProperty(value *string)() { + m.property = value +} +type Commitsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFragment()(*string) + GetMatches()([]Commits_matchesable) + GetObjectType()(*string) + GetObjectUrl()(*string) + GetProperty()(*string) + SetFragment(value *string)() + SetMatches(value []Commits_matchesable)() + SetObjectType(value *string)() + SetObjectUrl(value *string)() + SetProperty(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/commits_matches.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/commits_matches.go new file mode 100644 index 000000000..95e3a8da0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/commits_matches.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Commits_matches struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The indices property + indices []int32 + // The text property + text *string +} +// NewCommits_matches instantiates a new Commits_matches and sets the default values. +func NewCommits_matches()(*Commits_matches) { + m := &Commits_matches{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommits_matchesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommits_matchesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommits_matches(), 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 *Commits_matches) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Commits_matches) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["indices"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetIndices(res) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetIndices gets the indices property value. The indices property +// returns a []int32 when successful +func (m *Commits_matches) GetIndices()([]int32) { + return m.indices +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *Commits_matches) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *Commits_matches) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIndices() != nil { + err := writer.WriteCollectionOfInt32Values("indices", m.GetIndices()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + 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 *Commits_matches) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIndices sets the indices property value. The indices property +func (m *Commits_matches) SetIndices(value []int32)() { + m.indices = value +} +// SetText sets the text property value. The text property +func (m *Commits_matches) SetText(value *string)() { + m.text = value +} +type Commits_matchesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIndices()([]int32) + GetText()(*string) + SetIndices(value []int32)() + SetText(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/community_profile.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/community_profile.go new file mode 100644 index 000000000..001005979 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/community_profile.go @@ -0,0 +1,227 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CommunityProfile community Profile +type CommunityProfile struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The content_reports_enabled property + content_reports_enabled *bool + // The description property + description *string + // The documentation property + documentation *string + // The files property + files CommunityProfile_filesable + // The health_percentage property + health_percentage *int32 + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewCommunityProfile instantiates a new CommunityProfile and sets the default values. +func NewCommunityProfile()(*CommunityProfile) { + m := &CommunityProfile{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommunityProfileFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommunityProfileFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommunityProfile(), 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 *CommunityProfile) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentReportsEnabled gets the content_reports_enabled property value. The content_reports_enabled property +// returns a *bool when successful +func (m *CommunityProfile) GetContentReportsEnabled()(*bool) { + return m.content_reports_enabled +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *CommunityProfile) GetDescription()(*string) { + return m.description +} +// GetDocumentation gets the documentation property value. The documentation property +// returns a *string when successful +func (m *CommunityProfile) GetDocumentation()(*string) { + return m.documentation +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CommunityProfile) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_reports_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetContentReportsEnabled(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["documentation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentation(val) + } + return nil + } + res["files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommunityProfile_filesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetFiles(val.(CommunityProfile_filesable)) + } + return nil + } + res["health_percentage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetHealthPercentage(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetFiles gets the files property value. The files property +// returns a CommunityProfile_filesable when successful +func (m *CommunityProfile) GetFiles()(CommunityProfile_filesable) { + return m.files +} +// GetHealthPercentage gets the health_percentage property value. The health_percentage property +// returns a *int32 when successful +func (m *CommunityProfile) GetHealthPercentage()(*int32) { + return m.health_percentage +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *CommunityProfile) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *CommunityProfile) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("content_reports_enabled", m.GetContentReportsEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation", m.GetDocumentation()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("files", m.GetFiles()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("health_percentage", m.GetHealthPercentage()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + 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 *CommunityProfile) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentReportsEnabled sets the content_reports_enabled property value. The content_reports_enabled property +func (m *CommunityProfile) SetContentReportsEnabled(value *bool)() { + m.content_reports_enabled = value +} +// SetDescription sets the description property value. The description property +func (m *CommunityProfile) SetDescription(value *string)() { + m.description = value +} +// SetDocumentation sets the documentation property value. The documentation property +func (m *CommunityProfile) SetDocumentation(value *string)() { + m.documentation = value +} +// SetFiles sets the files property value. The files property +func (m *CommunityProfile) SetFiles(value CommunityProfile_filesable)() { + m.files = value +} +// SetHealthPercentage sets the health_percentage property value. The health_percentage property +func (m *CommunityProfile) SetHealthPercentage(value *int32)() { + m.health_percentage = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *CommunityProfile) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type CommunityProfileable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentReportsEnabled()(*bool) + GetDescription()(*string) + GetDocumentation()(*string) + GetFiles()(CommunityProfile_filesable) + GetHealthPercentage()(*int32) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetContentReportsEnabled(value *bool)() + SetDescription(value *string)() + SetDocumentation(value *string)() + SetFiles(value CommunityProfile_filesable)() + SetHealthPercentage(value *int32)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/community_profile_files.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/community_profile_files.go new file mode 100644 index 000000000..ddd527d3e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/community_profile_files.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CommunityProfile_files struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Code of Conduct Simple + code_of_conduct NullableCodeOfConductSimpleable + // The code_of_conduct_file property + code_of_conduct_file NullableCommunityHealthFileable + // The contributing property + contributing NullableCommunityHealthFileable + // The issue_template property + issue_template NullableCommunityHealthFileable + // License Simple + license NullableLicenseSimpleable + // The pull_request_template property + pull_request_template NullableCommunityHealthFileable + // The readme property + readme NullableCommunityHealthFileable +} +// NewCommunityProfile_files instantiates a new CommunityProfile_files and sets the default values. +func NewCommunityProfile_files()(*CommunityProfile_files) { + m := &CommunityProfile_files{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommunityProfile_filesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommunityProfile_filesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommunityProfile_files(), 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 *CommunityProfile_files) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCodeOfConduct gets the code_of_conduct property value. Code of Conduct Simple +// returns a NullableCodeOfConductSimpleable when successful +func (m *CommunityProfile_files) GetCodeOfConduct()(NullableCodeOfConductSimpleable) { + return m.code_of_conduct +} +// GetCodeOfConductFile gets the code_of_conduct_file property value. The code_of_conduct_file property +// returns a NullableCommunityHealthFileable when successful +func (m *CommunityProfile_files) GetCodeOfConductFile()(NullableCommunityHealthFileable) { + return m.code_of_conduct_file +} +// GetContributing gets the contributing property value. The contributing property +// returns a NullableCommunityHealthFileable when successful +func (m *CommunityProfile_files) GetContributing()(NullableCommunityHealthFileable) { + return m.contributing +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CommunityProfile_files) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code_of_conduct"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableCodeOfConductSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCodeOfConduct(val.(NullableCodeOfConductSimpleable)) + } + return nil + } + res["code_of_conduct_file"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableCommunityHealthFileFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCodeOfConductFile(val.(NullableCommunityHealthFileable)) + } + return nil + } + res["contributing"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableCommunityHealthFileFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetContributing(val.(NullableCommunityHealthFileable)) + } + return nil + } + res["issue_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableCommunityHealthFileFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIssueTemplate(val.(NullableCommunityHealthFileable)) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableLicenseSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(NullableLicenseSimpleable)) + } + return nil + } + res["pull_request_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableCommunityHealthFileFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPullRequestTemplate(val.(NullableCommunityHealthFileable)) + } + return nil + } + res["readme"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableCommunityHealthFileFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReadme(val.(NullableCommunityHealthFileable)) + } + return nil + } + return res +} +// GetIssueTemplate gets the issue_template property value. The issue_template property +// returns a NullableCommunityHealthFileable when successful +func (m *CommunityProfile_files) GetIssueTemplate()(NullableCommunityHealthFileable) { + return m.issue_template +} +// GetLicense gets the license property value. License Simple +// returns a NullableLicenseSimpleable when successful +func (m *CommunityProfile_files) GetLicense()(NullableLicenseSimpleable) { + return m.license +} +// GetPullRequestTemplate gets the pull_request_template property value. The pull_request_template property +// returns a NullableCommunityHealthFileable when successful +func (m *CommunityProfile_files) GetPullRequestTemplate()(NullableCommunityHealthFileable) { + return m.pull_request_template +} +// GetReadme gets the readme property value. The readme property +// returns a NullableCommunityHealthFileable when successful +func (m *CommunityProfile_files) GetReadme()(NullableCommunityHealthFileable) { + return m.readme +} +// Serialize serializes information the current object +func (m *CommunityProfile_files) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("code_of_conduct", m.GetCodeOfConduct()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("code_of_conduct_file", m.GetCodeOfConductFile()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("contributing", m.GetContributing()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("issue_template", m.GetIssueTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pull_request_template", m.GetPullRequestTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("readme", m.GetReadme()) + 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 *CommunityProfile_files) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCodeOfConduct sets the code_of_conduct property value. Code of Conduct Simple +func (m *CommunityProfile_files) SetCodeOfConduct(value NullableCodeOfConductSimpleable)() { + m.code_of_conduct = value +} +// SetCodeOfConductFile sets the code_of_conduct_file property value. The code_of_conduct_file property +func (m *CommunityProfile_files) SetCodeOfConductFile(value NullableCommunityHealthFileable)() { + m.code_of_conduct_file = value +} +// SetContributing sets the contributing property value. The contributing property +func (m *CommunityProfile_files) SetContributing(value NullableCommunityHealthFileable)() { + m.contributing = value +} +// SetIssueTemplate sets the issue_template property value. The issue_template property +func (m *CommunityProfile_files) SetIssueTemplate(value NullableCommunityHealthFileable)() { + m.issue_template = value +} +// SetLicense sets the license property value. License Simple +func (m *CommunityProfile_files) SetLicense(value NullableLicenseSimpleable)() { + m.license = value +} +// SetPullRequestTemplate sets the pull_request_template property value. The pull_request_template property +func (m *CommunityProfile_files) SetPullRequestTemplate(value NullableCommunityHealthFileable)() { + m.pull_request_template = value +} +// SetReadme sets the readme property value. The readme property +func (m *CommunityProfile_files) SetReadme(value NullableCommunityHealthFileable)() { + m.readme = value +} +type CommunityProfile_filesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCodeOfConduct()(NullableCodeOfConductSimpleable) + GetCodeOfConductFile()(NullableCommunityHealthFileable) + GetContributing()(NullableCommunityHealthFileable) + GetIssueTemplate()(NullableCommunityHealthFileable) + GetLicense()(NullableLicenseSimpleable) + GetPullRequestTemplate()(NullableCommunityHealthFileable) + GetReadme()(NullableCommunityHealthFileable) + SetCodeOfConduct(value NullableCodeOfConductSimpleable)() + SetCodeOfConductFile(value NullableCommunityHealthFileable)() + SetContributing(value NullableCommunityHealthFileable)() + SetIssueTemplate(value NullableCommunityHealthFileable)() + SetLicense(value NullableLicenseSimpleable)() + SetPullRequestTemplate(value NullableCommunityHealthFileable)() + SetReadme(value NullableCommunityHealthFileable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/content_file.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_file.go new file mode 100644 index 000000000..9a690433d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_file.go @@ -0,0 +1,459 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ContentFile content File +type ContentFile struct { + // The _links property + _links ContentFile__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The content property + content *string + // The download_url property + download_url *string + // The encoding property + encoding *string + // The git_url property + git_url *string + // The html_url property + html_url *string + // The name property + name *string + // The path property + path *string + // The sha property + sha *string + // The size property + size *int32 + // The submodule_git_url property + submodule_git_url *string + // The target property + target *string + // The type property + typeEscaped *ContentFile_type + // The url property + url *string +} +// NewContentFile instantiates a new ContentFile and sets the default values. +func NewContentFile()(*ContentFile) { + m := &ContentFile{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContentFileFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentFileFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentFile(), 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 *ContentFile) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContent gets the content property value. The content property +// returns a *string when successful +func (m *ContentFile) GetContent()(*string) { + return m.content +} +// GetDownloadUrl gets the download_url property value. The download_url property +// returns a *string when successful +func (m *ContentFile) GetDownloadUrl()(*string) { + return m.download_url +} +// GetEncoding gets the encoding property value. The encoding property +// returns a *string when successful +func (m *ContentFile) GetEncoding()(*string) { + return m.encoding +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContentFile) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateContentFile__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(ContentFile__linksable)) + } + return nil + } + res["content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContent(val) + } + return nil + } + res["download_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadUrl(val) + } + return nil + } + res["encoding"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncoding(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["submodule_git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubmoduleGitUrl(val) + } + return nil + } + res["target"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTarget(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseContentFile_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*ContentFile_type)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *ContentFile) GetGitUrl()(*string) { + return m.git_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *ContentFile) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLinks gets the _links property value. The _links property +// returns a ContentFile__linksable when successful +func (m *ContentFile) GetLinks()(ContentFile__linksable) { + return m._links +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *ContentFile) GetName()(*string) { + return m.name +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *ContentFile) GetPath()(*string) { + return m.path +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *ContentFile) GetSha()(*string) { + return m.sha +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *ContentFile) GetSize()(*int32) { + return m.size +} +// GetSubmoduleGitUrl gets the submodule_git_url property value. The submodule_git_url property +// returns a *string when successful +func (m *ContentFile) GetSubmoduleGitUrl()(*string) { + return m.submodule_git_url +} +// GetTarget gets the target property value. The target property +// returns a *string when successful +func (m *ContentFile) GetTarget()(*string) { + return m.target +} +// GetTypeEscaped gets the type property value. The type property +// returns a *ContentFile_type when successful +func (m *ContentFile) GetTypeEscaped()(*ContentFile_type) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ContentFile) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ContentFile) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content", m.GetContent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("download_url", m.GetDownloadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("encoding", m.GetEncoding()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("submodule_git_url", m.GetSubmoduleGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target", m.GetTarget()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *ContentFile) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContent sets the content property value. The content property +func (m *ContentFile) SetContent(value *string)() { + m.content = value +} +// SetDownloadUrl sets the download_url property value. The download_url property +func (m *ContentFile) SetDownloadUrl(value *string)() { + m.download_url = value +} +// SetEncoding sets the encoding property value. The encoding property +func (m *ContentFile) SetEncoding(value *string)() { + m.encoding = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *ContentFile) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *ContentFile) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLinks sets the _links property value. The _links property +func (m *ContentFile) SetLinks(value ContentFile__linksable)() { + m._links = value +} +// SetName sets the name property value. The name property +func (m *ContentFile) SetName(value *string)() { + m.name = value +} +// SetPath sets the path property value. The path property +func (m *ContentFile) SetPath(value *string)() { + m.path = value +} +// SetSha sets the sha property value. The sha property +func (m *ContentFile) SetSha(value *string)() { + m.sha = value +} +// SetSize sets the size property value. The size property +func (m *ContentFile) SetSize(value *int32)() { + m.size = value +} +// SetSubmoduleGitUrl sets the submodule_git_url property value. The submodule_git_url property +func (m *ContentFile) SetSubmoduleGitUrl(value *string)() { + m.submodule_git_url = value +} +// SetTarget sets the target property value. The target property +func (m *ContentFile) SetTarget(value *string)() { + m.target = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *ContentFile) SetTypeEscaped(value *ContentFile_type)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *ContentFile) SetUrl(value *string)() { + m.url = value +} +type ContentFileable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContent()(*string) + GetDownloadUrl()(*string) + GetEncoding()(*string) + GetGitUrl()(*string) + GetHtmlUrl()(*string) + GetLinks()(ContentFile__linksable) + GetName()(*string) + GetPath()(*string) + GetSha()(*string) + GetSize()(*int32) + GetSubmoduleGitUrl()(*string) + GetTarget()(*string) + GetTypeEscaped()(*ContentFile_type) + GetUrl()(*string) + SetContent(value *string)() + SetDownloadUrl(value *string)() + SetEncoding(value *string)() + SetGitUrl(value *string)() + SetHtmlUrl(value *string)() + SetLinks(value ContentFile__linksable)() + SetName(value *string)() + SetPath(value *string)() + SetSha(value *string)() + SetSize(value *int32)() + SetSubmoduleGitUrl(value *string)() + SetTarget(value *string)() + SetTypeEscaped(value *ContentFile_type)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/content_file__links.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_file__links.go new file mode 100644 index 000000000..bb77d374e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_file__links.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ContentFile__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The git property + git *string + // The html property + html *string + // The self property + self *string +} +// NewContentFile__links instantiates a new ContentFile__links and sets the default values. +func NewContentFile__links()(*ContentFile__links) { + m := &ContentFile__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContentFile__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentFile__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentFile__links(), 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 *ContentFile__links) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContentFile__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["git"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGit(val) + } + return nil + } + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtml(val) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelf(val) + } + return nil + } + return res +} +// GetGit gets the git property value. The git property +// returns a *string when successful +func (m *ContentFile__links) GetGit()(*string) { + return m.git +} +// GetHtml gets the html property value. The html property +// returns a *string when successful +func (m *ContentFile__links) GetHtml()(*string) { + return m.html +} +// GetSelf gets the self property value. The self property +// returns a *string when successful +func (m *ContentFile__links) GetSelf()(*string) { + return m.self +} +// Serialize serializes information the current object +func (m *ContentFile__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("git", m.GetGit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("self", m.GetSelf()) + 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 *ContentFile__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGit sets the git property value. The git property +func (m *ContentFile__links) SetGit(value *string)() { + m.git = value +} +// SetHtml sets the html property value. The html property +func (m *ContentFile__links) SetHtml(value *string)() { + m.html = value +} +// SetSelf sets the self property value. The self property +func (m *ContentFile__links) SetSelf(value *string)() { + m.self = value +} +type ContentFile__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGit()(*string) + GetHtml()(*string) + GetSelf()(*string) + SetGit(value *string)() + SetHtml(value *string)() + SetSelf(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/content_file_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_file_type.go new file mode 100644 index 000000000..2d0669186 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_file_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type ContentFile_type int + +const ( + FILE_CONTENTFILE_TYPE ContentFile_type = iota +) + +func (i ContentFile_type) String() string { + return []string{"file"}[i] +} +func ParseContentFile_type(v string) (any, error) { + result := FILE_CONTENTFILE_TYPE + switch v { + case "file": + result = FILE_CONTENTFILE_TYPE + default: + return 0, errors.New("Unknown ContentFile_type value: " + v) + } + return &result, nil +} +func SerializeContentFile_type(values []ContentFile_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ContentFile_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/content_submodule.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_submodule.go new file mode 100644 index 000000000..cb1054189 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_submodule.go @@ -0,0 +1,372 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ContentSubmodule an object describing a submodule +type ContentSubmodule struct { + // The _links property + _links ContentSubmodule__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The download_url property + download_url *string + // The git_url property + git_url *string + // The html_url property + html_url *string + // The name property + name *string + // The path property + path *string + // The sha property + sha *string + // The size property + size *int32 + // The submodule_git_url property + submodule_git_url *string + // The type property + typeEscaped *ContentSubmodule_type + // The url property + url *string +} +// NewContentSubmodule instantiates a new ContentSubmodule and sets the default values. +func NewContentSubmodule()(*ContentSubmodule) { + m := &ContentSubmodule{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContentSubmoduleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentSubmoduleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentSubmodule(), 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 *ContentSubmodule) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDownloadUrl gets the download_url property value. The download_url property +// returns a *string when successful +func (m *ContentSubmodule) GetDownloadUrl()(*string) { + return m.download_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContentSubmodule) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateContentSubmodule__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(ContentSubmodule__linksable)) + } + return nil + } + res["download_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["submodule_git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubmoduleGitUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseContentSubmodule_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*ContentSubmodule_type)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *ContentSubmodule) GetGitUrl()(*string) { + return m.git_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *ContentSubmodule) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLinks gets the _links property value. The _links property +// returns a ContentSubmodule__linksable when successful +func (m *ContentSubmodule) GetLinks()(ContentSubmodule__linksable) { + return m._links +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *ContentSubmodule) GetName()(*string) { + return m.name +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *ContentSubmodule) GetPath()(*string) { + return m.path +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *ContentSubmodule) GetSha()(*string) { + return m.sha +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *ContentSubmodule) GetSize()(*int32) { + return m.size +} +// GetSubmoduleGitUrl gets the submodule_git_url property value. The submodule_git_url property +// returns a *string when successful +func (m *ContentSubmodule) GetSubmoduleGitUrl()(*string) { + return m.submodule_git_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *ContentSubmodule_type when successful +func (m *ContentSubmodule) GetTypeEscaped()(*ContentSubmodule_type) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ContentSubmodule) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ContentSubmodule) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("download_url", m.GetDownloadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("submodule_git_url", m.GetSubmoduleGitUrl()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *ContentSubmodule) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDownloadUrl sets the download_url property value. The download_url property +func (m *ContentSubmodule) SetDownloadUrl(value *string)() { + m.download_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *ContentSubmodule) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *ContentSubmodule) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLinks sets the _links property value. The _links property +func (m *ContentSubmodule) SetLinks(value ContentSubmodule__linksable)() { + m._links = value +} +// SetName sets the name property value. The name property +func (m *ContentSubmodule) SetName(value *string)() { + m.name = value +} +// SetPath sets the path property value. The path property +func (m *ContentSubmodule) SetPath(value *string)() { + m.path = value +} +// SetSha sets the sha property value. The sha property +func (m *ContentSubmodule) SetSha(value *string)() { + m.sha = value +} +// SetSize sets the size property value. The size property +func (m *ContentSubmodule) SetSize(value *int32)() { + m.size = value +} +// SetSubmoduleGitUrl sets the submodule_git_url property value. The submodule_git_url property +func (m *ContentSubmodule) SetSubmoduleGitUrl(value *string)() { + m.submodule_git_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *ContentSubmodule) SetTypeEscaped(value *ContentSubmodule_type)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *ContentSubmodule) SetUrl(value *string)() { + m.url = value +} +type ContentSubmoduleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDownloadUrl()(*string) + GetGitUrl()(*string) + GetHtmlUrl()(*string) + GetLinks()(ContentSubmodule__linksable) + GetName()(*string) + GetPath()(*string) + GetSha()(*string) + GetSize()(*int32) + GetSubmoduleGitUrl()(*string) + GetTypeEscaped()(*ContentSubmodule_type) + GetUrl()(*string) + SetDownloadUrl(value *string)() + SetGitUrl(value *string)() + SetHtmlUrl(value *string)() + SetLinks(value ContentSubmodule__linksable)() + SetName(value *string)() + SetPath(value *string)() + SetSha(value *string)() + SetSize(value *int32)() + SetSubmoduleGitUrl(value *string)() + SetTypeEscaped(value *ContentSubmodule_type)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/content_submodule__links.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_submodule__links.go new file mode 100644 index 000000000..bc48d47b4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_submodule__links.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ContentSubmodule__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The git property + git *string + // The html property + html *string + // The self property + self *string +} +// NewContentSubmodule__links instantiates a new ContentSubmodule__links and sets the default values. +func NewContentSubmodule__links()(*ContentSubmodule__links) { + m := &ContentSubmodule__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContentSubmodule__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentSubmodule__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentSubmodule__links(), 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 *ContentSubmodule__links) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContentSubmodule__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["git"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGit(val) + } + return nil + } + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtml(val) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelf(val) + } + return nil + } + return res +} +// GetGit gets the git property value. The git property +// returns a *string when successful +func (m *ContentSubmodule__links) GetGit()(*string) { + return m.git +} +// GetHtml gets the html property value. The html property +// returns a *string when successful +func (m *ContentSubmodule__links) GetHtml()(*string) { + return m.html +} +// GetSelf gets the self property value. The self property +// returns a *string when successful +func (m *ContentSubmodule__links) GetSelf()(*string) { + return m.self +} +// Serialize serializes information the current object +func (m *ContentSubmodule__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("git", m.GetGit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("self", m.GetSelf()) + 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 *ContentSubmodule__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGit sets the git property value. The git property +func (m *ContentSubmodule__links) SetGit(value *string)() { + m.git = value +} +// SetHtml sets the html property value. The html property +func (m *ContentSubmodule__links) SetHtml(value *string)() { + m.html = value +} +// SetSelf sets the self property value. The self property +func (m *ContentSubmodule__links) SetSelf(value *string)() { + m.self = value +} +type ContentSubmodule__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGit()(*string) + GetHtml()(*string) + GetSelf()(*string) + SetGit(value *string)() + SetHtml(value *string)() + SetSelf(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/content_submodule_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_submodule_type.go new file mode 100644 index 000000000..9e8ce3c31 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_submodule_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type ContentSubmodule_type int + +const ( + SUBMODULE_CONTENTSUBMODULE_TYPE ContentSubmodule_type = iota +) + +func (i ContentSubmodule_type) String() string { + return []string{"submodule"}[i] +} +func ParseContentSubmodule_type(v string) (any, error) { + result := SUBMODULE_CONTENTSUBMODULE_TYPE + switch v { + case "submodule": + result = SUBMODULE_CONTENTSUBMODULE_TYPE + default: + return 0, errors.New("Unknown ContentSubmodule_type value: " + v) + } + return &result, nil +} +func SerializeContentSubmodule_type(values []ContentSubmodule_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ContentSubmodule_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/content_symlink.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_symlink.go new file mode 100644 index 000000000..48d3c210d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_symlink.go @@ -0,0 +1,372 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ContentSymlink an object describing a symlink +type ContentSymlink struct { + // The _links property + _links ContentSymlink__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The download_url property + download_url *string + // The git_url property + git_url *string + // The html_url property + html_url *string + // The name property + name *string + // The path property + path *string + // The sha property + sha *string + // The size property + size *int32 + // The target property + target *string + // The type property + typeEscaped *ContentSymlink_type + // The url property + url *string +} +// NewContentSymlink instantiates a new ContentSymlink and sets the default values. +func NewContentSymlink()(*ContentSymlink) { + m := &ContentSymlink{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContentSymlinkFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentSymlinkFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentSymlink(), 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 *ContentSymlink) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDownloadUrl gets the download_url property value. The download_url property +// returns a *string when successful +func (m *ContentSymlink) GetDownloadUrl()(*string) { + return m.download_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContentSymlink) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateContentSymlink__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(ContentSymlink__linksable)) + } + return nil + } + res["download_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["target"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTarget(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseContentSymlink_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*ContentSymlink_type)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *ContentSymlink) GetGitUrl()(*string) { + return m.git_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *ContentSymlink) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLinks gets the _links property value. The _links property +// returns a ContentSymlink__linksable when successful +func (m *ContentSymlink) GetLinks()(ContentSymlink__linksable) { + return m._links +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *ContentSymlink) GetName()(*string) { + return m.name +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *ContentSymlink) GetPath()(*string) { + return m.path +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *ContentSymlink) GetSha()(*string) { + return m.sha +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *ContentSymlink) GetSize()(*int32) { + return m.size +} +// GetTarget gets the target property value. The target property +// returns a *string when successful +func (m *ContentSymlink) GetTarget()(*string) { + return m.target +} +// GetTypeEscaped gets the type property value. The type property +// returns a *ContentSymlink_type when successful +func (m *ContentSymlink) GetTypeEscaped()(*ContentSymlink_type) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ContentSymlink) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ContentSymlink) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("download_url", m.GetDownloadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target", m.GetTarget()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *ContentSymlink) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDownloadUrl sets the download_url property value. The download_url property +func (m *ContentSymlink) SetDownloadUrl(value *string)() { + m.download_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *ContentSymlink) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *ContentSymlink) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLinks sets the _links property value. The _links property +func (m *ContentSymlink) SetLinks(value ContentSymlink__linksable)() { + m._links = value +} +// SetName sets the name property value. The name property +func (m *ContentSymlink) SetName(value *string)() { + m.name = value +} +// SetPath sets the path property value. The path property +func (m *ContentSymlink) SetPath(value *string)() { + m.path = value +} +// SetSha sets the sha property value. The sha property +func (m *ContentSymlink) SetSha(value *string)() { + m.sha = value +} +// SetSize sets the size property value. The size property +func (m *ContentSymlink) SetSize(value *int32)() { + m.size = value +} +// SetTarget sets the target property value. The target property +func (m *ContentSymlink) SetTarget(value *string)() { + m.target = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *ContentSymlink) SetTypeEscaped(value *ContentSymlink_type)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *ContentSymlink) SetUrl(value *string)() { + m.url = value +} +type ContentSymlinkable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDownloadUrl()(*string) + GetGitUrl()(*string) + GetHtmlUrl()(*string) + GetLinks()(ContentSymlink__linksable) + GetName()(*string) + GetPath()(*string) + GetSha()(*string) + GetSize()(*int32) + GetTarget()(*string) + GetTypeEscaped()(*ContentSymlink_type) + GetUrl()(*string) + SetDownloadUrl(value *string)() + SetGitUrl(value *string)() + SetHtmlUrl(value *string)() + SetLinks(value ContentSymlink__linksable)() + SetName(value *string)() + SetPath(value *string)() + SetSha(value *string)() + SetSize(value *int32)() + SetTarget(value *string)() + SetTypeEscaped(value *ContentSymlink_type)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/content_symlink__links.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_symlink__links.go new file mode 100644 index 000000000..14f012f05 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_symlink__links.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ContentSymlink__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The git property + git *string + // The html property + html *string + // The self property + self *string +} +// NewContentSymlink__links instantiates a new ContentSymlink__links and sets the default values. +func NewContentSymlink__links()(*ContentSymlink__links) { + m := &ContentSymlink__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContentSymlink__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentSymlink__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentSymlink__links(), 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 *ContentSymlink__links) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContentSymlink__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["git"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGit(val) + } + return nil + } + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtml(val) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelf(val) + } + return nil + } + return res +} +// GetGit gets the git property value. The git property +// returns a *string when successful +func (m *ContentSymlink__links) GetGit()(*string) { + return m.git +} +// GetHtml gets the html property value. The html property +// returns a *string when successful +func (m *ContentSymlink__links) GetHtml()(*string) { + return m.html +} +// GetSelf gets the self property value. The self property +// returns a *string when successful +func (m *ContentSymlink__links) GetSelf()(*string) { + return m.self +} +// Serialize serializes information the current object +func (m *ContentSymlink__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("git", m.GetGit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("self", m.GetSelf()) + 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 *ContentSymlink__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGit sets the git property value. The git property +func (m *ContentSymlink__links) SetGit(value *string)() { + m.git = value +} +// SetHtml sets the html property value. The html property +func (m *ContentSymlink__links) SetHtml(value *string)() { + m.html = value +} +// SetSelf sets the self property value. The self property +func (m *ContentSymlink__links) SetSelf(value *string)() { + m.self = value +} +type ContentSymlink__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGit()(*string) + GetHtml()(*string) + GetSelf()(*string) + SetGit(value *string)() + SetHtml(value *string)() + SetSelf(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/content_symlink_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_symlink_type.go new file mode 100644 index 000000000..48973b3ee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_symlink_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type ContentSymlink_type int + +const ( + SYMLINK_CONTENTSYMLINK_TYPE ContentSymlink_type = iota +) + +func (i ContentSymlink_type) String() string { + return []string{"symlink"}[i] +} +func ParseContentSymlink_type(v string) (any, error) { + result := SYMLINK_CONTENTSYMLINK_TYPE + switch v { + case "symlink": + result = SYMLINK_CONTENTSYMLINK_TYPE + default: + return 0, errors.New("Unknown ContentSymlink_type value: " + v) + } + return &result, nil +} +func SerializeContentSymlink_type(values []ContentSymlink_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ContentSymlink_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/content_traffic.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_traffic.go new file mode 100644 index 000000000..5b786210e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/content_traffic.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ContentTraffic content Traffic +type ContentTraffic struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The count property + count *int32 + // The path property + path *string + // The title property + title *string + // The uniques property + uniques *int32 +} +// NewContentTraffic instantiates a new ContentTraffic and sets the default values. +func NewContentTraffic()(*ContentTraffic) { + m := &ContentTraffic{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContentTrafficFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentTrafficFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentTraffic(), 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 *ContentTraffic) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCount gets the count property value. The count property +// returns a *int32 when successful +func (m *ContentTraffic) GetCount()(*int32) { + return m.count +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContentTraffic) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCount(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["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["uniques"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUniques(val) + } + return nil + } + return res +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *ContentTraffic) GetPath()(*string) { + return m.path +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *ContentTraffic) GetTitle()(*string) { + return m.title +} +// GetUniques gets the uniques property value. The uniques property +// returns a *int32 when successful +func (m *ContentTraffic) GetUniques()(*int32) { + return m.uniques +} +// Serialize serializes information the current object +func (m *ContentTraffic) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("count", m.GetCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("uniques", m.GetUniques()) + 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 *ContentTraffic) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCount sets the count property value. The count property +func (m *ContentTraffic) SetCount(value *int32)() { + m.count = value +} +// SetPath sets the path property value. The path property +func (m *ContentTraffic) SetPath(value *string)() { + m.path = value +} +// SetTitle sets the title property value. The title property +func (m *ContentTraffic) SetTitle(value *string)() { + m.title = value +} +// SetUniques sets the uniques property value. The uniques property +func (m *ContentTraffic) SetUniques(value *int32)() { + m.uniques = value +} +type ContentTrafficable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCount()(*int32) + GetPath()(*string) + GetTitle()(*string) + GetUniques()(*int32) + SetCount(value *int32)() + SetPath(value *string)() + SetTitle(value *string)() + SetUniques(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/contributor.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/contributor.go new file mode 100644 index 000000000..08342ad40 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/contributor.go @@ -0,0 +1,661 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Contributor contributor +type Contributor struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The contributions property + contributions *int32 + // The email property + email *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int32 + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewContributor instantiates a new Contributor and sets the default values. +func NewContributor()(*Contributor) { + m := &Contributor{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContributorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContributorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContributor(), 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 *Contributor) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *Contributor) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetContributions gets the contributions property value. The contributions property +// returns a *int32 when successful +func (m *Contributor) GetContributions()(*int32) { + return m.contributions +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *Contributor) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *Contributor) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Contributor) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["contributions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetContributions(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *Contributor) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *Contributor) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *Contributor) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *Contributor) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Contributor) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Contributor) GetId()(*int32) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *Contributor) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *Contributor) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Contributor) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *Contributor) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *Contributor) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *Contributor) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *Contributor) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *Contributor) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *Contributor) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *Contributor) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Contributor) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Contributor) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("contributions", m.GetContributions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Contributor) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *Contributor) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetContributions sets the contributions property value. The contributions property +func (m *Contributor) SetContributions(value *int32)() { + m.contributions = value +} +// SetEmail sets the email property value. The email property +func (m *Contributor) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *Contributor) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *Contributor) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *Contributor) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *Contributor) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *Contributor) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Contributor) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Contributor) SetId(value *int32)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *Contributor) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *Contributor) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Contributor) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *Contributor) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *Contributor) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *Contributor) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *Contributor) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *Contributor) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *Contributor) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Contributor) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *Contributor) SetUrl(value *string)() { + m.url = value +} +type Contributorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetContributions()(*int32) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetContributions(value *int32)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/contributor_activity.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/contributor_activity.go new file mode 100644 index 000000000..66abfa8e6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/contributor_activity.go @@ -0,0 +1,151 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ContributorActivity contributor Activity +type ContributorActivity struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + author NullableSimpleUserable + // The total property + total *int32 + // The weeks property + weeks []ContributorActivity_weeksable +} +// NewContributorActivity instantiates a new ContributorActivity and sets the default values. +func NewContributorActivity()(*ContributorActivity) { + m := &ContributorActivity{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContributorActivityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContributorActivityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContributorActivity(), 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 *ContributorActivity) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *ContributorActivity) GetAuthor()(NullableSimpleUserable) { + return m.author +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContributorActivity) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(NullableSimpleUserable)) + } + return nil + } + res["total"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotal(val) + } + return nil + } + res["weeks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateContributorActivity_weeksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ContributorActivity_weeksable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ContributorActivity_weeksable) + } + } + m.SetWeeks(res) + } + return nil + } + return res +} +// GetTotal gets the total property value. The total property +// returns a *int32 when successful +func (m *ContributorActivity) GetTotal()(*int32) { + return m.total +} +// GetWeeks gets the weeks property value. The weeks property +// returns a []ContributorActivity_weeksable when successful +func (m *ContributorActivity) GetWeeks()([]ContributorActivity_weeksable) { + return m.weeks +} +// Serialize serializes information the current object +func (m *ContributorActivity) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total", m.GetTotal()) + if err != nil { + return err + } + } + if m.GetWeeks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetWeeks())) + for i, v := range m.GetWeeks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("weeks", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ContributorActivity) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. A GitHub user. +func (m *ContributorActivity) SetAuthor(value NullableSimpleUserable)() { + m.author = value +} +// SetTotal sets the total property value. The total property +func (m *ContributorActivity) SetTotal(value *int32)() { + m.total = value +} +// SetWeeks sets the weeks property value. The weeks property +func (m *ContributorActivity) SetWeeks(value []ContributorActivity_weeksable)() { + m.weeks = value +} +type ContributorActivityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(NullableSimpleUserable) + GetTotal()(*int32) + GetWeeks()([]ContributorActivity_weeksable) + SetAuthor(value NullableSimpleUserable)() + SetTotal(value *int32)() + SetWeeks(value []ContributorActivity_weeksable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/contributor_activity_weeks.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/contributor_activity_weeks.go new file mode 100644 index 000000000..8427f464e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/contributor_activity_weeks.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ContributorActivity_weeks struct { + // The a property + a *int32 + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The c property + c *int32 + // The d property + d *int32 + // The w property + w *int32 +} +// NewContributorActivity_weeks instantiates a new ContributorActivity_weeks and sets the default values. +func NewContributorActivity_weeks()(*ContributorActivity_weeks) { + m := &ContributorActivity_weeks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContributorActivity_weeksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContributorActivity_weeksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContributorActivity_weeks(), nil +} +// GetA gets the a property value. The a property +// returns a *int32 when successful +func (m *ContributorActivity_weeks) GetA()(*int32) { + return m.a +} +// 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 *ContributorActivity_weeks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetC gets the c property value. The c property +// returns a *int32 when successful +func (m *ContributorActivity_weeks) GetC()(*int32) { + return m.c +} +// GetD gets the d property value. The d property +// returns a *int32 when successful +func (m *ContributorActivity_weeks) GetD()(*int32) { + return m.d +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContributorActivity_weeks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["a"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetA(val) + } + return nil + } + res["c"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetC(val) + } + return nil + } + res["d"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetD(val) + } + return nil + } + res["w"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetW(val) + } + return nil + } + return res +} +// GetW gets the w property value. The w property +// returns a *int32 when successful +func (m *ContributorActivity_weeks) GetW()(*int32) { + return m.w +} +// Serialize serializes information the current object +func (m *ContributorActivity_weeks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("a", m.GetA()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("c", m.GetC()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("d", m.GetD()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("w", m.GetW()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetA sets the a property value. The a property +func (m *ContributorActivity_weeks) SetA(value *int32)() { + m.a = value +} +// 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 *ContributorActivity_weeks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetC sets the c property value. The c property +func (m *ContributorActivity_weeks) SetC(value *int32)() { + m.c = value +} +// SetD sets the d property value. The d property +func (m *ContributorActivity_weeks) SetD(value *int32)() { + m.d = value +} +// SetW sets the w property value. The w property +func (m *ContributorActivity_weeks) SetW(value *int32)() { + m.w = value +} +type ContributorActivity_weeksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetA()(*int32) + GetC()(*int32) + GetD()(*int32) + GetW()(*int32) + SetA(value *int32)() + SetC(value *int32)() + SetD(value *int32)() + SetW(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/converted_note_to_issue_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/converted_note_to_issue_issue_event.go new file mode 100644 index 000000000..6a024bc45 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/converted_note_to_issue_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ConvertedNoteToIssueIssueEvent converted Note to Issue Issue Event +type ConvertedNoteToIssueIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app Integrationable + // The project_card property + project_card ConvertedNoteToIssueIssueEvent_project_cardable + // The url property + url *string +} +// NewConvertedNoteToIssueIssueEvent instantiates a new ConvertedNoteToIssueIssueEvent and sets the default values. +func NewConvertedNoteToIssueIssueEvent()(*ConvertedNoteToIssueIssueEvent) { + m := &ConvertedNoteToIssueIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateConvertedNoteToIssueIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateConvertedNoteToIssueIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewConvertedNoteToIssueIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *ConvertedNoteToIssueIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *ConvertedNoteToIssueIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ConvertedNoteToIssueIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(Integrationable)) + } + return nil + } + res["project_card"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateConvertedNoteToIssueIssueEvent_project_cardFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProjectCard(val.(ConvertedNoteToIssueIssueEvent_project_cardable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *ConvertedNoteToIssueIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a Integrationable when successful +func (m *ConvertedNoteToIssueIssueEvent) GetPerformedViaGithubApp()(Integrationable) { + return m.performed_via_github_app +} +// GetProjectCard gets the project_card property value. The project_card property +// returns a ConvertedNoteToIssueIssueEvent_project_cardable when successful +func (m *ConvertedNoteToIssueIssueEvent) GetProjectCard()(ConvertedNoteToIssueIssueEvent_project_cardable) { + return m.project_card +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ConvertedNoteToIssueIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("project_card", m.GetProjectCard()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *ConvertedNoteToIssueIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *ConvertedNoteToIssueIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *ConvertedNoteToIssueIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *ConvertedNoteToIssueIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ConvertedNoteToIssueIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *ConvertedNoteToIssueIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *ConvertedNoteToIssueIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *ConvertedNoteToIssueIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *ConvertedNoteToIssueIssueEvent) SetPerformedViaGithubApp(value Integrationable)() { + m.performed_via_github_app = value +} +// SetProjectCard sets the project_card property value. The project_card property +func (m *ConvertedNoteToIssueIssueEvent) SetProjectCard(value ConvertedNoteToIssueIssueEvent_project_cardable)() { + m.project_card = value +} +// SetUrl sets the url property value. The url property +func (m *ConvertedNoteToIssueIssueEvent) SetUrl(value *string)() { + m.url = value +} +type ConvertedNoteToIssueIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(Integrationable) + GetProjectCard()(ConvertedNoteToIssueIssueEvent_project_cardable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value Integrationable)() + SetProjectCard(value ConvertedNoteToIssueIssueEvent_project_cardable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/converted_note_to_issue_issue_event_project_card.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/converted_note_to_issue_issue_event_project_card.go new file mode 100644 index 000000000..2713ecfc5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/converted_note_to_issue_issue_event_project_card.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ConvertedNoteToIssueIssueEvent_project_card struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The column_name property + column_name *string + // The id property + id *int32 + // The previous_column_name property + previous_column_name *string + // The project_id property + project_id *int32 + // The project_url property + project_url *string + // The url property + url *string +} +// NewConvertedNoteToIssueIssueEvent_project_card instantiates a new ConvertedNoteToIssueIssueEvent_project_card and sets the default values. +func NewConvertedNoteToIssueIssueEvent_project_card()(*ConvertedNoteToIssueIssueEvent_project_card) { + m := &ConvertedNoteToIssueIssueEvent_project_card{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateConvertedNoteToIssueIssueEvent_project_cardFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateConvertedNoteToIssueIssueEvent_project_cardFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewConvertedNoteToIssueIssueEvent_project_card(), 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 *ConvertedNoteToIssueIssueEvent_project_card) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColumnName gets the column_name property value. The column_name property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent_project_card) GetColumnName()(*string) { + return m.column_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ConvertedNoteToIssueIssueEvent_project_card) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnName(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["previous_column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviousColumnName(val) + } + return nil + } + res["project_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetProjectId(val) + } + return nil + } + res["project_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProjectUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *ConvertedNoteToIssueIssueEvent_project_card) GetId()(*int32) { + return m.id +} +// GetPreviousColumnName gets the previous_column_name property value. The previous_column_name property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent_project_card) GetPreviousColumnName()(*string) { + return m.previous_column_name +} +// GetProjectId gets the project_id property value. The project_id property +// returns a *int32 when successful +func (m *ConvertedNoteToIssueIssueEvent_project_card) GetProjectId()(*int32) { + return m.project_id +} +// GetProjectUrl gets the project_url property value. The project_url property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent_project_card) GetProjectUrl()(*string) { + return m.project_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent_project_card) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ConvertedNoteToIssueIssueEvent_project_card) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("column_name", m.GetColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("previous_column_name", m.GetPreviousColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("project_id", m.GetProjectId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("project_url", m.GetProjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ConvertedNoteToIssueIssueEvent_project_card) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColumnName sets the column_name property value. The column_name property +func (m *ConvertedNoteToIssueIssueEvent_project_card) SetColumnName(value *string)() { + m.column_name = value +} +// SetId sets the id property value. The id property +func (m *ConvertedNoteToIssueIssueEvent_project_card) SetId(value *int32)() { + m.id = value +} +// SetPreviousColumnName sets the previous_column_name property value. The previous_column_name property +func (m *ConvertedNoteToIssueIssueEvent_project_card) SetPreviousColumnName(value *string)() { + m.previous_column_name = value +} +// SetProjectId sets the project_id property value. The project_id property +func (m *ConvertedNoteToIssueIssueEvent_project_card) SetProjectId(value *int32)() { + m.project_id = value +} +// SetProjectUrl sets the project_url property value. The project_url property +func (m *ConvertedNoteToIssueIssueEvent_project_card) SetProjectUrl(value *string)() { + m.project_url = value +} +// SetUrl sets the url property value. The url property +func (m *ConvertedNoteToIssueIssueEvent_project_card) SetUrl(value *string)() { + m.url = value +} +type ConvertedNoteToIssueIssueEvent_project_cardable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColumnName()(*string) + GetId()(*int32) + GetPreviousColumnName()(*string) + GetProjectId()(*int32) + GetProjectUrl()(*string) + GetUrl()(*string) + SetColumnName(value *string)() + SetId(value *int32)() + SetPreviousColumnName(value *string)() + SetProjectId(value *int32)() + SetProjectUrl(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details.go new file mode 100644 index 000000000..1774e9ea5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details.go @@ -0,0 +1,231 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CopilotOrganizationDetails information about the seat breakdown and policies set for an organization with a Copilot Business subscription. +type CopilotOrganizationDetails struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The organization policy for allowing or disallowing organization members to use Copilot within their CLI. + cli *CopilotOrganizationDetails_cli + // The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. + ide_chat *CopilotOrganizationDetails_ide_chat + // The organization policy for allowing or disallowing organization members to use Copilot features within github.com. + platform_chat *CopilotOrganizationDetails_platform_chat + // The organization policy for allowing or disallowing Copilot to make suggestions that match public code. + public_code_suggestions *CopilotOrganizationDetails_public_code_suggestions + // The breakdown of Copilot Business seats for the organization. + seat_breakdown CopilotSeatBreakdownable + // The mode of assigning new seats. + seat_management_setting *CopilotOrganizationDetails_seat_management_setting +} +// NewCopilotOrganizationDetails instantiates a new CopilotOrganizationDetails and sets the default values. +func NewCopilotOrganizationDetails()(*CopilotOrganizationDetails) { + m := &CopilotOrganizationDetails{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCopilotOrganizationDetailsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCopilotOrganizationDetailsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCopilotOrganizationDetails(), 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 *CopilotOrganizationDetails) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCli gets the cli property value. The organization policy for allowing or disallowing organization members to use Copilot within their CLI. +// returns a *CopilotOrganizationDetails_cli when successful +func (m *CopilotOrganizationDetails) GetCli()(*CopilotOrganizationDetails_cli) { + return m.cli +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CopilotOrganizationDetails) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cli"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCopilotOrganizationDetails_cli) + if err != nil { + return err + } + if val != nil { + m.SetCli(val.(*CopilotOrganizationDetails_cli)) + } + return nil + } + res["ide_chat"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCopilotOrganizationDetails_ide_chat) + if err != nil { + return err + } + if val != nil { + m.SetIdeChat(val.(*CopilotOrganizationDetails_ide_chat)) + } + return nil + } + res["platform_chat"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCopilotOrganizationDetails_platform_chat) + if err != nil { + return err + } + if val != nil { + m.SetPlatformChat(val.(*CopilotOrganizationDetails_platform_chat)) + } + return nil + } + res["public_code_suggestions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCopilotOrganizationDetails_public_code_suggestions) + if err != nil { + return err + } + if val != nil { + m.SetPublicCodeSuggestions(val.(*CopilotOrganizationDetails_public_code_suggestions)) + } + return nil + } + res["seat_breakdown"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCopilotSeatBreakdownFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSeatBreakdown(val.(CopilotSeatBreakdownable)) + } + return nil + } + res["seat_management_setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCopilotOrganizationDetails_seat_management_setting) + if err != nil { + return err + } + if val != nil { + m.SetSeatManagementSetting(val.(*CopilotOrganizationDetails_seat_management_setting)) + } + return nil + } + return res +} +// GetIdeChat gets the ide_chat property value. The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. +// returns a *CopilotOrganizationDetails_ide_chat when successful +func (m *CopilotOrganizationDetails) GetIdeChat()(*CopilotOrganizationDetails_ide_chat) { + return m.ide_chat +} +// GetPlatformChat gets the platform_chat property value. The organization policy for allowing or disallowing organization members to use Copilot features within github.com. +// returns a *CopilotOrganizationDetails_platform_chat when successful +func (m *CopilotOrganizationDetails) GetPlatformChat()(*CopilotOrganizationDetails_platform_chat) { + return m.platform_chat +} +// GetPublicCodeSuggestions gets the public_code_suggestions property value. The organization policy for allowing or disallowing Copilot to make suggestions that match public code. +// returns a *CopilotOrganizationDetails_public_code_suggestions when successful +func (m *CopilotOrganizationDetails) GetPublicCodeSuggestions()(*CopilotOrganizationDetails_public_code_suggestions) { + return m.public_code_suggestions +} +// GetSeatBreakdown gets the seat_breakdown property value. The breakdown of Copilot Business seats for the organization. +// returns a CopilotSeatBreakdownable when successful +func (m *CopilotOrganizationDetails) GetSeatBreakdown()(CopilotSeatBreakdownable) { + return m.seat_breakdown +} +// GetSeatManagementSetting gets the seat_management_setting property value. The mode of assigning new seats. +// returns a *CopilotOrganizationDetails_seat_management_setting when successful +func (m *CopilotOrganizationDetails) GetSeatManagementSetting()(*CopilotOrganizationDetails_seat_management_setting) { + return m.seat_management_setting +} +// Serialize serializes information the current object +func (m *CopilotOrganizationDetails) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCli() != nil { + cast := (*m.GetCli()).String() + err := writer.WriteStringValue("cli", &cast) + if err != nil { + return err + } + } + if m.GetIdeChat() != nil { + cast := (*m.GetIdeChat()).String() + err := writer.WriteStringValue("ide_chat", &cast) + if err != nil { + return err + } + } + if m.GetPlatformChat() != nil { + cast := (*m.GetPlatformChat()).String() + err := writer.WriteStringValue("platform_chat", &cast) + if err != nil { + return err + } + } + if m.GetPublicCodeSuggestions() != nil { + cast := (*m.GetPublicCodeSuggestions()).String() + err := writer.WriteStringValue("public_code_suggestions", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("seat_breakdown", m.GetSeatBreakdown()) + if err != nil { + return err + } + } + if m.GetSeatManagementSetting() != nil { + cast := (*m.GetSeatManagementSetting()).String() + err := writer.WriteStringValue("seat_management_setting", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CopilotOrganizationDetails) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCli sets the cli property value. The organization policy for allowing or disallowing organization members to use Copilot within their CLI. +func (m *CopilotOrganizationDetails) SetCli(value *CopilotOrganizationDetails_cli)() { + m.cli = value +} +// SetIdeChat sets the ide_chat property value. The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. +func (m *CopilotOrganizationDetails) SetIdeChat(value *CopilotOrganizationDetails_ide_chat)() { + m.ide_chat = value +} +// SetPlatformChat sets the platform_chat property value. The organization policy for allowing or disallowing organization members to use Copilot features within github.com. +func (m *CopilotOrganizationDetails) SetPlatformChat(value *CopilotOrganizationDetails_platform_chat)() { + m.platform_chat = value +} +// SetPublicCodeSuggestions sets the public_code_suggestions property value. The organization policy for allowing or disallowing Copilot to make suggestions that match public code. +func (m *CopilotOrganizationDetails) SetPublicCodeSuggestions(value *CopilotOrganizationDetails_public_code_suggestions)() { + m.public_code_suggestions = value +} +// SetSeatBreakdown sets the seat_breakdown property value. The breakdown of Copilot Business seats for the organization. +func (m *CopilotOrganizationDetails) SetSeatBreakdown(value CopilotSeatBreakdownable)() { + m.seat_breakdown = value +} +// SetSeatManagementSetting sets the seat_management_setting property value. The mode of assigning new seats. +func (m *CopilotOrganizationDetails) SetSeatManagementSetting(value *CopilotOrganizationDetails_seat_management_setting)() { + m.seat_management_setting = value +} +type CopilotOrganizationDetailsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCli()(*CopilotOrganizationDetails_cli) + GetIdeChat()(*CopilotOrganizationDetails_ide_chat) + GetPlatformChat()(*CopilotOrganizationDetails_platform_chat) + GetPublicCodeSuggestions()(*CopilotOrganizationDetails_public_code_suggestions) + GetSeatBreakdown()(CopilotSeatBreakdownable) + GetSeatManagementSetting()(*CopilotOrganizationDetails_seat_management_setting) + SetCli(value *CopilotOrganizationDetails_cli)() + SetIdeChat(value *CopilotOrganizationDetails_ide_chat)() + SetPlatformChat(value *CopilotOrganizationDetails_platform_chat)() + SetPublicCodeSuggestions(value *CopilotOrganizationDetails_public_code_suggestions)() + SetSeatBreakdown(value CopilotSeatBreakdownable)() + SetSeatManagementSetting(value *CopilotOrganizationDetails_seat_management_setting)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_cli.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_cli.go new file mode 100644 index 000000000..af8a63c44 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_cli.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The organization policy for allowing or disallowing organization members to use Copilot within their CLI. +type CopilotOrganizationDetails_cli int + +const ( + ENABLED_COPILOTORGANIZATIONDETAILS_CLI CopilotOrganizationDetails_cli = iota + DISABLED_COPILOTORGANIZATIONDETAILS_CLI + UNCONFIGURED_COPILOTORGANIZATIONDETAILS_CLI +) + +func (i CopilotOrganizationDetails_cli) String() string { + return []string{"enabled", "disabled", "unconfigured"}[i] +} +func ParseCopilotOrganizationDetails_cli(v string) (any, error) { + result := ENABLED_COPILOTORGANIZATIONDETAILS_CLI + switch v { + case "enabled": + result = ENABLED_COPILOTORGANIZATIONDETAILS_CLI + case "disabled": + result = DISABLED_COPILOTORGANIZATIONDETAILS_CLI + case "unconfigured": + result = UNCONFIGURED_COPILOTORGANIZATIONDETAILS_CLI + default: + return 0, errors.New("Unknown CopilotOrganizationDetails_cli value: " + v) + } + return &result, nil +} +func SerializeCopilotOrganizationDetails_cli(values []CopilotOrganizationDetails_cli) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CopilotOrganizationDetails_cli) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_copilot_chat.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_copilot_chat.go new file mode 100644 index 000000000..5998d7d4b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_copilot_chat.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. +type CopilotOrganizationDetails_copilot_chat int + +const ( + ENABLED_COPILOTORGANIZATIONDETAILS_COPILOT_CHAT CopilotOrganizationDetails_copilot_chat = iota + DISABLED_COPILOTORGANIZATIONDETAILS_COPILOT_CHAT + UNCONFIGURED_COPILOTORGANIZATIONDETAILS_COPILOT_CHAT +) + +func (i CopilotOrganizationDetails_copilot_chat) String() string { + return []string{"enabled", "disabled", "unconfigured"}[i] +} +func ParseCopilotOrganizationDetails_copilot_chat(v string) (any, error) { + result := ENABLED_COPILOTORGANIZATIONDETAILS_COPILOT_CHAT + switch v { + case "enabled": + result = ENABLED_COPILOTORGANIZATIONDETAILS_COPILOT_CHAT + case "disabled": + result = DISABLED_COPILOTORGANIZATIONDETAILS_COPILOT_CHAT + case "unconfigured": + result = UNCONFIGURED_COPILOTORGANIZATIONDETAILS_COPILOT_CHAT + default: + return 0, errors.New("Unknown CopilotOrganizationDetails_copilot_chat value: " + v) + } + return &result, nil +} +func SerializeCopilotOrganizationDetails_copilot_chat(values []CopilotOrganizationDetails_copilot_chat) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CopilotOrganizationDetails_copilot_chat) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_ide_chat.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_ide_chat.go new file mode 100644 index 000000000..a89ad2fc1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_ide_chat.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. +type CopilotOrganizationDetails_ide_chat int + +const ( + ENABLED_COPILOTORGANIZATIONDETAILS_IDE_CHAT CopilotOrganizationDetails_ide_chat = iota + DISABLED_COPILOTORGANIZATIONDETAILS_IDE_CHAT + UNCONFIGURED_COPILOTORGANIZATIONDETAILS_IDE_CHAT +) + +func (i CopilotOrganizationDetails_ide_chat) String() string { + return []string{"enabled", "disabled", "unconfigured"}[i] +} +func ParseCopilotOrganizationDetails_ide_chat(v string) (any, error) { + result := ENABLED_COPILOTORGANIZATIONDETAILS_IDE_CHAT + switch v { + case "enabled": + result = ENABLED_COPILOTORGANIZATIONDETAILS_IDE_CHAT + case "disabled": + result = DISABLED_COPILOTORGANIZATIONDETAILS_IDE_CHAT + case "unconfigured": + result = UNCONFIGURED_COPILOTORGANIZATIONDETAILS_IDE_CHAT + default: + return 0, errors.New("Unknown CopilotOrganizationDetails_ide_chat value: " + v) + } + return &result, nil +} +func SerializeCopilotOrganizationDetails_ide_chat(values []CopilotOrganizationDetails_ide_chat) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CopilotOrganizationDetails_ide_chat) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_platform_chat.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_platform_chat.go new file mode 100644 index 000000000..d03a09e5b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_platform_chat.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The organization policy for allowing or disallowing organization members to use Copilot features within github.com. +type CopilotOrganizationDetails_platform_chat int + +const ( + ENABLED_COPILOTORGANIZATIONDETAILS_PLATFORM_CHAT CopilotOrganizationDetails_platform_chat = iota + DISABLED_COPILOTORGANIZATIONDETAILS_PLATFORM_CHAT + UNCONFIGURED_COPILOTORGANIZATIONDETAILS_PLATFORM_CHAT +) + +func (i CopilotOrganizationDetails_platform_chat) String() string { + return []string{"enabled", "disabled", "unconfigured"}[i] +} +func ParseCopilotOrganizationDetails_platform_chat(v string) (any, error) { + result := ENABLED_COPILOTORGANIZATIONDETAILS_PLATFORM_CHAT + switch v { + case "enabled": + result = ENABLED_COPILOTORGANIZATIONDETAILS_PLATFORM_CHAT + case "disabled": + result = DISABLED_COPILOTORGANIZATIONDETAILS_PLATFORM_CHAT + case "unconfigured": + result = UNCONFIGURED_COPILOTORGANIZATIONDETAILS_PLATFORM_CHAT + default: + return 0, errors.New("Unknown CopilotOrganizationDetails_platform_chat value: " + v) + } + return &result, nil +} +func SerializeCopilotOrganizationDetails_platform_chat(values []CopilotOrganizationDetails_platform_chat) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CopilotOrganizationDetails_platform_chat) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_public_code_suggestions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_public_code_suggestions.go new file mode 100644 index 000000000..6fe57dbad --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_public_code_suggestions.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The organization policy for allowing or disallowing Copilot to make suggestions that match public code. +type CopilotOrganizationDetails_public_code_suggestions int + +const ( + ALLOW_COPILOTORGANIZATIONDETAILS_PUBLIC_CODE_SUGGESTIONS CopilotOrganizationDetails_public_code_suggestions = iota + BLOCK_COPILOTORGANIZATIONDETAILS_PUBLIC_CODE_SUGGESTIONS + UNCONFIGURED_COPILOTORGANIZATIONDETAILS_PUBLIC_CODE_SUGGESTIONS + UNKNOWN_COPILOTORGANIZATIONDETAILS_PUBLIC_CODE_SUGGESTIONS +) + +func (i CopilotOrganizationDetails_public_code_suggestions) String() string { + return []string{"allow", "block", "unconfigured", "unknown"}[i] +} +func ParseCopilotOrganizationDetails_public_code_suggestions(v string) (any, error) { + result := ALLOW_COPILOTORGANIZATIONDETAILS_PUBLIC_CODE_SUGGESTIONS + switch v { + case "allow": + result = ALLOW_COPILOTORGANIZATIONDETAILS_PUBLIC_CODE_SUGGESTIONS + case "block": + result = BLOCK_COPILOTORGANIZATIONDETAILS_PUBLIC_CODE_SUGGESTIONS + case "unconfigured": + result = UNCONFIGURED_COPILOTORGANIZATIONDETAILS_PUBLIC_CODE_SUGGESTIONS + case "unknown": + result = UNKNOWN_COPILOTORGANIZATIONDETAILS_PUBLIC_CODE_SUGGESTIONS + default: + return 0, errors.New("Unknown CopilotOrganizationDetails_public_code_suggestions value: " + v) + } + return &result, nil +} +func SerializeCopilotOrganizationDetails_public_code_suggestions(values []CopilotOrganizationDetails_public_code_suggestions) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CopilotOrganizationDetails_public_code_suggestions) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_seat_management_setting.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_seat_management_setting.go new file mode 100644 index 000000000..b4b64ef45 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_organization_details_seat_management_setting.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The mode of assigning new seats. +type CopilotOrganizationDetails_seat_management_setting int + +const ( + ASSIGN_ALL_COPILOTORGANIZATIONDETAILS_SEAT_MANAGEMENT_SETTING CopilotOrganizationDetails_seat_management_setting = iota + ASSIGN_SELECTED_COPILOTORGANIZATIONDETAILS_SEAT_MANAGEMENT_SETTING + DISABLED_COPILOTORGANIZATIONDETAILS_SEAT_MANAGEMENT_SETTING + UNCONFIGURED_COPILOTORGANIZATIONDETAILS_SEAT_MANAGEMENT_SETTING +) + +func (i CopilotOrganizationDetails_seat_management_setting) String() string { + return []string{"assign_all", "assign_selected", "disabled", "unconfigured"}[i] +} +func ParseCopilotOrganizationDetails_seat_management_setting(v string) (any, error) { + result := ASSIGN_ALL_COPILOTORGANIZATIONDETAILS_SEAT_MANAGEMENT_SETTING + switch v { + case "assign_all": + result = ASSIGN_ALL_COPILOTORGANIZATIONDETAILS_SEAT_MANAGEMENT_SETTING + case "assign_selected": + result = ASSIGN_SELECTED_COPILOTORGANIZATIONDETAILS_SEAT_MANAGEMENT_SETTING + case "disabled": + result = DISABLED_COPILOTORGANIZATIONDETAILS_SEAT_MANAGEMENT_SETTING + case "unconfigured": + result = UNCONFIGURED_COPILOTORGANIZATIONDETAILS_SEAT_MANAGEMENT_SETTING + default: + return 0, errors.New("Unknown CopilotOrganizationDetails_seat_management_setting value: " + v) + } + return &result, nil +} +func SerializeCopilotOrganizationDetails_seat_management_setting(values []CopilotOrganizationDetails_seat_management_setting) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CopilotOrganizationDetails_seat_management_setting) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_seat_breakdown.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_seat_breakdown.go new file mode 100644 index 000000000..87262c584 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_seat_breakdown.go @@ -0,0 +1,226 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CopilotSeatBreakdown the breakdown of Copilot Business seats for the organization. +type CopilotSeatBreakdown struct { + // The number of seats that have used Copilot during the current billing cycle. + active_this_cycle *int32 + // Seats added during the current billing cycle. + added_this_cycle *int32 + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The number of seats that have not used Copilot during the current billing cycle. + inactive_this_cycle *int32 + // The number of seats that are pending cancellation at the end of the current billing cycle. + pending_cancellation *int32 + // The number of seats that have been assigned to users that have not yet accepted an invitation to this organization. + pending_invitation *int32 + // The total number of seats being billed for the organization as of the current billing cycle. + total *int32 +} +// NewCopilotSeatBreakdown instantiates a new CopilotSeatBreakdown and sets the default values. +func NewCopilotSeatBreakdown()(*CopilotSeatBreakdown) { + m := &CopilotSeatBreakdown{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCopilotSeatBreakdownFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCopilotSeatBreakdownFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCopilotSeatBreakdown(), nil +} +// GetActiveThisCycle gets the active_this_cycle property value. The number of seats that have used Copilot during the current billing cycle. +// returns a *int32 when successful +func (m *CopilotSeatBreakdown) GetActiveThisCycle()(*int32) { + return m.active_this_cycle +} +// GetAddedThisCycle gets the added_this_cycle property value. Seats added during the current billing cycle. +// returns a *int32 when successful +func (m *CopilotSeatBreakdown) GetAddedThisCycle()(*int32) { + return m.added_this_cycle +} +// 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 *CopilotSeatBreakdown) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CopilotSeatBreakdown) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active_this_cycle"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetActiveThisCycle(val) + } + return nil + } + res["added_this_cycle"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAddedThisCycle(val) + } + return nil + } + res["inactive_this_cycle"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetInactiveThisCycle(val) + } + return nil + } + res["pending_cancellation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPendingCancellation(val) + } + return nil + } + res["pending_invitation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPendingInvitation(val) + } + return nil + } + res["total"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotal(val) + } + return nil + } + return res +} +// GetInactiveThisCycle gets the inactive_this_cycle property value. The number of seats that have not used Copilot during the current billing cycle. +// returns a *int32 when successful +func (m *CopilotSeatBreakdown) GetInactiveThisCycle()(*int32) { + return m.inactive_this_cycle +} +// GetPendingCancellation gets the pending_cancellation property value. The number of seats that are pending cancellation at the end of the current billing cycle. +// returns a *int32 when successful +func (m *CopilotSeatBreakdown) GetPendingCancellation()(*int32) { + return m.pending_cancellation +} +// GetPendingInvitation gets the pending_invitation property value. The number of seats that have been assigned to users that have not yet accepted an invitation to this organization. +// returns a *int32 when successful +func (m *CopilotSeatBreakdown) GetPendingInvitation()(*int32) { + return m.pending_invitation +} +// GetTotal gets the total property value. The total number of seats being billed for the organization as of the current billing cycle. +// returns a *int32 when successful +func (m *CopilotSeatBreakdown) GetTotal()(*int32) { + return m.total +} +// Serialize serializes information the current object +func (m *CopilotSeatBreakdown) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("active_this_cycle", m.GetActiveThisCycle()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("added_this_cycle", m.GetAddedThisCycle()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("inactive_this_cycle", m.GetInactiveThisCycle()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("pending_cancellation", m.GetPendingCancellation()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("pending_invitation", m.GetPendingInvitation()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total", m.GetTotal()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActiveThisCycle sets the active_this_cycle property value. The number of seats that have used Copilot during the current billing cycle. +func (m *CopilotSeatBreakdown) SetActiveThisCycle(value *int32)() { + m.active_this_cycle = value +} +// SetAddedThisCycle sets the added_this_cycle property value. Seats added during the current billing cycle. +func (m *CopilotSeatBreakdown) SetAddedThisCycle(value *int32)() { + m.added_this_cycle = value +} +// 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 *CopilotSeatBreakdown) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetInactiveThisCycle sets the inactive_this_cycle property value. The number of seats that have not used Copilot during the current billing cycle. +func (m *CopilotSeatBreakdown) SetInactiveThisCycle(value *int32)() { + m.inactive_this_cycle = value +} +// SetPendingCancellation sets the pending_cancellation property value. The number of seats that are pending cancellation at the end of the current billing cycle. +func (m *CopilotSeatBreakdown) SetPendingCancellation(value *int32)() { + m.pending_cancellation = value +} +// SetPendingInvitation sets the pending_invitation property value. The number of seats that have been assigned to users that have not yet accepted an invitation to this organization. +func (m *CopilotSeatBreakdown) SetPendingInvitation(value *int32)() { + m.pending_invitation = value +} +// SetTotal sets the total property value. The total number of seats being billed for the organization as of the current billing cycle. +func (m *CopilotSeatBreakdown) SetTotal(value *int32)() { + m.total = value +} +type CopilotSeatBreakdownable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActiveThisCycle()(*int32) + GetAddedThisCycle()(*int32) + GetInactiveThisCycle()(*int32) + GetPendingCancellation()(*int32) + GetPendingInvitation()(*int32) + GetTotal()(*int32) + SetActiveThisCycle(value *int32)() + SetAddedThisCycle(value *int32)() + SetInactiveThisCycle(value *int32)() + SetPendingCancellation(value *int32)() + SetPendingInvitation(value *int32)() + SetTotal(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_seat_details.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_seat_details.go new file mode 100644 index 000000000..9ddf50ae4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_seat_details.go @@ -0,0 +1,450 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CopilotSeatDetails information about a Copilot Business seat assignment for a user, team, or organization. +type CopilotSeatDetails struct { + // The assignee that has been granted access to GitHub Copilot. + assignee CopilotSeatDetails_CopilotSeatDetails_assigneeable + // The team through which the assignee is granted access to GitHub Copilot, if applicable. + assigning_team CopilotSeatDetails_CopilotSeatDetails_assigning_teamable + // Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Timestamp of user's last GitHub Copilot activity, in ISO 8601 format. + last_activity_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Last editor that was used by the user for a GitHub Copilot completion. + last_activity_editor *string + // The organization to which this seat belongs. + organization CopilotSeatDetails_organizationable + // The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle. + pending_cancellation_date *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly + // Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// CopilotSeatDetails_CopilotSeatDetails_assignee composed type wrapper for classes Organizationable, SimpleUserable, Teamable +type CopilotSeatDetails_CopilotSeatDetails_assignee struct { + // Composed type representation for type Organizationable + organization Organizationable + // Composed type representation for type SimpleUserable + simpleUser SimpleUserable + // Composed type representation for type Teamable + team Teamable +} +// NewCopilotSeatDetails_CopilotSeatDetails_assignee instantiates a new CopilotSeatDetails_CopilotSeatDetails_assignee and sets the default values. +func NewCopilotSeatDetails_CopilotSeatDetails_assignee()(*CopilotSeatDetails_CopilotSeatDetails_assignee) { + m := &CopilotSeatDetails_CopilotSeatDetails_assignee{ + } + return m +} +// CreateCopilotSeatDetails_CopilotSeatDetails_assigneeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCopilotSeatDetails_CopilotSeatDetails_assigneeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewCopilotSeatDetails_CopilotSeatDetails_assignee() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CopilotSeatDetails_CopilotSeatDetails_assignee) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *CopilotSeatDetails_CopilotSeatDetails_assignee) GetIsComposedType()(bool) { + return true +} +// GetOrganization gets the organization property value. Composed type representation for type Organizationable +// returns a Organizationable when successful +func (m *CopilotSeatDetails_CopilotSeatDetails_assignee) GetOrganization()(Organizationable) { + return m.organization +} +// GetSimpleUser gets the simpleUser property value. Composed type representation for type SimpleUserable +// returns a SimpleUserable when successful +func (m *CopilotSeatDetails_CopilotSeatDetails_assignee) GetSimpleUser()(SimpleUserable) { + return m.simpleUser +} +// GetTeam gets the team property value. Composed type representation for type Teamable +// returns a Teamable when successful +func (m *CopilotSeatDetails_CopilotSeatDetails_assignee) GetTeam()(Teamable) { + return m.team +} +// Serialize serializes information the current object +func (m *CopilotSeatDetails_CopilotSeatDetails_assignee) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetOrganization() != nil { + err := writer.WriteObjectValue("", m.GetOrganization()) + if err != nil { + return err + } + } else if m.GetSimpleUser() != nil { + err := writer.WriteObjectValue("", m.GetSimpleUser()) + if err != nil { + return err + } + } else if m.GetTeam() != nil { + err := writer.WriteObjectValue("", m.GetTeam()) + if err != nil { + return err + } + } + return nil +} +// SetOrganization sets the organization property value. Composed type representation for type Organizationable +func (m *CopilotSeatDetails_CopilotSeatDetails_assignee) SetOrganization(value Organizationable)() { + m.organization = value +} +// SetSimpleUser sets the simpleUser property value. Composed type representation for type SimpleUserable +func (m *CopilotSeatDetails_CopilotSeatDetails_assignee) SetSimpleUser(value SimpleUserable)() { + m.simpleUser = value +} +// SetTeam sets the team property value. Composed type representation for type Teamable +func (m *CopilotSeatDetails_CopilotSeatDetails_assignee) SetTeam(value Teamable)() { + m.team = value +} +// CopilotSeatDetails_CopilotSeatDetails_assigning_team composed type wrapper for classes EnterpriseTeamable, Teamable +type CopilotSeatDetails_CopilotSeatDetails_assigning_team struct { + // Composed type representation for type EnterpriseTeamable + enterpriseTeam EnterpriseTeamable + // Composed type representation for type Teamable + team Teamable +} +// NewCopilotSeatDetails_CopilotSeatDetails_assigning_team instantiates a new CopilotSeatDetails_CopilotSeatDetails_assigning_team and sets the default values. +func NewCopilotSeatDetails_CopilotSeatDetails_assigning_team()(*CopilotSeatDetails_CopilotSeatDetails_assigning_team) { + m := &CopilotSeatDetails_CopilotSeatDetails_assigning_team{ + } + return m +} +// CreateCopilotSeatDetails_CopilotSeatDetails_assigning_teamFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCopilotSeatDetails_CopilotSeatDetails_assigning_teamFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewCopilotSeatDetails_CopilotSeatDetails_assigning_team() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + return result, nil +} +// GetEnterpriseTeam gets the enterpriseTeam property value. Composed type representation for type EnterpriseTeamable +// returns a EnterpriseTeamable when successful +func (m *CopilotSeatDetails_CopilotSeatDetails_assigning_team) GetEnterpriseTeam()(EnterpriseTeamable) { + return m.enterpriseTeam +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CopilotSeatDetails_CopilotSeatDetails_assigning_team) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *CopilotSeatDetails_CopilotSeatDetails_assigning_team) GetIsComposedType()(bool) { + return true +} +// GetTeam gets the team property value. Composed type representation for type Teamable +// returns a Teamable when successful +func (m *CopilotSeatDetails_CopilotSeatDetails_assigning_team) GetTeam()(Teamable) { + return m.team +} +// Serialize serializes information the current object +func (m *CopilotSeatDetails_CopilotSeatDetails_assigning_team) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEnterpriseTeam() != nil { + err := writer.WriteObjectValue("", m.GetEnterpriseTeam()) + if err != nil { + return err + } + } else if m.GetTeam() != nil { + err := writer.WriteObjectValue("", m.GetTeam()) + if err != nil { + return err + } + } + return nil +} +// SetEnterpriseTeam sets the enterpriseTeam property value. Composed type representation for type EnterpriseTeamable +func (m *CopilotSeatDetails_CopilotSeatDetails_assigning_team) SetEnterpriseTeam(value EnterpriseTeamable)() { + m.enterpriseTeam = value +} +// SetTeam sets the team property value. Composed type representation for type Teamable +func (m *CopilotSeatDetails_CopilotSeatDetails_assigning_team) SetTeam(value Teamable)() { + m.team = value +} +type CopilotSeatDetails_CopilotSeatDetails_assigneeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetOrganization()(Organizationable) + GetSimpleUser()(SimpleUserable) + GetTeam()(Teamable) + SetOrganization(value Organizationable)() + SetSimpleUser(value SimpleUserable)() + SetTeam(value Teamable)() +} +type CopilotSeatDetails_CopilotSeatDetails_assigning_teamable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnterpriseTeam()(EnterpriseTeamable) + GetTeam()(Teamable) + SetEnterpriseTeam(value EnterpriseTeamable)() + SetTeam(value Teamable)() +} +// NewCopilotSeatDetails instantiates a new CopilotSeatDetails and sets the default values. +func NewCopilotSeatDetails()(*CopilotSeatDetails) { + m := &CopilotSeatDetails{ + } + return m +} +// CreateCopilotSeatDetailsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCopilotSeatDetailsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCopilotSeatDetails(), nil +} +// GetAssignee gets the assignee property value. The assignee that has been granted access to GitHub Copilot. +// returns a CopilotSeatDetails_CopilotSeatDetails_assigneeable when successful +func (m *CopilotSeatDetails) GetAssignee()(CopilotSeatDetails_CopilotSeatDetails_assigneeable) { + return m.assignee +} +// GetAssigningTeam gets the assigning_team property value. The team through which the assignee is granted access to GitHub Copilot, if applicable. +// returns a CopilotSeatDetails_CopilotSeatDetails_assigning_teamable when successful +func (m *CopilotSeatDetails) GetAssigningTeam()(CopilotSeatDetails_CopilotSeatDetails_assigning_teamable) { + return m.assigning_team +} +// GetCreatedAt gets the created_at property value. Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. +// returns a *Time when successful +func (m *CopilotSeatDetails) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CopilotSeatDetails) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCopilotSeatDetails_CopilotSeatDetails_assigneeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(CopilotSeatDetails_CopilotSeatDetails_assigneeable)) + } + return nil + } + res["assigning_team"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCopilotSeatDetails_CopilotSeatDetails_assigning_teamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssigningTeam(val.(CopilotSeatDetails_CopilotSeatDetails_assigning_teamable)) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["last_activity_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastActivityAt(val) + } + return nil + } + res["last_activity_editor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLastActivityEditor(val) + } + return nil + } + res["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCopilotSeatDetails_organizationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrganization(val.(CopilotSeatDetails_organizationable)) + } + return nil + } + res["pending_cancellation_date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetDateOnlyValue() + if err != nil { + return err + } + if val != nil { + m.SetPendingCancellationDate(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetLastActivityAt gets the last_activity_at property value. Timestamp of user's last GitHub Copilot activity, in ISO 8601 format. +// returns a *Time when successful +func (m *CopilotSeatDetails) GetLastActivityAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.last_activity_at +} +// GetLastActivityEditor gets the last_activity_editor property value. Last editor that was used by the user for a GitHub Copilot completion. +// returns a *string when successful +func (m *CopilotSeatDetails) GetLastActivityEditor()(*string) { + return m.last_activity_editor +} +// GetOrganization gets the organization property value. The organization to which this seat belongs. +// returns a CopilotSeatDetails_organizationable when successful +func (m *CopilotSeatDetails) GetOrganization()(CopilotSeatDetails_organizationable) { + return m.organization +} +// GetPendingCancellationDate gets the pending_cancellation_date property value. The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle. +// returns a *DateOnly when successful +func (m *CopilotSeatDetails) GetPendingCancellationDate()(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly) { + return m.pending_cancellation_date +} +// GetUpdatedAt gets the updated_at property value. Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format. +// returns a *Time when successful +func (m *CopilotSeatDetails) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *CopilotSeatDetails) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assigning_team", m.GetAssigningTeam()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("last_activity_at", m.GetLastActivityAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("last_activity_editor", m.GetLastActivityEditor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("organization", m.GetOrganization()) + if err != nil { + return err + } + } + { + err := writer.WriteDateOnlyValue("pending_cancellation_date", m.GetPendingCancellationDate()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + return nil +} +// SetAssignee sets the assignee property value. The assignee that has been granted access to GitHub Copilot. +func (m *CopilotSeatDetails) SetAssignee(value CopilotSeatDetails_CopilotSeatDetails_assigneeable)() { + m.assignee = value +} +// SetAssigningTeam sets the assigning_team property value. The team through which the assignee is granted access to GitHub Copilot, if applicable. +func (m *CopilotSeatDetails) SetAssigningTeam(value CopilotSeatDetails_CopilotSeatDetails_assigning_teamable)() { + m.assigning_team = value +} +// SetCreatedAt sets the created_at property value. Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. +func (m *CopilotSeatDetails) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetLastActivityAt sets the last_activity_at property value. Timestamp of user's last GitHub Copilot activity, in ISO 8601 format. +func (m *CopilotSeatDetails) SetLastActivityAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.last_activity_at = value +} +// SetLastActivityEditor sets the last_activity_editor property value. Last editor that was used by the user for a GitHub Copilot completion. +func (m *CopilotSeatDetails) SetLastActivityEditor(value *string)() { + m.last_activity_editor = value +} +// SetOrganization sets the organization property value. The organization to which this seat belongs. +func (m *CopilotSeatDetails) SetOrganization(value CopilotSeatDetails_organizationable)() { + m.organization = value +} +// SetPendingCancellationDate sets the pending_cancellation_date property value. The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle. +func (m *CopilotSeatDetails) SetPendingCancellationDate(value *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly)() { + m.pending_cancellation_date = value +} +// SetUpdatedAt sets the updated_at property value. Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format. +func (m *CopilotSeatDetails) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type CopilotSeatDetailsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssignee()(CopilotSeatDetails_CopilotSeatDetails_assigneeable) + GetAssigningTeam()(CopilotSeatDetails_CopilotSeatDetails_assigning_teamable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetLastActivityAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetLastActivityEditor()(*string) + GetOrganization()(CopilotSeatDetails_organizationable) + GetPendingCancellationDate()(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetAssignee(value CopilotSeatDetails_CopilotSeatDetails_assigneeable)() + SetAssigningTeam(value CopilotSeatDetails_CopilotSeatDetails_assigning_teamable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetLastActivityAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetLastActivityEditor(value *string)() + SetOrganization(value CopilotSeatDetails_organizationable)() + SetPendingCancellationDate(value *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_seat_details_organization.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_seat_details_organization.go new file mode 100644 index 000000000..9ef2e1059 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_seat_details_organization.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CopilotSeatDetails_organization the organization to which this seat belongs. +type CopilotSeatDetails_organization struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewCopilotSeatDetails_organization instantiates a new CopilotSeatDetails_organization and sets the default values. +func NewCopilotSeatDetails_organization()(*CopilotSeatDetails_organization) { + m := &CopilotSeatDetails_organization{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCopilotSeatDetails_organizationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCopilotSeatDetails_organizationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCopilotSeatDetails_organization(), 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 *CopilotSeatDetails_organization) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CopilotSeatDetails_organization) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *CopilotSeatDetails_organization) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *CopilotSeatDetails_organization) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type CopilotSeatDetails_organizationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_usage_metrics.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_usage_metrics.go new file mode 100644 index 000000000..0cee13ef5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_usage_metrics.go @@ -0,0 +1,335 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CopilotUsageMetrics summary of Copilot usage. +type CopilotUsageMetrics struct { + // Breakdown of Copilot code completions usage by language and editor + breakdown []CopilotUsageMetrics_breakdownable + // The date for which the usage metrics are reported, in `YYYY-MM-DD` format. + day *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly + // The total number of Copilot code completion suggestions accepted by users. + total_acceptances_count *int32 + // The total number of users who interacted with Copilot Chat in the IDE during the day specified. + total_active_chat_users *int32 + // The total number of users who were shown Copilot code completion suggestions during the day specified. + total_active_users *int32 + // The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline). + total_chat_acceptances *int32 + // The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE. + total_chat_turns *int32 + // The total number of lines of code completions accepted by users. + total_lines_accepted *int32 + // The total number of lines of code completions suggested by Copilot. + total_lines_suggested *int32 + // The total number of Copilot code completion suggestions shown to users. + total_suggestions_count *int32 +} +// NewCopilotUsageMetrics instantiates a new CopilotUsageMetrics and sets the default values. +func NewCopilotUsageMetrics()(*CopilotUsageMetrics) { + m := &CopilotUsageMetrics{ + } + return m +} +// CreateCopilotUsageMetricsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCopilotUsageMetricsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCopilotUsageMetrics(), nil +} +// GetBreakdown gets the breakdown property value. Breakdown of Copilot code completions usage by language and editor +// returns a []CopilotUsageMetrics_breakdownable when successful +func (m *CopilotUsageMetrics) GetBreakdown()([]CopilotUsageMetrics_breakdownable) { + return m.breakdown +} +// GetDay gets the day property value. The date for which the usage metrics are reported, in `YYYY-MM-DD` format. +// returns a *DateOnly when successful +func (m *CopilotUsageMetrics) GetDay()(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly) { + return m.day +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CopilotUsageMetrics) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["breakdown"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCopilotUsageMetrics_breakdownFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CopilotUsageMetrics_breakdownable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CopilotUsageMetrics_breakdownable) + } + } + m.SetBreakdown(res) + } + return nil + } + res["day"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetDateOnlyValue() + if err != nil { + return err + } + if val != nil { + m.SetDay(val) + } + return nil + } + res["total_acceptances_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalAcceptancesCount(val) + } + return nil + } + res["total_active_chat_users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalActiveChatUsers(val) + } + return nil + } + res["total_active_users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalActiveUsers(val) + } + return nil + } + res["total_chat_acceptances"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalChatAcceptances(val) + } + return nil + } + res["total_chat_turns"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalChatTurns(val) + } + return nil + } + res["total_lines_accepted"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalLinesAccepted(val) + } + return nil + } + res["total_lines_suggested"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalLinesSuggested(val) + } + return nil + } + res["total_suggestions_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalSuggestionsCount(val) + } + return nil + } + return res +} +// GetTotalAcceptancesCount gets the total_acceptances_count property value. The total number of Copilot code completion suggestions accepted by users. +// returns a *int32 when successful +func (m *CopilotUsageMetrics) GetTotalAcceptancesCount()(*int32) { + return m.total_acceptances_count +} +// GetTotalActiveChatUsers gets the total_active_chat_users property value. The total number of users who interacted with Copilot Chat in the IDE during the day specified. +// returns a *int32 when successful +func (m *CopilotUsageMetrics) GetTotalActiveChatUsers()(*int32) { + return m.total_active_chat_users +} +// GetTotalActiveUsers gets the total_active_users property value. The total number of users who were shown Copilot code completion suggestions during the day specified. +// returns a *int32 when successful +func (m *CopilotUsageMetrics) GetTotalActiveUsers()(*int32) { + return m.total_active_users +} +// GetTotalChatAcceptances gets the total_chat_acceptances property value. The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline). +// returns a *int32 when successful +func (m *CopilotUsageMetrics) GetTotalChatAcceptances()(*int32) { + return m.total_chat_acceptances +} +// GetTotalChatTurns gets the total_chat_turns property value. The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE. +// returns a *int32 when successful +func (m *CopilotUsageMetrics) GetTotalChatTurns()(*int32) { + return m.total_chat_turns +} +// GetTotalLinesAccepted gets the total_lines_accepted property value. The total number of lines of code completions accepted by users. +// returns a *int32 when successful +func (m *CopilotUsageMetrics) GetTotalLinesAccepted()(*int32) { + return m.total_lines_accepted +} +// GetTotalLinesSuggested gets the total_lines_suggested property value. The total number of lines of code completions suggested by Copilot. +// returns a *int32 when successful +func (m *CopilotUsageMetrics) GetTotalLinesSuggested()(*int32) { + return m.total_lines_suggested +} +// GetTotalSuggestionsCount gets the total_suggestions_count property value. The total number of Copilot code completion suggestions shown to users. +// returns a *int32 when successful +func (m *CopilotUsageMetrics) GetTotalSuggestionsCount()(*int32) { + return m.total_suggestions_count +} +// Serialize serializes information the current object +func (m *CopilotUsageMetrics) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBreakdown() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetBreakdown())) + for i, v := range m.GetBreakdown() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("breakdown", cast) + if err != nil { + return err + } + } + { + err := writer.WriteDateOnlyValue("day", m.GetDay()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_acceptances_count", m.GetTotalAcceptancesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_active_chat_users", m.GetTotalActiveChatUsers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_active_users", m.GetTotalActiveUsers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_chat_acceptances", m.GetTotalChatAcceptances()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_chat_turns", m.GetTotalChatTurns()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_lines_accepted", m.GetTotalLinesAccepted()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_lines_suggested", m.GetTotalLinesSuggested()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_suggestions_count", m.GetTotalSuggestionsCount()) + if err != nil { + return err + } + } + return nil +} +// SetBreakdown sets the breakdown property value. Breakdown of Copilot code completions usage by language and editor +func (m *CopilotUsageMetrics) SetBreakdown(value []CopilotUsageMetrics_breakdownable)() { + m.breakdown = value +} +// SetDay sets the day property value. The date for which the usage metrics are reported, in `YYYY-MM-DD` format. +func (m *CopilotUsageMetrics) SetDay(value *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly)() { + m.day = value +} +// SetTotalAcceptancesCount sets the total_acceptances_count property value. The total number of Copilot code completion suggestions accepted by users. +func (m *CopilotUsageMetrics) SetTotalAcceptancesCount(value *int32)() { + m.total_acceptances_count = value +} +// SetTotalActiveChatUsers sets the total_active_chat_users property value. The total number of users who interacted with Copilot Chat in the IDE during the day specified. +func (m *CopilotUsageMetrics) SetTotalActiveChatUsers(value *int32)() { + m.total_active_chat_users = value +} +// SetTotalActiveUsers sets the total_active_users property value. The total number of users who were shown Copilot code completion suggestions during the day specified. +func (m *CopilotUsageMetrics) SetTotalActiveUsers(value *int32)() { + m.total_active_users = value +} +// SetTotalChatAcceptances sets the total_chat_acceptances property value. The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline). +func (m *CopilotUsageMetrics) SetTotalChatAcceptances(value *int32)() { + m.total_chat_acceptances = value +} +// SetTotalChatTurns sets the total_chat_turns property value. The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE. +func (m *CopilotUsageMetrics) SetTotalChatTurns(value *int32)() { + m.total_chat_turns = value +} +// SetTotalLinesAccepted sets the total_lines_accepted property value. The total number of lines of code completions accepted by users. +func (m *CopilotUsageMetrics) SetTotalLinesAccepted(value *int32)() { + m.total_lines_accepted = value +} +// SetTotalLinesSuggested sets the total_lines_suggested property value. The total number of lines of code completions suggested by Copilot. +func (m *CopilotUsageMetrics) SetTotalLinesSuggested(value *int32)() { + m.total_lines_suggested = value +} +// SetTotalSuggestionsCount sets the total_suggestions_count property value. The total number of Copilot code completion suggestions shown to users. +func (m *CopilotUsageMetrics) SetTotalSuggestionsCount(value *int32)() { + m.total_suggestions_count = value +} +type CopilotUsageMetricsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBreakdown()([]CopilotUsageMetrics_breakdownable) + GetDay()(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly) + GetTotalAcceptancesCount()(*int32) + GetTotalActiveChatUsers()(*int32) + GetTotalActiveUsers()(*int32) + GetTotalChatAcceptances()(*int32) + GetTotalChatTurns()(*int32) + GetTotalLinesAccepted()(*int32) + GetTotalLinesSuggested()(*int32) + GetTotalSuggestionsCount()(*int32) + SetBreakdown(value []CopilotUsageMetrics_breakdownable)() + SetDay(value *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly)() + SetTotalAcceptancesCount(value *int32)() + SetTotalActiveChatUsers(value *int32)() + SetTotalActiveUsers(value *int32)() + SetTotalChatAcceptances(value *int32)() + SetTotalChatTurns(value *int32)() + SetTotalLinesAccepted(value *int32)() + SetTotalLinesSuggested(value *int32)() + SetTotalSuggestionsCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_usage_metrics_breakdown.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_usage_metrics_breakdown.go new file mode 100644 index 000000000..9924ca1fd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/copilot_usage_metrics_breakdown.go @@ -0,0 +1,255 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CopilotUsageMetrics_breakdown breakdown of Copilot usage by editor for this language +type CopilotUsageMetrics_breakdown struct { + // The number of Copilot suggestions accepted by users in the editor specified during the day specified. + acceptances_count *int32 + // The number of users who were shown Copilot completion suggestions in the editor specified during the day specified. + active_users *int32 + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The editor in which Copilot suggestions were shown to users for the specified language. + editor *string + // The language in which Copilot suggestions were shown to users in the specified editor. + language *string + // The number of lines of code accepted by users in the editor specified during the day specified. + lines_accepted *int32 + // The number of lines of code suggested by Copilot in the editor specified during the day specified. + lines_suggested *int32 + // The number of Copilot suggestions shown to users in the editor specified during the day specified. + suggestions_count *int32 +} +// NewCopilotUsageMetrics_breakdown instantiates a new CopilotUsageMetrics_breakdown and sets the default values. +func NewCopilotUsageMetrics_breakdown()(*CopilotUsageMetrics_breakdown) { + m := &CopilotUsageMetrics_breakdown{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCopilotUsageMetrics_breakdownFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCopilotUsageMetrics_breakdownFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCopilotUsageMetrics_breakdown(), nil +} +// GetAcceptancesCount gets the acceptances_count property value. The number of Copilot suggestions accepted by users in the editor specified during the day specified. +// returns a *int32 when successful +func (m *CopilotUsageMetrics_breakdown) GetAcceptancesCount()(*int32) { + return m.acceptances_count +} +// GetActiveUsers gets the active_users property value. The number of users who were shown Copilot completion suggestions in the editor specified during the day specified. +// returns a *int32 when successful +func (m *CopilotUsageMetrics_breakdown) GetActiveUsers()(*int32) { + return m.active_users +} +// 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 *CopilotUsageMetrics_breakdown) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEditor gets the editor property value. The editor in which Copilot suggestions were shown to users for the specified language. +// returns a *string when successful +func (m *CopilotUsageMetrics_breakdown) GetEditor()(*string) { + return m.editor +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CopilotUsageMetrics_breakdown) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["acceptances_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAcceptancesCount(val) + } + return nil + } + res["active_users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetActiveUsers(val) + } + return nil + } + res["editor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEditor(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["lines_accepted"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLinesAccepted(val) + } + return nil + } + res["lines_suggested"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLinesSuggested(val) + } + return nil + } + res["suggestions_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSuggestionsCount(val) + } + return nil + } + return res +} +// GetLanguage gets the language property value. The language in which Copilot suggestions were shown to users in the specified editor. +// returns a *string when successful +func (m *CopilotUsageMetrics_breakdown) GetLanguage()(*string) { + return m.language +} +// GetLinesAccepted gets the lines_accepted property value. The number of lines of code accepted by users in the editor specified during the day specified. +// returns a *int32 when successful +func (m *CopilotUsageMetrics_breakdown) GetLinesAccepted()(*int32) { + return m.lines_accepted +} +// GetLinesSuggested gets the lines_suggested property value. The number of lines of code suggested by Copilot in the editor specified during the day specified. +// returns a *int32 when successful +func (m *CopilotUsageMetrics_breakdown) GetLinesSuggested()(*int32) { + return m.lines_suggested +} +// GetSuggestionsCount gets the suggestions_count property value. The number of Copilot suggestions shown to users in the editor specified during the day specified. +// returns a *int32 when successful +func (m *CopilotUsageMetrics_breakdown) GetSuggestionsCount()(*int32) { + return m.suggestions_count +} +// Serialize serializes information the current object +func (m *CopilotUsageMetrics_breakdown) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("acceptances_count", m.GetAcceptancesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("active_users", m.GetActiveUsers()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("editor", m.GetEditor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("lines_accepted", m.GetLinesAccepted()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("lines_suggested", m.GetLinesSuggested()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("suggestions_count", m.GetSuggestionsCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAcceptancesCount sets the acceptances_count property value. The number of Copilot suggestions accepted by users in the editor specified during the day specified. +func (m *CopilotUsageMetrics_breakdown) SetAcceptancesCount(value *int32)() { + m.acceptances_count = value +} +// SetActiveUsers sets the active_users property value. The number of users who were shown Copilot completion suggestions in the editor specified during the day specified. +func (m *CopilotUsageMetrics_breakdown) SetActiveUsers(value *int32)() { + m.active_users = value +} +// 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 *CopilotUsageMetrics_breakdown) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEditor sets the editor property value. The editor in which Copilot suggestions were shown to users for the specified language. +func (m *CopilotUsageMetrics_breakdown) SetEditor(value *string)() { + m.editor = value +} +// SetLanguage sets the language property value. The language in which Copilot suggestions were shown to users in the specified editor. +func (m *CopilotUsageMetrics_breakdown) SetLanguage(value *string)() { + m.language = value +} +// SetLinesAccepted sets the lines_accepted property value. The number of lines of code accepted by users in the editor specified during the day specified. +func (m *CopilotUsageMetrics_breakdown) SetLinesAccepted(value *int32)() { + m.lines_accepted = value +} +// SetLinesSuggested sets the lines_suggested property value. The number of lines of code suggested by Copilot in the editor specified during the day specified. +func (m *CopilotUsageMetrics_breakdown) SetLinesSuggested(value *int32)() { + m.lines_suggested = value +} +// SetSuggestionsCount sets the suggestions_count property value. The number of Copilot suggestions shown to users in the editor specified during the day specified. +func (m *CopilotUsageMetrics_breakdown) SetSuggestionsCount(value *int32)() { + m.suggestions_count = value +} +type CopilotUsageMetrics_breakdownable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAcceptancesCount()(*int32) + GetActiveUsers()(*int32) + GetEditor()(*string) + GetLanguage()(*string) + GetLinesAccepted()(*int32) + GetLinesSuggested()(*int32) + GetSuggestionsCount()(*int32) + SetAcceptancesCount(value *int32)() + SetActiveUsers(value *int32)() + SetEditor(value *string)() + SetLanguage(value *string)() + SetLinesAccepted(value *int32)() + SetLinesSuggested(value *int32)() + SetSuggestionsCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/custom_deployment_rule_app.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/custom_deployment_rule_app.go new file mode 100644 index 000000000..9f1613c98 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/custom_deployment_rule_app.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CustomDeploymentRuleApp a GitHub App that is providing a custom deployment protection rule. +type CustomDeploymentRuleApp struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The unique identifier of the deployment protection rule integration. + id *int32 + // The URL for the endpoint to get details about the app. + integration_url *string + // The node ID for the deployment protection rule integration. + node_id *string + // The slugified name of the deployment protection rule integration. + slug *string +} +// NewCustomDeploymentRuleApp instantiates a new CustomDeploymentRuleApp and sets the default values. +func NewCustomDeploymentRuleApp()(*CustomDeploymentRuleApp) { + m := &CustomDeploymentRuleApp{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCustomDeploymentRuleAppFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCustomDeploymentRuleAppFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCustomDeploymentRuleApp(), 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 *CustomDeploymentRuleApp) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CustomDeploymentRuleApp) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["integration_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIntegrationUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + return res +} +// GetId gets the id property value. The unique identifier of the deployment protection rule integration. +// returns a *int32 when successful +func (m *CustomDeploymentRuleApp) GetId()(*int32) { + return m.id +} +// GetIntegrationUrl gets the integration_url property value. The URL for the endpoint to get details about the app. +// returns a *string when successful +func (m *CustomDeploymentRuleApp) GetIntegrationUrl()(*string) { + return m.integration_url +} +// GetNodeId gets the node_id property value. The node ID for the deployment protection rule integration. +// returns a *string when successful +func (m *CustomDeploymentRuleApp) GetNodeId()(*string) { + return m.node_id +} +// GetSlug gets the slug property value. The slugified name of the deployment protection rule integration. +// returns a *string when successful +func (m *CustomDeploymentRuleApp) GetSlug()(*string) { + return m.slug +} +// Serialize serializes information the current object +func (m *CustomDeploymentRuleApp) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("integration_url", m.GetIntegrationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + 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 *CustomDeploymentRuleApp) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The unique identifier of the deployment protection rule integration. +func (m *CustomDeploymentRuleApp) SetId(value *int32)() { + m.id = value +} +// SetIntegrationUrl sets the integration_url property value. The URL for the endpoint to get details about the app. +func (m *CustomDeploymentRuleApp) SetIntegrationUrl(value *string)() { + m.integration_url = value +} +// SetNodeId sets the node_id property value. The node ID for the deployment protection rule integration. +func (m *CustomDeploymentRuleApp) SetNodeId(value *string)() { + m.node_id = value +} +// SetSlug sets the slug property value. The slugified name of the deployment protection rule integration. +func (m *CustomDeploymentRuleApp) SetSlug(value *string)() { + m.slug = value +} +type CustomDeploymentRuleAppable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetIntegrationUrl()(*string) + GetNodeId()(*string) + GetSlug()(*string) + SetId(value *int32)() + SetIntegrationUrl(value *string)() + SetNodeId(value *string)() + SetSlug(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/custom_property_value.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/custom_property_value.go new file mode 100644 index 000000000..5608853bf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/custom_property_value.go @@ -0,0 +1,181 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CustomPropertyValue custom property name and associated value +type CustomPropertyValue struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name of the property + property_name *string + // The value assigned to the property + value CustomPropertyValue_CustomPropertyValue_valueable +} +// CustomPropertyValue_CustomPropertyValue_value composed type wrapper for classes string +type CustomPropertyValue_CustomPropertyValue_value struct { + // Composed type representation for type string + string *string +} +// NewCustomPropertyValue_CustomPropertyValue_value instantiates a new CustomPropertyValue_CustomPropertyValue_value and sets the default values. +func NewCustomPropertyValue_CustomPropertyValue_value()(*CustomPropertyValue_CustomPropertyValue_value) { + m := &CustomPropertyValue_CustomPropertyValue_value{ + } + return m +} +// CreateCustomPropertyValue_CustomPropertyValue_valueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCustomPropertyValue_CustomPropertyValue_valueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewCustomPropertyValue_CustomPropertyValue_value() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CustomPropertyValue_CustomPropertyValue_value) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *CustomPropertyValue_CustomPropertyValue_value) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *CustomPropertyValue_CustomPropertyValue_value) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *CustomPropertyValue_CustomPropertyValue_value) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetString sets the string property value. Composed type representation for type string +func (m *CustomPropertyValue_CustomPropertyValue_value) SetString(value *string)() { + m.string = value +} +type CustomPropertyValue_CustomPropertyValue_valueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetString()(*string) + SetString(value *string)() +} +// NewCustomPropertyValue instantiates a new CustomPropertyValue and sets the default values. +func NewCustomPropertyValue()(*CustomPropertyValue) { + m := &CustomPropertyValue{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCustomPropertyValueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCustomPropertyValueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCustomPropertyValue(), 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 *CustomPropertyValue) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CustomPropertyValue) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["property_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPropertyName(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCustomPropertyValue_CustomPropertyValue_valueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetValue(val.(CustomPropertyValue_CustomPropertyValue_valueable)) + } + return nil + } + return res +} +// GetPropertyName gets the property_name property value. The name of the property +// returns a *string when successful +func (m *CustomPropertyValue) GetPropertyName()(*string) { + return m.property_name +} +// GetValue gets the value property value. The value assigned to the property +// returns a CustomPropertyValue_CustomPropertyValue_valueable when successful +func (m *CustomPropertyValue) GetValue()(CustomPropertyValue_CustomPropertyValue_valueable) { + return m.value +} +// Serialize serializes information the current object +func (m *CustomPropertyValue) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("property_name", m.GetPropertyName()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("value", m.GetValue()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CustomPropertyValue) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPropertyName sets the property_name property value. The name of the property +func (m *CustomPropertyValue) SetPropertyName(value *string)() { + m.property_name = value +} +// SetValue sets the value property value. The value assigned to the property +func (m *CustomPropertyValue) SetValue(value CustomPropertyValue_CustomPropertyValue_valueable)() { + m.value = value +} +type CustomPropertyValueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPropertyName()(*string) + GetValue()(CustomPropertyValue_CustomPropertyValue_valueable) + SetPropertyName(value *string)() + SetValue(value CustomPropertyValue_CustomPropertyValue_valueable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/databases503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/databases503_error.go new file mode 100644 index 000000000..671c2a4a2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/databases503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Databases503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewDatabases503Error instantiates a new Databases503Error and sets the default values. +func NewDatabases503Error()(*Databases503Error) { + m := &Databases503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDatabases503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDatabases503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDatabases503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Databases503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Databases503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Databases503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Databases503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Databases503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Databases503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Databases503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *Databases503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Databases503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Databases503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Databases503Error) SetMessage(value *string)() { + m.message = value +} +type Databases503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/demilestoned_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/demilestoned_issue_event.go new file mode 100644 index 000000000..ad3ecb119 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/demilestoned_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DemilestonedIssueEvent demilestoned Issue Event +type DemilestonedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The milestone property + milestone DemilestonedIssueEvent_milestoneable + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewDemilestonedIssueEvent instantiates a new DemilestonedIssueEvent and sets the default values. +func NewDemilestonedIssueEvent()(*DemilestonedIssueEvent) { + m := &DemilestonedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDemilestonedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDemilestonedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDemilestonedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *DemilestonedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *DemilestonedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *DemilestonedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *DemilestonedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *DemilestonedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *DemilestonedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DemilestonedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDemilestonedIssueEvent_milestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(DemilestonedIssueEvent_milestoneable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *DemilestonedIssueEvent) GetId()(*int32) { + return m.id +} +// GetMilestone gets the milestone property value. The milestone property +// returns a DemilestonedIssueEvent_milestoneable when successful +func (m *DemilestonedIssueEvent) GetMilestone()(DemilestonedIssueEvent_milestoneable) { + return m.milestone +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *DemilestonedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *DemilestonedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *DemilestonedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *DemilestonedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *DemilestonedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *DemilestonedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *DemilestonedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *DemilestonedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *DemilestonedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *DemilestonedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *DemilestonedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetMilestone sets the milestone property value. The milestone property +func (m *DemilestonedIssueEvent) SetMilestone(value DemilestonedIssueEvent_milestoneable)() { + m.milestone = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *DemilestonedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *DemilestonedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *DemilestonedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type DemilestonedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetMilestone()(DemilestonedIssueEvent_milestoneable) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetMilestone(value DemilestonedIssueEvent_milestoneable)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/demilestoned_issue_event_milestone.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/demilestoned_issue_event_milestone.go new file mode 100644 index 000000000..e864bc2b8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/demilestoned_issue_event_milestone.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DemilestonedIssueEvent_milestone struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The title property + title *string +} +// NewDemilestonedIssueEvent_milestone instantiates a new DemilestonedIssueEvent_milestone and sets the default values. +func NewDemilestonedIssueEvent_milestone()(*DemilestonedIssueEvent_milestone) { + m := &DemilestonedIssueEvent_milestone{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDemilestonedIssueEvent_milestoneFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDemilestonedIssueEvent_milestoneFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDemilestonedIssueEvent_milestone(), 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 *DemilestonedIssueEvent_milestone) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DemilestonedIssueEvent_milestone) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *DemilestonedIssueEvent_milestone) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *DemilestonedIssueEvent_milestone) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *DemilestonedIssueEvent_milestone) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTitle sets the title property value. The title property +func (m *DemilestonedIssueEvent_milestone) SetTitle(value *string)() { + m.title = value +} +type DemilestonedIssueEvent_milestoneable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTitle()(*string) + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert.go new file mode 100644 index 000000000..823058ff1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert.go @@ -0,0 +1,398 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlert a Dependabot alert. +type DependabotAlert struct { + // The time that the alert was auto-dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + auto_dismissed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Details for the vulnerable dependency. + dependency DependabotAlert_dependencyable + // The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + dismissed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + dismissed_by NullableSimpleUserable + // An optional comment associated with the alert's dismissal. + dismissed_comment *string + // The reason that the alert was dismissed. + dismissed_reason *DependabotAlert_dismissed_reason + // The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + fixed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The GitHub URL of the alert resource. + html_url *string + // The security alert number. + number *int32 + // Details for the GitHub Security Advisory. + security_advisory DependabotAlertSecurityAdvisoryable + // Details pertaining to one vulnerable version range for the advisory. + security_vulnerability DependabotAlertSecurityVulnerabilityable + // The state of the Dependabot alert. + state *DependabotAlert_state + // The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The REST API URL of the alert resource. + url *string +} +// NewDependabotAlert instantiates a new DependabotAlert and sets the default values. +func NewDependabotAlert()(*DependabotAlert) { + m := &DependabotAlert{ + } + return m +} +// CreateDependabotAlertFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlert(), nil +} +// GetAutoDismissedAt gets the auto_dismissed_at property value. The time that the alert was auto-dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlert) GetAutoDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.auto_dismissed_at +} +// GetCreatedAt gets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlert) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDependency gets the dependency property value. Details for the vulnerable dependency. +// returns a DependabotAlert_dependencyable when successful +func (m *DependabotAlert) GetDependency()(DependabotAlert_dependencyable) { + return m.dependency +} +// GetDismissedAt gets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlert) GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.dismissed_at +} +// GetDismissedBy gets the dismissed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *DependabotAlert) GetDismissedBy()(NullableSimpleUserable) { + return m.dismissed_by +} +// GetDismissedComment gets the dismissed_comment property value. An optional comment associated with the alert's dismissal. +// returns a *string when successful +func (m *DependabotAlert) GetDismissedComment()(*string) { + return m.dismissed_comment +} +// GetDismissedReason gets the dismissed_reason property value. The reason that the alert was dismissed. +// returns a *DependabotAlert_dismissed_reason when successful +func (m *DependabotAlert) GetDismissedReason()(*DependabotAlert_dismissed_reason) { + return m.dismissed_reason +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlert) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["auto_dismissed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetAutoDismissedAt(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["dependency"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlert_dependencyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDependency(val.(DependabotAlert_dependencyable)) + } + return nil + } + res["dismissed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedAt(val) + } + return nil + } + res["dismissed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["dismissed_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedComment(val) + } + return nil + } + res["dismissed_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlert_dismissed_reason) + if err != nil { + return err + } + if val != nil { + m.SetDismissedReason(val.(*DependabotAlert_dismissed_reason)) + } + return nil + } + res["fixed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetFixedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["security_advisory"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertSecurityAdvisoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAdvisory(val.(DependabotAlertSecurityAdvisoryable)) + } + return nil + } + res["security_vulnerability"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertSecurityVulnerabilityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityVulnerability(val.(DependabotAlertSecurityVulnerabilityable)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlert_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*DependabotAlert_state)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFixedAt gets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlert) GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.fixed_at +} +// GetHtmlUrl gets the html_url property value. The GitHub URL of the alert resource. +// returns a *string when successful +func (m *DependabotAlert) GetHtmlUrl()(*string) { + return m.html_url +} +// GetNumber gets the number property value. The security alert number. +// returns a *int32 when successful +func (m *DependabotAlert) GetNumber()(*int32) { + return m.number +} +// GetSecurityAdvisory gets the security_advisory property value. Details for the GitHub Security Advisory. +// returns a DependabotAlertSecurityAdvisoryable when successful +func (m *DependabotAlert) GetSecurityAdvisory()(DependabotAlertSecurityAdvisoryable) { + return m.security_advisory +} +// GetSecurityVulnerability gets the security_vulnerability property value. Details pertaining to one vulnerable version range for the advisory. +// returns a DependabotAlertSecurityVulnerabilityable when successful +func (m *DependabotAlert) GetSecurityVulnerability()(DependabotAlertSecurityVulnerabilityable) { + return m.security_vulnerability +} +// GetState gets the state property value. The state of the Dependabot alert. +// returns a *DependabotAlert_state when successful +func (m *DependabotAlert) GetState()(*DependabotAlert_state) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlert) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The REST API URL of the alert resource. +// returns a *string when successful +func (m *DependabotAlert) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *DependabotAlert) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("dismissed_by", m.GetDismissedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("dismissed_comment", m.GetDismissedComment()) + if err != nil { + return err + } + } + if m.GetDismissedReason() != nil { + cast := (*m.GetDismissedReason()).String() + err := writer.WriteStringValue("dismissed_reason", &cast) + if err != nil { + return err + } + } + return nil +} +// SetAutoDismissedAt sets the auto_dismissed_at property value. The time that the alert was auto-dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlert) SetAutoDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.auto_dismissed_at = value +} +// SetCreatedAt sets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlert) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDependency sets the dependency property value. Details for the vulnerable dependency. +func (m *DependabotAlert) SetDependency(value DependabotAlert_dependencyable)() { + m.dependency = value +} +// SetDismissedAt sets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlert) SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.dismissed_at = value +} +// SetDismissedBy sets the dismissed_by property value. A GitHub user. +func (m *DependabotAlert) SetDismissedBy(value NullableSimpleUserable)() { + m.dismissed_by = value +} +// SetDismissedComment sets the dismissed_comment property value. An optional comment associated with the alert's dismissal. +func (m *DependabotAlert) SetDismissedComment(value *string)() { + m.dismissed_comment = value +} +// SetDismissedReason sets the dismissed_reason property value. The reason that the alert was dismissed. +func (m *DependabotAlert) SetDismissedReason(value *DependabotAlert_dismissed_reason)() { + m.dismissed_reason = value +} +// SetFixedAt sets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlert) SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.fixed_at = value +} +// SetHtmlUrl sets the html_url property value. The GitHub URL of the alert resource. +func (m *DependabotAlert) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetNumber sets the number property value. The security alert number. +func (m *DependabotAlert) SetNumber(value *int32)() { + m.number = value +} +// SetSecurityAdvisory sets the security_advisory property value. Details for the GitHub Security Advisory. +func (m *DependabotAlert) SetSecurityAdvisory(value DependabotAlertSecurityAdvisoryable)() { + m.security_advisory = value +} +// SetSecurityVulnerability sets the security_vulnerability property value. Details pertaining to one vulnerable version range for the advisory. +func (m *DependabotAlert) SetSecurityVulnerability(value DependabotAlertSecurityVulnerabilityable)() { + m.security_vulnerability = value +} +// SetState sets the state property value. The state of the Dependabot alert. +func (m *DependabotAlert) SetState(value *DependabotAlert_state)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlert) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The REST API URL of the alert resource. +func (m *DependabotAlert) SetUrl(value *string)() { + m.url = value +} +type DependabotAlertable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAutoDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDependency()(DependabotAlert_dependencyable) + GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedBy()(NullableSimpleUserable) + GetDismissedComment()(*string) + GetDismissedReason()(*DependabotAlert_dismissed_reason) + GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetNumber()(*int32) + GetSecurityAdvisory()(DependabotAlertSecurityAdvisoryable) + GetSecurityVulnerability()(DependabotAlertSecurityVulnerabilityable) + GetState()(*DependabotAlert_state) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAutoDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDependency(value DependabotAlert_dependencyable)() + SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedBy(value NullableSimpleUserable)() + SetDismissedComment(value *string)() + SetDismissedReason(value *DependabotAlert_dismissed_reason)() + SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetNumber(value *int32)() + SetSecurityAdvisory(value DependabotAlertSecurityAdvisoryable)() + SetSecurityVulnerability(value DependabotAlertSecurityVulnerabilityable)() + SetState(value *DependabotAlert_state)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_dependency.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_dependency.go new file mode 100644 index 000000000..560bb6f25 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_dependency.go @@ -0,0 +1,121 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlert_dependency details for the vulnerable dependency. +type DependabotAlert_dependency struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The full path to the dependency manifest file, relative to the root of the repository. + manifest_path *string + // Details for the vulnerable package. + packageEscaped DependabotAlertPackageable + // The execution scope of the vulnerable dependency. + scope *DependabotAlert_dependency_scope +} +// NewDependabotAlert_dependency instantiates a new DependabotAlert_dependency and sets the default values. +func NewDependabotAlert_dependency()(*DependabotAlert_dependency) { + m := &DependabotAlert_dependency{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependabotAlert_dependencyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlert_dependencyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlert_dependency(), 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 *DependabotAlert_dependency) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlert_dependency) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["manifest_path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetManifestPath(val) + } + return nil + } + res["package"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertPackageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPackageEscaped(val.(DependabotAlertPackageable)) + } + return nil + } + res["scope"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlert_dependency_scope) + if err != nil { + return err + } + if val != nil { + m.SetScope(val.(*DependabotAlert_dependency_scope)) + } + return nil + } + return res +} +// GetManifestPath gets the manifest_path property value. The full path to the dependency manifest file, relative to the root of the repository. +// returns a *string when successful +func (m *DependabotAlert_dependency) GetManifestPath()(*string) { + return m.manifest_path +} +// GetPackageEscaped gets the package property value. Details for the vulnerable package. +// returns a DependabotAlertPackageable when successful +func (m *DependabotAlert_dependency) GetPackageEscaped()(DependabotAlertPackageable) { + return m.packageEscaped +} +// GetScope gets the scope property value. The execution scope of the vulnerable dependency. +// returns a *DependabotAlert_dependency_scope when successful +func (m *DependabotAlert_dependency) GetScope()(*DependabotAlert_dependency_scope) { + return m.scope +} +// Serialize serializes information the current object +func (m *DependabotAlert_dependency) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *DependabotAlert_dependency) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetManifestPath sets the manifest_path property value. The full path to the dependency manifest file, relative to the root of the repository. +func (m *DependabotAlert_dependency) SetManifestPath(value *string)() { + m.manifest_path = value +} +// SetPackageEscaped sets the package property value. Details for the vulnerable package. +func (m *DependabotAlert_dependency) SetPackageEscaped(value DependabotAlertPackageable)() { + m.packageEscaped = value +} +// SetScope sets the scope property value. The execution scope of the vulnerable dependency. +func (m *DependabotAlert_dependency) SetScope(value *DependabotAlert_dependency_scope)() { + m.scope = value +} +type DependabotAlert_dependencyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetManifestPath()(*string) + GetPackageEscaped()(DependabotAlertPackageable) + GetScope()(*DependabotAlert_dependency_scope) + SetManifestPath(value *string)() + SetPackageEscaped(value DependabotAlertPackageable)() + SetScope(value *DependabotAlert_dependency_scope)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_dependency_scope.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_dependency_scope.go new file mode 100644 index 000000000..4daff2e15 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_dependency_scope.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The execution scope of the vulnerable dependency. +type DependabotAlert_dependency_scope int + +const ( + DEVELOPMENT_DEPENDABOTALERT_DEPENDENCY_SCOPE DependabotAlert_dependency_scope = iota + RUNTIME_DEPENDABOTALERT_DEPENDENCY_SCOPE +) + +func (i DependabotAlert_dependency_scope) String() string { + return []string{"development", "runtime"}[i] +} +func ParseDependabotAlert_dependency_scope(v string) (any, error) { + result := DEVELOPMENT_DEPENDABOTALERT_DEPENDENCY_SCOPE + switch v { + case "development": + result = DEVELOPMENT_DEPENDABOTALERT_DEPENDENCY_SCOPE + case "runtime": + result = RUNTIME_DEPENDABOTALERT_DEPENDENCY_SCOPE + default: + return 0, errors.New("Unknown DependabotAlert_dependency_scope value: " + v) + } + return &result, nil +} +func SerializeDependabotAlert_dependency_scope(values []DependabotAlert_dependency_scope) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlert_dependency_scope) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_dismissed_reason.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_dismissed_reason.go new file mode 100644 index 000000000..6226c653a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_dismissed_reason.go @@ -0,0 +1,46 @@ +package models +import ( + "errors" +) +// The reason that the alert was dismissed. +type DependabotAlert_dismissed_reason int + +const ( + FIX_STARTED_DEPENDABOTALERT_DISMISSED_REASON DependabotAlert_dismissed_reason = iota + INACCURATE_DEPENDABOTALERT_DISMISSED_REASON + NO_BANDWIDTH_DEPENDABOTALERT_DISMISSED_REASON + NOT_USED_DEPENDABOTALERT_DISMISSED_REASON + TOLERABLE_RISK_DEPENDABOTALERT_DISMISSED_REASON +) + +func (i DependabotAlert_dismissed_reason) String() string { + return []string{"fix_started", "inaccurate", "no_bandwidth", "not_used", "tolerable_risk"}[i] +} +func ParseDependabotAlert_dismissed_reason(v string) (any, error) { + result := FIX_STARTED_DEPENDABOTALERT_DISMISSED_REASON + switch v { + case "fix_started": + result = FIX_STARTED_DEPENDABOTALERT_DISMISSED_REASON + case "inaccurate": + result = INACCURATE_DEPENDABOTALERT_DISMISSED_REASON + case "no_bandwidth": + result = NO_BANDWIDTH_DEPENDABOTALERT_DISMISSED_REASON + case "not_used": + result = NOT_USED_DEPENDABOTALERT_DISMISSED_REASON + case "tolerable_risk": + result = TOLERABLE_RISK_DEPENDABOTALERT_DISMISSED_REASON + default: + return 0, errors.New("Unknown DependabotAlert_dismissed_reason value: " + v) + } + return &result, nil +} +func SerializeDependabotAlert_dismissed_reason(values []DependabotAlert_dismissed_reason) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlert_dismissed_reason) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_package.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_package.go new file mode 100644 index 000000000..f142485ee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_package.go @@ -0,0 +1,79 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertPackage details for the vulnerable package. +type DependabotAlertPackage struct { + // The package's language or package management ecosystem. + ecosystem *string + // The unique package name within its ecosystem. + name *string +} +// NewDependabotAlertPackage instantiates a new DependabotAlertPackage and sets the default values. +func NewDependabotAlertPackage()(*DependabotAlertPackage) { + m := &DependabotAlertPackage{ + } + return m +} +// CreateDependabotAlertPackageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertPackageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertPackage(), nil +} +// GetEcosystem gets the ecosystem property value. The package's language or package management ecosystem. +// returns a *string when successful +func (m *DependabotAlertPackage) GetEcosystem()(*string) { + return m.ecosystem +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertPackage) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ecosystem"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEcosystem(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The unique package name within its ecosystem. +// returns a *string when successful +func (m *DependabotAlertPackage) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *DependabotAlertPackage) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// SetEcosystem sets the ecosystem property value. The package's language or package management ecosystem. +func (m *DependabotAlertPackage) SetEcosystem(value *string)() { + m.ecosystem = value +} +// SetName sets the name property value. The unique package name within its ecosystem. +func (m *DependabotAlertPackage) SetName(value *string)() { + m.name = value +} +type DependabotAlertPackageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEcosystem()(*string) + GetName()(*string) + SetEcosystem(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory.go new file mode 100644 index 000000000..3d1cdad3a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory.go @@ -0,0 +1,357 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertSecurityAdvisory details for the GitHub Security Advisory. +type DependabotAlertSecurityAdvisory struct { + // The unique CVE ID assigned to the advisory. + cve_id *string + // Details for the advisory pertaining to the Common Vulnerability Scoring System. + cvss DependabotAlertSecurityAdvisory_cvssable + // Details for the advisory pertaining to Common Weakness Enumeration. + cwes []DependabotAlertSecurityAdvisory_cwesable + // A long-form Markdown-supported description of the advisory. + description *string + // The unique GitHub Security Advisory ID assigned to the advisory. + ghsa_id *string + // Values that identify this advisory among security information sources. + identifiers []DependabotAlertSecurityAdvisory_identifiersable + // The time that the advisory was published in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + published_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Links to additional advisory information. + references []DependabotAlertSecurityAdvisory_referencesable + // The severity of the advisory. + severity *DependabotAlertSecurityAdvisory_severity + // A short, plain text summary of the advisory. + summary *string + // The time that the advisory was last modified in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Vulnerable version range information for the advisory. + vulnerabilities []DependabotAlertSecurityVulnerabilityable + // The time that the advisory was withdrawn in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + withdrawn_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewDependabotAlertSecurityAdvisory instantiates a new DependabotAlertSecurityAdvisory and sets the default values. +func NewDependabotAlertSecurityAdvisory()(*DependabotAlertSecurityAdvisory) { + m := &DependabotAlertSecurityAdvisory{ + } + return m +} +// CreateDependabotAlertSecurityAdvisoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertSecurityAdvisoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertSecurityAdvisory(), nil +} +// GetCveId gets the cve_id property value. The unique CVE ID assigned to the advisory. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory) GetCveId()(*string) { + return m.cve_id +} +// GetCvss gets the cvss property value. Details for the advisory pertaining to the Common Vulnerability Scoring System. +// returns a DependabotAlertSecurityAdvisory_cvssable when successful +func (m *DependabotAlertSecurityAdvisory) GetCvss()(DependabotAlertSecurityAdvisory_cvssable) { + return m.cvss +} +// GetCwes gets the cwes property value. Details for the advisory pertaining to Common Weakness Enumeration. +// returns a []DependabotAlertSecurityAdvisory_cwesable when successful +func (m *DependabotAlertSecurityAdvisory) GetCwes()([]DependabotAlertSecurityAdvisory_cwesable) { + return m.cwes +} +// GetDescription gets the description property value. A long-form Markdown-supported description of the advisory. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertSecurityAdvisory) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cve_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCveId(val) + } + return nil + } + res["cvss"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertSecurityAdvisory_cvssFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCvss(val.(DependabotAlertSecurityAdvisory_cvssable)) + } + return nil + } + res["cwes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDependabotAlertSecurityAdvisory_cwesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DependabotAlertSecurityAdvisory_cwesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DependabotAlertSecurityAdvisory_cwesable) + } + } + m.SetCwes(res) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["ghsa_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGhsaId(val) + } + return nil + } + res["identifiers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDependabotAlertSecurityAdvisory_identifiersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DependabotAlertSecurityAdvisory_identifiersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DependabotAlertSecurityAdvisory_identifiersable) + } + } + m.SetIdentifiers(res) + } + return nil + } + res["published_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPublishedAt(val) + } + return nil + } + res["references"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDependabotAlertSecurityAdvisory_referencesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DependabotAlertSecurityAdvisory_referencesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DependabotAlertSecurityAdvisory_referencesable) + } + } + m.SetReferences(res) + } + return nil + } + res["severity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlertSecurityAdvisory_severity) + if err != nil { + return err + } + if val != nil { + m.SetSeverity(val.(*DependabotAlertSecurityAdvisory_severity)) + } + return nil + } + res["summary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSummary(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["vulnerabilities"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDependabotAlertSecurityVulnerabilityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DependabotAlertSecurityVulnerabilityable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DependabotAlertSecurityVulnerabilityable) + } + } + m.SetVulnerabilities(res) + } + return nil + } + res["withdrawn_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetWithdrawnAt(val) + } + return nil + } + return res +} +// GetGhsaId gets the ghsa_id property value. The unique GitHub Security Advisory ID assigned to the advisory. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory) GetGhsaId()(*string) { + return m.ghsa_id +} +// GetIdentifiers gets the identifiers property value. Values that identify this advisory among security information sources. +// returns a []DependabotAlertSecurityAdvisory_identifiersable when successful +func (m *DependabotAlertSecurityAdvisory) GetIdentifiers()([]DependabotAlertSecurityAdvisory_identifiersable) { + return m.identifiers +} +// GetPublishedAt gets the published_at property value. The time that the advisory was published in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlertSecurityAdvisory) GetPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.published_at +} +// GetReferences gets the references property value. Links to additional advisory information. +// returns a []DependabotAlertSecurityAdvisory_referencesable when successful +func (m *DependabotAlertSecurityAdvisory) GetReferences()([]DependabotAlertSecurityAdvisory_referencesable) { + return m.references +} +// GetSeverity gets the severity property value. The severity of the advisory. +// returns a *DependabotAlertSecurityAdvisory_severity when successful +func (m *DependabotAlertSecurityAdvisory) GetSeverity()(*DependabotAlertSecurityAdvisory_severity) { + return m.severity +} +// GetSummary gets the summary property value. A short, plain text summary of the advisory. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory) GetSummary()(*string) { + return m.summary +} +// GetUpdatedAt gets the updated_at property value. The time that the advisory was last modified in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlertSecurityAdvisory) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetVulnerabilities gets the vulnerabilities property value. Vulnerable version range information for the advisory. +// returns a []DependabotAlertSecurityVulnerabilityable when successful +func (m *DependabotAlertSecurityAdvisory) GetVulnerabilities()([]DependabotAlertSecurityVulnerabilityable) { + return m.vulnerabilities +} +// GetWithdrawnAt gets the withdrawn_at property value. The time that the advisory was withdrawn in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlertSecurityAdvisory) GetWithdrawnAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.withdrawn_at +} +// Serialize serializes information the current object +func (m *DependabotAlertSecurityAdvisory) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// SetCveId sets the cve_id property value. The unique CVE ID assigned to the advisory. +func (m *DependabotAlertSecurityAdvisory) SetCveId(value *string)() { + m.cve_id = value +} +// SetCvss sets the cvss property value. Details for the advisory pertaining to the Common Vulnerability Scoring System. +func (m *DependabotAlertSecurityAdvisory) SetCvss(value DependabotAlertSecurityAdvisory_cvssable)() { + m.cvss = value +} +// SetCwes sets the cwes property value. Details for the advisory pertaining to Common Weakness Enumeration. +func (m *DependabotAlertSecurityAdvisory) SetCwes(value []DependabotAlertSecurityAdvisory_cwesable)() { + m.cwes = value +} +// SetDescription sets the description property value. A long-form Markdown-supported description of the advisory. +func (m *DependabotAlertSecurityAdvisory) SetDescription(value *string)() { + m.description = value +} +// SetGhsaId sets the ghsa_id property value. The unique GitHub Security Advisory ID assigned to the advisory. +func (m *DependabotAlertSecurityAdvisory) SetGhsaId(value *string)() { + m.ghsa_id = value +} +// SetIdentifiers sets the identifiers property value. Values that identify this advisory among security information sources. +func (m *DependabotAlertSecurityAdvisory) SetIdentifiers(value []DependabotAlertSecurityAdvisory_identifiersable)() { + m.identifiers = value +} +// SetPublishedAt sets the published_at property value. The time that the advisory was published in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlertSecurityAdvisory) SetPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.published_at = value +} +// SetReferences sets the references property value. Links to additional advisory information. +func (m *DependabotAlertSecurityAdvisory) SetReferences(value []DependabotAlertSecurityAdvisory_referencesable)() { + m.references = value +} +// SetSeverity sets the severity property value. The severity of the advisory. +func (m *DependabotAlertSecurityAdvisory) SetSeverity(value *DependabotAlertSecurityAdvisory_severity)() { + m.severity = value +} +// SetSummary sets the summary property value. A short, plain text summary of the advisory. +func (m *DependabotAlertSecurityAdvisory) SetSummary(value *string)() { + m.summary = value +} +// SetUpdatedAt sets the updated_at property value. The time that the advisory was last modified in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlertSecurityAdvisory) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetVulnerabilities sets the vulnerabilities property value. Vulnerable version range information for the advisory. +func (m *DependabotAlertSecurityAdvisory) SetVulnerabilities(value []DependabotAlertSecurityVulnerabilityable)() { + m.vulnerabilities = value +} +// SetWithdrawnAt sets the withdrawn_at property value. The time that the advisory was withdrawn in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlertSecurityAdvisory) SetWithdrawnAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.withdrawn_at = value +} +type DependabotAlertSecurityAdvisoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCveId()(*string) + GetCvss()(DependabotAlertSecurityAdvisory_cvssable) + GetCwes()([]DependabotAlertSecurityAdvisory_cwesable) + GetDescription()(*string) + GetGhsaId()(*string) + GetIdentifiers()([]DependabotAlertSecurityAdvisory_identifiersable) + GetPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReferences()([]DependabotAlertSecurityAdvisory_referencesable) + GetSeverity()(*DependabotAlertSecurityAdvisory_severity) + GetSummary()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetVulnerabilities()([]DependabotAlertSecurityVulnerabilityable) + GetWithdrawnAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetCveId(value *string)() + SetCvss(value DependabotAlertSecurityAdvisory_cvssable)() + SetCwes(value []DependabotAlertSecurityAdvisory_cwesable)() + SetDescription(value *string)() + SetGhsaId(value *string)() + SetIdentifiers(value []DependabotAlertSecurityAdvisory_identifiersable)() + SetPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReferences(value []DependabotAlertSecurityAdvisory_referencesable)() + SetSeverity(value *DependabotAlertSecurityAdvisory_severity)() + SetSummary(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetVulnerabilities(value []DependabotAlertSecurityVulnerabilityable)() + SetWithdrawnAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_cvss.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_cvss.go new file mode 100644 index 000000000..61ad5b939 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_cvss.go @@ -0,0 +1,79 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertSecurityAdvisory_cvss details for the advisory pertaining to the Common Vulnerability Scoring System. +type DependabotAlertSecurityAdvisory_cvss struct { + // The overall CVSS score of the advisory. + score *float64 + // The full CVSS vector string for the advisory. + vector_string *string +} +// NewDependabotAlertSecurityAdvisory_cvss instantiates a new DependabotAlertSecurityAdvisory_cvss and sets the default values. +func NewDependabotAlertSecurityAdvisory_cvss()(*DependabotAlertSecurityAdvisory_cvss) { + m := &DependabotAlertSecurityAdvisory_cvss{ + } + return m +} +// CreateDependabotAlertSecurityAdvisory_cvssFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertSecurityAdvisory_cvssFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertSecurityAdvisory_cvss(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertSecurityAdvisory_cvss) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["vector_string"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVectorString(val) + } + return nil + } + return res +} +// GetScore gets the score property value. The overall CVSS score of the advisory. +// returns a *float64 when successful +func (m *DependabotAlertSecurityAdvisory_cvss) GetScore()(*float64) { + return m.score +} +// GetVectorString gets the vector_string property value. The full CVSS vector string for the advisory. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory_cvss) GetVectorString()(*string) { + return m.vector_string +} +// Serialize serializes information the current object +func (m *DependabotAlertSecurityAdvisory_cvss) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// SetScore sets the score property value. The overall CVSS score of the advisory. +func (m *DependabotAlertSecurityAdvisory_cvss) SetScore(value *float64)() { + m.score = value +} +// SetVectorString sets the vector_string property value. The full CVSS vector string for the advisory. +func (m *DependabotAlertSecurityAdvisory_cvss) SetVectorString(value *string)() { + m.vector_string = value +} +type DependabotAlertSecurityAdvisory_cvssable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetScore()(*float64) + GetVectorString()(*string) + SetScore(value *float64)() + SetVectorString(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_cwes.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_cwes.go new file mode 100644 index 000000000..27e24d104 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_cwes.go @@ -0,0 +1,79 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertSecurityAdvisory_cwes a CWE weakness assigned to the advisory. +type DependabotAlertSecurityAdvisory_cwes struct { + // The unique CWE ID. + cwe_id *string + // The short, plain text name of the CWE. + name *string +} +// NewDependabotAlertSecurityAdvisory_cwes instantiates a new DependabotAlertSecurityAdvisory_cwes and sets the default values. +func NewDependabotAlertSecurityAdvisory_cwes()(*DependabotAlertSecurityAdvisory_cwes) { + m := &DependabotAlertSecurityAdvisory_cwes{ + } + return m +} +// CreateDependabotAlertSecurityAdvisory_cwesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertSecurityAdvisory_cwesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertSecurityAdvisory_cwes(), nil +} +// GetCweId gets the cwe_id property value. The unique CWE ID. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory_cwes) GetCweId()(*string) { + return m.cwe_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertSecurityAdvisory_cwes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cwe_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCweId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The short, plain text name of the CWE. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory_cwes) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *DependabotAlertSecurityAdvisory_cwes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// SetCweId sets the cwe_id property value. The unique CWE ID. +func (m *DependabotAlertSecurityAdvisory_cwes) SetCweId(value *string)() { + m.cwe_id = value +} +// SetName sets the name property value. The short, plain text name of the CWE. +func (m *DependabotAlertSecurityAdvisory_cwes) SetName(value *string)() { + m.name = value +} +type DependabotAlertSecurityAdvisory_cwesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCweId()(*string) + GetName()(*string) + SetCweId(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_identifiers.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_identifiers.go new file mode 100644 index 000000000..35b54af13 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_identifiers.go @@ -0,0 +1,79 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertSecurityAdvisory_identifiers an advisory identifier. +type DependabotAlertSecurityAdvisory_identifiers struct { + // The type of advisory identifier. + typeEscaped *DependabotAlertSecurityAdvisory_identifiers_type + // The value of the advisory identifer. + value *string +} +// NewDependabotAlertSecurityAdvisory_identifiers instantiates a new DependabotAlertSecurityAdvisory_identifiers and sets the default values. +func NewDependabotAlertSecurityAdvisory_identifiers()(*DependabotAlertSecurityAdvisory_identifiers) { + m := &DependabotAlertSecurityAdvisory_identifiers{ + } + return m +} +// CreateDependabotAlertSecurityAdvisory_identifiersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertSecurityAdvisory_identifiersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertSecurityAdvisory_identifiers(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertSecurityAdvisory_identifiers) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlertSecurityAdvisory_identifiers_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*DependabotAlertSecurityAdvisory_identifiers_type)) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The type of advisory identifier. +// returns a *DependabotAlertSecurityAdvisory_identifiers_type when successful +func (m *DependabotAlertSecurityAdvisory_identifiers) GetTypeEscaped()(*DependabotAlertSecurityAdvisory_identifiers_type) { + return m.typeEscaped +} +// GetValue gets the value property value. The value of the advisory identifer. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory_identifiers) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *DependabotAlertSecurityAdvisory_identifiers) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// SetTypeEscaped sets the type property value. The type of advisory identifier. +func (m *DependabotAlertSecurityAdvisory_identifiers) SetTypeEscaped(value *DependabotAlertSecurityAdvisory_identifiers_type)() { + m.typeEscaped = value +} +// SetValue sets the value property value. The value of the advisory identifer. +func (m *DependabotAlertSecurityAdvisory_identifiers) SetValue(value *string)() { + m.value = value +} +type DependabotAlertSecurityAdvisory_identifiersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTypeEscaped()(*DependabotAlertSecurityAdvisory_identifiers_type) + GetValue()(*string) + SetTypeEscaped(value *DependabotAlertSecurityAdvisory_identifiers_type)() + SetValue(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_identifiers_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_identifiers_type.go new file mode 100644 index 000000000..dad68d1ca --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_identifiers_type.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The type of advisory identifier. +type DependabotAlertSecurityAdvisory_identifiers_type int + +const ( + CVE_DEPENDABOTALERTSECURITYADVISORY_IDENTIFIERS_TYPE DependabotAlertSecurityAdvisory_identifiers_type = iota + GHSA_DEPENDABOTALERTSECURITYADVISORY_IDENTIFIERS_TYPE +) + +func (i DependabotAlertSecurityAdvisory_identifiers_type) String() string { + return []string{"CVE", "GHSA"}[i] +} +func ParseDependabotAlertSecurityAdvisory_identifiers_type(v string) (any, error) { + result := CVE_DEPENDABOTALERTSECURITYADVISORY_IDENTIFIERS_TYPE + switch v { + case "CVE": + result = CVE_DEPENDABOTALERTSECURITYADVISORY_IDENTIFIERS_TYPE + case "GHSA": + result = GHSA_DEPENDABOTALERTSECURITYADVISORY_IDENTIFIERS_TYPE + default: + return 0, errors.New("Unknown DependabotAlertSecurityAdvisory_identifiers_type value: " + v) + } + return &result, nil +} +func SerializeDependabotAlertSecurityAdvisory_identifiers_type(values []DependabotAlertSecurityAdvisory_identifiers_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlertSecurityAdvisory_identifiers_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_references.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_references.go new file mode 100644 index 000000000..52113307b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_references.go @@ -0,0 +1,56 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertSecurityAdvisory_references a link to additional advisory information. +type DependabotAlertSecurityAdvisory_references struct { + // The URL of the reference. + url *string +} +// NewDependabotAlertSecurityAdvisory_references instantiates a new DependabotAlertSecurityAdvisory_references and sets the default values. +func NewDependabotAlertSecurityAdvisory_references()(*DependabotAlertSecurityAdvisory_references) { + m := &DependabotAlertSecurityAdvisory_references{ + } + return m +} +// CreateDependabotAlertSecurityAdvisory_referencesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertSecurityAdvisory_referencesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertSecurityAdvisory_references(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertSecurityAdvisory_references) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetUrl gets the url property value. The URL of the reference. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory_references) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *DependabotAlertSecurityAdvisory_references) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// SetUrl sets the url property value. The URL of the reference. +func (m *DependabotAlertSecurityAdvisory_references) SetUrl(value *string)() { + m.url = value +} +type DependabotAlertSecurityAdvisory_referencesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetUrl()(*string) + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_severity.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_severity.go new file mode 100644 index 000000000..8de14c8f6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_advisory_severity.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The severity of the advisory. +type DependabotAlertSecurityAdvisory_severity int + +const ( + LOW_DEPENDABOTALERTSECURITYADVISORY_SEVERITY DependabotAlertSecurityAdvisory_severity = iota + MEDIUM_DEPENDABOTALERTSECURITYADVISORY_SEVERITY + HIGH_DEPENDABOTALERTSECURITYADVISORY_SEVERITY + CRITICAL_DEPENDABOTALERTSECURITYADVISORY_SEVERITY +) + +func (i DependabotAlertSecurityAdvisory_severity) String() string { + return []string{"low", "medium", "high", "critical"}[i] +} +func ParseDependabotAlertSecurityAdvisory_severity(v string) (any, error) { + result := LOW_DEPENDABOTALERTSECURITYADVISORY_SEVERITY + switch v { + case "low": + result = LOW_DEPENDABOTALERTSECURITYADVISORY_SEVERITY + case "medium": + result = MEDIUM_DEPENDABOTALERTSECURITYADVISORY_SEVERITY + case "high": + result = HIGH_DEPENDABOTALERTSECURITYADVISORY_SEVERITY + case "critical": + result = CRITICAL_DEPENDABOTALERTSECURITYADVISORY_SEVERITY + default: + return 0, errors.New("Unknown DependabotAlertSecurityAdvisory_severity value: " + v) + } + return &result, nil +} +func SerializeDependabotAlertSecurityAdvisory_severity(values []DependabotAlertSecurityAdvisory_severity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlertSecurityAdvisory_severity) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_vulnerability.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_vulnerability.go new file mode 100644 index 000000000..310fad1d3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_vulnerability.go @@ -0,0 +1,125 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertSecurityVulnerability details pertaining to one vulnerable version range for the advisory. +type DependabotAlertSecurityVulnerability struct { + // Details pertaining to the package version that patches this vulnerability. + first_patched_version DependabotAlertSecurityVulnerability_first_patched_versionable + // Details for the vulnerable package. + packageEscaped DependabotAlertPackageable + // The severity of the vulnerability. + severity *DependabotAlertSecurityVulnerability_severity + // Conditions that identify vulnerable versions of this vulnerability's package. + vulnerable_version_range *string +} +// NewDependabotAlertSecurityVulnerability instantiates a new DependabotAlertSecurityVulnerability and sets the default values. +func NewDependabotAlertSecurityVulnerability()(*DependabotAlertSecurityVulnerability) { + m := &DependabotAlertSecurityVulnerability{ + } + return m +} +// CreateDependabotAlertSecurityVulnerabilityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertSecurityVulnerabilityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertSecurityVulnerability(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertSecurityVulnerability) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["first_patched_version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertSecurityVulnerability_first_patched_versionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetFirstPatchedVersion(val.(DependabotAlertSecurityVulnerability_first_patched_versionable)) + } + return nil + } + res["package"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertPackageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPackageEscaped(val.(DependabotAlertPackageable)) + } + return nil + } + res["severity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlertSecurityVulnerability_severity) + if err != nil { + return err + } + if val != nil { + m.SetSeverity(val.(*DependabotAlertSecurityVulnerability_severity)) + } + return nil + } + res["vulnerable_version_range"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVulnerableVersionRange(val) + } + return nil + } + return res +} +// GetFirstPatchedVersion gets the first_patched_version property value. Details pertaining to the package version that patches this vulnerability. +// returns a DependabotAlertSecurityVulnerability_first_patched_versionable when successful +func (m *DependabotAlertSecurityVulnerability) GetFirstPatchedVersion()(DependabotAlertSecurityVulnerability_first_patched_versionable) { + return m.first_patched_version +} +// GetPackageEscaped gets the package property value. Details for the vulnerable package. +// returns a DependabotAlertPackageable when successful +func (m *DependabotAlertSecurityVulnerability) GetPackageEscaped()(DependabotAlertPackageable) { + return m.packageEscaped +} +// GetSeverity gets the severity property value. The severity of the vulnerability. +// returns a *DependabotAlertSecurityVulnerability_severity when successful +func (m *DependabotAlertSecurityVulnerability) GetSeverity()(*DependabotAlertSecurityVulnerability_severity) { + return m.severity +} +// GetVulnerableVersionRange gets the vulnerable_version_range property value. Conditions that identify vulnerable versions of this vulnerability's package. +// returns a *string when successful +func (m *DependabotAlertSecurityVulnerability) GetVulnerableVersionRange()(*string) { + return m.vulnerable_version_range +} +// Serialize serializes information the current object +func (m *DependabotAlertSecurityVulnerability) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// SetFirstPatchedVersion sets the first_patched_version property value. Details pertaining to the package version that patches this vulnerability. +func (m *DependabotAlertSecurityVulnerability) SetFirstPatchedVersion(value DependabotAlertSecurityVulnerability_first_patched_versionable)() { + m.first_patched_version = value +} +// SetPackageEscaped sets the package property value. Details for the vulnerable package. +func (m *DependabotAlertSecurityVulnerability) SetPackageEscaped(value DependabotAlertPackageable)() { + m.packageEscaped = value +} +// SetSeverity sets the severity property value. The severity of the vulnerability. +func (m *DependabotAlertSecurityVulnerability) SetSeverity(value *DependabotAlertSecurityVulnerability_severity)() { + m.severity = value +} +// SetVulnerableVersionRange sets the vulnerable_version_range property value. Conditions that identify vulnerable versions of this vulnerability's package. +func (m *DependabotAlertSecurityVulnerability) SetVulnerableVersionRange(value *string)() { + m.vulnerable_version_range = value +} +type DependabotAlertSecurityVulnerabilityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFirstPatchedVersion()(DependabotAlertSecurityVulnerability_first_patched_versionable) + GetPackageEscaped()(DependabotAlertPackageable) + GetSeverity()(*DependabotAlertSecurityVulnerability_severity) + GetVulnerableVersionRange()(*string) + SetFirstPatchedVersion(value DependabotAlertSecurityVulnerability_first_patched_versionable)() + SetPackageEscaped(value DependabotAlertPackageable)() + SetSeverity(value *DependabotAlertSecurityVulnerability_severity)() + SetVulnerableVersionRange(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_vulnerability_first_patched_version.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_vulnerability_first_patched_version.go new file mode 100644 index 000000000..bd96c084d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_vulnerability_first_patched_version.go @@ -0,0 +1,56 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertSecurityVulnerability_first_patched_version details pertaining to the package version that patches this vulnerability. +type DependabotAlertSecurityVulnerability_first_patched_version struct { + // The package version that patches this vulnerability. + identifier *string +} +// NewDependabotAlertSecurityVulnerability_first_patched_version instantiates a new DependabotAlertSecurityVulnerability_first_patched_version and sets the default values. +func NewDependabotAlertSecurityVulnerability_first_patched_version()(*DependabotAlertSecurityVulnerability_first_patched_version) { + m := &DependabotAlertSecurityVulnerability_first_patched_version{ + } + return m +} +// CreateDependabotAlertSecurityVulnerability_first_patched_versionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertSecurityVulnerability_first_patched_versionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertSecurityVulnerability_first_patched_version(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertSecurityVulnerability_first_patched_version) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["identifier"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIdentifier(val) + } + return nil + } + return res +} +// GetIdentifier gets the identifier property value. The package version that patches this vulnerability. +// returns a *string when successful +func (m *DependabotAlertSecurityVulnerability_first_patched_version) GetIdentifier()(*string) { + return m.identifier +} +// Serialize serializes information the current object +func (m *DependabotAlertSecurityVulnerability_first_patched_version) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// SetIdentifier sets the identifier property value. The package version that patches this vulnerability. +func (m *DependabotAlertSecurityVulnerability_first_patched_version) SetIdentifier(value *string)() { + m.identifier = value +} +type DependabotAlertSecurityVulnerability_first_patched_versionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIdentifier()(*string) + SetIdentifier(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_vulnerability_severity.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_vulnerability_severity.go new file mode 100644 index 000000000..627c1cc23 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_security_vulnerability_severity.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The severity of the vulnerability. +type DependabotAlertSecurityVulnerability_severity int + +const ( + LOW_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY DependabotAlertSecurityVulnerability_severity = iota + MEDIUM_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY + HIGH_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY + CRITICAL_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY +) + +func (i DependabotAlertSecurityVulnerability_severity) String() string { + return []string{"low", "medium", "high", "critical"}[i] +} +func ParseDependabotAlertSecurityVulnerability_severity(v string) (any, error) { + result := LOW_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY + switch v { + case "low": + result = LOW_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY + case "medium": + result = MEDIUM_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY + case "high": + result = HIGH_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY + case "critical": + result = CRITICAL_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY + default: + return 0, errors.New("Unknown DependabotAlertSecurityVulnerability_severity value: " + v) + } + return &result, nil +} +func SerializeDependabotAlertSecurityVulnerability_severity(values []DependabotAlertSecurityVulnerability_severity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlertSecurityVulnerability_severity) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_state.go new file mode 100644 index 000000000..d50a35df4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_state.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The state of the Dependabot alert. +type DependabotAlert_state int + +const ( + AUTO_DISMISSED_DEPENDABOTALERT_STATE DependabotAlert_state = iota + DISMISSED_DEPENDABOTALERT_STATE + FIXED_DEPENDABOTALERT_STATE + OPEN_DEPENDABOTALERT_STATE +) + +func (i DependabotAlert_state) String() string { + return []string{"auto_dismissed", "dismissed", "fixed", "open"}[i] +} +func ParseDependabotAlert_state(v string) (any, error) { + result := AUTO_DISMISSED_DEPENDABOTALERT_STATE + switch v { + case "auto_dismissed": + result = AUTO_DISMISSED_DEPENDABOTALERT_STATE + case "dismissed": + result = DISMISSED_DEPENDABOTALERT_STATE + case "fixed": + result = FIXED_DEPENDABOTALERT_STATE + case "open": + result = OPEN_DEPENDABOTALERT_STATE + default: + return 0, errors.New("Unknown DependabotAlert_state value: " + v) + } + return &result, nil +} +func SerializeDependabotAlert_state(values []DependabotAlert_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlert_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_with_repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_with_repository.go new file mode 100644 index 000000000..15d615035 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_with_repository.go @@ -0,0 +1,427 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertWithRepository a Dependabot alert. +type DependabotAlertWithRepository struct { + // The time that the alert was auto-dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + auto_dismissed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Details for the vulnerable dependency. + dependency DependabotAlertWithRepository_dependencyable + // The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + dismissed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + dismissed_by NullableSimpleUserable + // An optional comment associated with the alert's dismissal. + dismissed_comment *string + // The reason that the alert was dismissed. + dismissed_reason *DependabotAlertWithRepository_dismissed_reason + // The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + fixed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The GitHub URL of the alert resource. + html_url *string + // The security alert number. + number *int32 + // A GitHub repository. + repository SimpleRepositoryable + // Details for the GitHub Security Advisory. + security_advisory DependabotAlertSecurityAdvisoryable + // Details pertaining to one vulnerable version range for the advisory. + security_vulnerability DependabotAlertSecurityVulnerabilityable + // The state of the Dependabot alert. + state *DependabotAlertWithRepository_state + // The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The REST API URL of the alert resource. + url *string +} +// NewDependabotAlertWithRepository instantiates a new DependabotAlertWithRepository and sets the default values. +func NewDependabotAlertWithRepository()(*DependabotAlertWithRepository) { + m := &DependabotAlertWithRepository{ + } + return m +} +// CreateDependabotAlertWithRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertWithRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertWithRepository(), nil +} +// GetAutoDismissedAt gets the auto_dismissed_at property value. The time that the alert was auto-dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlertWithRepository) GetAutoDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.auto_dismissed_at +} +// GetCreatedAt gets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlertWithRepository) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDependency gets the dependency property value. Details for the vulnerable dependency. +// returns a DependabotAlertWithRepository_dependencyable when successful +func (m *DependabotAlertWithRepository) GetDependency()(DependabotAlertWithRepository_dependencyable) { + return m.dependency +} +// GetDismissedAt gets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlertWithRepository) GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.dismissed_at +} +// GetDismissedBy gets the dismissed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *DependabotAlertWithRepository) GetDismissedBy()(NullableSimpleUserable) { + return m.dismissed_by +} +// GetDismissedComment gets the dismissed_comment property value. An optional comment associated with the alert's dismissal. +// returns a *string when successful +func (m *DependabotAlertWithRepository) GetDismissedComment()(*string) { + return m.dismissed_comment +} +// GetDismissedReason gets the dismissed_reason property value. The reason that the alert was dismissed. +// returns a *DependabotAlertWithRepository_dismissed_reason when successful +func (m *DependabotAlertWithRepository) GetDismissedReason()(*DependabotAlertWithRepository_dismissed_reason) { + return m.dismissed_reason +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertWithRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["auto_dismissed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetAutoDismissedAt(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["dependency"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertWithRepository_dependencyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDependency(val.(DependabotAlertWithRepository_dependencyable)) + } + return nil + } + res["dismissed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedAt(val) + } + return nil + } + res["dismissed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["dismissed_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedComment(val) + } + return nil + } + res["dismissed_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlertWithRepository_dismissed_reason) + if err != nil { + return err + } + if val != nil { + m.SetDismissedReason(val.(*DependabotAlertWithRepository_dismissed_reason)) + } + return nil + } + res["fixed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetFixedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(SimpleRepositoryable)) + } + return nil + } + res["security_advisory"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertSecurityAdvisoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAdvisory(val.(DependabotAlertSecurityAdvisoryable)) + } + return nil + } + res["security_vulnerability"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertSecurityVulnerabilityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityVulnerability(val.(DependabotAlertSecurityVulnerabilityable)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlertWithRepository_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*DependabotAlertWithRepository_state)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFixedAt gets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlertWithRepository) GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.fixed_at +} +// GetHtmlUrl gets the html_url property value. The GitHub URL of the alert resource. +// returns a *string when successful +func (m *DependabotAlertWithRepository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetNumber gets the number property value. The security alert number. +// returns a *int32 when successful +func (m *DependabotAlertWithRepository) GetNumber()(*int32) { + return m.number +} +// GetRepository gets the repository property value. A GitHub repository. +// returns a SimpleRepositoryable when successful +func (m *DependabotAlertWithRepository) GetRepository()(SimpleRepositoryable) { + return m.repository +} +// GetSecurityAdvisory gets the security_advisory property value. Details for the GitHub Security Advisory. +// returns a DependabotAlertSecurityAdvisoryable when successful +func (m *DependabotAlertWithRepository) GetSecurityAdvisory()(DependabotAlertSecurityAdvisoryable) { + return m.security_advisory +} +// GetSecurityVulnerability gets the security_vulnerability property value. Details pertaining to one vulnerable version range for the advisory. +// returns a DependabotAlertSecurityVulnerabilityable when successful +func (m *DependabotAlertWithRepository) GetSecurityVulnerability()(DependabotAlertSecurityVulnerabilityable) { + return m.security_vulnerability +} +// GetState gets the state property value. The state of the Dependabot alert. +// returns a *DependabotAlertWithRepository_state when successful +func (m *DependabotAlertWithRepository) GetState()(*DependabotAlertWithRepository_state) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlertWithRepository) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The REST API URL of the alert resource. +// returns a *string when successful +func (m *DependabotAlertWithRepository) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *DependabotAlertWithRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("dismissed_by", m.GetDismissedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("dismissed_comment", m.GetDismissedComment()) + if err != nil { + return err + } + } + if m.GetDismissedReason() != nil { + cast := (*m.GetDismissedReason()).String() + err := writer.WriteStringValue("dismissed_reason", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + return nil +} +// SetAutoDismissedAt sets the auto_dismissed_at property value. The time that the alert was auto-dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlertWithRepository) SetAutoDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.auto_dismissed_at = value +} +// SetCreatedAt sets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlertWithRepository) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDependency sets the dependency property value. Details for the vulnerable dependency. +func (m *DependabotAlertWithRepository) SetDependency(value DependabotAlertWithRepository_dependencyable)() { + m.dependency = value +} +// SetDismissedAt sets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlertWithRepository) SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.dismissed_at = value +} +// SetDismissedBy sets the dismissed_by property value. A GitHub user. +func (m *DependabotAlertWithRepository) SetDismissedBy(value NullableSimpleUserable)() { + m.dismissed_by = value +} +// SetDismissedComment sets the dismissed_comment property value. An optional comment associated with the alert's dismissal. +func (m *DependabotAlertWithRepository) SetDismissedComment(value *string)() { + m.dismissed_comment = value +} +// SetDismissedReason sets the dismissed_reason property value. The reason that the alert was dismissed. +func (m *DependabotAlertWithRepository) SetDismissedReason(value *DependabotAlertWithRepository_dismissed_reason)() { + m.dismissed_reason = value +} +// SetFixedAt sets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlertWithRepository) SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.fixed_at = value +} +// SetHtmlUrl sets the html_url property value. The GitHub URL of the alert resource. +func (m *DependabotAlertWithRepository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetNumber sets the number property value. The security alert number. +func (m *DependabotAlertWithRepository) SetNumber(value *int32)() { + m.number = value +} +// SetRepository sets the repository property value. A GitHub repository. +func (m *DependabotAlertWithRepository) SetRepository(value SimpleRepositoryable)() { + m.repository = value +} +// SetSecurityAdvisory sets the security_advisory property value. Details for the GitHub Security Advisory. +func (m *DependabotAlertWithRepository) SetSecurityAdvisory(value DependabotAlertSecurityAdvisoryable)() { + m.security_advisory = value +} +// SetSecurityVulnerability sets the security_vulnerability property value. Details pertaining to one vulnerable version range for the advisory. +func (m *DependabotAlertWithRepository) SetSecurityVulnerability(value DependabotAlertSecurityVulnerabilityable)() { + m.security_vulnerability = value +} +// SetState sets the state property value. The state of the Dependabot alert. +func (m *DependabotAlertWithRepository) SetState(value *DependabotAlertWithRepository_state)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlertWithRepository) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The REST API URL of the alert resource. +func (m *DependabotAlertWithRepository) SetUrl(value *string)() { + m.url = value +} +type DependabotAlertWithRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAutoDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDependency()(DependabotAlertWithRepository_dependencyable) + GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedBy()(NullableSimpleUserable) + GetDismissedComment()(*string) + GetDismissedReason()(*DependabotAlertWithRepository_dismissed_reason) + GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetNumber()(*int32) + GetRepository()(SimpleRepositoryable) + GetSecurityAdvisory()(DependabotAlertSecurityAdvisoryable) + GetSecurityVulnerability()(DependabotAlertSecurityVulnerabilityable) + GetState()(*DependabotAlertWithRepository_state) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAutoDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDependency(value DependabotAlertWithRepository_dependencyable)() + SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedBy(value NullableSimpleUserable)() + SetDismissedComment(value *string)() + SetDismissedReason(value *DependabotAlertWithRepository_dismissed_reason)() + SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetNumber(value *int32)() + SetRepository(value SimpleRepositoryable)() + SetSecurityAdvisory(value DependabotAlertSecurityAdvisoryable)() + SetSecurityVulnerability(value DependabotAlertSecurityVulnerabilityable)() + SetState(value *DependabotAlertWithRepository_state)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_with_repository_dependency.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_with_repository_dependency.go new file mode 100644 index 000000000..b85c3d9f3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_with_repository_dependency.go @@ -0,0 +1,121 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertWithRepository_dependency details for the vulnerable dependency. +type DependabotAlertWithRepository_dependency struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The full path to the dependency manifest file, relative to the root of the repository. + manifest_path *string + // Details for the vulnerable package. + packageEscaped DependabotAlertPackageable + // The execution scope of the vulnerable dependency. + scope *DependabotAlertWithRepository_dependency_scope +} +// NewDependabotAlertWithRepository_dependency instantiates a new DependabotAlertWithRepository_dependency and sets the default values. +func NewDependabotAlertWithRepository_dependency()(*DependabotAlertWithRepository_dependency) { + m := &DependabotAlertWithRepository_dependency{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependabotAlertWithRepository_dependencyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertWithRepository_dependencyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertWithRepository_dependency(), 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 *DependabotAlertWithRepository_dependency) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertWithRepository_dependency) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["manifest_path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetManifestPath(val) + } + return nil + } + res["package"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertPackageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPackageEscaped(val.(DependabotAlertPackageable)) + } + return nil + } + res["scope"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlertWithRepository_dependency_scope) + if err != nil { + return err + } + if val != nil { + m.SetScope(val.(*DependabotAlertWithRepository_dependency_scope)) + } + return nil + } + return res +} +// GetManifestPath gets the manifest_path property value. The full path to the dependency manifest file, relative to the root of the repository. +// returns a *string when successful +func (m *DependabotAlertWithRepository_dependency) GetManifestPath()(*string) { + return m.manifest_path +} +// GetPackageEscaped gets the package property value. Details for the vulnerable package. +// returns a DependabotAlertPackageable when successful +func (m *DependabotAlertWithRepository_dependency) GetPackageEscaped()(DependabotAlertPackageable) { + return m.packageEscaped +} +// GetScope gets the scope property value. The execution scope of the vulnerable dependency. +// returns a *DependabotAlertWithRepository_dependency_scope when successful +func (m *DependabotAlertWithRepository_dependency) GetScope()(*DependabotAlertWithRepository_dependency_scope) { + return m.scope +} +// Serialize serializes information the current object +func (m *DependabotAlertWithRepository_dependency) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *DependabotAlertWithRepository_dependency) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetManifestPath sets the manifest_path property value. The full path to the dependency manifest file, relative to the root of the repository. +func (m *DependabotAlertWithRepository_dependency) SetManifestPath(value *string)() { + m.manifest_path = value +} +// SetPackageEscaped sets the package property value. Details for the vulnerable package. +func (m *DependabotAlertWithRepository_dependency) SetPackageEscaped(value DependabotAlertPackageable)() { + m.packageEscaped = value +} +// SetScope sets the scope property value. The execution scope of the vulnerable dependency. +func (m *DependabotAlertWithRepository_dependency) SetScope(value *DependabotAlertWithRepository_dependency_scope)() { + m.scope = value +} +type DependabotAlertWithRepository_dependencyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetManifestPath()(*string) + GetPackageEscaped()(DependabotAlertPackageable) + GetScope()(*DependabotAlertWithRepository_dependency_scope) + SetManifestPath(value *string)() + SetPackageEscaped(value DependabotAlertPackageable)() + SetScope(value *DependabotAlertWithRepository_dependency_scope)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_with_repository_dependency_scope.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_with_repository_dependency_scope.go new file mode 100644 index 000000000..048032085 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_with_repository_dependency_scope.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The execution scope of the vulnerable dependency. +type DependabotAlertWithRepository_dependency_scope int + +const ( + DEVELOPMENT_DEPENDABOTALERTWITHREPOSITORY_DEPENDENCY_SCOPE DependabotAlertWithRepository_dependency_scope = iota + RUNTIME_DEPENDABOTALERTWITHREPOSITORY_DEPENDENCY_SCOPE +) + +func (i DependabotAlertWithRepository_dependency_scope) String() string { + return []string{"development", "runtime"}[i] +} +func ParseDependabotAlertWithRepository_dependency_scope(v string) (any, error) { + result := DEVELOPMENT_DEPENDABOTALERTWITHREPOSITORY_DEPENDENCY_SCOPE + switch v { + case "development": + result = DEVELOPMENT_DEPENDABOTALERTWITHREPOSITORY_DEPENDENCY_SCOPE + case "runtime": + result = RUNTIME_DEPENDABOTALERTWITHREPOSITORY_DEPENDENCY_SCOPE + default: + return 0, errors.New("Unknown DependabotAlertWithRepository_dependency_scope value: " + v) + } + return &result, nil +} +func SerializeDependabotAlertWithRepository_dependency_scope(values []DependabotAlertWithRepository_dependency_scope) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlertWithRepository_dependency_scope) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_with_repository_dismissed_reason.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_with_repository_dismissed_reason.go new file mode 100644 index 000000000..6e77055f7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_with_repository_dismissed_reason.go @@ -0,0 +1,46 @@ +package models +import ( + "errors" +) +// The reason that the alert was dismissed. +type DependabotAlertWithRepository_dismissed_reason int + +const ( + FIX_STARTED_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON DependabotAlertWithRepository_dismissed_reason = iota + INACCURATE_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + NO_BANDWIDTH_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + NOT_USED_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + TOLERABLE_RISK_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON +) + +func (i DependabotAlertWithRepository_dismissed_reason) String() string { + return []string{"fix_started", "inaccurate", "no_bandwidth", "not_used", "tolerable_risk"}[i] +} +func ParseDependabotAlertWithRepository_dismissed_reason(v string) (any, error) { + result := FIX_STARTED_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + switch v { + case "fix_started": + result = FIX_STARTED_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + case "inaccurate": + result = INACCURATE_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + case "no_bandwidth": + result = NO_BANDWIDTH_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + case "not_used": + result = NOT_USED_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + case "tolerable_risk": + result = TOLERABLE_RISK_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + default: + return 0, errors.New("Unknown DependabotAlertWithRepository_dismissed_reason value: " + v) + } + return &result, nil +} +func SerializeDependabotAlertWithRepository_dismissed_reason(values []DependabotAlertWithRepository_dismissed_reason) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlertWithRepository_dismissed_reason) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_with_repository_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_with_repository_state.go new file mode 100644 index 000000000..b679d703f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_alert_with_repository_state.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The state of the Dependabot alert. +type DependabotAlertWithRepository_state int + +const ( + AUTO_DISMISSED_DEPENDABOTALERTWITHREPOSITORY_STATE DependabotAlertWithRepository_state = iota + DISMISSED_DEPENDABOTALERTWITHREPOSITORY_STATE + FIXED_DEPENDABOTALERTWITHREPOSITORY_STATE + OPEN_DEPENDABOTALERTWITHREPOSITORY_STATE +) + +func (i DependabotAlertWithRepository_state) String() string { + return []string{"auto_dismissed", "dismissed", "fixed", "open"}[i] +} +func ParseDependabotAlertWithRepository_state(v string) (any, error) { + result := AUTO_DISMISSED_DEPENDABOTALERTWITHREPOSITORY_STATE + switch v { + case "auto_dismissed": + result = AUTO_DISMISSED_DEPENDABOTALERTWITHREPOSITORY_STATE + case "dismissed": + result = DISMISSED_DEPENDABOTALERTWITHREPOSITORY_STATE + case "fixed": + result = FIXED_DEPENDABOTALERTWITHREPOSITORY_STATE + case "open": + result = OPEN_DEPENDABOTALERTWITHREPOSITORY_STATE + default: + return 0, errors.New("Unknown DependabotAlertWithRepository_state value: " + v) + } + return &result, nil +} +func SerializeDependabotAlertWithRepository_state(values []DependabotAlertWithRepository_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlertWithRepository_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_public_key.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_public_key.go new file mode 100644 index 000000000..2655586bb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_public_key.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotPublicKey the public key used for setting Dependabot Secrets. +type DependabotPublicKey struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The Base64 encoded public key. + key *string + // The identifier for the key. + key_id *string +} +// NewDependabotPublicKey instantiates a new DependabotPublicKey and sets the default values. +func NewDependabotPublicKey()(*DependabotPublicKey) { + m := &DependabotPublicKey{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependabotPublicKeyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotPublicKeyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotPublicKey(), 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 *DependabotPublicKey) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotPublicKey) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The Base64 encoded public key. +// returns a *string when successful +func (m *DependabotPublicKey) GetKey()(*string) { + return m.key +} +// GetKeyId gets the key_id property value. The identifier for the key. +// returns a *string when successful +func (m *DependabotPublicKey) GetKeyId()(*string) { + return m.key_id +} +// Serialize serializes information the current object +func (m *DependabotPublicKey) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *DependabotPublicKey) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The Base64 encoded public key. +func (m *DependabotPublicKey) SetKey(value *string)() { + m.key = value +} +// SetKeyId sets the key_id property value. The identifier for the key. +func (m *DependabotPublicKey) SetKeyId(value *string)() { + m.key_id = value +} +type DependabotPublicKeyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetKeyId()(*string) + SetKey(value *string)() + SetKeyId(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_secret.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_secret.go new file mode 100644 index 000000000..f326e9bfe --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependabot_secret.go @@ -0,0 +1,140 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotSecret set secrets for Dependabot. +type DependabotSecret struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the secret. + name *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewDependabotSecret instantiates a new DependabotSecret and sets the default values. +func NewDependabotSecret()(*DependabotSecret) { + m := &DependabotSecret{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependabotSecretFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotSecretFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotSecret(), 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 *DependabotSecret) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *DependabotSecret) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotSecret) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the secret. +// returns a *string when successful +func (m *DependabotSecret) GetName()(*string) { + return m.name +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *DependabotSecret) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *DependabotSecret) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + 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 *DependabotSecret) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *DependabotSecret) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetName sets the name property value. The name of the secret. +func (m *DependabotSecret) SetName(value *string)() { + m.name = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *DependabotSecret) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type DependabotSecretable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_diff.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_diff.go new file mode 100644 index 000000000..c4760f92c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_diff.go @@ -0,0 +1,355 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DependencyGraphDiff struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The change_type property + change_type *DependencyGraphDiff_change_type + // The ecosystem property + ecosystem *string + // The license property + license *string + // The manifest property + manifest *string + // The name property + name *string + // The package_url property + package_url *string + // Where the dependency is utilized. `development` means that the dependency is only utilized in the development environment. `runtime` means that the dependency is utilized at runtime and in the development environment. + scope *DependencyGraphDiff_scope + // The source_repository_url property + source_repository_url *string + // The version property + version *string + // The vulnerabilities property + vulnerabilities []DependencyGraphDiff_vulnerabilitiesable +} +// NewDependencyGraphDiff instantiates a new DependencyGraphDiff and sets the default values. +func NewDependencyGraphDiff()(*DependencyGraphDiff) { + m := &DependencyGraphDiff{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependencyGraphDiffFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependencyGraphDiffFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependencyGraphDiff(), 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 *DependencyGraphDiff) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChangeType gets the change_type property value. The change_type property +// returns a *DependencyGraphDiff_change_type when successful +func (m *DependencyGraphDiff) GetChangeType()(*DependencyGraphDiff_change_type) { + return m.change_type +} +// GetEcosystem gets the ecosystem property value. The ecosystem property +// returns a *string when successful +func (m *DependencyGraphDiff) GetEcosystem()(*string) { + return m.ecosystem +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependencyGraphDiff) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["change_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependencyGraphDiff_change_type) + if err != nil { + return err + } + if val != nil { + m.SetChangeType(val.(*DependencyGraphDiff_change_type)) + } + return nil + } + res["ecosystem"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEcosystem(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLicense(val) + } + return nil + } + res["manifest"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetManifest(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["package_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPackageUrl(val) + } + return nil + } + res["scope"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependencyGraphDiff_scope) + if err != nil { + return err + } + if val != nil { + m.SetScope(val.(*DependencyGraphDiff_scope)) + } + return nil + } + res["source_repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSourceRepositoryUrl(val) + } + return nil + } + res["version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + res["vulnerabilities"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDependencyGraphDiff_vulnerabilitiesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DependencyGraphDiff_vulnerabilitiesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DependencyGraphDiff_vulnerabilitiesable) + } + } + m.SetVulnerabilities(res) + } + return nil + } + return res +} +// GetLicense gets the license property value. The license property +// returns a *string when successful +func (m *DependencyGraphDiff) GetLicense()(*string) { + return m.license +} +// GetManifest gets the manifest property value. The manifest property +// returns a *string when successful +func (m *DependencyGraphDiff) GetManifest()(*string) { + return m.manifest +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *DependencyGraphDiff) GetName()(*string) { + return m.name +} +// GetPackageUrl gets the package_url property value. The package_url property +// returns a *string when successful +func (m *DependencyGraphDiff) GetPackageUrl()(*string) { + return m.package_url +} +// GetScope gets the scope property value. Where the dependency is utilized. `development` means that the dependency is only utilized in the development environment. `runtime` means that the dependency is utilized at runtime and in the development environment. +// returns a *DependencyGraphDiff_scope when successful +func (m *DependencyGraphDiff) GetScope()(*DependencyGraphDiff_scope) { + return m.scope +} +// GetSourceRepositoryUrl gets the source_repository_url property value. The source_repository_url property +// returns a *string when successful +func (m *DependencyGraphDiff) GetSourceRepositoryUrl()(*string) { + return m.source_repository_url +} +// GetVersion gets the version property value. The version property +// returns a *string when successful +func (m *DependencyGraphDiff) GetVersion()(*string) { + return m.version +} +// GetVulnerabilities gets the vulnerabilities property value. The vulnerabilities property +// returns a []DependencyGraphDiff_vulnerabilitiesable when successful +func (m *DependencyGraphDiff) GetVulnerabilities()([]DependencyGraphDiff_vulnerabilitiesable) { + return m.vulnerabilities +} +// Serialize serializes information the current object +func (m *DependencyGraphDiff) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetChangeType() != nil { + cast := (*m.GetChangeType()).String() + err := writer.WriteStringValue("change_type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ecosystem", m.GetEcosystem()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("manifest", m.GetManifest()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("package_url", m.GetPackageUrl()) + if err != nil { + return err + } + } + if m.GetScope() != nil { + cast := (*m.GetScope()).String() + err := writer.WriteStringValue("scope", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("source_repository_url", m.GetSourceRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("version", m.GetVersion()) + if err != nil { + return err + } + } + if m.GetVulnerabilities() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVulnerabilities())) + for i, v := range m.GetVulnerabilities() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("vulnerabilities", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *DependencyGraphDiff) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChangeType sets the change_type property value. The change_type property +func (m *DependencyGraphDiff) SetChangeType(value *DependencyGraphDiff_change_type)() { + m.change_type = value +} +// SetEcosystem sets the ecosystem property value. The ecosystem property +func (m *DependencyGraphDiff) SetEcosystem(value *string)() { + m.ecosystem = value +} +// SetLicense sets the license property value. The license property +func (m *DependencyGraphDiff) SetLicense(value *string)() { + m.license = value +} +// SetManifest sets the manifest property value. The manifest property +func (m *DependencyGraphDiff) SetManifest(value *string)() { + m.manifest = value +} +// SetName sets the name property value. The name property +func (m *DependencyGraphDiff) SetName(value *string)() { + m.name = value +} +// SetPackageUrl sets the package_url property value. The package_url property +func (m *DependencyGraphDiff) SetPackageUrl(value *string)() { + m.package_url = value +} +// SetScope sets the scope property value. Where the dependency is utilized. `development` means that the dependency is only utilized in the development environment. `runtime` means that the dependency is utilized at runtime and in the development environment. +func (m *DependencyGraphDiff) SetScope(value *DependencyGraphDiff_scope)() { + m.scope = value +} +// SetSourceRepositoryUrl sets the source_repository_url property value. The source_repository_url property +func (m *DependencyGraphDiff) SetSourceRepositoryUrl(value *string)() { + m.source_repository_url = value +} +// SetVersion sets the version property value. The version property +func (m *DependencyGraphDiff) SetVersion(value *string)() { + m.version = value +} +// SetVulnerabilities sets the vulnerabilities property value. The vulnerabilities property +func (m *DependencyGraphDiff) SetVulnerabilities(value []DependencyGraphDiff_vulnerabilitiesable)() { + m.vulnerabilities = value +} +type DependencyGraphDiffable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChangeType()(*DependencyGraphDiff_change_type) + GetEcosystem()(*string) + GetLicense()(*string) + GetManifest()(*string) + GetName()(*string) + GetPackageUrl()(*string) + GetScope()(*DependencyGraphDiff_scope) + GetSourceRepositoryUrl()(*string) + GetVersion()(*string) + GetVulnerabilities()([]DependencyGraphDiff_vulnerabilitiesable) + SetChangeType(value *DependencyGraphDiff_change_type)() + SetEcosystem(value *string)() + SetLicense(value *string)() + SetManifest(value *string)() + SetName(value *string)() + SetPackageUrl(value *string)() + SetScope(value *DependencyGraphDiff_scope)() + SetSourceRepositoryUrl(value *string)() + SetVersion(value *string)() + SetVulnerabilities(value []DependencyGraphDiff_vulnerabilitiesable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_diff_change_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_diff_change_type.go new file mode 100644 index 000000000..6fb0c850f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_diff_change_type.go @@ -0,0 +1,36 @@ +package models +import ( + "errors" +) +type DependencyGraphDiff_change_type int + +const ( + ADDED_DEPENDENCYGRAPHDIFF_CHANGE_TYPE DependencyGraphDiff_change_type = iota + REMOVED_DEPENDENCYGRAPHDIFF_CHANGE_TYPE +) + +func (i DependencyGraphDiff_change_type) String() string { + return []string{"added", "removed"}[i] +} +func ParseDependencyGraphDiff_change_type(v string) (any, error) { + result := ADDED_DEPENDENCYGRAPHDIFF_CHANGE_TYPE + switch v { + case "added": + result = ADDED_DEPENDENCYGRAPHDIFF_CHANGE_TYPE + case "removed": + result = REMOVED_DEPENDENCYGRAPHDIFF_CHANGE_TYPE + default: + return 0, errors.New("Unknown DependencyGraphDiff_change_type value: " + v) + } + return &result, nil +} +func SerializeDependencyGraphDiff_change_type(values []DependencyGraphDiff_change_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependencyGraphDiff_change_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_diff_scope.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_diff_scope.go new file mode 100644 index 000000000..8b0eb3229 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_diff_scope.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// Where the dependency is utilized. `development` means that the dependency is only utilized in the development environment. `runtime` means that the dependency is utilized at runtime and in the development environment. +type DependencyGraphDiff_scope int + +const ( + UNKNOWN_DEPENDENCYGRAPHDIFF_SCOPE DependencyGraphDiff_scope = iota + RUNTIME_DEPENDENCYGRAPHDIFF_SCOPE + DEVELOPMENT_DEPENDENCYGRAPHDIFF_SCOPE +) + +func (i DependencyGraphDiff_scope) String() string { + return []string{"unknown", "runtime", "development"}[i] +} +func ParseDependencyGraphDiff_scope(v string) (any, error) { + result := UNKNOWN_DEPENDENCYGRAPHDIFF_SCOPE + switch v { + case "unknown": + result = UNKNOWN_DEPENDENCYGRAPHDIFF_SCOPE + case "runtime": + result = RUNTIME_DEPENDENCYGRAPHDIFF_SCOPE + case "development": + result = DEVELOPMENT_DEPENDENCYGRAPHDIFF_SCOPE + default: + return 0, errors.New("Unknown DependencyGraphDiff_scope value: " + v) + } + return &result, nil +} +func SerializeDependencyGraphDiff_scope(values []DependencyGraphDiff_scope) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependencyGraphDiff_scope) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_diff_vulnerabilities.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_diff_vulnerabilities.go new file mode 100644 index 000000000..e5034937f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_diff_vulnerabilities.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DependencyGraphDiff_vulnerabilities struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The advisory_ghsa_id property + advisory_ghsa_id *string + // The advisory_summary property + advisory_summary *string + // The advisory_url property + advisory_url *string + // The severity property + severity *string +} +// NewDependencyGraphDiff_vulnerabilities instantiates a new DependencyGraphDiff_vulnerabilities and sets the default values. +func NewDependencyGraphDiff_vulnerabilities()(*DependencyGraphDiff_vulnerabilities) { + m := &DependencyGraphDiff_vulnerabilities{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependencyGraphDiff_vulnerabilitiesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependencyGraphDiff_vulnerabilitiesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependencyGraphDiff_vulnerabilities(), 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 *DependencyGraphDiff_vulnerabilities) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvisoryGhsaId gets the advisory_ghsa_id property value. The advisory_ghsa_id property +// returns a *string when successful +func (m *DependencyGraphDiff_vulnerabilities) GetAdvisoryGhsaId()(*string) { + return m.advisory_ghsa_id +} +// GetAdvisorySummary gets the advisory_summary property value. The advisory_summary property +// returns a *string when successful +func (m *DependencyGraphDiff_vulnerabilities) GetAdvisorySummary()(*string) { + return m.advisory_summary +} +// GetAdvisoryUrl gets the advisory_url property value. The advisory_url property +// returns a *string when successful +func (m *DependencyGraphDiff_vulnerabilities) GetAdvisoryUrl()(*string) { + return m.advisory_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependencyGraphDiff_vulnerabilities) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["advisory_ghsa_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAdvisoryGhsaId(val) + } + return nil + } + res["advisory_summary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAdvisorySummary(val) + } + return nil + } + res["advisory_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAdvisoryUrl(val) + } + return nil + } + res["severity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSeverity(val) + } + return nil + } + return res +} +// GetSeverity gets the severity property value. The severity property +// returns a *string when successful +func (m *DependencyGraphDiff_vulnerabilities) GetSeverity()(*string) { + return m.severity +} +// Serialize serializes information the current object +func (m *DependencyGraphDiff_vulnerabilities) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("advisory_ghsa_id", m.GetAdvisoryGhsaId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("advisory_summary", m.GetAdvisorySummary()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("advisory_url", m.GetAdvisoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("severity", m.GetSeverity()) + 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 *DependencyGraphDiff_vulnerabilities) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvisoryGhsaId sets the advisory_ghsa_id property value. The advisory_ghsa_id property +func (m *DependencyGraphDiff_vulnerabilities) SetAdvisoryGhsaId(value *string)() { + m.advisory_ghsa_id = value +} +// SetAdvisorySummary sets the advisory_summary property value. The advisory_summary property +func (m *DependencyGraphDiff_vulnerabilities) SetAdvisorySummary(value *string)() { + m.advisory_summary = value +} +// SetAdvisoryUrl sets the advisory_url property value. The advisory_url property +func (m *DependencyGraphDiff_vulnerabilities) SetAdvisoryUrl(value *string)() { + m.advisory_url = value +} +// SetSeverity sets the severity property value. The severity property +func (m *DependencyGraphDiff_vulnerabilities) SetSeverity(value *string)() { + m.severity = value +} +type DependencyGraphDiff_vulnerabilitiesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdvisoryGhsaId()(*string) + GetAdvisorySummary()(*string) + GetAdvisoryUrl()(*string) + GetSeverity()(*string) + SetAdvisoryGhsaId(value *string)() + SetAdvisorySummary(value *string)() + SetAdvisoryUrl(value *string)() + SetSeverity(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_spdx_sbom.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_spdx_sbom.go new file mode 100644 index 000000000..69670e99d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_spdx_sbom.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependencyGraphSpdxSbom a schema for the SPDX JSON format returned by the Dependency Graph. +type DependencyGraphSpdxSbom struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The sbom property + sbom DependencyGraphSpdxSbom_sbomable +} +// NewDependencyGraphSpdxSbom instantiates a new DependencyGraphSpdxSbom and sets the default values. +func NewDependencyGraphSpdxSbom()(*DependencyGraphSpdxSbom) { + m := &DependencyGraphSpdxSbom{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependencyGraphSpdxSbomFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependencyGraphSpdxSbomFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependencyGraphSpdxSbom(), 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 *DependencyGraphSpdxSbom) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependencyGraphSpdxSbom) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["sbom"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependencyGraphSpdxSbom_sbomFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSbom(val.(DependencyGraphSpdxSbom_sbomable)) + } + return nil + } + return res +} +// GetSbom gets the sbom property value. The sbom property +// returns a DependencyGraphSpdxSbom_sbomable when successful +func (m *DependencyGraphSpdxSbom) GetSbom()(DependencyGraphSpdxSbom_sbomable) { + return m.sbom +} +// Serialize serializes information the current object +func (m *DependencyGraphSpdxSbom) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("sbom", m.GetSbom()) + 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 *DependencyGraphSpdxSbom) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSbom sets the sbom property value. The sbom property +func (m *DependencyGraphSpdxSbom) SetSbom(value DependencyGraphSpdxSbom_sbomable)() { + m.sbom = value +} +type DependencyGraphSpdxSbomable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSbom()(DependencyGraphSpdxSbom_sbomable) + SetSbom(value DependencyGraphSpdxSbom_sbomable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_spdx_sbom_sbom.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_spdx_sbom_sbom.go new file mode 100644 index 000000000..f283a7162 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_spdx_sbom_sbom.go @@ -0,0 +1,301 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DependencyGraphSpdxSbom_sbom struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The creationInfo property + creationInfo DependencyGraphSpdxSbom_sbom_creationInfoable + // The license under which the SPDX document is licensed. + dataLicense *string + // The name of the repository that the SPDX document describes. + documentDescribes []string + // The namespace for the SPDX document. + documentNamespace *string + // The name of the SPDX document. + name *string + // The packages property + packages []DependencyGraphSpdxSbom_sbom_packagesable + // The SPDX identifier for the SPDX document. + sPDXID *string + // The version of the SPDX specification that this document conforms to. + spdxVersion *string +} +// NewDependencyGraphSpdxSbom_sbom instantiates a new DependencyGraphSpdxSbom_sbom and sets the default values. +func NewDependencyGraphSpdxSbom_sbom()(*DependencyGraphSpdxSbom_sbom) { + m := &DependencyGraphSpdxSbom_sbom{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependencyGraphSpdxSbom_sbomFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependencyGraphSpdxSbom_sbomFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependencyGraphSpdxSbom_sbom(), 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 *DependencyGraphSpdxSbom_sbom) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreationInfo gets the creationInfo property value. The creationInfo property +// returns a DependencyGraphSpdxSbom_sbom_creationInfoable when successful +func (m *DependencyGraphSpdxSbom_sbom) GetCreationInfo()(DependencyGraphSpdxSbom_sbom_creationInfoable) { + return m.creationInfo +} +// GetDataLicense gets the dataLicense property value. The license under which the SPDX document is licensed. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom) GetDataLicense()(*string) { + return m.dataLicense +} +// GetDocumentDescribes gets the documentDescribes property value. The name of the repository that the SPDX document describes. +// returns a []string when successful +func (m *DependencyGraphSpdxSbom_sbom) GetDocumentDescribes()([]string) { + return m.documentDescribes +} +// GetDocumentNamespace gets the documentNamespace property value. The namespace for the SPDX document. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom) GetDocumentNamespace()(*string) { + return m.documentNamespace +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependencyGraphSpdxSbom_sbom) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["creationInfo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependencyGraphSpdxSbom_sbom_creationInfoFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreationInfo(val.(DependencyGraphSpdxSbom_sbom_creationInfoable)) + } + return nil + } + res["dataLicense"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDataLicense(val) + } + return nil + } + res["documentDescribes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetDocumentDescribes(res) + } + return nil + } + res["documentNamespace"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentNamespace(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["packages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDependencyGraphSpdxSbom_sbom_packagesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DependencyGraphSpdxSbom_sbom_packagesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DependencyGraphSpdxSbom_sbom_packagesable) + } + } + m.SetPackages(res) + } + return nil + } + res["SPDXID"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSPDXID(val) + } + return nil + } + res["spdxVersion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSpdxVersion(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the SPDX document. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom) GetName()(*string) { + return m.name +} +// GetPackages gets the packages property value. The packages property +// returns a []DependencyGraphSpdxSbom_sbom_packagesable when successful +func (m *DependencyGraphSpdxSbom_sbom) GetPackages()([]DependencyGraphSpdxSbom_sbom_packagesable) { + return m.packages +} +// GetSPDXID gets the SPDXID property value. The SPDX identifier for the SPDX document. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom) GetSPDXID()(*string) { + return m.sPDXID +} +// GetSpdxVersion gets the spdxVersion property value. The version of the SPDX specification that this document conforms to. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom) GetSpdxVersion()(*string) { + return m.spdxVersion +} +// Serialize serializes information the current object +func (m *DependencyGraphSpdxSbom_sbom) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("creationInfo", m.GetCreationInfo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("dataLicense", m.GetDataLicense()) + if err != nil { + return err + } + } + if m.GetDocumentDescribes() != nil { + err := writer.WriteCollectionOfStringValues("documentDescribes", m.GetDocumentDescribes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentNamespace", m.GetDocumentNamespace()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetPackages() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetPackages())) + for i, v := range m.GetPackages() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("packages", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("SPDXID", m.GetSPDXID()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("spdxVersion", m.GetSpdxVersion()) + 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 *DependencyGraphSpdxSbom_sbom) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreationInfo sets the creationInfo property value. The creationInfo property +func (m *DependencyGraphSpdxSbom_sbom) SetCreationInfo(value DependencyGraphSpdxSbom_sbom_creationInfoable)() { + m.creationInfo = value +} +// SetDataLicense sets the dataLicense property value. The license under which the SPDX document is licensed. +func (m *DependencyGraphSpdxSbom_sbom) SetDataLicense(value *string)() { + m.dataLicense = value +} +// SetDocumentDescribes sets the documentDescribes property value. The name of the repository that the SPDX document describes. +func (m *DependencyGraphSpdxSbom_sbom) SetDocumentDescribes(value []string)() { + m.documentDescribes = value +} +// SetDocumentNamespace sets the documentNamespace property value. The namespace for the SPDX document. +func (m *DependencyGraphSpdxSbom_sbom) SetDocumentNamespace(value *string)() { + m.documentNamespace = value +} +// SetName sets the name property value. The name of the SPDX document. +func (m *DependencyGraphSpdxSbom_sbom) SetName(value *string)() { + m.name = value +} +// SetPackages sets the packages property value. The packages property +func (m *DependencyGraphSpdxSbom_sbom) SetPackages(value []DependencyGraphSpdxSbom_sbom_packagesable)() { + m.packages = value +} +// SetSPDXID sets the SPDXID property value. The SPDX identifier for the SPDX document. +func (m *DependencyGraphSpdxSbom_sbom) SetSPDXID(value *string)() { + m.sPDXID = value +} +// SetSpdxVersion sets the spdxVersion property value. The version of the SPDX specification that this document conforms to. +func (m *DependencyGraphSpdxSbom_sbom) SetSpdxVersion(value *string)() { + m.spdxVersion = value +} +type DependencyGraphSpdxSbom_sbomable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreationInfo()(DependencyGraphSpdxSbom_sbom_creationInfoable) + GetDataLicense()(*string) + GetDocumentDescribes()([]string) + GetDocumentNamespace()(*string) + GetName()(*string) + GetPackages()([]DependencyGraphSpdxSbom_sbom_packagesable) + GetSPDXID()(*string) + GetSpdxVersion()(*string) + SetCreationInfo(value DependencyGraphSpdxSbom_sbom_creationInfoable)() + SetDataLicense(value *string)() + SetDocumentDescribes(value []string)() + SetDocumentNamespace(value *string)() + SetName(value *string)() + SetPackages(value []DependencyGraphSpdxSbom_sbom_packagesable)() + SetSPDXID(value *string)() + SetSpdxVersion(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_spdx_sbom_sbom_creation_info.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_spdx_sbom_sbom_creation_info.go new file mode 100644 index 000000000..26f794cd1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_spdx_sbom_sbom_creation_info.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DependencyGraphSpdxSbom_sbom_creationInfo struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The date and time the SPDX document was created. + created *string + // The tools that were used to generate the SPDX document. + creators []string +} +// NewDependencyGraphSpdxSbom_sbom_creationInfo instantiates a new DependencyGraphSpdxSbom_sbom_creationInfo and sets the default values. +func NewDependencyGraphSpdxSbom_sbom_creationInfo()(*DependencyGraphSpdxSbom_sbom_creationInfo) { + m := &DependencyGraphSpdxSbom_sbom_creationInfo{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependencyGraphSpdxSbom_sbom_creationInfoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependencyGraphSpdxSbom_sbom_creationInfoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependencyGraphSpdxSbom_sbom_creationInfo(), 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 *DependencyGraphSpdxSbom_sbom_creationInfo) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreated gets the created property value. The date and time the SPDX document was created. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_creationInfo) GetCreated()(*string) { + return m.created +} +// GetCreators gets the creators property value. The tools that were used to generate the SPDX document. +// returns a []string when successful +func (m *DependencyGraphSpdxSbom_sbom_creationInfo) GetCreators()([]string) { + return m.creators +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependencyGraphSpdxSbom_sbom_creationInfo) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreated(val) + } + return nil + } + res["creators"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetCreators(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *DependencyGraphSpdxSbom_sbom_creationInfo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created", m.GetCreated()) + if err != nil { + return err + } + } + if m.GetCreators() != nil { + err := writer.WriteCollectionOfStringValues("creators", m.GetCreators()) + 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 *DependencyGraphSpdxSbom_sbom_creationInfo) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreated sets the created property value. The date and time the SPDX document was created. +func (m *DependencyGraphSpdxSbom_sbom_creationInfo) SetCreated(value *string)() { + m.created = value +} +// SetCreators sets the creators property value. The tools that were used to generate the SPDX document. +func (m *DependencyGraphSpdxSbom_sbom_creationInfo) SetCreators(value []string)() { + m.creators = value +} +type DependencyGraphSpdxSbom_sbom_creationInfoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreated()(*string) + GetCreators()([]string) + SetCreated(value *string)() + SetCreators(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_spdx_sbom_sbom_packages.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_spdx_sbom_sbom_packages.go new file mode 100644 index 000000000..b397ec67a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_spdx_sbom_sbom_packages.go @@ -0,0 +1,353 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DependencyGraphSpdxSbom_sbom_packages struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The copyright holders of the package, and any dates present with those notices, if available. + copyrightText *string + // The location where the package can be downloaded,or NOASSERTION if this has not been determined. + downloadLocation *string + // The externalRefs property + externalRefs []DependencyGraphSpdxSbom_sbom_packages_externalRefsable + // Whether the package's file content has been subjected toanalysis during the creation of the SPDX document. + filesAnalyzed *bool + // The license of the package as determined while creating the SPDX document. + licenseConcluded *string + // The license of the package as declared by its author, or NOASSERTION if this informationwas not available when the SPDX document was created. + licenseDeclared *string + // The name of the package. + name *string + // A unique SPDX identifier for the package. + sPDXID *string + // The distribution source of this package, or NOASSERTION if this was not determined. + supplier *string + // The version of the package. If the package does not have an exact version specified,a version range is given. + versionInfo *string +} +// NewDependencyGraphSpdxSbom_sbom_packages instantiates a new DependencyGraphSpdxSbom_sbom_packages and sets the default values. +func NewDependencyGraphSpdxSbom_sbom_packages()(*DependencyGraphSpdxSbom_sbom_packages) { + m := &DependencyGraphSpdxSbom_sbom_packages{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependencyGraphSpdxSbom_sbom_packagesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependencyGraphSpdxSbom_sbom_packagesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependencyGraphSpdxSbom_sbom_packages(), 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 *DependencyGraphSpdxSbom_sbom_packages) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCopyrightText gets the copyrightText property value. The copyright holders of the package, and any dates present with those notices, if available. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetCopyrightText()(*string) { + return m.copyrightText +} +// GetDownloadLocation gets the downloadLocation property value. The location where the package can be downloaded,or NOASSERTION if this has not been determined. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetDownloadLocation()(*string) { + return m.downloadLocation +} +// GetExternalRefs gets the externalRefs property value. The externalRefs property +// returns a []DependencyGraphSpdxSbom_sbom_packages_externalRefsable when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetExternalRefs()([]DependencyGraphSpdxSbom_sbom_packages_externalRefsable) { + return m.externalRefs +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["copyrightText"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCopyrightText(val) + } + return nil + } + res["downloadLocation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadLocation(val) + } + return nil + } + res["externalRefs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDependencyGraphSpdxSbom_sbom_packages_externalRefsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DependencyGraphSpdxSbom_sbom_packages_externalRefsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DependencyGraphSpdxSbom_sbom_packages_externalRefsable) + } + } + m.SetExternalRefs(res) + } + return nil + } + res["filesAnalyzed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFilesAnalyzed(val) + } + return nil + } + res["licenseConcluded"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLicenseConcluded(val) + } + return nil + } + res["licenseDeclared"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLicenseDeclared(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["SPDXID"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSPDXID(val) + } + return nil + } + res["supplier"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSupplier(val) + } + return nil + } + res["versionInfo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersionInfo(val) + } + return nil + } + return res +} +// GetFilesAnalyzed gets the filesAnalyzed property value. Whether the package's file content has been subjected toanalysis during the creation of the SPDX document. +// returns a *bool when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetFilesAnalyzed()(*bool) { + return m.filesAnalyzed +} +// GetLicenseConcluded gets the licenseConcluded property value. The license of the package as determined while creating the SPDX document. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetLicenseConcluded()(*string) { + return m.licenseConcluded +} +// GetLicenseDeclared gets the licenseDeclared property value. The license of the package as declared by its author, or NOASSERTION if this informationwas not available when the SPDX document was created. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetLicenseDeclared()(*string) { + return m.licenseDeclared +} +// GetName gets the name property value. The name of the package. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetName()(*string) { + return m.name +} +// GetSPDXID gets the SPDXID property value. A unique SPDX identifier for the package. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetSPDXID()(*string) { + return m.sPDXID +} +// GetSupplier gets the supplier property value. The distribution source of this package, or NOASSERTION if this was not determined. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetSupplier()(*string) { + return m.supplier +} +// GetVersionInfo gets the versionInfo property value. The version of the package. If the package does not have an exact version specified,a version range is given. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetVersionInfo()(*string) { + return m.versionInfo +} +// Serialize serializes information the current object +func (m *DependencyGraphSpdxSbom_sbom_packages) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("copyrightText", m.GetCopyrightText()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloadLocation", m.GetDownloadLocation()) + if err != nil { + return err + } + } + if m.GetExternalRefs() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetExternalRefs())) + for i, v := range m.GetExternalRefs() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("externalRefs", cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("filesAnalyzed", m.GetFilesAnalyzed()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("licenseConcluded", m.GetLicenseConcluded()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("licenseDeclared", m.GetLicenseDeclared()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("SPDXID", m.GetSPDXID()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("supplier", m.GetSupplier()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("versionInfo", m.GetVersionInfo()) + 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 *DependencyGraphSpdxSbom_sbom_packages) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCopyrightText sets the copyrightText property value. The copyright holders of the package, and any dates present with those notices, if available. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetCopyrightText(value *string)() { + m.copyrightText = value +} +// SetDownloadLocation sets the downloadLocation property value. The location where the package can be downloaded,or NOASSERTION if this has not been determined. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetDownloadLocation(value *string)() { + m.downloadLocation = value +} +// SetExternalRefs sets the externalRefs property value. The externalRefs property +func (m *DependencyGraphSpdxSbom_sbom_packages) SetExternalRefs(value []DependencyGraphSpdxSbom_sbom_packages_externalRefsable)() { + m.externalRefs = value +} +// SetFilesAnalyzed sets the filesAnalyzed property value. Whether the package's file content has been subjected toanalysis during the creation of the SPDX document. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetFilesAnalyzed(value *bool)() { + m.filesAnalyzed = value +} +// SetLicenseConcluded sets the licenseConcluded property value. The license of the package as determined while creating the SPDX document. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetLicenseConcluded(value *string)() { + m.licenseConcluded = value +} +// SetLicenseDeclared sets the licenseDeclared property value. The license of the package as declared by its author, or NOASSERTION if this informationwas not available when the SPDX document was created. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetLicenseDeclared(value *string)() { + m.licenseDeclared = value +} +// SetName sets the name property value. The name of the package. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetName(value *string)() { + m.name = value +} +// SetSPDXID sets the SPDXID property value. A unique SPDX identifier for the package. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetSPDXID(value *string)() { + m.sPDXID = value +} +// SetSupplier sets the supplier property value. The distribution source of this package, or NOASSERTION if this was not determined. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetSupplier(value *string)() { + m.supplier = value +} +// SetVersionInfo sets the versionInfo property value. The version of the package. If the package does not have an exact version specified,a version range is given. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetVersionInfo(value *string)() { + m.versionInfo = value +} +type DependencyGraphSpdxSbom_sbom_packagesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCopyrightText()(*string) + GetDownloadLocation()(*string) + GetExternalRefs()([]DependencyGraphSpdxSbom_sbom_packages_externalRefsable) + GetFilesAnalyzed()(*bool) + GetLicenseConcluded()(*string) + GetLicenseDeclared()(*string) + GetName()(*string) + GetSPDXID()(*string) + GetSupplier()(*string) + GetVersionInfo()(*string) + SetCopyrightText(value *string)() + SetDownloadLocation(value *string)() + SetExternalRefs(value []DependencyGraphSpdxSbom_sbom_packages_externalRefsable)() + SetFilesAnalyzed(value *bool)() + SetLicenseConcluded(value *string)() + SetLicenseDeclared(value *string)() + SetName(value *string)() + SetSPDXID(value *string)() + SetSupplier(value *string)() + SetVersionInfo(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_spdx_sbom_sbom_packages_external_refs.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_spdx_sbom_sbom_packages_external_refs.go new file mode 100644 index 000000000..a161a0fb1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/dependency_graph_spdx_sbom_sbom_packages_external_refs.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DependencyGraphSpdxSbom_sbom_packages_externalRefs struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The category of reference to an external resource this reference refers to. + referenceCategory *string + // A locator for the particular external resource this reference refers to. + referenceLocator *string + // The category of reference to an external resource this reference refers to. + referenceType *string +} +// NewDependencyGraphSpdxSbom_sbom_packages_externalRefs instantiates a new DependencyGraphSpdxSbom_sbom_packages_externalRefs and sets the default values. +func NewDependencyGraphSpdxSbom_sbom_packages_externalRefs()(*DependencyGraphSpdxSbom_sbom_packages_externalRefs) { + m := &DependencyGraphSpdxSbom_sbom_packages_externalRefs{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependencyGraphSpdxSbom_sbom_packages_externalRefsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependencyGraphSpdxSbom_sbom_packages_externalRefsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependencyGraphSpdxSbom_sbom_packages_externalRefs(), 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 *DependencyGraphSpdxSbom_sbom_packages_externalRefs) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependencyGraphSpdxSbom_sbom_packages_externalRefs) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["referenceCategory"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReferenceCategory(val) + } + return nil + } + res["referenceLocator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReferenceLocator(val) + } + return nil + } + res["referenceType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReferenceType(val) + } + return nil + } + return res +} +// GetReferenceCategory gets the referenceCategory property value. The category of reference to an external resource this reference refers to. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages_externalRefs) GetReferenceCategory()(*string) { + return m.referenceCategory +} +// GetReferenceLocator gets the referenceLocator property value. A locator for the particular external resource this reference refers to. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages_externalRefs) GetReferenceLocator()(*string) { + return m.referenceLocator +} +// GetReferenceType gets the referenceType property value. The category of reference to an external resource this reference refers to. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages_externalRefs) GetReferenceType()(*string) { + return m.referenceType +} +// Serialize serializes information the current object +func (m *DependencyGraphSpdxSbom_sbom_packages_externalRefs) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("referenceCategory", m.GetReferenceCategory()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("referenceLocator", m.GetReferenceLocator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("referenceType", m.GetReferenceType()) + 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 *DependencyGraphSpdxSbom_sbom_packages_externalRefs) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetReferenceCategory sets the referenceCategory property value. The category of reference to an external resource this reference refers to. +func (m *DependencyGraphSpdxSbom_sbom_packages_externalRefs) SetReferenceCategory(value *string)() { + m.referenceCategory = value +} +// SetReferenceLocator sets the referenceLocator property value. A locator for the particular external resource this reference refers to. +func (m *DependencyGraphSpdxSbom_sbom_packages_externalRefs) SetReferenceLocator(value *string)() { + m.referenceLocator = value +} +// SetReferenceType sets the referenceType property value. The category of reference to an external resource this reference refers to. +func (m *DependencyGraphSpdxSbom_sbom_packages_externalRefs) SetReferenceType(value *string)() { + m.referenceType = value +} +type DependencyGraphSpdxSbom_sbom_packages_externalRefsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetReferenceCategory()(*string) + GetReferenceLocator()(*string) + GetReferenceType()(*string) + SetReferenceCategory(value *string)() + SetReferenceLocator(value *string)() + SetReferenceType(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/deploy_key.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/deploy_key.go new file mode 100644 index 000000000..e51d0d311 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/deploy_key.go @@ -0,0 +1,313 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DeployKey an SSH key granting access to a single repository. +type DeployKey struct { + // The added_by property + added_by *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *string + // The id property + id *int32 + // The key property + key *string + // The last_used property + last_used *string + // The read_only property + read_only *bool + // The title property + title *string + // The url property + url *string + // The verified property + verified *bool +} +// NewDeployKey instantiates a new DeployKey and sets the default values. +func NewDeployKey()(*DeployKey) { + m := &DeployKey{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeployKeyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeployKeyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeployKey(), nil +} +// GetAddedBy gets the added_by property value. The added_by property +// returns a *string when successful +func (m *DeployKey) GetAddedBy()(*string) { + return m.added_by +} +// 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 *DeployKey) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *DeployKey) GetCreatedAt()(*string) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DeployKey) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["added_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAddedBy(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["last_used"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLastUsed(val) + } + return nil + } + res["read_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetReadOnly(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *DeployKey) GetId()(*int32) { + return m.id +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *DeployKey) GetKey()(*string) { + return m.key +} +// GetLastUsed gets the last_used property value. The last_used property +// returns a *string when successful +func (m *DeployKey) GetLastUsed()(*string) { + return m.last_used +} +// GetReadOnly gets the read_only property value. The read_only property +// returns a *bool when successful +func (m *DeployKey) GetReadOnly()(*bool) { + return m.read_only +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *DeployKey) GetTitle()(*string) { + return m.title +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *DeployKey) GetUrl()(*string) { + return m.url +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *DeployKey) GetVerified()(*bool) { + return m.verified +} +// Serialize serializes information the current object +func (m *DeployKey) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("added_by", m.GetAddedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("last_used", m.GetLastUsed()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("read_only", m.GetReadOnly()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAddedBy sets the added_by property value. The added_by property +func (m *DeployKey) SetAddedBy(value *string)() { + m.added_by = value +} +// 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 *DeployKey) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *DeployKey) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *DeployKey) SetId(value *int32)() { + m.id = value +} +// SetKey sets the key property value. The key property +func (m *DeployKey) SetKey(value *string)() { + m.key = value +} +// SetLastUsed sets the last_used property value. The last_used property +func (m *DeployKey) SetLastUsed(value *string)() { + m.last_used = value +} +// SetReadOnly sets the read_only property value. The read_only property +func (m *DeployKey) SetReadOnly(value *bool)() { + m.read_only = value +} +// SetTitle sets the title property value. The title property +func (m *DeployKey) SetTitle(value *string)() { + m.title = value +} +// SetUrl sets the url property value. The url property +func (m *DeployKey) SetUrl(value *string)() { + m.url = value +} +// SetVerified sets the verified property value. The verified property +func (m *DeployKey) SetVerified(value *bool)() { + m.verified = value +} +type DeployKeyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAddedBy()(*string) + GetCreatedAt()(*string) + GetId()(*int32) + GetKey()(*string) + GetLastUsed()(*string) + GetReadOnly()(*bool) + GetTitle()(*string) + GetUrl()(*string) + GetVerified()(*bool) + SetAddedBy(value *string)() + SetCreatedAt(value *string)() + SetId(value *int32)() + SetKey(value *string)() + SetLastUsed(value *string)() + SetReadOnly(value *bool)() + SetTitle(value *string)() + SetUrl(value *string)() + SetVerified(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment.go new file mode 100644 index 000000000..7b7f0289d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment.go @@ -0,0 +1,575 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Deployment a request for a specific ref(branch,sha,tag) to be deployed +type Deployment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + creator NullableSimpleUserable + // The description property + description *string + // Name for the target deployment environment. + environment *string + // Unique identifier of the deployment + id *int64 + // The node_id property + node_id *string + // The original_environment property + original_environment *string + // The payload property + payload *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // Specifies if the given environment is one that end-users directly interact with. Default: false. + production_environment *bool + // The ref to deploy. This can be a branch, tag, or sha. + ref *string + // The repository_url property + repository_url *string + // The sha property + sha *string + // The statuses_url property + statuses_url *string + // Parameter to specify a task to execute + task *string + // Specifies if the given environment is will no longer exist at some point in the future. Default: false. + transient_environment *bool + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewDeployment instantiates a new Deployment and sets the default values. +func NewDeployment()(*Deployment) { + m := &Deployment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeploymentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeployment(), 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 *Deployment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Deployment) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCreator gets the creator property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Deployment) GetCreator()(NullableSimpleUserable) { + return m.creator +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *Deployment) GetDescription()(*string) { + return m.description +} +// GetEnvironment gets the environment property value. Name for the target deployment environment. +// returns a *string when successful +func (m *Deployment) GetEnvironment()(*string) { + return m.environment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Deployment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["creator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreator(val.(NullableSimpleUserable)) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["original_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOriginalEnvironment(val) + } + return nil + } + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPayload(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["production_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetProductionEnvironment(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["task"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTask(val) + } + return nil + } + res["transient_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTransientEnvironment(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the deployment +// returns a *int64 when successful +func (m *Deployment) GetId()(*int64) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Deployment) GetNodeId()(*string) { + return m.node_id +} +// GetOriginalEnvironment gets the original_environment property value. The original_environment property +// returns a *string when successful +func (m *Deployment) GetOriginalEnvironment()(*string) { + return m.original_environment +} +// GetPayload gets the payload property value. The payload property +// returns a *string when successful +func (m *Deployment) GetPayload()(*string) { + return m.payload +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *Deployment) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetProductionEnvironment gets the production_environment property value. Specifies if the given environment is one that end-users directly interact with. Default: false. +// returns a *bool when successful +func (m *Deployment) GetProductionEnvironment()(*bool) { + return m.production_environment +} +// GetRef gets the ref property value. The ref to deploy. This can be a branch, tag, or sha. +// returns a *string when successful +func (m *Deployment) GetRef()(*string) { + return m.ref +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *Deployment) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *Deployment) GetSha()(*string) { + return m.sha +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *Deployment) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetTask gets the task property value. Parameter to specify a task to execute +// returns a *string when successful +func (m *Deployment) GetTask()(*string) { + return m.task +} +// GetTransientEnvironment gets the transient_environment property value. Specifies if the given environment is will no longer exist at some point in the future. Default: false. +// returns a *bool when successful +func (m *Deployment) GetTransientEnvironment()(*bool) { + return m.transient_environment +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Deployment) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Deployment) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Deployment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("creator", m.GetCreator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("original_environment", m.GetOriginalEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("payload", m.GetPayload()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("production_environment", m.GetProductionEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("task", m.GetTask()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("transient_environment", m.GetTransientEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Deployment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Deployment) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCreator sets the creator property value. A GitHub user. +func (m *Deployment) SetCreator(value NullableSimpleUserable)() { + m.creator = value +} +// SetDescription sets the description property value. The description property +func (m *Deployment) SetDescription(value *string)() { + m.description = value +} +// SetEnvironment sets the environment property value. Name for the target deployment environment. +func (m *Deployment) SetEnvironment(value *string)() { + m.environment = value +} +// SetId sets the id property value. Unique identifier of the deployment +func (m *Deployment) SetId(value *int64)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Deployment) SetNodeId(value *string)() { + m.node_id = value +} +// SetOriginalEnvironment sets the original_environment property value. The original_environment property +func (m *Deployment) SetOriginalEnvironment(value *string)() { + m.original_environment = value +} +// SetPayload sets the payload property value. The payload property +func (m *Deployment) SetPayload(value *string)() { + m.payload = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *Deployment) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetProductionEnvironment sets the production_environment property value. Specifies if the given environment is one that end-users directly interact with. Default: false. +func (m *Deployment) SetProductionEnvironment(value *bool)() { + m.production_environment = value +} +// SetRef sets the ref property value. The ref to deploy. This can be a branch, tag, or sha. +func (m *Deployment) SetRef(value *string)() { + m.ref = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *Deployment) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetSha sets the sha property value. The sha property +func (m *Deployment) SetSha(value *string)() { + m.sha = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *Deployment) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetTask sets the task property value. Parameter to specify a task to execute +func (m *Deployment) SetTask(value *string)() { + m.task = value +} +// SetTransientEnvironment sets the transient_environment property value. Specifies if the given environment is will no longer exist at some point in the future. Default: false. +func (m *Deployment) SetTransientEnvironment(value *bool)() { + m.transient_environment = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Deployment) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Deployment) SetUrl(value *string)() { + m.url = value +} +type Deploymentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreator()(NullableSimpleUserable) + GetDescription()(*string) + GetEnvironment()(*string) + GetId()(*int64) + GetNodeId()(*string) + GetOriginalEnvironment()(*string) + GetPayload()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetProductionEnvironment()(*bool) + GetRef()(*string) + GetRepositoryUrl()(*string) + GetSha()(*string) + GetStatusesUrl()(*string) + GetTask()(*string) + GetTransientEnvironment()(*bool) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreator(value NullableSimpleUserable)() + SetDescription(value *string)() + SetEnvironment(value *string)() + SetId(value *int64)() + SetNodeId(value *string)() + SetOriginalEnvironment(value *string)() + SetPayload(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetProductionEnvironment(value *bool)() + SetRef(value *string)() + SetRepositoryUrl(value *string)() + SetSha(value *string)() + SetStatusesUrl(value *string)() + SetTask(value *string)() + SetTransientEnvironment(value *bool)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy.go new file mode 100644 index 000000000..b09c45fca --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy.go @@ -0,0 +1,169 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DeploymentBranchPolicy details of a deployment branch or tag policy. +type DeploymentBranchPolicy struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The unique identifier of the branch or tag policy. + id *int32 + // The name pattern that branches or tags must match in order to deploy to the environment. + name *string + // The node_id property + node_id *string + // Whether this rule targets a branch or tag. + typeEscaped *DeploymentBranchPolicy_type +} +// NewDeploymentBranchPolicy instantiates a new DeploymentBranchPolicy and sets the default values. +func NewDeploymentBranchPolicy()(*DeploymentBranchPolicy) { + m := &DeploymentBranchPolicy{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeploymentBranchPolicyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentBranchPolicyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeploymentBranchPolicy(), 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 *DeploymentBranchPolicy) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DeploymentBranchPolicy) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDeploymentBranchPolicy_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*DeploymentBranchPolicy_type)) + } + return nil + } + return res +} +// GetId gets the id property value. The unique identifier of the branch or tag policy. +// returns a *int32 when successful +func (m *DeploymentBranchPolicy) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name pattern that branches or tags must match in order to deploy to the environment. +// returns a *string when successful +func (m *DeploymentBranchPolicy) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *DeploymentBranchPolicy) GetNodeId()(*string) { + return m.node_id +} +// GetTypeEscaped gets the type property value. Whether this rule targets a branch or tag. +// returns a *DeploymentBranchPolicy_type when successful +func (m *DeploymentBranchPolicy) GetTypeEscaped()(*DeploymentBranchPolicy_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *DeploymentBranchPolicy) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *DeploymentBranchPolicy) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The unique identifier of the branch or tag policy. +func (m *DeploymentBranchPolicy) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name pattern that branches or tags must match in order to deploy to the environment. +func (m *DeploymentBranchPolicy) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *DeploymentBranchPolicy) SetNodeId(value *string)() { + m.node_id = value +} +// SetTypeEscaped sets the type property value. Whether this rule targets a branch or tag. +func (m *DeploymentBranchPolicy) SetTypeEscaped(value *DeploymentBranchPolicy_type)() { + m.typeEscaped = value +} +type DeploymentBranchPolicyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetTypeEscaped()(*DeploymentBranchPolicy_type) + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetTypeEscaped(value *DeploymentBranchPolicy_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy_name_pattern.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy_name_pattern.go new file mode 100644 index 000000000..543ff4b41 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy_name_pattern.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DeploymentBranchPolicyNamePattern struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name pattern that branches must match in order to deploy to the environment.Wildcard characters will not match `/`. For example, to match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.For more information about pattern matching syntax, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch). + name *string +} +// NewDeploymentBranchPolicyNamePattern instantiates a new DeploymentBranchPolicyNamePattern and sets the default values. +func NewDeploymentBranchPolicyNamePattern()(*DeploymentBranchPolicyNamePattern) { + m := &DeploymentBranchPolicyNamePattern{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeploymentBranchPolicyNamePatternFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentBranchPolicyNamePatternFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeploymentBranchPolicyNamePattern(), 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 *DeploymentBranchPolicyNamePattern) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DeploymentBranchPolicyNamePattern) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name pattern that branches must match in order to deploy to the environment.Wildcard characters will not match `/`. For example, to match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.For more information about pattern matching syntax, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch). +// returns a *string when successful +func (m *DeploymentBranchPolicyNamePattern) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *DeploymentBranchPolicyNamePattern) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *DeploymentBranchPolicyNamePattern) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name pattern that branches must match in order to deploy to the environment.Wildcard characters will not match `/`. For example, to match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.For more information about pattern matching syntax, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch). +func (m *DeploymentBranchPolicyNamePattern) SetName(value *string)() { + m.name = value +} +type DeploymentBranchPolicyNamePatternable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy_name_pattern_with_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy_name_pattern_with_type.go new file mode 100644 index 000000000..d0aa7554f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy_name_pattern_with_type.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DeploymentBranchPolicyNamePatternWithType struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name pattern that branches or tags must match in order to deploy to the environment.Wildcard characters will not match `/`. For example, to match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.For more information about pattern matching syntax, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch). + name *string + // Whether this rule targets a branch or tag + typeEscaped *DeploymentBranchPolicyNamePatternWithType_type +} +// NewDeploymentBranchPolicyNamePatternWithType instantiates a new DeploymentBranchPolicyNamePatternWithType and sets the default values. +func NewDeploymentBranchPolicyNamePatternWithType()(*DeploymentBranchPolicyNamePatternWithType) { + m := &DeploymentBranchPolicyNamePatternWithType{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeploymentBranchPolicyNamePatternWithTypeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentBranchPolicyNamePatternWithTypeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeploymentBranchPolicyNamePatternWithType(), 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 *DeploymentBranchPolicyNamePatternWithType) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DeploymentBranchPolicyNamePatternWithType) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDeploymentBranchPolicyNamePatternWithType_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*DeploymentBranchPolicyNamePatternWithType_type)) + } + return nil + } + return res +} +// GetName gets the name property value. The name pattern that branches or tags must match in order to deploy to the environment.Wildcard characters will not match `/`. For example, to match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.For more information about pattern matching syntax, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch). +// returns a *string when successful +func (m *DeploymentBranchPolicyNamePatternWithType) GetName()(*string) { + return m.name +} +// GetTypeEscaped gets the type property value. Whether this rule targets a branch or tag +// returns a *DeploymentBranchPolicyNamePatternWithType_type when successful +func (m *DeploymentBranchPolicyNamePatternWithType) GetTypeEscaped()(*DeploymentBranchPolicyNamePatternWithType_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *DeploymentBranchPolicyNamePatternWithType) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *DeploymentBranchPolicyNamePatternWithType) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name pattern that branches or tags must match in order to deploy to the environment.Wildcard characters will not match `/`. For example, to match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.For more information about pattern matching syntax, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch). +func (m *DeploymentBranchPolicyNamePatternWithType) SetName(value *string)() { + m.name = value +} +// SetTypeEscaped sets the type property value. Whether this rule targets a branch or tag +func (m *DeploymentBranchPolicyNamePatternWithType) SetTypeEscaped(value *DeploymentBranchPolicyNamePatternWithType_type)() { + m.typeEscaped = value +} +type DeploymentBranchPolicyNamePatternWithTypeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetTypeEscaped()(*DeploymentBranchPolicyNamePatternWithType_type) + SetName(value *string)() + SetTypeEscaped(value *DeploymentBranchPolicyNamePatternWithType_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy_name_pattern_with_type_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy_name_pattern_with_type_type.go new file mode 100644 index 000000000..8cb5c811b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy_name_pattern_with_type_type.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// Whether this rule targets a branch or tag +type DeploymentBranchPolicyNamePatternWithType_type int + +const ( + BRANCH_DEPLOYMENTBRANCHPOLICYNAMEPATTERNWITHTYPE_TYPE DeploymentBranchPolicyNamePatternWithType_type = iota + TAG_DEPLOYMENTBRANCHPOLICYNAMEPATTERNWITHTYPE_TYPE +) + +func (i DeploymentBranchPolicyNamePatternWithType_type) String() string { + return []string{"branch", "tag"}[i] +} +func ParseDeploymentBranchPolicyNamePatternWithType_type(v string) (any, error) { + result := BRANCH_DEPLOYMENTBRANCHPOLICYNAMEPATTERNWITHTYPE_TYPE + switch v { + case "branch": + result = BRANCH_DEPLOYMENTBRANCHPOLICYNAMEPATTERNWITHTYPE_TYPE + case "tag": + result = TAG_DEPLOYMENTBRANCHPOLICYNAMEPATTERNWITHTYPE_TYPE + default: + return 0, errors.New("Unknown DeploymentBranchPolicyNamePatternWithType_type value: " + v) + } + return &result, nil +} +func SerializeDeploymentBranchPolicyNamePatternWithType_type(values []DeploymentBranchPolicyNamePatternWithType_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DeploymentBranchPolicyNamePatternWithType_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy_settings.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy_settings.go new file mode 100644 index 000000000..3724f4005 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy_settings.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DeploymentBranchPolicySettings the type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`. +type DeploymentBranchPolicySettings struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`. + custom_branch_policies *bool + // Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`. + protected_branches *bool +} +// NewDeploymentBranchPolicySettings instantiates a new DeploymentBranchPolicySettings and sets the default values. +func NewDeploymentBranchPolicySettings()(*DeploymentBranchPolicySettings) { + m := &DeploymentBranchPolicySettings{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeploymentBranchPolicySettingsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentBranchPolicySettingsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeploymentBranchPolicySettings(), 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 *DeploymentBranchPolicySettings) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCustomBranchPolicies gets the custom_branch_policies property value. Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`. +// returns a *bool when successful +func (m *DeploymentBranchPolicySettings) GetCustomBranchPolicies()(*bool) { + return m.custom_branch_policies +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DeploymentBranchPolicySettings) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["custom_branch_policies"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCustomBranchPolicies(val) + } + return nil + } + res["protected_branches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetProtectedBranches(val) + } + return nil + } + return res +} +// GetProtectedBranches gets the protected_branches property value. Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`. +// returns a *bool when successful +func (m *DeploymentBranchPolicySettings) GetProtectedBranches()(*bool) { + return m.protected_branches +} +// Serialize serializes information the current object +func (m *DeploymentBranchPolicySettings) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("custom_branch_policies", m.GetCustomBranchPolicies()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("protected_branches", m.GetProtectedBranches()) + 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 *DeploymentBranchPolicySettings) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCustomBranchPolicies sets the custom_branch_policies property value. Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`. +func (m *DeploymentBranchPolicySettings) SetCustomBranchPolicies(value *bool)() { + m.custom_branch_policies = value +} +// SetProtectedBranches sets the protected_branches property value. Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`. +func (m *DeploymentBranchPolicySettings) SetProtectedBranches(value *bool)() { + m.protected_branches = value +} +type DeploymentBranchPolicySettingsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCustomBranchPolicies()(*bool) + GetProtectedBranches()(*bool) + SetCustomBranchPolicies(value *bool)() + SetProtectedBranches(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy_type.go new file mode 100644 index 000000000..eed415919 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_branch_policy_type.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// Whether this rule targets a branch or tag. +type DeploymentBranchPolicy_type int + +const ( + BRANCH_DEPLOYMENTBRANCHPOLICY_TYPE DeploymentBranchPolicy_type = iota + TAG_DEPLOYMENTBRANCHPOLICY_TYPE +) + +func (i DeploymentBranchPolicy_type) String() string { + return []string{"branch", "tag"}[i] +} +func ParseDeploymentBranchPolicy_type(v string) (any, error) { + result := BRANCH_DEPLOYMENTBRANCHPOLICY_TYPE + switch v { + case "branch": + result = BRANCH_DEPLOYMENTBRANCHPOLICY_TYPE + case "tag": + result = TAG_DEPLOYMENTBRANCHPOLICY_TYPE + default: + return 0, errors.New("Unknown DeploymentBranchPolicy_type value: " + v) + } + return &result, nil +} +func SerializeDeploymentBranchPolicy_type(values []DeploymentBranchPolicy_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DeploymentBranchPolicy_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_payload_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_payload_member1.go new file mode 100644 index 000000000..7f429d5a3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_payload_member1.go @@ -0,0 +1,50 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Deployment_payloadMember1 +type Deployment_payloadMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewDeployment_payloadMember1 instantiates a new deployment_payloadMember1 and sets the default values. +func NewDeployment_payloadMember1()(*Deployment_payloadMember1) { + m := &Deployment_payloadMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeployment_payloadMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateDeployment_payloadMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeployment_payloadMember1(), 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. +func (m *Deployment_payloadMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +func (m *Deployment_payloadMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *Deployment_payloadMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *Deployment_payloadMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// Deployment_payloadMember1able +type Deployment_payloadMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_protection_rule.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_protection_rule.go new file mode 100644 index 000000000..104d5e14f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_protection_rule.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DeploymentProtectionRule deployment protection rule +type DeploymentProtectionRule struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub App that is providing a custom deployment protection rule. + app CustomDeploymentRuleAppable + // Whether the deployment protection rule is enabled for the environment. + enabled *bool + // The unique identifier for the deployment protection rule. + id *int32 + // The node ID for the deployment protection rule. + node_id *string +} +// NewDeploymentProtectionRule instantiates a new DeploymentProtectionRule and sets the default values. +func NewDeploymentProtectionRule()(*DeploymentProtectionRule) { + m := &DeploymentProtectionRule{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeploymentProtectionRuleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentProtectionRuleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeploymentProtectionRule(), 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 *DeploymentProtectionRule) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApp gets the app property value. A GitHub App that is providing a custom deployment protection rule. +// returns a CustomDeploymentRuleAppable when successful +func (m *DeploymentProtectionRule) GetApp()(CustomDeploymentRuleAppable) { + return m.app +} +// GetEnabled gets the enabled property value. Whether the deployment protection rule is enabled for the environment. +// returns a *bool when successful +func (m *DeploymentProtectionRule) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DeploymentProtectionRule) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCustomDeploymentRuleAppFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetApp(val.(CustomDeploymentRuleAppable)) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + return res +} +// GetId gets the id property value. The unique identifier for the deployment protection rule. +// returns a *int32 when successful +func (m *DeploymentProtectionRule) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node ID for the deployment protection rule. +// returns a *string when successful +func (m *DeploymentProtectionRule) GetNodeId()(*string) { + return m.node_id +} +// Serialize serializes information the current object +func (m *DeploymentProtectionRule) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("app", m.GetApp()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + 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 *DeploymentProtectionRule) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApp sets the app property value. A GitHub App that is providing a custom deployment protection rule. +func (m *DeploymentProtectionRule) SetApp(value CustomDeploymentRuleAppable)() { + m.app = value +} +// SetEnabled sets the enabled property value. Whether the deployment protection rule is enabled for the environment. +func (m *DeploymentProtectionRule) SetEnabled(value *bool)() { + m.enabled = value +} +// SetId sets the id property value. The unique identifier for the deployment protection rule. +func (m *DeploymentProtectionRule) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node ID for the deployment protection rule. +func (m *DeploymentProtectionRule) SetNodeId(value *string)() { + m.node_id = value +} +type DeploymentProtectionRuleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApp()(CustomDeploymentRuleAppable) + GetEnabled()(*bool) + GetId()(*int32) + GetNodeId()(*string) + SetApp(value CustomDeploymentRuleAppable)() + SetEnabled(value *bool)() + SetId(value *int32)() + SetNodeId(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_reviewer_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_reviewer_type.go new file mode 100644 index 000000000..64d0295f2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_reviewer_type.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The type of reviewer. +type DeploymentReviewerType int + +const ( + USER_DEPLOYMENTREVIEWERTYPE DeploymentReviewerType = iota + TEAM_DEPLOYMENTREVIEWERTYPE +) + +func (i DeploymentReviewerType) String() string { + return []string{"User", "Team"}[i] +} +func ParseDeploymentReviewerType(v string) (any, error) { + result := USER_DEPLOYMENTREVIEWERTYPE + switch v { + case "User": + result = USER_DEPLOYMENTREVIEWERTYPE + case "Team": + result = TEAM_DEPLOYMENTREVIEWERTYPE + default: + return 0, errors.New("Unknown DeploymentReviewerType value: " + v) + } + return &result, nil +} +func SerializeDeploymentReviewerType(values []DeploymentReviewerType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DeploymentReviewerType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_simple.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_simple.go new file mode 100644 index 000000000..1eb295a8d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_simple.go @@ -0,0 +1,459 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DeploymentSimple a deployment created as the result of an Actions check run from a workflow that references an environment +type DeploymentSimple struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The description property + description *string + // Name for the target deployment environment. + environment *string + // Unique identifier of the deployment + id *int32 + // The node_id property + node_id *string + // The original_environment property + original_environment *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // Specifies if the given environment is one that end-users directly interact with. Default: false. + production_environment *bool + // The repository_url property + repository_url *string + // The statuses_url property + statuses_url *string + // Parameter to specify a task to execute + task *string + // Specifies if the given environment is will no longer exist at some point in the future. Default: false. + transient_environment *bool + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewDeploymentSimple instantiates a new DeploymentSimple and sets the default values. +func NewDeploymentSimple()(*DeploymentSimple) { + m := &DeploymentSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeploymentSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeploymentSimple(), 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 *DeploymentSimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *DeploymentSimple) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *DeploymentSimple) GetDescription()(*string) { + return m.description +} +// GetEnvironment gets the environment property value. Name for the target deployment environment. +// returns a *string when successful +func (m *DeploymentSimple) GetEnvironment()(*string) { + return m.environment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DeploymentSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["original_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOriginalEnvironment(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["production_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetProductionEnvironment(val) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["task"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTask(val) + } + return nil + } + res["transient_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTransientEnvironment(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the deployment +// returns a *int32 when successful +func (m *DeploymentSimple) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *DeploymentSimple) GetNodeId()(*string) { + return m.node_id +} +// GetOriginalEnvironment gets the original_environment property value. The original_environment property +// returns a *string when successful +func (m *DeploymentSimple) GetOriginalEnvironment()(*string) { + return m.original_environment +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *DeploymentSimple) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetProductionEnvironment gets the production_environment property value. Specifies if the given environment is one that end-users directly interact with. Default: false. +// returns a *bool when successful +func (m *DeploymentSimple) GetProductionEnvironment()(*bool) { + return m.production_environment +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *DeploymentSimple) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *DeploymentSimple) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetTask gets the task property value. Parameter to specify a task to execute +// returns a *string when successful +func (m *DeploymentSimple) GetTask()(*string) { + return m.task +} +// GetTransientEnvironment gets the transient_environment property value. Specifies if the given environment is will no longer exist at some point in the future. Default: false. +// returns a *bool when successful +func (m *DeploymentSimple) GetTransientEnvironment()(*bool) { + return m.transient_environment +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *DeploymentSimple) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *DeploymentSimple) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *DeploymentSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("original_environment", m.GetOriginalEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("production_environment", m.GetProductionEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("task", m.GetTask()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("transient_environment", m.GetTransientEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *DeploymentSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *DeploymentSimple) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *DeploymentSimple) SetDescription(value *string)() { + m.description = value +} +// SetEnvironment sets the environment property value. Name for the target deployment environment. +func (m *DeploymentSimple) SetEnvironment(value *string)() { + m.environment = value +} +// SetId sets the id property value. Unique identifier of the deployment +func (m *DeploymentSimple) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *DeploymentSimple) SetNodeId(value *string)() { + m.node_id = value +} +// SetOriginalEnvironment sets the original_environment property value. The original_environment property +func (m *DeploymentSimple) SetOriginalEnvironment(value *string)() { + m.original_environment = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *DeploymentSimple) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetProductionEnvironment sets the production_environment property value. Specifies if the given environment is one that end-users directly interact with. Default: false. +func (m *DeploymentSimple) SetProductionEnvironment(value *bool)() { + m.production_environment = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *DeploymentSimple) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *DeploymentSimple) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetTask sets the task property value. Parameter to specify a task to execute +func (m *DeploymentSimple) SetTask(value *string)() { + m.task = value +} +// SetTransientEnvironment sets the transient_environment property value. Specifies if the given environment is will no longer exist at some point in the future. Default: false. +func (m *DeploymentSimple) SetTransientEnvironment(value *bool)() { + m.transient_environment = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *DeploymentSimple) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *DeploymentSimple) SetUrl(value *string)() { + m.url = value +} +type DeploymentSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetEnvironment()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetOriginalEnvironment()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetProductionEnvironment()(*bool) + GetRepositoryUrl()(*string) + GetStatusesUrl()(*string) + GetTask()(*string) + GetTransientEnvironment()(*bool) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetEnvironment(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetOriginalEnvironment(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetProductionEnvironment(value *bool)() + SetRepositoryUrl(value *string)() + SetStatusesUrl(value *string)() + SetTask(value *string)() + SetTransientEnvironment(value *bool)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_status.go new file mode 100644 index 000000000..69367899b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_status.go @@ -0,0 +1,489 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DeploymentStatus the status of a deployment. +type DeploymentStatus struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + creator NullableSimpleUserable + // The deployment_url property + deployment_url *string + // A short description of the status. + description *string + // The environment of the deployment that the status is for. + environment *string + // The URL for accessing your environment. + environment_url *string + // The id property + id *int64 + // The URL to associate with this status. + log_url *string + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The repository_url property + repository_url *string + // The state of the status. + state *DeploymentStatus_state + // Deprecated: the URL to associate with this status. + target_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewDeploymentStatus instantiates a new DeploymentStatus and sets the default values. +func NewDeploymentStatus()(*DeploymentStatus) { + m := &DeploymentStatus{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeploymentStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeploymentStatus(), 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 *DeploymentStatus) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *DeploymentStatus) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCreator gets the creator property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *DeploymentStatus) GetCreator()(NullableSimpleUserable) { + return m.creator +} +// GetDeploymentUrl gets the deployment_url property value. The deployment_url property +// returns a *string when successful +func (m *DeploymentStatus) GetDeploymentUrl()(*string) { + return m.deployment_url +} +// GetDescription gets the description property value. A short description of the status. +// returns a *string when successful +func (m *DeploymentStatus) GetDescription()(*string) { + return m.description +} +// GetEnvironment gets the environment property value. The environment of the deployment that the status is for. +// returns a *string when successful +func (m *DeploymentStatus) GetEnvironment()(*string) { + return m.environment +} +// GetEnvironmentUrl gets the environment_url property value. The URL for accessing your environment. +// returns a *string when successful +func (m *DeploymentStatus) GetEnvironmentUrl()(*string) { + return m.environment_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DeploymentStatus) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["creator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreator(val.(NullableSimpleUserable)) + } + return nil + } + res["deployment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentUrl(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val) + } + return nil + } + res["environment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironmentUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["log_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDeploymentStatus_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*DeploymentStatus_state)) + } + return nil + } + res["target_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *DeploymentStatus) GetId()(*int64) { + return m.id +} +// GetLogUrl gets the log_url property value. The URL to associate with this status. +// returns a *string when successful +func (m *DeploymentStatus) GetLogUrl()(*string) { + return m.log_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *DeploymentStatus) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *DeploymentStatus) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *DeploymentStatus) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetState gets the state property value. The state of the status. +// returns a *DeploymentStatus_state when successful +func (m *DeploymentStatus) GetState()(*DeploymentStatus_state) { + return m.state +} +// GetTargetUrl gets the target_url property value. Deprecated: the URL to associate with this status. +// returns a *string when successful +func (m *DeploymentStatus) GetTargetUrl()(*string) { + return m.target_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *DeploymentStatus) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *DeploymentStatus) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *DeploymentStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("creator", m.GetCreator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployment_url", m.GetDeploymentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment_url", m.GetEnvironmentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("log_url", m.GetLogUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_url", m.GetTargetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *DeploymentStatus) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *DeploymentStatus) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCreator sets the creator property value. A GitHub user. +func (m *DeploymentStatus) SetCreator(value NullableSimpleUserable)() { + m.creator = value +} +// SetDeploymentUrl sets the deployment_url property value. The deployment_url property +func (m *DeploymentStatus) SetDeploymentUrl(value *string)() { + m.deployment_url = value +} +// SetDescription sets the description property value. A short description of the status. +func (m *DeploymentStatus) SetDescription(value *string)() { + m.description = value +} +// SetEnvironment sets the environment property value. The environment of the deployment that the status is for. +func (m *DeploymentStatus) SetEnvironment(value *string)() { + m.environment = value +} +// SetEnvironmentUrl sets the environment_url property value. The URL for accessing your environment. +func (m *DeploymentStatus) SetEnvironmentUrl(value *string)() { + m.environment_url = value +} +// SetId sets the id property value. The id property +func (m *DeploymentStatus) SetId(value *int64)() { + m.id = value +} +// SetLogUrl sets the log_url property value. The URL to associate with this status. +func (m *DeploymentStatus) SetLogUrl(value *string)() { + m.log_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *DeploymentStatus) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *DeploymentStatus) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *DeploymentStatus) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetState sets the state property value. The state of the status. +func (m *DeploymentStatus) SetState(value *DeploymentStatus_state)() { + m.state = value +} +// SetTargetUrl sets the target_url property value. Deprecated: the URL to associate with this status. +func (m *DeploymentStatus) SetTargetUrl(value *string)() { + m.target_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *DeploymentStatus) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *DeploymentStatus) SetUrl(value *string)() { + m.url = value +} +type DeploymentStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreator()(NullableSimpleUserable) + GetDeploymentUrl()(*string) + GetDescription()(*string) + GetEnvironment()(*string) + GetEnvironmentUrl()(*string) + GetId()(*int64) + GetLogUrl()(*string) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetRepositoryUrl()(*string) + GetState()(*DeploymentStatus_state) + GetTargetUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreator(value NullableSimpleUserable)() + SetDeploymentUrl(value *string)() + SetDescription(value *string)() + SetEnvironment(value *string)() + SetEnvironmentUrl(value *string)() + SetId(value *int64)() + SetLogUrl(value *string)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetRepositoryUrl(value *string)() + SetState(value *DeploymentStatus_state)() + SetTargetUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_status_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_status_state.go new file mode 100644 index 000000000..a9cf20470 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/deployment_status_state.go @@ -0,0 +1,52 @@ +package models +import ( + "errors" +) +// The state of the status. +type DeploymentStatus_state int + +const ( + ERROR_DEPLOYMENTSTATUS_STATE DeploymentStatus_state = iota + FAILURE_DEPLOYMENTSTATUS_STATE + INACTIVE_DEPLOYMENTSTATUS_STATE + PENDING_DEPLOYMENTSTATUS_STATE + SUCCESS_DEPLOYMENTSTATUS_STATE + QUEUED_DEPLOYMENTSTATUS_STATE + IN_PROGRESS_DEPLOYMENTSTATUS_STATE +) + +func (i DeploymentStatus_state) String() string { + return []string{"error", "failure", "inactive", "pending", "success", "queued", "in_progress"}[i] +} +func ParseDeploymentStatus_state(v string) (any, error) { + result := ERROR_DEPLOYMENTSTATUS_STATE + switch v { + case "error": + result = ERROR_DEPLOYMENTSTATUS_STATE + case "failure": + result = FAILURE_DEPLOYMENTSTATUS_STATE + case "inactive": + result = INACTIVE_DEPLOYMENTSTATUS_STATE + case "pending": + result = PENDING_DEPLOYMENTSTATUS_STATE + case "success": + result = SUCCESS_DEPLOYMENTSTATUS_STATE + case "queued": + result = QUEUED_DEPLOYMENTSTATUS_STATE + case "in_progress": + result = IN_PROGRESS_DEPLOYMENTSTATUS_STATE + default: + return 0, errors.New("Unknown DeploymentStatus_state value: " + v) + } + return &result, nil +} +func SerializeDeploymentStatus_state(values []DeploymentStatus_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DeploymentStatus_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/diff_entry.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/diff_entry.go new file mode 100644 index 000000000..a6506c819 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/diff_entry.go @@ -0,0 +1,372 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DiffEntry diff Entry +type DiffEntry struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The additions property + additions *int32 + // The blob_url property + blob_url *string + // The changes property + changes *int32 + // The contents_url property + contents_url *string + // The deletions property + deletions *int32 + // The filename property + filename *string + // The patch property + patch *string + // The previous_filename property + previous_filename *string + // The raw_url property + raw_url *string + // The sha property + sha *string + // The status property + status *DiffEntry_status +} +// NewDiffEntry instantiates a new DiffEntry and sets the default values. +func NewDiffEntry()(*DiffEntry) { + m := &DiffEntry{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDiffEntryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDiffEntryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDiffEntry(), 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 *DiffEntry) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdditions gets the additions property value. The additions property +// returns a *int32 when successful +func (m *DiffEntry) GetAdditions()(*int32) { + return m.additions +} +// GetBlobUrl gets the blob_url property value. The blob_url property +// returns a *string when successful +func (m *DiffEntry) GetBlobUrl()(*string) { + return m.blob_url +} +// GetChanges gets the changes property value. The changes property +// returns a *int32 when successful +func (m *DiffEntry) GetChanges()(*int32) { + return m.changes +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *DiffEntry) GetContentsUrl()(*string) { + return m.contents_url +} +// GetDeletions gets the deletions property value. The deletions property +// returns a *int32 when successful +func (m *DiffEntry) GetDeletions()(*int32) { + return m.deletions +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DiffEntry) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["additions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAdditions(val) + } + return nil + } + res["blob_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobUrl(val) + } + return nil + } + res["changes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetChanges(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["deletions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDeletions(val) + } + return nil + } + res["filename"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFilename(val) + } + return nil + } + res["patch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatch(val) + } + return nil + } + res["previous_filename"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviousFilename(val) + } + return nil + } + res["raw_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRawUrl(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDiffEntry_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*DiffEntry_status)) + } + return nil + } + return res +} +// GetFilename gets the filename property value. The filename property +// returns a *string when successful +func (m *DiffEntry) GetFilename()(*string) { + return m.filename +} +// GetPatch gets the patch property value. The patch property +// returns a *string when successful +func (m *DiffEntry) GetPatch()(*string) { + return m.patch +} +// GetPreviousFilename gets the previous_filename property value. The previous_filename property +// returns a *string when successful +func (m *DiffEntry) GetPreviousFilename()(*string) { + return m.previous_filename +} +// GetRawUrl gets the raw_url property value. The raw_url property +// returns a *string when successful +func (m *DiffEntry) GetRawUrl()(*string) { + return m.raw_url +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *DiffEntry) GetSha()(*string) { + return m.sha +} +// GetStatus gets the status property value. The status property +// returns a *DiffEntry_status when successful +func (m *DiffEntry) GetStatus()(*DiffEntry_status) { + return m.status +} +// Serialize serializes information the current object +func (m *DiffEntry) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("additions", m.GetAdditions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blob_url", m.GetBlobUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("changes", m.GetChanges()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("deletions", m.GetDeletions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("filename", m.GetFilename()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patch", m.GetPatch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("previous_filename", m.GetPreviousFilename()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("raw_url", m.GetRawUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err := writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *DiffEntry) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdditions sets the additions property value. The additions property +func (m *DiffEntry) SetAdditions(value *int32)() { + m.additions = value +} +// SetBlobUrl sets the blob_url property value. The blob_url property +func (m *DiffEntry) SetBlobUrl(value *string)() { + m.blob_url = value +} +// SetChanges sets the changes property value. The changes property +func (m *DiffEntry) SetChanges(value *int32)() { + m.changes = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *DiffEntry) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetDeletions sets the deletions property value. The deletions property +func (m *DiffEntry) SetDeletions(value *int32)() { + m.deletions = value +} +// SetFilename sets the filename property value. The filename property +func (m *DiffEntry) SetFilename(value *string)() { + m.filename = value +} +// SetPatch sets the patch property value. The patch property +func (m *DiffEntry) SetPatch(value *string)() { + m.patch = value +} +// SetPreviousFilename sets the previous_filename property value. The previous_filename property +func (m *DiffEntry) SetPreviousFilename(value *string)() { + m.previous_filename = value +} +// SetRawUrl sets the raw_url property value. The raw_url property +func (m *DiffEntry) SetRawUrl(value *string)() { + m.raw_url = value +} +// SetSha sets the sha property value. The sha property +func (m *DiffEntry) SetSha(value *string)() { + m.sha = value +} +// SetStatus sets the status property value. The status property +func (m *DiffEntry) SetStatus(value *DiffEntry_status)() { + m.status = value +} +type DiffEntryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdditions()(*int32) + GetBlobUrl()(*string) + GetChanges()(*int32) + GetContentsUrl()(*string) + GetDeletions()(*int32) + GetFilename()(*string) + GetPatch()(*string) + GetPreviousFilename()(*string) + GetRawUrl()(*string) + GetSha()(*string) + GetStatus()(*DiffEntry_status) + SetAdditions(value *int32)() + SetBlobUrl(value *string)() + SetChanges(value *int32)() + SetContentsUrl(value *string)() + SetDeletions(value *int32)() + SetFilename(value *string)() + SetPatch(value *string)() + SetPreviousFilename(value *string)() + SetRawUrl(value *string)() + SetSha(value *string)() + SetStatus(value *DiffEntry_status)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/diff_entry_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/diff_entry_status.go new file mode 100644 index 000000000..bd97efe24 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/diff_entry_status.go @@ -0,0 +1,51 @@ +package models +import ( + "errors" +) +type DiffEntry_status int + +const ( + ADDED_DIFFENTRY_STATUS DiffEntry_status = iota + REMOVED_DIFFENTRY_STATUS + MODIFIED_DIFFENTRY_STATUS + RENAMED_DIFFENTRY_STATUS + COPIED_DIFFENTRY_STATUS + CHANGED_DIFFENTRY_STATUS + UNCHANGED_DIFFENTRY_STATUS +) + +func (i DiffEntry_status) String() string { + return []string{"added", "removed", "modified", "renamed", "copied", "changed", "unchanged"}[i] +} +func ParseDiffEntry_status(v string) (any, error) { + result := ADDED_DIFFENTRY_STATUS + switch v { + case "added": + result = ADDED_DIFFENTRY_STATUS + case "removed": + result = REMOVED_DIFFENTRY_STATUS + case "modified": + result = MODIFIED_DIFFENTRY_STATUS + case "renamed": + result = RENAMED_DIFFENTRY_STATUS + case "copied": + result = COPIED_DIFFENTRY_STATUS + case "changed": + result = CHANGED_DIFFENTRY_STATUS + case "unchanged": + result = UNCHANGED_DIFFENTRY_STATUS + default: + return 0, errors.New("Unknown DiffEntry_status value: " + v) + } + return &result, nil +} +func SerializeDiffEntry_status(values []DiffEntry_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DiffEntry_status) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/email.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/email.go new file mode 100644 index 000000000..1a663e74d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/email.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Email email +type Email struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The email property + email *string + // The primary property + primary *bool + // The verified property + verified *bool + // The visibility property + visibility *string +} +// NewEmail instantiates a new Email and sets the default values. +func NewEmail()(*Email) { + m := &Email{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEmailFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEmailFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEmail(), 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 *Email) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *Email) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Email) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["primary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrimary(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + return res +} +// GetPrimary gets the primary property value. The primary property +// returns a *bool when successful +func (m *Email) GetPrimary()(*bool) { + return m.primary +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *Email) GetVerified()(*bool) { + return m.verified +} +// GetVisibility gets the visibility property value. The visibility property +// returns a *string when successful +func (m *Email) GetVisibility()(*string) { + return m.visibility +} +// Serialize serializes information the current object +func (m *Email) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("primary", m.GetPrimary()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + 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 *Email) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. The email property +func (m *Email) SetEmail(value *string)() { + m.email = value +} +// SetPrimary sets the primary property value. The primary property +func (m *Email) SetPrimary(value *bool)() { + m.primary = value +} +// SetVerified sets the verified property value. The verified property +func (m *Email) SetVerified(value *bool)() { + m.verified = value +} +// SetVisibility sets the visibility property value. The visibility property +func (m *Email) SetVisibility(value *string)() { + m.visibility = value +} +type Emailable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetPrimary()(*bool) + GetVerified()(*bool) + GetVisibility()(*string) + SetEmail(value *string)() + SetPrimary(value *bool)() + SetVerified(value *bool)() + SetVisibility(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/empty_object.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/empty_object.go new file mode 100644 index 000000000..ac73b6f2c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/empty_object.go @@ -0,0 +1,33 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// EmptyObject an object without any properties. +type EmptyObject struct { +} +// NewEmptyObject instantiates a new EmptyObject and sets the default values. +func NewEmptyObject()(*EmptyObject) { + m := &EmptyObject{ + } + return m +} +// CreateEmptyObjectFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEmptyObjectFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEmptyObject(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EmptyObject) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *EmptyObject) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +type EmptyObjectable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/empty_object503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/empty_object503_error.go new file mode 100644 index 000000000..2e7d36e94 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/empty_object503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EmptyObject503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewEmptyObject503Error instantiates a new EmptyObject503Error and sets the default values. +func NewEmptyObject503Error()(*EmptyObject503Error) { + m := &EmptyObject503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEmptyObject503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEmptyObject503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEmptyObject503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *EmptyObject503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *EmptyObject503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *EmptyObject503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *EmptyObject503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EmptyObject503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *EmptyObject503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *EmptyObject503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *EmptyObject503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *EmptyObject503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *EmptyObject503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *EmptyObject503Error) SetMessage(value *string)() { + m.message = value +} +type EmptyObject503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/enabled_repositories.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/enabled_repositories.go new file mode 100644 index 000000000..527bacd44 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/enabled_repositories.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The policy that controls the repositories in the organization that are allowed to run GitHub Actions. +type EnabledRepositories int + +const ( + ALL_ENABLEDREPOSITORIES EnabledRepositories = iota + NONE_ENABLEDREPOSITORIES + SELECTED_ENABLEDREPOSITORIES +) + +func (i EnabledRepositories) String() string { + return []string{"all", "none", "selected"}[i] +} +func ParseEnabledRepositories(v string) (any, error) { + result := ALL_ENABLEDREPOSITORIES + switch v { + case "all": + result = ALL_ENABLEDREPOSITORIES + case "none": + result = NONE_ENABLEDREPOSITORIES + case "selected": + result = SELECTED_ENABLEDREPOSITORIES + default: + return 0, errors.New("Unknown EnabledRepositories value: " + v) + } + return &result, nil +} +func SerializeEnabledRepositories(values []EnabledRepositories) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i EnabledRepositories) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/enterprise.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/enterprise.go new file mode 100644 index 000000000..8a2e71076 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/enterprise.go @@ -0,0 +1,343 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Enterprise an enterprise on GitHub. +type Enterprise struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A short description of the enterprise. + description *string + // The html_url property + html_url *string + // Unique identifier of the enterprise + id *int32 + // The name of the enterprise. + name *string + // The node_id property + node_id *string + // The slug url identifier for the enterprise. + slug *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The enterprise's website URL. + website_url *string +} +// NewEnterprise instantiates a new Enterprise and sets the default values. +func NewEnterprise()(*Enterprise) { + m := &Enterprise{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterprise(), 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 *Enterprise) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *Enterprise) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Enterprise) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. A short description of the enterprise. +// returns a *string when successful +func (m *Enterprise) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Enterprise) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["website_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWebsiteUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Enterprise) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the enterprise +// returns a *int32 when successful +func (m *Enterprise) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name of the enterprise. +// returns a *string when successful +func (m *Enterprise) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Enterprise) GetNodeId()(*string) { + return m.node_id +} +// GetSlug gets the slug property value. The slug url identifier for the enterprise. +// returns a *string when successful +func (m *Enterprise) GetSlug()(*string) { + return m.slug +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Enterprise) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetWebsiteUrl gets the website_url property value. The enterprise's website URL. +// returns a *string when successful +func (m *Enterprise) GetWebsiteUrl()(*string) { + return m.website_url +} +// Serialize serializes information the current object +func (m *Enterprise) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("website_url", m.GetWebsiteUrl()) + 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 *Enterprise) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *Enterprise) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Enterprise) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. A short description of the enterprise. +func (m *Enterprise) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Enterprise) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the enterprise +func (m *Enterprise) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name of the enterprise. +func (m *Enterprise) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Enterprise) SetNodeId(value *string)() { + m.node_id = value +} +// SetSlug sets the slug property value. The slug url identifier for the enterprise. +func (m *Enterprise) SetSlug(value *string)() { + m.slug = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Enterprise) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetWebsiteUrl sets the website_url property value. The enterprise's website URL. +func (m *Enterprise) SetWebsiteUrl(value *string)() { + m.website_url = value +} +type Enterpriseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetSlug()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetWebsiteUrl()(*string) + SetAvatarUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetSlug(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetWebsiteUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/enterprise_team.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/enterprise_team.go new file mode 100644 index 000000000..18aa97bb1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/enterprise_team.go @@ -0,0 +1,343 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// EnterpriseTeam group of enterprise owners and/or members +type EnterpriseTeam struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The group_id property + group_id *int32 + // The html_url property + html_url *string + // The id property + id *int64 + // The members_url property + members_url *string + // The name property + name *string + // The slug property + slug *string + // The sync_to_organizations property + sync_to_organizations *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewEnterpriseTeam instantiates a new EnterpriseTeam and sets the default values. +func NewEnterpriseTeam()(*EnterpriseTeam) { + m := &EnterpriseTeam{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseTeamFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseTeamFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseTeam(), 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 *EnterpriseTeam) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *EnterpriseTeam) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseTeam) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["group_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetGroupId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["sync_to_organizations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSyncToOrganizations(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetGroupId gets the group_id property value. The group_id property +// returns a *int32 when successful +func (m *EnterpriseTeam) GetGroupId()(*int32) { + return m.group_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *EnterpriseTeam) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *EnterpriseTeam) GetId()(*int64) { + return m.id +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *EnterpriseTeam) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *EnterpriseTeam) GetName()(*string) { + return m.name +} +// GetSlug gets the slug property value. The slug property +// returns a *string when successful +func (m *EnterpriseTeam) GetSlug()(*string) { + return m.slug +} +// GetSyncToOrganizations gets the sync_to_organizations property value. The sync_to_organizations property +// returns a *string when successful +func (m *EnterpriseTeam) GetSyncToOrganizations()(*string) { + return m.sync_to_organizations +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *EnterpriseTeam) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *EnterpriseTeam) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *EnterpriseTeam) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("group_id", m.GetGroupId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sync_to_organizations", m.GetSyncToOrganizations()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *EnterpriseTeam) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *EnterpriseTeam) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetGroupId sets the group_id property value. The group_id property +func (m *EnterpriseTeam) SetGroupId(value *int32)() { + m.group_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *EnterpriseTeam) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *EnterpriseTeam) SetId(value *int64)() { + m.id = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *EnterpriseTeam) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. The name property +func (m *EnterpriseTeam) SetName(value *string)() { + m.name = value +} +// SetSlug sets the slug property value. The slug property +func (m *EnterpriseTeam) SetSlug(value *string)() { + m.slug = value +} +// SetSyncToOrganizations sets the sync_to_organizations property value. The sync_to_organizations property +func (m *EnterpriseTeam) SetSyncToOrganizations(value *string)() { + m.sync_to_organizations = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *EnterpriseTeam) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *EnterpriseTeam) SetUrl(value *string)() { + m.url = value +} +type EnterpriseTeamable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetGroupId()(*int32) + GetHtmlUrl()(*string) + GetId()(*int64) + GetMembersUrl()(*string) + GetName()(*string) + GetSlug()(*string) + GetSyncToOrganizations()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetGroupId(value *int32)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetSlug(value *string)() + SetSyncToOrganizations(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/environment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/environment.go new file mode 100644 index 000000000..4731bc509 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/environment.go @@ -0,0 +1,437 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Environment details of a deployment environment +type Environment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time that the environment was created, in ISO 8601 format. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`. + deployment_branch_policy DeploymentBranchPolicySettingsable + // The html_url property + html_url *string + // The id of the environment. + id *int32 + // The name of the environment. + name *string + // The node_id property + node_id *string + // Built-in deployment protection rules for the environment. + protection_rules []Environment_Environment_protection_rulesable + // The time that the environment was last updated, in ISO 8601 format. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// Environment_Environment_protection_rules composed type wrapper for classes Environment_protection_rulesMember1able, Environment_protection_rulesMember2able, Environment_protection_rulesMember3able +type Environment_Environment_protection_rules struct { + // Composed type representation for type Environment_protection_rulesMember1able + environment_protection_rulesMember1 Environment_protection_rulesMember1able + // Composed type representation for type Environment_protection_rulesMember2able + environment_protection_rulesMember2 Environment_protection_rulesMember2able + // Composed type representation for type Environment_protection_rulesMember3able + environment_protection_rulesMember3 Environment_protection_rulesMember3able +} +// NewEnvironment_Environment_protection_rules instantiates a new Environment_Environment_protection_rules and sets the default values. +func NewEnvironment_Environment_protection_rules()(*Environment_Environment_protection_rules) { + m := &Environment_Environment_protection_rules{ + } + return m +} +// CreateEnvironment_Environment_protection_rulesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironment_Environment_protection_rulesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewEnvironment_Environment_protection_rules() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateEnvironment_protection_rulesMember1FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(Environment_protection_rulesMember1able); ok { + result.SetEnvironmentProtectionRulesMember1(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateEnvironment_protection_rulesMember2FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(Environment_protection_rulesMember2able); ok { + result.SetEnvironmentProtectionRulesMember2(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateEnvironment_protection_rulesMember3FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(Environment_protection_rulesMember3able); ok { + result.SetEnvironmentProtectionRulesMember3(cast) + } + } + } + return result, nil +} +// GetEnvironmentProtectionRulesMember1 gets the environment_protection_rulesMember1 property value. Composed type representation for type Environment_protection_rulesMember1able +// returns a Environment_protection_rulesMember1able when successful +func (m *Environment_Environment_protection_rules) GetEnvironmentProtectionRulesMember1()(Environment_protection_rulesMember1able) { + return m.environment_protection_rulesMember1 +} +// GetEnvironmentProtectionRulesMember2 gets the environment_protection_rulesMember2 property value. Composed type representation for type Environment_protection_rulesMember2able +// returns a Environment_protection_rulesMember2able when successful +func (m *Environment_Environment_protection_rules) GetEnvironmentProtectionRulesMember2()(Environment_protection_rulesMember2able) { + return m.environment_protection_rulesMember2 +} +// GetEnvironmentProtectionRulesMember3 gets the environment_protection_rulesMember3 property value. Composed type representation for type Environment_protection_rulesMember3able +// returns a Environment_protection_rulesMember3able when successful +func (m *Environment_Environment_protection_rules) GetEnvironmentProtectionRulesMember3()(Environment_protection_rulesMember3able) { + return m.environment_protection_rulesMember3 +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Environment_Environment_protection_rules) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *Environment_Environment_protection_rules) GetIsComposedType()(bool) { + return true +} +// Serialize serializes information the current object +func (m *Environment_Environment_protection_rules) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEnvironmentProtectionRulesMember1() != nil { + err := writer.WriteObjectValue("", m.GetEnvironmentProtectionRulesMember1()) + if err != nil { + return err + } + } else if m.GetEnvironmentProtectionRulesMember2() != nil { + err := writer.WriteObjectValue("", m.GetEnvironmentProtectionRulesMember2()) + if err != nil { + return err + } + } else if m.GetEnvironmentProtectionRulesMember3() != nil { + err := writer.WriteObjectValue("", m.GetEnvironmentProtectionRulesMember3()) + if err != nil { + return err + } + } + return nil +} +// SetEnvironmentProtectionRulesMember1 sets the environment_protection_rulesMember1 property value. Composed type representation for type Environment_protection_rulesMember1able +func (m *Environment_Environment_protection_rules) SetEnvironmentProtectionRulesMember1(value Environment_protection_rulesMember1able)() { + m.environment_protection_rulesMember1 = value +} +// SetEnvironmentProtectionRulesMember2 sets the environment_protection_rulesMember2 property value. Composed type representation for type Environment_protection_rulesMember2able +func (m *Environment_Environment_protection_rules) SetEnvironmentProtectionRulesMember2(value Environment_protection_rulesMember2able)() { + m.environment_protection_rulesMember2 = value +} +// SetEnvironmentProtectionRulesMember3 sets the environment_protection_rulesMember3 property value. Composed type representation for type Environment_protection_rulesMember3able +func (m *Environment_Environment_protection_rules) SetEnvironmentProtectionRulesMember3(value Environment_protection_rulesMember3able)() { + m.environment_protection_rulesMember3 = value +} +type Environment_Environment_protection_rulesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnvironmentProtectionRulesMember1()(Environment_protection_rulesMember1able) + GetEnvironmentProtectionRulesMember2()(Environment_protection_rulesMember2able) + GetEnvironmentProtectionRulesMember3()(Environment_protection_rulesMember3able) + SetEnvironmentProtectionRulesMember1(value Environment_protection_rulesMember1able)() + SetEnvironmentProtectionRulesMember2(value Environment_protection_rulesMember2able)() + SetEnvironmentProtectionRulesMember3(value Environment_protection_rulesMember3able)() +} +// NewEnvironment instantiates a new Environment and sets the default values. +func NewEnvironment()(*Environment) { + m := &Environment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnvironmentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironmentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnvironment(), 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 *Environment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The time that the environment was created, in ISO 8601 format. +// returns a *Time when successful +func (m *Environment) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDeploymentBranchPolicy gets the deployment_branch_policy property value. The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`. +// returns a DeploymentBranchPolicySettingsable when successful +func (m *Environment) GetDeploymentBranchPolicy()(DeploymentBranchPolicySettingsable) { + return m.deployment_branch_policy +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Environment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["deployment_branch_policy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDeploymentBranchPolicySettingsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDeploymentBranchPolicy(val.(DeploymentBranchPolicySettingsable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["protection_rules"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateEnvironment_Environment_protection_rulesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Environment_Environment_protection_rulesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Environment_Environment_protection_rulesable) + } + } + m.SetProtectionRules(res) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Environment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id of the environment. +// returns a *int32 when successful +func (m *Environment) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name of the environment. +// returns a *string when successful +func (m *Environment) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Environment) GetNodeId()(*string) { + return m.node_id +} +// GetProtectionRules gets the protection_rules property value. Built-in deployment protection rules for the environment. +// returns a []Environment_Environment_protection_rulesable when successful +func (m *Environment) GetProtectionRules()([]Environment_Environment_protection_rulesable) { + return m.protection_rules +} +// GetUpdatedAt gets the updated_at property value. The time that the environment was last updated, in ISO 8601 format. +// returns a *Time when successful +func (m *Environment) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Environment) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Environment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("deployment_branch_policy", m.GetDeploymentBranchPolicy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetProtectionRules() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetProtectionRules())) + for i, v := range m.GetProtectionRules() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("protection_rules", cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Environment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The time that the environment was created, in ISO 8601 format. +func (m *Environment) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDeploymentBranchPolicy sets the deployment_branch_policy property value. The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`. +func (m *Environment) SetDeploymentBranchPolicy(value DeploymentBranchPolicySettingsable)() { + m.deployment_branch_policy = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Environment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id of the environment. +func (m *Environment) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name of the environment. +func (m *Environment) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Environment) SetNodeId(value *string)() { + m.node_id = value +} +// SetProtectionRules sets the protection_rules property value. Built-in deployment protection rules for the environment. +func (m *Environment) SetProtectionRules(value []Environment_Environment_protection_rulesable)() { + m.protection_rules = value +} +// SetUpdatedAt sets the updated_at property value. The time that the environment was last updated, in ISO 8601 format. +func (m *Environment) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Environment) SetUrl(value *string)() { + m.url = value +} +type Environmentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDeploymentBranchPolicy()(DeploymentBranchPolicySettingsable) + GetHtmlUrl()(*string) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetProtectionRules()([]Environment_Environment_protection_rulesable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDeploymentBranchPolicy(value DeploymentBranchPolicySettingsable)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetProtectionRules(value []Environment_Environment_protection_rulesable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_approvals.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_approvals.go new file mode 100644 index 000000000..eb5bcced5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_approvals.go @@ -0,0 +1,181 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// EnvironmentApprovals an entry in the reviews log for environment deployments +type EnvironmentApprovals struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The comment submitted with the deployment review + comment *string + // The list of environments that were approved or rejected + environments []EnvironmentApprovals_environmentsable + // Whether deployment to the environment(s) was approved or rejected or pending (with comments) + state *EnvironmentApprovals_state + // A GitHub user. + user SimpleUserable +} +// NewEnvironmentApprovals instantiates a new EnvironmentApprovals and sets the default values. +func NewEnvironmentApprovals()(*EnvironmentApprovals) { + m := &EnvironmentApprovals{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnvironmentApprovalsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironmentApprovalsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnvironmentApprovals(), 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 *EnvironmentApprovals) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComment gets the comment property value. The comment submitted with the deployment review +// returns a *string when successful +func (m *EnvironmentApprovals) GetComment()(*string) { + return m.comment +} +// GetEnvironments gets the environments property value. The list of environments that were approved or rejected +// returns a []EnvironmentApprovals_environmentsable when successful +func (m *EnvironmentApprovals) GetEnvironments()([]EnvironmentApprovals_environmentsable) { + return m.environments +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnvironmentApprovals) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetComment(val) + } + return nil + } + res["environments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateEnvironmentApprovals_environmentsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]EnvironmentApprovals_environmentsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(EnvironmentApprovals_environmentsable) + } + } + m.SetEnvironments(res) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseEnvironmentApprovals_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*EnvironmentApprovals_state)) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(SimpleUserable)) + } + return nil + } + return res +} +// GetState gets the state property value. Whether deployment to the environment(s) was approved or rejected or pending (with comments) +// returns a *EnvironmentApprovals_state when successful +func (m *EnvironmentApprovals) GetState()(*EnvironmentApprovals_state) { + return m.state +} +// GetUser gets the user property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *EnvironmentApprovals) GetUser()(SimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *EnvironmentApprovals) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("comment", m.GetComment()) + if err != nil { + return err + } + } + if m.GetEnvironments() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetEnvironments())) + for i, v := range m.GetEnvironments() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("environments", cast) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *EnvironmentApprovals) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComment sets the comment property value. The comment submitted with the deployment review +func (m *EnvironmentApprovals) SetComment(value *string)() { + m.comment = value +} +// SetEnvironments sets the environments property value. The list of environments that were approved or rejected +func (m *EnvironmentApprovals) SetEnvironments(value []EnvironmentApprovals_environmentsable)() { + m.environments = value +} +// SetState sets the state property value. Whether deployment to the environment(s) was approved or rejected or pending (with comments) +func (m *EnvironmentApprovals) SetState(value *EnvironmentApprovals_state)() { + m.state = value +} +// SetUser sets the user property value. A GitHub user. +func (m *EnvironmentApprovals) SetUser(value SimpleUserable)() { + m.user = value +} +type EnvironmentApprovalsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComment()(*string) + GetEnvironments()([]EnvironmentApprovals_environmentsable) + GetState()(*EnvironmentApprovals_state) + GetUser()(SimpleUserable) + SetComment(value *string)() + SetEnvironments(value []EnvironmentApprovals_environmentsable)() + SetState(value *EnvironmentApprovals_state)() + SetUser(value SimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_approvals_environments.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_approvals_environments.go new file mode 100644 index 000000000..13efdbfd6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_approvals_environments.go @@ -0,0 +1,255 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnvironmentApprovals_environments struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time that the environment was created, in ISO 8601 format. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The html_url property + html_url *string + // The id of the environment. + id *int32 + // The name of the environment. + name *string + // The node_id property + node_id *string + // The time that the environment was last updated, in ISO 8601 format. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewEnvironmentApprovals_environments instantiates a new EnvironmentApprovals_environments and sets the default values. +func NewEnvironmentApprovals_environments()(*EnvironmentApprovals_environments) { + m := &EnvironmentApprovals_environments{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnvironmentApprovals_environmentsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironmentApprovals_environmentsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnvironmentApprovals_environments(), 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 *EnvironmentApprovals_environments) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The time that the environment was created, in ISO 8601 format. +// returns a *Time when successful +func (m *EnvironmentApprovals_environments) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnvironmentApprovals_environments) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *EnvironmentApprovals_environments) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id of the environment. +// returns a *int32 when successful +func (m *EnvironmentApprovals_environments) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name of the environment. +// returns a *string when successful +func (m *EnvironmentApprovals_environments) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *EnvironmentApprovals_environments) GetNodeId()(*string) { + return m.node_id +} +// GetUpdatedAt gets the updated_at property value. The time that the environment was last updated, in ISO 8601 format. +// returns a *Time when successful +func (m *EnvironmentApprovals_environments) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *EnvironmentApprovals_environments) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *EnvironmentApprovals_environments) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *EnvironmentApprovals_environments) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The time that the environment was created, in ISO 8601 format. +func (m *EnvironmentApprovals_environments) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *EnvironmentApprovals_environments) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id of the environment. +func (m *EnvironmentApprovals_environments) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name of the environment. +func (m *EnvironmentApprovals_environments) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *EnvironmentApprovals_environments) SetNodeId(value *string)() { + m.node_id = value +} +// SetUpdatedAt sets the updated_at property value. The time that the environment was last updated, in ISO 8601 format. +func (m *EnvironmentApprovals_environments) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *EnvironmentApprovals_environments) SetUrl(value *string)() { + m.url = value +} +type EnvironmentApprovals_environmentsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_approvals_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_approvals_state.go new file mode 100644 index 000000000..f3bacf7bc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_approvals_state.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// Whether deployment to the environment(s) was approved or rejected or pending (with comments) +type EnvironmentApprovals_state int + +const ( + APPROVED_ENVIRONMENTAPPROVALS_STATE EnvironmentApprovals_state = iota + REJECTED_ENVIRONMENTAPPROVALS_STATE + PENDING_ENVIRONMENTAPPROVALS_STATE +) + +func (i EnvironmentApprovals_state) String() string { + return []string{"approved", "rejected", "pending"}[i] +} +func ParseEnvironmentApprovals_state(v string) (any, error) { + result := APPROVED_ENVIRONMENTAPPROVALS_STATE + switch v { + case "approved": + result = APPROVED_ENVIRONMENTAPPROVALS_STATE + case "rejected": + result = REJECTED_ENVIRONMENTAPPROVALS_STATE + case "pending": + result = PENDING_ENVIRONMENTAPPROVALS_STATE + default: + return 0, errors.New("Unknown EnvironmentApprovals_state value: " + v) + } + return &result, nil +} +func SerializeEnvironmentApprovals_state(values []EnvironmentApprovals_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i EnvironmentApprovals_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_protection_rules_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_protection_rules_member1.go new file mode 100644 index 000000000..b0c47b693 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_protection_rules_member1.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Environment_protection_rulesMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 + // The node_id property + node_id *string + // The type property + typeEscaped *string + // The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days). + wait_timer *int32 +} +// NewEnvironment_protection_rulesMember1 instantiates a new Environment_protection_rulesMember1 and sets the default values. +func NewEnvironment_protection_rulesMember1()(*Environment_protection_rulesMember1) { + m := &Environment_protection_rulesMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnvironment_protection_rulesMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironment_protection_rulesMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnvironment_protection_rulesMember1(), 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 *Environment_protection_rulesMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Environment_protection_rulesMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["wait_timer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWaitTimer(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Environment_protection_rulesMember1) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Environment_protection_rulesMember1) GetNodeId()(*string) { + return m.node_id +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *Environment_protection_rulesMember1) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetWaitTimer gets the wait_timer property value. The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days). +// returns a *int32 when successful +func (m *Environment_protection_rulesMember1) GetWaitTimer()(*int32) { + return m.wait_timer +} +// Serialize serializes information the current object +func (m *Environment_protection_rulesMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("wait_timer", m.GetWaitTimer()) + 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 *Environment_protection_rulesMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *Environment_protection_rulesMember1) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Environment_protection_rulesMember1) SetNodeId(value *string)() { + m.node_id = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Environment_protection_rulesMember1) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetWaitTimer sets the wait_timer property value. The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days). +func (m *Environment_protection_rulesMember1) SetWaitTimer(value *int32)() { + m.wait_timer = value +} +type Environment_protection_rulesMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetNodeId()(*string) + GetTypeEscaped()(*string) + GetWaitTimer()(*int32) + SetId(value *int32)() + SetNodeId(value *string)() + SetTypeEscaped(value *string)() + SetWaitTimer(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_protection_rules_member2.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_protection_rules_member2.go new file mode 100644 index 000000000..def382fe7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_protection_rules_member2.go @@ -0,0 +1,208 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Environment_protection_rulesMember2 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 + // The node_id property + node_id *string + // Whether deployments to this environment can be approved by the user who created the deployment. + prevent_self_review *bool + // The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. + reviewers []Environment_protection_rulesMember2_reviewersable + // The type property + typeEscaped *string +} +// NewEnvironment_protection_rulesMember2 instantiates a new Environment_protection_rulesMember2 and sets the default values. +func NewEnvironment_protection_rulesMember2()(*Environment_protection_rulesMember2) { + m := &Environment_protection_rulesMember2{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnvironment_protection_rulesMember2FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironment_protection_rulesMember2FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnvironment_protection_rulesMember2(), 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 *Environment_protection_rulesMember2) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Environment_protection_rulesMember2) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["prevent_self_review"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPreventSelfReview(val) + } + return nil + } + res["reviewers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateEnvironment_protection_rulesMember2_reviewersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Environment_protection_rulesMember2_reviewersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Environment_protection_rulesMember2_reviewersable) + } + } + m.SetReviewers(res) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Environment_protection_rulesMember2) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Environment_protection_rulesMember2) GetNodeId()(*string) { + return m.node_id +} +// GetPreventSelfReview gets the prevent_self_review property value. Whether deployments to this environment can be approved by the user who created the deployment. +// returns a *bool when successful +func (m *Environment_protection_rulesMember2) GetPreventSelfReview()(*bool) { + return m.prevent_self_review +} +// GetReviewers gets the reviewers property value. The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. +// returns a []Environment_protection_rulesMember2_reviewersable when successful +func (m *Environment_protection_rulesMember2) GetReviewers()([]Environment_protection_rulesMember2_reviewersable) { + return m.reviewers +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *Environment_protection_rulesMember2) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *Environment_protection_rulesMember2) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("prevent_self_review", m.GetPreventSelfReview()) + if err != nil { + return err + } + } + if m.GetReviewers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetReviewers())) + for i, v := range m.GetReviewers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("reviewers", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + 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 *Environment_protection_rulesMember2) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *Environment_protection_rulesMember2) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Environment_protection_rulesMember2) SetNodeId(value *string)() { + m.node_id = value +} +// SetPreventSelfReview sets the prevent_self_review property value. Whether deployments to this environment can be approved by the user who created the deployment. +func (m *Environment_protection_rulesMember2) SetPreventSelfReview(value *bool)() { + m.prevent_self_review = value +} +// SetReviewers sets the reviewers property value. The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. +func (m *Environment_protection_rulesMember2) SetReviewers(value []Environment_protection_rulesMember2_reviewersable)() { + m.reviewers = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Environment_protection_rulesMember2) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +type Environment_protection_rulesMember2able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetNodeId()(*string) + GetPreventSelfReview()(*bool) + GetReviewers()([]Environment_protection_rulesMember2_reviewersable) + GetTypeEscaped()(*string) + SetId(value *int32)() + SetNodeId(value *string)() + SetPreventSelfReview(value *bool)() + SetReviewers(value []Environment_protection_rulesMember2_reviewersable)() + SetTypeEscaped(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_protection_rules_member2_reviewers.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_protection_rules_member2_reviewers.go new file mode 100644 index 000000000..f537c30b5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_protection_rules_member2_reviewers.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Environment_protection_rulesMember2_reviewers struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The reviewer property + reviewer Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerable + // The type of reviewer. + typeEscaped *DeploymentReviewerType +} +// Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer composed type wrapper for classes SimpleUserable, Teamable +type Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer struct { + // Composed type representation for type SimpleUserable + simpleUser SimpleUserable + // Composed type representation for type Teamable + team Teamable +} +// NewEnvironment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer instantiates a new Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer and sets the default values. +func NewEnvironment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer()(*Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer) { + m := &Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer{ + } + return m +} +// CreateEnvironment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewEnvironment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateSimpleUserFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(SimpleUserable); ok { + result.SetSimpleUser(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTeamFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(Teamable); ok { + result.SetTeam(cast) + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer) GetIsComposedType()(bool) { + return true +} +// GetSimpleUser gets the simpleUser property value. Composed type representation for type SimpleUserable +// returns a SimpleUserable when successful +func (m *Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer) GetSimpleUser()(SimpleUserable) { + return m.simpleUser +} +// GetTeam gets the team property value. Composed type representation for type Teamable +// returns a Teamable when successful +func (m *Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer) GetTeam()(Teamable) { + return m.team +} +// Serialize serializes information the current object +func (m *Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSimpleUser() != nil { + err := writer.WriteObjectValue("", m.GetSimpleUser()) + if err != nil { + return err + } + } else if m.GetTeam() != nil { + err := writer.WriteObjectValue("", m.GetTeam()) + if err != nil { + return err + } + } + return nil +} +// SetSimpleUser sets the simpleUser property value. Composed type representation for type SimpleUserable +func (m *Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer) SetSimpleUser(value SimpleUserable)() { + m.simpleUser = value +} +// SetTeam sets the team property value. Composed type representation for type Teamable +func (m *Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer) SetTeam(value Teamable)() { + m.team = value +} +type Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSimpleUser()(SimpleUserable) + GetTeam()(Teamable) + SetSimpleUser(value SimpleUserable)() + SetTeam(value Teamable)() +} +// NewEnvironment_protection_rulesMember2_reviewers instantiates a new Environment_protection_rulesMember2_reviewers and sets the default values. +func NewEnvironment_protection_rulesMember2_reviewers()(*Environment_protection_rulesMember2_reviewers) { + m := &Environment_protection_rulesMember2_reviewers{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnvironment_protection_rulesMember2_reviewersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironment_protection_rulesMember2_reviewersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnvironment_protection_rulesMember2_reviewers(), 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 *Environment_protection_rulesMember2_reviewers) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Environment_protection_rulesMember2_reviewers) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["reviewer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnvironment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewer(val.(Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDeploymentReviewerType) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*DeploymentReviewerType)) + } + return nil + } + return res +} +// GetReviewer gets the reviewer property value. The reviewer property +// returns a Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerable when successful +func (m *Environment_protection_rulesMember2_reviewers) GetReviewer()(Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerable) { + return m.reviewer +} +// GetTypeEscaped gets the type property value. The type of reviewer. +// returns a *DeploymentReviewerType when successful +func (m *Environment_protection_rulesMember2_reviewers) GetTypeEscaped()(*DeploymentReviewerType) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *Environment_protection_rulesMember2_reviewers) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("reviewer", m.GetReviewer()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *Environment_protection_rulesMember2_reviewers) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetReviewer sets the reviewer property value. The reviewer property +func (m *Environment_protection_rulesMember2_reviewers) SetReviewer(value Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerable)() { + m.reviewer = value +} +// SetTypeEscaped sets the type property value. The type of reviewer. +func (m *Environment_protection_rulesMember2_reviewers) SetTypeEscaped(value *DeploymentReviewerType)() { + m.typeEscaped = value +} +type Environment_protection_rulesMember2_reviewersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetReviewer()(Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerable) + GetTypeEscaped()(*DeploymentReviewerType) + SetReviewer(value Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerable)() + SetTypeEscaped(value *DeploymentReviewerType)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_protection_rules_member3.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_protection_rules_member3.go new file mode 100644 index 000000000..fdcb073f1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/environment_protection_rules_member3.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Environment_protection_rulesMember3 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 + // The node_id property + node_id *string + // The type property + typeEscaped *string +} +// NewEnvironment_protection_rulesMember3 instantiates a new Environment_protection_rulesMember3 and sets the default values. +func NewEnvironment_protection_rulesMember3()(*Environment_protection_rulesMember3) { + m := &Environment_protection_rulesMember3{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnvironment_protection_rulesMember3FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironment_protection_rulesMember3FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnvironment_protection_rulesMember3(), 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 *Environment_protection_rulesMember3) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Environment_protection_rulesMember3) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Environment_protection_rulesMember3) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Environment_protection_rulesMember3) GetNodeId()(*string) { + return m.node_id +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *Environment_protection_rulesMember3) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *Environment_protection_rulesMember3) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + 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 *Environment_protection_rulesMember3) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *Environment_protection_rulesMember3) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Environment_protection_rulesMember3) SetNodeId(value *string)() { + m.node_id = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Environment_protection_rulesMember3) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +type Environment_protection_rulesMember3able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetNodeId()(*string) + GetTypeEscaped()(*string) + SetId(value *int32)() + SetNodeId(value *string)() + SetTypeEscaped(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/event.go new file mode 100644 index 000000000..8b48f643f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/event.go @@ -0,0 +1,285 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Event event +type Event struct { + // Actor + actor Actorable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The id property + id *string + // Actor + org Actorable + // The payload property + payload Event_payloadable + // The public property + public *bool + // The repo property + repo Event_repoable + // The type property + typeEscaped *string +} +// NewEvent instantiates a new Event and sets the default values. +func NewEvent()(*Event) { + m := &Event{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEvent(), nil +} +// GetActor gets the actor property value. Actor +// returns a Actorable when successful +func (m *Event) GetActor()(Actorable) { + return m.actor +} +// 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 *Event) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Event) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Event) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateActorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(Actorable)) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["org"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateActorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrg(val.(Actorable)) + } + return nil + } + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEvent_payloadFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPayload(val.(Event_payloadable)) + } + return nil + } + res["public"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPublic(val) + } + return nil + } + res["repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEvent_repoFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepo(val.(Event_repoable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *string when successful +func (m *Event) GetId()(*string) { + return m.id +} +// GetOrg gets the org property value. Actor +// returns a Actorable when successful +func (m *Event) GetOrg()(Actorable) { + return m.org +} +// GetPayload gets the payload property value. The payload property +// returns a Event_payloadable when successful +func (m *Event) GetPayload()(Event_payloadable) { + return m.payload +} +// GetPublic gets the public property value. The public property +// returns a *bool when successful +func (m *Event) GetPublic()(*bool) { + return m.public +} +// GetRepo gets the repo property value. The repo property +// returns a Event_repoable when successful +func (m *Event) GetRepo()(Event_repoable) { + return m.repo +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *Event) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *Event) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("org", m.GetOrg()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("payload", m.GetPayload()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("public", m.GetPublic()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repo", m.GetRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. Actor +func (m *Event) SetActor(value Actorable)() { + m.actor = value +} +// 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 *Event) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Event) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *Event) SetId(value *string)() { + m.id = value +} +// SetOrg sets the org property value. Actor +func (m *Event) SetOrg(value Actorable)() { + m.org = value +} +// SetPayload sets the payload property value. The payload property +func (m *Event) SetPayload(value Event_payloadable)() { + m.payload = value +} +// SetPublic sets the public property value. The public property +func (m *Event) SetPublic(value *bool)() { + m.public = value +} +// SetRepo sets the repo property value. The repo property +func (m *Event) SetRepo(value Event_repoable)() { + m.repo = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Event) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +type Eventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(Actorable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*string) + GetOrg()(Actorable) + GetPayload()(Event_payloadable) + GetPublic()(*bool) + GetRepo()(Event_repoable) + GetTypeEscaped()(*string) + SetActor(value Actorable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *string)() + SetOrg(value Actorable)() + SetPayload(value Event_payloadable)() + SetPublic(value *bool)() + SetRepo(value Event_repoable)() + SetTypeEscaped(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/event_payload.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/event_payload.go new file mode 100644 index 000000000..f3528f17a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/event_payload.go @@ -0,0 +1,179 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Event_payload struct { + // The action property + action *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Comments provide a way for people to collaborate on an issue. + comment IssueCommentable + // Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. + issue Issueable + // The pages property + pages []Event_payload_pagesable +} +// NewEvent_payload instantiates a new Event_payload and sets the default values. +func NewEvent_payload()(*Event_payload) { + m := &Event_payload{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEvent_payloadFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEvent_payloadFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEvent_payload(), nil +} +// GetAction gets the action property value. The action property +// returns a *string when successful +func (m *Event_payload) GetAction()(*string) { + return m.action +} +// 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 *Event_payload) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComment gets the comment property value. Comments provide a way for people to collaborate on an issue. +// returns a IssueCommentable when successful +func (m *Event_payload) GetComment()(IssueCommentable) { + return m.comment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Event_payload) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["action"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAction(val) + } + return nil + } + res["comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueCommentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetComment(val.(IssueCommentable)) + } + return nil + } + res["issue"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIssue(val.(Issueable)) + } + return nil + } + res["pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateEvent_payload_pagesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Event_payload_pagesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Event_payload_pagesable) + } + } + m.SetPages(res) + } + return nil + } + return res +} +// GetIssue gets the issue property value. Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. +// returns a Issueable when successful +func (m *Event_payload) GetIssue()(Issueable) { + return m.issue +} +// GetPages gets the pages property value. The pages property +// returns a []Event_payload_pagesable when successful +func (m *Event_payload) GetPages()([]Event_payload_pagesable) { + return m.pages +} +// Serialize serializes information the current object +func (m *Event_payload) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("action", m.GetAction()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("comment", m.GetComment()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("issue", m.GetIssue()) + if err != nil { + return err + } + } + if m.GetPages() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetPages())) + for i, v := range m.GetPages() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("pages", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAction sets the action property value. The action property +func (m *Event_payload) SetAction(value *string)() { + m.action = value +} +// 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 *Event_payload) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComment sets the comment property value. Comments provide a way for people to collaborate on an issue. +func (m *Event_payload) SetComment(value IssueCommentable)() { + m.comment = value +} +// SetIssue sets the issue property value. Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. +func (m *Event_payload) SetIssue(value Issueable)() { + m.issue = value +} +// SetPages sets the pages property value. The pages property +func (m *Event_payload) SetPages(value []Event_payload_pagesable)() { + m.pages = value +} +type Event_payloadable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAction()(*string) + GetComment()(IssueCommentable) + GetIssue()(Issueable) + GetPages()([]Event_payload_pagesable) + SetAction(value *string)() + SetComment(value IssueCommentable)() + SetIssue(value Issueable)() + SetPages(value []Event_payload_pagesable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/event_payload_pages.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/event_payload_pages.go new file mode 100644 index 000000000..73a9780c8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/event_payload_pages.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Event_payload_pages struct { + // The action property + action *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html_url property + html_url *string + // The page_name property + page_name *string + // The sha property + sha *string + // The summary property + summary *string + // The title property + title *string +} +// NewEvent_payload_pages instantiates a new Event_payload_pages and sets the default values. +func NewEvent_payload_pages()(*Event_payload_pages) { + m := &Event_payload_pages{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEvent_payload_pagesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEvent_payload_pagesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEvent_payload_pages(), nil +} +// GetAction gets the action property value. The action property +// returns a *string when successful +func (m *Event_payload_pages) GetAction()(*string) { + return m.action +} +// 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 *Event_payload_pages) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Event_payload_pages) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["action"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAction(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["page_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPageName(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["summary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSummary(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Event_payload_pages) GetHtmlUrl()(*string) { + return m.html_url +} +// GetPageName gets the page_name property value. The page_name property +// returns a *string when successful +func (m *Event_payload_pages) GetPageName()(*string) { + return m.page_name +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *Event_payload_pages) GetSha()(*string) { + return m.sha +} +// GetSummary gets the summary property value. The summary property +// returns a *string when successful +func (m *Event_payload_pages) GetSummary()(*string) { + return m.summary +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *Event_payload_pages) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *Event_payload_pages) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("action", m.GetAction()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("page_name", m.GetPageName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("summary", m.GetSummary()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAction sets the action property value. The action property +func (m *Event_payload_pages) SetAction(value *string)() { + m.action = value +} +// 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 *Event_payload_pages) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Event_payload_pages) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetPageName sets the page_name property value. The page_name property +func (m *Event_payload_pages) SetPageName(value *string)() { + m.page_name = value +} +// SetSha sets the sha property value. The sha property +func (m *Event_payload_pages) SetSha(value *string)() { + m.sha = value +} +// SetSummary sets the summary property value. The summary property +func (m *Event_payload_pages) SetSummary(value *string)() { + m.summary = value +} +// SetTitle sets the title property value. The title property +func (m *Event_payload_pages) SetTitle(value *string)() { + m.title = value +} +type Event_payload_pagesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAction()(*string) + GetHtmlUrl()(*string) + GetPageName()(*string) + GetSha()(*string) + GetSummary()(*string) + GetTitle()(*string) + SetAction(value *string)() + SetHtmlUrl(value *string)() + SetPageName(value *string)() + SetSha(value *string)() + SetSummary(value *string)() + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/event_repo.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/event_repo.go new file mode 100644 index 000000000..cfc4bf998 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/event_repo.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Event_repo struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 + // The name property + name *string + // The url property + url *string +} +// NewEvent_repo instantiates a new Event_repo and sets the default values. +func NewEvent_repo()(*Event_repo) { + m := &Event_repo{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEvent_repoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEvent_repoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEvent_repo(), 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 *Event_repo) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Event_repo) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Event_repo) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *Event_repo) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Event_repo) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Event_repo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Event_repo) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *Event_repo) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *Event_repo) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url property +func (m *Event_repo) SetUrl(value *string)() { + m.url = value +} +type Event_repoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetName()(*string) + GetUrl()(*string) + SetId(value *int32)() + SetName(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/events503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/events503_error.go new file mode 100644 index 000000000..31ef3b790 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/events503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Events503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewEvents503Error instantiates a new Events503Error and sets the default values. +func NewEvents503Error()(*Events503Error) { + m := &Events503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEvents503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEvents503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEvents503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Events503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Events503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Events503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Events503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Events503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Events503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Events503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *Events503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Events503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Events503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Events503Error) SetMessage(value *string)() { + m.message = value +} +type Events503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/feed.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/feed.go new file mode 100644 index 000000000..83ce8add2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/feed.go @@ -0,0 +1,377 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Feed feed +type Feed struct { + // The _links property + _links Feed__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The current_user_actor_url property + current_user_actor_url *string + // The current_user_organization_url property + current_user_organization_url *string + // The current_user_organization_urls property + current_user_organization_urls []string + // The current_user_public_url property + current_user_public_url *string + // The current_user_url property + current_user_url *string + // A feed of discussions for a given repository and category. + repository_discussions_category_url *string + // A feed of discussions for a given repository. + repository_discussions_url *string + // The security_advisories_url property + security_advisories_url *string + // The timeline_url property + timeline_url *string + // The user_url property + user_url *string +} +// NewFeed instantiates a new Feed and sets the default values. +func NewFeed()(*Feed) { + m := &Feed{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFeedFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFeedFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFeed(), 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 *Feed) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCurrentUserActorUrl gets the current_user_actor_url property value. The current_user_actor_url property +// returns a *string when successful +func (m *Feed) GetCurrentUserActorUrl()(*string) { + return m.current_user_actor_url +} +// GetCurrentUserOrganizationUrl gets the current_user_organization_url property value. The current_user_organization_url property +// returns a *string when successful +func (m *Feed) GetCurrentUserOrganizationUrl()(*string) { + return m.current_user_organization_url +} +// GetCurrentUserOrganizationUrls gets the current_user_organization_urls property value. The current_user_organization_urls property +// returns a []string when successful +func (m *Feed) GetCurrentUserOrganizationUrls()([]string) { + return m.current_user_organization_urls +} +// GetCurrentUserPublicUrl gets the current_user_public_url property value. The current_user_public_url property +// returns a *string when successful +func (m *Feed) GetCurrentUserPublicUrl()(*string) { + return m.current_user_public_url +} +// GetCurrentUserUrl gets the current_user_url property value. The current_user_url property +// returns a *string when successful +func (m *Feed) GetCurrentUserUrl()(*string) { + return m.current_user_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Feed) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFeed__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(Feed__linksable)) + } + return nil + } + res["current_user_actor_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserActorUrl(val) + } + return nil + } + res["current_user_organization_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserOrganizationUrl(val) + } + return nil + } + res["current_user_organization_urls"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetCurrentUserOrganizationUrls(res) + } + return nil + } + res["current_user_public_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserPublicUrl(val) + } + return nil + } + res["current_user_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserUrl(val) + } + return nil + } + res["repository_discussions_category_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryDiscussionsCategoryUrl(val) + } + return nil + } + res["repository_discussions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryDiscussionsUrl(val) + } + return nil + } + res["security_advisories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecurityAdvisoriesUrl(val) + } + return nil + } + res["timeline_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTimelineUrl(val) + } + return nil + } + res["user_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUserUrl(val) + } + return nil + } + return res +} +// GetLinks gets the _links property value. The _links property +// returns a Feed__linksable when successful +func (m *Feed) GetLinks()(Feed__linksable) { + return m._links +} +// GetRepositoryDiscussionsCategoryUrl gets the repository_discussions_category_url property value. A feed of discussions for a given repository and category. +// returns a *string when successful +func (m *Feed) GetRepositoryDiscussionsCategoryUrl()(*string) { + return m.repository_discussions_category_url +} +// GetRepositoryDiscussionsUrl gets the repository_discussions_url property value. A feed of discussions for a given repository. +// returns a *string when successful +func (m *Feed) GetRepositoryDiscussionsUrl()(*string) { + return m.repository_discussions_url +} +// GetSecurityAdvisoriesUrl gets the security_advisories_url property value. The security_advisories_url property +// returns a *string when successful +func (m *Feed) GetSecurityAdvisoriesUrl()(*string) { + return m.security_advisories_url +} +// GetTimelineUrl gets the timeline_url property value. The timeline_url property +// returns a *string when successful +func (m *Feed) GetTimelineUrl()(*string) { + return m.timeline_url +} +// GetUserUrl gets the user_url property value. The user_url property +// returns a *string when successful +func (m *Feed) GetUserUrl()(*string) { + return m.user_url +} +// Serialize serializes information the current object +func (m *Feed) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("current_user_actor_url", m.GetCurrentUserActorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("current_user_organization_url", m.GetCurrentUserOrganizationUrl()) + if err != nil { + return err + } + } + if m.GetCurrentUserOrganizationUrls() != nil { + err := writer.WriteCollectionOfStringValues("current_user_organization_urls", m.GetCurrentUserOrganizationUrls()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("current_user_public_url", m.GetCurrentUserPublicUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("current_user_url", m.GetCurrentUserUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_discussions_category_url", m.GetRepositoryDiscussionsCategoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_discussions_url", m.GetRepositoryDiscussionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("security_advisories_url", m.GetSecurityAdvisoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("timeline_url", m.GetTimelineUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user_url", m.GetUserUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *Feed) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCurrentUserActorUrl sets the current_user_actor_url property value. The current_user_actor_url property +func (m *Feed) SetCurrentUserActorUrl(value *string)() { + m.current_user_actor_url = value +} +// SetCurrentUserOrganizationUrl sets the current_user_organization_url property value. The current_user_organization_url property +func (m *Feed) SetCurrentUserOrganizationUrl(value *string)() { + m.current_user_organization_url = value +} +// SetCurrentUserOrganizationUrls sets the current_user_organization_urls property value. The current_user_organization_urls property +func (m *Feed) SetCurrentUserOrganizationUrls(value []string)() { + m.current_user_organization_urls = value +} +// SetCurrentUserPublicUrl sets the current_user_public_url property value. The current_user_public_url property +func (m *Feed) SetCurrentUserPublicUrl(value *string)() { + m.current_user_public_url = value +} +// SetCurrentUserUrl sets the current_user_url property value. The current_user_url property +func (m *Feed) SetCurrentUserUrl(value *string)() { + m.current_user_url = value +} +// SetLinks sets the _links property value. The _links property +func (m *Feed) SetLinks(value Feed__linksable)() { + m._links = value +} +// SetRepositoryDiscussionsCategoryUrl sets the repository_discussions_category_url property value. A feed of discussions for a given repository and category. +func (m *Feed) SetRepositoryDiscussionsCategoryUrl(value *string)() { + m.repository_discussions_category_url = value +} +// SetRepositoryDiscussionsUrl sets the repository_discussions_url property value. A feed of discussions for a given repository. +func (m *Feed) SetRepositoryDiscussionsUrl(value *string)() { + m.repository_discussions_url = value +} +// SetSecurityAdvisoriesUrl sets the security_advisories_url property value. The security_advisories_url property +func (m *Feed) SetSecurityAdvisoriesUrl(value *string)() { + m.security_advisories_url = value +} +// SetTimelineUrl sets the timeline_url property value. The timeline_url property +func (m *Feed) SetTimelineUrl(value *string)() { + m.timeline_url = value +} +// SetUserUrl sets the user_url property value. The user_url property +func (m *Feed) SetUserUrl(value *string)() { + m.user_url = value +} +type Feedable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCurrentUserActorUrl()(*string) + GetCurrentUserOrganizationUrl()(*string) + GetCurrentUserOrganizationUrls()([]string) + GetCurrentUserPublicUrl()(*string) + GetCurrentUserUrl()(*string) + GetLinks()(Feed__linksable) + GetRepositoryDiscussionsCategoryUrl()(*string) + GetRepositoryDiscussionsUrl()(*string) + GetSecurityAdvisoriesUrl()(*string) + GetTimelineUrl()(*string) + GetUserUrl()(*string) + SetCurrentUserActorUrl(value *string)() + SetCurrentUserOrganizationUrl(value *string)() + SetCurrentUserOrganizationUrls(value []string)() + SetCurrentUserPublicUrl(value *string)() + SetCurrentUserUrl(value *string)() + SetLinks(value Feed__linksable)() + SetRepositoryDiscussionsCategoryUrl(value *string)() + SetRepositoryDiscussionsUrl(value *string)() + SetSecurityAdvisoriesUrl(value *string)() + SetTimelineUrl(value *string)() + SetUserUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/feed__links.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/feed__links.go new file mode 100644 index 000000000..c6a335b4d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/feed__links.go @@ -0,0 +1,353 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Feed__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Hypermedia Link with Type + current_user LinkWithTypeable + // Hypermedia Link with Type + current_user_actor LinkWithTypeable + // Hypermedia Link with Type + current_user_organization LinkWithTypeable + // The current_user_organizations property + current_user_organizations []LinkWithTypeable + // Hypermedia Link with Type + current_user_public LinkWithTypeable + // Hypermedia Link with Type + repository_discussions LinkWithTypeable + // Hypermedia Link with Type + repository_discussions_category LinkWithTypeable + // Hypermedia Link with Type + security_advisories LinkWithTypeable + // Hypermedia Link with Type + timeline LinkWithTypeable + // Hypermedia Link with Type + user LinkWithTypeable +} +// NewFeed__links instantiates a new Feed__links and sets the default values. +func NewFeed__links()(*Feed__links) { + m := &Feed__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFeed__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFeed__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFeed__links(), 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 *Feed__links) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCurrentUser gets the current_user property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetCurrentUser()(LinkWithTypeable) { + return m.current_user +} +// GetCurrentUserActor gets the current_user_actor property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetCurrentUserActor()(LinkWithTypeable) { + return m.current_user_actor +} +// GetCurrentUserOrganization gets the current_user_organization property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetCurrentUserOrganization()(LinkWithTypeable) { + return m.current_user_organization +} +// GetCurrentUserOrganizations gets the current_user_organizations property value. The current_user_organizations property +// returns a []LinkWithTypeable when successful +func (m *Feed__links) GetCurrentUserOrganizations()([]LinkWithTypeable) { + return m.current_user_organizations +} +// GetCurrentUserPublic gets the current_user_public property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetCurrentUserPublic()(LinkWithTypeable) { + return m.current_user_public +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Feed__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["current_user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCurrentUser(val.(LinkWithTypeable)) + } + return nil + } + res["current_user_actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserActor(val.(LinkWithTypeable)) + } + return nil + } + res["current_user_organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserOrganization(val.(LinkWithTypeable)) + } + return nil + } + res["current_user_organizations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]LinkWithTypeable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(LinkWithTypeable) + } + } + m.SetCurrentUserOrganizations(res) + } + return nil + } + res["current_user_public"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserPublic(val.(LinkWithTypeable)) + } + return nil + } + res["repository_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepositoryDiscussions(val.(LinkWithTypeable)) + } + return nil + } + res["repository_discussions_category"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepositoryDiscussionsCategory(val.(LinkWithTypeable)) + } + return nil + } + res["security_advisories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAdvisories(val.(LinkWithTypeable)) + } + return nil + } + res["timeline"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTimeline(val.(LinkWithTypeable)) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(LinkWithTypeable)) + } + return nil + } + return res +} +// GetRepositoryDiscussions gets the repository_discussions property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetRepositoryDiscussions()(LinkWithTypeable) { + return m.repository_discussions +} +// GetRepositoryDiscussionsCategory gets the repository_discussions_category property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetRepositoryDiscussionsCategory()(LinkWithTypeable) { + return m.repository_discussions_category +} +// GetSecurityAdvisories gets the security_advisories property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetSecurityAdvisories()(LinkWithTypeable) { + return m.security_advisories +} +// GetTimeline gets the timeline property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetTimeline()(LinkWithTypeable) { + return m.timeline +} +// GetUser gets the user property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetUser()(LinkWithTypeable) { + return m.user +} +// Serialize serializes information the current object +func (m *Feed__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("current_user", m.GetCurrentUser()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("current_user_actor", m.GetCurrentUserActor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("current_user_organization", m.GetCurrentUserOrganization()) + if err != nil { + return err + } + } + if m.GetCurrentUserOrganizations() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCurrentUserOrganizations())) + for i, v := range m.GetCurrentUserOrganizations() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("current_user_organizations", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("current_user_public", m.GetCurrentUserPublic()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository_discussions", m.GetRepositoryDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository_discussions_category", m.GetRepositoryDiscussionsCategory()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("security_advisories", m.GetSecurityAdvisories()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("timeline", m.GetTimeline()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *Feed__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCurrentUser sets the current_user property value. Hypermedia Link with Type +func (m *Feed__links) SetCurrentUser(value LinkWithTypeable)() { + m.current_user = value +} +// SetCurrentUserActor sets the current_user_actor property value. Hypermedia Link with Type +func (m *Feed__links) SetCurrentUserActor(value LinkWithTypeable)() { + m.current_user_actor = value +} +// SetCurrentUserOrganization sets the current_user_organization property value. Hypermedia Link with Type +func (m *Feed__links) SetCurrentUserOrganization(value LinkWithTypeable)() { + m.current_user_organization = value +} +// SetCurrentUserOrganizations sets the current_user_organizations property value. The current_user_organizations property +func (m *Feed__links) SetCurrentUserOrganizations(value []LinkWithTypeable)() { + m.current_user_organizations = value +} +// SetCurrentUserPublic sets the current_user_public property value. Hypermedia Link with Type +func (m *Feed__links) SetCurrentUserPublic(value LinkWithTypeable)() { + m.current_user_public = value +} +// SetRepositoryDiscussions sets the repository_discussions property value. Hypermedia Link with Type +func (m *Feed__links) SetRepositoryDiscussions(value LinkWithTypeable)() { + m.repository_discussions = value +} +// SetRepositoryDiscussionsCategory sets the repository_discussions_category property value. Hypermedia Link with Type +func (m *Feed__links) SetRepositoryDiscussionsCategory(value LinkWithTypeable)() { + m.repository_discussions_category = value +} +// SetSecurityAdvisories sets the security_advisories property value. Hypermedia Link with Type +func (m *Feed__links) SetSecurityAdvisories(value LinkWithTypeable)() { + m.security_advisories = value +} +// SetTimeline sets the timeline property value. Hypermedia Link with Type +func (m *Feed__links) SetTimeline(value LinkWithTypeable)() { + m.timeline = value +} +// SetUser sets the user property value. Hypermedia Link with Type +func (m *Feed__links) SetUser(value LinkWithTypeable)() { + m.user = value +} +type Feed__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCurrentUser()(LinkWithTypeable) + GetCurrentUserActor()(LinkWithTypeable) + GetCurrentUserOrganization()(LinkWithTypeable) + GetCurrentUserOrganizations()([]LinkWithTypeable) + GetCurrentUserPublic()(LinkWithTypeable) + GetRepositoryDiscussions()(LinkWithTypeable) + GetRepositoryDiscussionsCategory()(LinkWithTypeable) + GetSecurityAdvisories()(LinkWithTypeable) + GetTimeline()(LinkWithTypeable) + GetUser()(LinkWithTypeable) + SetCurrentUser(value LinkWithTypeable)() + SetCurrentUserActor(value LinkWithTypeable)() + SetCurrentUserOrganization(value LinkWithTypeable)() + SetCurrentUserOrganizations(value []LinkWithTypeable)() + SetCurrentUserPublic(value LinkWithTypeable)() + SetRepositoryDiscussions(value LinkWithTypeable)() + SetRepositoryDiscussionsCategory(value LinkWithTypeable)() + SetSecurityAdvisories(value LinkWithTypeable)() + SetTimeline(value LinkWithTypeable)() + SetUser(value LinkWithTypeable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit.go new file mode 100644 index 000000000..6183a9ec0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// FileCommit file Commit +type FileCommit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit property + commit FileCommit_commitable + // The content property + content FileCommit_contentable +} +// NewFileCommit instantiates a new FileCommit and sets the default values. +func NewFileCommit()(*FileCommit) { + m := &FileCommit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit(), 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 *FileCommit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommit gets the commit property value. The commit property +// returns a FileCommit_commitable when successful +func (m *FileCommit) GetCommit()(FileCommit_commitable) { + return m.commit +} +// GetContent gets the content property value. The content property +// returns a FileCommit_contentable when successful +func (m *FileCommit) GetContent()(FileCommit_contentable) { + return m.content +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FileCommit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFileCommit_commitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommit(val.(FileCommit_commitable)) + } + return nil + } + res["content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFileCommit_contentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetContent(val.(FileCommit_contentable)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *FileCommit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("commit", m.GetCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("content", m.GetContent()) + 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 *FileCommit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommit sets the commit property value. The commit property +func (m *FileCommit) SetCommit(value FileCommit_commitable)() { + m.commit = value +} +// SetContent sets the content property value. The content property +func (m *FileCommit) SetContent(value FileCommit_contentable)() { + m.content = value +} +type FileCommitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommit()(FileCommit_commitable) + GetContent()(FileCommit_contentable) + SetCommit(value FileCommit_commitable)() + SetContent(value FileCommit_contentable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit503_error.go new file mode 100644 index 000000000..3b309fd28 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FileCommit503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewFileCommit503Error instantiates a new FileCommit503Error and sets the default values. +func NewFileCommit503Error()(*FileCommit503Error) { + m := &FileCommit503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *FileCommit503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *FileCommit503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *FileCommit503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *FileCommit503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FileCommit503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *FileCommit503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *FileCommit503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *FileCommit503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *FileCommit503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *FileCommit503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *FileCommit503Error) SetMessage(value *string)() { + m.message = value +} +type FileCommit503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit.go new file mode 100644 index 000000000..b087f159a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit.go @@ -0,0 +1,353 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FileCommit_commit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The author property + author FileCommit_commit_authorable + // The committer property + committer FileCommit_commit_committerable + // The html_url property + html_url *string + // The message property + message *string + // The node_id property + node_id *string + // The parents property + parents []FileCommit_commit_parentsable + // The sha property + sha *string + // The tree property + tree FileCommit_commit_treeable + // The url property + url *string + // The verification property + verification FileCommit_commit_verificationable +} +// NewFileCommit_commit instantiates a new FileCommit_commit and sets the default values. +func NewFileCommit_commit()(*FileCommit_commit) { + m := &FileCommit_commit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit_commitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit_commitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit_commit(), 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 *FileCommit_commit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. The author property +// returns a FileCommit_commit_authorable when successful +func (m *FileCommit_commit) GetAuthor()(FileCommit_commit_authorable) { + return m.author +} +// GetCommitter gets the committer property value. The committer property +// returns a FileCommit_commit_committerable when successful +func (m *FileCommit_commit) GetCommitter()(FileCommit_commit_committerable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FileCommit_commit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFileCommit_commit_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(FileCommit_commit_authorable)) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFileCommit_commit_committerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(FileCommit_commit_committerable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["parents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateFileCommit_commit_parentsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]FileCommit_commit_parentsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(FileCommit_commit_parentsable) + } + } + m.SetParents(res) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFileCommit_commit_treeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTree(val.(FileCommit_commit_treeable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["verification"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFileCommit_commit_verificationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerification(val.(FileCommit_commit_verificationable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *FileCommit_commit) GetHtmlUrl()(*string) { + return m.html_url +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *FileCommit_commit) GetMessage()(*string) { + return m.message +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *FileCommit_commit) GetNodeId()(*string) { + return m.node_id +} +// GetParents gets the parents property value. The parents property +// returns a []FileCommit_commit_parentsable when successful +func (m *FileCommit_commit) GetParents()([]FileCommit_commit_parentsable) { + return m.parents +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *FileCommit_commit) GetSha()(*string) { + return m.sha +} +// GetTree gets the tree property value. The tree property +// returns a FileCommit_commit_treeable when successful +func (m *FileCommit_commit) GetTree()(FileCommit_commit_treeable) { + return m.tree +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *FileCommit_commit) GetUrl()(*string) { + return m.url +} +// GetVerification gets the verification property value. The verification property +// returns a FileCommit_commit_verificationable when successful +func (m *FileCommit_commit) GetVerification()(FileCommit_commit_verificationable) { + return m.verification +} +// Serialize serializes information the current object +func (m *FileCommit_commit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetParents() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetParents())) + for i, v := range m.GetParents() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("parents", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tree", m.GetTree()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("verification", m.GetVerification()) + 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 *FileCommit_commit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. The author property +func (m *FileCommit_commit) SetAuthor(value FileCommit_commit_authorable)() { + m.author = value +} +// SetCommitter sets the committer property value. The committer property +func (m *FileCommit_commit) SetCommitter(value FileCommit_commit_committerable)() { + m.committer = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *FileCommit_commit) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetMessage sets the message property value. The message property +func (m *FileCommit_commit) SetMessage(value *string)() { + m.message = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *FileCommit_commit) SetNodeId(value *string)() { + m.node_id = value +} +// SetParents sets the parents property value. The parents property +func (m *FileCommit_commit) SetParents(value []FileCommit_commit_parentsable)() { + m.parents = value +} +// SetSha sets the sha property value. The sha property +func (m *FileCommit_commit) SetSha(value *string)() { + m.sha = value +} +// SetTree sets the tree property value. The tree property +func (m *FileCommit_commit) SetTree(value FileCommit_commit_treeable)() { + m.tree = value +} +// SetUrl sets the url property value. The url property +func (m *FileCommit_commit) SetUrl(value *string)() { + m.url = value +} +// SetVerification sets the verification property value. The verification property +func (m *FileCommit_commit) SetVerification(value FileCommit_commit_verificationable)() { + m.verification = value +} +type FileCommit_commitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(FileCommit_commit_authorable) + GetCommitter()(FileCommit_commit_committerable) + GetHtmlUrl()(*string) + GetMessage()(*string) + GetNodeId()(*string) + GetParents()([]FileCommit_commit_parentsable) + GetSha()(*string) + GetTree()(FileCommit_commit_treeable) + GetUrl()(*string) + GetVerification()(FileCommit_commit_verificationable) + SetAuthor(value FileCommit_commit_authorable)() + SetCommitter(value FileCommit_commit_committerable)() + SetHtmlUrl(value *string)() + SetMessage(value *string)() + SetNodeId(value *string)() + SetParents(value []FileCommit_commit_parentsable)() + SetSha(value *string)() + SetTree(value FileCommit_commit_treeable)() + SetUrl(value *string)() + SetVerification(value FileCommit_commit_verificationable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit_author.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit_author.go new file mode 100644 index 000000000..0deddb04f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit_author.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FileCommit_commit_author struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The date property + date *string + // The email property + email *string + // The name property + name *string +} +// NewFileCommit_commit_author instantiates a new FileCommit_commit_author and sets the default values. +func NewFileCommit_commit_author()(*FileCommit_commit_author) { + m := &FileCommit_commit_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit_commit_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit_commit_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit_commit_author(), 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 *FileCommit_commit_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. The date property +// returns a *string when successful +func (m *FileCommit_commit_author) GetDate()(*string) { + return m.date +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *FileCommit_commit_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FileCommit_commit_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *FileCommit_commit_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *FileCommit_commit_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *FileCommit_commit_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. The date property +func (m *FileCommit_commit_author) SetDate(value *string)() { + m.date = value +} +// SetEmail sets the email property value. The email property +func (m *FileCommit_commit_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name property +func (m *FileCommit_commit_author) SetName(value *string)() { + m.name = value +} +type FileCommit_commit_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*string) + GetEmail()(*string) + GetName()(*string) + SetDate(value *string)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit_committer.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit_committer.go new file mode 100644 index 000000000..f472c4d5d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit_committer.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FileCommit_commit_committer struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The date property + date *string + // The email property + email *string + // The name property + name *string +} +// NewFileCommit_commit_committer instantiates a new FileCommit_commit_committer and sets the default values. +func NewFileCommit_commit_committer()(*FileCommit_commit_committer) { + m := &FileCommit_commit_committer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit_commit_committerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit_commit_committerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit_commit_committer(), 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 *FileCommit_commit_committer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. The date property +// returns a *string when successful +func (m *FileCommit_commit_committer) GetDate()(*string) { + return m.date +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *FileCommit_commit_committer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FileCommit_commit_committer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *FileCommit_commit_committer) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *FileCommit_commit_committer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *FileCommit_commit_committer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. The date property +func (m *FileCommit_commit_committer) SetDate(value *string)() { + m.date = value +} +// SetEmail sets the email property value. The email property +func (m *FileCommit_commit_committer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name property +func (m *FileCommit_commit_committer) SetName(value *string)() { + m.name = value +} +type FileCommit_commit_committerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*string) + GetEmail()(*string) + GetName()(*string) + SetDate(value *string)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit_parents.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit_parents.go new file mode 100644 index 000000000..27e599159 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit_parents.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FileCommit_commit_parents struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html_url property + html_url *string + // The sha property + sha *string + // The url property + url *string +} +// NewFileCommit_commit_parents instantiates a new FileCommit_commit_parents and sets the default values. +func NewFileCommit_commit_parents()(*FileCommit_commit_parents) { + m := &FileCommit_commit_parents{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit_commit_parentsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit_commit_parentsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit_commit_parents(), 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 *FileCommit_commit_parents) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FileCommit_commit_parents) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *FileCommit_commit_parents) GetHtmlUrl()(*string) { + return m.html_url +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *FileCommit_commit_parents) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *FileCommit_commit_parents) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *FileCommit_commit_parents) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *FileCommit_commit_parents) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *FileCommit_commit_parents) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetSha sets the sha property value. The sha property +func (m *FileCommit_commit_parents) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *FileCommit_commit_parents) SetUrl(value *string)() { + m.url = value +} +type FileCommit_commit_parentsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetSha()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit_tree.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit_tree.go new file mode 100644 index 000000000..64583bec5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit_tree.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FileCommit_commit_tree struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The sha property + sha *string + // The url property + url *string +} +// NewFileCommit_commit_tree instantiates a new FileCommit_commit_tree and sets the default values. +func NewFileCommit_commit_tree()(*FileCommit_commit_tree) { + m := &FileCommit_commit_tree{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit_commit_treeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit_commit_treeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit_commit_tree(), 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 *FileCommit_commit_tree) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FileCommit_commit_tree) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *FileCommit_commit_tree) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *FileCommit_commit_tree) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *FileCommit_commit_tree) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *FileCommit_commit_tree) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *FileCommit_commit_tree) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *FileCommit_commit_tree) SetUrl(value *string)() { + m.url = value +} +type FileCommit_commit_treeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit_verification.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit_verification.go new file mode 100644 index 000000000..255b309c4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_commit_verification.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FileCommit_commit_verification struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The payload property + payload *string + // The reason property + reason *string + // The signature property + signature *string + // The verified property + verified *bool +} +// NewFileCommit_commit_verification instantiates a new FileCommit_commit_verification and sets the default values. +func NewFileCommit_commit_verification()(*FileCommit_commit_verification) { + m := &FileCommit_commit_verification{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit_commit_verificationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit_commit_verificationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit_commit_verification(), 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 *FileCommit_commit_verification) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FileCommit_commit_verification) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPayload(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["signature"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSignature(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + return res +} +// GetPayload gets the payload property value. The payload property +// returns a *string when successful +func (m *FileCommit_commit_verification) GetPayload()(*string) { + return m.payload +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *FileCommit_commit_verification) GetReason()(*string) { + return m.reason +} +// GetSignature gets the signature property value. The signature property +// returns a *string when successful +func (m *FileCommit_commit_verification) GetSignature()(*string) { + return m.signature +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *FileCommit_commit_verification) GetVerified()(*bool) { + return m.verified +} +// Serialize serializes information the current object +func (m *FileCommit_commit_verification) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("payload", m.GetPayload()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("signature", m.GetSignature()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + 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 *FileCommit_commit_verification) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPayload sets the payload property value. The payload property +func (m *FileCommit_commit_verification) SetPayload(value *string)() { + m.payload = value +} +// SetReason sets the reason property value. The reason property +func (m *FileCommit_commit_verification) SetReason(value *string)() { + m.reason = value +} +// SetSignature sets the signature property value. The signature property +func (m *FileCommit_commit_verification) SetSignature(value *string)() { + m.signature = value +} +// SetVerified sets the verified property value. The verified property +func (m *FileCommit_commit_verification) SetVerified(value *bool)() { + m.verified = value +} +type FileCommit_commit_verificationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPayload()(*string) + GetReason()(*string) + GetSignature()(*string) + GetVerified()(*bool) + SetPayload(value *string)() + SetReason(value *string)() + SetSignature(value *string)() + SetVerified(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_content.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_content.go new file mode 100644 index 000000000..1e1635744 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_content.go @@ -0,0 +1,341 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FileCommit_content struct { + // The _links property + _links FileCommit_content__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The download_url property + download_url *string + // The git_url property + git_url *string + // The html_url property + html_url *string + // The name property + name *string + // The path property + path *string + // The sha property + sha *string + // The size property + size *int32 + // The type property + typeEscaped *string + // The url property + url *string +} +// NewFileCommit_content instantiates a new FileCommit_content and sets the default values. +func NewFileCommit_content()(*FileCommit_content) { + m := &FileCommit_content{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit_contentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit_contentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit_content(), 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 *FileCommit_content) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDownloadUrl gets the download_url property value. The download_url property +// returns a *string when successful +func (m *FileCommit_content) GetDownloadUrl()(*string) { + return m.download_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FileCommit_content) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFileCommit_content__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(FileCommit_content__linksable)) + } + return nil + } + res["download_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *FileCommit_content) GetGitUrl()(*string) { + return m.git_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *FileCommit_content) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLinks gets the _links property value. The _links property +// returns a FileCommit_content__linksable when successful +func (m *FileCommit_content) GetLinks()(FileCommit_content__linksable) { + return m._links +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *FileCommit_content) GetName()(*string) { + return m.name +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *FileCommit_content) GetPath()(*string) { + return m.path +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *FileCommit_content) GetSha()(*string) { + return m.sha +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *FileCommit_content) GetSize()(*int32) { + return m.size +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *FileCommit_content) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *FileCommit_content) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *FileCommit_content) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("download_url", m.GetDownloadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *FileCommit_content) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDownloadUrl sets the download_url property value. The download_url property +func (m *FileCommit_content) SetDownloadUrl(value *string)() { + m.download_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *FileCommit_content) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *FileCommit_content) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLinks sets the _links property value. The _links property +func (m *FileCommit_content) SetLinks(value FileCommit_content__linksable)() { + m._links = value +} +// SetName sets the name property value. The name property +func (m *FileCommit_content) SetName(value *string)() { + m.name = value +} +// SetPath sets the path property value. The path property +func (m *FileCommit_content) SetPath(value *string)() { + m.path = value +} +// SetSha sets the sha property value. The sha property +func (m *FileCommit_content) SetSha(value *string)() { + m.sha = value +} +// SetSize sets the size property value. The size property +func (m *FileCommit_content) SetSize(value *int32)() { + m.size = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *FileCommit_content) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *FileCommit_content) SetUrl(value *string)() { + m.url = value +} +type FileCommit_contentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDownloadUrl()(*string) + GetGitUrl()(*string) + GetHtmlUrl()(*string) + GetLinks()(FileCommit_content__linksable) + GetName()(*string) + GetPath()(*string) + GetSha()(*string) + GetSize()(*int32) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetDownloadUrl(value *string)() + SetGitUrl(value *string)() + SetHtmlUrl(value *string)() + SetLinks(value FileCommit_content__linksable)() + SetName(value *string)() + SetPath(value *string)() + SetSha(value *string)() + SetSize(value *int32)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_content__links.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_content__links.go new file mode 100644 index 000000000..0d9ac3ebf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_commit_content__links.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FileCommit_content__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The git property + git *string + // The html property + html *string + // The self property + self *string +} +// NewFileCommit_content__links instantiates a new FileCommit_content__links and sets the default values. +func NewFileCommit_content__links()(*FileCommit_content__links) { + m := &FileCommit_content__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit_content__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit_content__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit_content__links(), 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 *FileCommit_content__links) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FileCommit_content__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["git"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGit(val) + } + return nil + } + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtml(val) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelf(val) + } + return nil + } + return res +} +// GetGit gets the git property value. The git property +// returns a *string when successful +func (m *FileCommit_content__links) GetGit()(*string) { + return m.git +} +// GetHtml gets the html property value. The html property +// returns a *string when successful +func (m *FileCommit_content__links) GetHtml()(*string) { + return m.html +} +// GetSelf gets the self property value. The self property +// returns a *string when successful +func (m *FileCommit_content__links) GetSelf()(*string) { + return m.self +} +// Serialize serializes information the current object +func (m *FileCommit_content__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("git", m.GetGit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("self", m.GetSelf()) + 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 *FileCommit_content__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGit sets the git property value. The git property +func (m *FileCommit_content__links) SetGit(value *string)() { + m.git = value +} +// SetHtml sets the html property value. The html property +func (m *FileCommit_content__links) SetHtml(value *string)() { + m.html = value +} +// SetSelf sets the self property value. The self property +func (m *FileCommit_content__links) SetSelf(value *string)() { + m.self = value +} +type FileCommit_content__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGit()(*string) + GetHtml()(*string) + GetSelf()(*string) + SetGit(value *string)() + SetHtml(value *string)() + SetSelf(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/file_extension_restriction.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_extension_restriction.go new file mode 100644 index 000000000..cf261b714 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_extension_restriction.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// File_extension_restriction note: file_extension_restriction is in beta and subject to change.Prevent commits that include files with specified file extensions from being pushed to the commit graph. +type File_extension_restriction struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters File_extension_restriction_parametersable + // The type property + typeEscaped *File_extension_restriction_type +} +// NewFile_extension_restriction instantiates a new File_extension_restriction and sets the default values. +func NewFile_extension_restriction()(*File_extension_restriction) { + m := &File_extension_restriction{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFile_extension_restrictionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFile_extension_restrictionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFile_extension_restriction(), 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 *File_extension_restriction) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *File_extension_restriction) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFile_extension_restriction_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(File_extension_restriction_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseFile_extension_restriction_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*File_extension_restriction_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a File_extension_restriction_parametersable when successful +func (m *File_extension_restriction) GetParameters()(File_extension_restriction_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *File_extension_restriction_type when successful +func (m *File_extension_restriction) GetTypeEscaped()(*File_extension_restriction_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *File_extension_restriction) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *File_extension_restriction) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *File_extension_restriction) SetParameters(value File_extension_restriction_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *File_extension_restriction) SetTypeEscaped(value *File_extension_restriction_type)() { + m.typeEscaped = value +} +type File_extension_restrictionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(File_extension_restriction_parametersable) + GetTypeEscaped()(*File_extension_restriction_type) + SetParameters(value File_extension_restriction_parametersable)() + SetTypeEscaped(value *File_extension_restriction_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/file_extension_restriction_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_extension_restriction_parameters.go new file mode 100644 index 000000000..45e09bc8f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_extension_restriction_parameters.go @@ -0,0 +1,86 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type File_extension_restriction_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The file extensions that are restricted from being pushed to the commit graph. + restricted_file_extensions []string +} +// NewFile_extension_restriction_parameters instantiates a new File_extension_restriction_parameters and sets the default values. +func NewFile_extension_restriction_parameters()(*File_extension_restriction_parameters) { + m := &File_extension_restriction_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFile_extension_restriction_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFile_extension_restriction_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFile_extension_restriction_parameters(), 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 *File_extension_restriction_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *File_extension_restriction_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["restricted_file_extensions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRestrictedFileExtensions(res) + } + return nil + } + return res +} +// GetRestrictedFileExtensions gets the restricted_file_extensions property value. The file extensions that are restricted from being pushed to the commit graph. +// returns a []string when successful +func (m *File_extension_restriction_parameters) GetRestrictedFileExtensions()([]string) { + return m.restricted_file_extensions +} +// Serialize serializes information the current object +func (m *File_extension_restriction_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRestrictedFileExtensions() != nil { + err := writer.WriteCollectionOfStringValues("restricted_file_extensions", m.GetRestrictedFileExtensions()) + 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 *File_extension_restriction_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRestrictedFileExtensions sets the restricted_file_extensions property value. The file extensions that are restricted from being pushed to the commit graph. +func (m *File_extension_restriction_parameters) SetRestrictedFileExtensions(value []string)() { + m.restricted_file_extensions = value +} +type File_extension_restriction_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRestrictedFileExtensions()([]string) + SetRestrictedFileExtensions(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/file_extension_restriction_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_extension_restriction_type.go new file mode 100644 index 000000000..d74668c4c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_extension_restriction_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type File_extension_restriction_type int + +const ( + FILE_EXTENSION_RESTRICTION_FILE_EXTENSION_RESTRICTION_TYPE File_extension_restriction_type = iota +) + +func (i File_extension_restriction_type) String() string { + return []string{"file_extension_restriction"}[i] +} +func ParseFile_extension_restriction_type(v string) (any, error) { + result := FILE_EXTENSION_RESTRICTION_FILE_EXTENSION_RESTRICTION_TYPE + switch v { + case "file_extension_restriction": + result = FILE_EXTENSION_RESTRICTION_FILE_EXTENSION_RESTRICTION_TYPE + default: + return 0, errors.New("Unknown File_extension_restriction_type value: " + v) + } + return &result, nil +} +func SerializeFile_extension_restriction_type(values []File_extension_restriction_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i File_extension_restriction_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/file_path_restriction.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_path_restriction.go new file mode 100644 index 000000000..d45a96412 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_path_restriction.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// File_path_restriction note: file_path_restriction is in beta and subject to change.Prevent commits that include changes in specified file paths from being pushed to the commit graph. +type File_path_restriction struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters File_path_restriction_parametersable + // The type property + typeEscaped *File_path_restriction_type +} +// NewFile_path_restriction instantiates a new File_path_restriction and sets the default values. +func NewFile_path_restriction()(*File_path_restriction) { + m := &File_path_restriction{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFile_path_restrictionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFile_path_restrictionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFile_path_restriction(), 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 *File_path_restriction) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *File_path_restriction) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFile_path_restriction_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(File_path_restriction_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseFile_path_restriction_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*File_path_restriction_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a File_path_restriction_parametersable when successful +func (m *File_path_restriction) GetParameters()(File_path_restriction_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *File_path_restriction_type when successful +func (m *File_path_restriction) GetTypeEscaped()(*File_path_restriction_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *File_path_restriction) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *File_path_restriction) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *File_path_restriction) SetParameters(value File_path_restriction_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *File_path_restriction) SetTypeEscaped(value *File_path_restriction_type)() { + m.typeEscaped = value +} +type File_path_restrictionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(File_path_restriction_parametersable) + GetTypeEscaped()(*File_path_restriction_type) + SetParameters(value File_path_restriction_parametersable)() + SetTypeEscaped(value *File_path_restriction_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/file_path_restriction_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_path_restriction_parameters.go new file mode 100644 index 000000000..860c651b2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_path_restriction_parameters.go @@ -0,0 +1,86 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type File_path_restriction_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The file paths that are restricted from being pushed to the commit graph. + restricted_file_paths []string +} +// NewFile_path_restriction_parameters instantiates a new File_path_restriction_parameters and sets the default values. +func NewFile_path_restriction_parameters()(*File_path_restriction_parameters) { + m := &File_path_restriction_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFile_path_restriction_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFile_path_restriction_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFile_path_restriction_parameters(), 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 *File_path_restriction_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *File_path_restriction_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["restricted_file_paths"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRestrictedFilePaths(res) + } + return nil + } + return res +} +// GetRestrictedFilePaths gets the restricted_file_paths property value. The file paths that are restricted from being pushed to the commit graph. +// returns a []string when successful +func (m *File_path_restriction_parameters) GetRestrictedFilePaths()([]string) { + return m.restricted_file_paths +} +// Serialize serializes information the current object +func (m *File_path_restriction_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRestrictedFilePaths() != nil { + err := writer.WriteCollectionOfStringValues("restricted_file_paths", m.GetRestrictedFilePaths()) + 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 *File_path_restriction_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRestrictedFilePaths sets the restricted_file_paths property value. The file paths that are restricted from being pushed to the commit graph. +func (m *File_path_restriction_parameters) SetRestrictedFilePaths(value []string)() { + m.restricted_file_paths = value +} +type File_path_restriction_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRestrictedFilePaths()([]string) + SetRestrictedFilePaths(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/file_path_restriction_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_path_restriction_type.go new file mode 100644 index 000000000..b73a36960 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/file_path_restriction_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type File_path_restriction_type int + +const ( + FILE_PATH_RESTRICTION_FILE_PATH_RESTRICTION_TYPE File_path_restriction_type = iota +) + +func (i File_path_restriction_type) String() string { + return []string{"file_path_restriction"}[i] +} +func ParseFile_path_restriction_type(v string) (any, error) { + result := FILE_PATH_RESTRICTION_FILE_PATH_RESTRICTION_TYPE + switch v { + case "file_path_restriction": + result = FILE_PATH_RESTRICTION_FILE_PATH_RESTRICTION_TYPE + default: + return 0, errors.New("Unknown File_path_restriction_type value: " + v) + } + return &result, nil +} +func SerializeFile_path_restriction_type(values []File_path_restriction_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i File_path_restriction_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/files503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/files503_error.go new file mode 100644 index 000000000..886aef7ca --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/files503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Files503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewFiles503Error instantiates a new Files503Error and sets the default values. +func NewFiles503Error()(*Files503Error) { + m := &Files503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFiles503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFiles503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFiles503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Files503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Files503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Files503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Files503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Files503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Files503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Files503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *Files503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Files503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Files503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Files503Error) SetMessage(value *string)() { + m.message = value +} +type Files503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository.go new file mode 100644 index 000000000..7744cef38 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository.go @@ -0,0 +1,3050 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// FullRepository full Repository +type FullRepository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The allow_auto_merge property + allow_auto_merge *bool + // The allow_forking property + allow_forking *bool + // The allow_merge_commit property + allow_merge_commit *bool + // The allow_rebase_merge property + allow_rebase_merge *bool + // The allow_squash_merge property + allow_squash_merge *bool + // The allow_update_branch property + allow_update_branch *bool + // Whether anonymous git access is allowed. + anonymous_access_enabled *bool + // The archive_url property + archive_url *string + // The archived property + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // Code of Conduct Simple + code_of_conduct CodeOfConductSimpleable + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + custom_properties FullRepository_custom_propertiesable + // The default_branch property + default_branch *string + // The delete_branch_on_merge property + delete_branch_on_merge *bool + // The deployments_url property + deployments_url *string + // The description property + description *string + // Returns whether or not this repository disabled. + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // The has_discussions property + has_discussions *bool + // The has_downloads property + has_downloads *bool + // The has_issues property + has_issues *bool + // The has_pages property + has_pages *bool + // The has_projects property + has_projects *bool + // The has_wiki property + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int64 + // The is_template property + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // License Simple + license NullableLicenseSimpleable + // The master_branch property + master_branch *string + // The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. + merge_commit_message *FullRepository_merge_commit_message + // The default value for a merge commit title. - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + merge_commit_title *FullRepository_merge_commit_title + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name property + name *string + // The network_count property + network_count *int32 + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // A GitHub user. + organization NullableSimpleUserable + // A GitHub user. + owner SimpleUserable + // A repository on GitHub. + parent Repositoryable + // The permissions property + permissions FullRepository_permissionsable + // The private property + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The security_and_analysis property + security_and_analysis SecurityAndAnalysisable + // The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + size *int32 + // A repository on GitHub. + source Repositoryable + // The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. + squash_merge_commit_message *FullRepository_squash_merge_commit_message + // The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + squash_merge_commit_title *FullRepository_squash_merge_commit_title + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The statuses_url property + statuses_url *string + // The subscribers_count property + subscribers_count *int32 + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // A repository on GitHub. + template_repository NullableRepositoryable + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The use_squash_pr_title_as_default property + use_squash_pr_title_as_default *bool + // The repository visibility: public, private, or internal. + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // The web_commit_signoff_required property + web_commit_signoff_required *bool +} +// NewFullRepository instantiates a new FullRepository and sets the default values. +func NewFullRepository()(*FullRepository) { + m := &FullRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFullRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFullRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFullRepository(), 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 *FullRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. The allow_auto_merge property +// returns a *bool when successful +func (m *FullRepository) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowForking gets the allow_forking property value. The allow_forking property +// returns a *bool when successful +func (m *FullRepository) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. The allow_merge_commit property +// returns a *bool when successful +func (m *FullRepository) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. The allow_rebase_merge property +// returns a *bool when successful +func (m *FullRepository) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. The allow_squash_merge property +// returns a *bool when successful +func (m *FullRepository) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetAllowUpdateBranch gets the allow_update_branch property value. The allow_update_branch property +// returns a *bool when successful +func (m *FullRepository) GetAllowUpdateBranch()(*bool) { + return m.allow_update_branch +} +// GetAnonymousAccessEnabled gets the anonymous_access_enabled property value. Whether anonymous git access is allowed. +// returns a *bool when successful +func (m *FullRepository) GetAnonymousAccessEnabled()(*bool) { + return m.anonymous_access_enabled +} +// GetArchived gets the archived property value. The archived property +// returns a *bool when successful +func (m *FullRepository) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *FullRepository) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *FullRepository) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *FullRepository) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *FullRepository) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *FullRepository) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCodeOfConduct gets the code_of_conduct property value. Code of Conduct Simple +// returns a CodeOfConductSimpleable when successful +func (m *FullRepository) GetCodeOfConduct()(CodeOfConductSimpleable) { + return m.code_of_conduct +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *FullRepository) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *FullRepository) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *FullRepository) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *FullRepository) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *FullRepository) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *FullRepository) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *FullRepository) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCustomProperties gets the custom_properties property value. The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. +// returns a FullRepository_custom_propertiesable when successful +func (m *FullRepository) GetCustomProperties()(FullRepository_custom_propertiesable) { + return m.custom_properties +} +// GetDefaultBranch gets the default_branch property value. The default_branch property +// returns a *string when successful +func (m *FullRepository) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. The delete_branch_on_merge property +// returns a *bool when successful +func (m *FullRepository) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *FullRepository) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *FullRepository) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. Returns whether or not this repository disabled. +// returns a *bool when successful +func (m *FullRepository) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *FullRepository) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *FullRepository) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FullRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["allow_update_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowUpdateBranch(val) + } + return nil + } + res["anonymous_access_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAnonymousAccessEnabled(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["code_of_conduct"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeOfConductSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCodeOfConduct(val.(CodeOfConductSimpleable)) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["custom_properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFullRepository_custom_propertiesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCustomProperties(val.(FullRepository_custom_propertiesable)) + } + return nil + } + res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableLicenseSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(NullableLicenseSimpleable)) + } + return nil + } + res["master_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMasterBranch(val) + } + return nil + } + res["merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseFullRepository_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitMessage(val.(*FullRepository_merge_commit_message)) + } + return nil + } + res["merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseFullRepository_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitTitle(val.(*FullRepository_merge_commit_title)) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["network_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNetworkCount(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrganization(val.(NullableSimpleUserable)) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["parent"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParent(val.(Repositoryable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFullRepository_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(FullRepository_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["security_and_analysis"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSecurityAndAnalysisFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAndAnalysis(val.(SecurityAndAnalysisable)) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSource(val.(Repositoryable)) + } + return nil + } + res["squash_merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseFullRepository_squash_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitMessage(val.(*FullRepository_squash_merge_commit_message)) + } + return nil + } + res["squash_merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseFullRepository_squash_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitTitle(val.(*FullRepository_squash_merge_commit_title)) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersCount(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["template_repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTemplateRepository(val.(NullableRepositoryable)) + } + return nil + } + res["topics"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["use_squash_pr_title_as_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseSquashPrTitleAsDefault(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *FullRepository) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *FullRepository) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *FullRepository) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *FullRepository) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *FullRepository) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *FullRepository) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *FullRepository) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *FullRepository) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *FullRepository) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDiscussions gets the has_discussions property value. The has_discussions property +// returns a *bool when successful +func (m *FullRepository) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. The has_downloads property +// returns a *bool when successful +func (m *FullRepository) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. The has_issues property +// returns a *bool when successful +func (m *FullRepository) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *FullRepository) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. The has_projects property +// returns a *bool when successful +func (m *FullRepository) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. The has_wiki property +// returns a *bool when successful +func (m *FullRepository) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *FullRepository) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *FullRepository) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *FullRepository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *FullRepository) GetId()(*int64) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *FullRepository) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *FullRepository) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *FullRepository) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. The is_template property +// returns a *bool when successful +func (m *FullRepository) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *FullRepository) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *FullRepository) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *FullRepository) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *FullRepository) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. License Simple +// returns a NullableLicenseSimpleable when successful +func (m *FullRepository) GetLicense()(NullableLicenseSimpleable) { + return m.license +} +// GetMasterBranch gets the master_branch property value. The master_branch property +// returns a *string when successful +func (m *FullRepository) GetMasterBranch()(*string) { + return m.master_branch +} +// GetMergeCommitMessage gets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +// returns a *FullRepository_merge_commit_message when successful +func (m *FullRepository) GetMergeCommitMessage()(*FullRepository_merge_commit_message) { + return m.merge_commit_message +} +// GetMergeCommitTitle gets the merge_commit_title property value. The default value for a merge commit title. - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +// returns a *FullRepository_merge_commit_title when successful +func (m *FullRepository) GetMergeCommitTitle()(*FullRepository_merge_commit_title) { + return m.merge_commit_title +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *FullRepository) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *FullRepository) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *FullRepository) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *FullRepository) GetName()(*string) { + return m.name +} +// GetNetworkCount gets the network_count property value. The network_count property +// returns a *int32 when successful +func (m *FullRepository) GetNetworkCount()(*int32) { + return m.network_count +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *FullRepository) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *FullRepository) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *FullRepository) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *FullRepository) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOrganization gets the organization property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *FullRepository) GetOrganization()(NullableSimpleUserable) { + return m.organization +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *FullRepository) GetOwner()(SimpleUserable) { + return m.owner +} +// GetParent gets the parent property value. A repository on GitHub. +// returns a Repositoryable when successful +func (m *FullRepository) GetParent()(Repositoryable) { + return m.parent +} +// GetPermissions gets the permissions property value. The permissions property +// returns a FullRepository_permissionsable when successful +func (m *FullRepository) GetPermissions()(FullRepository_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. The private property +// returns a *bool when successful +func (m *FullRepository) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *FullRepository) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *FullRepository) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *FullRepository) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetSecurityAndAnalysis gets the security_and_analysis property value. The security_and_analysis property +// returns a SecurityAndAnalysisable when successful +func (m *FullRepository) GetSecurityAndAnalysis()(SecurityAndAnalysisable) { + return m.security_and_analysis +} +// GetSize gets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +// returns a *int32 when successful +func (m *FullRepository) GetSize()(*int32) { + return m.size +} +// GetSource gets the source property value. A repository on GitHub. +// returns a Repositoryable when successful +func (m *FullRepository) GetSource()(Repositoryable) { + return m.source +} +// GetSquashMergeCommitMessage gets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +// returns a *FullRepository_squash_merge_commit_message when successful +func (m *FullRepository) GetSquashMergeCommitMessage()(*FullRepository_squash_merge_commit_message) { + return m.squash_merge_commit_message +} +// GetSquashMergeCommitTitle gets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +// returns a *FullRepository_squash_merge_commit_title when successful +func (m *FullRepository) GetSquashMergeCommitTitle()(*FullRepository_squash_merge_commit_title) { + return m.squash_merge_commit_title +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *FullRepository) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *FullRepository) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *FullRepository) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *FullRepository) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersCount gets the subscribers_count property value. The subscribers_count property +// returns a *int32 when successful +func (m *FullRepository) GetSubscribersCount()(*int32) { + return m.subscribers_count +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *FullRepository) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *FullRepository) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *FullRepository) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *FullRepository) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *FullRepository) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *FullRepository) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTemplateRepository gets the template_repository property value. A repository on GitHub. +// returns a NullableRepositoryable when successful +func (m *FullRepository) GetTemplateRepository()(NullableRepositoryable) { + return m.template_repository +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *FullRepository) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *FullRepository) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *FullRepository) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *FullRepository) GetUrl()(*string) { + return m.url +} +// GetUseSquashPrTitleAsDefault gets the use_squash_pr_title_as_default property value. The use_squash_pr_title_as_default property +// returns a *bool when successful +func (m *FullRepository) GetUseSquashPrTitleAsDefault()(*bool) { + return m.use_squash_pr_title_as_default +} +// GetVisibility gets the visibility property value. The repository visibility: public, private, or internal. +// returns a *string when successful +func (m *FullRepository) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *FullRepository) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *FullRepository) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. The web_commit_signoff_required property +// returns a *bool when successful +func (m *FullRepository) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *FullRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_update_branch", m.GetAllowUpdateBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("anonymous_access_enabled", m.GetAnonymousAccessEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("code_of_conduct", m.GetCodeOfConduct()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("custom_properties", m.GetCustomProperties()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("master_branch", m.GetMasterBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + if m.GetMergeCommitMessage() != nil { + cast := (*m.GetMergeCommitMessage()).String() + err := writer.WriteStringValue("merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetMergeCommitTitle() != nil { + cast := (*m.GetMergeCommitTitle()).String() + err := writer.WriteStringValue("merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("network_count", m.GetNetworkCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("organization", m.GetOrganization()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("parent", m.GetParent()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("security_and_analysis", m.GetSecurityAndAnalysis()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("source", m.GetSource()) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitMessage() != nil { + cast := (*m.GetSquashMergeCommitMessage()).String() + err := writer.WriteStringValue("squash_merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitTitle() != nil { + cast := (*m.GetSquashMergeCommitTitle()).String() + err := writer.WriteStringValue("squash_merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("subscribers_count", m.GetSubscribersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("template_repository", m.GetTemplateRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_squash_pr_title_as_default", m.GetUseSquashPrTitleAsDefault()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *FullRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. The allow_auto_merge property +func (m *FullRepository) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowForking sets the allow_forking property value. The allow_forking property +func (m *FullRepository) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. The allow_merge_commit property +func (m *FullRepository) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. The allow_rebase_merge property +func (m *FullRepository) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. The allow_squash_merge property +func (m *FullRepository) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetAllowUpdateBranch sets the allow_update_branch property value. The allow_update_branch property +func (m *FullRepository) SetAllowUpdateBranch(value *bool)() { + m.allow_update_branch = value +} +// SetAnonymousAccessEnabled sets the anonymous_access_enabled property value. Whether anonymous git access is allowed. +func (m *FullRepository) SetAnonymousAccessEnabled(value *bool)() { + m.anonymous_access_enabled = value +} +// SetArchived sets the archived property value. The archived property +func (m *FullRepository) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *FullRepository) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *FullRepository) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *FullRepository) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *FullRepository) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *FullRepository) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCodeOfConduct sets the code_of_conduct property value. Code of Conduct Simple +func (m *FullRepository) SetCodeOfConduct(value CodeOfConductSimpleable)() { + m.code_of_conduct = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *FullRepository) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *FullRepository) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *FullRepository) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *FullRepository) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *FullRepository) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *FullRepository) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *FullRepository) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCustomProperties sets the custom_properties property value. The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. +func (m *FullRepository) SetCustomProperties(value FullRepository_custom_propertiesable)() { + m.custom_properties = value +} +// SetDefaultBranch sets the default_branch property value. The default_branch property +func (m *FullRepository) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. The delete_branch_on_merge property +func (m *FullRepository) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *FullRepository) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *FullRepository) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. Returns whether or not this repository disabled. +func (m *FullRepository) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *FullRepository) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *FullRepository) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *FullRepository) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *FullRepository) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *FullRepository) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *FullRepository) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *FullRepository) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *FullRepository) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *FullRepository) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *FullRepository) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *FullRepository) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDiscussions sets the has_discussions property value. The has_discussions property +func (m *FullRepository) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. The has_downloads property +func (m *FullRepository) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. The has_issues property +func (m *FullRepository) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *FullRepository) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. The has_projects property +func (m *FullRepository) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. The has_wiki property +func (m *FullRepository) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *FullRepository) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *FullRepository) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *FullRepository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *FullRepository) SetId(value *int64)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *FullRepository) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *FullRepository) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *FullRepository) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. The is_template property +func (m *FullRepository) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *FullRepository) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *FullRepository) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *FullRepository) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *FullRepository) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. License Simple +func (m *FullRepository) SetLicense(value NullableLicenseSimpleable)() { + m.license = value +} +// SetMasterBranch sets the master_branch property value. The master_branch property +func (m *FullRepository) SetMasterBranch(value *string)() { + m.master_branch = value +} +// SetMergeCommitMessage sets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +func (m *FullRepository) SetMergeCommitMessage(value *FullRepository_merge_commit_message)() { + m.merge_commit_message = value +} +// SetMergeCommitTitle sets the merge_commit_title property value. The default value for a merge commit title. - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +func (m *FullRepository) SetMergeCommitTitle(value *FullRepository_merge_commit_title)() { + m.merge_commit_title = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *FullRepository) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *FullRepository) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *FullRepository) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name property +func (m *FullRepository) SetName(value *string)() { + m.name = value +} +// SetNetworkCount sets the network_count property value. The network_count property +func (m *FullRepository) SetNetworkCount(value *int32)() { + m.network_count = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *FullRepository) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *FullRepository) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *FullRepository) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *FullRepository) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOrganization sets the organization property value. A GitHub user. +func (m *FullRepository) SetOrganization(value NullableSimpleUserable)() { + m.organization = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *FullRepository) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetParent sets the parent property value. A repository on GitHub. +func (m *FullRepository) SetParent(value Repositoryable)() { + m.parent = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *FullRepository) SetPermissions(value FullRepository_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. The private property +func (m *FullRepository) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *FullRepository) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *FullRepository) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *FullRepository) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetSecurityAndAnalysis sets the security_and_analysis property value. The security_and_analysis property +func (m *FullRepository) SetSecurityAndAnalysis(value SecurityAndAnalysisable)() { + m.security_and_analysis = value +} +// SetSize sets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +func (m *FullRepository) SetSize(value *int32)() { + m.size = value +} +// SetSource sets the source property value. A repository on GitHub. +func (m *FullRepository) SetSource(value Repositoryable)() { + m.source = value +} +// SetSquashMergeCommitMessage sets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +func (m *FullRepository) SetSquashMergeCommitMessage(value *FullRepository_squash_merge_commit_message)() { + m.squash_merge_commit_message = value +} +// SetSquashMergeCommitTitle sets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +func (m *FullRepository) SetSquashMergeCommitTitle(value *FullRepository_squash_merge_commit_title)() { + m.squash_merge_commit_title = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *FullRepository) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *FullRepository) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *FullRepository) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *FullRepository) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersCount sets the subscribers_count property value. The subscribers_count property +func (m *FullRepository) SetSubscribersCount(value *int32)() { + m.subscribers_count = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *FullRepository) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *FullRepository) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *FullRepository) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *FullRepository) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *FullRepository) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *FullRepository) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTemplateRepository sets the template_repository property value. A repository on GitHub. +func (m *FullRepository) SetTemplateRepository(value NullableRepositoryable)() { + m.template_repository = value +} +// SetTopics sets the topics property value. The topics property +func (m *FullRepository) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *FullRepository) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *FullRepository) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *FullRepository) SetUrl(value *string)() { + m.url = value +} +// SetUseSquashPrTitleAsDefault sets the use_squash_pr_title_as_default property value. The use_squash_pr_title_as_default property +func (m *FullRepository) SetUseSquashPrTitleAsDefault(value *bool)() { + m.use_squash_pr_title_as_default = value +} +// SetVisibility sets the visibility property value. The repository visibility: public, private, or internal. +func (m *FullRepository) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *FullRepository) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *FullRepository) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. The web_commit_signoff_required property +func (m *FullRepository) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type FullRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetAllowUpdateBranch()(*bool) + GetAnonymousAccessEnabled()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCodeOfConduct()(CodeOfConductSimpleable) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCustomProperties()(FullRepository_custom_propertiesable) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(NullableLicenseSimpleable) + GetMasterBranch()(*string) + GetMergeCommitMessage()(*FullRepository_merge_commit_message) + GetMergeCommitTitle()(*FullRepository_merge_commit_title) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNetworkCount()(*int32) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOrganization()(NullableSimpleUserable) + GetOwner()(SimpleUserable) + GetParent()(Repositoryable) + GetPermissions()(FullRepository_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetSecurityAndAnalysis()(SecurityAndAnalysisable) + GetSize()(*int32) + GetSource()(Repositoryable) + GetSquashMergeCommitMessage()(*FullRepository_squash_merge_commit_message) + GetSquashMergeCommitTitle()(*FullRepository_squash_merge_commit_title) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersCount()(*int32) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTemplateRepository()(NullableRepositoryable) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUseSquashPrTitleAsDefault()(*bool) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowAutoMerge(value *bool)() + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetAllowUpdateBranch(value *bool)() + SetAnonymousAccessEnabled(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCodeOfConduct(value CodeOfConductSimpleable)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCustomProperties(value FullRepository_custom_propertiesable)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value NullableLicenseSimpleable)() + SetMasterBranch(value *string)() + SetMergeCommitMessage(value *FullRepository_merge_commit_message)() + SetMergeCommitTitle(value *FullRepository_merge_commit_title)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNetworkCount(value *int32)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOrganization(value NullableSimpleUserable)() + SetOwner(value SimpleUserable)() + SetParent(value Repositoryable)() + SetPermissions(value FullRepository_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetSecurityAndAnalysis(value SecurityAndAnalysisable)() + SetSize(value *int32)() + SetSource(value Repositoryable)() + SetSquashMergeCommitMessage(value *FullRepository_squash_merge_commit_message)() + SetSquashMergeCommitTitle(value *FullRepository_squash_merge_commit_title)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersCount(value *int32)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTemplateRepository(value NullableRepositoryable)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUseSquashPrTitleAsDefault(value *bool)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_custom_properties.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_custom_properties.go new file mode 100644 index 000000000..4087296e9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_custom_properties.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// FullRepository_custom_properties the custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. +type FullRepository_custom_properties struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewFullRepository_custom_properties instantiates a new FullRepository_custom_properties and sets the default values. +func NewFullRepository_custom_properties()(*FullRepository_custom_properties) { + m := &FullRepository_custom_properties{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFullRepository_custom_propertiesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFullRepository_custom_propertiesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFullRepository_custom_properties(), 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 *FullRepository_custom_properties) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FullRepository_custom_properties) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *FullRepository_custom_properties) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *FullRepository_custom_properties) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type FullRepository_custom_propertiesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_merge_commit_message.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_merge_commit_message.go new file mode 100644 index 000000000..0f291c5c5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_merge_commit_message.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +type FullRepository_merge_commit_message int + +const ( + PR_BODY_FULLREPOSITORY_MERGE_COMMIT_MESSAGE FullRepository_merge_commit_message = iota + PR_TITLE_FULLREPOSITORY_MERGE_COMMIT_MESSAGE + BLANK_FULLREPOSITORY_MERGE_COMMIT_MESSAGE +) + +func (i FullRepository_merge_commit_message) String() string { + return []string{"PR_BODY", "PR_TITLE", "BLANK"}[i] +} +func ParseFullRepository_merge_commit_message(v string) (any, error) { + result := PR_BODY_FULLREPOSITORY_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_FULLREPOSITORY_MERGE_COMMIT_MESSAGE + case "PR_TITLE": + result = PR_TITLE_FULLREPOSITORY_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_FULLREPOSITORY_MERGE_COMMIT_MESSAGE + default: + return 0, errors.New("Unknown FullRepository_merge_commit_message value: " + v) + } + return &result, nil +} +func SerializeFullRepository_merge_commit_message(values []FullRepository_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i FullRepository_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_merge_commit_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_merge_commit_title.go new file mode 100644 index 000000000..582c9e670 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_merge_commit_title.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The default value for a merge commit title. - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +type FullRepository_merge_commit_title int + +const ( + PR_TITLE_FULLREPOSITORY_MERGE_COMMIT_TITLE FullRepository_merge_commit_title = iota + MERGE_MESSAGE_FULLREPOSITORY_MERGE_COMMIT_TITLE +) + +func (i FullRepository_merge_commit_title) String() string { + return []string{"PR_TITLE", "MERGE_MESSAGE"}[i] +} +func ParseFullRepository_merge_commit_title(v string) (any, error) { + result := PR_TITLE_FULLREPOSITORY_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_FULLREPOSITORY_MERGE_COMMIT_TITLE + case "MERGE_MESSAGE": + result = MERGE_MESSAGE_FULLREPOSITORY_MERGE_COMMIT_TITLE + default: + return 0, errors.New("Unknown FullRepository_merge_commit_title value: " + v) + } + return &result, nil +} +func SerializeFullRepository_merge_commit_title(values []FullRepository_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i FullRepository_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_permissions.go new file mode 100644 index 000000000..9915aa3c8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FullRepository_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewFullRepository_permissions instantiates a new FullRepository_permissions and sets the default values. +func NewFullRepository_permissions()(*FullRepository_permissions) { + m := &FullRepository_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFullRepository_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFullRepository_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFullRepository_permissions(), 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 *FullRepository_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *FullRepository_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FullRepository_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *FullRepository_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *FullRepository_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *FullRepository_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *FullRepository_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *FullRepository_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *FullRepository_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *FullRepository_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *FullRepository_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *FullRepository_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *FullRepository_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *FullRepository_permissions) SetTriage(value *bool)() { + m.triage = value +} +type FullRepository_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_squash_merge_commit_message.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_squash_merge_commit_message.go new file mode 100644 index 000000000..1564df2af --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_squash_merge_commit_message.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +type FullRepository_squash_merge_commit_message int + +const ( + PR_BODY_FULLREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE FullRepository_squash_merge_commit_message = iota + COMMIT_MESSAGES_FULLREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + BLANK_FULLREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE +) + +func (i FullRepository_squash_merge_commit_message) String() string { + return []string{"PR_BODY", "COMMIT_MESSAGES", "BLANK"}[i] +} +func ParseFullRepository_squash_merge_commit_message(v string) (any, error) { + result := PR_BODY_FULLREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_FULLREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + case "COMMIT_MESSAGES": + result = COMMIT_MESSAGES_FULLREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_FULLREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + default: + return 0, errors.New("Unknown FullRepository_squash_merge_commit_message value: " + v) + } + return &result, nil +} +func SerializeFullRepository_squash_merge_commit_message(values []FullRepository_squash_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i FullRepository_squash_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_squash_merge_commit_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_squash_merge_commit_title.go new file mode 100644 index 000000000..e99fbf53a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/full_repository_squash_merge_commit_title.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +type FullRepository_squash_merge_commit_title int + +const ( + PR_TITLE_FULLREPOSITORY_SQUASH_MERGE_COMMIT_TITLE FullRepository_squash_merge_commit_title = iota + COMMIT_OR_PR_TITLE_FULLREPOSITORY_SQUASH_MERGE_COMMIT_TITLE +) + +func (i FullRepository_squash_merge_commit_title) String() string { + return []string{"PR_TITLE", "COMMIT_OR_PR_TITLE"}[i] +} +func ParseFullRepository_squash_merge_commit_title(v string) (any, error) { + result := PR_TITLE_FULLREPOSITORY_SQUASH_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_FULLREPOSITORY_SQUASH_MERGE_COMMIT_TITLE + case "COMMIT_OR_PR_TITLE": + result = COMMIT_OR_PR_TITLE_FULLREPOSITORY_SQUASH_MERGE_COMMIT_TITLE + default: + return 0, errors.New("Unknown FullRepository_squash_merge_commit_title value: " + v) + } + return &result, nil +} +func SerializeFullRepository_squash_merge_commit_title(values []FullRepository_squash_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i FullRepository_squash_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_comment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_comment.go new file mode 100644 index 000000000..fcefb8ede --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_comment.go @@ -0,0 +1,286 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GistComment a comment made to a gist. +type GistComment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How the author is associated with the repository. + author_association *AuthorAssociation + // The comment text. + body *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The id property + id *int32 + // The node_id property + node_id *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewGistComment instantiates a new GistComment and sets the default values. +func NewGistComment()(*GistComment) { + m := &GistComment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistComment(), 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 *GistComment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *GistComment) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. The comment text. +// returns a *string when successful +func (m *GistComment) GetBody()(*string) { + return m.body +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *GistComment) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *GistComment) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *GistComment) GetNodeId()(*string) { + return m.node_id +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *GistComment) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GistComment) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *GistComment) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *GistComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *GistComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *GistComment) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. The comment text. +func (m *GistComment) SetBody(value *string)() { + m.body = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GistComment) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *GistComment) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *GistComment) SetNodeId(value *string)() { + m.node_id = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *GistComment) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *GistComment) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *GistComment) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type GistCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int32) + GetNodeId()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int32)() + SetNodeId(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_comment403_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_comment403_error.go new file mode 100644 index 000000000..1cdf600c9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_comment403_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistComment403Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The block property + block GistComment403Error_blockable + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewGistComment403Error instantiates a new GistComment403Error and sets the default values. +func NewGistComment403Error()(*GistComment403Error) { + m := &GistComment403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistComment403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistComment403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistComment403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *GistComment403Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *GistComment403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBlock gets the block property value. The block property +// returns a GistComment403Error_blockable when successful +func (m *GistComment403Error) GetBlock()(GistComment403Error_blockable) { + return m.block +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *GistComment403Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistComment403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["block"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistComment403Error_blockFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBlock(val.(GistComment403Error_blockable)) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *GistComment403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *GistComment403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("block", m.GetBlock()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *GistComment403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBlock sets the block property value. The block property +func (m *GistComment403Error) SetBlock(value GistComment403Error_blockable)() { + m.block = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *GistComment403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *GistComment403Error) SetMessage(value *string)() { + m.message = value +} +type GistComment403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBlock()(GistComment403Error_blockable) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetBlock(value GistComment403Error_blockable)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_comment403_error_block.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_comment403_error_block.go new file mode 100644 index 000000000..b90ac2998 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_comment403_error_block.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistComment403Error_block struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *string + // The html_url property + html_url *string + // The reason property + reason *string +} +// NewGistComment403Error_block instantiates a new GistComment403Error_block and sets the default values. +func NewGistComment403Error_block()(*GistComment403Error_block) { + m := &GistComment403Error_block{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistComment403Error_blockFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistComment403Error_blockFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistComment403Error_block(), 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 *GistComment403Error_block) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *GistComment403Error_block) GetCreatedAt()(*string) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistComment403Error_block) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *GistComment403Error_block) GetHtmlUrl()(*string) { + return m.html_url +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *GistComment403Error_block) GetReason()(*string) { + return m.reason +} +// Serialize serializes information the current object +func (m *GistComment403Error_block) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + 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 *GistComment403Error_block) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GistComment403Error_block) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *GistComment403Error_block) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetReason sets the reason property value. The reason property +func (m *GistComment403Error_block) SetReason(value *string)() { + m.reason = value +} +type GistComment403Error_blockable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*string) + GetHtmlUrl()(*string) + GetReason()(*string) + SetCreatedAt(value *string)() + SetHtmlUrl(value *string)() + SetReason(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_commit.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_commit.go new file mode 100644 index 000000000..3f92d6415 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_commit.go @@ -0,0 +1,198 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GistCommit gist Commit +type GistCommit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The change_status property + change_status GistCommit_change_statusable + // The committed_at property + committed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable + // The version property + version *string +} +// NewGistCommit instantiates a new GistCommit and sets the default values. +func NewGistCommit()(*GistCommit) { + m := &GistCommit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistCommitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistCommitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistCommit(), 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 *GistCommit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChangeStatus gets the change_status property value. The change_status property +// returns a GistCommit_change_statusable when successful +func (m *GistCommit) GetChangeStatus()(GistCommit_change_statusable) { + return m.change_status +} +// GetCommittedAt gets the committed_at property value. The committed_at property +// returns a *Time when successful +func (m *GistCommit) GetCommittedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.committed_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistCommit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["change_status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistCommit_change_statusFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetChangeStatus(val.(GistCommit_change_statusable)) + } + return nil + } + res["committed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCommittedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + res["version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + return res +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GistCommit) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *GistCommit) GetUser()(NullableSimpleUserable) { + return m.user +} +// GetVersion gets the version property value. The version property +// returns a *string when successful +func (m *GistCommit) GetVersion()(*string) { + return m.version +} +// Serialize serializes information the current object +func (m *GistCommit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("change_status", m.GetChangeStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("committed_at", m.GetCommittedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("version", m.GetVersion()) + 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 *GistCommit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChangeStatus sets the change_status property value. The change_status property +func (m *GistCommit) SetChangeStatus(value GistCommit_change_statusable)() { + m.change_status = value +} +// SetCommittedAt sets the committed_at property value. The committed_at property +func (m *GistCommit) SetCommittedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.committed_at = value +} +// SetUrl sets the url property value. The url property +func (m *GistCommit) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *GistCommit) SetUser(value NullableSimpleUserable)() { + m.user = value +} +// SetVersion sets the version property value. The version property +func (m *GistCommit) SetVersion(value *string)() { + m.version = value +} +type GistCommitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChangeStatus()(GistCommit_change_statusable) + GetCommittedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + GetVersion()(*string) + SetChangeStatus(value GistCommit_change_statusable)() + SetCommittedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() + SetVersion(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_commit_change_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_commit_change_status.go new file mode 100644 index 000000000..356c9de32 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_commit_change_status.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistCommit_change_status struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The additions property + additions *int32 + // The deletions property + deletions *int32 + // The total property + total *int32 +} +// NewGistCommit_change_status instantiates a new GistCommit_change_status and sets the default values. +func NewGistCommit_change_status()(*GistCommit_change_status) { + m := &GistCommit_change_status{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistCommit_change_statusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistCommit_change_statusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistCommit_change_status(), 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 *GistCommit_change_status) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdditions gets the additions property value. The additions property +// returns a *int32 when successful +func (m *GistCommit_change_status) GetAdditions()(*int32) { + return m.additions +} +// GetDeletions gets the deletions property value. The deletions property +// returns a *int32 when successful +func (m *GistCommit_change_status) GetDeletions()(*int32) { + return m.deletions +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistCommit_change_status) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["additions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAdditions(val) + } + return nil + } + res["deletions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDeletions(val) + } + return nil + } + res["total"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotal(val) + } + return nil + } + return res +} +// GetTotal gets the total property value. The total property +// returns a *int32 when successful +func (m *GistCommit_change_status) GetTotal()(*int32) { + return m.total +} +// Serialize serializes information the current object +func (m *GistCommit_change_status) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("additions", m.GetAdditions()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("deletions", m.GetDeletions()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total", m.GetTotal()) + 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 *GistCommit_change_status) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdditions sets the additions property value. The additions property +func (m *GistCommit_change_status) SetAdditions(value *int32)() { + m.additions = value +} +// SetDeletions sets the deletions property value. The deletions property +func (m *GistCommit_change_status) SetDeletions(value *int32)() { + m.deletions = value +} +// SetTotal sets the total property value. The total property +func (m *GistCommit_change_status) SetTotal(value *int32)() { + m.total = value +} +type GistCommit_change_statusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdditions()(*int32) + GetDeletions()(*int32) + GetTotal()(*int32) + SetAdditions(value *int32)() + SetDeletions(value *int32)() + SetTotal(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_history.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_history.go new file mode 100644 index 000000000..1c1afaf87 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_history.go @@ -0,0 +1,198 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GistHistory gist History +type GistHistory struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The change_status property + change_status GistHistory_change_statusable + // The committed_at property + committed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable + // The version property + version *string +} +// NewGistHistory instantiates a new GistHistory and sets the default values. +func NewGistHistory()(*GistHistory) { + m := &GistHistory{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistHistoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistHistoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistHistory(), 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 *GistHistory) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChangeStatus gets the change_status property value. The change_status property +// returns a GistHistory_change_statusable when successful +func (m *GistHistory) GetChangeStatus()(GistHistory_change_statusable) { + return m.change_status +} +// GetCommittedAt gets the committed_at property value. The committed_at property +// returns a *Time when successful +func (m *GistHistory) GetCommittedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.committed_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistHistory) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["change_status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistHistory_change_statusFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetChangeStatus(val.(GistHistory_change_statusable)) + } + return nil + } + res["committed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCommittedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + res["version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + return res +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GistHistory) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *GistHistory) GetUser()(NullableSimpleUserable) { + return m.user +} +// GetVersion gets the version property value. The version property +// returns a *string when successful +func (m *GistHistory) GetVersion()(*string) { + return m.version +} +// Serialize serializes information the current object +func (m *GistHistory) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("change_status", m.GetChangeStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("committed_at", m.GetCommittedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("version", m.GetVersion()) + 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 *GistHistory) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChangeStatus sets the change_status property value. The change_status property +func (m *GistHistory) SetChangeStatus(value GistHistory_change_statusable)() { + m.change_status = value +} +// SetCommittedAt sets the committed_at property value. The committed_at property +func (m *GistHistory) SetCommittedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.committed_at = value +} +// SetUrl sets the url property value. The url property +func (m *GistHistory) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *GistHistory) SetUser(value NullableSimpleUserable)() { + m.user = value +} +// SetVersion sets the version property value. The version property +func (m *GistHistory) SetVersion(value *string)() { + m.version = value +} +type GistHistoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChangeStatus()(GistHistory_change_statusable) + GetCommittedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + GetVersion()(*string) + SetChangeStatus(value GistHistory_change_statusable)() + SetCommittedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() + SetVersion(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_history_change_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_history_change_status.go new file mode 100644 index 000000000..6217ceb8e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_history_change_status.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistHistory_change_status struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The additions property + additions *int32 + // The deletions property + deletions *int32 + // The total property + total *int32 +} +// NewGistHistory_change_status instantiates a new GistHistory_change_status and sets the default values. +func NewGistHistory_change_status()(*GistHistory_change_status) { + m := &GistHistory_change_status{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistHistory_change_statusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistHistory_change_statusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistHistory_change_status(), 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 *GistHistory_change_status) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdditions gets the additions property value. The additions property +// returns a *int32 when successful +func (m *GistHistory_change_status) GetAdditions()(*int32) { + return m.additions +} +// GetDeletions gets the deletions property value. The deletions property +// returns a *int32 when successful +func (m *GistHistory_change_status) GetDeletions()(*int32) { + return m.deletions +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistHistory_change_status) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["additions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAdditions(val) + } + return nil + } + res["deletions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDeletions(val) + } + return nil + } + res["total"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotal(val) + } + return nil + } + return res +} +// GetTotal gets the total property value. The total property +// returns a *int32 when successful +func (m *GistHistory_change_status) GetTotal()(*int32) { + return m.total +} +// Serialize serializes information the current object +func (m *GistHistory_change_status) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("additions", m.GetAdditions()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("deletions", m.GetDeletions()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total", m.GetTotal()) + 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 *GistHistory_change_status) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdditions sets the additions property value. The additions property +func (m *GistHistory_change_status) SetAdditions(value *int32)() { + m.additions = value +} +// SetDeletions sets the deletions property value. The deletions property +func (m *GistHistory_change_status) SetDeletions(value *int32)() { + m.deletions = value +} +// SetTotal sets the total property value. The total property +func (m *GistHistory_change_status) SetTotal(value *int32)() { + m.total = value +} +type GistHistory_change_statusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdditions()(*int32) + GetDeletions()(*int32) + GetTotal()(*int32) + SetAdditions(value *int32)() + SetDeletions(value *int32)() + SetTotal(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple.go new file mode 100644 index 000000000..a6d9d0461 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple.go @@ -0,0 +1,691 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GistSimple gist Simple +type GistSimple struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The comments property + comments *int32 + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The created_at property + created_at *string + // The description property + description *string + // The files property + files GistSimple_filesable + // Gist + fork_of GistSimple_fork_ofable + // The forks property + // Deprecated: + forks []GistSimple_forksable + // 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 + // Deprecated: + history []GistHistoryable + // The html_url property + html_url *string + // The id property + id *string + // The node_id property + node_id *string + // A GitHub user. + owner SimpleUserable + // The public property + public *bool + // The truncated property + truncated *bool + // The updated_at property + updated_at *string + // The url property + url *string + // The user property + user *string +} +// NewGistSimple instantiates a new GistSimple and sets the default values. +func NewGistSimple()(*GistSimple) { + m := &GistSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistSimple(), 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 *GistSimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComments gets the comments property value. The comments property +// returns a *int32 when successful +func (m *GistSimple) GetComments()(*int32) { + return m.comments +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *GistSimple) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *GistSimple) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *GistSimple) GetCreatedAt()(*string) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *GistSimple) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetComments(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistSimple_filesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetFiles(val.(GistSimple_filesable)) + } + return nil + } + res["fork_of"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistSimple_fork_ofFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetForkOf(val.(GistSimple_fork_ofable)) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGistSimple_forksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GistSimple_forksable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GistSimple_forksable) + } + } + m.SetForks(res) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["git_pull_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitPullUrl(val) + } + return nil + } + res["git_push_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitPushUrl(val) + } + return nil + } + res["history"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGistHistoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GistHistoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GistHistoryable) + } + } + m.SetHistory(res) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["public"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPublic(val) + } + return nil + } + res["truncated"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTruncated(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUser(val) + } + return nil + } + return res +} +// GetFiles gets the files property value. The files property +// returns a GistSimple_filesable when successful +func (m *GistSimple) GetFiles()(GistSimple_filesable) { + return m.files +} +// GetForkOf gets the fork_of property value. Gist +// returns a GistSimple_fork_ofable when successful +func (m *GistSimple) GetForkOf()(GistSimple_fork_ofable) { + return m.fork_of +} +// GetForks gets the forks property value. The forks property +// Deprecated: +// returns a []GistSimple_forksable when successful +func (m *GistSimple) GetForks()([]GistSimple_forksable) { + return m.forks +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *GistSimple) GetForksUrl()(*string) { + return m.forks_url +} +// GetGitPullUrl gets the git_pull_url property value. The git_pull_url property +// returns a *string when successful +func (m *GistSimple) GetGitPullUrl()(*string) { + return m.git_pull_url +} +// GetGitPushUrl gets the git_push_url property value. The git_push_url property +// returns a *string when successful +func (m *GistSimple) GetGitPushUrl()(*string) { + return m.git_push_url +} +// GetHistory gets the history property value. The history property +// Deprecated: +// returns a []GistHistoryable when successful +func (m *GistSimple) GetHistory()([]GistHistoryable) { + return m.history +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *GistSimple) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *string when successful +func (m *GistSimple) GetId()(*string) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *GistSimple) GetNodeId()(*string) { + return m.node_id +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *GistSimple) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPublic gets the public property value. The public property +// returns a *bool when successful +func (m *GistSimple) GetPublic()(*bool) { + return m.public +} +// GetTruncated gets the truncated property value. The truncated property +// returns a *bool when successful +func (m *GistSimple) GetTruncated()(*bool) { + return m.truncated +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *string when successful +func (m *GistSimple) GetUpdatedAt()(*string) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GistSimple) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. The user property +// returns a *string when successful +func (m *GistSimple) GetUser()(*string) { + return m.user +} +// Serialize serializes information the current object +func (m *GistSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("files", m.GetFiles()) + if err != nil { + return err + } + } + if m.GetForks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetForks())) + for i, v := range m.GetForks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("forks", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("fork_of", m.GetForkOf()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_pull_url", m.GetGitPullUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_push_url", m.GetGitPushUrl()) + if err != nil { + return err + } + } + if m.GetHistory() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetHistory())) + for i, v := range m.GetHistory() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("history", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("public", m.GetPublic()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("truncated", m.GetTruncated()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user", m.GetUser()) + 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 *GistSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComments sets the comments property value. The comments property +func (m *GistSimple) SetComments(value *int32)() { + m.comments = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *GistSimple) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *GistSimple) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GistSimple) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *GistSimple) SetDescription(value *string)() { + m.description = value +} +// SetFiles sets the files property value. The files property +func (m *GistSimple) SetFiles(value GistSimple_filesable)() { + m.files = value +} +// SetForkOf sets the fork_of property value. Gist +func (m *GistSimple) SetForkOf(value GistSimple_fork_ofable)() { + m.fork_of = value +} +// SetForks sets the forks property value. The forks property +// Deprecated: +func (m *GistSimple) SetForks(value []GistSimple_forksable)() { + m.forks = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *GistSimple) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetGitPullUrl sets the git_pull_url property value. The git_pull_url property +func (m *GistSimple) SetGitPullUrl(value *string)() { + m.git_pull_url = value +} +// SetGitPushUrl sets the git_push_url property value. The git_push_url property +func (m *GistSimple) SetGitPushUrl(value *string)() { + m.git_push_url = value +} +// SetHistory sets the history property value. The history property +// Deprecated: +func (m *GistSimple) SetHistory(value []GistHistoryable)() { + m.history = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *GistSimple) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *GistSimple) SetId(value *string)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *GistSimple) SetNodeId(value *string)() { + m.node_id = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *GistSimple) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPublic sets the public property value. The public property +func (m *GistSimple) SetPublic(value *bool)() { + m.public = value +} +// SetTruncated sets the truncated property value. The truncated property +func (m *GistSimple) SetTruncated(value *bool)() { + m.truncated = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *GistSimple) SetUpdatedAt(value *string)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *GistSimple) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. The user property +func (m *GistSimple) SetUser(value *string)() { + m.user = value +} +type GistSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComments()(*int32) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCreatedAt()(*string) + GetDescription()(*string) + GetFiles()(GistSimple_filesable) + GetForkOf()(GistSimple_fork_ofable) + GetForks()([]GistSimple_forksable) + GetForksUrl()(*string) + GetGitPullUrl()(*string) + GetGitPushUrl()(*string) + GetHistory()([]GistHistoryable) + GetHtmlUrl()(*string) + GetId()(*string) + GetNodeId()(*string) + GetOwner()(SimpleUserable) + GetPublic()(*bool) + GetTruncated()(*bool) + GetUpdatedAt()(*string) + GetUrl()(*string) + GetUser()(*string) + SetComments(value *int32)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCreatedAt(value *string)() + SetDescription(value *string)() + SetFiles(value GistSimple_filesable)() + SetForkOf(value GistSimple_fork_ofable)() + SetForks(value []GistSimple_forksable)() + SetForksUrl(value *string)() + SetGitPullUrl(value *string)() + SetGitPushUrl(value *string)() + SetHistory(value []GistHistoryable)() + SetHtmlUrl(value *string)() + SetId(value *string)() + SetNodeId(value *string)() + SetOwner(value SimpleUserable)() + SetPublic(value *bool)() + SetTruncated(value *bool)() + SetUpdatedAt(value *string)() + SetUrl(value *string)() + SetUser(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple403_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple403_error.go new file mode 100644 index 000000000..fa0e1758e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple403_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistSimple403Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The block property + block GistSimple403Error_blockable + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewGistSimple403Error instantiates a new GistSimple403Error and sets the default values. +func NewGistSimple403Error()(*GistSimple403Error) { + m := &GistSimple403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistSimple403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistSimple403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistSimple403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *GistSimple403Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *GistSimple403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBlock gets the block property value. The block property +// returns a GistSimple403Error_blockable when successful +func (m *GistSimple403Error) GetBlock()(GistSimple403Error_blockable) { + return m.block +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *GistSimple403Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistSimple403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["block"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistSimple403Error_blockFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBlock(val.(GistSimple403Error_blockable)) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *GistSimple403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *GistSimple403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("block", m.GetBlock()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *GistSimple403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBlock sets the block property value. The block property +func (m *GistSimple403Error) SetBlock(value GistSimple403Error_blockable)() { + m.block = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *GistSimple403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *GistSimple403Error) SetMessage(value *string)() { + m.message = value +} +type GistSimple403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBlock()(GistSimple403Error_blockable) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetBlock(value GistSimple403Error_blockable)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple403_error_block.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple403_error_block.go new file mode 100644 index 000000000..b5a16f2c6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple403_error_block.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistSimple403Error_block struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *string + // The html_url property + html_url *string + // The reason property + reason *string +} +// NewGistSimple403Error_block instantiates a new GistSimple403Error_block and sets the default values. +func NewGistSimple403Error_block()(*GistSimple403Error_block) { + m := &GistSimple403Error_block{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistSimple403Error_blockFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistSimple403Error_blockFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistSimple403Error_block(), 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 *GistSimple403Error_block) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *GistSimple403Error_block) GetCreatedAt()(*string) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistSimple403Error_block) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *GistSimple403Error_block) GetHtmlUrl()(*string) { + return m.html_url +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *GistSimple403Error_block) GetReason()(*string) { + return m.reason +} +// Serialize serializes information the current object +func (m *GistSimple403Error_block) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + 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 *GistSimple403Error_block) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GistSimple403Error_block) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *GistSimple403Error_block) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetReason sets the reason property value. The reason property +func (m *GistSimple403Error_block) SetReason(value *string)() { + m.reason = value +} +type GistSimple403Error_blockable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*string) + GetHtmlUrl()(*string) + GetReason()(*string) + SetCreatedAt(value *string)() + SetHtmlUrl(value *string)() + SetReason(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple_files.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple_files.go new file mode 100644 index 000000000..aff8eb1b9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple_files.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistSimple_files struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewGistSimple_files instantiates a new GistSimple_files and sets the default values. +func NewGistSimple_files()(*GistSimple_files) { + m := &GistSimple_files{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistSimple_filesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistSimple_filesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistSimple_files(), 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 *GistSimple_files) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistSimple_files) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *GistSimple_files) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *GistSimple_files) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type GistSimple_filesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple_fork_of.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple_fork_of.go new file mode 100644 index 000000000..2971159b2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple_fork_of.go @@ -0,0 +1,633 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GistSimple_fork_of gist +type GistSimple_fork_of struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The comments property + comments *int32 + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The description property + 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 + id *string + // The node_id property + node_id *string + // A GitHub user. + owner NullableSimpleUserable + // The public property + public *bool + // The truncated property + truncated *bool + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewGistSimple_fork_of instantiates a new GistSimple_fork_of and sets the default values. +func NewGistSimple_fork_of()(*GistSimple_fork_of) { + m := &GistSimple_fork_of{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistSimple_fork_ofFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistSimple_fork_ofFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistSimple_fork_of(), 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 *GistSimple_fork_of) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComments gets the comments property value. The comments property +// returns a *int32 when successful +func (m *GistSimple_fork_of) GetComments()(*int32) { + return m.comments +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *GistSimple_fork_of) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *GistSimple_fork_of) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *GistSimple_fork_of) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *GistSimple_fork_of) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistSimple_fork_of) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetComments(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistSimple_fork_of_filesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetFiles(val.(GistSimple_fork_of_filesable)) + } + 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 { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["git_pull_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitPullUrl(val) + } + return nil + } + res["git_push_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitPushUrl(val) + } + 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 { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(NullableSimpleUserable)) + } + return nil + } + res["public"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPublic(val) + } + return nil + } + res["truncated"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTruncated(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetFiles gets the files property value. The files property +// returns a GistSimple_fork_of_filesable when successful +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) { + return m.forks_url +} +// GetGitPullUrl gets the git_pull_url property value. The git_pull_url property +// returns a *string when successful +func (m *GistSimple_fork_of) GetGitPullUrl()(*string) { + return m.git_pull_url +} +// GetGitPushUrl gets the git_push_url property value. The git_push_url property +// returns a *string when successful +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) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *string when successful +func (m *GistSimple_fork_of) GetId()(*string) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *GistSimple_fork_of) GetNodeId()(*string) { + return m.node_id +} +// GetOwner gets the owner property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *GistSimple_fork_of) GetOwner()(NullableSimpleUserable) { + return m.owner +} +// GetPublic gets the public property value. The public property +// returns a *bool when successful +func (m *GistSimple_fork_of) GetPublic()(*bool) { + return m.public +} +// GetTruncated gets the truncated property value. The truncated property +// returns a *bool when successful +func (m *GistSimple_fork_of) GetTruncated()(*bool) { + return m.truncated +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *GistSimple_fork_of) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GistSimple_fork_of) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *GistSimple_fork_of) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *GistSimple_fork_of) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("files", m.GetFiles()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_pull_url", m.GetGitPullUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_push_url", m.GetGitPushUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("history", m.GetHistory()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("public", m.GetPublic()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("truncated", m.GetTruncated()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *GistSimple_fork_of) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComments sets the comments property value. The comments property +func (m *GistSimple_fork_of) SetComments(value *int32)() { + m.comments = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *GistSimple_fork_of) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *GistSimple_fork_of) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GistSimple_fork_of) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *GistSimple_fork_of) SetDescription(value *string)() { + m.description = value +} +// SetFiles sets the files property value. The files property +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 +} +// SetGitPullUrl sets the git_pull_url property value. The git_pull_url property +func (m *GistSimple_fork_of) SetGitPullUrl(value *string)() { + m.git_pull_url = value +} +// SetGitPushUrl sets the git_push_url property value. The git_push_url property +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 +} +// SetId sets the id property value. The id property +func (m *GistSimple_fork_of) SetId(value *string)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *GistSimple_fork_of) SetNodeId(value *string)() { + m.node_id = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *GistSimple_fork_of) SetOwner(value NullableSimpleUserable)() { + m.owner = value +} +// SetPublic sets the public property value. The public property +func (m *GistSimple_fork_of) SetPublic(value *bool)() { + m.public = value +} +// SetTruncated sets the truncated property value. The truncated property +func (m *GistSimple_fork_of) SetTruncated(value *bool)() { + m.truncated = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *GistSimple_fork_of) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *GistSimple_fork_of) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *GistSimple_fork_of) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type GistSimple_fork_ofable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComments()(*int32) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + 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) + GetOwner()(NullableSimpleUserable) + GetPublic()(*bool) + GetTruncated()(*bool) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetComments(value *int32)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + 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)() + SetOwner(value NullableSimpleUserable)() + SetPublic(value *bool)() + SetTruncated(value *bool)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple_fork_of_files.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple_fork_of_files.go new file mode 100644 index 000000000..9c4e85872 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple_fork_of_files.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistSimple_fork_of_files struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewGistSimple_fork_of_files instantiates a new GistSimple_fork_of_files and sets the default values. +func NewGistSimple_fork_of_files()(*GistSimple_fork_of_files) { + m := &GistSimple_fork_of_files{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistSimple_fork_of_filesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistSimple_fork_of_filesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistSimple_fork_of_files(), 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 *GistSimple_fork_of_files) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistSimple_fork_of_files) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *GistSimple_fork_of_files) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *GistSimple_fork_of_files) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type GistSimple_fork_of_filesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple_forks.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple_forks.go new file mode 100644 index 000000000..7f07a35d4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gist_simple_forks.go @@ -0,0 +1,197 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistSimple_forks struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The id property + id *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // Public User + user PublicUserable +} +// NewGistSimple_forks instantiates a new GistSimple_forks and sets the default values. +func NewGistSimple_forks()(*GistSimple_forks) { + m := &GistSimple_forks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistSimple_forksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistSimple_forksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistSimple_forks(), 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 *GistSimple_forks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *GistSimple_forks) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistSimple_forks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePublicUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(PublicUserable)) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *string when successful +func (m *GistSimple_forks) GetId()(*string) { + return m.id +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *GistSimple_forks) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GistSimple_forks) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. Public User +// returns a PublicUserable when successful +func (m *GistSimple_forks) GetUser()(PublicUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *GistSimple_forks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *GistSimple_forks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GistSimple_forks) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *GistSimple_forks) SetId(value *string)() { + m.id = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *GistSimple_forks) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *GistSimple_forks) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. Public User +func (m *GistSimple_forks) SetUser(value PublicUserable)() { + m.user = value +} +type GistSimple_forksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(PublicUserable) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value PublicUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit.go new file mode 100644 index 000000000..47e882582 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit.go @@ -0,0 +1,354 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GitCommit low-level Git commit operations within a repository +type GitCommit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Identifying information for the git-user + author GitCommit_authorable + // Identifying information for the git-user + committer GitCommit_committerable + // The html_url property + html_url *string + // Message describing the purpose of the commit + message *string + // The node_id property + node_id *string + // The parents property + parents []GitCommit_parentsable + // SHA for the commit + sha *string + // The tree property + tree GitCommit_treeable + // The url property + url *string + // The verification property + verification GitCommit_verificationable +} +// NewGitCommit instantiates a new GitCommit and sets the default values. +func NewGitCommit()(*GitCommit) { + m := &GitCommit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitCommitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitCommitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitCommit(), 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 *GitCommit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. Identifying information for the git-user +// returns a GitCommit_authorable when successful +func (m *GitCommit) GetAuthor()(GitCommit_authorable) { + return m.author +} +// GetCommitter gets the committer property value. Identifying information for the git-user +// returns a GitCommit_committerable when successful +func (m *GitCommit) GetCommitter()(GitCommit_committerable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitCommit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGitCommit_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(GitCommit_authorable)) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGitCommit_committerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(GitCommit_committerable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["parents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGitCommit_parentsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GitCommit_parentsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GitCommit_parentsable) + } + } + m.SetParents(res) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGitCommit_treeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTree(val.(GitCommit_treeable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["verification"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGitCommit_verificationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerification(val.(GitCommit_verificationable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *GitCommit) GetHtmlUrl()(*string) { + return m.html_url +} +// GetMessage gets the message property value. Message describing the purpose of the commit +// returns a *string when successful +func (m *GitCommit) GetMessage()(*string) { + return m.message +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *GitCommit) GetNodeId()(*string) { + return m.node_id +} +// GetParents gets the parents property value. The parents property +// returns a []GitCommit_parentsable when successful +func (m *GitCommit) GetParents()([]GitCommit_parentsable) { + return m.parents +} +// GetSha gets the sha property value. SHA for the commit +// returns a *string when successful +func (m *GitCommit) GetSha()(*string) { + return m.sha +} +// GetTree gets the tree property value. The tree property +// returns a GitCommit_treeable when successful +func (m *GitCommit) GetTree()(GitCommit_treeable) { + return m.tree +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GitCommit) GetUrl()(*string) { + return m.url +} +// GetVerification gets the verification property value. The verification property +// returns a GitCommit_verificationable when successful +func (m *GitCommit) GetVerification()(GitCommit_verificationable) { + return m.verification +} +// Serialize serializes information the current object +func (m *GitCommit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetParents() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetParents())) + for i, v := range m.GetParents() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("parents", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tree", m.GetTree()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("verification", m.GetVerification()) + 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 *GitCommit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. Identifying information for the git-user +func (m *GitCommit) SetAuthor(value GitCommit_authorable)() { + m.author = value +} +// SetCommitter sets the committer property value. Identifying information for the git-user +func (m *GitCommit) SetCommitter(value GitCommit_committerable)() { + m.committer = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *GitCommit) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetMessage sets the message property value. Message describing the purpose of the commit +func (m *GitCommit) SetMessage(value *string)() { + m.message = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *GitCommit) SetNodeId(value *string)() { + m.node_id = value +} +// SetParents sets the parents property value. The parents property +func (m *GitCommit) SetParents(value []GitCommit_parentsable)() { + m.parents = value +} +// SetSha sets the sha property value. SHA for the commit +func (m *GitCommit) SetSha(value *string)() { + m.sha = value +} +// SetTree sets the tree property value. The tree property +func (m *GitCommit) SetTree(value GitCommit_treeable)() { + m.tree = value +} +// SetUrl sets the url property value. The url property +func (m *GitCommit) SetUrl(value *string)() { + m.url = value +} +// SetVerification sets the verification property value. The verification property +func (m *GitCommit) SetVerification(value GitCommit_verificationable)() { + m.verification = value +} +type GitCommitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(GitCommit_authorable) + GetCommitter()(GitCommit_committerable) + GetHtmlUrl()(*string) + GetMessage()(*string) + GetNodeId()(*string) + GetParents()([]GitCommit_parentsable) + GetSha()(*string) + GetTree()(GitCommit_treeable) + GetUrl()(*string) + GetVerification()(GitCommit_verificationable) + SetAuthor(value GitCommit_authorable)() + SetCommitter(value GitCommit_committerable)() + SetHtmlUrl(value *string)() + SetMessage(value *string)() + SetNodeId(value *string)() + SetParents(value []GitCommit_parentsable)() + SetSha(value *string)() + SetTree(value GitCommit_treeable)() + SetUrl(value *string)() + SetVerification(value GitCommit_verificationable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit_author.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit_author.go new file mode 100644 index 000000000..c385face9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit_author.go @@ -0,0 +1,140 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GitCommit_author identifying information for the git-user +type GitCommit_author struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Timestamp of the commit + date *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Git email address of the user + email *string + // Name of the git user + name *string +} +// NewGitCommit_author instantiates a new GitCommit_author and sets the default values. +func NewGitCommit_author()(*GitCommit_author) { + m := &GitCommit_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitCommit_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitCommit_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitCommit_author(), 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 *GitCommit_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. Timestamp of the commit +// returns a *Time when successful +func (m *GitCommit_author) GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.date +} +// GetEmail gets the email property value. Git email address of the user +// returns a *string when successful +func (m *GitCommit_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitCommit_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. Name of the git user +// returns a *string when successful +func (m *GitCommit_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *GitCommit_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *GitCommit_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. Timestamp of the commit +func (m *GitCommit_author) SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.date = value +} +// SetEmail sets the email property value. Git email address of the user +func (m *GitCommit_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. Name of the git user +func (m *GitCommit_author) SetName(value *string)() { + m.name = value +} +type GitCommit_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetName()(*string) + SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit_committer.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit_committer.go new file mode 100644 index 000000000..45b9e1416 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit_committer.go @@ -0,0 +1,140 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GitCommit_committer identifying information for the git-user +type GitCommit_committer struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Timestamp of the commit + date *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Git email address of the user + email *string + // Name of the git user + name *string +} +// NewGitCommit_committer instantiates a new GitCommit_committer and sets the default values. +func NewGitCommit_committer()(*GitCommit_committer) { + m := &GitCommit_committer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitCommit_committerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitCommit_committerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitCommit_committer(), 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 *GitCommit_committer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. Timestamp of the commit +// returns a *Time when successful +func (m *GitCommit_committer) GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.date +} +// GetEmail gets the email property value. Git email address of the user +// returns a *string when successful +func (m *GitCommit_committer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitCommit_committer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. Name of the git user +// returns a *string when successful +func (m *GitCommit_committer) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *GitCommit_committer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *GitCommit_committer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. Timestamp of the commit +func (m *GitCommit_committer) SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.date = value +} +// SetEmail sets the email property value. Git email address of the user +func (m *GitCommit_committer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. Name of the git user +func (m *GitCommit_committer) SetName(value *string)() { + m.name = value +} +type GitCommit_committerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetName()(*string) + SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit_parents.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit_parents.go new file mode 100644 index 000000000..f439f62f1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit_parents.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GitCommit_parents struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html_url property + html_url *string + // SHA for the commit + sha *string + // The url property + url *string +} +// NewGitCommit_parents instantiates a new GitCommit_parents and sets the default values. +func NewGitCommit_parents()(*GitCommit_parents) { + m := &GitCommit_parents{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitCommit_parentsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitCommit_parentsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitCommit_parents(), 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 *GitCommit_parents) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitCommit_parents) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *GitCommit_parents) GetHtmlUrl()(*string) { + return m.html_url +} +// GetSha gets the sha property value. SHA for the commit +// returns a *string when successful +func (m *GitCommit_parents) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GitCommit_parents) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GitCommit_parents) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *GitCommit_parents) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *GitCommit_parents) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetSha sets the sha property value. SHA for the commit +func (m *GitCommit_parents) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *GitCommit_parents) SetUrl(value *string)() { + m.url = value +} +type GitCommit_parentsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetSha()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit_tree.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit_tree.go new file mode 100644 index 000000000..6c2fb88b8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit_tree.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GitCommit_tree 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 for the commit + sha *string + // The url property + url *string +} +// NewGitCommit_tree instantiates a new GitCommit_tree and sets the default values. +func NewGitCommit_tree()(*GitCommit_tree) { + m := &GitCommit_tree{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitCommit_treeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitCommit_treeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitCommit_tree(), 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 *GitCommit_tree) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitCommit_tree) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. SHA for the commit +// returns a *string when successful +func (m *GitCommit_tree) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GitCommit_tree) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GitCommit_tree) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *GitCommit_tree) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. SHA for the commit +func (m *GitCommit_tree) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *GitCommit_tree) SetUrl(value *string)() { + m.url = value +} +type GitCommit_treeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit_verification.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit_verification.go new file mode 100644 index 000000000..aa5557412 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_commit_verification.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GitCommit_verification struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The payload property + payload *string + // The reason property + reason *string + // The signature property + signature *string + // The verified property + verified *bool +} +// NewGitCommit_verification instantiates a new GitCommit_verification and sets the default values. +func NewGitCommit_verification()(*GitCommit_verification) { + m := &GitCommit_verification{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitCommit_verificationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitCommit_verificationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitCommit_verification(), 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 *GitCommit_verification) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitCommit_verification) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPayload(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["signature"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSignature(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + return res +} +// GetPayload gets the payload property value. The payload property +// returns a *string when successful +func (m *GitCommit_verification) GetPayload()(*string) { + return m.payload +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *GitCommit_verification) GetReason()(*string) { + return m.reason +} +// GetSignature gets the signature property value. The signature property +// returns a *string when successful +func (m *GitCommit_verification) GetSignature()(*string) { + return m.signature +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *GitCommit_verification) GetVerified()(*bool) { + return m.verified +} +// Serialize serializes information the current object +func (m *GitCommit_verification) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("payload", m.GetPayload()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("signature", m.GetSignature()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + 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 *GitCommit_verification) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPayload sets the payload property value. The payload property +func (m *GitCommit_verification) SetPayload(value *string)() { + m.payload = value +} +// SetReason sets the reason property value. The reason property +func (m *GitCommit_verification) SetReason(value *string)() { + m.reason = value +} +// SetSignature sets the signature property value. The signature property +func (m *GitCommit_verification) SetSignature(value *string)() { + m.signature = value +} +// SetVerified sets the verified property value. The verified property +func (m *GitCommit_verification) SetVerified(value *bool)() { + m.verified = value +} +type GitCommit_verificationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPayload()(*string) + GetReason()(*string) + GetSignature()(*string) + GetVerified()(*bool) + SetPayload(value *string)() + SetReason(value *string)() + SetSignature(value *string)() + SetVerified(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/git_ref.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_ref.go new file mode 100644 index 000000000..c99f171a9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_ref.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GitRef git references within a repository +type GitRef struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The node_id property + node_id *string + // The object property + object GitRef_objectable + // The ref property + ref *string + // The url property + url *string +} +// NewGitRef instantiates a new GitRef and sets the default values. +func NewGitRef()(*GitRef) { + m := &GitRef{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitRefFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitRefFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitRef(), 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 *GitRef) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitRef) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["object"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGitRef_objectFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetObject(val.(GitRef_objectable)) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *GitRef) GetNodeId()(*string) { + return m.node_id +} +// GetObject gets the object property value. The object property +// returns a GitRef_objectable when successful +func (m *GitRef) GetObject()(GitRef_objectable) { + return m.object +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *GitRef) GetRef()(*string) { + return m.ref +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GitRef) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GitRef) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("object", m.GetObject()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *GitRef) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *GitRef) SetNodeId(value *string)() { + m.node_id = value +} +// SetObject sets the object property value. The object property +func (m *GitRef) SetObject(value GitRef_objectable)() { + m.object = value +} +// SetRef sets the ref property value. The ref property +func (m *GitRef) SetRef(value *string)() { + m.ref = value +} +// SetUrl sets the url property value. The url property +func (m *GitRef) SetUrl(value *string)() { + m.url = value +} +type GitRefable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNodeId()(*string) + GetObject()(GitRef_objectable) + GetRef()(*string) + GetUrl()(*string) + SetNodeId(value *string)() + SetObject(value GitRef_objectable)() + SetRef(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/git_ref_object.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_ref_object.go new file mode 100644 index 000000000..594d4e896 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_ref_object.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GitRef_object 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 for the reference + sha *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewGitRef_object instantiates a new GitRef_object and sets the default values. +func NewGitRef_object()(*GitRef_object) { + m := &GitRef_object{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitRef_objectFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitRef_objectFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitRef_object(), 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 *GitRef_object) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitRef_object) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. SHA for the reference +// returns a *string when successful +func (m *GitRef_object) GetSha()(*string) { + return m.sha +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *GitRef_object) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GitRef_object) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GitRef_object) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *GitRef_object) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. SHA for the reference +func (m *GitRef_object) SetSha(value *string)() { + m.sha = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *GitRef_object) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *GitRef_object) SetUrl(value *string)() { + m.url = value +} +type GitRef_objectable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/git_tag.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_tag.go new file mode 100644 index 000000000..1a3d31c4c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_tag.go @@ -0,0 +1,284 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GitTag metadata for a Git tag +type GitTag struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Message describing the purpose of the tag + message *string + // The node_id property + node_id *string + // The object property + object GitTag_objectable + // The sha property + sha *string + // Name of the tag + tag *string + // The tagger property + tagger GitTag_taggerable + // URL for the tag + url *string + // The verification property + verification Verificationable +} +// NewGitTag instantiates a new GitTag and sets the default values. +func NewGitTag()(*GitTag) { + m := &GitTag{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitTagFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitTagFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitTag(), 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 *GitTag) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitTag) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["object"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGitTag_objectFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetObject(val.(GitTag_objectable)) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["tag"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTag(val) + } + return nil + } + res["tagger"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGitTag_taggerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTagger(val.(GitTag_taggerable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["verification"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateVerificationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerification(val.(Verificationable)) + } + return nil + } + return res +} +// GetMessage gets the message property value. Message describing the purpose of the tag +// returns a *string when successful +func (m *GitTag) GetMessage()(*string) { + return m.message +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *GitTag) GetNodeId()(*string) { + return m.node_id +} +// GetObject gets the object property value. The object property +// returns a GitTag_objectable when successful +func (m *GitTag) GetObject()(GitTag_objectable) { + return m.object +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *GitTag) GetSha()(*string) { + return m.sha +} +// GetTag gets the tag property value. Name of the tag +// returns a *string when successful +func (m *GitTag) GetTag()(*string) { + return m.tag +} +// GetTagger gets the tagger property value. The tagger property +// returns a GitTag_taggerable when successful +func (m *GitTag) GetTagger()(GitTag_taggerable) { + return m.tagger +} +// GetUrl gets the url property value. URL for the tag +// returns a *string when successful +func (m *GitTag) GetUrl()(*string) { + return m.url +} +// GetVerification gets the verification property value. The verification property +// returns a Verificationable when successful +func (m *GitTag) GetVerification()(Verificationable) { + return m.verification +} +// Serialize serializes information the current object +func (m *GitTag) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("object", m.GetObject()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tag", m.GetTag()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tagger", m.GetTagger()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("verification", m.GetVerification()) + 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 *GitTag) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. Message describing the purpose of the tag +func (m *GitTag) SetMessage(value *string)() { + m.message = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *GitTag) SetNodeId(value *string)() { + m.node_id = value +} +// SetObject sets the object property value. The object property +func (m *GitTag) SetObject(value GitTag_objectable)() { + m.object = value +} +// SetSha sets the sha property value. The sha property +func (m *GitTag) SetSha(value *string)() { + m.sha = value +} +// SetTag sets the tag property value. Name of the tag +func (m *GitTag) SetTag(value *string)() { + m.tag = value +} +// SetTagger sets the tagger property value. The tagger property +func (m *GitTag) SetTagger(value GitTag_taggerable)() { + m.tagger = value +} +// SetUrl sets the url property value. URL for the tag +func (m *GitTag) SetUrl(value *string)() { + m.url = value +} +// SetVerification sets the verification property value. The verification property +func (m *GitTag) SetVerification(value Verificationable)() { + m.verification = value +} +type GitTagable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + GetNodeId()(*string) + GetObject()(GitTag_objectable) + GetSha()(*string) + GetTag()(*string) + GetTagger()(GitTag_taggerable) + GetUrl()(*string) + GetVerification()(Verificationable) + SetMessage(value *string)() + SetNodeId(value *string)() + SetObject(value GitTag_objectable)() + SetSha(value *string)() + SetTag(value *string)() + SetTagger(value GitTag_taggerable)() + SetUrl(value *string)() + SetVerification(value Verificationable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/git_tag_object.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_tag_object.go new file mode 100644 index 000000000..dd8dff41b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_tag_object.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GitTag_object struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The sha property + sha *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewGitTag_object instantiates a new GitTag_object and sets the default values. +func NewGitTag_object()(*GitTag_object) { + m := &GitTag_object{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitTag_objectFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitTag_objectFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitTag_object(), 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 *GitTag_object) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitTag_object) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *GitTag_object) GetSha()(*string) { + return m.sha +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *GitTag_object) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GitTag_object) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GitTag_object) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *GitTag_object) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *GitTag_object) SetSha(value *string)() { + m.sha = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *GitTag_object) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *GitTag_object) SetUrl(value *string)() { + m.url = value +} +type GitTag_objectable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/git_tag_tagger.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_tag_tagger.go new file mode 100644 index 000000000..b4f8c328a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_tag_tagger.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GitTag_tagger struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The date property + date *string + // The email property + email *string + // The name property + name *string +} +// NewGitTag_tagger instantiates a new GitTag_tagger and sets the default values. +func NewGitTag_tagger()(*GitTag_tagger) { + m := &GitTag_tagger{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitTag_taggerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitTag_taggerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitTag_tagger(), 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 *GitTag_tagger) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. The date property +// returns a *string when successful +func (m *GitTag_tagger) GetDate()(*string) { + return m.date +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *GitTag_tagger) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitTag_tagger) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *GitTag_tagger) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *GitTag_tagger) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *GitTag_tagger) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. The date property +func (m *GitTag_tagger) SetDate(value *string)() { + m.date = value +} +// SetEmail sets the email property value. The email property +func (m *GitTag_tagger) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name property +func (m *GitTag_tagger) SetName(value *string)() { + m.name = value +} +type GitTag_taggerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*string) + GetEmail()(*string) + GetName()(*string) + SetDate(value *string)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/git_tree.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_tree.go new file mode 100644 index 000000000..6bc98bff5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_tree.go @@ -0,0 +1,180 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GitTree the hierarchy between files in a Git repository. +type GitTree struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The sha property + sha *string + // Objects specifying a tree structure + tree []GitTree_treeable + // The truncated property + truncated *bool + // The url property + url *string +} +// NewGitTree instantiates a new GitTree and sets the default values. +func NewGitTree()(*GitTree) { + m := &GitTree{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitTreeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitTreeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitTree(), 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 *GitTree) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitTree) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGitTree_treeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GitTree_treeable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GitTree_treeable) + } + } + m.SetTree(res) + } + return nil + } + res["truncated"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTruncated(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *GitTree) GetSha()(*string) { + return m.sha +} +// GetTree gets the tree property value. Objects specifying a tree structure +// returns a []GitTree_treeable when successful +func (m *GitTree) GetTree()([]GitTree_treeable) { + return m.tree +} +// GetTruncated gets the truncated property value. The truncated property +// returns a *bool when successful +func (m *GitTree) GetTruncated()(*bool) { + return m.truncated +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GitTree) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GitTree) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + if m.GetTree() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTree())) + for i, v := range m.GetTree() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("tree", cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("truncated", m.GetTruncated()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *GitTree) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *GitTree) SetSha(value *string)() { + m.sha = value +} +// SetTree sets the tree property value. Objects specifying a tree structure +func (m *GitTree) SetTree(value []GitTree_treeable)() { + m.tree = value +} +// SetTruncated sets the truncated property value. The truncated property +func (m *GitTree) SetTruncated(value *bool)() { + m.truncated = value +} +// SetUrl sets the url property value. The url property +func (m *GitTree) SetUrl(value *string)() { + m.url = value +} +type GitTreeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetTree()([]GitTree_treeable) + GetTruncated()(*bool) + GetUrl()(*string) + SetSha(value *string)() + SetTree(value []GitTree_treeable)() + SetTruncated(value *bool)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/git_tree_tree.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_tree_tree.go new file mode 100644 index 000000000..de2ab5cca --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/git_tree_tree.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GitTree_tree struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The mode property + mode *string + // The path property + path *string + // The sha property + sha *string + // The size property + size *int32 + // The type property + typeEscaped *string + // The url property + url *string +} +// NewGitTree_tree instantiates a new GitTree_tree and sets the default values. +func NewGitTree_tree()(*GitTree_tree) { + m := &GitTree_tree{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitTree_treeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitTree_treeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitTree_tree(), 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 *GitTree_tree) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitTree_tree) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["mode"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMode(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["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetMode gets the mode property value. The mode property +// returns a *string when successful +func (m *GitTree_tree) GetMode()(*string) { + return m.mode +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *GitTree_tree) GetPath()(*string) { + return m.path +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *GitTree_tree) GetSha()(*string) { + return m.sha +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *GitTree_tree) GetSize()(*int32) { + return m.size +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *GitTree_tree) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GitTree_tree) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GitTree_tree) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("mode", m.GetMode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *GitTree_tree) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMode sets the mode property value. The mode property +func (m *GitTree_tree) SetMode(value *string)() { + m.mode = value +} +// SetPath sets the path property value. The path property +func (m *GitTree_tree) SetPath(value *string)() { + m.path = value +} +// SetSha sets the sha property value. The sha property +func (m *GitTree_tree) SetSha(value *string)() { + m.sha = value +} +// SetSize sets the size property value. The size property +func (m *GitTree_tree) SetSize(value *int32)() { + m.size = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *GitTree_tree) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *GitTree_tree) SetUrl(value *string)() { + m.url = value +} +type GitTree_treeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMode()(*string) + GetPath()(*string) + GetSha()(*string) + GetSize()(*int32) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetMode(value *string)() + SetPath(value *string)() + SetSha(value *string)() + SetSize(value *int32)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gitignore_template.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gitignore_template.go new file mode 100644 index 000000000..0ddd602f7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gitignore_template.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GitignoreTemplate gitignore Template +type GitignoreTemplate struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name property + name *string + // The source property + source *string +} +// NewGitignoreTemplate instantiates a new GitignoreTemplate and sets the default values. +func NewGitignoreTemplate()(*GitignoreTemplate) { + m := &GitignoreTemplate{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitignoreTemplateFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitignoreTemplateFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitignoreTemplate(), 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 *GitignoreTemplate) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitignoreTemplate) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSource(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *GitignoreTemplate) GetName()(*string) { + return m.name +} +// GetSource gets the source property value. The source property +// returns a *string when successful +func (m *GitignoreTemplate) GetSource()(*string) { + return m.source +} +// Serialize serializes information the current object +func (m *GitignoreTemplate) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("source", m.GetSource()) + 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 *GitignoreTemplate) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name property +func (m *GitignoreTemplate) SetName(value *string)() { + m.name = value +} +// SetSource sets the source property value. The source property +func (m *GitignoreTemplate) SetSource(value *string)() { + m.source = value +} +type GitignoreTemplateable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetSource()(*string) + SetName(value *string)() + SetSource(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory.go new file mode 100644 index 000000000..931d0b408 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory.go @@ -0,0 +1,608 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GlobalAdvisory a GitHub Security Advisory. +type GlobalAdvisory struct { + // The users who contributed to the advisory. + credits []GlobalAdvisory_creditsable + // The Common Vulnerabilities and Exposures (CVE) ID. + cve_id *string + // The cvss property + cvss GlobalAdvisory_cvssable + // The cwes property + cwes []GlobalAdvisory_cwesable + // A detailed description of what the advisory entails. + description *string + // The GitHub Security Advisory ID. + ghsa_id *string + // The date and time of when the advisory was reviewed by GitHub, in ISO 8601 format. + github_reviewed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The URL for the advisory. + html_url *string + // The identifiers property + identifiers []GlobalAdvisory_identifiersable + // The date and time when the advisory was published in the National Vulnerability Database, in ISO 8601 format.This field is only populated when the advisory is imported from the National Vulnerability Database. + nvd_published_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The date and time of when the advisory was published, in ISO 8601 format. + published_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The references property + references []string + // The API URL for the repository advisory. + repository_advisory_url *string + // The severity of the advisory. + severity *GlobalAdvisory_severity + // The URL of the advisory's source code. + source_code_location *string + // A short summary of the advisory. + summary *string + // The type of advisory. + typeEscaped *GlobalAdvisory_type + // The date and time of when the advisory was last updated, in ISO 8601 format. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The API URL for the advisory. + url *string + // The products and respective version ranges affected by the advisory. + vulnerabilities []Vulnerabilityable + // The date and time of when the advisory was withdrawn, in ISO 8601 format. + withdrawn_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewGlobalAdvisory instantiates a new GlobalAdvisory and sets the default values. +func NewGlobalAdvisory()(*GlobalAdvisory) { + m := &GlobalAdvisory{ + } + return m +} +// CreateGlobalAdvisoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGlobalAdvisoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGlobalAdvisory(), nil +} +// GetCredits gets the credits property value. The users who contributed to the advisory. +// returns a []GlobalAdvisory_creditsable when successful +func (m *GlobalAdvisory) GetCredits()([]GlobalAdvisory_creditsable) { + return m.credits +} +// GetCveId gets the cve_id property value. The Common Vulnerabilities and Exposures (CVE) ID. +// returns a *string when successful +func (m *GlobalAdvisory) GetCveId()(*string) { + return m.cve_id +} +// GetCvss gets the cvss property value. The cvss property +// returns a GlobalAdvisory_cvssable when successful +func (m *GlobalAdvisory) GetCvss()(GlobalAdvisory_cvssable) { + return m.cvss +} +// GetCwes gets the cwes property value. The cwes property +// returns a []GlobalAdvisory_cwesable when successful +func (m *GlobalAdvisory) GetCwes()([]GlobalAdvisory_cwesable) { + return m.cwes +} +// GetDescription gets the description property value. A detailed description of what the advisory entails. +// returns a *string when successful +func (m *GlobalAdvisory) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GlobalAdvisory) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["credits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGlobalAdvisory_creditsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GlobalAdvisory_creditsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GlobalAdvisory_creditsable) + } + } + m.SetCredits(res) + } + return nil + } + res["cve_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCveId(val) + } + return nil + } + res["cvss"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGlobalAdvisory_cvssFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCvss(val.(GlobalAdvisory_cvssable)) + } + return nil + } + res["cwes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGlobalAdvisory_cwesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GlobalAdvisory_cwesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GlobalAdvisory_cwesable) + } + } + m.SetCwes(res) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["ghsa_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGhsaId(val) + } + return nil + } + res["github_reviewed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetGithubReviewedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["identifiers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGlobalAdvisory_identifiersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GlobalAdvisory_identifiersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GlobalAdvisory_identifiersable) + } + } + m.SetIdentifiers(res) + } + return nil + } + res["nvd_published_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetNvdPublishedAt(val) + } + return nil + } + res["published_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPublishedAt(val) + } + return nil + } + res["references"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetReferences(res) + } + return nil + } + res["repository_advisory_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryAdvisoryUrl(val) + } + return nil + } + res["severity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGlobalAdvisory_severity) + if err != nil { + return err + } + if val != nil { + m.SetSeverity(val.(*GlobalAdvisory_severity)) + } + return nil + } + res["source_code_location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSourceCodeLocation(val) + } + return nil + } + res["summary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSummary(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGlobalAdvisory_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*GlobalAdvisory_type)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["vulnerabilities"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateVulnerabilityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Vulnerabilityable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Vulnerabilityable) + } + } + m.SetVulnerabilities(res) + } + return nil + } + res["withdrawn_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetWithdrawnAt(val) + } + return nil + } + return res +} +// GetGhsaId gets the ghsa_id property value. The GitHub Security Advisory ID. +// returns a *string when successful +func (m *GlobalAdvisory) GetGhsaId()(*string) { + return m.ghsa_id +} +// GetGithubReviewedAt gets the github_reviewed_at property value. The date and time of when the advisory was reviewed by GitHub, in ISO 8601 format. +// returns a *Time when successful +func (m *GlobalAdvisory) GetGithubReviewedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.github_reviewed_at +} +// GetHtmlUrl gets the html_url property value. The URL for the advisory. +// returns a *string when successful +func (m *GlobalAdvisory) GetHtmlUrl()(*string) { + return m.html_url +} +// GetIdentifiers gets the identifiers property value. The identifiers property +// returns a []GlobalAdvisory_identifiersable when successful +func (m *GlobalAdvisory) GetIdentifiers()([]GlobalAdvisory_identifiersable) { + return m.identifiers +} +// GetNvdPublishedAt gets the nvd_published_at property value. The date and time when the advisory was published in the National Vulnerability Database, in ISO 8601 format.This field is only populated when the advisory is imported from the National Vulnerability Database. +// returns a *Time when successful +func (m *GlobalAdvisory) GetNvdPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.nvd_published_at +} +// GetPublishedAt gets the published_at property value. The date and time of when the advisory was published, in ISO 8601 format. +// returns a *Time when successful +func (m *GlobalAdvisory) GetPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.published_at +} +// GetReferences gets the references property value. The references property +// returns a []string when successful +func (m *GlobalAdvisory) GetReferences()([]string) { + return m.references +} +// GetRepositoryAdvisoryUrl gets the repository_advisory_url property value. The API URL for the repository advisory. +// returns a *string when successful +func (m *GlobalAdvisory) GetRepositoryAdvisoryUrl()(*string) { + return m.repository_advisory_url +} +// GetSeverity gets the severity property value. The severity of the advisory. +// returns a *GlobalAdvisory_severity when successful +func (m *GlobalAdvisory) GetSeverity()(*GlobalAdvisory_severity) { + return m.severity +} +// GetSourceCodeLocation gets the source_code_location property value. The URL of the advisory's source code. +// returns a *string when successful +func (m *GlobalAdvisory) GetSourceCodeLocation()(*string) { + return m.source_code_location +} +// GetSummary gets the summary property value. A short summary of the advisory. +// returns a *string when successful +func (m *GlobalAdvisory) GetSummary()(*string) { + return m.summary +} +// GetTypeEscaped gets the type property value. The type of advisory. +// returns a *GlobalAdvisory_type when successful +func (m *GlobalAdvisory) GetTypeEscaped()(*GlobalAdvisory_type) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The date and time of when the advisory was last updated, in ISO 8601 format. +// returns a *Time when successful +func (m *GlobalAdvisory) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The API URL for the advisory. +// returns a *string when successful +func (m *GlobalAdvisory) GetUrl()(*string) { + return m.url +} +// GetVulnerabilities gets the vulnerabilities property value. The products and respective version ranges affected by the advisory. +// returns a []Vulnerabilityable when successful +func (m *GlobalAdvisory) GetVulnerabilities()([]Vulnerabilityable) { + return m.vulnerabilities +} +// GetWithdrawnAt gets the withdrawn_at property value. The date and time of when the advisory was withdrawn, in ISO 8601 format. +// returns a *Time when successful +func (m *GlobalAdvisory) GetWithdrawnAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.withdrawn_at +} +// Serialize serializes information the current object +func (m *GlobalAdvisory) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("cvss", m.GetCvss()) + if err != nil { + return err + } + } + if m.GetCwes() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCwes())) + for i, v := range m.GetCwes() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("cwes", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + if m.GetReferences() != nil { + err := writer.WriteCollectionOfStringValues("references", m.GetReferences()) + if err != nil { + return err + } + } + if m.GetSeverity() != nil { + cast := (*m.GetSeverity()).String() + err := writer.WriteStringValue("severity", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("source_code_location", m.GetSourceCodeLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("summary", m.GetSummary()) + if err != nil { + return err + } + } + if m.GetVulnerabilities() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVulnerabilities())) + for i, v := range m.GetVulnerabilities() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("vulnerabilities", cast) + if err != nil { + return err + } + } + return nil +} +// SetCredits sets the credits property value. The users who contributed to the advisory. +func (m *GlobalAdvisory) SetCredits(value []GlobalAdvisory_creditsable)() { + m.credits = value +} +// SetCveId sets the cve_id property value. The Common Vulnerabilities and Exposures (CVE) ID. +func (m *GlobalAdvisory) SetCveId(value *string)() { + m.cve_id = value +} +// SetCvss sets the cvss property value. The cvss property +func (m *GlobalAdvisory) SetCvss(value GlobalAdvisory_cvssable)() { + m.cvss = value +} +// SetCwes sets the cwes property value. The cwes property +func (m *GlobalAdvisory) SetCwes(value []GlobalAdvisory_cwesable)() { + m.cwes = value +} +// SetDescription sets the description property value. A detailed description of what the advisory entails. +func (m *GlobalAdvisory) SetDescription(value *string)() { + m.description = value +} +// SetGhsaId sets the ghsa_id property value. The GitHub Security Advisory ID. +func (m *GlobalAdvisory) SetGhsaId(value *string)() { + m.ghsa_id = value +} +// SetGithubReviewedAt sets the github_reviewed_at property value. The date and time of when the advisory was reviewed by GitHub, in ISO 8601 format. +func (m *GlobalAdvisory) SetGithubReviewedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.github_reviewed_at = value +} +// SetHtmlUrl sets the html_url property value. The URL for the advisory. +func (m *GlobalAdvisory) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetIdentifiers sets the identifiers property value. The identifiers property +func (m *GlobalAdvisory) SetIdentifiers(value []GlobalAdvisory_identifiersable)() { + m.identifiers = value +} +// SetNvdPublishedAt sets the nvd_published_at property value. The date and time when the advisory was published in the National Vulnerability Database, in ISO 8601 format.This field is only populated when the advisory is imported from the National Vulnerability Database. +func (m *GlobalAdvisory) SetNvdPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.nvd_published_at = value +} +// SetPublishedAt sets the published_at property value. The date and time of when the advisory was published, in ISO 8601 format. +func (m *GlobalAdvisory) SetPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.published_at = value +} +// SetReferences sets the references property value. The references property +func (m *GlobalAdvisory) SetReferences(value []string)() { + m.references = value +} +// SetRepositoryAdvisoryUrl sets the repository_advisory_url property value. The API URL for the repository advisory. +func (m *GlobalAdvisory) SetRepositoryAdvisoryUrl(value *string)() { + m.repository_advisory_url = value +} +// SetSeverity sets the severity property value. The severity of the advisory. +func (m *GlobalAdvisory) SetSeverity(value *GlobalAdvisory_severity)() { + m.severity = value +} +// SetSourceCodeLocation sets the source_code_location property value. The URL of the advisory's source code. +func (m *GlobalAdvisory) SetSourceCodeLocation(value *string)() { + m.source_code_location = value +} +// SetSummary sets the summary property value. A short summary of the advisory. +func (m *GlobalAdvisory) SetSummary(value *string)() { + m.summary = value +} +// SetTypeEscaped sets the type property value. The type of advisory. +func (m *GlobalAdvisory) SetTypeEscaped(value *GlobalAdvisory_type)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The date and time of when the advisory was last updated, in ISO 8601 format. +func (m *GlobalAdvisory) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The API URL for the advisory. +func (m *GlobalAdvisory) SetUrl(value *string)() { + m.url = value +} +// SetVulnerabilities sets the vulnerabilities property value. The products and respective version ranges affected by the advisory. +func (m *GlobalAdvisory) SetVulnerabilities(value []Vulnerabilityable)() { + m.vulnerabilities = value +} +// SetWithdrawnAt sets the withdrawn_at property value. The date and time of when the advisory was withdrawn, in ISO 8601 format. +func (m *GlobalAdvisory) SetWithdrawnAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.withdrawn_at = value +} +type GlobalAdvisoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCredits()([]GlobalAdvisory_creditsable) + GetCveId()(*string) + GetCvss()(GlobalAdvisory_cvssable) + GetCwes()([]GlobalAdvisory_cwesable) + GetDescription()(*string) + GetGhsaId()(*string) + GetGithubReviewedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetIdentifiers()([]GlobalAdvisory_identifiersable) + GetNvdPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReferences()([]string) + GetRepositoryAdvisoryUrl()(*string) + GetSeverity()(*GlobalAdvisory_severity) + GetSourceCodeLocation()(*string) + GetSummary()(*string) + GetTypeEscaped()(*GlobalAdvisory_type) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetVulnerabilities()([]Vulnerabilityable) + GetWithdrawnAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetCredits(value []GlobalAdvisory_creditsable)() + SetCveId(value *string)() + SetCvss(value GlobalAdvisory_cvssable)() + SetCwes(value []GlobalAdvisory_cwesable)() + SetDescription(value *string)() + SetGhsaId(value *string)() + SetGithubReviewedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetIdentifiers(value []GlobalAdvisory_identifiersable)() + SetNvdPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReferences(value []string)() + SetRepositoryAdvisoryUrl(value *string)() + SetSeverity(value *GlobalAdvisory_severity)() + SetSourceCodeLocation(value *string)() + SetSummary(value *string)() + SetTypeEscaped(value *GlobalAdvisory_type)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetVulnerabilities(value []Vulnerabilityable)() + SetWithdrawnAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_credits.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_credits.go new file mode 100644 index 000000000..43eb16866 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_credits.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GlobalAdvisory_credits struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The type of credit the user is receiving. + typeEscaped *SecurityAdvisoryCreditTypes + // A GitHub user. + user SimpleUserable +} +// NewGlobalAdvisory_credits instantiates a new GlobalAdvisory_credits and sets the default values. +func NewGlobalAdvisory_credits()(*GlobalAdvisory_credits) { + m := &GlobalAdvisory_credits{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGlobalAdvisory_creditsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGlobalAdvisory_creditsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGlobalAdvisory_credits(), 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 *GlobalAdvisory_credits) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GlobalAdvisory_credits) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAdvisoryCreditTypes) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*SecurityAdvisoryCreditTypes)) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(SimpleUserable)) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The type of credit the user is receiving. +// returns a *SecurityAdvisoryCreditTypes when successful +func (m *GlobalAdvisory_credits) GetTypeEscaped()(*SecurityAdvisoryCreditTypes) { + return m.typeEscaped +} +// GetUser gets the user property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *GlobalAdvisory_credits) GetUser()(SimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *GlobalAdvisory_credits) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *GlobalAdvisory_credits) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTypeEscaped sets the type property value. The type of credit the user is receiving. +func (m *GlobalAdvisory_credits) SetTypeEscaped(value *SecurityAdvisoryCreditTypes)() { + m.typeEscaped = value +} +// SetUser sets the user property value. A GitHub user. +func (m *GlobalAdvisory_credits) SetUser(value SimpleUserable)() { + m.user = value +} +type GlobalAdvisory_creditsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTypeEscaped()(*SecurityAdvisoryCreditTypes) + GetUser()(SimpleUserable) + SetTypeEscaped(value *SecurityAdvisoryCreditTypes)() + SetUser(value SimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_cvss.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_cvss.go new file mode 100644 index 000000000..f3d257653 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_cvss.go @@ -0,0 +1,103 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GlobalAdvisory_cvss struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The CVSS score. + score *float64 + // The CVSS vector. + vector_string *string +} +// NewGlobalAdvisory_cvss instantiates a new GlobalAdvisory_cvss and sets the default values. +func NewGlobalAdvisory_cvss()(*GlobalAdvisory_cvss) { + m := &GlobalAdvisory_cvss{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGlobalAdvisory_cvssFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGlobalAdvisory_cvssFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGlobalAdvisory_cvss(), 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 *GlobalAdvisory_cvss) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GlobalAdvisory_cvss) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["vector_string"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVectorString(val) + } + return nil + } + return res +} +// GetScore gets the score property value. The CVSS score. +// returns a *float64 when successful +func (m *GlobalAdvisory_cvss) GetScore()(*float64) { + return m.score +} +// GetVectorString gets the vector_string property value. The CVSS vector. +// returns a *string when successful +func (m *GlobalAdvisory_cvss) GetVectorString()(*string) { + return m.vector_string +} +// Serialize serializes information the current object +func (m *GlobalAdvisory_cvss) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("vector_string", m.GetVectorString()) + 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 *GlobalAdvisory_cvss) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetScore sets the score property value. The CVSS score. +func (m *GlobalAdvisory_cvss) SetScore(value *float64)() { + m.score = value +} +// SetVectorString sets the vector_string property value. The CVSS vector. +func (m *GlobalAdvisory_cvss) SetVectorString(value *string)() { + m.vector_string = value +} +type GlobalAdvisory_cvssable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetScore()(*float64) + GetVectorString()(*string) + SetScore(value *float64)() + SetVectorString(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_cwes.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_cwes.go new file mode 100644 index 000000000..e041244da --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_cwes.go @@ -0,0 +1,103 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GlobalAdvisory_cwes struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The Common Weakness Enumeration (CWE) identifier. + cwe_id *string + // The name of the CWE. + name *string +} +// NewGlobalAdvisory_cwes instantiates a new GlobalAdvisory_cwes and sets the default values. +func NewGlobalAdvisory_cwes()(*GlobalAdvisory_cwes) { + m := &GlobalAdvisory_cwes{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGlobalAdvisory_cwesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGlobalAdvisory_cwesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGlobalAdvisory_cwes(), 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 *GlobalAdvisory_cwes) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCweId gets the cwe_id property value. The Common Weakness Enumeration (CWE) identifier. +// returns a *string when successful +func (m *GlobalAdvisory_cwes) GetCweId()(*string) { + return m.cwe_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GlobalAdvisory_cwes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cwe_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCweId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the CWE. +// returns a *string when successful +func (m *GlobalAdvisory_cwes) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *GlobalAdvisory_cwes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("cwe_id", m.GetCweId()) + 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 *GlobalAdvisory_cwes) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCweId sets the cwe_id property value. The Common Weakness Enumeration (CWE) identifier. +func (m *GlobalAdvisory_cwes) SetCweId(value *string)() { + m.cwe_id = value +} +// SetName sets the name property value. The name of the CWE. +func (m *GlobalAdvisory_cwes) SetName(value *string)() { + m.name = value +} +type GlobalAdvisory_cwesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCweId()(*string) + GetName()(*string) + SetCweId(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_identifiers.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_identifiers.go new file mode 100644 index 000000000..51e94cf6b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_identifiers.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GlobalAdvisory_identifiers struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The type of identifier. + typeEscaped *GlobalAdvisory_identifiers_type + // The identifier value. + value *string +} +// NewGlobalAdvisory_identifiers instantiates a new GlobalAdvisory_identifiers and sets the default values. +func NewGlobalAdvisory_identifiers()(*GlobalAdvisory_identifiers) { + m := &GlobalAdvisory_identifiers{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGlobalAdvisory_identifiersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGlobalAdvisory_identifiersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGlobalAdvisory_identifiers(), 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 *GlobalAdvisory_identifiers) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GlobalAdvisory_identifiers) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGlobalAdvisory_identifiers_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*GlobalAdvisory_identifiers_type)) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The type of identifier. +// returns a *GlobalAdvisory_identifiers_type when successful +func (m *GlobalAdvisory_identifiers) GetTypeEscaped()(*GlobalAdvisory_identifiers_type) { + return m.typeEscaped +} +// GetValue gets the value property value. The identifier value. +// returns a *string when successful +func (m *GlobalAdvisory_identifiers) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *GlobalAdvisory_identifiers) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *GlobalAdvisory_identifiers) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTypeEscaped sets the type property value. The type of identifier. +func (m *GlobalAdvisory_identifiers) SetTypeEscaped(value *GlobalAdvisory_identifiers_type)() { + m.typeEscaped = value +} +// SetValue sets the value property value. The identifier value. +func (m *GlobalAdvisory_identifiers) SetValue(value *string)() { + m.value = value +} +type GlobalAdvisory_identifiersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTypeEscaped()(*GlobalAdvisory_identifiers_type) + GetValue()(*string) + SetTypeEscaped(value *GlobalAdvisory_identifiers_type)() + SetValue(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_identifiers_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_identifiers_type.go new file mode 100644 index 000000000..6bb333809 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_identifiers_type.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The type of identifier. +type GlobalAdvisory_identifiers_type int + +const ( + CVE_GLOBALADVISORY_IDENTIFIERS_TYPE GlobalAdvisory_identifiers_type = iota + GHSA_GLOBALADVISORY_IDENTIFIERS_TYPE +) + +func (i GlobalAdvisory_identifiers_type) String() string { + return []string{"CVE", "GHSA"}[i] +} +func ParseGlobalAdvisory_identifiers_type(v string) (any, error) { + result := CVE_GLOBALADVISORY_IDENTIFIERS_TYPE + switch v { + case "CVE": + result = CVE_GLOBALADVISORY_IDENTIFIERS_TYPE + case "GHSA": + result = GHSA_GLOBALADVISORY_IDENTIFIERS_TYPE + default: + return 0, errors.New("Unknown GlobalAdvisory_identifiers_type value: " + v) + } + return &result, nil +} +func SerializeGlobalAdvisory_identifiers_type(values []GlobalAdvisory_identifiers_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GlobalAdvisory_identifiers_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_severity.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_severity.go new file mode 100644 index 000000000..c486526ba --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_severity.go @@ -0,0 +1,46 @@ +package models +import ( + "errors" +) +// The severity of the advisory. +type GlobalAdvisory_severity int + +const ( + CRITICAL_GLOBALADVISORY_SEVERITY GlobalAdvisory_severity = iota + HIGH_GLOBALADVISORY_SEVERITY + MEDIUM_GLOBALADVISORY_SEVERITY + LOW_GLOBALADVISORY_SEVERITY + UNKNOWN_GLOBALADVISORY_SEVERITY +) + +func (i GlobalAdvisory_severity) String() string { + return []string{"critical", "high", "medium", "low", "unknown"}[i] +} +func ParseGlobalAdvisory_severity(v string) (any, error) { + result := CRITICAL_GLOBALADVISORY_SEVERITY + switch v { + case "critical": + result = CRITICAL_GLOBALADVISORY_SEVERITY + case "high": + result = HIGH_GLOBALADVISORY_SEVERITY + case "medium": + result = MEDIUM_GLOBALADVISORY_SEVERITY + case "low": + result = LOW_GLOBALADVISORY_SEVERITY + case "unknown": + result = UNKNOWN_GLOBALADVISORY_SEVERITY + default: + return 0, errors.New("Unknown GlobalAdvisory_severity value: " + v) + } + return &result, nil +} +func SerializeGlobalAdvisory_severity(values []GlobalAdvisory_severity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GlobalAdvisory_severity) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_type.go new file mode 100644 index 000000000..56c44a2ac --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_type.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The type of advisory. +type GlobalAdvisory_type int + +const ( + REVIEWED_GLOBALADVISORY_TYPE GlobalAdvisory_type = iota + UNREVIEWED_GLOBALADVISORY_TYPE + MALWARE_GLOBALADVISORY_TYPE +) + +func (i GlobalAdvisory_type) String() string { + return []string{"reviewed", "unreviewed", "malware"}[i] +} +func ParseGlobalAdvisory_type(v string) (any, error) { + result := REVIEWED_GLOBALADVISORY_TYPE + switch v { + case "reviewed": + result = REVIEWED_GLOBALADVISORY_TYPE + case "unreviewed": + result = UNREVIEWED_GLOBALADVISORY_TYPE + case "malware": + result = MALWARE_GLOBALADVISORY_TYPE + default: + return 0, errors.New("Unknown GlobalAdvisory_type value: " + v) + } + return &result, nil +} +func SerializeGlobalAdvisory_type(values []GlobalAdvisory_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GlobalAdvisory_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_vulnerabilities.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_vulnerabilities.go new file mode 100644 index 000000000..2a2c05ceb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_vulnerabilities.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GlobalAdvisory_vulnerabilities struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The package version that resolve the vulnerability. + first_patched_version *string + // The name of the package affected by the vulnerability. + packageEscaped GlobalAdvisory_vulnerabilities_packageable + // The functions in the package that are affected by the vulnerability. + vulnerable_functions []string + // The range of the package versions affected by the vulnerability. + vulnerable_version_range *string +} +// NewGlobalAdvisory_vulnerabilities instantiates a new GlobalAdvisory_vulnerabilities and sets the default values. +func NewGlobalAdvisory_vulnerabilities()(*GlobalAdvisory_vulnerabilities) { + m := &GlobalAdvisory_vulnerabilities{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGlobalAdvisory_vulnerabilitiesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGlobalAdvisory_vulnerabilitiesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGlobalAdvisory_vulnerabilities(), 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 *GlobalAdvisory_vulnerabilities) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GlobalAdvisory_vulnerabilities) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["first_patched_version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFirstPatchedVersion(val) + } + return nil + } + res["package"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGlobalAdvisory_vulnerabilities_packageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPackageEscaped(val.(GlobalAdvisory_vulnerabilities_packageable)) + } + return nil + } + res["vulnerable_functions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetVulnerableFunctions(res) + } + return nil + } + res["vulnerable_version_range"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVulnerableVersionRange(val) + } + return nil + } + return res +} +// GetFirstPatchedVersion gets the first_patched_version property value. The package version that resolve the vulnerability. +// returns a *string when successful +func (m *GlobalAdvisory_vulnerabilities) GetFirstPatchedVersion()(*string) { + return m.first_patched_version +} +// GetPackageEscaped gets the package property value. The name of the package affected by the vulnerability. +// returns a GlobalAdvisory_vulnerabilities_packageable when successful +func (m *GlobalAdvisory_vulnerabilities) GetPackageEscaped()(GlobalAdvisory_vulnerabilities_packageable) { + return m.packageEscaped +} +// GetVulnerableFunctions gets the vulnerable_functions property value. The functions in the package that are affected by the vulnerability. +// returns a []string when successful +func (m *GlobalAdvisory_vulnerabilities) GetVulnerableFunctions()([]string) { + return m.vulnerable_functions +} +// GetVulnerableVersionRange gets the vulnerable_version_range property value. The range of the package versions affected by the vulnerability. +// returns a *string when successful +func (m *GlobalAdvisory_vulnerabilities) GetVulnerableVersionRange()(*string) { + return m.vulnerable_version_range +} +// Serialize serializes information the current object +func (m *GlobalAdvisory_vulnerabilities) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("first_patched_version", m.GetFirstPatchedVersion()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("package", m.GetPackageEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("vulnerable_version_range", m.GetVulnerableVersionRange()) + 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 *GlobalAdvisory_vulnerabilities) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFirstPatchedVersion sets the first_patched_version property value. The package version that resolve the vulnerability. +func (m *GlobalAdvisory_vulnerabilities) SetFirstPatchedVersion(value *string)() { + m.first_patched_version = value +} +// SetPackageEscaped sets the package property value. The name of the package affected by the vulnerability. +func (m *GlobalAdvisory_vulnerabilities) SetPackageEscaped(value GlobalAdvisory_vulnerabilities_packageable)() { + m.packageEscaped = value +} +// SetVulnerableFunctions sets the vulnerable_functions property value. The functions in the package that are affected by the vulnerability. +func (m *GlobalAdvisory_vulnerabilities) SetVulnerableFunctions(value []string)() { + m.vulnerable_functions = value +} +// SetVulnerableVersionRange sets the vulnerable_version_range property value. The range of the package versions affected by the vulnerability. +func (m *GlobalAdvisory_vulnerabilities) SetVulnerableVersionRange(value *string)() { + m.vulnerable_version_range = value +} +type GlobalAdvisory_vulnerabilitiesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFirstPatchedVersion()(*string) + GetPackageEscaped()(GlobalAdvisory_vulnerabilities_packageable) + GetVulnerableFunctions()([]string) + GetVulnerableVersionRange()(*string) + SetFirstPatchedVersion(value *string)() + SetPackageEscaped(value GlobalAdvisory_vulnerabilities_packageable)() + SetVulnerableFunctions(value []string)() + SetVulnerableVersionRange(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_vulnerabilities_package.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_vulnerabilities_package.go new file mode 100644 index 000000000..476d4dfa2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/global_advisory_vulnerabilities_package.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GlobalAdvisory_vulnerabilities_package the name of the package affected by the vulnerability. +type GlobalAdvisory_vulnerabilities_package struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The package's language or package management ecosystem. + ecosystem *SecurityAdvisoryEcosystems + // The unique package name within its ecosystem. + name *string +} +// NewGlobalAdvisory_vulnerabilities_package instantiates a new GlobalAdvisory_vulnerabilities_package and sets the default values. +func NewGlobalAdvisory_vulnerabilities_package()(*GlobalAdvisory_vulnerabilities_package) { + m := &GlobalAdvisory_vulnerabilities_package{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGlobalAdvisory_vulnerabilities_packageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGlobalAdvisory_vulnerabilities_packageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGlobalAdvisory_vulnerabilities_package(), 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 *GlobalAdvisory_vulnerabilities_package) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEcosystem gets the ecosystem property value. The package's language or package management ecosystem. +// returns a *SecurityAdvisoryEcosystems when successful +func (m *GlobalAdvisory_vulnerabilities_package) GetEcosystem()(*SecurityAdvisoryEcosystems) { + return m.ecosystem +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GlobalAdvisory_vulnerabilities_package) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ecosystem"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAdvisoryEcosystems) + if err != nil { + return err + } + if val != nil { + m.SetEcosystem(val.(*SecurityAdvisoryEcosystems)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The unique package name within its ecosystem. +// returns a *string when successful +func (m *GlobalAdvisory_vulnerabilities_package) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *GlobalAdvisory_vulnerabilities_package) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEcosystem() != nil { + cast := (*m.GetEcosystem()).String() + err := writer.WriteStringValue("ecosystem", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *GlobalAdvisory_vulnerabilities_package) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEcosystem sets the ecosystem property value. The package's language or package management ecosystem. +func (m *GlobalAdvisory_vulnerabilities_package) SetEcosystem(value *SecurityAdvisoryEcosystems)() { + m.ecosystem = value +} +// SetName sets the name property value. The unique package name within its ecosystem. +func (m *GlobalAdvisory_vulnerabilities_package) SetName(value *string)() { + m.name = value +} +type GlobalAdvisory_vulnerabilities_packageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEcosystem()(*SecurityAdvisoryEcosystems) + GetName()(*string) + SetEcosystem(value *SecurityAdvisoryEcosystems)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gpg_key.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gpg_key.go new file mode 100644 index 000000000..6e3e5e3b7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gpg_key.go @@ -0,0 +1,512 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GpgKey a unique encryption key +type GpgKey struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The can_certify property + can_certify *bool + // The can_encrypt_comms property + can_encrypt_comms *bool + // The can_encrypt_storage property + can_encrypt_storage *bool + // The can_sign property + can_sign *bool + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The emails property + emails []GpgKey_emailsable + // The expires_at property + expires_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The id property + id *int64 + // The key_id property + key_id *string + // The name property + name *string + // The primary_key_id property + primary_key_id *int32 + // The public_key property + public_key *string + // The raw_key property + raw_key *string + // The revoked property + revoked *bool + // The subkeys property + subkeys []GpgKey_subkeysable +} +// NewGpgKey instantiates a new GpgKey and sets the default values. +func NewGpgKey()(*GpgKey) { + m := &GpgKey{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGpgKeyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGpgKeyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGpgKey(), 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 *GpgKey) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCanCertify gets the can_certify property value. The can_certify property +// returns a *bool when successful +func (m *GpgKey) GetCanCertify()(*bool) { + return m.can_certify +} +// GetCanEncryptComms gets the can_encrypt_comms property value. The can_encrypt_comms property +// returns a *bool when successful +func (m *GpgKey) GetCanEncryptComms()(*bool) { + return m.can_encrypt_comms +} +// GetCanEncryptStorage gets the can_encrypt_storage property value. The can_encrypt_storage property +// returns a *bool when successful +func (m *GpgKey) GetCanEncryptStorage()(*bool) { + return m.can_encrypt_storage +} +// GetCanSign gets the can_sign property value. The can_sign property +// returns a *bool when successful +func (m *GpgKey) GetCanSign()(*bool) { + return m.can_sign +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *GpgKey) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetEmails gets the emails property value. The emails property +// returns a []GpgKey_emailsable when successful +func (m *GpgKey) GetEmails()([]GpgKey_emailsable) { + return m.emails +} +// GetExpiresAt gets the expires_at property value. The expires_at property +// returns a *Time when successful +func (m *GpgKey) GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.expires_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GpgKey) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["can_certify"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanCertify(val) + } + return nil + } + res["can_encrypt_comms"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanEncryptComms(val) + } + return nil + } + res["can_encrypt_storage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanEncryptStorage(val) + } + return nil + } + res["can_sign"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanSign(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["emails"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGpgKey_emailsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GpgKey_emailsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GpgKey_emailsable) + } + } + m.SetEmails(res) + } + return nil + } + res["expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["primary_key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrimaryKeyId(val) + } + return nil + } + res["public_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicKey(val) + } + return nil + } + res["raw_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRawKey(val) + } + return nil + } + res["revoked"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRevoked(val) + } + return nil + } + res["subkeys"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGpgKey_subkeysFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GpgKey_subkeysable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GpgKey_subkeysable) + } + } + m.SetSubkeys(res) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *GpgKey) GetId()(*int64) { + return m.id +} +// GetKeyId gets the key_id property value. The key_id property +// returns a *string when successful +func (m *GpgKey) GetKeyId()(*string) { + return m.key_id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *GpgKey) GetName()(*string) { + return m.name +} +// GetPrimaryKeyId gets the primary_key_id property value. The primary_key_id property +// returns a *int32 when successful +func (m *GpgKey) GetPrimaryKeyId()(*int32) { + return m.primary_key_id +} +// GetPublicKey gets the public_key property value. The public_key property +// returns a *string when successful +func (m *GpgKey) GetPublicKey()(*string) { + return m.public_key +} +// GetRawKey gets the raw_key property value. The raw_key property +// returns a *string when successful +func (m *GpgKey) GetRawKey()(*string) { + return m.raw_key +} +// GetRevoked gets the revoked property value. The revoked property +// returns a *bool when successful +func (m *GpgKey) GetRevoked()(*bool) { + return m.revoked +} +// GetSubkeys gets the subkeys property value. The subkeys property +// returns a []GpgKey_subkeysable when successful +func (m *GpgKey) GetSubkeys()([]GpgKey_subkeysable) { + return m.subkeys +} +// Serialize serializes information the current object +func (m *GpgKey) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("can_certify", m.GetCanCertify()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("can_encrypt_comms", m.GetCanEncryptComms()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("can_encrypt_storage", m.GetCanEncryptStorage()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("can_sign", m.GetCanSign()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + if m.GetEmails() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetEmails())) + for i, v := range m.GetEmails() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("emails", cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("expires_at", m.GetExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("primary_key_id", m.GetPrimaryKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("public_key", m.GetPublicKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("raw_key", m.GetRawKey()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("revoked", m.GetRevoked()) + if err != nil { + return err + } + } + if m.GetSubkeys() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSubkeys())) + for i, v := range m.GetSubkeys() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("subkeys", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *GpgKey) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCanCertify sets the can_certify property value. The can_certify property +func (m *GpgKey) SetCanCertify(value *bool)() { + m.can_certify = value +} +// SetCanEncryptComms sets the can_encrypt_comms property value. The can_encrypt_comms property +func (m *GpgKey) SetCanEncryptComms(value *bool)() { + m.can_encrypt_comms = value +} +// SetCanEncryptStorage sets the can_encrypt_storage property value. The can_encrypt_storage property +func (m *GpgKey) SetCanEncryptStorage(value *bool)() { + m.can_encrypt_storage = value +} +// SetCanSign sets the can_sign property value. The can_sign property +func (m *GpgKey) SetCanSign(value *bool)() { + m.can_sign = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GpgKey) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetEmails sets the emails property value. The emails property +func (m *GpgKey) SetEmails(value []GpgKey_emailsable)() { + m.emails = value +} +// SetExpiresAt sets the expires_at property value. The expires_at property +func (m *GpgKey) SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.expires_at = value +} +// SetId sets the id property value. The id property +func (m *GpgKey) SetId(value *int64)() { + m.id = value +} +// SetKeyId sets the key_id property value. The key_id property +func (m *GpgKey) SetKeyId(value *string)() { + m.key_id = value +} +// SetName sets the name property value. The name property +func (m *GpgKey) SetName(value *string)() { + m.name = value +} +// SetPrimaryKeyId sets the primary_key_id property value. The primary_key_id property +func (m *GpgKey) SetPrimaryKeyId(value *int32)() { + m.primary_key_id = value +} +// SetPublicKey sets the public_key property value. The public_key property +func (m *GpgKey) SetPublicKey(value *string)() { + m.public_key = value +} +// SetRawKey sets the raw_key property value. The raw_key property +func (m *GpgKey) SetRawKey(value *string)() { + m.raw_key = value +} +// SetRevoked sets the revoked property value. The revoked property +func (m *GpgKey) SetRevoked(value *bool)() { + m.revoked = value +} +// SetSubkeys sets the subkeys property value. The subkeys property +func (m *GpgKey) SetSubkeys(value []GpgKey_subkeysable)() { + m.subkeys = value +} +type GpgKeyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCanCertify()(*bool) + GetCanEncryptComms()(*bool) + GetCanEncryptStorage()(*bool) + GetCanSign()(*bool) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmails()([]GpgKey_emailsable) + GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int64) + GetKeyId()(*string) + GetName()(*string) + GetPrimaryKeyId()(*int32) + GetPublicKey()(*string) + GetRawKey()(*string) + GetRevoked()(*bool) + GetSubkeys()([]GpgKey_subkeysable) + SetCanCertify(value *bool)() + SetCanEncryptComms(value *bool)() + SetCanEncryptStorage(value *bool)() + SetCanSign(value *bool)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmails(value []GpgKey_emailsable)() + SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int64)() + SetKeyId(value *string)() + SetName(value *string)() + SetPrimaryKeyId(value *int32)() + SetPublicKey(value *string)() + SetRawKey(value *string)() + SetRevoked(value *bool)() + SetSubkeys(value []GpgKey_subkeysable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gpg_key_emails.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gpg_key_emails.go new file mode 100644 index 000000000..9a75970ca --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gpg_key_emails.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GpgKey_emails struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The email property + email *string + // The verified property + verified *bool +} +// NewGpgKey_emails instantiates a new GpgKey_emails and sets the default values. +func NewGpgKey_emails()(*GpgKey_emails) { + m := &GpgKey_emails{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGpgKey_emailsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGpgKey_emailsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGpgKey_emails(), 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 *GpgKey_emails) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *GpgKey_emails) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GpgKey_emails) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + return res +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *GpgKey_emails) GetVerified()(*bool) { + return m.verified +} +// Serialize serializes information the current object +func (m *GpgKey_emails) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + 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 *GpgKey_emails) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. The email property +func (m *GpgKey_emails) SetEmail(value *string)() { + m.email = value +} +// SetVerified sets the verified property value. The verified property +func (m *GpgKey_emails) SetVerified(value *bool)() { + m.verified = value +} +type GpgKey_emailsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetVerified()(*bool) + SetEmail(value *string)() + SetVerified(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gpg_key_subkeys.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gpg_key_subkeys.go new file mode 100644 index 000000000..5eb328b0a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gpg_key_subkeys.go @@ -0,0 +1,469 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GpgKey_subkeys struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The can_certify property + can_certify *bool + // The can_encrypt_comms property + can_encrypt_comms *bool + // The can_encrypt_storage property + can_encrypt_storage *bool + // The can_sign property + can_sign *bool + // The created_at property + created_at *string + // The emails property + emails []GpgKey_subkeys_emailsable + // The expires_at property + expires_at *string + // The id property + id *int64 + // The key_id property + key_id *string + // The primary_key_id property + primary_key_id *int32 + // The public_key property + public_key *string + // The raw_key property + 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) { + m := &GpgKey_subkeys{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGpgKey_subkeysFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGpgKey_subkeysFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGpgKey_subkeys(), 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 *GpgKey_subkeys) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCanCertify gets the can_certify property value. The can_certify property +// returns a *bool when successful +func (m *GpgKey_subkeys) GetCanCertify()(*bool) { + return m.can_certify +} +// GetCanEncryptComms gets the can_encrypt_comms property value. The can_encrypt_comms property +// returns a *bool when successful +func (m *GpgKey_subkeys) GetCanEncryptComms()(*bool) { + return m.can_encrypt_comms +} +// GetCanEncryptStorage gets the can_encrypt_storage property value. The can_encrypt_storage property +// returns a *bool when successful +func (m *GpgKey_subkeys) GetCanEncryptStorage()(*bool) { + return m.can_encrypt_storage +} +// GetCanSign gets the can_sign property value. The can_sign property +// returns a *bool when successful +func (m *GpgKey_subkeys) GetCanSign()(*bool) { + return m.can_sign +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *GpgKey_subkeys) GetCreatedAt()(*string) { + return m.created_at +} +// GetEmails gets the emails property value. The emails property +// returns a []GpgKey_subkeys_emailsable when successful +func (m *GpgKey_subkeys) GetEmails()([]GpgKey_subkeys_emailsable) { + return m.emails +} +// GetExpiresAt gets the expires_at property value. The expires_at property +// returns a *string when successful +func (m *GpgKey_subkeys) GetExpiresAt()(*string) { + return m.expires_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GpgKey_subkeys) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["can_certify"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanCertify(val) + } + return nil + } + res["can_encrypt_comms"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanEncryptComms(val) + } + return nil + } + res["can_encrypt_storage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanEncryptStorage(val) + } + return nil + } + res["can_sign"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanSign(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["emails"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGpgKey_subkeys_emailsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GpgKey_subkeys_emailsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GpgKey_subkeys_emailsable) + } + } + m.SetEmails(res) + } + return nil + } + res["expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + res["primary_key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrimaryKeyId(val) + } + return nil + } + res["public_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicKey(val) + } + return nil + } + res["raw_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRawKey(val) + } + return nil + } + res["revoked"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRevoked(val) + } + 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 +// returns a *int64 when successful +func (m *GpgKey_subkeys) GetId()(*int64) { + return m.id +} +// GetKeyId gets the key_id property value. The key_id property +// returns a *string when successful +func (m *GpgKey_subkeys) GetKeyId()(*string) { + return m.key_id +} +// GetPrimaryKeyId gets the primary_key_id property value. The primary_key_id property +// returns a *int32 when successful +func (m *GpgKey_subkeys) GetPrimaryKeyId()(*int32) { + return m.primary_key_id +} +// GetPublicKey gets the public_key property value. The public_key property +// returns a *string when successful +func (m *GpgKey_subkeys) GetPublicKey()(*string) { + return m.public_key +} +// GetRawKey gets the raw_key property value. The raw_key property +// returns a *string when successful +func (m *GpgKey_subkeys) GetRawKey()(*string) { + return m.raw_key +} +// GetRevoked gets the revoked property value. The revoked property +// returns a *bool when successful +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) { + { + err := writer.WriteBoolValue("can_certify", m.GetCanCertify()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("can_encrypt_comms", m.GetCanEncryptComms()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("can_encrypt_storage", m.GetCanEncryptStorage()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("can_sign", m.GetCanSign()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + if m.GetEmails() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetEmails())) + for i, v := range m.GetEmails() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("emails", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("expires_at", m.GetExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("primary_key_id", m.GetPrimaryKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("public_key", m.GetPublicKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("raw_key", m.GetRawKey()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("revoked", m.GetRevoked()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("subkeys", m.GetSubkeys()) + 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 *GpgKey_subkeys) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCanCertify sets the can_certify property value. The can_certify property +func (m *GpgKey_subkeys) SetCanCertify(value *bool)() { + m.can_certify = value +} +// SetCanEncryptComms sets the can_encrypt_comms property value. The can_encrypt_comms property +func (m *GpgKey_subkeys) SetCanEncryptComms(value *bool)() { + m.can_encrypt_comms = value +} +// SetCanEncryptStorage sets the can_encrypt_storage property value. The can_encrypt_storage property +func (m *GpgKey_subkeys) SetCanEncryptStorage(value *bool)() { + m.can_encrypt_storage = value +} +// SetCanSign sets the can_sign property value. The can_sign property +func (m *GpgKey_subkeys) SetCanSign(value *bool)() { + m.can_sign = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GpgKey_subkeys) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEmails sets the emails property value. The emails property +func (m *GpgKey_subkeys) SetEmails(value []GpgKey_subkeys_emailsable)() { + m.emails = value +} +// SetExpiresAt sets the expires_at property value. The expires_at property +func (m *GpgKey_subkeys) SetExpiresAt(value *string)() { + m.expires_at = value +} +// SetId sets the id property value. The id property +func (m *GpgKey_subkeys) SetId(value *int64)() { + m.id = value +} +// SetKeyId sets the key_id property value. The key_id property +func (m *GpgKey_subkeys) SetKeyId(value *string)() { + m.key_id = value +} +// SetPrimaryKeyId sets the primary_key_id property value. The primary_key_id property +func (m *GpgKey_subkeys) SetPrimaryKeyId(value *int32)() { + m.primary_key_id = value +} +// SetPublicKey sets the public_key property value. The public_key property +func (m *GpgKey_subkeys) SetPublicKey(value *string)() { + m.public_key = value +} +// SetRawKey sets the raw_key property value. The raw_key property +func (m *GpgKey_subkeys) SetRawKey(value *string)() { + m.raw_key = value +} +// SetRevoked sets the revoked property value. The revoked property +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 + GetCanCertify()(*bool) + GetCanEncryptComms()(*bool) + GetCanEncryptStorage()(*bool) + GetCanSign()(*bool) + GetCreatedAt()(*string) + GetEmails()([]GpgKey_subkeys_emailsable) + GetExpiresAt()(*string) + GetId()(*int64) + GetKeyId()(*string) + GetPrimaryKeyId()(*int32) + GetPublicKey()(*string) + GetRawKey()(*string) + GetRevoked()(*bool) + GetSubkeys()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + SetCanCertify(value *bool)() + SetCanEncryptComms(value *bool)() + SetCanEncryptStorage(value *bool)() + SetCanSign(value *bool)() + SetCreatedAt(value *string)() + SetEmails(value []GpgKey_subkeys_emailsable)() + SetExpiresAt(value *string)() + SetId(value *int64)() + SetKeyId(value *string)() + SetPrimaryKeyId(value *int32)() + SetPublicKey(value *string)() + SetRawKey(value *string)() + SetRevoked(value *bool)() + SetSubkeys(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/gpg_key_subkeys_emails.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/gpg_key_subkeys_emails.go new file mode 100644 index 000000000..7fdffcce1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/gpg_key_subkeys_emails.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GpgKey_subkeys_emails struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The email property + email *string + // The verified property + verified *bool +} +// NewGpgKey_subkeys_emails instantiates a new GpgKey_subkeys_emails and sets the default values. +func NewGpgKey_subkeys_emails()(*GpgKey_subkeys_emails) { + m := &GpgKey_subkeys_emails{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGpgKey_subkeys_emailsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGpgKey_subkeys_emailsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGpgKey_subkeys_emails(), 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 *GpgKey_subkeys_emails) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *GpgKey_subkeys_emails) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GpgKey_subkeys_emails) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + return res +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *GpgKey_subkeys_emails) GetVerified()(*bool) { + return m.verified +} +// Serialize serializes information the current object +func (m *GpgKey_subkeys_emails) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + 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 *GpgKey_subkeys_emails) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. The email property +func (m *GpgKey_subkeys_emails) SetEmail(value *string)() { + m.email = value +} +// SetVerified sets the verified property value. The verified property +func (m *GpgKey_subkeys_emails) SetVerified(value *bool)() { + m.verified = value +} +type GpgKey_subkeys_emailsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetVerified()(*bool) + SetEmail(value *string)() + SetVerified(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/hook.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook.go new file mode 100644 index 000000000..83d41cf1e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook.go @@ -0,0 +1,436 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Hook webhooks for repositories. +type Hook struct { + // Determines whether the hook is actually triggered on pushes. + active *bool + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Configuration object of the webhook + config WebhookConfigable + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The deliveries_url property + deliveries_url *string + // Determines what events the hook is triggered for. Default: ['push']. + events []string + // Unique identifier of the webhook. + id *int32 + // The last_response property + last_response HookResponseable + // The name of a valid service, use 'web' for a webhook. + name *string + // The ping_url property + ping_url *string + // The test_url property + test_url *string + // The type property + typeEscaped *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewHook instantiates a new Hook and sets the default values. +func NewHook()(*Hook) { + m := &Hook{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHook(), nil +} +// GetActive gets the active property value. Determines whether the hook is actually triggered on pushes. +// returns a *bool when successful +func (m *Hook) GetActive()(*bool) { + return m.active +} +// 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 *Hook) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfig gets the config property value. Configuration object of the webhook +// returns a WebhookConfigable when successful +func (m *Hook) GetConfig()(WebhookConfigable) { + return m.config +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Hook) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDeliveriesUrl gets the deliveries_url property value. The deliveries_url property +// returns a *string when successful +func (m *Hook) GetDeliveriesUrl()(*string) { + return m.deliveries_url +} +// GetEvents gets the events property value. Determines what events the hook is triggered for. Default: ['push']. +// returns a []string when successful +func (m *Hook) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Hook) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateWebhookConfigFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfig(val.(WebhookConfigable)) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["deliveries_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeliveriesUrl(val) + } + return nil + } + res["events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetEvents(res) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["last_response"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateHookResponseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLastResponse(val.(HookResponseable)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["ping_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPingUrl(val) + } + return nil + } + res["test_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTestUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the webhook. +// returns a *int32 when successful +func (m *Hook) GetId()(*int32) { + return m.id +} +// GetLastResponse gets the last_response property value. The last_response property +// returns a HookResponseable when successful +func (m *Hook) GetLastResponse()(HookResponseable) { + return m.last_response +} +// GetName gets the name property value. The name of a valid service, use 'web' for a webhook. +// returns a *string when successful +func (m *Hook) GetName()(*string) { + return m.name +} +// GetPingUrl gets the ping_url property value. The ping_url property +// returns a *string when successful +func (m *Hook) GetPingUrl()(*string) { + return m.ping_url +} +// GetTestUrl gets the test_url property value. The test_url property +// returns a *string when successful +func (m *Hook) GetTestUrl()(*string) { + return m.test_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *Hook) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Hook) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Hook) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Hook) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("config", m.GetConfig()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deliveries_url", m.GetDeliveriesUrl()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("last_response", m.GetLastResponse()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ping_url", m.GetPingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("test_url", m.GetTestUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActive sets the active property value. Determines whether the hook is actually triggered on pushes. +func (m *Hook) SetActive(value *bool)() { + m.active = value +} +// 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 *Hook) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfig sets the config property value. Configuration object of the webhook +func (m *Hook) SetConfig(value WebhookConfigable)() { + m.config = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Hook) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDeliveriesUrl sets the deliveries_url property value. The deliveries_url property +func (m *Hook) SetDeliveriesUrl(value *string)() { + m.deliveries_url = value +} +// SetEvents sets the events property value. Determines what events the hook is triggered for. Default: ['push']. +func (m *Hook) SetEvents(value []string)() { + m.events = value +} +// SetId sets the id property value. Unique identifier of the webhook. +func (m *Hook) SetId(value *int32)() { + m.id = value +} +// SetLastResponse sets the last_response property value. The last_response property +func (m *Hook) SetLastResponse(value HookResponseable)() { + m.last_response = value +} +// SetName sets the name property value. The name of a valid service, use 'web' for a webhook. +func (m *Hook) SetName(value *string)() { + m.name = value +} +// SetPingUrl sets the ping_url property value. The ping_url property +func (m *Hook) SetPingUrl(value *string)() { + m.ping_url = value +} +// SetTestUrl sets the test_url property value. The test_url property +func (m *Hook) SetTestUrl(value *string)() { + m.test_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Hook) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Hook) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Hook) SetUrl(value *string)() { + m.url = value +} +type Hookable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetConfig()(WebhookConfigable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDeliveriesUrl()(*string) + GetEvents()([]string) + GetId()(*int32) + GetLastResponse()(HookResponseable) + GetName()(*string) + GetPingUrl()(*string) + GetTestUrl()(*string) + GetTypeEscaped()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetActive(value *bool)() + SetConfig(value WebhookConfigable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDeliveriesUrl(value *string)() + SetEvents(value []string)() + SetId(value *int32)() + SetLastResponse(value HookResponseable)() + SetName(value *string)() + SetPingUrl(value *string)() + SetTestUrl(value *string)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_config.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_config.go new file mode 100644 index 000000000..20cc21ac4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_config.go @@ -0,0 +1,330 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Hook_config +type Hook_config struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // The digest property + digest *string + // The email property + email *string + // The insecure_ssl property + insecure_ssl WebhookConfigInsecureSslable + // The password property + password *string + // The room property + room *string + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). + secret *string + // The subdomain property + subdomain *string + // The token property + token *string + // The URL to which the payloads will be delivered. + url *string +} +// NewHook_config instantiates a new hook_config and sets the default values. +func NewHook_config()(*Hook_config) { + m := &Hook_config{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHook_configFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateHook_configFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHook_config(), 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. +func (m *Hook_config) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *Hook_config) GetContentType()(*string) { + return m.content_type +} +// GetDigest gets the digest property value. The digest property +func (m *Hook_config) GetDigest()(*string) { + return m.digest +} +// GetEmail gets the email property value. The email property +func (m *Hook_config) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +func (m *Hook_config) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["digest"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDigest(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateWebhookConfigInsecureSslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val.(WebhookConfigInsecureSslable)) + } + return nil + } + res["password"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPassword(val) + } + return nil + } + res["room"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRoom(val) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["subdomain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubdomain(val) + } + return nil + } + res["token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetToken(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +func (m *Hook_config) GetInsecureSsl()(WebhookConfigInsecureSslable) { + return m.insecure_ssl +} +// GetPassword gets the password property value. The password property +func (m *Hook_config) GetPassword()(*string) { + return m.password +} +// GetRoom gets the room property value. The room property +func (m *Hook_config) GetRoom()(*string) { + return m.room +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +func (m *Hook_config) GetSecret()(*string) { + return m.secret +} +// GetSubdomain gets the subdomain property value. The subdomain property +func (m *Hook_config) GetSubdomain()(*string) { + return m.subdomain +} +// GetToken gets the token property value. The token property +func (m *Hook_config) GetToken()(*string) { + return m.token +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +func (m *Hook_config) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Hook_config) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("digest", m.GetDigest()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("password", m.GetPassword()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("room", m.GetRoom()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subdomain", m.GetSubdomain()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token", m.GetToken()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Hook_config) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *Hook_config) SetContentType(value *string)() { + m.content_type = value +} +// SetDigest sets the digest property value. The digest property +func (m *Hook_config) SetDigest(value *string)() { + m.digest = value +} +// SetEmail sets the email property value. The email property +func (m *Hook_config) SetEmail(value *string)() { + m.email = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *Hook_config) SetInsecureSsl(value WebhookConfigInsecureSslable)() { + m.insecure_ssl = value +} +// SetPassword sets the password property value. The password property +func (m *Hook_config) SetPassword(value *string)() { + m.password = value +} +// SetRoom sets the room property value. The room property +func (m *Hook_config) SetRoom(value *string)() { + m.room = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +func (m *Hook_config) SetSecret(value *string)() { + m.secret = value +} +// SetSubdomain sets the subdomain property value. The subdomain property +func (m *Hook_config) SetSubdomain(value *string)() { + m.subdomain = value +} +// SetToken sets the token property value. The token property +func (m *Hook_config) SetToken(value *string)() { + m.token = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *Hook_config) SetUrl(value *string)() { + m.url = value +} +// Hook_configable +type Hook_configable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetDigest()(*string) + GetEmail()(*string) + GetInsecureSsl()(WebhookConfigInsecureSslable) + GetPassword()(*string) + GetRoom()(*string) + GetSecret()(*string) + GetSubdomain()(*string) + GetToken()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetDigest(value *string)() + SetEmail(value *string)() + SetInsecureSsl(value WebhookConfigInsecureSslable)() + SetPassword(value *string)() + SetRoom(value *string)() + SetSecret(value *string)() + SetSubdomain(value *string)() + SetToken(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery.go new file mode 100644 index 000000000..a2e0b7a63 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery.go @@ -0,0 +1,488 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// HookDelivery delivery made by a webhook. +type HookDelivery struct { + // The type of activity for the event that triggered the delivery. + action *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Time when the delivery was delivered. + delivered_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Time spent delivering. + duration *float64 + // The event that triggered the delivery. + event *string + // Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). + guid *string + // Unique identifier of the delivery. + id *int32 + // The id of the GitHub App installation associated with this event. + installation_id *int32 + // Whether the delivery is a redelivery. + redelivery *bool + // The id of the repository associated with this event. + repository_id *int32 + // The request property + request HookDelivery_requestable + // The response property + response HookDelivery_responseable + // Description of the status of the attempted delivery + status *string + // Status code received when delivery was made. + status_code *int32 + // Time when the webhook delivery was throttled. + throttled_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The URL target of the delivery. + url *string +} +// NewHookDelivery instantiates a new HookDelivery and sets the default values. +func NewHookDelivery()(*HookDelivery) { + m := &HookDelivery{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookDeliveryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookDeliveryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookDelivery(), nil +} +// GetAction gets the action property value. The type of activity for the event that triggered the delivery. +// returns a *string when successful +func (m *HookDelivery) GetAction()(*string) { + return m.action +} +// 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 *HookDelivery) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDeliveredAt gets the delivered_at property value. Time when the delivery was delivered. +// returns a *Time when successful +func (m *HookDelivery) GetDeliveredAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.delivered_at +} +// GetDuration gets the duration property value. Time spent delivering. +// returns a *float64 when successful +func (m *HookDelivery) GetDuration()(*float64) { + return m.duration +} +// GetEvent gets the event property value. The event that triggered the delivery. +// returns a *string when successful +func (m *HookDelivery) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HookDelivery) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["action"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAction(val) + } + return nil + } + res["delivered_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDeliveredAt(val) + } + return nil + } + res["duration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetDuration(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["guid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGuid(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["installation_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetInstallationId(val) + } + return nil + } + res["redelivery"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRedelivery(val) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + res["request"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateHookDelivery_requestFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequest(val.(HookDelivery_requestable)) + } + return nil + } + res["response"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateHookDelivery_responseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetResponse(val.(HookDelivery_responseable)) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + res["status_code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStatusCode(val) + } + return nil + } + res["throttled_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetThrottledAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetGuid gets the guid property value. Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). +// returns a *string when successful +func (m *HookDelivery) GetGuid()(*string) { + return m.guid +} +// GetId gets the id property value. Unique identifier of the delivery. +// returns a *int32 when successful +func (m *HookDelivery) GetId()(*int32) { + return m.id +} +// GetInstallationId gets the installation_id property value. The id of the GitHub App installation associated with this event. +// returns a *int32 when successful +func (m *HookDelivery) GetInstallationId()(*int32) { + return m.installation_id +} +// GetRedelivery gets the redelivery property value. Whether the delivery is a redelivery. +// returns a *bool when successful +func (m *HookDelivery) GetRedelivery()(*bool) { + return m.redelivery +} +// GetRepositoryId gets the repository_id property value. The id of the repository associated with this event. +// returns a *int32 when successful +func (m *HookDelivery) GetRepositoryId()(*int32) { + return m.repository_id +} +// GetRequest gets the request property value. The request property +// returns a HookDelivery_requestable when successful +func (m *HookDelivery) GetRequest()(HookDelivery_requestable) { + return m.request +} +// GetResponse gets the response property value. The response property +// returns a HookDelivery_responseable when successful +func (m *HookDelivery) GetResponse()(HookDelivery_responseable) { + return m.response +} +// GetStatus gets the status property value. Description of the status of the attempted delivery +// returns a *string when successful +func (m *HookDelivery) GetStatus()(*string) { + return m.status +} +// GetStatusCode gets the status_code property value. Status code received when delivery was made. +// returns a *int32 when successful +func (m *HookDelivery) GetStatusCode()(*int32) { + return m.status_code +} +// GetThrottledAt gets the throttled_at property value. Time when the webhook delivery was throttled. +// returns a *Time when successful +func (m *HookDelivery) GetThrottledAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.throttled_at +} +// GetUrl gets the url property value. The URL target of the delivery. +// returns a *string when successful +func (m *HookDelivery) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *HookDelivery) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("action", m.GetAction()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("delivered_at", m.GetDeliveredAt()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("duration", m.GetDuration()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("guid", m.GetGuid()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("installation_id", m.GetInstallationId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("redelivery", m.GetRedelivery()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("request", m.GetRequest()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("response", m.GetResponse()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status", m.GetStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("status_code", m.GetStatusCode()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("throttled_at", m.GetThrottledAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAction sets the action property value. The type of activity for the event that triggered the delivery. +func (m *HookDelivery) SetAction(value *string)() { + m.action = value +} +// 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 *HookDelivery) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDeliveredAt sets the delivered_at property value. Time when the delivery was delivered. +func (m *HookDelivery) SetDeliveredAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.delivered_at = value +} +// SetDuration sets the duration property value. Time spent delivering. +func (m *HookDelivery) SetDuration(value *float64)() { + m.duration = value +} +// SetEvent sets the event property value. The event that triggered the delivery. +func (m *HookDelivery) SetEvent(value *string)() { + m.event = value +} +// SetGuid sets the guid property value. Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). +func (m *HookDelivery) SetGuid(value *string)() { + m.guid = value +} +// SetId sets the id property value. Unique identifier of the delivery. +func (m *HookDelivery) SetId(value *int32)() { + m.id = value +} +// SetInstallationId sets the installation_id property value. The id of the GitHub App installation associated with this event. +func (m *HookDelivery) SetInstallationId(value *int32)() { + m.installation_id = value +} +// SetRedelivery sets the redelivery property value. Whether the delivery is a redelivery. +func (m *HookDelivery) SetRedelivery(value *bool)() { + m.redelivery = value +} +// SetRepositoryId sets the repository_id property value. The id of the repository associated with this event. +func (m *HookDelivery) SetRepositoryId(value *int32)() { + m.repository_id = value +} +// SetRequest sets the request property value. The request property +func (m *HookDelivery) SetRequest(value HookDelivery_requestable)() { + m.request = value +} +// SetResponse sets the response property value. The response property +func (m *HookDelivery) SetResponse(value HookDelivery_responseable)() { + m.response = value +} +// SetStatus sets the status property value. Description of the status of the attempted delivery +func (m *HookDelivery) SetStatus(value *string)() { + m.status = value +} +// SetStatusCode sets the status_code property value. Status code received when delivery was made. +func (m *HookDelivery) SetStatusCode(value *int32)() { + m.status_code = value +} +// SetThrottledAt sets the throttled_at property value. Time when the webhook delivery was throttled. +func (m *HookDelivery) SetThrottledAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.throttled_at = value +} +// SetUrl sets the url property value. The URL target of the delivery. +func (m *HookDelivery) SetUrl(value *string)() { + m.url = value +} +type HookDeliveryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAction()(*string) + GetDeliveredAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDuration()(*float64) + GetEvent()(*string) + GetGuid()(*string) + GetId()(*int32) + GetInstallationId()(*int32) + GetRedelivery()(*bool) + GetRepositoryId()(*int32) + GetRequest()(HookDelivery_requestable) + GetResponse()(HookDelivery_responseable) + GetStatus()(*string) + GetStatusCode()(*int32) + GetThrottledAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAction(value *string)() + SetDeliveredAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDuration(value *float64)() + SetEvent(value *string)() + SetGuid(value *string)() + SetId(value *int32)() + SetInstallationId(value *int32)() + SetRedelivery(value *bool)() + SetRepositoryId(value *int32)() + SetRequest(value HookDelivery_requestable)() + SetResponse(value HookDelivery_responseable)() + SetStatus(value *string)() + SetStatusCode(value *int32)() + SetThrottledAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_item.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_item.go new file mode 100644 index 000000000..0340ded17 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_item.go @@ -0,0 +1,401 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// HookDeliveryItem delivery made by a webhook, without request and response information. +type HookDeliveryItem struct { + // The type of activity for the event that triggered the delivery. + action *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Time when the webhook delivery occurred. + delivered_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Time spent delivering. + duration *float64 + // The event that triggered the delivery. + event *string + // Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). + guid *string + // Unique identifier of the webhook delivery. + id *int32 + // The id of the GitHub App installation associated with this event. + installation_id *int32 + // Whether the webhook delivery is a redelivery. + redelivery *bool + // The id of the repository associated with this event. + repository_id *int32 + // Describes the response returned after attempting the delivery. + status *string + // Status code received when delivery was made. + status_code *int32 + // Time when the webhook delivery was throttled. + throttled_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewHookDeliveryItem instantiates a new HookDeliveryItem and sets the default values. +func NewHookDeliveryItem()(*HookDeliveryItem) { + m := &HookDeliveryItem{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookDeliveryItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookDeliveryItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookDeliveryItem(), nil +} +// GetAction gets the action property value. The type of activity for the event that triggered the delivery. +// returns a *string when successful +func (m *HookDeliveryItem) GetAction()(*string) { + return m.action +} +// 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 *HookDeliveryItem) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDeliveredAt gets the delivered_at property value. Time when the webhook delivery occurred. +// returns a *Time when successful +func (m *HookDeliveryItem) GetDeliveredAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.delivered_at +} +// GetDuration gets the duration property value. Time spent delivering. +// returns a *float64 when successful +func (m *HookDeliveryItem) GetDuration()(*float64) { + return m.duration +} +// GetEvent gets the event property value. The event that triggered the delivery. +// returns a *string when successful +func (m *HookDeliveryItem) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HookDeliveryItem) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["action"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAction(val) + } + return nil + } + res["delivered_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDeliveredAt(val) + } + return nil + } + res["duration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetDuration(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["guid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGuid(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["installation_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetInstallationId(val) + } + return nil + } + res["redelivery"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRedelivery(val) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + res["status_code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStatusCode(val) + } + return nil + } + res["throttled_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetThrottledAt(val) + } + return nil + } + return res +} +// GetGuid gets the guid property value. Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). +// returns a *string when successful +func (m *HookDeliveryItem) GetGuid()(*string) { + return m.guid +} +// GetId gets the id property value. Unique identifier of the webhook delivery. +// returns a *int32 when successful +func (m *HookDeliveryItem) GetId()(*int32) { + return m.id +} +// GetInstallationId gets the installation_id property value. The id of the GitHub App installation associated with this event. +// returns a *int32 when successful +func (m *HookDeliveryItem) GetInstallationId()(*int32) { + return m.installation_id +} +// GetRedelivery gets the redelivery property value. Whether the webhook delivery is a redelivery. +// returns a *bool when successful +func (m *HookDeliveryItem) GetRedelivery()(*bool) { + return m.redelivery +} +// GetRepositoryId gets the repository_id property value. The id of the repository associated with this event. +// returns a *int32 when successful +func (m *HookDeliveryItem) GetRepositoryId()(*int32) { + return m.repository_id +} +// GetStatus gets the status property value. Describes the response returned after attempting the delivery. +// returns a *string when successful +func (m *HookDeliveryItem) GetStatus()(*string) { + return m.status +} +// GetStatusCode gets the status_code property value. Status code received when delivery was made. +// returns a *int32 when successful +func (m *HookDeliveryItem) GetStatusCode()(*int32) { + return m.status_code +} +// GetThrottledAt gets the throttled_at property value. Time when the webhook delivery was throttled. +// returns a *Time when successful +func (m *HookDeliveryItem) GetThrottledAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.throttled_at +} +// Serialize serializes information the current object +func (m *HookDeliveryItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("action", m.GetAction()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("delivered_at", m.GetDeliveredAt()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("duration", m.GetDuration()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("guid", m.GetGuid()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("installation_id", m.GetInstallationId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("redelivery", m.GetRedelivery()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status", m.GetStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("status_code", m.GetStatusCode()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("throttled_at", m.GetThrottledAt()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAction sets the action property value. The type of activity for the event that triggered the delivery. +func (m *HookDeliveryItem) SetAction(value *string)() { + m.action = value +} +// 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 *HookDeliveryItem) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDeliveredAt sets the delivered_at property value. Time when the webhook delivery occurred. +func (m *HookDeliveryItem) SetDeliveredAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.delivered_at = value +} +// SetDuration sets the duration property value. Time spent delivering. +func (m *HookDeliveryItem) SetDuration(value *float64)() { + m.duration = value +} +// SetEvent sets the event property value. The event that triggered the delivery. +func (m *HookDeliveryItem) SetEvent(value *string)() { + m.event = value +} +// SetGuid sets the guid property value. Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). +func (m *HookDeliveryItem) SetGuid(value *string)() { + m.guid = value +} +// SetId sets the id property value. Unique identifier of the webhook delivery. +func (m *HookDeliveryItem) SetId(value *int32)() { + m.id = value +} +// SetInstallationId sets the installation_id property value. The id of the GitHub App installation associated with this event. +func (m *HookDeliveryItem) SetInstallationId(value *int32)() { + m.installation_id = value +} +// SetRedelivery sets the redelivery property value. Whether the webhook delivery is a redelivery. +func (m *HookDeliveryItem) SetRedelivery(value *bool)() { + m.redelivery = value +} +// SetRepositoryId sets the repository_id property value. The id of the repository associated with this event. +func (m *HookDeliveryItem) SetRepositoryId(value *int32)() { + m.repository_id = value +} +// SetStatus sets the status property value. Describes the response returned after attempting the delivery. +func (m *HookDeliveryItem) SetStatus(value *string)() { + m.status = value +} +// SetStatusCode sets the status_code property value. Status code received when delivery was made. +func (m *HookDeliveryItem) SetStatusCode(value *int32)() { + m.status_code = value +} +// SetThrottledAt sets the throttled_at property value. Time when the webhook delivery was throttled. +func (m *HookDeliveryItem) SetThrottledAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.throttled_at = value +} +type HookDeliveryItemable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAction()(*string) + GetDeliveredAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDuration()(*float64) + GetEvent()(*string) + GetGuid()(*string) + GetId()(*int32) + GetInstallationId()(*int32) + GetRedelivery()(*bool) + GetRepositoryId()(*int32) + GetStatus()(*string) + GetStatusCode()(*int32) + GetThrottledAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetAction(value *string)() + SetDeliveredAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDuration(value *float64)() + SetEvent(value *string)() + SetGuid(value *string)() + SetId(value *int32)() + SetInstallationId(value *int32)() + SetRedelivery(value *bool)() + SetRepositoryId(value *int32)() + SetStatus(value *string)() + SetStatusCode(value *int32)() + SetThrottledAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_request.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_request.go new file mode 100644 index 000000000..9a116e435 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_request.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type HookDelivery_request struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The request headers sent with the webhook delivery. + headers HookDelivery_request_headersable + // The webhook payload. + payload HookDelivery_request_payloadable +} +// NewHookDelivery_request instantiates a new HookDelivery_request and sets the default values. +func NewHookDelivery_request()(*HookDelivery_request) { + m := &HookDelivery_request{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookDelivery_requestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookDelivery_requestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookDelivery_request(), 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 *HookDelivery_request) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HookDelivery_request) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["headers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateHookDelivery_request_headersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHeaders(val.(HookDelivery_request_headersable)) + } + return nil + } + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateHookDelivery_request_payloadFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPayload(val.(HookDelivery_request_payloadable)) + } + return nil + } + return res +} +// GetHeaders gets the headers property value. The request headers sent with the webhook delivery. +// returns a HookDelivery_request_headersable when successful +func (m *HookDelivery_request) GetHeaders()(HookDelivery_request_headersable) { + return m.headers +} +// GetPayload gets the payload property value. The webhook payload. +// returns a HookDelivery_request_payloadable when successful +func (m *HookDelivery_request) GetPayload()(HookDelivery_request_payloadable) { + return m.payload +} +// Serialize serializes information the current object +func (m *HookDelivery_request) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("headers", m.GetHeaders()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("payload", m.GetPayload()) + 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 *HookDelivery_request) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHeaders sets the headers property value. The request headers sent with the webhook delivery. +func (m *HookDelivery_request) SetHeaders(value HookDelivery_request_headersable)() { + m.headers = value +} +// SetPayload sets the payload property value. The webhook payload. +func (m *HookDelivery_request) SetPayload(value HookDelivery_request_payloadable)() { + m.payload = value +} +type HookDelivery_requestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHeaders()(HookDelivery_request_headersable) + GetPayload()(HookDelivery_request_payloadable) + SetHeaders(value HookDelivery_request_headersable)() + SetPayload(value HookDelivery_request_payloadable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_request_headers.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_request_headers.go new file mode 100644 index 000000000..24156dfed --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_request_headers.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// HookDelivery_request_headers the request headers sent with the webhook delivery. +type HookDelivery_request_headers struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewHookDelivery_request_headers instantiates a new HookDelivery_request_headers and sets the default values. +func NewHookDelivery_request_headers()(*HookDelivery_request_headers) { + m := &HookDelivery_request_headers{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookDelivery_request_headersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookDelivery_request_headersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookDelivery_request_headers(), 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 *HookDelivery_request_headers) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HookDelivery_request_headers) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *HookDelivery_request_headers) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *HookDelivery_request_headers) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type HookDelivery_request_headersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_request_payload.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_request_payload.go new file mode 100644 index 000000000..5eb11a228 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_request_payload.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// HookDelivery_request_payload the webhook payload. +type HookDelivery_request_payload struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewHookDelivery_request_payload instantiates a new HookDelivery_request_payload and sets the default values. +func NewHookDelivery_request_payload()(*HookDelivery_request_payload) { + m := &HookDelivery_request_payload{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookDelivery_request_payloadFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookDelivery_request_payloadFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookDelivery_request_payload(), 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 *HookDelivery_request_payload) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HookDelivery_request_payload) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *HookDelivery_request_payload) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *HookDelivery_request_payload) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type HookDelivery_request_payloadable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_response.go new file mode 100644 index 000000000..5f86f882c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_response.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type HookDelivery_response struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The response headers received when the delivery was made. + headers HookDelivery_response_headersable + // The response payload received. + payload *string +} +// NewHookDelivery_response instantiates a new HookDelivery_response and sets the default values. +func NewHookDelivery_response()(*HookDelivery_response) { + m := &HookDelivery_response{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookDelivery_responseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookDelivery_responseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookDelivery_response(), 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 *HookDelivery_response) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HookDelivery_response) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["headers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateHookDelivery_response_headersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHeaders(val.(HookDelivery_response_headersable)) + } + return nil + } + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPayload(val) + } + return nil + } + return res +} +// GetHeaders gets the headers property value. The response headers received when the delivery was made. +// returns a HookDelivery_response_headersable when successful +func (m *HookDelivery_response) GetHeaders()(HookDelivery_response_headersable) { + return m.headers +} +// GetPayload gets the payload property value. The response payload received. +// returns a *string when successful +func (m *HookDelivery_response) GetPayload()(*string) { + return m.payload +} +// Serialize serializes information the current object +func (m *HookDelivery_response) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("headers", m.GetHeaders()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("payload", m.GetPayload()) + 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 *HookDelivery_response) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHeaders sets the headers property value. The response headers received when the delivery was made. +func (m *HookDelivery_response) SetHeaders(value HookDelivery_response_headersable)() { + m.headers = value +} +// SetPayload sets the payload property value. The response payload received. +func (m *HookDelivery_response) SetPayload(value *string)() { + m.payload = value +} +type HookDelivery_responseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHeaders()(HookDelivery_response_headersable) + GetPayload()(*string) + SetHeaders(value HookDelivery_response_headersable)() + SetPayload(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_response_headers.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_response_headers.go new file mode 100644 index 000000000..dde90a90e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_delivery_response_headers.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// HookDelivery_response_headers the response headers received when the delivery was made. +type HookDelivery_response_headers struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewHookDelivery_response_headers instantiates a new HookDelivery_response_headers and sets the default values. +func NewHookDelivery_response_headers()(*HookDelivery_response_headers) { + m := &HookDelivery_response_headers{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookDelivery_response_headersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookDelivery_response_headersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookDelivery_response_headers(), 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 *HookDelivery_response_headers) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HookDelivery_response_headers) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *HookDelivery_response_headers) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *HookDelivery_response_headers) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type HookDelivery_response_headersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_response.go new file mode 100644 index 000000000..98bd9219a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/hook_response.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type HookResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *int32 + // The message property + message *string + // The status property + status *string +} +// NewHookResponse instantiates a new HookResponse and sets the default values. +func NewHookResponse()(*HookResponse) { + m := &HookResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookResponse(), 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 *HookResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *int32 when successful +func (m *HookResponse) GetCode()(*int32) { + return m.code +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HookResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *HookResponse) GetMessage()(*string) { + return m.message +} +// GetStatus gets the status property value. The status property +// returns a *string when successful +func (m *HookResponse) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *HookResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *HookResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *HookResponse) SetCode(value *int32)() { + m.code = value +} +// SetMessage sets the message property value. The message property +func (m *HookResponse) SetMessage(value *string)() { + m.message = value +} +// SetStatus sets the status property value. The status property +func (m *HookResponse) SetStatus(value *string)() { + m.status = value +} +type HookResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*int32) + GetMessage()(*string) + GetStatus()(*string) + SetCode(value *int32)() + SetMessage(value *string)() + SetStatus(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/hovercard.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/hovercard.go new file mode 100644 index 000000000..f3ab9743d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/hovercard.go @@ -0,0 +1,93 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Hovercard hovercard +type Hovercard struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The contexts property + contexts []Hovercard_contextsable +} +// NewHovercard instantiates a new Hovercard and sets the default values. +func NewHovercard()(*Hovercard) { + m := &Hovercard{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHovercardFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHovercardFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHovercard(), 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 *Hovercard) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContexts gets the contexts property value. The contexts property +// returns a []Hovercard_contextsable when successful +func (m *Hovercard) GetContexts()([]Hovercard_contextsable) { + return m.contexts +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Hovercard) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["contexts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateHovercard_contextsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Hovercard_contextsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Hovercard_contextsable) + } + } + m.SetContexts(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *Hovercard) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContexts() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetContexts())) + for i, v := range m.GetContexts() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("contexts", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *Hovercard) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContexts sets the contexts property value. The contexts property +func (m *Hovercard) SetContexts(value []Hovercard_contextsable)() { + m.contexts = value +} +type Hovercardable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContexts()([]Hovercard_contextsable) + SetContexts(value []Hovercard_contextsable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/hovercard_contexts.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/hovercard_contexts.go new file mode 100644 index 000000000..9239a0fc3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/hovercard_contexts.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Hovercard_contexts struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The message property + message *string + // The octicon property + octicon *string +} +// NewHovercard_contexts instantiates a new Hovercard_contexts and sets the default values. +func NewHovercard_contexts()(*Hovercard_contexts) { + m := &Hovercard_contexts{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHovercard_contextsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHovercard_contextsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHovercard_contexts(), 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 *Hovercard_contexts) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Hovercard_contexts) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["octicon"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOcticon(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Hovercard_contexts) GetMessage()(*string) { + return m.message +} +// GetOcticon gets the octicon property value. The octicon property +// returns a *string when successful +func (m *Hovercard_contexts) GetOcticon()(*string) { + return m.octicon +} +// Serialize serializes information the current object +func (m *Hovercard_contexts) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("octicon", m.GetOcticon()) + 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 *Hovercard_contexts) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. The message property +func (m *Hovercard_contexts) SetMessage(value *string)() { + m.message = value +} +// SetOcticon sets the octicon property value. The octicon property +func (m *Hovercard_contexts) SetOcticon(value *string)() { + m.octicon = value +} +type Hovercard_contextsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + GetOcticon()(*string) + SetMessage(value *string)() + SetOcticon(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/import_escaped.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/import_escaped.go new file mode 100644 index 000000000..a0f2ef90a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/import_escaped.go @@ -0,0 +1,732 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ImportEscaped a repository import from an external source. +type ImportEscaped struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The authors_count property + authors_count *int32 + // The authors_url property + authors_url *string + // The commit_count property + commit_count *int32 + // The error_message property + error_message *string + // The failed_step property + failed_step *string + // The has_large_files property + has_large_files *bool + // The html_url property + html_url *string + // The import_percent property + import_percent *int32 + // The large_files_count property + large_files_count *int32 + // The large_files_size property + large_files_size *int32 + // The message property + message *string + // The project_choices property + project_choices []Import_project_choicesable + // The push_percent property + push_percent *int32 + // The repository_url property + repository_url *string + // The status property + status *Import_status + // The status_text property + status_text *string + // The svc_root property + svc_root *string + // The svn_root property + svn_root *string + // The tfvc_project property + tfvc_project *string + // The url property + url *string + // The use_lfs property + use_lfs *bool + // The vcs property + vcs *string + // The URL of the originating repository. + vcs_url *string +} +// NewImportEscaped instantiates a new ImportEscaped and sets the default values. +func NewImportEscaped()(*ImportEscaped) { + m := &ImportEscaped{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateImportEscapedFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateImportEscapedFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewImportEscaped(), 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 *ImportEscaped) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorsCount gets the authors_count property value. The authors_count property +// returns a *int32 when successful +func (m *ImportEscaped) GetAuthorsCount()(*int32) { + return m.authors_count +} +// GetAuthorsUrl gets the authors_url property value. The authors_url property +// returns a *string when successful +func (m *ImportEscaped) GetAuthorsUrl()(*string) { + return m.authors_url +} +// GetCommitCount gets the commit_count property value. The commit_count property +// returns a *int32 when successful +func (m *ImportEscaped) GetCommitCount()(*int32) { + return m.commit_count +} +// GetErrorMessage gets the error_message property value. The error_message property +// returns a *string when successful +func (m *ImportEscaped) GetErrorMessage()(*string) { + return m.error_message +} +// GetFailedStep gets the failed_step property value. The failed_step property +// returns a *string when successful +func (m *ImportEscaped) GetFailedStep()(*string) { + return m.failed_step +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ImportEscaped) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["authors_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAuthorsCount(val) + } + return nil + } + res["authors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAuthorsUrl(val) + } + return nil + } + res["commit_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCommitCount(val) + } + return nil + } + res["error_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetErrorMessage(val) + } + return nil + } + res["failed_step"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFailedStep(val) + } + return nil + } + res["has_large_files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasLargeFiles(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["import_percent"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetImportPercent(val) + } + return nil + } + res["large_files_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLargeFilesCount(val) + } + return nil + } + res["large_files_size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLargeFilesSize(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["project_choices"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateImport_project_choicesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Import_project_choicesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Import_project_choicesable) + } + } + m.SetProjectChoices(res) + } + return nil + } + res["push_percent"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPushPercent(val) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseImport_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*Import_status)) + } + return nil + } + res["status_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusText(val) + } + return nil + } + res["svc_root"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvcRoot(val) + } + return nil + } + res["svn_root"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnRoot(val) + } + return nil + } + res["tfvc_project"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTfvcProject(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["use_lfs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseLfs(val) + } + return nil + } + res["vcs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVcs(val) + } + return nil + } + res["vcs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVcsUrl(val) + } + return nil + } + return res +} +// GetHasLargeFiles gets the has_large_files property value. The has_large_files property +// returns a *bool when successful +func (m *ImportEscaped) GetHasLargeFiles()(*bool) { + return m.has_large_files +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *ImportEscaped) GetHtmlUrl()(*string) { + return m.html_url +} +// GetImportPercent gets the import_percent property value. The import_percent property +// returns a *int32 when successful +func (m *ImportEscaped) GetImportPercent()(*int32) { + return m.import_percent +} +// GetLargeFilesCount gets the large_files_count property value. The large_files_count property +// returns a *int32 when successful +func (m *ImportEscaped) GetLargeFilesCount()(*int32) { + return m.large_files_count +} +// GetLargeFilesSize gets the large_files_size property value. The large_files_size property +// returns a *int32 when successful +func (m *ImportEscaped) GetLargeFilesSize()(*int32) { + return m.large_files_size +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ImportEscaped) GetMessage()(*string) { + return m.message +} +// GetProjectChoices gets the project_choices property value. The project_choices property +// returns a []Import_project_choicesable when successful +func (m *ImportEscaped) GetProjectChoices()([]Import_project_choicesable) { + return m.project_choices +} +// GetPushPercent gets the push_percent property value. The push_percent property +// returns a *int32 when successful +func (m *ImportEscaped) GetPushPercent()(*int32) { + return m.push_percent +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *ImportEscaped) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetStatus gets the status property value. The status property +// returns a *Import_status when successful +func (m *ImportEscaped) GetStatus()(*Import_status) { + return m.status +} +// GetStatusText gets the status_text property value. The status_text property +// returns a *string when successful +func (m *ImportEscaped) GetStatusText()(*string) { + return m.status_text +} +// GetSvcRoot gets the svc_root property value. The svc_root property +// returns a *string when successful +func (m *ImportEscaped) GetSvcRoot()(*string) { + return m.svc_root +} +// GetSvnRoot gets the svn_root property value. The svn_root property +// returns a *string when successful +func (m *ImportEscaped) GetSvnRoot()(*string) { + return m.svn_root +} +// GetTfvcProject gets the tfvc_project property value. The tfvc_project property +// returns a *string when successful +func (m *ImportEscaped) GetTfvcProject()(*string) { + return m.tfvc_project +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ImportEscaped) GetUrl()(*string) { + return m.url +} +// GetUseLfs gets the use_lfs property value. The use_lfs property +// returns a *bool when successful +func (m *ImportEscaped) GetUseLfs()(*bool) { + return m.use_lfs +} +// GetVcs gets the vcs property value. The vcs property +// returns a *string when successful +func (m *ImportEscaped) GetVcs()(*string) { + return m.vcs +} +// GetVcsUrl gets the vcs_url property value. The URL of the originating repository. +// returns a *string when successful +func (m *ImportEscaped) GetVcsUrl()(*string) { + return m.vcs_url +} +// Serialize serializes information the current object +func (m *ImportEscaped) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("authors_count", m.GetAuthorsCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("authors_url", m.GetAuthorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("commit_count", m.GetCommitCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("error_message", m.GetErrorMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("failed_step", m.GetFailedStep()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_large_files", m.GetHasLargeFiles()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("import_percent", m.GetImportPercent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("large_files_count", m.GetLargeFilesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("large_files_size", m.GetLargeFilesSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + if m.GetProjectChoices() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetProjectChoices())) + for i, v := range m.GetProjectChoices() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("project_choices", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("push_percent", m.GetPushPercent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err := writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status_text", m.GetStatusText()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svc_root", m.GetSvcRoot()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_root", m.GetSvnRoot()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tfvc_project", m.GetTfvcProject()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_lfs", m.GetUseLfs()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("vcs", m.GetVcs()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("vcs_url", m.GetVcsUrl()) + 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 *ImportEscaped) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorsCount sets the authors_count property value. The authors_count property +func (m *ImportEscaped) SetAuthorsCount(value *int32)() { + m.authors_count = value +} +// SetAuthorsUrl sets the authors_url property value. The authors_url property +func (m *ImportEscaped) SetAuthorsUrl(value *string)() { + m.authors_url = value +} +// SetCommitCount sets the commit_count property value. The commit_count property +func (m *ImportEscaped) SetCommitCount(value *int32)() { + m.commit_count = value +} +// SetErrorMessage sets the error_message property value. The error_message property +func (m *ImportEscaped) SetErrorMessage(value *string)() { + m.error_message = value +} +// SetFailedStep sets the failed_step property value. The failed_step property +func (m *ImportEscaped) SetFailedStep(value *string)() { + m.failed_step = value +} +// SetHasLargeFiles sets the has_large_files property value. The has_large_files property +func (m *ImportEscaped) SetHasLargeFiles(value *bool)() { + m.has_large_files = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *ImportEscaped) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetImportPercent sets the import_percent property value. The import_percent property +func (m *ImportEscaped) SetImportPercent(value *int32)() { + m.import_percent = value +} +// SetLargeFilesCount sets the large_files_count property value. The large_files_count property +func (m *ImportEscaped) SetLargeFilesCount(value *int32)() { + m.large_files_count = value +} +// SetLargeFilesSize sets the large_files_size property value. The large_files_size property +func (m *ImportEscaped) SetLargeFilesSize(value *int32)() { + m.large_files_size = value +} +// SetMessage sets the message property value. The message property +func (m *ImportEscaped) SetMessage(value *string)() { + m.message = value +} +// SetProjectChoices sets the project_choices property value. The project_choices property +func (m *ImportEscaped) SetProjectChoices(value []Import_project_choicesable)() { + m.project_choices = value +} +// SetPushPercent sets the push_percent property value. The push_percent property +func (m *ImportEscaped) SetPushPercent(value *int32)() { + m.push_percent = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *ImportEscaped) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetStatus sets the status property value. The status property +func (m *ImportEscaped) SetStatus(value *Import_status)() { + m.status = value +} +// SetStatusText sets the status_text property value. The status_text property +func (m *ImportEscaped) SetStatusText(value *string)() { + m.status_text = value +} +// SetSvcRoot sets the svc_root property value. The svc_root property +func (m *ImportEscaped) SetSvcRoot(value *string)() { + m.svc_root = value +} +// SetSvnRoot sets the svn_root property value. The svn_root property +func (m *ImportEscaped) SetSvnRoot(value *string)() { + m.svn_root = value +} +// SetTfvcProject sets the tfvc_project property value. The tfvc_project property +func (m *ImportEscaped) SetTfvcProject(value *string)() { + m.tfvc_project = value +} +// SetUrl sets the url property value. The url property +func (m *ImportEscaped) SetUrl(value *string)() { + m.url = value +} +// SetUseLfs sets the use_lfs property value. The use_lfs property +func (m *ImportEscaped) SetUseLfs(value *bool)() { + m.use_lfs = value +} +// SetVcs sets the vcs property value. The vcs property +func (m *ImportEscaped) SetVcs(value *string)() { + m.vcs = value +} +// SetVcsUrl sets the vcs_url property value. The URL of the originating repository. +func (m *ImportEscaped) SetVcsUrl(value *string)() { + m.vcs_url = value +} +type ImportEscapedable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorsCount()(*int32) + GetAuthorsUrl()(*string) + GetCommitCount()(*int32) + GetErrorMessage()(*string) + GetFailedStep()(*string) + GetHasLargeFiles()(*bool) + GetHtmlUrl()(*string) + GetImportPercent()(*int32) + GetLargeFilesCount()(*int32) + GetLargeFilesSize()(*int32) + GetMessage()(*string) + GetProjectChoices()([]Import_project_choicesable) + GetPushPercent()(*int32) + GetRepositoryUrl()(*string) + GetStatus()(*Import_status) + GetStatusText()(*string) + GetSvcRoot()(*string) + GetSvnRoot()(*string) + GetTfvcProject()(*string) + GetUrl()(*string) + GetUseLfs()(*bool) + GetVcs()(*string) + GetVcsUrl()(*string) + SetAuthorsCount(value *int32)() + SetAuthorsUrl(value *string)() + SetCommitCount(value *int32)() + SetErrorMessage(value *string)() + SetFailedStep(value *string)() + SetHasLargeFiles(value *bool)() + SetHtmlUrl(value *string)() + SetImportPercent(value *int32)() + SetLargeFilesCount(value *int32)() + SetLargeFilesSize(value *int32)() + SetMessage(value *string)() + SetProjectChoices(value []Import_project_choicesable)() + SetPushPercent(value *int32)() + SetRepositoryUrl(value *string)() + SetStatus(value *Import_status)() + SetStatusText(value *string)() + SetSvcRoot(value *string)() + SetSvnRoot(value *string)() + SetTfvcProject(value *string)() + SetUrl(value *string)() + SetUseLfs(value *bool)() + SetVcs(value *string)() + SetVcsUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/import_project_choices.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/import_project_choices.go new file mode 100644 index 000000000..9f4d14cf3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/import_project_choices.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Import_project_choices struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The human_name property + human_name *string + // The tfvc_project property + tfvc_project *string + // The vcs property + vcs *string +} +// NewImport_project_choices instantiates a new Import_project_choices and sets the default values. +func NewImport_project_choices()(*Import_project_choices) { + m := &Import_project_choices{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateImport_project_choicesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateImport_project_choicesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewImport_project_choices(), 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 *Import_project_choices) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Import_project_choices) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["human_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHumanName(val) + } + return nil + } + res["tfvc_project"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTfvcProject(val) + } + return nil + } + res["vcs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVcs(val) + } + return nil + } + return res +} +// GetHumanName gets the human_name property value. The human_name property +// returns a *string when successful +func (m *Import_project_choices) GetHumanName()(*string) { + return m.human_name +} +// GetTfvcProject gets the tfvc_project property value. The tfvc_project property +// returns a *string when successful +func (m *Import_project_choices) GetTfvcProject()(*string) { + return m.tfvc_project +} +// GetVcs gets the vcs property value. The vcs property +// returns a *string when successful +func (m *Import_project_choices) GetVcs()(*string) { + return m.vcs +} +// Serialize serializes information the current object +func (m *Import_project_choices) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("human_name", m.GetHumanName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tfvc_project", m.GetTfvcProject()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("vcs", m.GetVcs()) + 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 *Import_project_choices) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHumanName sets the human_name property value. The human_name property +func (m *Import_project_choices) SetHumanName(value *string)() { + m.human_name = value +} +// SetTfvcProject sets the tfvc_project property value. The tfvc_project property +func (m *Import_project_choices) SetTfvcProject(value *string)() { + m.tfvc_project = value +} +// SetVcs sets the vcs property value. The vcs property +func (m *Import_project_choices) SetVcs(value *string)() { + m.vcs = value +} +type Import_project_choicesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHumanName()(*string) + GetTfvcProject()(*string) + GetVcs()(*string) + SetHumanName(value *string)() + SetTfvcProject(value *string)() + SetVcs(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/import_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/import_status.go new file mode 100644 index 000000000..eae626127 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/import_status.go @@ -0,0 +1,78 @@ +package models +import ( + "errors" +) +type Import_status int + +const ( + AUTH_IMPORT_STATUS Import_status = iota + ERROR_IMPORT_STATUS + NONE_IMPORT_STATUS + DETECTING_IMPORT_STATUS + CHOOSE_IMPORT_STATUS + AUTH_FAILED_IMPORT_STATUS + IMPORTING_IMPORT_STATUS + MAPPING_IMPORT_STATUS + WAITING_TO_PUSH_IMPORT_STATUS + PUSHING_IMPORT_STATUS + COMPLETE_IMPORT_STATUS + SETUP_IMPORT_STATUS + UNKNOWN_IMPORT_STATUS + DETECTION_FOUND_MULTIPLE_IMPORT_STATUS + DETECTION_FOUND_NOTHING_IMPORT_STATUS + DETECTION_NEEDS_AUTH_IMPORT_STATUS +) + +func (i Import_status) String() string { + return []string{"auth", "error", "none", "detecting", "choose", "auth_failed", "importing", "mapping", "waiting_to_push", "pushing", "complete", "setup", "unknown", "detection_found_multiple", "detection_found_nothing", "detection_needs_auth"}[i] +} +func ParseImport_status(v string) (any, error) { + result := AUTH_IMPORT_STATUS + switch v { + case "auth": + result = AUTH_IMPORT_STATUS + case "error": + result = ERROR_IMPORT_STATUS + case "none": + result = NONE_IMPORT_STATUS + case "detecting": + result = DETECTING_IMPORT_STATUS + case "choose": + result = CHOOSE_IMPORT_STATUS + case "auth_failed": + result = AUTH_FAILED_IMPORT_STATUS + case "importing": + result = IMPORTING_IMPORT_STATUS + case "mapping": + result = MAPPING_IMPORT_STATUS + case "waiting_to_push": + result = WAITING_TO_PUSH_IMPORT_STATUS + case "pushing": + result = PUSHING_IMPORT_STATUS + case "complete": + result = COMPLETE_IMPORT_STATUS + case "setup": + result = SETUP_IMPORT_STATUS + case "unknown": + result = UNKNOWN_IMPORT_STATUS + case "detection_found_multiple": + result = DETECTION_FOUND_MULTIPLE_IMPORT_STATUS + case "detection_found_nothing": + result = DETECTION_FOUND_NOTHING_IMPORT_STATUS + case "detection_needs_auth": + result = DETECTION_NEEDS_AUTH_IMPORT_STATUS + default: + return 0, errors.New("Unknown Import_status value: " + v) + } + return &result, nil +} +func SerializeImport_status(values []Import_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Import_status) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/installation.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/installation.go new file mode 100644 index 000000000..dc40355d2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/installation.go @@ -0,0 +1,732 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Installation installation +type Installation struct { + // The access_tokens_url property + access_tokens_url *string + // The account property + account Installation_Installation_accountable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The app_id property + app_id *int32 + // The app_slug property + app_slug *string + // The contact_email property + contact_email *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The events property + events []string + // The has_multiple_single_files property + has_multiple_single_files *bool + // The html_url property + html_url *string + // The ID of the installation. + id *int32 + // The permissions granted to the user access token. + permissions AppPermissionsable + // The repositories_url property + repositories_url *string + // Describe whether all repositories have been selected or there's a selection involved + repository_selection *Installation_repository_selection + // The single_file_name property + single_file_name *string + // The single_file_paths property + single_file_paths []string + // The suspended_at property + suspended_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + suspended_by NullableSimpleUserable + // The ID of the user or organization this token is being scoped to. + target_id *int32 + // The target_type property + target_type *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// Installation_Installation_account composed type wrapper for classes Enterpriseable, SimpleUserable +type Installation_Installation_account struct { + // Composed type representation for type Enterpriseable + enterprise Enterpriseable + // Composed type representation for type SimpleUserable + simpleUser SimpleUserable +} +// NewInstallation_Installation_account instantiates a new Installation_Installation_account and sets the default values. +func NewInstallation_Installation_account()(*Installation_Installation_account) { + m := &Installation_Installation_account{ + } + return m +} +// CreateInstallation_Installation_accountFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInstallation_Installation_accountFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewInstallation_Installation_account() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateEnterpriseFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(Enterpriseable); ok { + result.SetEnterprise(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateSimpleUserFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(SimpleUserable); ok { + result.SetSimpleUser(cast) + } + } + } + return result, nil +} +// GetEnterprise gets the enterprise property value. Composed type representation for type Enterpriseable +// returns a Enterpriseable when successful +func (m *Installation_Installation_account) GetEnterprise()(Enterpriseable) { + return m.enterprise +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Installation_Installation_account) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *Installation_Installation_account) GetIsComposedType()(bool) { + return true +} +// GetSimpleUser gets the simpleUser property value. Composed type representation for type SimpleUserable +// returns a SimpleUserable when successful +func (m *Installation_Installation_account) GetSimpleUser()(SimpleUserable) { + return m.simpleUser +} +// Serialize serializes information the current object +func (m *Installation_Installation_account) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEnterprise() != nil { + err := writer.WriteObjectValue("", m.GetEnterprise()) + if err != nil { + return err + } + } else if m.GetSimpleUser() != nil { + err := writer.WriteObjectValue("", m.GetSimpleUser()) + if err != nil { + return err + } + } + return nil +} +// SetEnterprise sets the enterprise property value. Composed type representation for type Enterpriseable +func (m *Installation_Installation_account) SetEnterprise(value Enterpriseable)() { + m.enterprise = value +} +// SetSimpleUser sets the simpleUser property value. Composed type representation for type SimpleUserable +func (m *Installation_Installation_account) SetSimpleUser(value SimpleUserable)() { + m.simpleUser = value +} +type Installation_Installation_accountable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnterprise()(Enterpriseable) + GetSimpleUser()(SimpleUserable) + SetEnterprise(value Enterpriseable)() + SetSimpleUser(value SimpleUserable)() +} +// NewInstallation instantiates a new Installation and sets the default values. +func NewInstallation()(*Installation) { + m := &Installation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateInstallationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInstallationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInstallation(), nil +} +// GetAccessTokensUrl gets the access_tokens_url property value. The access_tokens_url property +// returns a *string when successful +func (m *Installation) GetAccessTokensUrl()(*string) { + return m.access_tokens_url +} +// GetAccount gets the account property value. The account property +// returns a Installation_Installation_accountable when successful +func (m *Installation) GetAccount()(Installation_Installation_accountable) { + return m.account +} +// 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 *Installation) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAppId gets the app_id property value. The app_id property +// returns a *int32 when successful +func (m *Installation) GetAppId()(*int32) { + return m.app_id +} +// GetAppSlug gets the app_slug property value. The app_slug property +// returns a *string when successful +func (m *Installation) GetAppSlug()(*string) { + return m.app_slug +} +// GetContactEmail gets the contact_email property value. The contact_email property +// returns a *string when successful +func (m *Installation) GetContactEmail()(*string) { + return m.contact_email +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Installation) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetEvents gets the events property value. The events property +// returns a []string when successful +func (m *Installation) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Installation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["access_tokens_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAccessTokensUrl(val) + } + return nil + } + res["account"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateInstallation_Installation_accountFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAccount(val.(Installation_Installation_accountable)) + } + return nil + } + res["app_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["app_slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAppSlug(val) + } + return nil + } + res["contact_email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContactEmail(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetEvents(res) + } + return nil + } + res["has_multiple_single_files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasMultipleSingleFiles(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAppPermissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(AppPermissionsable)) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["repository_selection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseInstallation_repository_selection) + if err != nil { + return err + } + if val != nil { + m.SetRepositorySelection(val.(*Installation_repository_selection)) + } + return nil + } + res["single_file_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSingleFileName(val) + } + return nil + } + res["single_file_paths"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetSingleFilePaths(res) + } + return nil + } + res["suspended_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetSuspendedAt(val) + } + return nil + } + res["suspended_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSuspendedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["target_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTargetId(val) + } + return nil + } + res["target_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetType(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetHasMultipleSingleFiles gets the has_multiple_single_files property value. The has_multiple_single_files property +// returns a *bool when successful +func (m *Installation) GetHasMultipleSingleFiles()(*bool) { + return m.has_multiple_single_files +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Installation) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The ID of the installation. +// returns a *int32 when successful +func (m *Installation) GetId()(*int32) { + return m.id +} +// GetPermissions gets the permissions property value. The permissions granted to the user access token. +// returns a AppPermissionsable when successful +func (m *Installation) GetPermissions()(AppPermissionsable) { + return m.permissions +} +// GetRepositoriesUrl gets the repositories_url property value. The repositories_url property +// returns a *string when successful +func (m *Installation) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetRepositorySelection gets the repository_selection property value. Describe whether all repositories have been selected or there's a selection involved +// returns a *Installation_repository_selection when successful +func (m *Installation) GetRepositorySelection()(*Installation_repository_selection) { + return m.repository_selection +} +// GetSingleFileName gets the single_file_name property value. The single_file_name property +// returns a *string when successful +func (m *Installation) GetSingleFileName()(*string) { + return m.single_file_name +} +// GetSingleFilePaths gets the single_file_paths property value. The single_file_paths property +// returns a []string when successful +func (m *Installation) GetSingleFilePaths()([]string) { + return m.single_file_paths +} +// GetSuspendedAt gets the suspended_at property value. The suspended_at property +// returns a *Time when successful +func (m *Installation) GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.suspended_at +} +// GetSuspendedBy gets the suspended_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Installation) GetSuspendedBy()(NullableSimpleUserable) { + return m.suspended_by +} +// GetTargetId gets the target_id property value. The ID of the user or organization this token is being scoped to. +// returns a *int32 when successful +func (m *Installation) GetTargetId()(*int32) { + return m.target_id +} +// GetTargetType gets the target_type property value. The target_type property +// returns a *string when successful +func (m *Installation) GetTargetType()(*string) { + return m.target_type +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Installation) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *Installation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("access_tokens_url", m.GetAccessTokensUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("account", m.GetAccount()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("app_id", m.GetAppId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("app_slug", m.GetAppSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contact_email", m.GetContactEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_multiple_single_files", m.GetHasMultipleSingleFiles()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + if m.GetRepositorySelection() != nil { + cast := (*m.GetRepositorySelection()).String() + err := writer.WriteStringValue("repository_selection", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("single_file_name", m.GetSingleFileName()) + if err != nil { + return err + } + } + if m.GetSingleFilePaths() != nil { + err := writer.WriteCollectionOfStringValues("single_file_paths", m.GetSingleFilePaths()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("suspended_at", m.GetSuspendedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("suspended_by", m.GetSuspendedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("target_id", m.GetTargetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_type", m.GetTargetType()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccessTokensUrl sets the access_tokens_url property value. The access_tokens_url property +func (m *Installation) SetAccessTokensUrl(value *string)() { + m.access_tokens_url = value +} +// SetAccount sets the account property value. The account property +func (m *Installation) SetAccount(value Installation_Installation_accountable)() { + m.account = value +} +// 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 *Installation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAppId sets the app_id property value. The app_id property +func (m *Installation) SetAppId(value *int32)() { + m.app_id = value +} +// SetAppSlug sets the app_slug property value. The app_slug property +func (m *Installation) SetAppSlug(value *string)() { + m.app_slug = value +} +// SetContactEmail sets the contact_email property value. The contact_email property +func (m *Installation) SetContactEmail(value *string)() { + m.contact_email = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Installation) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetEvents sets the events property value. The events property +func (m *Installation) SetEvents(value []string)() { + m.events = value +} +// SetHasMultipleSingleFiles sets the has_multiple_single_files property value. The has_multiple_single_files property +func (m *Installation) SetHasMultipleSingleFiles(value *bool)() { + m.has_multiple_single_files = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Installation) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The ID of the installation. +func (m *Installation) SetId(value *int32)() { + m.id = value +} +// SetPermissions sets the permissions property value. The permissions granted to the user access token. +func (m *Installation) SetPermissions(value AppPermissionsable)() { + m.permissions = value +} +// SetRepositoriesUrl sets the repositories_url property value. The repositories_url property +func (m *Installation) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetRepositorySelection sets the repository_selection property value. Describe whether all repositories have been selected or there's a selection involved +func (m *Installation) SetRepositorySelection(value *Installation_repository_selection)() { + m.repository_selection = value +} +// SetSingleFileName sets the single_file_name property value. The single_file_name property +func (m *Installation) SetSingleFileName(value *string)() { + m.single_file_name = value +} +// SetSingleFilePaths sets the single_file_paths property value. The single_file_paths property +func (m *Installation) SetSingleFilePaths(value []string)() { + m.single_file_paths = value +} +// SetSuspendedAt sets the suspended_at property value. The suspended_at property +func (m *Installation) SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.suspended_at = value +} +// SetSuspendedBy sets the suspended_by property value. A GitHub user. +func (m *Installation) SetSuspendedBy(value NullableSimpleUserable)() { + m.suspended_by = value +} +// SetTargetId sets the target_id property value. The ID of the user or organization this token is being scoped to. +func (m *Installation) SetTargetId(value *int32)() { + m.target_id = value +} +// SetTargetType sets the target_type property value. The target_type property +func (m *Installation) SetTargetType(value *string)() { + m.target_type = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Installation) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type Installationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessTokensUrl()(*string) + GetAccount()(Installation_Installation_accountable) + GetAppId()(*int32) + GetAppSlug()(*string) + GetContactEmail()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEvents()([]string) + GetHasMultipleSingleFiles()(*bool) + GetHtmlUrl()(*string) + GetId()(*int32) + GetPermissions()(AppPermissionsable) + GetRepositoriesUrl()(*string) + GetRepositorySelection()(*Installation_repository_selection) + GetSingleFileName()(*string) + GetSingleFilePaths()([]string) + GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetSuspendedBy()(NullableSimpleUserable) + GetTargetId()(*int32) + GetTargetType()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetAccessTokensUrl(value *string)() + SetAccount(value Installation_Installation_accountable)() + SetAppId(value *int32)() + SetAppSlug(value *string)() + SetContactEmail(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEvents(value []string)() + SetHasMultipleSingleFiles(value *bool)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetPermissions(value AppPermissionsable)() + SetRepositoriesUrl(value *string)() + SetRepositorySelection(value *Installation_repository_selection)() + SetSingleFileName(value *string)() + SetSingleFilePaths(value []string)() + SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetSuspendedBy(value NullableSimpleUserable)() + SetTargetId(value *int32)() + SetTargetType(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/installation_repository_selection.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/installation_repository_selection.go new file mode 100644 index 000000000..8f8e8b09d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/installation_repository_selection.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// Describe whether all repositories have been selected or there's a selection involved +type Installation_repository_selection int + +const ( + ALL_INSTALLATION_REPOSITORY_SELECTION Installation_repository_selection = iota + SELECTED_INSTALLATION_REPOSITORY_SELECTION +) + +func (i Installation_repository_selection) String() string { + return []string{"all", "selected"}[i] +} +func ParseInstallation_repository_selection(v string) (any, error) { + result := ALL_INSTALLATION_REPOSITORY_SELECTION + switch v { + case "all": + result = ALL_INSTALLATION_REPOSITORY_SELECTION + case "selected": + result = SELECTED_INSTALLATION_REPOSITORY_SELECTION + default: + return 0, errors.New("Unknown Installation_repository_selection value: " + v) + } + return &result, nil +} +func SerializeInstallation_repository_selection(values []Installation_repository_selection) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Installation_repository_selection) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/installation_token.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/installation_token.go new file mode 100644 index 000000000..e84bbad65 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/installation_token.go @@ -0,0 +1,303 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// InstallationToken authentication token for a GitHub App installed on a user or org. +type InstallationToken struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The expires_at property + expires_at *string + // The has_multiple_single_files property + has_multiple_single_files *bool + // The permissions granted to the user access token. + permissions AppPermissionsable + // The repositories property + repositories []Repositoryable + // The repository_selection property + repository_selection *InstallationToken_repository_selection + // The single_file property + single_file *string + // The single_file_paths property + single_file_paths []string + // The token property + token *string +} +// NewInstallationToken instantiates a new InstallationToken and sets the default values. +func NewInstallationToken()(*InstallationToken) { + m := &InstallationToken{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateInstallationTokenFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInstallationTokenFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInstallationToken(), 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 *InstallationToken) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetExpiresAt gets the expires_at property value. The expires_at property +// returns a *string when successful +func (m *InstallationToken) GetExpiresAt()(*string) { + return m.expires_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *InstallationToken) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresAt(val) + } + return nil + } + res["has_multiple_single_files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasMultipleSingleFiles(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAppPermissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(AppPermissionsable)) + } + return nil + } + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Repositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Repositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["repository_selection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseInstallationToken_repository_selection) + if err != nil { + return err + } + if val != nil { + m.SetRepositorySelection(val.(*InstallationToken_repository_selection)) + } + return nil + } + res["single_file"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSingleFile(val) + } + return nil + } + res["single_file_paths"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetSingleFilePaths(res) + } + return nil + } + res["token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetToken(val) + } + return nil + } + return res +} +// GetHasMultipleSingleFiles gets the has_multiple_single_files property value. The has_multiple_single_files property +// returns a *bool when successful +func (m *InstallationToken) GetHasMultipleSingleFiles()(*bool) { + return m.has_multiple_single_files +} +// GetPermissions gets the permissions property value. The permissions granted to the user access token. +// returns a AppPermissionsable when successful +func (m *InstallationToken) GetPermissions()(AppPermissionsable) { + return m.permissions +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []Repositoryable when successful +func (m *InstallationToken) GetRepositories()([]Repositoryable) { + return m.repositories +} +// GetRepositorySelection gets the repository_selection property value. The repository_selection property +// returns a *InstallationToken_repository_selection when successful +func (m *InstallationToken) GetRepositorySelection()(*InstallationToken_repository_selection) { + return m.repository_selection +} +// GetSingleFile gets the single_file property value. The single_file property +// returns a *string when successful +func (m *InstallationToken) GetSingleFile()(*string) { + return m.single_file +} +// GetSingleFilePaths gets the single_file_paths property value. The single_file_paths property +// returns a []string when successful +func (m *InstallationToken) GetSingleFilePaths()([]string) { + return m.single_file_paths +} +// GetToken gets the token property value. The token property +// returns a *string when successful +func (m *InstallationToken) GetToken()(*string) { + return m.token +} +// Serialize serializes information the current object +func (m *InstallationToken) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("expires_at", m.GetExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_multiple_single_files", m.GetHasMultipleSingleFiles()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + if m.GetRepositorySelection() != nil { + cast := (*m.GetRepositorySelection()).String() + err := writer.WriteStringValue("repository_selection", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("single_file", m.GetSingleFile()) + if err != nil { + return err + } + } + if m.GetSingleFilePaths() != nil { + err := writer.WriteCollectionOfStringValues("single_file_paths", m.GetSingleFilePaths()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token", m.GetToken()) + 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 *InstallationToken) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetExpiresAt sets the expires_at property value. The expires_at property +func (m *InstallationToken) SetExpiresAt(value *string)() { + m.expires_at = value +} +// SetHasMultipleSingleFiles sets the has_multiple_single_files property value. The has_multiple_single_files property +func (m *InstallationToken) SetHasMultipleSingleFiles(value *bool)() { + m.has_multiple_single_files = value +} +// SetPermissions sets the permissions property value. The permissions granted to the user access token. +func (m *InstallationToken) SetPermissions(value AppPermissionsable)() { + m.permissions = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *InstallationToken) SetRepositories(value []Repositoryable)() { + m.repositories = value +} +// SetRepositorySelection sets the repository_selection property value. The repository_selection property +func (m *InstallationToken) SetRepositorySelection(value *InstallationToken_repository_selection)() { + m.repository_selection = value +} +// SetSingleFile sets the single_file property value. The single_file property +func (m *InstallationToken) SetSingleFile(value *string)() { + m.single_file = value +} +// SetSingleFilePaths sets the single_file_paths property value. The single_file_paths property +func (m *InstallationToken) SetSingleFilePaths(value []string)() { + m.single_file_paths = value +} +// SetToken sets the token property value. The token property +func (m *InstallationToken) SetToken(value *string)() { + m.token = value +} +type InstallationTokenable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetExpiresAt()(*string) + GetHasMultipleSingleFiles()(*bool) + GetPermissions()(AppPermissionsable) + GetRepositories()([]Repositoryable) + GetRepositorySelection()(*InstallationToken_repository_selection) + GetSingleFile()(*string) + GetSingleFilePaths()([]string) + GetToken()(*string) + SetExpiresAt(value *string)() + SetHasMultipleSingleFiles(value *bool)() + SetPermissions(value AppPermissionsable)() + SetRepositories(value []Repositoryable)() + SetRepositorySelection(value *InstallationToken_repository_selection)() + SetSingleFile(value *string)() + SetSingleFilePaths(value []string)() + SetToken(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/installation_token_repository_selection.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/installation_token_repository_selection.go new file mode 100644 index 000000000..75a98374b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/installation_token_repository_selection.go @@ -0,0 +1,36 @@ +package models +import ( + "errors" +) +type InstallationToken_repository_selection int + +const ( + ALL_INSTALLATIONTOKEN_REPOSITORY_SELECTION InstallationToken_repository_selection = iota + SELECTED_INSTALLATIONTOKEN_REPOSITORY_SELECTION +) + +func (i InstallationToken_repository_selection) String() string { + return []string{"all", "selected"}[i] +} +func ParseInstallationToken_repository_selection(v string) (any, error) { + result := ALL_INSTALLATIONTOKEN_REPOSITORY_SELECTION + switch v { + case "all": + result = ALL_INSTALLATIONTOKEN_REPOSITORY_SELECTION + case "selected": + result = SELECTED_INSTALLATIONTOKEN_REPOSITORY_SELECTION + default: + return 0, errors.New("Unknown InstallationToken_repository_selection value: " + v) + } + return &result, nil +} +func SerializeInstallationToken_repository_selection(values []InstallationToken_repository_selection) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i InstallationToken_repository_selection) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/instances503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/instances503_error.go new file mode 100644 index 000000000..6361ee822 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/instances503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Instances503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewInstances503Error instantiates a new Instances503Error and sets the default values. +func NewInstances503Error()(*Instances503Error) { + m := &Instances503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateInstances503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInstances503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInstances503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Instances503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Instances503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Instances503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Instances503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Instances503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Instances503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Instances503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *Instances503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Instances503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Instances503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Instances503Error) SetMessage(value *string)() { + m.message = value +} +type Instances503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/integration.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/integration.go new file mode 100644 index 000000000..414a294dc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/integration.go @@ -0,0 +1,552 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Integration gitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +type Integration struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The client_id property + client_id *string + // The client_secret property + client_secret *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The description property + description *string + // The list of events for the GitHub app + events []string + // The external_url property + external_url *string + // The html_url property + html_url *string + // Unique identifier of the GitHub app + id *int32 + // The number of installations associated with the GitHub app + installations_count *int32 + // The name of the GitHub app + name *string + // The node_id property + node_id *string + // A GitHub user. + owner NullableSimpleUserable + // The pem property + pem *string + // The set of permissions for the GitHub app + permissions Integration_permissionsable + // The slug name of the GitHub app + slug *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The webhook_secret property + webhook_secret *string +} +// NewIntegration instantiates a new Integration and sets the default values. +func NewIntegration()(*Integration) { + m := &Integration{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIntegrationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIntegrationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIntegration(), 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 *Integration) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientId gets the client_id property value. The client_id property +// returns a *string when successful +func (m *Integration) GetClientId()(*string) { + return m.client_id +} +// GetClientSecret gets the client_secret property value. The client_secret property +// returns a *string when successful +func (m *Integration) GetClientSecret()(*string) { + return m.client_secret +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Integration) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *Integration) GetDescription()(*string) { + return m.description +} +// GetEvents gets the events property value. The list of events for the GitHub app +// returns a []string when successful +func (m *Integration) GetEvents()([]string) { + return m.events +} +// GetExternalUrl gets the external_url property value. The external_url property +// returns a *string when successful +func (m *Integration) GetExternalUrl()(*string) { + return m.external_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Integration) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientId(val) + } + return nil + } + res["client_secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientSecret(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetEvents(res) + } + return nil + } + res["external_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExternalUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["installations_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetInstallationsCount(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(NullableSimpleUserable)) + } + return nil + } + res["pem"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPem(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIntegration_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(Integration_permissionsable)) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["webhook_secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWebhookSecret(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Integration) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the GitHub app +// returns a *int32 when successful +func (m *Integration) GetId()(*int32) { + return m.id +} +// GetInstallationsCount gets the installations_count property value. The number of installations associated with the GitHub app +// returns a *int32 when successful +func (m *Integration) GetInstallationsCount()(*int32) { + return m.installations_count +} +// GetName gets the name property value. The name of the GitHub app +// returns a *string when successful +func (m *Integration) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Integration) GetNodeId()(*string) { + return m.node_id +} +// GetOwner gets the owner property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Integration) GetOwner()(NullableSimpleUserable) { + return m.owner +} +// GetPem gets the pem property value. The pem property +// returns a *string when successful +func (m *Integration) GetPem()(*string) { + return m.pem +} +// GetPermissions gets the permissions property value. The set of permissions for the GitHub app +// returns a Integration_permissionsable when successful +func (m *Integration) GetPermissions()(Integration_permissionsable) { + return m.permissions +} +// GetSlug gets the slug property value. The slug name of the GitHub app +// returns a *string when successful +func (m *Integration) GetSlug()(*string) { + return m.slug +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Integration) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetWebhookSecret gets the webhook_secret property value. The webhook_secret property +// returns a *string when successful +func (m *Integration) GetWebhookSecret()(*string) { + return m.webhook_secret +} +// Serialize serializes information the current object +func (m *Integration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("client_id", m.GetClientId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("client_secret", m.GetClientSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("external_url", m.GetExternalUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("installations_count", m.GetInstallationsCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pem", m.GetPem()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("webhook_secret", m.GetWebhookSecret()) + 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 *Integration) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientId sets the client_id property value. The client_id property +func (m *Integration) SetClientId(value *string)() { + m.client_id = value +} +// SetClientSecret sets the client_secret property value. The client_secret property +func (m *Integration) SetClientSecret(value *string)() { + m.client_secret = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Integration) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *Integration) SetDescription(value *string)() { + m.description = value +} +// SetEvents sets the events property value. The list of events for the GitHub app +func (m *Integration) SetEvents(value []string)() { + m.events = value +} +// SetExternalUrl sets the external_url property value. The external_url property +func (m *Integration) SetExternalUrl(value *string)() { + m.external_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Integration) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the GitHub app +func (m *Integration) SetId(value *int32)() { + m.id = value +} +// SetInstallationsCount sets the installations_count property value. The number of installations associated with the GitHub app +func (m *Integration) SetInstallationsCount(value *int32)() { + m.installations_count = value +} +// SetName sets the name property value. The name of the GitHub app +func (m *Integration) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Integration) SetNodeId(value *string)() { + m.node_id = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *Integration) SetOwner(value NullableSimpleUserable)() { + m.owner = value +} +// SetPem sets the pem property value. The pem property +func (m *Integration) SetPem(value *string)() { + m.pem = value +} +// SetPermissions sets the permissions property value. The set of permissions for the GitHub app +func (m *Integration) SetPermissions(value Integration_permissionsable)() { + m.permissions = value +} +// SetSlug sets the slug property value. The slug name of the GitHub app +func (m *Integration) SetSlug(value *string)() { + m.slug = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Integration) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetWebhookSecret sets the webhook_secret property value. The webhook_secret property +func (m *Integration) SetWebhookSecret(value *string)() { + m.webhook_secret = value +} +type Integrationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientId()(*string) + GetClientSecret()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetEvents()([]string) + GetExternalUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetInstallationsCount()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetOwner()(NullableSimpleUserable) + GetPem()(*string) + GetPermissions()(Integration_permissionsable) + GetSlug()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetWebhookSecret()(*string) + SetClientId(value *string)() + SetClientSecret(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetEvents(value []string)() + SetExternalUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetInstallationsCount(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetOwner(value NullableSimpleUserable)() + SetPem(value *string)() + SetPermissions(value Integration_permissionsable)() + SetSlug(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetWebhookSecret(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/integration_installation_request.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/integration_installation_request.go new file mode 100644 index 000000000..c524829db --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/integration_installation_request.go @@ -0,0 +1,284 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IntegrationInstallationRequest request to install an integration on a target +type IntegrationInstallationRequest struct { + // The account property + account IntegrationInstallationRequest_IntegrationInstallationRequest_accountable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Unique identifier of the request installation. + id *int32 + // The node_id property + node_id *string + // A GitHub user. + requester SimpleUserable +} +// IntegrationInstallationRequest_IntegrationInstallationRequest_account composed type wrapper for classes Enterpriseable, SimpleUserable +type IntegrationInstallationRequest_IntegrationInstallationRequest_account struct { + // Composed type representation for type Enterpriseable + enterprise Enterpriseable + // Composed type representation for type SimpleUserable + simpleUser SimpleUserable +} +// NewIntegrationInstallationRequest_IntegrationInstallationRequest_account instantiates a new IntegrationInstallationRequest_IntegrationInstallationRequest_account and sets the default values. +func NewIntegrationInstallationRequest_IntegrationInstallationRequest_account()(*IntegrationInstallationRequest_IntegrationInstallationRequest_account) { + m := &IntegrationInstallationRequest_IntegrationInstallationRequest_account{ + } + return m +} +// CreateIntegrationInstallationRequest_IntegrationInstallationRequest_accountFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIntegrationInstallationRequest_IntegrationInstallationRequest_accountFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewIntegrationInstallationRequest_IntegrationInstallationRequest_account() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateEnterpriseFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(Enterpriseable); ok { + result.SetEnterprise(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateSimpleUserFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(SimpleUserable); ok { + result.SetSimpleUser(cast) + } + } + } + return result, nil +} +// GetEnterprise gets the enterprise property value. Composed type representation for type Enterpriseable +// returns a Enterpriseable when successful +func (m *IntegrationInstallationRequest_IntegrationInstallationRequest_account) GetEnterprise()(Enterpriseable) { + return m.enterprise +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IntegrationInstallationRequest_IntegrationInstallationRequest_account) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *IntegrationInstallationRequest_IntegrationInstallationRequest_account) GetIsComposedType()(bool) { + return true +} +// GetSimpleUser gets the simpleUser property value. Composed type representation for type SimpleUserable +// returns a SimpleUserable when successful +func (m *IntegrationInstallationRequest_IntegrationInstallationRequest_account) GetSimpleUser()(SimpleUserable) { + return m.simpleUser +} +// Serialize serializes information the current object +func (m *IntegrationInstallationRequest_IntegrationInstallationRequest_account) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEnterprise() != nil { + err := writer.WriteObjectValue("", m.GetEnterprise()) + if err != nil { + return err + } + } else if m.GetSimpleUser() != nil { + err := writer.WriteObjectValue("", m.GetSimpleUser()) + if err != nil { + return err + } + } + return nil +} +// SetEnterprise sets the enterprise property value. Composed type representation for type Enterpriseable +func (m *IntegrationInstallationRequest_IntegrationInstallationRequest_account) SetEnterprise(value Enterpriseable)() { + m.enterprise = value +} +// SetSimpleUser sets the simpleUser property value. Composed type representation for type SimpleUserable +func (m *IntegrationInstallationRequest_IntegrationInstallationRequest_account) SetSimpleUser(value SimpleUserable)() { + m.simpleUser = value +} +type IntegrationInstallationRequest_IntegrationInstallationRequest_accountable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnterprise()(Enterpriseable) + GetSimpleUser()(SimpleUserable) + SetEnterprise(value Enterpriseable)() + SetSimpleUser(value SimpleUserable)() +} +// NewIntegrationInstallationRequest instantiates a new IntegrationInstallationRequest and sets the default values. +func NewIntegrationInstallationRequest()(*IntegrationInstallationRequest) { + m := &IntegrationInstallationRequest{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIntegrationInstallationRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIntegrationInstallationRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIntegrationInstallationRequest(), nil +} +// GetAccount gets the account property value. The account property +// returns a IntegrationInstallationRequest_IntegrationInstallationRequest_accountable when successful +func (m *IntegrationInstallationRequest) GetAccount()(IntegrationInstallationRequest_IntegrationInstallationRequest_accountable) { + return m.account +} +// 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 *IntegrationInstallationRequest) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *IntegrationInstallationRequest) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IntegrationInstallationRequest) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["account"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIntegrationInstallationRequest_IntegrationInstallationRequest_accountFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAccount(val.(IntegrationInstallationRequest_IntegrationInstallationRequest_accountable)) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["requester"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequester(val.(SimpleUserable)) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the request installation. +// returns a *int32 when successful +func (m *IntegrationInstallationRequest) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *IntegrationInstallationRequest) GetNodeId()(*string) { + return m.node_id +} +// GetRequester gets the requester property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *IntegrationInstallationRequest) GetRequester()(SimpleUserable) { + return m.requester +} +// Serialize serializes information the current object +func (m *IntegrationInstallationRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("account", m.GetAccount()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("requester", m.GetRequester()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccount sets the account property value. The account property +func (m *IntegrationInstallationRequest) SetAccount(value IntegrationInstallationRequest_IntegrationInstallationRequest_accountable)() { + m.account = value +} +// 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 *IntegrationInstallationRequest) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *IntegrationInstallationRequest) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. Unique identifier of the request installation. +func (m *IntegrationInstallationRequest) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *IntegrationInstallationRequest) SetNodeId(value *string)() { + m.node_id = value +} +// SetRequester sets the requester property value. A GitHub user. +func (m *IntegrationInstallationRequest) SetRequester(value SimpleUserable)() { + m.requester = value +} +type IntegrationInstallationRequestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccount()(IntegrationInstallationRequest_IntegrationInstallationRequest_accountable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int32) + GetNodeId()(*string) + GetRequester()(SimpleUserable) + SetAccount(value IntegrationInstallationRequest_IntegrationInstallationRequest_accountable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int32)() + SetNodeId(value *string)() + SetRequester(value SimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/integration_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/integration_permissions.go new file mode 100644 index 000000000..b147bc909 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/integration_permissions.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Integration_permissions the set of permissions for the GitHub app +type Integration_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The checks property + checks *string + // The contents property + contents *string + // The deployments property + deployments *string + // The issues property + issues *string + // The metadata property + metadata *string +} +// NewIntegration_permissions instantiates a new Integration_permissions and sets the default values. +func NewIntegration_permissions()(*Integration_permissions) { + m := &Integration_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIntegration_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIntegration_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIntegration_permissions(), 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 *Integration_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChecks gets the checks property value. The checks property +// returns a *string when successful +func (m *Integration_permissions) GetChecks()(*string) { + return m.checks +} +// GetContents gets the contents property value. The contents property +// returns a *string when successful +func (m *Integration_permissions) GetContents()(*string) { + return m.contents +} +// GetDeployments gets the deployments property value. The deployments property +// returns a *string when successful +func (m *Integration_permissions) GetDeployments()(*string) { + return m.deployments +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Integration_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetChecks(val) + } + return nil + } + res["contents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContents(val) + } + return nil + } + res["deployments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeployments(val) + } + return nil + } + res["issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssues(val) + } + return nil + } + res["metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMetadata(val) + } + return nil + } + return res +} +// GetIssues gets the issues property value. The issues property +// returns a *string when successful +func (m *Integration_permissions) GetIssues()(*string) { + return m.issues +} +// GetMetadata gets the metadata property value. The metadata property +// returns a *string when successful +func (m *Integration_permissions) GetMetadata()(*string) { + return m.metadata +} +// Serialize serializes information the current object +func (m *Integration_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("checks", m.GetChecks()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents", m.GetContents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments", m.GetDeployments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues", m.GetIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("metadata", m.GetMetadata()) + 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 *Integration_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChecks sets the checks property value. The checks property +func (m *Integration_permissions) SetChecks(value *string)() { + m.checks = value +} +// SetContents sets the contents property value. The contents property +func (m *Integration_permissions) SetContents(value *string)() { + m.contents = value +} +// SetDeployments sets the deployments property value. The deployments property +func (m *Integration_permissions) SetDeployments(value *string)() { + m.deployments = value +} +// SetIssues sets the issues property value. The issues property +func (m *Integration_permissions) SetIssues(value *string)() { + m.issues = value +} +// SetMetadata sets the metadata property value. The metadata property +func (m *Integration_permissions) SetMetadata(value *string)() { + m.metadata = value +} +type Integration_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChecks()(*string) + GetContents()(*string) + GetDeployments()(*string) + GetIssues()(*string) + GetMetadata()(*string) + SetChecks(value *string)() + SetContents(value *string)() + SetDeployments(value *string)() + SetIssues(value *string)() + SetMetadata(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/interaction_expiry.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/interaction_expiry.go new file mode 100644 index 000000000..f49b20e17 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/interaction_expiry.go @@ -0,0 +1,46 @@ +package models +import ( + "errors" +) +// The duration of the interaction restriction. Default: `one_day`. +type InteractionExpiry int + +const ( + ONE_DAY_INTERACTIONEXPIRY InteractionExpiry = iota + THREE_DAYS_INTERACTIONEXPIRY + ONE_WEEK_INTERACTIONEXPIRY + ONE_MONTH_INTERACTIONEXPIRY + SIX_MONTHS_INTERACTIONEXPIRY +) + +func (i InteractionExpiry) String() string { + return []string{"one_day", "three_days", "one_week", "one_month", "six_months"}[i] +} +func ParseInteractionExpiry(v string) (any, error) { + result := ONE_DAY_INTERACTIONEXPIRY + switch v { + case "one_day": + result = ONE_DAY_INTERACTIONEXPIRY + case "three_days": + result = THREE_DAYS_INTERACTIONEXPIRY + case "one_week": + result = ONE_WEEK_INTERACTIONEXPIRY + case "one_month": + result = ONE_MONTH_INTERACTIONEXPIRY + case "six_months": + result = SIX_MONTHS_INTERACTIONEXPIRY + default: + return 0, errors.New("Unknown InteractionExpiry value: " + v) + } + return &result, nil +} +func SerializeInteractionExpiry(values []InteractionExpiry) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i InteractionExpiry) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/interaction_group.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/interaction_group.go new file mode 100644 index 000000000..38a73fe7c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/interaction_group.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. +type InteractionGroup int + +const ( + EXISTING_USERS_INTERACTIONGROUP InteractionGroup = iota + CONTRIBUTORS_ONLY_INTERACTIONGROUP + COLLABORATORS_ONLY_INTERACTIONGROUP +) + +func (i InteractionGroup) String() string { + return []string{"existing_users", "contributors_only", "collaborators_only"}[i] +} +func ParseInteractionGroup(v string) (any, error) { + result := EXISTING_USERS_INTERACTIONGROUP + switch v { + case "existing_users": + result = EXISTING_USERS_INTERACTIONGROUP + case "contributors_only": + result = CONTRIBUTORS_ONLY_INTERACTIONGROUP + case "collaborators_only": + result = COLLABORATORS_ONLY_INTERACTIONGROUP + default: + return 0, errors.New("Unknown InteractionGroup value: " + v) + } + return &result, nil +} +func SerializeInteractionGroup(values []InteractionGroup) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i InteractionGroup) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/interaction_limit.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/interaction_limit.go new file mode 100644 index 000000000..739001bba --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/interaction_limit.go @@ -0,0 +1,112 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// InteractionLimit limit interactions to a specific type of user for a specified duration +type InteractionLimit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The duration of the interaction restriction. Default: `one_day`. + expiry *InteractionExpiry + // The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. + limit *InteractionGroup +} +// NewInteractionLimit instantiates a new InteractionLimit and sets the default values. +func NewInteractionLimit()(*InteractionLimit) { + m := &InteractionLimit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateInteractionLimitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInteractionLimitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInteractionLimit(), 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 *InteractionLimit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetExpiry gets the expiry property value. The duration of the interaction restriction. Default: `one_day`. +// returns a *InteractionExpiry when successful +func (m *InteractionLimit) GetExpiry()(*InteractionExpiry) { + return m.expiry +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *InteractionLimit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["expiry"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseInteractionExpiry) + if err != nil { + return err + } + if val != nil { + m.SetExpiry(val.(*InteractionExpiry)) + } + return nil + } + res["limit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseInteractionGroup) + if err != nil { + return err + } + if val != nil { + m.SetLimit(val.(*InteractionGroup)) + } + return nil + } + return res +} +// GetLimit gets the limit property value. The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. +// returns a *InteractionGroup when successful +func (m *InteractionLimit) GetLimit()(*InteractionGroup) { + return m.limit +} +// Serialize serializes information the current object +func (m *InteractionLimit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetExpiry() != nil { + cast := (*m.GetExpiry()).String() + err := writer.WriteStringValue("expiry", &cast) + if err != nil { + return err + } + } + if m.GetLimit() != nil { + cast := (*m.GetLimit()).String() + err := writer.WriteStringValue("limit", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *InteractionLimit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetExpiry sets the expiry property value. The duration of the interaction restriction. Default: `one_day`. +func (m *InteractionLimit) SetExpiry(value *InteractionExpiry)() { + m.expiry = value +} +// SetLimit sets the limit property value. The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. +func (m *InteractionLimit) SetLimit(value *InteractionGroup)() { + m.limit = value +} +type InteractionLimitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetExpiry()(*InteractionExpiry) + GetLimit()(*InteractionGroup) + SetExpiry(value *InteractionExpiry)() + SetLimit(value *InteractionGroup)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/interaction_limit_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/interaction_limit_response.go new file mode 100644 index 000000000..6d1434ae9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/interaction_limit_response.go @@ -0,0 +1,141 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// InteractionLimitResponse interaction limit settings. +type InteractionLimitResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The expires_at property + expires_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. + limit *InteractionGroup + // The origin property + origin *string +} +// NewInteractionLimitResponse instantiates a new InteractionLimitResponse and sets the default values. +func NewInteractionLimitResponse()(*InteractionLimitResponse) { + m := &InteractionLimitResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateInteractionLimitResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInteractionLimitResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInteractionLimitResponse(), 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 *InteractionLimitResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetExpiresAt gets the expires_at property value. The expires_at property +// returns a *Time when successful +func (m *InteractionLimitResponse) GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.expires_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *InteractionLimitResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresAt(val) + } + return nil + } + res["limit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseInteractionGroup) + if err != nil { + return err + } + if val != nil { + m.SetLimit(val.(*InteractionGroup)) + } + return nil + } + res["origin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrigin(val) + } + return nil + } + return res +} +// GetLimit gets the limit property value. The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. +// returns a *InteractionGroup when successful +func (m *InteractionLimitResponse) GetLimit()(*InteractionGroup) { + return m.limit +} +// GetOrigin gets the origin property value. The origin property +// returns a *string when successful +func (m *InteractionLimitResponse) GetOrigin()(*string) { + return m.origin +} +// Serialize serializes information the current object +func (m *InteractionLimitResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("expires_at", m.GetExpiresAt()) + if err != nil { + return err + } + } + if m.GetLimit() != nil { + cast := (*m.GetLimit()).String() + err := writer.WriteStringValue("limit", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("origin", m.GetOrigin()) + 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 *InteractionLimitResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetExpiresAt sets the expires_at property value. The expires_at property +func (m *InteractionLimitResponse) SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.expires_at = value +} +// SetLimit sets the limit property value. The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. +func (m *InteractionLimitResponse) SetLimit(value *InteractionGroup)() { + m.limit = value +} +// SetOrigin sets the origin property value. The origin property +func (m *InteractionLimitResponse) SetOrigin(value *string)() { + m.origin = value +} +type InteractionLimitResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetLimit()(*InteractionGroup) + GetOrigin()(*string) + SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetLimit(value *InteractionGroup)() + SetOrigin(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issue.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue.go new file mode 100644 index 000000000..465c7bb2b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue.go @@ -0,0 +1,1059 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Issue issues are a great way to keep track of tasks, enhancements, and bugs for your projects. +type Issue struct { + // The active_lock_reason property + active_lock_reason *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee NullableSimpleUserable + // The assignees property + assignees []SimpleUserable + // How the author is associated with the repository. + author_association *AuthorAssociation + // Contents of the issue + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // The closed_at property + closed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + closed_by NullableSimpleUserable + // The comments property + comments *int32 + // The comments_url property + comments_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The draft property + draft *bool + // The events_url property + events_url *string + // The html_url property + html_url *string + // The id property + id *int64 + // Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository + labels []string + // The labels_url property + labels_url *string + // The locked property + locked *bool + // A collection of related issues and pull requests. + milestone NullableMilestoneable + // The node_id property + node_id *string + // Number uniquely identifying the issue within its repository + number *int32 + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The pull_request property + pull_request Issue_pull_requestable + // The reactions property + reactions ReactionRollupable + // A repository on GitHub. + repository Repositoryable + // The repository_url property + repository_url *string + // State of the issue; either 'open' or 'closed' + state *string + // The reason for the current state + state_reason *Issue_state_reason + // The timeline_url property + timeline_url *string + // Title of the issue + title *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // URL for the issue + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewIssue instantiates a new Issue and sets the default values. +func NewIssue()(*Issue) { + m := &Issue{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssue(), nil +} +// GetActiveLockReason gets the active_lock_reason property value. The active_lock_reason property +// returns a *string when successful +func (m *Issue) GetActiveLockReason()(*string) { + return m.active_lock_reason +} +// 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 *Issue) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Issue) GetAssignee()(NullableSimpleUserable) { + return m.assignee +} +// GetAssignees gets the assignees property value. The assignees property +// returns a []SimpleUserable when successful +func (m *Issue) GetAssignees()([]SimpleUserable) { + return m.assignees +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *Issue) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. Contents of the issue +// returns a *string when successful +func (m *Issue) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *Issue) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *Issue) GetBodyText()(*string) { + return m.body_text +} +// GetClosedAt gets the closed_at property value. The closed_at property +// returns a *Time when successful +func (m *Issue) GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.closed_at +} +// GetClosedBy gets the closed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Issue) GetClosedBy()(NullableSimpleUserable) { + return m.closed_by +} +// GetComments gets the comments property value. The comments property +// returns a *int32 when successful +func (m *Issue) GetComments()(*int32) { + return m.comments +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *Issue) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Issue) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDraft gets the draft property value. The draft property +// returns a *bool when successful +func (m *Issue) GetDraft()(*bool) { + return m.draft +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *Issue) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Issue) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active_lock_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetActiveLockReason(val) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(NullableSimpleUserable)) + } + return nil + } + res["assignees"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetAssignees(res) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + res["closed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetClosedAt(val) + } + return nil + } + res["closed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetClosedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetComments(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetLabels(res) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["locked"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLocked(val) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableMilestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(NullableMilestoneable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["pull_request"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssue_pull_requestFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPullRequest(val.(Issue_pull_requestable)) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(Repositoryable)) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["state_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseIssue_state_reason) + if err != nil { + return err + } + if val != nil { + m.SetStateReason(val.(*Issue_state_reason)) + } + return nil + } + res["timeline_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTimelineUrl(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Issue) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *Issue) GetId()(*int64) { + return m.id +} +// GetLabels gets the labels property value. Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository +// returns a []string when successful +func (m *Issue) GetLabels()([]string) { + return m.labels +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *Issue) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLocked gets the locked property value. The locked property +// returns a *bool when successful +func (m *Issue) GetLocked()(*bool) { + return m.locked +} +// GetMilestone gets the milestone property value. A collection of related issues and pull requests. +// returns a NullableMilestoneable when successful +func (m *Issue) GetMilestone()(NullableMilestoneable) { + return m.milestone +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Issue) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. Number uniquely identifying the issue within its repository +// returns a *int32 when successful +func (m *Issue) GetNumber()(*int32) { + return m.number +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *Issue) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetPullRequest gets the pull_request property value. The pull_request property +// returns a Issue_pull_requestable when successful +func (m *Issue) GetPullRequest()(Issue_pull_requestable) { + return m.pull_request +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *Issue) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetRepository gets the repository property value. A repository on GitHub. +// returns a Repositoryable when successful +func (m *Issue) GetRepository()(Repositoryable) { + return m.repository +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *Issue) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetState gets the state property value. State of the issue; either 'open' or 'closed' +// returns a *string when successful +func (m *Issue) GetState()(*string) { + return m.state +} +// GetStateReason gets the state_reason property value. The reason for the current state +// returns a *Issue_state_reason when successful +func (m *Issue) GetStateReason()(*Issue_state_reason) { + return m.state_reason +} +// GetTimelineUrl gets the timeline_url property value. The timeline_url property +// returns a *string when successful +func (m *Issue) GetTimelineUrl()(*string) { + return m.timeline_url +} +// GetTitle gets the title property value. Title of the issue +// returns a *string when successful +func (m *Issue) GetTitle()(*string) { + return m.title +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Issue) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. URL for the issue +// returns a *string when successful +func (m *Issue) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Issue) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *Issue) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("active_lock_reason", m.GetActiveLockReason()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + if m.GetAssignees() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAssignees())) + for i, v := range m.GetAssignees() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("assignees", cast) + if err != nil { + return err + } + } + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("closed_at", m.GetClosedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("closed_by", m.GetClosedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("locked", m.GetLocked()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pull_request", m.GetPullRequest()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + if m.GetStateReason() != nil { + cast := (*m.GetStateReason()).String() + err := writer.WriteStringValue("state_reason", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("timeline_url", m.GetTimelineUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActiveLockReason sets the active_lock_reason property value. The active_lock_reason property +func (m *Issue) SetActiveLockReason(value *string)() { + m.active_lock_reason = value +} +// 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 *Issue) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *Issue) SetAssignee(value NullableSimpleUserable)() { + m.assignee = value +} +// SetAssignees sets the assignees property value. The assignees property +func (m *Issue) SetAssignees(value []SimpleUserable)() { + m.assignees = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *Issue) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. Contents of the issue +func (m *Issue) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *Issue) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *Issue) SetBodyText(value *string)() { + m.body_text = value +} +// SetClosedAt sets the closed_at property value. The closed_at property +func (m *Issue) SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.closed_at = value +} +// SetClosedBy sets the closed_by property value. A GitHub user. +func (m *Issue) SetClosedBy(value NullableSimpleUserable)() { + m.closed_by = value +} +// SetComments sets the comments property value. The comments property +func (m *Issue) SetComments(value *int32)() { + m.comments = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *Issue) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Issue) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDraft sets the draft property value. The draft property +func (m *Issue) SetDraft(value *bool)() { + m.draft = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *Issue) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Issue) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Issue) SetId(value *int64)() { + m.id = value +} +// SetLabels sets the labels property value. Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository +func (m *Issue) SetLabels(value []string)() { + m.labels = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *Issue) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLocked sets the locked property value. The locked property +func (m *Issue) SetLocked(value *bool)() { + m.locked = value +} +// SetMilestone sets the milestone property value. A collection of related issues and pull requests. +func (m *Issue) SetMilestone(value NullableMilestoneable)() { + m.milestone = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Issue) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. Number uniquely identifying the issue within its repository +func (m *Issue) SetNumber(value *int32)() { + m.number = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *Issue) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetPullRequest sets the pull_request property value. The pull_request property +func (m *Issue) SetPullRequest(value Issue_pull_requestable)() { + m.pull_request = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *Issue) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetRepository sets the repository property value. A repository on GitHub. +func (m *Issue) SetRepository(value Repositoryable)() { + m.repository = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *Issue) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetState sets the state property value. State of the issue; either 'open' or 'closed' +func (m *Issue) SetState(value *string)() { + m.state = value +} +// SetStateReason sets the state_reason property value. The reason for the current state +func (m *Issue) SetStateReason(value *Issue_state_reason)() { + m.state_reason = value +} +// SetTimelineUrl sets the timeline_url property value. The timeline_url property +func (m *Issue) SetTimelineUrl(value *string)() { + m.timeline_url = value +} +// SetTitle sets the title property value. Title of the issue +func (m *Issue) SetTitle(value *string)() { + m.title = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Issue) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. URL for the issue +func (m *Issue) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *Issue) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type Issueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActiveLockReason()(*string) + GetAssignee()(NullableSimpleUserable) + GetAssignees()([]SimpleUserable) + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetClosedBy()(NullableSimpleUserable) + GetComments()(*int32) + GetCommentsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDraft()(*bool) + GetEventsUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLabels()([]string) + GetLabelsUrl()(*string) + GetLocked()(*bool) + GetMilestone()(NullableMilestoneable) + GetNodeId()(*string) + GetNumber()(*int32) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetPullRequest()(Issue_pull_requestable) + GetReactions()(ReactionRollupable) + GetRepository()(Repositoryable) + GetRepositoryUrl()(*string) + GetState()(*string) + GetStateReason()(*Issue_state_reason) + GetTimelineUrl()(*string) + GetTitle()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetActiveLockReason(value *string)() + SetAssignee(value NullableSimpleUserable)() + SetAssignees(value []SimpleUserable)() + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetClosedBy(value NullableSimpleUserable)() + SetComments(value *int32)() + SetCommentsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDraft(value *bool)() + SetEventsUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLabels(value []string)() + SetLabelsUrl(value *string)() + SetLocked(value *bool)() + SetMilestone(value NullableMilestoneable)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetPullRequest(value Issue_pull_requestable)() + SetReactions(value ReactionRollupable)() + SetRepository(value Repositoryable)() + SetRepositoryUrl(value *string)() + SetState(value *string)() + SetStateReason(value *Issue_state_reason)() + SetTimelineUrl(value *string)() + SetTitle(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issue503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue503_error.go new file mode 100644 index 000000000..13e279b0d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Issue503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewIssue503Error instantiates a new Issue503Error and sets the default values. +func NewIssue503Error()(*Issue503Error) { + m := &Issue503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssue503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssue503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssue503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Issue503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Issue503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Issue503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Issue503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Issue503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Issue503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Issue503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *Issue503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Issue503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Issue503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Issue503Error) SetMessage(value *string)() { + m.message = value +} +type Issue503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_comment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_comment.go new file mode 100644 index 000000000..f462410b4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_comment.go @@ -0,0 +1,460 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IssueComment comments provide a way for people to collaborate on an issue. +type IssueComment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How the author is associated with the repository. + author_association *AuthorAssociation + // Contents of the issue comment + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The html_url property + html_url *string + // Unique identifier of the issue comment + id *int64 + // The issue_url property + issue_url *string + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The reactions property + reactions ReactionRollupable + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // URL for the issue comment + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewIssueComment instantiates a new IssueComment and sets the default values. +func NewIssueComment()(*IssueComment) { + m := &IssueComment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueComment(), 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 *IssueComment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *IssueComment) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. Contents of the issue comment +// returns a *string when successful +func (m *IssueComment) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *IssueComment) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *IssueComment) GetBodyText()(*string) { + return m.body_text +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *IssueComment) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["issue_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *IssueComment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the issue comment +// returns a *int64 when successful +func (m *IssueComment) GetId()(*int64) { + return m.id +} +// GetIssueUrl gets the issue_url property value. The issue_url property +// returns a *string when successful +func (m *IssueComment) GetIssueUrl()(*string) { + return m.issue_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *IssueComment) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *IssueComment) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *IssueComment) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *IssueComment) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. URL for the issue comment +// returns a *string when successful +func (m *IssueComment) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *IssueComment) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *IssueComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_url", m.GetIssueUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *IssueComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *IssueComment) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. Contents of the issue comment +func (m *IssueComment) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *IssueComment) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *IssueComment) SetBodyText(value *string)() { + m.body_text = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *IssueComment) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *IssueComment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the issue comment +func (m *IssueComment) SetId(value *int64)() { + m.id = value +} +// SetIssueUrl sets the issue_url property value. The issue_url property +func (m *IssueComment) SetIssueUrl(value *string)() { + m.issue_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *IssueComment) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *IssueComment) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *IssueComment) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *IssueComment) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. URL for the issue comment +func (m *IssueComment) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *IssueComment) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type IssueCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueUrl()(*string) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetReactions()(ReactionRollupable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueUrl(value *string)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetReactions(value ReactionRollupable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event.go new file mode 100644 index 000000000..43fcef637 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event.go @@ -0,0 +1,692 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IssueEvent issue Event +type IssueEvent struct { + // A GitHub user. + actor NullableSimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee NullableSimpleUserable + // A GitHub user. + assigner NullableSimpleUserable + // How the author is associated with the repository. + author_association *AuthorAssociation + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The dismissed_review property + dismissed_review IssueEventDismissedReviewable + // The event property + event *string + // The id property + id *int64 + // Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. + issue NullableIssueable + // Issue Event Label + label IssueEventLabelable + // The lock_reason property + lock_reason *string + // Issue Event Milestone + milestone IssueEventMilestoneable + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // Issue Event Project Card + project_card IssueEventProjectCardable + // Issue Event Rename + rename IssueEventRenameable + // A GitHub user. + requested_reviewer NullableSimpleUserable + // Groups of organization members that gives permissions on specified repositories. + requested_team Teamable + // A GitHub user. + review_requester NullableSimpleUserable + // The url property + url *string +} +// NewIssueEvent instantiates a new IssueEvent and sets the default values. +func NewIssueEvent()(*IssueEvent) { + m := &IssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *IssueEvent) GetActor()(NullableSimpleUserable) { + return m.actor +} +// 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 *IssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *IssueEvent) GetAssignee()(NullableSimpleUserable) { + return m.assignee +} +// GetAssigner gets the assigner property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *IssueEvent) GetAssigner()(NullableSimpleUserable) { + return m.assigner +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *IssueEvent) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *IssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *IssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *IssueEvent) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDismissedReview gets the dismissed_review property value. The dismissed_review property +// returns a IssueEventDismissedReviewable when successful +func (m *IssueEvent) GetDismissedReview()(IssueEventDismissedReviewable) { + return m.dismissed_review +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *IssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(NullableSimpleUserable)) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(NullableSimpleUserable)) + } + return nil + } + res["assigner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssigner(val.(NullableSimpleUserable)) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["dismissed_review"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueEventDismissedReviewFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissedReview(val.(IssueEventDismissedReviewable)) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["issue"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIssueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIssue(val.(NullableIssueable)) + } + return nil + } + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueEventLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLabel(val.(IssueEventLabelable)) + } + return nil + } + res["lock_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLockReason(val) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueEventMilestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(IssueEventMilestoneable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["project_card"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueEventProjectCardFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProjectCard(val.(IssueEventProjectCardable)) + } + return nil + } + res["rename"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueEventRenameFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRename(val.(IssueEventRenameable)) + } + return nil + } + res["requested_reviewer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequestedReviewer(val.(NullableSimpleUserable)) + } + return nil + } + res["requested_team"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequestedTeam(val.(Teamable)) + } + return nil + } + res["review_requester"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewRequester(val.(NullableSimpleUserable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *IssueEvent) GetId()(*int64) { + return m.id +} +// GetIssue gets the issue property value. Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. +// returns a NullableIssueable when successful +func (m *IssueEvent) GetIssue()(NullableIssueable) { + return m.issue +} +// GetLabel gets the label property value. Issue Event Label +// returns a IssueEventLabelable when successful +func (m *IssueEvent) GetLabel()(IssueEventLabelable) { + return m.label +} +// GetLockReason gets the lock_reason property value. The lock_reason property +// returns a *string when successful +func (m *IssueEvent) GetLockReason()(*string) { + return m.lock_reason +} +// GetMilestone gets the milestone property value. Issue Event Milestone +// returns a IssueEventMilestoneable when successful +func (m *IssueEvent) GetMilestone()(IssueEventMilestoneable) { + return m.milestone +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *IssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *IssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetProjectCard gets the project_card property value. Issue Event Project Card +// returns a IssueEventProjectCardable when successful +func (m *IssueEvent) GetProjectCard()(IssueEventProjectCardable) { + return m.project_card +} +// GetRename gets the rename property value. Issue Event Rename +// returns a IssueEventRenameable when successful +func (m *IssueEvent) GetRename()(IssueEventRenameable) { + return m.rename +} +// GetRequestedReviewer gets the requested_reviewer property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *IssueEvent) GetRequestedReviewer()(NullableSimpleUserable) { + return m.requested_reviewer +} +// GetRequestedTeam gets the requested_team property value. Groups of organization members that gives permissions on specified repositories. +// returns a Teamable when successful +func (m *IssueEvent) GetRequestedTeam()(Teamable) { + return m.requested_team +} +// GetReviewRequester gets the review_requester property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *IssueEvent) GetReviewRequester()(NullableSimpleUserable) { + return m.review_requester +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *IssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *IssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assigner", m.GetAssigner()) + if err != nil { + return err + } + } + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("dismissed_review", m.GetDismissedReview()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("issue", m.GetIssue()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("lock_reason", m.GetLockReason()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("project_card", m.GetProjectCard()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("rename", m.GetRename()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("requested_reviewer", m.GetRequestedReviewer()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("requested_team", m.GetRequestedTeam()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("review_requester", m.GetReviewRequester()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *IssueEvent) SetActor(value NullableSimpleUserable)() { + m.actor = value +} +// 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 *IssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *IssueEvent) SetAssignee(value NullableSimpleUserable)() { + m.assignee = value +} +// SetAssigner sets the assigner property value. A GitHub user. +func (m *IssueEvent) SetAssigner(value NullableSimpleUserable)() { + m.assigner = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *IssueEvent) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *IssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *IssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *IssueEvent) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDismissedReview sets the dismissed_review property value. The dismissed_review property +func (m *IssueEvent) SetDismissedReview(value IssueEventDismissedReviewable)() { + m.dismissed_review = value +} +// SetEvent sets the event property value. The event property +func (m *IssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *IssueEvent) SetId(value *int64)() { + m.id = value +} +// SetIssue sets the issue property value. Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. +func (m *IssueEvent) SetIssue(value NullableIssueable)() { + m.issue = value +} +// SetLabel sets the label property value. Issue Event Label +func (m *IssueEvent) SetLabel(value IssueEventLabelable)() { + m.label = value +} +// SetLockReason sets the lock_reason property value. The lock_reason property +func (m *IssueEvent) SetLockReason(value *string)() { + m.lock_reason = value +} +// SetMilestone sets the milestone property value. Issue Event Milestone +func (m *IssueEvent) SetMilestone(value IssueEventMilestoneable)() { + m.milestone = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *IssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *IssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetProjectCard sets the project_card property value. Issue Event Project Card +func (m *IssueEvent) SetProjectCard(value IssueEventProjectCardable)() { + m.project_card = value +} +// SetRename sets the rename property value. Issue Event Rename +func (m *IssueEvent) SetRename(value IssueEventRenameable)() { + m.rename = value +} +// SetRequestedReviewer sets the requested_reviewer property value. A GitHub user. +func (m *IssueEvent) SetRequestedReviewer(value NullableSimpleUserable)() { + m.requested_reviewer = value +} +// SetRequestedTeam sets the requested_team property value. Groups of organization members that gives permissions on specified repositories. +func (m *IssueEvent) SetRequestedTeam(value Teamable)() { + m.requested_team = value +} +// SetReviewRequester sets the review_requester property value. A GitHub user. +func (m *IssueEvent) SetReviewRequester(value NullableSimpleUserable)() { + m.review_requester = value +} +// SetUrl sets the url property value. The url property +func (m *IssueEvent) SetUrl(value *string)() { + m.url = value +} +type IssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(NullableSimpleUserable) + GetAssignee()(NullableSimpleUserable) + GetAssigner()(NullableSimpleUserable) + GetAuthorAssociation()(*AuthorAssociation) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedReview()(IssueEventDismissedReviewable) + GetEvent()(*string) + GetId()(*int64) + GetIssue()(NullableIssueable) + GetLabel()(IssueEventLabelable) + GetLockReason()(*string) + GetMilestone()(IssueEventMilestoneable) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetProjectCard()(IssueEventProjectCardable) + GetRename()(IssueEventRenameable) + GetRequestedReviewer()(NullableSimpleUserable) + GetRequestedTeam()(Teamable) + GetReviewRequester()(NullableSimpleUserable) + GetUrl()(*string) + SetActor(value NullableSimpleUserable)() + SetAssignee(value NullableSimpleUserable)() + SetAssigner(value NullableSimpleUserable)() + SetAuthorAssociation(value *AuthorAssociation)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedReview(value IssueEventDismissedReviewable)() + SetEvent(value *string)() + SetId(value *int64)() + SetIssue(value NullableIssueable)() + SetLabel(value IssueEventLabelable)() + SetLockReason(value *string)() + SetMilestone(value IssueEventMilestoneable)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetProjectCard(value IssueEventProjectCardable)() + SetRename(value IssueEventRenameable)() + SetRequestedReviewer(value NullableSimpleUserable)() + SetRequestedTeam(value Teamable)() + SetReviewRequester(value NullableSimpleUserable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_dismissed_review.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_dismissed_review.go new file mode 100644 index 000000000..4e4a9e39c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_dismissed_review.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type IssueEventDismissedReview struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The dismissal_commit_id property + dismissal_commit_id *string + // The dismissal_message property + dismissal_message *string + // The review_id property + review_id *int32 + // The state property + state *string +} +// NewIssueEventDismissedReview instantiates a new IssueEventDismissedReview and sets the default values. +func NewIssueEventDismissedReview()(*IssueEventDismissedReview) { + m := &IssueEventDismissedReview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueEventDismissedReviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueEventDismissedReviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueEventDismissedReview(), 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 *IssueEventDismissedReview) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDismissalCommitId gets the dismissal_commit_id property value. The dismissal_commit_id property +// returns a *string when successful +func (m *IssueEventDismissedReview) GetDismissalCommitId()(*string) { + return m.dismissal_commit_id +} +// GetDismissalMessage gets the dismissal_message property value. The dismissal_message property +// returns a *string when successful +func (m *IssueEventDismissedReview) GetDismissalMessage()(*string) { + return m.dismissal_message +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueEventDismissedReview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["dismissal_commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissalCommitId(val) + } + return nil + } + res["dismissal_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissalMessage(val) + } + return nil + } + res["review_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetReviewId(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + return res +} +// GetReviewId gets the review_id property value. The review_id property +// returns a *int32 when successful +func (m *IssueEventDismissedReview) GetReviewId()(*int32) { + return m.review_id +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *IssueEventDismissedReview) GetState()(*string) { + return m.state +} +// Serialize serializes information the current object +func (m *IssueEventDismissedReview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("dismissal_commit_id", m.GetDismissalCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("dismissal_message", m.GetDismissalMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("review_id", m.GetReviewId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + 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 *IssueEventDismissedReview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDismissalCommitId sets the dismissal_commit_id property value. The dismissal_commit_id property +func (m *IssueEventDismissedReview) SetDismissalCommitId(value *string)() { + m.dismissal_commit_id = value +} +// SetDismissalMessage sets the dismissal_message property value. The dismissal_message property +func (m *IssueEventDismissedReview) SetDismissalMessage(value *string)() { + m.dismissal_message = value +} +// SetReviewId sets the review_id property value. The review_id property +func (m *IssueEventDismissedReview) SetReviewId(value *int32)() { + m.review_id = value +} +// SetState sets the state property value. The state property +func (m *IssueEventDismissedReview) SetState(value *string)() { + m.state = value +} +type IssueEventDismissedReviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDismissalCommitId()(*string) + GetDismissalMessage()(*string) + GetReviewId()(*int32) + GetState()(*string) + SetDismissalCommitId(value *string)() + SetDismissalMessage(value *string)() + SetReviewId(value *int32)() + SetState(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_for_issue.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_for_issue.go new file mode 100644 index 000000000..498fd5c2d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_for_issue.go @@ -0,0 +1,417 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IssueEventForIssue composed type wrapper for classes AddedToProjectIssueEventable, AssignedIssueEventable, ConvertedNoteToIssueIssueEventable, DemilestonedIssueEventable, LabeledIssueEventable, LockedIssueEventable, MilestonedIssueEventable, MovedColumnInProjectIssueEventable, RemovedFromProjectIssueEventable, RenamedIssueEventable, ReviewDismissedIssueEventable, ReviewRequestedIssueEventable, ReviewRequestRemovedIssueEventable, UnassignedIssueEventable, UnlabeledIssueEventable +type IssueEventForIssue struct { + // Composed type representation for type AddedToProjectIssueEventable + addedToProjectIssueEvent AddedToProjectIssueEventable + // Composed type representation for type AssignedIssueEventable + assignedIssueEvent AssignedIssueEventable + // Composed type representation for type ConvertedNoteToIssueIssueEventable + convertedNoteToIssueIssueEvent ConvertedNoteToIssueIssueEventable + // Composed type representation for type DemilestonedIssueEventable + demilestonedIssueEvent DemilestonedIssueEventable + // Composed type representation for type LabeledIssueEventable + labeledIssueEvent LabeledIssueEventable + // Composed type representation for type LockedIssueEventable + lockedIssueEvent LockedIssueEventable + // Composed type representation for type MilestonedIssueEventable + milestonedIssueEvent MilestonedIssueEventable + // Composed type representation for type MovedColumnInProjectIssueEventable + movedColumnInProjectIssueEvent MovedColumnInProjectIssueEventable + // Composed type representation for type RemovedFromProjectIssueEventable + removedFromProjectIssueEvent RemovedFromProjectIssueEventable + // Composed type representation for type RenamedIssueEventable + renamedIssueEvent RenamedIssueEventable + // Composed type representation for type ReviewDismissedIssueEventable + reviewDismissedIssueEvent ReviewDismissedIssueEventable + // Composed type representation for type ReviewRequestedIssueEventable + reviewRequestedIssueEvent ReviewRequestedIssueEventable + // Composed type representation for type ReviewRequestRemovedIssueEventable + reviewRequestRemovedIssueEvent ReviewRequestRemovedIssueEventable + // Composed type representation for type UnassignedIssueEventable + unassignedIssueEvent UnassignedIssueEventable + // Composed type representation for type UnlabeledIssueEventable + unlabeledIssueEvent UnlabeledIssueEventable +} +// NewIssueEventForIssue instantiates a new IssueEventForIssue and sets the default values. +func NewIssueEventForIssue()(*IssueEventForIssue) { + m := &IssueEventForIssue{ + } + return m +} +// CreateIssueEventForIssueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueEventForIssueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewIssueEventForIssue() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateAddedToProjectIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(AddedToProjectIssueEventable); ok { + result.SetAddedToProjectIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateAssignedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(AssignedIssueEventable); ok { + result.SetAssignedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateConvertedNoteToIssueIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ConvertedNoteToIssueIssueEventable); ok { + result.SetConvertedNoteToIssueIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateDemilestonedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(DemilestonedIssueEventable); ok { + result.SetDemilestonedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateLabeledIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(LabeledIssueEventable); ok { + result.SetLabeledIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateLockedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(LockedIssueEventable); ok { + result.SetLockedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateMilestonedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(MilestonedIssueEventable); ok { + result.SetMilestonedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateMovedColumnInProjectIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(MovedColumnInProjectIssueEventable); ok { + result.SetMovedColumnInProjectIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateRemovedFromProjectIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(RemovedFromProjectIssueEventable); ok { + result.SetRemovedFromProjectIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateRenamedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(RenamedIssueEventable); ok { + result.SetRenamedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateReviewDismissedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ReviewDismissedIssueEventable); ok { + result.SetReviewDismissedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateReviewRequestedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ReviewRequestedIssueEventable); ok { + result.SetReviewRequestedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateReviewRequestRemovedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ReviewRequestRemovedIssueEventable); ok { + result.SetReviewRequestRemovedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateUnassignedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(UnassignedIssueEventable); ok { + result.SetUnassignedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateUnlabeledIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(UnlabeledIssueEventable); ok { + result.SetUnlabeledIssueEvent(cast) + } + } + } + return result, nil +} +// GetAddedToProjectIssueEvent gets the addedToProjectIssueEvent property value. Composed type representation for type AddedToProjectIssueEventable +// returns a AddedToProjectIssueEventable when successful +func (m *IssueEventForIssue) GetAddedToProjectIssueEvent()(AddedToProjectIssueEventable) { + return m.addedToProjectIssueEvent +} +// GetAssignedIssueEvent gets the assignedIssueEvent property value. Composed type representation for type AssignedIssueEventable +// returns a AssignedIssueEventable when successful +func (m *IssueEventForIssue) GetAssignedIssueEvent()(AssignedIssueEventable) { + return m.assignedIssueEvent +} +// GetConvertedNoteToIssueIssueEvent gets the convertedNoteToIssueIssueEvent property value. Composed type representation for type ConvertedNoteToIssueIssueEventable +// returns a ConvertedNoteToIssueIssueEventable when successful +func (m *IssueEventForIssue) GetConvertedNoteToIssueIssueEvent()(ConvertedNoteToIssueIssueEventable) { + return m.convertedNoteToIssueIssueEvent +} +// GetDemilestonedIssueEvent gets the demilestonedIssueEvent property value. Composed type representation for type DemilestonedIssueEventable +// returns a DemilestonedIssueEventable when successful +func (m *IssueEventForIssue) GetDemilestonedIssueEvent()(DemilestonedIssueEventable) { + return m.demilestonedIssueEvent +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueEventForIssue) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *IssueEventForIssue) GetIsComposedType()(bool) { + return true +} +// GetLabeledIssueEvent gets the labeledIssueEvent property value. Composed type representation for type LabeledIssueEventable +// returns a LabeledIssueEventable when successful +func (m *IssueEventForIssue) GetLabeledIssueEvent()(LabeledIssueEventable) { + return m.labeledIssueEvent +} +// GetLockedIssueEvent gets the lockedIssueEvent property value. Composed type representation for type LockedIssueEventable +// returns a LockedIssueEventable when successful +func (m *IssueEventForIssue) GetLockedIssueEvent()(LockedIssueEventable) { + return m.lockedIssueEvent +} +// GetMilestonedIssueEvent gets the milestonedIssueEvent property value. Composed type representation for type MilestonedIssueEventable +// returns a MilestonedIssueEventable when successful +func (m *IssueEventForIssue) GetMilestonedIssueEvent()(MilestonedIssueEventable) { + return m.milestonedIssueEvent +} +// GetMovedColumnInProjectIssueEvent gets the movedColumnInProjectIssueEvent property value. Composed type representation for type MovedColumnInProjectIssueEventable +// returns a MovedColumnInProjectIssueEventable when successful +func (m *IssueEventForIssue) GetMovedColumnInProjectIssueEvent()(MovedColumnInProjectIssueEventable) { + return m.movedColumnInProjectIssueEvent +} +// GetRemovedFromProjectIssueEvent gets the removedFromProjectIssueEvent property value. Composed type representation for type RemovedFromProjectIssueEventable +// returns a RemovedFromProjectIssueEventable when successful +func (m *IssueEventForIssue) GetRemovedFromProjectIssueEvent()(RemovedFromProjectIssueEventable) { + return m.removedFromProjectIssueEvent +} +// GetRenamedIssueEvent gets the renamedIssueEvent property value. Composed type representation for type RenamedIssueEventable +// returns a RenamedIssueEventable when successful +func (m *IssueEventForIssue) GetRenamedIssueEvent()(RenamedIssueEventable) { + return m.renamedIssueEvent +} +// GetReviewDismissedIssueEvent gets the reviewDismissedIssueEvent property value. Composed type representation for type ReviewDismissedIssueEventable +// returns a ReviewDismissedIssueEventable when successful +func (m *IssueEventForIssue) GetReviewDismissedIssueEvent()(ReviewDismissedIssueEventable) { + return m.reviewDismissedIssueEvent +} +// GetReviewRequestedIssueEvent gets the reviewRequestedIssueEvent property value. Composed type representation for type ReviewRequestedIssueEventable +// returns a ReviewRequestedIssueEventable when successful +func (m *IssueEventForIssue) GetReviewRequestedIssueEvent()(ReviewRequestedIssueEventable) { + return m.reviewRequestedIssueEvent +} +// GetReviewRequestRemovedIssueEvent gets the reviewRequestRemovedIssueEvent property value. Composed type representation for type ReviewRequestRemovedIssueEventable +// returns a ReviewRequestRemovedIssueEventable when successful +func (m *IssueEventForIssue) GetReviewRequestRemovedIssueEvent()(ReviewRequestRemovedIssueEventable) { + return m.reviewRequestRemovedIssueEvent +} +// GetUnassignedIssueEvent gets the unassignedIssueEvent property value. Composed type representation for type UnassignedIssueEventable +// returns a UnassignedIssueEventable when successful +func (m *IssueEventForIssue) GetUnassignedIssueEvent()(UnassignedIssueEventable) { + return m.unassignedIssueEvent +} +// GetUnlabeledIssueEvent gets the unlabeledIssueEvent property value. Composed type representation for type UnlabeledIssueEventable +// returns a UnlabeledIssueEventable when successful +func (m *IssueEventForIssue) GetUnlabeledIssueEvent()(UnlabeledIssueEventable) { + return m.unlabeledIssueEvent +} +// Serialize serializes information the current object +func (m *IssueEventForIssue) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAddedToProjectIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetAddedToProjectIssueEvent()) + if err != nil { + return err + } + } else if m.GetAssignedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetAssignedIssueEvent()) + if err != nil { + return err + } + } else if m.GetConvertedNoteToIssueIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetConvertedNoteToIssueIssueEvent()) + if err != nil { + return err + } + } else if m.GetDemilestonedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetDemilestonedIssueEvent()) + if err != nil { + return err + } + } else if m.GetLabeledIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetLabeledIssueEvent()) + if err != nil { + return err + } + } else if m.GetLockedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetLockedIssueEvent()) + if err != nil { + return err + } + } else if m.GetMilestonedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetMilestonedIssueEvent()) + if err != nil { + return err + } + } else if m.GetMovedColumnInProjectIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetMovedColumnInProjectIssueEvent()) + if err != nil { + return err + } + } else if m.GetRemovedFromProjectIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetRemovedFromProjectIssueEvent()) + if err != nil { + return err + } + } else if m.GetRenamedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetRenamedIssueEvent()) + if err != nil { + return err + } + } else if m.GetReviewDismissedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetReviewDismissedIssueEvent()) + if err != nil { + return err + } + } else if m.GetReviewRequestedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetReviewRequestedIssueEvent()) + if err != nil { + return err + } + } else if m.GetReviewRequestRemovedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetReviewRequestRemovedIssueEvent()) + if err != nil { + return err + } + } else if m.GetUnassignedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetUnassignedIssueEvent()) + if err != nil { + return err + } + } else if m.GetUnlabeledIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetUnlabeledIssueEvent()) + if err != nil { + return err + } + } + return nil +} +// SetAddedToProjectIssueEvent sets the addedToProjectIssueEvent property value. Composed type representation for type AddedToProjectIssueEventable +func (m *IssueEventForIssue) SetAddedToProjectIssueEvent(value AddedToProjectIssueEventable)() { + m.addedToProjectIssueEvent = value +} +// SetAssignedIssueEvent sets the assignedIssueEvent property value. Composed type representation for type AssignedIssueEventable +func (m *IssueEventForIssue) SetAssignedIssueEvent(value AssignedIssueEventable)() { + m.assignedIssueEvent = value +} +// SetConvertedNoteToIssueIssueEvent sets the convertedNoteToIssueIssueEvent property value. Composed type representation for type ConvertedNoteToIssueIssueEventable +func (m *IssueEventForIssue) SetConvertedNoteToIssueIssueEvent(value ConvertedNoteToIssueIssueEventable)() { + m.convertedNoteToIssueIssueEvent = value +} +// SetDemilestonedIssueEvent sets the demilestonedIssueEvent property value. Composed type representation for type DemilestonedIssueEventable +func (m *IssueEventForIssue) SetDemilestonedIssueEvent(value DemilestonedIssueEventable)() { + m.demilestonedIssueEvent = value +} +// SetLabeledIssueEvent sets the labeledIssueEvent property value. Composed type representation for type LabeledIssueEventable +func (m *IssueEventForIssue) SetLabeledIssueEvent(value LabeledIssueEventable)() { + m.labeledIssueEvent = value +} +// SetLockedIssueEvent sets the lockedIssueEvent property value. Composed type representation for type LockedIssueEventable +func (m *IssueEventForIssue) SetLockedIssueEvent(value LockedIssueEventable)() { + m.lockedIssueEvent = value +} +// SetMilestonedIssueEvent sets the milestonedIssueEvent property value. Composed type representation for type MilestonedIssueEventable +func (m *IssueEventForIssue) SetMilestonedIssueEvent(value MilestonedIssueEventable)() { + m.milestonedIssueEvent = value +} +// SetMovedColumnInProjectIssueEvent sets the movedColumnInProjectIssueEvent property value. Composed type representation for type MovedColumnInProjectIssueEventable +func (m *IssueEventForIssue) SetMovedColumnInProjectIssueEvent(value MovedColumnInProjectIssueEventable)() { + m.movedColumnInProjectIssueEvent = value +} +// SetRemovedFromProjectIssueEvent sets the removedFromProjectIssueEvent property value. Composed type representation for type RemovedFromProjectIssueEventable +func (m *IssueEventForIssue) SetRemovedFromProjectIssueEvent(value RemovedFromProjectIssueEventable)() { + m.removedFromProjectIssueEvent = value +} +// SetRenamedIssueEvent sets the renamedIssueEvent property value. Composed type representation for type RenamedIssueEventable +func (m *IssueEventForIssue) SetRenamedIssueEvent(value RenamedIssueEventable)() { + m.renamedIssueEvent = value +} +// SetReviewDismissedIssueEvent sets the reviewDismissedIssueEvent property value. Composed type representation for type ReviewDismissedIssueEventable +func (m *IssueEventForIssue) SetReviewDismissedIssueEvent(value ReviewDismissedIssueEventable)() { + m.reviewDismissedIssueEvent = value +} +// SetReviewRequestedIssueEvent sets the reviewRequestedIssueEvent property value. Composed type representation for type ReviewRequestedIssueEventable +func (m *IssueEventForIssue) SetReviewRequestedIssueEvent(value ReviewRequestedIssueEventable)() { + m.reviewRequestedIssueEvent = value +} +// SetReviewRequestRemovedIssueEvent sets the reviewRequestRemovedIssueEvent property value. Composed type representation for type ReviewRequestRemovedIssueEventable +func (m *IssueEventForIssue) SetReviewRequestRemovedIssueEvent(value ReviewRequestRemovedIssueEventable)() { + m.reviewRequestRemovedIssueEvent = value +} +// SetUnassignedIssueEvent sets the unassignedIssueEvent property value. Composed type representation for type UnassignedIssueEventable +func (m *IssueEventForIssue) SetUnassignedIssueEvent(value UnassignedIssueEventable)() { + m.unassignedIssueEvent = value +} +// SetUnlabeledIssueEvent sets the unlabeledIssueEvent property value. Composed type representation for type UnlabeledIssueEventable +func (m *IssueEventForIssue) SetUnlabeledIssueEvent(value UnlabeledIssueEventable)() { + m.unlabeledIssueEvent = value +} +type IssueEventForIssueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAddedToProjectIssueEvent()(AddedToProjectIssueEventable) + GetAssignedIssueEvent()(AssignedIssueEventable) + GetConvertedNoteToIssueIssueEvent()(ConvertedNoteToIssueIssueEventable) + GetDemilestonedIssueEvent()(DemilestonedIssueEventable) + GetLabeledIssueEvent()(LabeledIssueEventable) + GetLockedIssueEvent()(LockedIssueEventable) + GetMilestonedIssueEvent()(MilestonedIssueEventable) + GetMovedColumnInProjectIssueEvent()(MovedColumnInProjectIssueEventable) + GetRemovedFromProjectIssueEvent()(RemovedFromProjectIssueEventable) + GetRenamedIssueEvent()(RenamedIssueEventable) + GetReviewDismissedIssueEvent()(ReviewDismissedIssueEventable) + GetReviewRequestedIssueEvent()(ReviewRequestedIssueEventable) + GetReviewRequestRemovedIssueEvent()(ReviewRequestRemovedIssueEventable) + GetUnassignedIssueEvent()(UnassignedIssueEventable) + GetUnlabeledIssueEvent()(UnlabeledIssueEventable) + SetAddedToProjectIssueEvent(value AddedToProjectIssueEventable)() + SetAssignedIssueEvent(value AssignedIssueEventable)() + SetConvertedNoteToIssueIssueEvent(value ConvertedNoteToIssueIssueEventable)() + SetDemilestonedIssueEvent(value DemilestonedIssueEventable)() + SetLabeledIssueEvent(value LabeledIssueEventable)() + SetLockedIssueEvent(value LockedIssueEventable)() + SetMilestonedIssueEvent(value MilestonedIssueEventable)() + SetMovedColumnInProjectIssueEvent(value MovedColumnInProjectIssueEventable)() + SetRemovedFromProjectIssueEvent(value RemovedFromProjectIssueEventable)() + SetRenamedIssueEvent(value RenamedIssueEventable)() + SetReviewDismissedIssueEvent(value ReviewDismissedIssueEventable)() + SetReviewRequestedIssueEvent(value ReviewRequestedIssueEventable)() + SetReviewRequestRemovedIssueEvent(value ReviewRequestRemovedIssueEventable)() + SetUnassignedIssueEvent(value UnassignedIssueEventable)() + SetUnlabeledIssueEvent(value UnlabeledIssueEventable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_label.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_label.go new file mode 100644 index 000000000..8cd5a9789 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_label.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IssueEventLabel issue Event Label +type IssueEventLabel struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The color property + color *string + // The name property + name *string +} +// NewIssueEventLabel instantiates a new IssueEventLabel and sets the default values. +func NewIssueEventLabel()(*IssueEventLabel) { + m := &IssueEventLabel{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueEventLabelFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueEventLabelFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueEventLabel(), 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 *IssueEventLabel) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The color property +// returns a *string when successful +func (m *IssueEventLabel) GetColor()(*string) { + return m.color +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueEventLabel) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *IssueEventLabel) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *IssueEventLabel) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *IssueEventLabel) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The color property +func (m *IssueEventLabel) SetColor(value *string)() { + m.color = value +} +// SetName sets the name property value. The name property +func (m *IssueEventLabel) SetName(value *string)() { + m.name = value +} +type IssueEventLabelable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetName()(*string) + SetColor(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_milestone.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_milestone.go new file mode 100644 index 000000000..e43340dc2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_milestone.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IssueEventMilestone issue Event Milestone +type IssueEventMilestone struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The title property + title *string +} +// NewIssueEventMilestone instantiates a new IssueEventMilestone and sets the default values. +func NewIssueEventMilestone()(*IssueEventMilestone) { + m := &IssueEventMilestone{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueEventMilestoneFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueEventMilestoneFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueEventMilestone(), 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 *IssueEventMilestone) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueEventMilestone) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *IssueEventMilestone) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *IssueEventMilestone) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *IssueEventMilestone) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTitle sets the title property value. The title property +func (m *IssueEventMilestone) SetTitle(value *string)() { + m.title = value +} +type IssueEventMilestoneable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTitle()(*string) + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_project_card.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_project_card.go new file mode 100644 index 000000000..ca87cbd9d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_project_card.go @@ -0,0 +1,226 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IssueEventProjectCard issue Event Project Card +type IssueEventProjectCard struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The column_name property + column_name *string + // The id property + id *int32 + // The previous_column_name property + previous_column_name *string + // The project_id property + project_id *int32 + // The project_url property + project_url *string + // The url property + url *string +} +// NewIssueEventProjectCard instantiates a new IssueEventProjectCard and sets the default values. +func NewIssueEventProjectCard()(*IssueEventProjectCard) { + m := &IssueEventProjectCard{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueEventProjectCardFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueEventProjectCardFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueEventProjectCard(), 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 *IssueEventProjectCard) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColumnName gets the column_name property value. The column_name property +// returns a *string when successful +func (m *IssueEventProjectCard) GetColumnName()(*string) { + return m.column_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueEventProjectCard) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnName(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["previous_column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviousColumnName(val) + } + return nil + } + res["project_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetProjectId(val) + } + return nil + } + res["project_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProjectUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *IssueEventProjectCard) GetId()(*int32) { + return m.id +} +// GetPreviousColumnName gets the previous_column_name property value. The previous_column_name property +// returns a *string when successful +func (m *IssueEventProjectCard) GetPreviousColumnName()(*string) { + return m.previous_column_name +} +// GetProjectId gets the project_id property value. The project_id property +// returns a *int32 when successful +func (m *IssueEventProjectCard) GetProjectId()(*int32) { + return m.project_id +} +// GetProjectUrl gets the project_url property value. The project_url property +// returns a *string when successful +func (m *IssueEventProjectCard) GetProjectUrl()(*string) { + return m.project_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *IssueEventProjectCard) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *IssueEventProjectCard) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("column_name", m.GetColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("previous_column_name", m.GetPreviousColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("project_id", m.GetProjectId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("project_url", m.GetProjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *IssueEventProjectCard) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColumnName sets the column_name property value. The column_name property +func (m *IssueEventProjectCard) SetColumnName(value *string)() { + m.column_name = value +} +// SetId sets the id property value. The id property +func (m *IssueEventProjectCard) SetId(value *int32)() { + m.id = value +} +// SetPreviousColumnName sets the previous_column_name property value. The previous_column_name property +func (m *IssueEventProjectCard) SetPreviousColumnName(value *string)() { + m.previous_column_name = value +} +// SetProjectId sets the project_id property value. The project_id property +func (m *IssueEventProjectCard) SetProjectId(value *int32)() { + m.project_id = value +} +// SetProjectUrl sets the project_url property value. The project_url property +func (m *IssueEventProjectCard) SetProjectUrl(value *string)() { + m.project_url = value +} +// SetUrl sets the url property value. The url property +func (m *IssueEventProjectCard) SetUrl(value *string)() { + m.url = value +} +type IssueEventProjectCardable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColumnName()(*string) + GetId()(*int32) + GetPreviousColumnName()(*string) + GetProjectId()(*int32) + GetProjectUrl()(*string) + GetUrl()(*string) + SetColumnName(value *string)() + SetId(value *int32)() + SetPreviousColumnName(value *string)() + SetProjectId(value *int32)() + SetProjectUrl(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_rename.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_rename.go new file mode 100644 index 000000000..0d8b43c55 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_event_rename.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IssueEventRename issue Event Rename +type IssueEventRename struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The from property + from *string + // The to property + to *string +} +// NewIssueEventRename instantiates a new IssueEventRename and sets the default values. +func NewIssueEventRename()(*IssueEventRename) { + m := &IssueEventRename{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueEventRenameFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueEventRenameFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueEventRename(), 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 *IssueEventRename) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueEventRename) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["from"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFrom(val) + } + return nil + } + res["to"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTo(val) + } + return nil + } + return res +} +// GetFrom gets the from property value. The from property +// returns a *string when successful +func (m *IssueEventRename) GetFrom()(*string) { + return m.from +} +// GetTo gets the to property value. The to property +// returns a *string when successful +func (m *IssueEventRename) GetTo()(*string) { + return m.to +} +// Serialize serializes information the current object +func (m *IssueEventRename) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("from", m.GetFrom()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("to", m.GetTo()) + 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 *IssueEventRename) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFrom sets the from property value. The from property +func (m *IssueEventRename) SetFrom(value *string)() { + m.from = value +} +// SetTo sets the to property value. The to property +func (m *IssueEventRename) SetTo(value *string)() { + m.to = value +} +type IssueEventRenameable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFrom()(*string) + GetTo()(*string) + SetFrom(value *string)() + SetTo(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_pull_request.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_pull_request.go new file mode 100644 index 000000000..d34957e20 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_pull_request.go @@ -0,0 +1,197 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Issue_pull_request struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The diff_url property + diff_url *string + // The html_url property + html_url *string + // The merged_at property + merged_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The patch_url property + patch_url *string + // The url property + url *string +} +// NewIssue_pull_request instantiates a new Issue_pull_request and sets the default values. +func NewIssue_pull_request()(*Issue_pull_request) { + m := &Issue_pull_request{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssue_pull_requestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssue_pull_requestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssue_pull_request(), 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 *Issue_pull_request) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDiffUrl gets the diff_url property value. The diff_url property +// returns a *string when successful +func (m *Issue_pull_request) GetDiffUrl()(*string) { + return m.diff_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Issue_pull_request) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["diff_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiffUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["merged_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetMergedAt(val) + } + return nil + } + res["patch_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatchUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Issue_pull_request) GetHtmlUrl()(*string) { + return m.html_url +} +// GetMergedAt gets the merged_at property value. The merged_at property +// returns a *Time when successful +func (m *Issue_pull_request) GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.merged_at +} +// GetPatchUrl gets the patch_url property value. The patch_url property +// returns a *string when successful +func (m *Issue_pull_request) GetPatchUrl()(*string) { + return m.patch_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Issue_pull_request) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Issue_pull_request) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("diff_url", m.GetDiffUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("merged_at", m.GetMergedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patch_url", m.GetPatchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Issue_pull_request) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDiffUrl sets the diff_url property value. The diff_url property +func (m *Issue_pull_request) SetDiffUrl(value *string)() { + m.diff_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Issue_pull_request) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetMergedAt sets the merged_at property value. The merged_at property +func (m *Issue_pull_request) SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.merged_at = value +} +// SetPatchUrl sets the patch_url property value. The patch_url property +func (m *Issue_pull_request) SetPatchUrl(value *string)() { + m.patch_url = value +} +// SetUrl sets the url property value. The url property +func (m *Issue_pull_request) SetUrl(value *string)() { + m.url = value +} +type Issue_pull_requestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDiffUrl()(*string) + GetHtmlUrl()(*string) + GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetPatchUrl()(*string) + GetUrl()(*string) + SetDiffUrl(value *string)() + SetHtmlUrl(value *string)() + SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetPatchUrl(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_search_result_item.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_search_result_item.go new file mode 100644 index 000000000..bb48360be --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_search_result_item.go @@ -0,0 +1,1105 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IssueSearchResultItem issue Search Result Item +type IssueSearchResultItem struct { + // The active_lock_reason property + active_lock_reason *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee NullableSimpleUserable + // The assignees property + assignees []SimpleUserable + // How the author is associated with the repository. + author_association *AuthorAssociation + // The body property + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // The closed_at property + closed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The comments property + comments *int32 + // The comments_url property + comments_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The draft property + draft *bool + // The events_url property + events_url *string + // The html_url property + html_url *string + // The id property + id *int64 + // The labels property + labels []IssueSearchResultItem_labelsable + // The labels_url property + labels_url *string + // The locked property + locked *bool + // A collection of related issues and pull requests. + milestone NullableMilestoneable + // The node_id property + node_id *string + // The number property + number *int32 + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The pull_request property + pull_request IssueSearchResultItem_pull_requestable + // The reactions property + reactions ReactionRollupable + // A repository on GitHub. + repository Repositoryable + // The repository_url property + repository_url *string + // The score property + score *float64 + // The state property + state *string + // The state_reason property + state_reason *string + // The text_matches property + text_matches []Issuesable + // The timeline_url property + timeline_url *string + // The title property + title *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewIssueSearchResultItem instantiates a new IssueSearchResultItem and sets the default values. +func NewIssueSearchResultItem()(*IssueSearchResultItem) { + m := &IssueSearchResultItem{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueSearchResultItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueSearchResultItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueSearchResultItem(), nil +} +// GetActiveLockReason gets the active_lock_reason property value. The active_lock_reason property +// returns a *string when successful +func (m *IssueSearchResultItem) GetActiveLockReason()(*string) { + return m.active_lock_reason +} +// 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 *IssueSearchResultItem) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *IssueSearchResultItem) GetAssignee()(NullableSimpleUserable) { + return m.assignee +} +// GetAssignees gets the assignees property value. The assignees property +// returns a []SimpleUserable when successful +func (m *IssueSearchResultItem) GetAssignees()([]SimpleUserable) { + return m.assignees +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *IssueSearchResultItem) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *IssueSearchResultItem) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *IssueSearchResultItem) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *IssueSearchResultItem) GetBodyText()(*string) { + return m.body_text +} +// GetClosedAt gets the closed_at property value. The closed_at property +// returns a *Time when successful +func (m *IssueSearchResultItem) GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.closed_at +} +// GetComments gets the comments property value. The comments property +// returns a *int32 when successful +func (m *IssueSearchResultItem) GetComments()(*int32) { + return m.comments +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *IssueSearchResultItem) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *IssueSearchResultItem) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDraft gets the draft property value. The draft property +// returns a *bool when successful +func (m *IssueSearchResultItem) GetDraft()(*bool) { + return m.draft +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *IssueSearchResultItem) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueSearchResultItem) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active_lock_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetActiveLockReason(val) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(NullableSimpleUserable)) + } + return nil + } + res["assignees"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetAssignees(res) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + res["closed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetClosedAt(val) + } + return nil + } + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetComments(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIssueSearchResultItem_labelsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]IssueSearchResultItem_labelsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(IssueSearchResultItem_labelsable) + } + } + m.SetLabels(res) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["locked"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLocked(val) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableMilestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(NullableMilestoneable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["pull_request"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueSearchResultItem_pull_requestFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPullRequest(val.(IssueSearchResultItem_pull_requestable)) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(Repositoryable)) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["state_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStateReason(val) + } + return nil + } + res["text_matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIssuesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Issuesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Issuesable) + } + } + m.SetTextMatches(res) + } + return nil + } + res["timeline_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTimelineUrl(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *IssueSearchResultItem) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *IssueSearchResultItem) GetId()(*int64) { + return m.id +} +// GetLabels gets the labels property value. The labels property +// returns a []IssueSearchResultItem_labelsable when successful +func (m *IssueSearchResultItem) GetLabels()([]IssueSearchResultItem_labelsable) { + return m.labels +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *IssueSearchResultItem) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLocked gets the locked property value. The locked property +// returns a *bool when successful +func (m *IssueSearchResultItem) GetLocked()(*bool) { + return m.locked +} +// GetMilestone gets the milestone property value. A collection of related issues and pull requests. +// returns a NullableMilestoneable when successful +func (m *IssueSearchResultItem) GetMilestone()(NullableMilestoneable) { + return m.milestone +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *IssueSearchResultItem) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. The number property +// returns a *int32 when successful +func (m *IssueSearchResultItem) GetNumber()(*int32) { + return m.number +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *IssueSearchResultItem) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetPullRequest gets the pull_request property value. The pull_request property +// returns a IssueSearchResultItem_pull_requestable when successful +func (m *IssueSearchResultItem) GetPullRequest()(IssueSearchResultItem_pull_requestable) { + return m.pull_request +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *IssueSearchResultItem) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetRepository gets the repository property value. A repository on GitHub. +// returns a Repositoryable when successful +func (m *IssueSearchResultItem) GetRepository()(Repositoryable) { + return m.repository +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *IssueSearchResultItem) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetScore gets the score property value. The score property +// returns a *float64 when successful +func (m *IssueSearchResultItem) GetScore()(*float64) { + return m.score +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *IssueSearchResultItem) GetState()(*string) { + return m.state +} +// GetStateReason gets the state_reason property value. The state_reason property +// returns a *string when successful +func (m *IssueSearchResultItem) GetStateReason()(*string) { + return m.state_reason +} +// GetTextMatches gets the text_matches property value. The text_matches property +// returns a []Issuesable when successful +func (m *IssueSearchResultItem) GetTextMatches()([]Issuesable) { + return m.text_matches +} +// GetTimelineUrl gets the timeline_url property value. The timeline_url property +// returns a *string when successful +func (m *IssueSearchResultItem) GetTimelineUrl()(*string) { + return m.timeline_url +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *IssueSearchResultItem) GetTitle()(*string) { + return m.title +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *IssueSearchResultItem) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *IssueSearchResultItem) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *IssueSearchResultItem) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *IssueSearchResultItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("active_lock_reason", m.GetActiveLockReason()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + if m.GetAssignees() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAssignees())) + for i, v := range m.GetAssignees() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("assignees", cast) + if err != nil { + return err + } + } + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("closed_at", m.GetClosedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("locked", m.GetLocked()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pull_request", m.GetPullRequest()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("score", m.GetScore()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state_reason", m.GetStateReason()) + if err != nil { + return err + } + } + if m.GetTextMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTextMatches())) + for i, v := range m.GetTextMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("text_matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("timeline_url", m.GetTimelineUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActiveLockReason sets the active_lock_reason property value. The active_lock_reason property +func (m *IssueSearchResultItem) SetActiveLockReason(value *string)() { + m.active_lock_reason = value +} +// 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 *IssueSearchResultItem) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *IssueSearchResultItem) SetAssignee(value NullableSimpleUserable)() { + m.assignee = value +} +// SetAssignees sets the assignees property value. The assignees property +func (m *IssueSearchResultItem) SetAssignees(value []SimpleUserable)() { + m.assignees = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *IssueSearchResultItem) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. The body property +func (m *IssueSearchResultItem) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *IssueSearchResultItem) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *IssueSearchResultItem) SetBodyText(value *string)() { + m.body_text = value +} +// SetClosedAt sets the closed_at property value. The closed_at property +func (m *IssueSearchResultItem) SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.closed_at = value +} +// SetComments sets the comments property value. The comments property +func (m *IssueSearchResultItem) SetComments(value *int32)() { + m.comments = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *IssueSearchResultItem) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *IssueSearchResultItem) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDraft sets the draft property value. The draft property +func (m *IssueSearchResultItem) SetDraft(value *bool)() { + m.draft = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *IssueSearchResultItem) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *IssueSearchResultItem) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *IssueSearchResultItem) SetId(value *int64)() { + m.id = value +} +// SetLabels sets the labels property value. The labels property +func (m *IssueSearchResultItem) SetLabels(value []IssueSearchResultItem_labelsable)() { + m.labels = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *IssueSearchResultItem) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLocked sets the locked property value. The locked property +func (m *IssueSearchResultItem) SetLocked(value *bool)() { + m.locked = value +} +// SetMilestone sets the milestone property value. A collection of related issues and pull requests. +func (m *IssueSearchResultItem) SetMilestone(value NullableMilestoneable)() { + m.milestone = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *IssueSearchResultItem) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. The number property +func (m *IssueSearchResultItem) SetNumber(value *int32)() { + m.number = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *IssueSearchResultItem) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetPullRequest sets the pull_request property value. The pull_request property +func (m *IssueSearchResultItem) SetPullRequest(value IssueSearchResultItem_pull_requestable)() { + m.pull_request = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *IssueSearchResultItem) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetRepository sets the repository property value. A repository on GitHub. +func (m *IssueSearchResultItem) SetRepository(value Repositoryable)() { + m.repository = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *IssueSearchResultItem) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetScore sets the score property value. The score property +func (m *IssueSearchResultItem) SetScore(value *float64)() { + m.score = value +} +// SetState sets the state property value. The state property +func (m *IssueSearchResultItem) SetState(value *string)() { + m.state = value +} +// SetStateReason sets the state_reason property value. The state_reason property +func (m *IssueSearchResultItem) SetStateReason(value *string)() { + m.state_reason = value +} +// SetTextMatches sets the text_matches property value. The text_matches property +func (m *IssueSearchResultItem) SetTextMatches(value []Issuesable)() { + m.text_matches = value +} +// SetTimelineUrl sets the timeline_url property value. The timeline_url property +func (m *IssueSearchResultItem) SetTimelineUrl(value *string)() { + m.timeline_url = value +} +// SetTitle sets the title property value. The title property +func (m *IssueSearchResultItem) SetTitle(value *string)() { + m.title = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *IssueSearchResultItem) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *IssueSearchResultItem) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *IssueSearchResultItem) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type IssueSearchResultItemable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActiveLockReason()(*string) + GetAssignee()(NullableSimpleUserable) + GetAssignees()([]SimpleUserable) + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetComments()(*int32) + GetCommentsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDraft()(*bool) + GetEventsUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLabels()([]IssueSearchResultItem_labelsable) + GetLabelsUrl()(*string) + GetLocked()(*bool) + GetMilestone()(NullableMilestoneable) + GetNodeId()(*string) + GetNumber()(*int32) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetPullRequest()(IssueSearchResultItem_pull_requestable) + GetReactions()(ReactionRollupable) + GetRepository()(Repositoryable) + GetRepositoryUrl()(*string) + GetScore()(*float64) + GetState()(*string) + GetStateReason()(*string) + GetTextMatches()([]Issuesable) + GetTimelineUrl()(*string) + GetTitle()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetActiveLockReason(value *string)() + SetAssignee(value NullableSimpleUserable)() + SetAssignees(value []SimpleUserable)() + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetComments(value *int32)() + SetCommentsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDraft(value *bool)() + SetEventsUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLabels(value []IssueSearchResultItem_labelsable)() + SetLabelsUrl(value *string)() + SetLocked(value *bool)() + SetMilestone(value NullableMilestoneable)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetPullRequest(value IssueSearchResultItem_pull_requestable)() + SetReactions(value ReactionRollupable)() + SetRepository(value Repositoryable)() + SetRepositoryUrl(value *string)() + SetScore(value *float64)() + SetState(value *string)() + SetStateReason(value *string)() + SetTextMatches(value []Issuesable)() + SetTimelineUrl(value *string)() + SetTitle(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_search_result_item_labels.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_search_result_item_labels.go new file mode 100644 index 000000000..e3603569b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_search_result_item_labels.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type IssueSearchResultItem_labels struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The color property + color *string + // The default property + defaultEscaped *bool + // The description property + description *string + // The id property + id *int64 + // The name property + name *string + // The node_id property + node_id *string + // The url property + url *string +} +// NewIssueSearchResultItem_labels instantiates a new IssueSearchResultItem_labels and sets the default values. +func NewIssueSearchResultItem_labels()(*IssueSearchResultItem_labels) { + m := &IssueSearchResultItem_labels{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueSearchResultItem_labelsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueSearchResultItem_labelsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueSearchResultItem_labels(), 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 *IssueSearchResultItem_labels) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The color property +// returns a *string when successful +func (m *IssueSearchResultItem_labels) GetColor()(*string) { + return m.color +} +// GetDefaultEscaped gets the default property value. The default property +// returns a *bool when successful +func (m *IssueSearchResultItem_labels) GetDefaultEscaped()(*bool) { + return m.defaultEscaped +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *IssueSearchResultItem_labels) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueSearchResultItem_labels) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(val) + } + return nil + } + res["default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultEscaped(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *IssueSearchResultItem_labels) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *IssueSearchResultItem_labels) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *IssueSearchResultItem_labels) GetNodeId()(*string) { + return m.node_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *IssueSearchResultItem_labels) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *IssueSearchResultItem_labels) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("default", m.GetDefaultEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *IssueSearchResultItem_labels) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The color property +func (m *IssueSearchResultItem_labels) SetColor(value *string)() { + m.color = value +} +// SetDefaultEscaped sets the default property value. The default property +func (m *IssueSearchResultItem_labels) SetDefaultEscaped(value *bool)() { + m.defaultEscaped = value +} +// SetDescription sets the description property value. The description property +func (m *IssueSearchResultItem_labels) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. The id property +func (m *IssueSearchResultItem_labels) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *IssueSearchResultItem_labels) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *IssueSearchResultItem_labels) SetNodeId(value *string)() { + m.node_id = value +} +// SetUrl sets the url property value. The url property +func (m *IssueSearchResultItem_labels) SetUrl(value *string)() { + m.url = value +} +type IssueSearchResultItem_labelsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetDefaultEscaped()(*bool) + GetDescription()(*string) + GetId()(*int64) + GetName()(*string) + GetNodeId()(*string) + GetUrl()(*string) + SetColor(value *string)() + SetDefaultEscaped(value *bool)() + SetDescription(value *string)() + SetId(value *int64)() + SetName(value *string)() + SetNodeId(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_search_result_item_pull_request.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_search_result_item_pull_request.go new file mode 100644 index 000000000..d6568fb3c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_search_result_item_pull_request.go @@ -0,0 +1,197 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type IssueSearchResultItem_pull_request struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The diff_url property + diff_url *string + // The html_url property + html_url *string + // The merged_at property + merged_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The patch_url property + patch_url *string + // The url property + url *string +} +// NewIssueSearchResultItem_pull_request instantiates a new IssueSearchResultItem_pull_request and sets the default values. +func NewIssueSearchResultItem_pull_request()(*IssueSearchResultItem_pull_request) { + m := &IssueSearchResultItem_pull_request{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueSearchResultItem_pull_requestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueSearchResultItem_pull_requestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueSearchResultItem_pull_request(), 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 *IssueSearchResultItem_pull_request) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDiffUrl gets the diff_url property value. The diff_url property +// returns a *string when successful +func (m *IssueSearchResultItem_pull_request) GetDiffUrl()(*string) { + return m.diff_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueSearchResultItem_pull_request) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["diff_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiffUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["merged_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetMergedAt(val) + } + return nil + } + res["patch_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatchUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *IssueSearchResultItem_pull_request) GetHtmlUrl()(*string) { + return m.html_url +} +// GetMergedAt gets the merged_at property value. The merged_at property +// returns a *Time when successful +func (m *IssueSearchResultItem_pull_request) GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.merged_at +} +// GetPatchUrl gets the patch_url property value. The patch_url property +// returns a *string when successful +func (m *IssueSearchResultItem_pull_request) GetPatchUrl()(*string) { + return m.patch_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *IssueSearchResultItem_pull_request) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *IssueSearchResultItem_pull_request) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("diff_url", m.GetDiffUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("merged_at", m.GetMergedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patch_url", m.GetPatchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *IssueSearchResultItem_pull_request) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDiffUrl sets the diff_url property value. The diff_url property +func (m *IssueSearchResultItem_pull_request) SetDiffUrl(value *string)() { + m.diff_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *IssueSearchResultItem_pull_request) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetMergedAt sets the merged_at property value. The merged_at property +func (m *IssueSearchResultItem_pull_request) SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.merged_at = value +} +// SetPatchUrl sets the patch_url property value. The patch_url property +func (m *IssueSearchResultItem_pull_request) SetPatchUrl(value *string)() { + m.patch_url = value +} +// SetUrl sets the url property value. The url property +func (m *IssueSearchResultItem_pull_request) SetUrl(value *string)() { + m.url = value +} +type IssueSearchResultItem_pull_requestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDiffUrl()(*string) + GetHtmlUrl()(*string) + GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetPatchUrl()(*string) + GetUrl()(*string) + SetDiffUrl(value *string)() + SetHtmlUrl(value *string)() + SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetPatchUrl(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_state_reason.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_state_reason.go new file mode 100644 index 000000000..130c6b677 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issue_state_reason.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The reason for the current state +type Issue_state_reason int + +const ( + COMPLETED_ISSUE_STATE_REASON Issue_state_reason = iota + REOPENED_ISSUE_STATE_REASON + NOT_PLANNED_ISSUE_STATE_REASON +) + +func (i Issue_state_reason) String() string { + return []string{"completed", "reopened", "not_planned"}[i] +} +func ParseIssue_state_reason(v string) (any, error) { + result := COMPLETED_ISSUE_STATE_REASON + switch v { + case "completed": + result = COMPLETED_ISSUE_STATE_REASON + case "reopened": + result = REOPENED_ISSUE_STATE_REASON + case "not_planned": + result = NOT_PLANNED_ISSUE_STATE_REASON + default: + return 0, errors.New("Unknown Issue_state_reason value: " + v) + } + return &result, nil +} +func SerializeIssue_state_reason(values []Issue_state_reason) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Issue_state_reason) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issues.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issues.go new file mode 100644 index 000000000..1f2178378 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issues.go @@ -0,0 +1,208 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Issues struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The fragment property + fragment *string + // The matches property + matches []Issues_matchesable + // The object_type property + object_type *string + // The object_url property + object_url *string + // The property property + property *string +} +// NewIssues instantiates a new Issues and sets the default values. +func NewIssues()(*Issues) { + m := &Issues{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssuesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssuesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssues(), 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 *Issues) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Issues) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["fragment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFragment(val) + } + return nil + } + res["matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIssues_matchesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Issues_matchesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Issues_matchesable) + } + } + m.SetMatches(res) + } + return nil + } + res["object_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectType(val) + } + return nil + } + res["object_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectUrl(val) + } + return nil + } + res["property"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProperty(val) + } + return nil + } + return res +} +// GetFragment gets the fragment property value. The fragment property +// returns a *string when successful +func (m *Issues) GetFragment()(*string) { + return m.fragment +} +// GetMatches gets the matches property value. The matches property +// returns a []Issues_matchesable when successful +func (m *Issues) GetMatches()([]Issues_matchesable) { + return m.matches +} +// GetObjectType gets the object_type property value. The object_type property +// returns a *string when successful +func (m *Issues) GetObjectType()(*string) { + return m.object_type +} +// GetObjectUrl gets the object_url property value. The object_url property +// returns a *string when successful +func (m *Issues) GetObjectUrl()(*string) { + return m.object_url +} +// GetProperty gets the property property value. The property property +// returns a *string when successful +func (m *Issues) GetProperty()(*string) { + return m.property +} +// Serialize serializes information the current object +func (m *Issues) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("fragment", m.GetFragment()) + if err != nil { + return err + } + } + if m.GetMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMatches())) + for i, v := range m.GetMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_type", m.GetObjectType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_url", m.GetObjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("property", m.GetProperty()) + 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 *Issues) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFragment sets the fragment property value. The fragment property +func (m *Issues) SetFragment(value *string)() { + m.fragment = value +} +// SetMatches sets the matches property value. The matches property +func (m *Issues) SetMatches(value []Issues_matchesable)() { + m.matches = value +} +// SetObjectType sets the object_type property value. The object_type property +func (m *Issues) SetObjectType(value *string)() { + m.object_type = value +} +// SetObjectUrl sets the object_url property value. The object_url property +func (m *Issues) SetObjectUrl(value *string)() { + m.object_url = value +} +// SetProperty sets the property property value. The property property +func (m *Issues) SetProperty(value *string)() { + m.property = value +} +type Issuesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFragment()(*string) + GetMatches()([]Issues_matchesable) + GetObjectType()(*string) + GetObjectUrl()(*string) + GetProperty()(*string) + SetFragment(value *string)() + SetMatches(value []Issues_matchesable)() + SetObjectType(value *string)() + SetObjectUrl(value *string)() + SetProperty(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issues503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issues503_error.go new file mode 100644 index 000000000..6d8d50946 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issues503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Issues503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewIssues503Error instantiates a new Issues503Error and sets the default values. +func NewIssues503Error()(*Issues503Error) { + m := &Issues503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssues503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssues503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssues503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Issues503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Issues503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Issues503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Issues503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Issues503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Issues503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Issues503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *Issues503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Issues503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Issues503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Issues503Error) SetMessage(value *string)() { + m.message = value +} +type Issues503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/issues_matches.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/issues_matches.go new file mode 100644 index 000000000..918b2c59a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/issues_matches.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Issues_matches struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The indices property + indices []int32 + // The text property + text *string +} +// NewIssues_matches instantiates a new Issues_matches and sets the default values. +func NewIssues_matches()(*Issues_matches) { + m := &Issues_matches{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssues_matchesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssues_matchesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssues_matches(), 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 *Issues_matches) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Issues_matches) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["indices"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetIndices(res) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetIndices gets the indices property value. The indices property +// returns a []int32 when successful +func (m *Issues_matches) GetIndices()([]int32) { + return m.indices +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *Issues_matches) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *Issues_matches) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIndices() != nil { + err := writer.WriteCollectionOfInt32Values("indices", m.GetIndices()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + 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 *Issues_matches) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIndices sets the indices property value. The indices property +func (m *Issues_matches) SetIndices(value []int32)() { + m.indices = value +} +// SetText sets the text property value. The text property +func (m *Issues_matches) SetText(value *string)() { + m.text = value +} +type Issues_matchesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIndices()([]int32) + GetText()(*string) + SetIndices(value []int32)() + SetText(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/job.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/job.go new file mode 100644 index 000000000..48fbc93dd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/job.go @@ -0,0 +1,740 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Job information of a job execution in a workflow run +type Job struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The check_run_url property + check_run_url *string + // The time that the job finished, in ISO 8601 format. + completed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The outcome of the job. + conclusion *Job_conclusion + // The time that the job created, in ISO 8601 format. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the current branch. + head_branch *string + // The SHA of the commit that is being run. + head_sha *string + // The html_url property + html_url *string + // The id of the job. + id *int32 + // Labels for the workflow job. Specified by the "runs_on" attribute in the action's workflow file. + labels []string + // The name of the job. + name *string + // The node_id property + node_id *string + // Attempt number of the associated workflow run, 1 for first attempt and higher if the workflow was re-run. + run_attempt *int32 + // The id of the associated workflow run. + run_id *int32 + // The run_url property + run_url *string + // The ID of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) + runner_group_id *int32 + // The name of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) + runner_group_name *string + // The ID of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) + runner_id *int32 + // The name of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) + runner_name *string + // The time that the job started, in ISO 8601 format. + started_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The phase of the lifecycle that the job is currently in. + status *Job_status + // Steps in this job. + steps []Job_stepsable + // The url property + url *string + // The name of the workflow. + workflow_name *string +} +// NewJob instantiates a new Job and sets the default values. +func NewJob()(*Job) { + m := &Job{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateJobFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateJobFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewJob(), 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 *Job) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCheckRunUrl gets the check_run_url property value. The check_run_url property +// returns a *string when successful +func (m *Job) GetCheckRunUrl()(*string) { + return m.check_run_url +} +// GetCompletedAt gets the completed_at property value. The time that the job finished, in ISO 8601 format. +// returns a *Time when successful +func (m *Job) GetCompletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.completed_at +} +// GetConclusion gets the conclusion property value. The outcome of the job. +// returns a *Job_conclusion when successful +func (m *Job) GetConclusion()(*Job_conclusion) { + return m.conclusion +} +// GetCreatedAt gets the created_at property value. The time that the job created, in ISO 8601 format. +// returns a *Time when successful +func (m *Job) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Job) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["check_run_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCheckRunUrl(val) + } + return nil + } + res["completed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCompletedAt(val) + } + return nil + } + res["conclusion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseJob_conclusion) + if err != nil { + return err + } + if val != nil { + m.SetConclusion(val.(*Job_conclusion)) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["head_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadBranch(val) + } + return nil + } + res["head_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadSha(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetLabels(res) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["run_attempt"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunAttempt(val) + } + return nil + } + res["run_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunId(val) + } + return nil + } + res["run_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRunUrl(val) + } + return nil + } + res["runner_group_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunnerGroupId(val) + } + return nil + } + res["runner_group_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRunnerGroupName(val) + } + return nil + } + res["runner_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunnerId(val) + } + return nil + } + res["runner_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRunnerName(val) + } + return nil + } + res["started_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetStartedAt(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseJob_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*Job_status)) + } + return nil + } + res["steps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateJob_stepsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Job_stepsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Job_stepsable) + } + } + m.SetSteps(res) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["workflow_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWorkflowName(val) + } + return nil + } + return res +} +// GetHeadBranch gets the head_branch property value. The name of the current branch. +// returns a *string when successful +func (m *Job) GetHeadBranch()(*string) { + return m.head_branch +} +// GetHeadSha gets the head_sha property value. The SHA of the commit that is being run. +// returns a *string when successful +func (m *Job) GetHeadSha()(*string) { + return m.head_sha +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Job) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id of the job. +// returns a *int32 when successful +func (m *Job) GetId()(*int32) { + return m.id +} +// GetLabels gets the labels property value. Labels for the workflow job. Specified by the "runs_on" attribute in the action's workflow file. +// returns a []string when successful +func (m *Job) GetLabels()([]string) { + return m.labels +} +// GetName gets the name property value. The name of the job. +// returns a *string when successful +func (m *Job) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Job) GetNodeId()(*string) { + return m.node_id +} +// GetRunAttempt gets the run_attempt property value. Attempt number of the associated workflow run, 1 for first attempt and higher if the workflow was re-run. +// returns a *int32 when successful +func (m *Job) GetRunAttempt()(*int32) { + return m.run_attempt +} +// GetRunId gets the run_id property value. The id of the associated workflow run. +// returns a *int32 when successful +func (m *Job) GetRunId()(*int32) { + return m.run_id +} +// GetRunnerGroupId gets the runner_group_id property value. The ID of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) +// returns a *int32 when successful +func (m *Job) GetRunnerGroupId()(*int32) { + return m.runner_group_id +} +// GetRunnerGroupName gets the runner_group_name property value. The name of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) +// returns a *string when successful +func (m *Job) GetRunnerGroupName()(*string) { + return m.runner_group_name +} +// GetRunnerId gets the runner_id property value. The ID of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) +// returns a *int32 when successful +func (m *Job) GetRunnerId()(*int32) { + return m.runner_id +} +// GetRunnerName gets the runner_name property value. The name of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) +// returns a *string when successful +func (m *Job) GetRunnerName()(*string) { + return m.runner_name +} +// GetRunUrl gets the run_url property value. The run_url property +// returns a *string when successful +func (m *Job) GetRunUrl()(*string) { + return m.run_url +} +// GetStartedAt gets the started_at property value. The time that the job started, in ISO 8601 format. +// returns a *Time when successful +func (m *Job) GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.started_at +} +// GetStatus gets the status property value. The phase of the lifecycle that the job is currently in. +// returns a *Job_status when successful +func (m *Job) GetStatus()(*Job_status) { + return m.status +} +// GetSteps gets the steps property value. Steps in this job. +// returns a []Job_stepsable when successful +func (m *Job) GetSteps()([]Job_stepsable) { + return m.steps +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Job) GetUrl()(*string) { + return m.url +} +// GetWorkflowName gets the workflow_name property value. The name of the workflow. +// returns a *string when successful +func (m *Job) GetWorkflowName()(*string) { + return m.workflow_name +} +// Serialize serializes information the current object +func (m *Job) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("check_run_url", m.GetCheckRunUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("completed_at", m.GetCompletedAt()) + if err != nil { + return err + } + } + if m.GetConclusion() != nil { + cast := (*m.GetConclusion()).String() + err := writer.WriteStringValue("conclusion", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_branch", m.GetHeadBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_sha", m.GetHeadSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("runner_group_id", m.GetRunnerGroupId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("runner_group_name", m.GetRunnerGroupName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("runner_id", m.GetRunnerId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("runner_name", m.GetRunnerName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("run_attempt", m.GetRunAttempt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("run_id", m.GetRunId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("run_url", m.GetRunUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("started_at", m.GetStartedAt()) + if err != nil { + return err + } + } + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err := writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + if m.GetSteps() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSteps())) + for i, v := range m.GetSteps() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("steps", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("workflow_name", m.GetWorkflowName()) + 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 *Job) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCheckRunUrl sets the check_run_url property value. The check_run_url property +func (m *Job) SetCheckRunUrl(value *string)() { + m.check_run_url = value +} +// SetCompletedAt sets the completed_at property value. The time that the job finished, in ISO 8601 format. +func (m *Job) SetCompletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.completed_at = value +} +// SetConclusion sets the conclusion property value. The outcome of the job. +func (m *Job) SetConclusion(value *Job_conclusion)() { + m.conclusion = value +} +// SetCreatedAt sets the created_at property value. The time that the job created, in ISO 8601 format. +func (m *Job) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHeadBranch sets the head_branch property value. The name of the current branch. +func (m *Job) SetHeadBranch(value *string)() { + m.head_branch = value +} +// SetHeadSha sets the head_sha property value. The SHA of the commit that is being run. +func (m *Job) SetHeadSha(value *string)() { + m.head_sha = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Job) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id of the job. +func (m *Job) SetId(value *int32)() { + m.id = value +} +// SetLabels sets the labels property value. Labels for the workflow job. Specified by the "runs_on" attribute in the action's workflow file. +func (m *Job) SetLabels(value []string)() { + m.labels = value +} +// SetName sets the name property value. The name of the job. +func (m *Job) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Job) SetNodeId(value *string)() { + m.node_id = value +} +// SetRunAttempt sets the run_attempt property value. Attempt number of the associated workflow run, 1 for first attempt and higher if the workflow was re-run. +func (m *Job) SetRunAttempt(value *int32)() { + m.run_attempt = value +} +// SetRunId sets the run_id property value. The id of the associated workflow run. +func (m *Job) SetRunId(value *int32)() { + m.run_id = value +} +// SetRunnerGroupId sets the runner_group_id property value. The ID of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) +func (m *Job) SetRunnerGroupId(value *int32)() { + m.runner_group_id = value +} +// SetRunnerGroupName sets the runner_group_name property value. The name of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) +func (m *Job) SetRunnerGroupName(value *string)() { + m.runner_group_name = value +} +// SetRunnerId sets the runner_id property value. The ID of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) +func (m *Job) SetRunnerId(value *int32)() { + m.runner_id = value +} +// SetRunnerName sets the runner_name property value. The name of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) +func (m *Job) SetRunnerName(value *string)() { + m.runner_name = value +} +// SetRunUrl sets the run_url property value. The run_url property +func (m *Job) SetRunUrl(value *string)() { + m.run_url = value +} +// SetStartedAt sets the started_at property value. The time that the job started, in ISO 8601 format. +func (m *Job) SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.started_at = value +} +// SetStatus sets the status property value. The phase of the lifecycle that the job is currently in. +func (m *Job) SetStatus(value *Job_status)() { + m.status = value +} +// SetSteps sets the steps property value. Steps in this job. +func (m *Job) SetSteps(value []Job_stepsable)() { + m.steps = value +} +// SetUrl sets the url property value. The url property +func (m *Job) SetUrl(value *string)() { + m.url = value +} +// SetWorkflowName sets the workflow_name property value. The name of the workflow. +func (m *Job) SetWorkflowName(value *string)() { + m.workflow_name = value +} +type Jobable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCheckRunUrl()(*string) + GetCompletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetConclusion()(*Job_conclusion) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHeadBranch()(*string) + GetHeadSha()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLabels()([]string) + GetName()(*string) + GetNodeId()(*string) + GetRunAttempt()(*int32) + GetRunId()(*int32) + GetRunnerGroupId()(*int32) + GetRunnerGroupName()(*string) + GetRunnerId()(*int32) + GetRunnerName()(*string) + GetRunUrl()(*string) + GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetStatus()(*Job_status) + GetSteps()([]Job_stepsable) + GetUrl()(*string) + GetWorkflowName()(*string) + SetCheckRunUrl(value *string)() + SetCompletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetConclusion(value *Job_conclusion)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHeadBranch(value *string)() + SetHeadSha(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLabels(value []string)() + SetName(value *string)() + SetNodeId(value *string)() + SetRunAttempt(value *int32)() + SetRunId(value *int32)() + SetRunnerGroupId(value *int32)() + SetRunnerGroupName(value *string)() + SetRunnerId(value *int32)() + SetRunnerName(value *string)() + SetRunUrl(value *string)() + SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetStatus(value *Job_status)() + SetSteps(value []Job_stepsable)() + SetUrl(value *string)() + SetWorkflowName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/job_conclusion.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/job_conclusion.go new file mode 100644 index 000000000..7bd35d836 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/job_conclusion.go @@ -0,0 +1,52 @@ +package models +import ( + "errors" +) +// The outcome of the job. +type Job_conclusion int + +const ( + SUCCESS_JOB_CONCLUSION Job_conclusion = iota + FAILURE_JOB_CONCLUSION + NEUTRAL_JOB_CONCLUSION + CANCELLED_JOB_CONCLUSION + SKIPPED_JOB_CONCLUSION + TIMED_OUT_JOB_CONCLUSION + ACTION_REQUIRED_JOB_CONCLUSION +) + +func (i Job_conclusion) String() string { + return []string{"success", "failure", "neutral", "cancelled", "skipped", "timed_out", "action_required"}[i] +} +func ParseJob_conclusion(v string) (any, error) { + result := SUCCESS_JOB_CONCLUSION + switch v { + case "success": + result = SUCCESS_JOB_CONCLUSION + case "failure": + result = FAILURE_JOB_CONCLUSION + case "neutral": + result = NEUTRAL_JOB_CONCLUSION + case "cancelled": + result = CANCELLED_JOB_CONCLUSION + case "skipped": + result = SKIPPED_JOB_CONCLUSION + case "timed_out": + result = TIMED_OUT_JOB_CONCLUSION + case "action_required": + result = ACTION_REQUIRED_JOB_CONCLUSION + default: + return 0, errors.New("Unknown Job_conclusion value: " + v) + } + return &result, nil +} +func SerializeJob_conclusion(values []Job_conclusion) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Job_conclusion) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/job_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/job_status.go new file mode 100644 index 000000000..ad86954c4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/job_status.go @@ -0,0 +1,49 @@ +package models +import ( + "errors" +) +// The phase of the lifecycle that the job is currently in. +type Job_status int + +const ( + QUEUED_JOB_STATUS Job_status = iota + IN_PROGRESS_JOB_STATUS + COMPLETED_JOB_STATUS + WAITING_JOB_STATUS + REQUESTED_JOB_STATUS + PENDING_JOB_STATUS +) + +func (i Job_status) String() string { + return []string{"queued", "in_progress", "completed", "waiting", "requested", "pending"}[i] +} +func ParseJob_status(v string) (any, error) { + result := QUEUED_JOB_STATUS + switch v { + case "queued": + result = QUEUED_JOB_STATUS + case "in_progress": + result = IN_PROGRESS_JOB_STATUS + case "completed": + result = COMPLETED_JOB_STATUS + case "waiting": + result = WAITING_JOB_STATUS + case "requested": + result = REQUESTED_JOB_STATUS + case "pending": + result = PENDING_JOB_STATUS + default: + return 0, errors.New("Unknown Job_status value: " + v) + } + return &result, nil +} +func SerializeJob_status(values []Job_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Job_status) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/job_steps.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/job_steps.go new file mode 100644 index 000000000..cc926427d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/job_steps.go @@ -0,0 +1,227 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Job_steps struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time that the job finished, in ISO 8601 format. + completed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The outcome of the job. + conclusion *string + // The name of the job. + name *string + // The number property + number *int32 + // The time that the step started, in ISO 8601 format. + started_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The phase of the lifecycle that the job is currently in. + status *Job_steps_status +} +// NewJob_steps instantiates a new Job_steps and sets the default values. +func NewJob_steps()(*Job_steps) { + m := &Job_steps{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateJob_stepsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateJob_stepsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewJob_steps(), 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 *Job_steps) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCompletedAt gets the completed_at property value. The time that the job finished, in ISO 8601 format. +// returns a *Time when successful +func (m *Job_steps) GetCompletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.completed_at +} +// GetConclusion gets the conclusion property value. The outcome of the job. +// returns a *string when successful +func (m *Job_steps) GetConclusion()(*string) { + return m.conclusion +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Job_steps) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["completed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCompletedAt(val) + } + return nil + } + res["conclusion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetConclusion(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["started_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetStartedAt(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseJob_steps_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*Job_steps_status)) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the job. +// returns a *string when successful +func (m *Job_steps) GetName()(*string) { + return m.name +} +// GetNumber gets the number property value. The number property +// returns a *int32 when successful +func (m *Job_steps) GetNumber()(*int32) { + return m.number +} +// GetStartedAt gets the started_at property value. The time that the step started, in ISO 8601 format. +// returns a *Time when successful +func (m *Job_steps) GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.started_at +} +// GetStatus gets the status property value. The phase of the lifecycle that the job is currently in. +// returns a *Job_steps_status when successful +func (m *Job_steps) GetStatus()(*Job_steps_status) { + return m.status +} +// Serialize serializes information the current object +func (m *Job_steps) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("completed_at", m.GetCompletedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("conclusion", m.GetConclusion()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("started_at", m.GetStartedAt()) + if err != nil { + return err + } + } + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err := writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *Job_steps) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCompletedAt sets the completed_at property value. The time that the job finished, in ISO 8601 format. +func (m *Job_steps) SetCompletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.completed_at = value +} +// SetConclusion sets the conclusion property value. The outcome of the job. +func (m *Job_steps) SetConclusion(value *string)() { + m.conclusion = value +} +// SetName sets the name property value. The name of the job. +func (m *Job_steps) SetName(value *string)() { + m.name = value +} +// SetNumber sets the number property value. The number property +func (m *Job_steps) SetNumber(value *int32)() { + m.number = value +} +// SetStartedAt sets the started_at property value. The time that the step started, in ISO 8601 format. +func (m *Job_steps) SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.started_at = value +} +// SetStatus sets the status property value. The phase of the lifecycle that the job is currently in. +func (m *Job_steps) SetStatus(value *Job_steps_status)() { + m.status = value +} +type Job_stepsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCompletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetConclusion()(*string) + GetName()(*string) + GetNumber()(*int32) + GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetStatus()(*Job_steps_status) + SetCompletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetConclusion(value *string)() + SetName(value *string)() + SetNumber(value *int32)() + SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetStatus(value *Job_steps_status)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/job_steps_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/job_steps_status.go new file mode 100644 index 000000000..d6163e45f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/job_steps_status.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The phase of the lifecycle that the job is currently in. +type Job_steps_status int + +const ( + QUEUED_JOB_STEPS_STATUS Job_steps_status = iota + IN_PROGRESS_JOB_STEPS_STATUS + COMPLETED_JOB_STEPS_STATUS +) + +func (i Job_steps_status) String() string { + return []string{"queued", "in_progress", "completed"}[i] +} +func ParseJob_steps_status(v string) (any, error) { + result := QUEUED_JOB_STEPS_STATUS + switch v { + case "queued": + result = QUEUED_JOB_STEPS_STATUS + case "in_progress": + result = IN_PROGRESS_JOB_STEPS_STATUS + case "completed": + result = COMPLETED_JOB_STEPS_STATUS + default: + return 0, errors.New("Unknown Job_steps_status value: " + v) + } + return &result, nil +} +func SerializeJob_steps_status(values []Job_steps_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Job_steps_status) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/key.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/key.go new file mode 100644 index 000000000..0ab58bcc6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/key.go @@ -0,0 +1,256 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Key key +type Key struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The id property + id *int64 + // The key property + key *string + // The read_only property + read_only *bool + // The title property + title *string + // The url property + url *string + // The verified property + verified *bool +} +// NewKey instantiates a new Key and sets the default values. +func NewKey()(*Key) { + m := &Key{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateKeyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateKeyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewKey(), 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 *Key) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Key) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Key) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["read_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetReadOnly(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *Key) GetId()(*int64) { + return m.id +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *Key) GetKey()(*string) { + return m.key +} +// GetReadOnly gets the read_only property value. The read_only property +// returns a *bool when successful +func (m *Key) GetReadOnly()(*bool) { + return m.read_only +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *Key) GetTitle()(*string) { + return m.title +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Key) GetUrl()(*string) { + return m.url +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *Key) GetVerified()(*bool) { + return m.verified +} +// Serialize serializes information the current object +func (m *Key) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("read_only", m.GetReadOnly()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + 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 *Key) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Key) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *Key) SetId(value *int64)() { + m.id = value +} +// SetKey sets the key property value. The key property +func (m *Key) SetKey(value *string)() { + m.key = value +} +// SetReadOnly sets the read_only property value. The read_only property +func (m *Key) SetReadOnly(value *bool)() { + m.read_only = value +} +// SetTitle sets the title property value. The title property +func (m *Key) SetTitle(value *string)() { + m.title = value +} +// SetUrl sets the url property value. The url property +func (m *Key) SetUrl(value *string)() { + m.url = value +} +// SetVerified sets the verified property value. The verified property +func (m *Key) SetVerified(value *bool)() { + m.verified = value +} +type Keyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int64) + GetKey()(*string) + GetReadOnly()(*bool) + GetTitle()(*string) + GetUrl()(*string) + GetVerified()(*bool) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int64)() + SetKey(value *string)() + SetReadOnly(value *bool)() + SetTitle(value *string)() + SetUrl(value *string)() + SetVerified(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/key_simple.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/key_simple.go new file mode 100644 index 000000000..0dfbdac08 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/key_simple.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// KeySimple key Simple +type KeySimple struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 + // The key property + key *string +} +// NewKeySimple instantiates a new KeySimple and sets the default values. +func NewKeySimple()(*KeySimple) { + m := &KeySimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateKeySimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateKeySimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewKeySimple(), 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 *KeySimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *KeySimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *KeySimple) GetId()(*int32) { + return m.id +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *KeySimple) GetKey()(*string) { + return m.key +} +// Serialize serializes information the current object +func (m *KeySimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + 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 *KeySimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *KeySimple) SetId(value *int32)() { + m.id = value +} +// SetKey sets the key property value. The key property +func (m *KeySimple) SetKey(value *string)() { + m.key = value +} +type KeySimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetKey()(*string) + SetId(value *int32)() + SetKey(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/label.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/label.go new file mode 100644 index 000000000..ba41053bc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/label.go @@ -0,0 +1,255 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Label color-coded labels help you categorize and filter your issues (just like labels in Gmail). +type Label struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // 6-character hex code, without the leading #, identifying the color + color *string + // The default property + defaultEscaped *bool + // The description property + description *string + // The id property + id *int64 + // The name of the label. + name *string + // The node_id property + node_id *string + // URL for the label + url *string +} +// NewLabel instantiates a new Label and sets the default values. +func NewLabel()(*Label) { + m := &Label{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLabelFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabelFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLabel(), 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 *Label) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. 6-character hex code, without the leading #, identifying the color +// returns a *string when successful +func (m *Label) GetColor()(*string) { + return m.color +} +// GetDefaultEscaped gets the default property value. The default property +// returns a *bool when successful +func (m *Label) GetDefaultEscaped()(*bool) { + return m.defaultEscaped +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *Label) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Label) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(val) + } + return nil + } + res["default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultEscaped(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *Label) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name of the label. +// returns a *string when successful +func (m *Label) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Label) GetNodeId()(*string) { + return m.node_id +} +// GetUrl gets the url property value. URL for the label +// returns a *string when successful +func (m *Label) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Label) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("default", m.GetDefaultEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Label) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. 6-character hex code, without the leading #, identifying the color +func (m *Label) SetColor(value *string)() { + m.color = value +} +// SetDefaultEscaped sets the default property value. The default property +func (m *Label) SetDefaultEscaped(value *bool)() { + m.defaultEscaped = value +} +// SetDescription sets the description property value. The description property +func (m *Label) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. The id property +func (m *Label) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name of the label. +func (m *Label) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Label) SetNodeId(value *string)() { + m.node_id = value +} +// SetUrl sets the url property value. URL for the label +func (m *Label) SetUrl(value *string)() { + m.url = value +} +type Labelable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetDefaultEscaped()(*bool) + GetDescription()(*string) + GetId()(*int64) + GetName()(*string) + GetNodeId()(*string) + GetUrl()(*string) + SetColor(value *string)() + SetDefaultEscaped(value *bool)() + SetDescription(value *string)() + SetId(value *int64)() + SetName(value *string)() + SetNodeId(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/label_search_result_item.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/label_search_result_item.go new file mode 100644 index 000000000..be1ea866e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/label_search_result_item.go @@ -0,0 +1,325 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// LabelSearchResultItem label Search Result Item +type LabelSearchResultItem struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The color property + color *string + // The default property + defaultEscaped *bool + // The description property + description *string + // The id property + id *int32 + // The name property + name *string + // The node_id property + node_id *string + // The score property + score *float64 + // The text_matches property + text_matches []Labelsable + // The url property + url *string +} +// NewLabelSearchResultItem instantiates a new LabelSearchResultItem and sets the default values. +func NewLabelSearchResultItem()(*LabelSearchResultItem) { + m := &LabelSearchResultItem{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLabelSearchResultItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabelSearchResultItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLabelSearchResultItem(), 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 *LabelSearchResultItem) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The color property +// returns a *string when successful +func (m *LabelSearchResultItem) GetColor()(*string) { + return m.color +} +// GetDefaultEscaped gets the default property value. The default property +// returns a *bool when successful +func (m *LabelSearchResultItem) GetDefaultEscaped()(*bool) { + return m.defaultEscaped +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *LabelSearchResultItem) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LabelSearchResultItem) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(val) + } + return nil + } + res["default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultEscaped(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["text_matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateLabelsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Labelsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Labelsable) + } + } + m.SetTextMatches(res) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *LabelSearchResultItem) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *LabelSearchResultItem) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *LabelSearchResultItem) GetNodeId()(*string) { + return m.node_id +} +// GetScore gets the score property value. The score property +// returns a *float64 when successful +func (m *LabelSearchResultItem) GetScore()(*float64) { + return m.score +} +// GetTextMatches gets the text_matches property value. The text_matches property +// returns a []Labelsable when successful +func (m *LabelSearchResultItem) GetTextMatches()([]Labelsable) { + return m.text_matches +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *LabelSearchResultItem) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *LabelSearchResultItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("default", m.GetDefaultEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("score", m.GetScore()) + if err != nil { + return err + } + } + if m.GetTextMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTextMatches())) + for i, v := range m.GetTextMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("text_matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *LabelSearchResultItem) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The color property +func (m *LabelSearchResultItem) SetColor(value *string)() { + m.color = value +} +// SetDefaultEscaped sets the default property value. The default property +func (m *LabelSearchResultItem) SetDefaultEscaped(value *bool)() { + m.defaultEscaped = value +} +// SetDescription sets the description property value. The description property +func (m *LabelSearchResultItem) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. The id property +func (m *LabelSearchResultItem) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *LabelSearchResultItem) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *LabelSearchResultItem) SetNodeId(value *string)() { + m.node_id = value +} +// SetScore sets the score property value. The score property +func (m *LabelSearchResultItem) SetScore(value *float64)() { + m.score = value +} +// SetTextMatches sets the text_matches property value. The text_matches property +func (m *LabelSearchResultItem) SetTextMatches(value []Labelsable)() { + m.text_matches = value +} +// SetUrl sets the url property value. The url property +func (m *LabelSearchResultItem) SetUrl(value *string)() { + m.url = value +} +type LabelSearchResultItemable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetDefaultEscaped()(*bool) + GetDescription()(*string) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetScore()(*float64) + GetTextMatches()([]Labelsable) + GetUrl()(*string) + SetColor(value *string)() + SetDefaultEscaped(value *bool)() + SetDescription(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetScore(value *float64)() + SetTextMatches(value []Labelsable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/labeled_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/labeled_issue_event.go new file mode 100644 index 000000000..414317d4a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/labeled_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// LabeledIssueEvent labeled Issue Event +type LabeledIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The label property + label LabeledIssueEvent_labelable + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewLabeledIssueEvent instantiates a new LabeledIssueEvent and sets the default values. +func NewLabeledIssueEvent()(*LabeledIssueEvent) { + m := &LabeledIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLabeledIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabeledIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLabeledIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *LabeledIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *LabeledIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *LabeledIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *LabeledIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *LabeledIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *LabeledIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LabeledIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLabeledIssueEvent_labelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLabel(val.(LabeledIssueEvent_labelable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *LabeledIssueEvent) GetId()(*int32) { + return m.id +} +// GetLabel gets the label property value. The label property +// returns a LabeledIssueEvent_labelable when successful +func (m *LabeledIssueEvent) GetLabel()(LabeledIssueEvent_labelable) { + return m.label +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *LabeledIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *LabeledIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *LabeledIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *LabeledIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *LabeledIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *LabeledIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *LabeledIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *LabeledIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *LabeledIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *LabeledIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *LabeledIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetLabel sets the label property value. The label property +func (m *LabeledIssueEvent) SetLabel(value LabeledIssueEvent_labelable)() { + m.label = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *LabeledIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *LabeledIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *LabeledIssueEvent) SetUrl(value *string)() { + m.url = value +} +type LabeledIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetLabel()(LabeledIssueEvent_labelable) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetLabel(value LabeledIssueEvent_labelable)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/labeled_issue_event_label.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/labeled_issue_event_label.go new file mode 100644 index 000000000..07147d275 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/labeled_issue_event_label.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type LabeledIssueEvent_label struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The color property + color *string + // The name property + name *string +} +// NewLabeledIssueEvent_label instantiates a new LabeledIssueEvent_label and sets the default values. +func NewLabeledIssueEvent_label()(*LabeledIssueEvent_label) { + m := &LabeledIssueEvent_label{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLabeledIssueEvent_labelFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabeledIssueEvent_labelFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLabeledIssueEvent_label(), 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 *LabeledIssueEvent_label) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The color property +// returns a *string when successful +func (m *LabeledIssueEvent_label) GetColor()(*string) { + return m.color +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LabeledIssueEvent_label) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *LabeledIssueEvent_label) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *LabeledIssueEvent_label) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *LabeledIssueEvent_label) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The color property +func (m *LabeledIssueEvent_label) SetColor(value *string)() { + m.color = value +} +// SetName sets the name property value. The name property +func (m *LabeledIssueEvent_label) SetName(value *string)() { + m.name = value +} +type LabeledIssueEvent_labelable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetName()(*string) + SetColor(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/labels.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/labels.go new file mode 100644 index 000000000..03d0d7f0f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/labels.go @@ -0,0 +1,208 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Labels struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The fragment property + fragment *string + // The matches property + matches []Labels_matchesable + // The object_type property + object_type *string + // The object_url property + object_url *string + // The property property + property *string +} +// NewLabels instantiates a new Labels and sets the default values. +func NewLabels()(*Labels) { + m := &Labels{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLabelsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabelsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLabels(), 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 *Labels) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Labels) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["fragment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFragment(val) + } + return nil + } + res["matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateLabels_matchesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Labels_matchesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Labels_matchesable) + } + } + m.SetMatches(res) + } + return nil + } + res["object_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectType(val) + } + return nil + } + res["object_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectUrl(val) + } + return nil + } + res["property"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProperty(val) + } + return nil + } + return res +} +// GetFragment gets the fragment property value. The fragment property +// returns a *string when successful +func (m *Labels) GetFragment()(*string) { + return m.fragment +} +// GetMatches gets the matches property value. The matches property +// returns a []Labels_matchesable when successful +func (m *Labels) GetMatches()([]Labels_matchesable) { + return m.matches +} +// GetObjectType gets the object_type property value. The object_type property +// returns a *string when successful +func (m *Labels) GetObjectType()(*string) { + return m.object_type +} +// GetObjectUrl gets the object_url property value. The object_url property +// returns a *string when successful +func (m *Labels) GetObjectUrl()(*string) { + return m.object_url +} +// GetProperty gets the property property value. The property property +// returns a *string when successful +func (m *Labels) GetProperty()(*string) { + return m.property +} +// Serialize serializes information the current object +func (m *Labels) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("fragment", m.GetFragment()) + if err != nil { + return err + } + } + if m.GetMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMatches())) + for i, v := range m.GetMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_type", m.GetObjectType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_url", m.GetObjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("property", m.GetProperty()) + 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 *Labels) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFragment sets the fragment property value. The fragment property +func (m *Labels) SetFragment(value *string)() { + m.fragment = value +} +// SetMatches sets the matches property value. The matches property +func (m *Labels) SetMatches(value []Labels_matchesable)() { + m.matches = value +} +// SetObjectType sets the object_type property value. The object_type property +func (m *Labels) SetObjectType(value *string)() { + m.object_type = value +} +// SetObjectUrl sets the object_url property value. The object_url property +func (m *Labels) SetObjectUrl(value *string)() { + m.object_url = value +} +// SetProperty sets the property property value. The property property +func (m *Labels) SetProperty(value *string)() { + m.property = value +} +type Labelsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFragment()(*string) + GetMatches()([]Labels_matchesable) + GetObjectType()(*string) + GetObjectUrl()(*string) + GetProperty()(*string) + SetFragment(value *string)() + SetMatches(value []Labels_matchesable)() + SetObjectType(value *string)() + SetObjectUrl(value *string)() + SetProperty(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/labels_matches.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/labels_matches.go new file mode 100644 index 000000000..d8ee82041 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/labels_matches.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Labels_matches struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The indices property + indices []int32 + // The text property + text *string +} +// NewLabels_matches instantiates a new Labels_matches and sets the default values. +func NewLabels_matches()(*Labels_matches) { + m := &Labels_matches{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLabels_matchesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabels_matchesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLabels_matches(), 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 *Labels_matches) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Labels_matches) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["indices"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetIndices(res) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetIndices gets the indices property value. The indices property +// returns a []int32 when successful +func (m *Labels_matches) GetIndices()([]int32) { + return m.indices +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *Labels_matches) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *Labels_matches) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIndices() != nil { + err := writer.WriteCollectionOfInt32Values("indices", m.GetIndices()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + 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 *Labels_matches) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIndices sets the indices property value. The indices property +func (m *Labels_matches) SetIndices(value []int32)() { + m.indices = value +} +// SetText sets the text property value. The text property +func (m *Labels_matches) SetText(value *string)() { + m.text = value +} +type Labels_matchesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIndices()([]int32) + GetText()(*string) + SetIndices(value []int32)() + SetText(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/language.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/language.go new file mode 100644 index 000000000..8ac27c3e4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/language.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Language language +type Language struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewLanguage instantiates a new Language and sets the default values. +func NewLanguage()(*Language) { + m := &Language{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLanguageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLanguageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLanguage(), 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 *Language) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Language) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *Language) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *Language) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type Languageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/license.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/license.go new file mode 100644 index 000000000..adb21e66e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/license.go @@ -0,0 +1,447 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// License license +type License struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The body property + body *string + // The conditions property + conditions []string + // The description property + description *string + // The featured property + featured *bool + // The html_url property + html_url *string + // The implementation property + implementation *string + // The key property + key *string + // The limitations property + limitations []string + // The name property + name *string + // The node_id property + node_id *string + // The permissions property + permissions []string + // The spdx_id property + spdx_id *string + // The url property + url *string +} +// NewLicense instantiates a new License and sets the default values. +func NewLicense()(*License) { + m := &License{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLicenseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLicenseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLicense(), 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 *License) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *License) GetBody()(*string) { + return m.body +} +// GetConditions gets the conditions property value. The conditions property +// returns a []string when successful +func (m *License) GetConditions()([]string) { + return m.conditions +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *License) GetDescription()(*string) { + return m.description +} +// GetFeatured gets the featured property value. The featured property +// returns a *bool when successful +func (m *License) GetFeatured()(*bool) { + return m.featured +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *License) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["conditions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetConditions(res) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["featured"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFeatured(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["implementation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetImplementation(val) + } + return nil + } + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["limitations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetLimitations(res) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetPermissions(res) + } + return nil + } + res["spdx_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSpdxId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *License) GetHtmlUrl()(*string) { + return m.html_url +} +// GetImplementation gets the implementation property value. The implementation property +// returns a *string when successful +func (m *License) GetImplementation()(*string) { + return m.implementation +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *License) GetKey()(*string) { + return m.key +} +// GetLimitations gets the limitations property value. The limitations property +// returns a []string when successful +func (m *License) GetLimitations()([]string) { + return m.limitations +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *License) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *License) GetNodeId()(*string) { + return m.node_id +} +// GetPermissions gets the permissions property value. The permissions property +// returns a []string when successful +func (m *License) GetPermissions()([]string) { + return m.permissions +} +// GetSpdxId gets the spdx_id property value. The spdx_id property +// returns a *string when successful +func (m *License) GetSpdxId()(*string) { + return m.spdx_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *License) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *License) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + if m.GetConditions() != nil { + err := writer.WriteCollectionOfStringValues("conditions", m.GetConditions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("featured", m.GetFeatured()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("implementation", m.GetImplementation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + if m.GetLimitations() != nil { + err := writer.WriteCollectionOfStringValues("limitations", m.GetLimitations()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetPermissions() != nil { + err := writer.WriteCollectionOfStringValues("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("spdx_id", m.GetSpdxId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *License) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The body property +func (m *License) SetBody(value *string)() { + m.body = value +} +// SetConditions sets the conditions property value. The conditions property +func (m *License) SetConditions(value []string)() { + m.conditions = value +} +// SetDescription sets the description property value. The description property +func (m *License) SetDescription(value *string)() { + m.description = value +} +// SetFeatured sets the featured property value. The featured property +func (m *License) SetFeatured(value *bool)() { + m.featured = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *License) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetImplementation sets the implementation property value. The implementation property +func (m *License) SetImplementation(value *string)() { + m.implementation = value +} +// SetKey sets the key property value. The key property +func (m *License) SetKey(value *string)() { + m.key = value +} +// SetLimitations sets the limitations property value. The limitations property +func (m *License) SetLimitations(value []string)() { + m.limitations = value +} +// SetName sets the name property value. The name property +func (m *License) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *License) SetNodeId(value *string)() { + m.node_id = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *License) SetPermissions(value []string)() { + m.permissions = value +} +// SetSpdxId sets the spdx_id property value. The spdx_id property +func (m *License) SetSpdxId(value *string)() { + m.spdx_id = value +} +// SetUrl sets the url property value. The url property +func (m *License) SetUrl(value *string)() { + m.url = value +} +type Licenseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetConditions()([]string) + GetDescription()(*string) + GetFeatured()(*bool) + GetHtmlUrl()(*string) + GetImplementation()(*string) + GetKey()(*string) + GetLimitations()([]string) + GetName()(*string) + GetNodeId()(*string) + GetPermissions()([]string) + GetSpdxId()(*string) + GetUrl()(*string) + SetBody(value *string)() + SetConditions(value []string)() + SetDescription(value *string)() + SetFeatured(value *bool)() + SetHtmlUrl(value *string)() + SetImplementation(value *string)() + SetKey(value *string)() + SetLimitations(value []string)() + SetName(value *string)() + SetNodeId(value *string)() + SetPermissions(value []string)() + SetSpdxId(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/license_content.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/license_content.go new file mode 100644 index 000000000..2b8ebed2d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/license_content.go @@ -0,0 +1,429 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// LicenseContent license Content +type LicenseContent struct { + // The _links property + _links LicenseContent__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The content property + content *string + // The download_url property + download_url *string + // The encoding property + encoding *string + // The git_url property + git_url *string + // The html_url property + html_url *string + // License Simple + license NullableLicenseSimpleable + // The name property + name *string + // The path property + path *string + // The sha property + sha *string + // The size property + size *int32 + // The type property + typeEscaped *string + // The url property + url *string +} +// NewLicenseContent instantiates a new LicenseContent and sets the default values. +func NewLicenseContent()(*LicenseContent) { + m := &LicenseContent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLicenseContentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLicenseContentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLicenseContent(), 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 *LicenseContent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContent gets the content property value. The content property +// returns a *string when successful +func (m *LicenseContent) GetContent()(*string) { + return m.content +} +// GetDownloadUrl gets the download_url property value. The download_url property +// returns a *string when successful +func (m *LicenseContent) GetDownloadUrl()(*string) { + return m.download_url +} +// GetEncoding gets the encoding property value. The encoding property +// returns a *string when successful +func (m *LicenseContent) GetEncoding()(*string) { + return m.encoding +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LicenseContent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLicenseContent__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(LicenseContent__linksable)) + } + return nil + } + res["content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContent(val) + } + return nil + } + res["download_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadUrl(val) + } + return nil + } + res["encoding"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncoding(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableLicenseSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(NullableLicenseSimpleable)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *LicenseContent) GetGitUrl()(*string) { + return m.git_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *LicenseContent) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLicense gets the license property value. License Simple +// returns a NullableLicenseSimpleable when successful +func (m *LicenseContent) GetLicense()(NullableLicenseSimpleable) { + return m.license +} +// GetLinks gets the _links property value. The _links property +// returns a LicenseContent__linksable when successful +func (m *LicenseContent) GetLinks()(LicenseContent__linksable) { + return m._links +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *LicenseContent) GetName()(*string) { + return m.name +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *LicenseContent) GetPath()(*string) { + return m.path +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *LicenseContent) GetSha()(*string) { + return m.sha +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *LicenseContent) GetSize()(*int32) { + return m.size +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *LicenseContent) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *LicenseContent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *LicenseContent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content", m.GetContent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("download_url", m.GetDownloadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("encoding", m.GetEncoding()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *LicenseContent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContent sets the content property value. The content property +func (m *LicenseContent) SetContent(value *string)() { + m.content = value +} +// SetDownloadUrl sets the download_url property value. The download_url property +func (m *LicenseContent) SetDownloadUrl(value *string)() { + m.download_url = value +} +// SetEncoding sets the encoding property value. The encoding property +func (m *LicenseContent) SetEncoding(value *string)() { + m.encoding = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *LicenseContent) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *LicenseContent) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLicense sets the license property value. License Simple +func (m *LicenseContent) SetLicense(value NullableLicenseSimpleable)() { + m.license = value +} +// SetLinks sets the _links property value. The _links property +func (m *LicenseContent) SetLinks(value LicenseContent__linksable)() { + m._links = value +} +// SetName sets the name property value. The name property +func (m *LicenseContent) SetName(value *string)() { + m.name = value +} +// SetPath sets the path property value. The path property +func (m *LicenseContent) SetPath(value *string)() { + m.path = value +} +// SetSha sets the sha property value. The sha property +func (m *LicenseContent) SetSha(value *string)() { + m.sha = value +} +// SetSize sets the size property value. The size property +func (m *LicenseContent) SetSize(value *int32)() { + m.size = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *LicenseContent) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *LicenseContent) SetUrl(value *string)() { + m.url = value +} +type LicenseContentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContent()(*string) + GetDownloadUrl()(*string) + GetEncoding()(*string) + GetGitUrl()(*string) + GetHtmlUrl()(*string) + GetLicense()(NullableLicenseSimpleable) + GetLinks()(LicenseContent__linksable) + GetName()(*string) + GetPath()(*string) + GetSha()(*string) + GetSize()(*int32) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetContent(value *string)() + SetDownloadUrl(value *string)() + SetEncoding(value *string)() + SetGitUrl(value *string)() + SetHtmlUrl(value *string)() + SetLicense(value NullableLicenseSimpleable)() + SetLinks(value LicenseContent__linksable)() + SetName(value *string)() + SetPath(value *string)() + SetSha(value *string)() + SetSize(value *int32)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/license_content__links.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/license_content__links.go new file mode 100644 index 000000000..a6137d549 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/license_content__links.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type LicenseContent__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The git property + git *string + // The html property + html *string + // The self property + self *string +} +// NewLicenseContent__links instantiates a new LicenseContent__links and sets the default values. +func NewLicenseContent__links()(*LicenseContent__links) { + m := &LicenseContent__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLicenseContent__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLicenseContent__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLicenseContent__links(), 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 *LicenseContent__links) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LicenseContent__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["git"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGit(val) + } + return nil + } + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtml(val) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelf(val) + } + return nil + } + return res +} +// GetGit gets the git property value. The git property +// returns a *string when successful +func (m *LicenseContent__links) GetGit()(*string) { + return m.git +} +// GetHtml gets the html property value. The html property +// returns a *string when successful +func (m *LicenseContent__links) GetHtml()(*string) { + return m.html +} +// GetSelf gets the self property value. The self property +// returns a *string when successful +func (m *LicenseContent__links) GetSelf()(*string) { + return m.self +} +// Serialize serializes information the current object +func (m *LicenseContent__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("git", m.GetGit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("self", m.GetSelf()) + 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 *LicenseContent__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGit sets the git property value. The git property +func (m *LicenseContent__links) SetGit(value *string)() { + m.git = value +} +// SetHtml sets the html property value. The html property +func (m *LicenseContent__links) SetHtml(value *string)() { + m.html = value +} +// SetSelf sets the self property value. The self property +func (m *LicenseContent__links) SetSelf(value *string)() { + m.self = value +} +type LicenseContent__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGit()(*string) + GetHtml()(*string) + GetSelf()(*string) + SetGit(value *string)() + SetHtml(value *string)() + SetSelf(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/license_simple.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/license_simple.go new file mode 100644 index 000000000..48241e6d1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/license_simple.go @@ -0,0 +1,226 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// LicenseSimple license Simple +type LicenseSimple struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html_url property + html_url *string + // The key property + key *string + // The name property + name *string + // The node_id property + node_id *string + // The spdx_id property + spdx_id *string + // The url property + url *string +} +// NewLicenseSimple instantiates a new LicenseSimple and sets the default values. +func NewLicenseSimple()(*LicenseSimple) { + m := &LicenseSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLicenseSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLicenseSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLicenseSimple(), 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 *LicenseSimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LicenseSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["spdx_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSpdxId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *LicenseSimple) GetHtmlUrl()(*string) { + return m.html_url +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *LicenseSimple) GetKey()(*string) { + return m.key +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *LicenseSimple) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *LicenseSimple) GetNodeId()(*string) { + return m.node_id +} +// GetSpdxId gets the spdx_id property value. The spdx_id property +// returns a *string when successful +func (m *LicenseSimple) GetSpdxId()(*string) { + return m.spdx_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *LicenseSimple) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *LicenseSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("spdx_id", m.GetSpdxId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *LicenseSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *LicenseSimple) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetKey sets the key property value. The key property +func (m *LicenseSimple) SetKey(value *string)() { + m.key = value +} +// SetName sets the name property value. The name property +func (m *LicenseSimple) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *LicenseSimple) SetNodeId(value *string)() { + m.node_id = value +} +// SetSpdxId sets the spdx_id property value. The spdx_id property +func (m *LicenseSimple) SetSpdxId(value *string)() { + m.spdx_id = value +} +// SetUrl sets the url property value. The url property +func (m *LicenseSimple) SetUrl(value *string)() { + m.url = value +} +type LicenseSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetKey()(*string) + GetName()(*string) + GetNodeId()(*string) + GetSpdxId()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetKey(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetSpdxId(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/link.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/link.go new file mode 100644 index 000000000..66228f905 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/link.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Link hypermedia Link +type Link struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The href property + href *string +} +// NewLink instantiates a new Link and sets the default values. +func NewLink()(*Link) { + m := &Link{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLinkFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLinkFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLink(), 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 *Link) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Link) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *Link) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *Link) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *Link) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *Link) SetHref(value *string)() { + m.href = value +} +type Linkable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/link_with_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/link_with_type.go new file mode 100644 index 000000000..5666a0a8e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/link_with_type.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// LinkWithType hypermedia Link with Type +type LinkWithType struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The href property + href *string + // The type property + typeEscaped *string +} +// NewLinkWithType instantiates a new LinkWithType and sets the default values. +func NewLinkWithType()(*LinkWithType) { + m := &LinkWithType{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLinkWithTypeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLinkWithTypeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLinkWithType(), 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 *LinkWithType) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LinkWithType) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *LinkWithType) GetHref()(*string) { + return m.href +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *LinkWithType) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *LinkWithType) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + 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 *LinkWithType) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *LinkWithType) SetHref(value *string)() { + m.href = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *LinkWithType) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +type LinkWithTypeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + GetTypeEscaped()(*string) + SetHref(value *string)() + SetTypeEscaped(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/locations503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/locations503_error.go new file mode 100644 index 000000000..57633e103 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/locations503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Locations503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewLocations503Error instantiates a new Locations503Error and sets the default values. +func NewLocations503Error()(*Locations503Error) { + m := &Locations503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLocations503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLocations503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLocations503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Locations503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Locations503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Locations503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Locations503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Locations503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Locations503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Locations503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *Locations503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Locations503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Locations503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Locations503Error) SetMessage(value *string)() { + m.message = value +} +type Locations503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/locked_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/locked_issue_event.go new file mode 100644 index 000000000..e31d97828 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/locked_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// LockedIssueEvent locked Issue Event +type LockedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The lock_reason property + lock_reason *string + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewLockedIssueEvent instantiates a new LockedIssueEvent and sets the default values. +func NewLockedIssueEvent()(*LockedIssueEvent) { + m := &LockedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLockedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLockedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLockedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *LockedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *LockedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *LockedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *LockedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *LockedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *LockedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LockedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["lock_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLockReason(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *LockedIssueEvent) GetId()(*int32) { + return m.id +} +// GetLockReason gets the lock_reason property value. The lock_reason property +// returns a *string when successful +func (m *LockedIssueEvent) GetLockReason()(*string) { + return m.lock_reason +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *LockedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *LockedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *LockedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *LockedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("lock_reason", m.GetLockReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *LockedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *LockedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *LockedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *LockedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *LockedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *LockedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *LockedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetLockReason sets the lock_reason property value. The lock_reason property +func (m *LockedIssueEvent) SetLockReason(value *string)() { + m.lock_reason = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *LockedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *LockedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *LockedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type LockedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetLockReason()(*string) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetLockReason(value *string)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_account.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_account.go new file mode 100644 index 000000000..ced3cfbc1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_account.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MarketplaceAccount struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The email property + email *string + // The id property + id *int32 + // The login property + login *string + // The node_id property + node_id *string + // The organization_billing_email property + organization_billing_email *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewMarketplaceAccount instantiates a new MarketplaceAccount and sets the default values. +func NewMarketplaceAccount()(*MarketplaceAccount) { + m := &MarketplaceAccount{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMarketplaceAccountFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMarketplaceAccountFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMarketplaceAccount(), 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 *MarketplaceAccount) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *MarketplaceAccount) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MarketplaceAccount) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organization_billing_email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationBillingEmail(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *MarketplaceAccount) GetId()(*int32) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *MarketplaceAccount) GetLogin()(*string) { + return m.login +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *MarketplaceAccount) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationBillingEmail gets the organization_billing_email property value. The organization_billing_email property +// returns a *string when successful +func (m *MarketplaceAccount) GetOrganizationBillingEmail()(*string) { + return m.organization_billing_email +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *MarketplaceAccount) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *MarketplaceAccount) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *MarketplaceAccount) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization_billing_email", m.GetOrganizationBillingEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *MarketplaceAccount) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. The email property +func (m *MarketplaceAccount) SetEmail(value *string)() { + m.email = value +} +// SetId sets the id property value. The id property +func (m *MarketplaceAccount) SetId(value *int32)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *MarketplaceAccount) SetLogin(value *string)() { + m.login = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *MarketplaceAccount) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationBillingEmail sets the organization_billing_email property value. The organization_billing_email property +func (m *MarketplaceAccount) SetOrganizationBillingEmail(value *string)() { + m.organization_billing_email = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *MarketplaceAccount) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *MarketplaceAccount) SetUrl(value *string)() { + m.url = value +} +type MarketplaceAccountable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetId()(*int32) + GetLogin()(*string) + GetNodeId()(*string) + GetOrganizationBillingEmail()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetEmail(value *string)() + SetId(value *int32)() + SetLogin(value *string)() + SetNodeId(value *string)() + SetOrganizationBillingEmail(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_listing_plan.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_listing_plan.go new file mode 100644 index 000000000..964684335 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_listing_plan.go @@ -0,0 +1,436 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// MarketplaceListingPlan marketplace Listing Plan +type MarketplaceListingPlan struct { + // The accounts_url property + accounts_url *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The bullets property + bullets []string + // The description property + description *string + // The has_free_trial property + has_free_trial *bool + // The id property + id *int32 + // The monthly_price_in_cents property + monthly_price_in_cents *int32 + // The name property + name *string + // The number property + number *int32 + // The price_model property + price_model *MarketplaceListingPlan_price_model + // The state property + state *string + // The unit_name property + unit_name *string + // The url property + url *string + // The yearly_price_in_cents property + yearly_price_in_cents *int32 +} +// NewMarketplaceListingPlan instantiates a new MarketplaceListingPlan and sets the default values. +func NewMarketplaceListingPlan()(*MarketplaceListingPlan) { + m := &MarketplaceListingPlan{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMarketplaceListingPlanFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMarketplaceListingPlanFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMarketplaceListingPlan(), nil +} +// GetAccountsUrl gets the accounts_url property value. The accounts_url property +// returns a *string when successful +func (m *MarketplaceListingPlan) GetAccountsUrl()(*string) { + return m.accounts_url +} +// 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 *MarketplaceListingPlan) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBullets gets the bullets property value. The bullets property +// returns a []string when successful +func (m *MarketplaceListingPlan) GetBullets()([]string) { + return m.bullets +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *MarketplaceListingPlan) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MarketplaceListingPlan) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["accounts_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAccountsUrl(val) + } + return nil + } + res["bullets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetBullets(res) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["has_free_trial"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasFreeTrial(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["monthly_price_in_cents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMonthlyPriceInCents(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["price_model"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseMarketplaceListingPlan_price_model) + if err != nil { + return err + } + if val != nil { + m.SetPriceModel(val.(*MarketplaceListingPlan_price_model)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["unit_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUnitName(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["yearly_price_in_cents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetYearlyPriceInCents(val) + } + return nil + } + return res +} +// GetHasFreeTrial gets the has_free_trial property value. The has_free_trial property +// returns a *bool when successful +func (m *MarketplaceListingPlan) GetHasFreeTrial()(*bool) { + return m.has_free_trial +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *MarketplaceListingPlan) GetId()(*int32) { + return m.id +} +// GetMonthlyPriceInCents gets the monthly_price_in_cents property value. The monthly_price_in_cents property +// returns a *int32 when successful +func (m *MarketplaceListingPlan) GetMonthlyPriceInCents()(*int32) { + return m.monthly_price_in_cents +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *MarketplaceListingPlan) GetName()(*string) { + return m.name +} +// GetNumber gets the number property value. The number property +// returns a *int32 when successful +func (m *MarketplaceListingPlan) GetNumber()(*int32) { + return m.number +} +// GetPriceModel gets the price_model property value. The price_model property +// returns a *MarketplaceListingPlan_price_model when successful +func (m *MarketplaceListingPlan) GetPriceModel()(*MarketplaceListingPlan_price_model) { + return m.price_model +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *MarketplaceListingPlan) GetState()(*string) { + return m.state +} +// GetUnitName gets the unit_name property value. The unit_name property +// returns a *string when successful +func (m *MarketplaceListingPlan) GetUnitName()(*string) { + return m.unit_name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *MarketplaceListingPlan) GetUrl()(*string) { + return m.url +} +// GetYearlyPriceInCents gets the yearly_price_in_cents property value. The yearly_price_in_cents property +// returns a *int32 when successful +func (m *MarketplaceListingPlan) GetYearlyPriceInCents()(*int32) { + return m.yearly_price_in_cents +} +// Serialize serializes information the current object +func (m *MarketplaceListingPlan) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("accounts_url", m.GetAccountsUrl()) + if err != nil { + return err + } + } + if m.GetBullets() != nil { + err := writer.WriteCollectionOfStringValues("bullets", m.GetBullets()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_free_trial", m.GetHasFreeTrial()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("monthly_price_in_cents", m.GetMonthlyPriceInCents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + if m.GetPriceModel() != nil { + cast := (*m.GetPriceModel()).String() + err := writer.WriteStringValue("price_model", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("unit_name", m.GetUnitName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("yearly_price_in_cents", m.GetYearlyPriceInCents()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccountsUrl sets the accounts_url property value. The accounts_url property +func (m *MarketplaceListingPlan) SetAccountsUrl(value *string)() { + m.accounts_url = value +} +// 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 *MarketplaceListingPlan) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBullets sets the bullets property value. The bullets property +func (m *MarketplaceListingPlan) SetBullets(value []string)() { + m.bullets = value +} +// SetDescription sets the description property value. The description property +func (m *MarketplaceListingPlan) SetDescription(value *string)() { + m.description = value +} +// SetHasFreeTrial sets the has_free_trial property value. The has_free_trial property +func (m *MarketplaceListingPlan) SetHasFreeTrial(value *bool)() { + m.has_free_trial = value +} +// SetId sets the id property value. The id property +func (m *MarketplaceListingPlan) SetId(value *int32)() { + m.id = value +} +// SetMonthlyPriceInCents sets the monthly_price_in_cents property value. The monthly_price_in_cents property +func (m *MarketplaceListingPlan) SetMonthlyPriceInCents(value *int32)() { + m.monthly_price_in_cents = value +} +// SetName sets the name property value. The name property +func (m *MarketplaceListingPlan) SetName(value *string)() { + m.name = value +} +// SetNumber sets the number property value. The number property +func (m *MarketplaceListingPlan) SetNumber(value *int32)() { + m.number = value +} +// SetPriceModel sets the price_model property value. The price_model property +func (m *MarketplaceListingPlan) SetPriceModel(value *MarketplaceListingPlan_price_model)() { + m.price_model = value +} +// SetState sets the state property value. The state property +func (m *MarketplaceListingPlan) SetState(value *string)() { + m.state = value +} +// SetUnitName sets the unit_name property value. The unit_name property +func (m *MarketplaceListingPlan) SetUnitName(value *string)() { + m.unit_name = value +} +// SetUrl sets the url property value. The url property +func (m *MarketplaceListingPlan) SetUrl(value *string)() { + m.url = value +} +// SetYearlyPriceInCents sets the yearly_price_in_cents property value. The yearly_price_in_cents property +func (m *MarketplaceListingPlan) SetYearlyPriceInCents(value *int32)() { + m.yearly_price_in_cents = value +} +type MarketplaceListingPlanable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccountsUrl()(*string) + GetBullets()([]string) + GetDescription()(*string) + GetHasFreeTrial()(*bool) + GetId()(*int32) + GetMonthlyPriceInCents()(*int32) + GetName()(*string) + GetNumber()(*int32) + GetPriceModel()(*MarketplaceListingPlan_price_model) + GetState()(*string) + GetUnitName()(*string) + GetUrl()(*string) + GetYearlyPriceInCents()(*int32) + SetAccountsUrl(value *string)() + SetBullets(value []string)() + SetDescription(value *string)() + SetHasFreeTrial(value *bool)() + SetId(value *int32)() + SetMonthlyPriceInCents(value *int32)() + SetName(value *string)() + SetNumber(value *int32)() + SetPriceModel(value *MarketplaceListingPlan_price_model)() + SetState(value *string)() + SetUnitName(value *string)() + SetUrl(value *string)() + SetYearlyPriceInCents(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_listing_plan_price_model.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_listing_plan_price_model.go new file mode 100644 index 000000000..1905efb7d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_listing_plan_price_model.go @@ -0,0 +1,39 @@ +package models +import ( + "errors" +) +type MarketplaceListingPlan_price_model int + +const ( + FREE_MARKETPLACELISTINGPLAN_PRICE_MODEL MarketplaceListingPlan_price_model = iota + FLAT_RATE_MARKETPLACELISTINGPLAN_PRICE_MODEL + PER_UNIT_MARKETPLACELISTINGPLAN_PRICE_MODEL +) + +func (i MarketplaceListingPlan_price_model) String() string { + return []string{"FREE", "FLAT_RATE", "PER_UNIT"}[i] +} +func ParseMarketplaceListingPlan_price_model(v string) (any, error) { + result := FREE_MARKETPLACELISTINGPLAN_PRICE_MODEL + switch v { + case "FREE": + result = FREE_MARKETPLACELISTINGPLAN_PRICE_MODEL + case "FLAT_RATE": + result = FLAT_RATE_MARKETPLACELISTINGPLAN_PRICE_MODEL + case "PER_UNIT": + result = PER_UNIT_MARKETPLACELISTINGPLAN_PRICE_MODEL + default: + return 0, errors.New("Unknown MarketplaceListingPlan_price_model value: " + v) + } + return &result, nil +} +func SerializeMarketplaceListingPlan_price_model(values []MarketplaceListingPlan_price_model) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i MarketplaceListingPlan_price_model) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_purchase.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_purchase.go new file mode 100644 index 000000000..87ee43a1b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_purchase.go @@ -0,0 +1,284 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// MarketplacePurchase marketplace Purchase +type MarketplacePurchase struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The email property + email *string + // The id property + id *int32 + // The login property + login *string + // The marketplace_pending_change property + marketplace_pending_change MarketplacePurchase_marketplace_pending_changeable + // The marketplace_purchase property + marketplace_purchase MarketplacePurchase_marketplace_purchaseable + // The organization_billing_email property + organization_billing_email *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewMarketplacePurchase instantiates a new MarketplacePurchase and sets the default values. +func NewMarketplacePurchase()(*MarketplacePurchase) { + m := &MarketplacePurchase{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMarketplacePurchaseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMarketplacePurchaseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMarketplacePurchase(), 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 *MarketplacePurchase) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *MarketplacePurchase) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MarketplacePurchase) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["marketplace_pending_change"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMarketplacePurchase_marketplace_pending_changeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMarketplacePendingChange(val.(MarketplacePurchase_marketplace_pending_changeable)) + } + return nil + } + res["marketplace_purchase"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMarketplacePurchase_marketplace_purchaseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMarketplacePurchase(val.(MarketplacePurchase_marketplace_purchaseable)) + } + return nil + } + res["organization_billing_email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationBillingEmail(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *MarketplacePurchase) GetId()(*int32) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *MarketplacePurchase) GetLogin()(*string) { + return m.login +} +// GetMarketplacePendingChange gets the marketplace_pending_change property value. The marketplace_pending_change property +// returns a MarketplacePurchase_marketplace_pending_changeable when successful +func (m *MarketplacePurchase) GetMarketplacePendingChange()(MarketplacePurchase_marketplace_pending_changeable) { + return m.marketplace_pending_change +} +// GetMarketplacePurchase gets the marketplace_purchase property value. The marketplace_purchase property +// returns a MarketplacePurchase_marketplace_purchaseable when successful +func (m *MarketplacePurchase) GetMarketplacePurchase()(MarketplacePurchase_marketplace_purchaseable) { + return m.marketplace_purchase +} +// GetOrganizationBillingEmail gets the organization_billing_email property value. The organization_billing_email property +// returns a *string when successful +func (m *MarketplacePurchase) GetOrganizationBillingEmail()(*string) { + return m.organization_billing_email +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *MarketplacePurchase) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *MarketplacePurchase) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *MarketplacePurchase) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("marketplace_pending_change", m.GetMarketplacePendingChange()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("marketplace_purchase", m.GetMarketplacePurchase()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization_billing_email", m.GetOrganizationBillingEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *MarketplacePurchase) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. The email property +func (m *MarketplacePurchase) SetEmail(value *string)() { + m.email = value +} +// SetId sets the id property value. The id property +func (m *MarketplacePurchase) SetId(value *int32)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *MarketplacePurchase) SetLogin(value *string)() { + m.login = value +} +// SetMarketplacePendingChange sets the marketplace_pending_change property value. The marketplace_pending_change property +func (m *MarketplacePurchase) SetMarketplacePendingChange(value MarketplacePurchase_marketplace_pending_changeable)() { + m.marketplace_pending_change = value +} +// SetMarketplacePurchase sets the marketplace_purchase property value. The marketplace_purchase property +func (m *MarketplacePurchase) SetMarketplacePurchase(value MarketplacePurchase_marketplace_purchaseable)() { + m.marketplace_purchase = value +} +// SetOrganizationBillingEmail sets the organization_billing_email property value. The organization_billing_email property +func (m *MarketplacePurchase) SetOrganizationBillingEmail(value *string)() { + m.organization_billing_email = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *MarketplacePurchase) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *MarketplacePurchase) SetUrl(value *string)() { + m.url = value +} +type MarketplacePurchaseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetId()(*int32) + GetLogin()(*string) + GetMarketplacePendingChange()(MarketplacePurchase_marketplace_pending_changeable) + GetMarketplacePurchase()(MarketplacePurchase_marketplace_purchaseable) + GetOrganizationBillingEmail()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetEmail(value *string)() + SetId(value *int32)() + SetLogin(value *string)() + SetMarketplacePendingChange(value MarketplacePurchase_marketplace_pending_changeable)() + SetMarketplacePurchase(value MarketplacePurchase_marketplace_purchaseable)() + SetOrganizationBillingEmail(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_purchase_marketplace_pending_change.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_purchase_marketplace_pending_change.go new file mode 100644 index 000000000..d14fed787 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_purchase_marketplace_pending_change.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MarketplacePurchase_marketplace_pending_change struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The effective_date property + effective_date *string + // The id property + id *int32 + // The is_installed property + is_installed *bool + // Marketplace Listing Plan + plan MarketplaceListingPlanable + // The unit_count property + unit_count *int32 +} +// NewMarketplacePurchase_marketplace_pending_change instantiates a new MarketplacePurchase_marketplace_pending_change and sets the default values. +func NewMarketplacePurchase_marketplace_pending_change()(*MarketplacePurchase_marketplace_pending_change) { + m := &MarketplacePurchase_marketplace_pending_change{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMarketplacePurchase_marketplace_pending_changeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMarketplacePurchase_marketplace_pending_changeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMarketplacePurchase_marketplace_pending_change(), 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 *MarketplacePurchase_marketplace_pending_change) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEffectiveDate gets the effective_date property value. The effective_date property +// returns a *string when successful +func (m *MarketplacePurchase_marketplace_pending_change) GetEffectiveDate()(*string) { + return m.effective_date +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MarketplacePurchase_marketplace_pending_change) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["effective_date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEffectiveDate(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_installed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsInstalled(val) + } + return nil + } + res["plan"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMarketplaceListingPlanFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPlan(val.(MarketplaceListingPlanable)) + } + return nil + } + res["unit_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUnitCount(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *MarketplacePurchase_marketplace_pending_change) GetId()(*int32) { + return m.id +} +// GetIsInstalled gets the is_installed property value. The is_installed property +// returns a *bool when successful +func (m *MarketplacePurchase_marketplace_pending_change) GetIsInstalled()(*bool) { + return m.is_installed +} +// GetPlan gets the plan property value. Marketplace Listing Plan +// returns a MarketplaceListingPlanable when successful +func (m *MarketplacePurchase_marketplace_pending_change) GetPlan()(MarketplaceListingPlanable) { + return m.plan +} +// GetUnitCount gets the unit_count property value. The unit_count property +// returns a *int32 when successful +func (m *MarketplacePurchase_marketplace_pending_change) GetUnitCount()(*int32) { + return m.unit_count +} +// Serialize serializes information the current object +func (m *MarketplacePurchase_marketplace_pending_change) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("effective_date", m.GetEffectiveDate()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_installed", m.GetIsInstalled()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("plan", m.GetPlan()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("unit_count", m.GetUnitCount()) + 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 *MarketplacePurchase_marketplace_pending_change) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEffectiveDate sets the effective_date property value. The effective_date property +func (m *MarketplacePurchase_marketplace_pending_change) SetEffectiveDate(value *string)() { + m.effective_date = value +} +// SetId sets the id property value. The id property +func (m *MarketplacePurchase_marketplace_pending_change) SetId(value *int32)() { + m.id = value +} +// SetIsInstalled sets the is_installed property value. The is_installed property +func (m *MarketplacePurchase_marketplace_pending_change) SetIsInstalled(value *bool)() { + m.is_installed = value +} +// SetPlan sets the plan property value. Marketplace Listing Plan +func (m *MarketplacePurchase_marketplace_pending_change) SetPlan(value MarketplaceListingPlanable)() { + m.plan = value +} +// SetUnitCount sets the unit_count property value. The unit_count property +func (m *MarketplacePurchase_marketplace_pending_change) SetUnitCount(value *int32)() { + m.unit_count = value +} +type MarketplacePurchase_marketplace_pending_changeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEffectiveDate()(*string) + GetId()(*int32) + GetIsInstalled()(*bool) + GetPlan()(MarketplaceListingPlanable) + GetUnitCount()(*int32) + SetEffectiveDate(value *string)() + SetId(value *int32)() + SetIsInstalled(value *bool)() + SetPlan(value MarketplaceListingPlanable)() + SetUnitCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_purchase_marketplace_purchase.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_purchase_marketplace_purchase.go new file mode 100644 index 000000000..4bee05bec --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/marketplace_purchase_marketplace_purchase.go @@ -0,0 +1,283 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MarketplacePurchase_marketplace_purchase struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The billing_cycle property + billing_cycle *string + // The free_trial_ends_on property + free_trial_ends_on *string + // The is_installed property + is_installed *bool + // The next_billing_date property + next_billing_date *string + // The on_free_trial property + on_free_trial *bool + // Marketplace Listing Plan + plan MarketplaceListingPlanable + // The unit_count property + unit_count *int32 + // The updated_at property + updated_at *string +} +// NewMarketplacePurchase_marketplace_purchase instantiates a new MarketplacePurchase_marketplace_purchase and sets the default values. +func NewMarketplacePurchase_marketplace_purchase()(*MarketplacePurchase_marketplace_purchase) { + m := &MarketplacePurchase_marketplace_purchase{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMarketplacePurchase_marketplace_purchaseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMarketplacePurchase_marketplace_purchaseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMarketplacePurchase_marketplace_purchase(), 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 *MarketplacePurchase_marketplace_purchase) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBillingCycle gets the billing_cycle property value. The billing_cycle property +// returns a *string when successful +func (m *MarketplacePurchase_marketplace_purchase) GetBillingCycle()(*string) { + return m.billing_cycle +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MarketplacePurchase_marketplace_purchase) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["billing_cycle"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBillingCycle(val) + } + return nil + } + res["free_trial_ends_on"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFreeTrialEndsOn(val) + } + return nil + } + res["is_installed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsInstalled(val) + } + return nil + } + res["next_billing_date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNextBillingDate(val) + } + return nil + } + res["on_free_trial"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetOnFreeTrial(val) + } + return nil + } + res["plan"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMarketplaceListingPlanFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPlan(val.(MarketplaceListingPlanable)) + } + return nil + } + res["unit_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUnitCount(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetFreeTrialEndsOn gets the free_trial_ends_on property value. The free_trial_ends_on property +// returns a *string when successful +func (m *MarketplacePurchase_marketplace_purchase) GetFreeTrialEndsOn()(*string) { + return m.free_trial_ends_on +} +// GetIsInstalled gets the is_installed property value. The is_installed property +// returns a *bool when successful +func (m *MarketplacePurchase_marketplace_purchase) GetIsInstalled()(*bool) { + return m.is_installed +} +// GetNextBillingDate gets the next_billing_date property value. The next_billing_date property +// returns a *string when successful +func (m *MarketplacePurchase_marketplace_purchase) GetNextBillingDate()(*string) { + return m.next_billing_date +} +// GetOnFreeTrial gets the on_free_trial property value. The on_free_trial property +// returns a *bool when successful +func (m *MarketplacePurchase_marketplace_purchase) GetOnFreeTrial()(*bool) { + return m.on_free_trial +} +// GetPlan gets the plan property value. Marketplace Listing Plan +// returns a MarketplaceListingPlanable when successful +func (m *MarketplacePurchase_marketplace_purchase) GetPlan()(MarketplaceListingPlanable) { + return m.plan +} +// GetUnitCount gets the unit_count property value. The unit_count property +// returns a *int32 when successful +func (m *MarketplacePurchase_marketplace_purchase) GetUnitCount()(*int32) { + return m.unit_count +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *string when successful +func (m *MarketplacePurchase_marketplace_purchase) GetUpdatedAt()(*string) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *MarketplacePurchase_marketplace_purchase) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("billing_cycle", m.GetBillingCycle()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("free_trial_ends_on", m.GetFreeTrialEndsOn()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_installed", m.GetIsInstalled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("next_billing_date", m.GetNextBillingDate()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("on_free_trial", m.GetOnFreeTrial()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("plan", m.GetPlan()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("unit_count", m.GetUnitCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + 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 *MarketplacePurchase_marketplace_purchase) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBillingCycle sets the billing_cycle property value. The billing_cycle property +func (m *MarketplacePurchase_marketplace_purchase) SetBillingCycle(value *string)() { + m.billing_cycle = value +} +// SetFreeTrialEndsOn sets the free_trial_ends_on property value. The free_trial_ends_on property +func (m *MarketplacePurchase_marketplace_purchase) SetFreeTrialEndsOn(value *string)() { + m.free_trial_ends_on = value +} +// SetIsInstalled sets the is_installed property value. The is_installed property +func (m *MarketplacePurchase_marketplace_purchase) SetIsInstalled(value *bool)() { + m.is_installed = value +} +// SetNextBillingDate sets the next_billing_date property value. The next_billing_date property +func (m *MarketplacePurchase_marketplace_purchase) SetNextBillingDate(value *string)() { + m.next_billing_date = value +} +// SetOnFreeTrial sets the on_free_trial property value. The on_free_trial property +func (m *MarketplacePurchase_marketplace_purchase) SetOnFreeTrial(value *bool)() { + m.on_free_trial = value +} +// SetPlan sets the plan property value. Marketplace Listing Plan +func (m *MarketplacePurchase_marketplace_purchase) SetPlan(value MarketplaceListingPlanable)() { + m.plan = value +} +// SetUnitCount sets the unit_count property value. The unit_count property +func (m *MarketplacePurchase_marketplace_purchase) SetUnitCount(value *int32)() { + m.unit_count = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *MarketplacePurchase_marketplace_purchase) SetUpdatedAt(value *string)() { + m.updated_at = value +} +type MarketplacePurchase_marketplace_purchaseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBillingCycle()(*string) + GetFreeTrialEndsOn()(*string) + GetIsInstalled()(*bool) + GetNextBillingDate()(*string) + GetOnFreeTrial()(*bool) + GetPlan()(MarketplaceListingPlanable) + GetUnitCount()(*int32) + GetUpdatedAt()(*string) + SetBillingCycle(value *string)() + SetFreeTrialEndsOn(value *string)() + SetIsInstalled(value *bool)() + SetNextBillingDate(value *string)() + SetOnFreeTrial(value *bool)() + SetPlan(value MarketplaceListingPlanable)() + SetUnitCount(value *int32)() + SetUpdatedAt(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_path_length.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_path_length.go new file mode 100644 index 000000000..ec4fe6f8c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_path_length.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Max_file_path_length note: max_file_path_length is in beta and subject to change.Prevent commits that include file paths that exceed a specified character limit from being pushed to the commit graph. +type Max_file_path_length struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters Max_file_path_length_parametersable + // The type property + typeEscaped *Max_file_path_length_type +} +// NewMax_file_path_length instantiates a new Max_file_path_length and sets the default values. +func NewMax_file_path_length()(*Max_file_path_length) { + m := &Max_file_path_length{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMax_file_path_lengthFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMax_file_path_lengthFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMax_file_path_length(), 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 *Max_file_path_length) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Max_file_path_length) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMax_file_path_length_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(Max_file_path_length_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseMax_file_path_length_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*Max_file_path_length_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a Max_file_path_length_parametersable when successful +func (m *Max_file_path_length) GetParameters()(Max_file_path_length_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *Max_file_path_length_type when successful +func (m *Max_file_path_length) GetTypeEscaped()(*Max_file_path_length_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *Max_file_path_length) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *Max_file_path_length) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *Max_file_path_length) SetParameters(value Max_file_path_length_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Max_file_path_length) SetTypeEscaped(value *Max_file_path_length_type)() { + m.typeEscaped = value +} +type Max_file_path_lengthable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(Max_file_path_length_parametersable) + GetTypeEscaped()(*Max_file_path_length_type) + SetParameters(value Max_file_path_length_parametersable)() + SetTypeEscaped(value *Max_file_path_length_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_path_length_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_path_length_parameters.go new file mode 100644 index 000000000..bde936d93 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_path_length_parameters.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Max_file_path_length_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The maximum amount of characters allowed in file paths + max_file_path_length *int32 +} +// NewMax_file_path_length_parameters instantiates a new Max_file_path_length_parameters and sets the default values. +func NewMax_file_path_length_parameters()(*Max_file_path_length_parameters) { + m := &Max_file_path_length_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMax_file_path_length_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMax_file_path_length_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMax_file_path_length_parameters(), 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 *Max_file_path_length_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Max_file_path_length_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["max_file_path_length"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMaxFilePathLength(val) + } + return nil + } + return res +} +// GetMaxFilePathLength gets the max_file_path_length property value. The maximum amount of characters allowed in file paths +// returns a *int32 when successful +func (m *Max_file_path_length_parameters) GetMaxFilePathLength()(*int32) { + return m.max_file_path_length +} +// Serialize serializes information the current object +func (m *Max_file_path_length_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("max_file_path_length", m.GetMaxFilePathLength()) + 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 *Max_file_path_length_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMaxFilePathLength sets the max_file_path_length property value. The maximum amount of characters allowed in file paths +func (m *Max_file_path_length_parameters) SetMaxFilePathLength(value *int32)() { + m.max_file_path_length = value +} +type Max_file_path_length_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMaxFilePathLength()(*int32) + SetMaxFilePathLength(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_path_length_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_path_length_type.go new file mode 100644 index 000000000..daaf0629d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_path_length_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type Max_file_path_length_type int + +const ( + MAX_FILE_PATH_LENGTH_MAX_FILE_PATH_LENGTH_TYPE Max_file_path_length_type = iota +) + +func (i Max_file_path_length_type) String() string { + return []string{"max_file_path_length"}[i] +} +func ParseMax_file_path_length_type(v string) (any, error) { + result := MAX_FILE_PATH_LENGTH_MAX_FILE_PATH_LENGTH_TYPE + switch v { + case "max_file_path_length": + result = MAX_FILE_PATH_LENGTH_MAX_FILE_PATH_LENGTH_TYPE + default: + return 0, errors.New("Unknown Max_file_path_length_type value: " + v) + } + return &result, nil +} +func SerializeMax_file_path_length_type(values []Max_file_path_length_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Max_file_path_length_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_size.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_size.go new file mode 100644 index 000000000..9bf5bb591 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_size.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Max_file_size note: max_file_size is in beta and subject to change.Prevent commits that exceed a specified file size limit from being pushed to the commit. +type Max_file_size struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters Max_file_size_parametersable + // The type property + typeEscaped *Max_file_size_type +} +// NewMax_file_size instantiates a new Max_file_size and sets the default values. +func NewMax_file_size()(*Max_file_size) { + m := &Max_file_size{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMax_file_sizeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMax_file_sizeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMax_file_size(), 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 *Max_file_size) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Max_file_size) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMax_file_size_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(Max_file_size_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseMax_file_size_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*Max_file_size_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a Max_file_size_parametersable when successful +func (m *Max_file_size) GetParameters()(Max_file_size_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *Max_file_size_type when successful +func (m *Max_file_size) GetTypeEscaped()(*Max_file_size_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *Max_file_size) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *Max_file_size) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *Max_file_size) SetParameters(value Max_file_size_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Max_file_size) SetTypeEscaped(value *Max_file_size_type)() { + m.typeEscaped = value +} +type Max_file_sizeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(Max_file_size_parametersable) + GetTypeEscaped()(*Max_file_size_type) + SetParameters(value Max_file_size_parametersable)() + SetTypeEscaped(value *Max_file_size_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_size_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_size_parameters.go new file mode 100644 index 000000000..9bb378564 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_size_parameters.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Max_file_size_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The maximum file size allowed in megabytes. This limit does not apply to Git Large File Storage (Git LFS). + max_file_size *int32 +} +// NewMax_file_size_parameters instantiates a new Max_file_size_parameters and sets the default values. +func NewMax_file_size_parameters()(*Max_file_size_parameters) { + m := &Max_file_size_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMax_file_size_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMax_file_size_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMax_file_size_parameters(), 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 *Max_file_size_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Max_file_size_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["max_file_size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMaxFileSize(val) + } + return nil + } + return res +} +// GetMaxFileSize gets the max_file_size property value. The maximum file size allowed in megabytes. This limit does not apply to Git Large File Storage (Git LFS). +// returns a *int32 when successful +func (m *Max_file_size_parameters) GetMaxFileSize()(*int32) { + return m.max_file_size +} +// Serialize serializes information the current object +func (m *Max_file_size_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("max_file_size", m.GetMaxFileSize()) + 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 *Max_file_size_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMaxFileSize sets the max_file_size property value. The maximum file size allowed in megabytes. This limit does not apply to Git Large File Storage (Git LFS). +func (m *Max_file_size_parameters) SetMaxFileSize(value *int32)() { + m.max_file_size = value +} +type Max_file_size_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMaxFileSize()(*int32) + SetMaxFileSize(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_size_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_size_type.go new file mode 100644 index 000000000..f4b53a3f5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/max_file_size_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type Max_file_size_type int + +const ( + MAX_FILE_SIZE_MAX_FILE_SIZE_TYPE Max_file_size_type = iota +) + +func (i Max_file_size_type) String() string { + return []string{"max_file_size"}[i] +} +func ParseMax_file_size_type(v string) (any, error) { + result := MAX_FILE_SIZE_MAX_FILE_SIZE_TYPE + switch v { + case "max_file_size": + result = MAX_FILE_SIZE_MAX_FILE_SIZE_TYPE + default: + return 0, errors.New("Unknown Max_file_size_type value: " + v) + } + return &result, nil +} +func SerializeMax_file_size_type(values []Max_file_size_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Max_file_size_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/merged_upstream.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/merged_upstream.go new file mode 100644 index 000000000..42558b5ae --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/merged_upstream.go @@ -0,0 +1,140 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// MergedUpstream results of a successful merge upstream request +type MergedUpstream struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The base_branch property + base_branch *string + // The merge_type property + merge_type *MergedUpstream_merge_type + // The message property + message *string +} +// NewMergedUpstream instantiates a new MergedUpstream and sets the default values. +func NewMergedUpstream()(*MergedUpstream) { + m := &MergedUpstream{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMergedUpstreamFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMergedUpstreamFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMergedUpstream(), 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 *MergedUpstream) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBaseBranch gets the base_branch property value. The base_branch property +// returns a *string when successful +func (m *MergedUpstream) GetBaseBranch()(*string) { + return m.base_branch +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MergedUpstream) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["base_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBaseBranch(val) + } + return nil + } + res["merge_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseMergedUpstream_merge_type) + if err != nil { + return err + } + if val != nil { + m.SetMergeType(val.(*MergedUpstream_merge_type)) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMergeType gets the merge_type property value. The merge_type property +// returns a *MergedUpstream_merge_type when successful +func (m *MergedUpstream) GetMergeType()(*MergedUpstream_merge_type) { + return m.merge_type +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *MergedUpstream) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *MergedUpstream) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("base_branch", m.GetBaseBranch()) + if err != nil { + return err + } + } + if m.GetMergeType() != nil { + cast := (*m.GetMergeType()).String() + err := writer.WriteStringValue("merge_type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *MergedUpstream) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBaseBranch sets the base_branch property value. The base_branch property +func (m *MergedUpstream) SetBaseBranch(value *string)() { + m.base_branch = value +} +// SetMergeType sets the merge_type property value. The merge_type property +func (m *MergedUpstream) SetMergeType(value *MergedUpstream_merge_type)() { + m.merge_type = value +} +// SetMessage sets the message property value. The message property +func (m *MergedUpstream) SetMessage(value *string)() { + m.message = value +} +type MergedUpstreamable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBaseBranch()(*string) + GetMergeType()(*MergedUpstream_merge_type) + GetMessage()(*string) + SetBaseBranch(value *string)() + SetMergeType(value *MergedUpstream_merge_type)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/merged_upstream_merge_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/merged_upstream_merge_type.go new file mode 100644 index 000000000..e86904183 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/merged_upstream_merge_type.go @@ -0,0 +1,39 @@ +package models +import ( + "errors" +) +type MergedUpstream_merge_type int + +const ( + MERGE_MERGEDUPSTREAM_MERGE_TYPE MergedUpstream_merge_type = iota + FASTFORWARD_MERGEDUPSTREAM_MERGE_TYPE + NONE_MERGEDUPSTREAM_MERGE_TYPE +) + +func (i MergedUpstream_merge_type) String() string { + return []string{"merge", "fast-forward", "none"}[i] +} +func ParseMergedUpstream_merge_type(v string) (any, error) { + result := MERGE_MERGEDUPSTREAM_MERGE_TYPE + switch v { + case "merge": + result = MERGE_MERGEDUPSTREAM_MERGE_TYPE + case "fast-forward": + result = FASTFORWARD_MERGEDUPSTREAM_MERGE_TYPE + case "none": + result = NONE_MERGEDUPSTREAM_MERGE_TYPE + default: + return 0, errors.New("Unknown MergedUpstream_merge_type value: " + v) + } + return &result, nil +} +func SerializeMergedUpstream_merge_type(values []MergedUpstream_merge_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i MergedUpstream_merge_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/metadata.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/metadata.go new file mode 100644 index 000000000..06ce8d14d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/metadata.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Metadata user-defined metadata to store domain-specific information limited to 8 keys with scalar values. +type Metadata struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewMetadata instantiates a new Metadata and sets the default values. +func NewMetadata()(*Metadata) { + m := &Metadata{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMetadataFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMetadataFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMetadata(), 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 *Metadata) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Metadata) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *Metadata) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *Metadata) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type Metadataable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/migration.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/migration.go new file mode 100644 index 000000000..247d723df --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/migration.go @@ -0,0 +1,593 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Migration a migration. +type Migration struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The archive_url property + archive_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Exclude related items from being returned in the response in order to improve performance of the request. The array can include any of: `"repositories"`. + exclude []string + // The exclude_attachments property + exclude_attachments *bool + // The exclude_git_data property + exclude_git_data *bool + // The exclude_metadata property + exclude_metadata *bool + // The exclude_owner_projects property + exclude_owner_projects *bool + // The exclude_releases property + exclude_releases *bool + // The guid property + guid *string + // The id property + id *int64 + // The lock_repositories property + lock_repositories *bool + // The node_id property + node_id *string + // The org_metadata_only property + org_metadata_only *bool + // A GitHub user. + owner NullableSimpleUserable + // The repositories included in the migration. Only returned for export migrations. + repositories []Repositoryable + // The state property + state *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewMigration instantiates a new Migration and sets the default values. +func NewMigration()(*Migration) { + m := &Migration{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMigrationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMigrationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMigration(), 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 *Migration) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *Migration) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Migration) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetExclude gets the exclude property value. Exclude related items from being returned in the response in order to improve performance of the request. The array can include any of: `"repositories"`. +// returns a []string when successful +func (m *Migration) GetExclude()([]string) { + return m.exclude +} +// GetExcludeAttachments gets the exclude_attachments property value. The exclude_attachments property +// returns a *bool when successful +func (m *Migration) GetExcludeAttachments()(*bool) { + return m.exclude_attachments +} +// GetExcludeGitData gets the exclude_git_data property value. The exclude_git_data property +// returns a *bool when successful +func (m *Migration) GetExcludeGitData()(*bool) { + return m.exclude_git_data +} +// GetExcludeMetadata gets the exclude_metadata property value. The exclude_metadata property +// returns a *bool when successful +func (m *Migration) GetExcludeMetadata()(*bool) { + return m.exclude_metadata +} +// GetExcludeOwnerProjects gets the exclude_owner_projects property value. The exclude_owner_projects property +// returns a *bool when successful +func (m *Migration) GetExcludeOwnerProjects()(*bool) { + return m.exclude_owner_projects +} +// GetExcludeReleases gets the exclude_releases property value. The exclude_releases property +// returns a *bool when successful +func (m *Migration) GetExcludeReleases()(*bool) { + return m.exclude_releases +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Migration) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["exclude"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetExclude(res) + } + return nil + } + res["exclude_attachments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeAttachments(val) + } + return nil + } + res["exclude_git_data"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeGitData(val) + } + return nil + } + res["exclude_metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeMetadata(val) + } + return nil + } + res["exclude_owner_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeOwnerProjects(val) + } + return nil + } + res["exclude_releases"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeReleases(val) + } + return nil + } + res["guid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGuid(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["lock_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLockRepositories(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["org_metadata_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetOrgMetadataOnly(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(NullableSimpleUserable)) + } + return nil + } + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Repositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Repositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetGuid gets the guid property value. The guid property +// returns a *string when successful +func (m *Migration) GetGuid()(*string) { + return m.guid +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *Migration) GetId()(*int64) { + return m.id +} +// GetLockRepositories gets the lock_repositories property value. The lock_repositories property +// returns a *bool when successful +func (m *Migration) GetLockRepositories()(*bool) { + return m.lock_repositories +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Migration) GetNodeId()(*string) { + return m.node_id +} +// GetOrgMetadataOnly gets the org_metadata_only property value. The org_metadata_only property +// returns a *bool when successful +func (m *Migration) GetOrgMetadataOnly()(*bool) { + return m.org_metadata_only +} +// GetOwner gets the owner property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Migration) GetOwner()(NullableSimpleUserable) { + return m.owner +} +// GetRepositories gets the repositories property value. The repositories included in the migration. Only returned for export migrations. +// returns a []Repositoryable when successful +func (m *Migration) GetRepositories()([]Repositoryable) { + return m.repositories +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *Migration) GetState()(*string) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Migration) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Migration) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Migration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + if m.GetExclude() != nil { + err := writer.WriteCollectionOfStringValues("exclude", m.GetExclude()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_attachments", m.GetExcludeAttachments()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_git_data", m.GetExcludeGitData()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_metadata", m.GetExcludeMetadata()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_owner_projects", m.GetExcludeOwnerProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_releases", m.GetExcludeReleases()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("guid", m.GetGuid()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("lock_repositories", m.GetLockRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("org_metadata_only", m.GetOrgMetadataOnly()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Migration) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *Migration) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Migration) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetExclude sets the exclude property value. Exclude related items from being returned in the response in order to improve performance of the request. The array can include any of: `"repositories"`. +func (m *Migration) SetExclude(value []string)() { + m.exclude = value +} +// SetExcludeAttachments sets the exclude_attachments property value. The exclude_attachments property +func (m *Migration) SetExcludeAttachments(value *bool)() { + m.exclude_attachments = value +} +// SetExcludeGitData sets the exclude_git_data property value. The exclude_git_data property +func (m *Migration) SetExcludeGitData(value *bool)() { + m.exclude_git_data = value +} +// SetExcludeMetadata sets the exclude_metadata property value. The exclude_metadata property +func (m *Migration) SetExcludeMetadata(value *bool)() { + m.exclude_metadata = value +} +// SetExcludeOwnerProjects sets the exclude_owner_projects property value. The exclude_owner_projects property +func (m *Migration) SetExcludeOwnerProjects(value *bool)() { + m.exclude_owner_projects = value +} +// SetExcludeReleases sets the exclude_releases property value. The exclude_releases property +func (m *Migration) SetExcludeReleases(value *bool)() { + m.exclude_releases = value +} +// SetGuid sets the guid property value. The guid property +func (m *Migration) SetGuid(value *string)() { + m.guid = value +} +// SetId sets the id property value. The id property +func (m *Migration) SetId(value *int64)() { + m.id = value +} +// SetLockRepositories sets the lock_repositories property value. The lock_repositories property +func (m *Migration) SetLockRepositories(value *bool)() { + m.lock_repositories = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Migration) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrgMetadataOnly sets the org_metadata_only property value. The org_metadata_only property +func (m *Migration) SetOrgMetadataOnly(value *bool)() { + m.org_metadata_only = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *Migration) SetOwner(value NullableSimpleUserable)() { + m.owner = value +} +// SetRepositories sets the repositories property value. The repositories included in the migration. Only returned for export migrations. +func (m *Migration) SetRepositories(value []Repositoryable)() { + m.repositories = value +} +// SetState sets the state property value. The state property +func (m *Migration) SetState(value *string)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Migration) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Migration) SetUrl(value *string)() { + m.url = value +} +type Migrationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArchiveUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetExclude()([]string) + GetExcludeAttachments()(*bool) + GetExcludeGitData()(*bool) + GetExcludeMetadata()(*bool) + GetExcludeOwnerProjects()(*bool) + GetExcludeReleases()(*bool) + GetGuid()(*string) + GetId()(*int64) + GetLockRepositories()(*bool) + GetNodeId()(*string) + GetOrgMetadataOnly()(*bool) + GetOwner()(NullableSimpleUserable) + GetRepositories()([]Repositoryable) + GetState()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetArchiveUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetExclude(value []string)() + SetExcludeAttachments(value *bool)() + SetExcludeGitData(value *bool)() + SetExcludeMetadata(value *bool)() + SetExcludeOwnerProjects(value *bool)() + SetExcludeReleases(value *bool)() + SetGuid(value *string)() + SetId(value *int64)() + SetLockRepositories(value *bool)() + SetNodeId(value *string)() + SetOrgMetadataOnly(value *bool)() + SetOwner(value NullableSimpleUserable)() + SetRepositories(value []Repositoryable)() + SetState(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/milestone.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/milestone.go new file mode 100644 index 000000000..6e613c0cc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/milestone.go @@ -0,0 +1,520 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Milestone a collection of related issues and pull requests. +type Milestone struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The closed_at property + closed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The closed_issues property + closed_issues *int32 + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + creator NullableSimpleUserable + // The description property + description *string + // The due_on property + due_on *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The html_url property + html_url *string + // The id property + id *int32 + // The labels_url property + labels_url *string + // The node_id property + node_id *string + // The number of the milestone. + number *int32 + // The open_issues property + open_issues *int32 + // The state of the milestone. + state *Milestone_state + // The title of the milestone. + title *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewMilestone instantiates a new Milestone and sets the default values. +func NewMilestone()(*Milestone) { + m := &Milestone{ + } + m.SetAdditionalData(make(map[string]any)) + stateValue := OPEN_MILESTONE_STATE + m.SetState(&stateValue) + return m +} +// CreateMilestoneFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMilestoneFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMilestone(), 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 *Milestone) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClosedAt gets the closed_at property value. The closed_at property +// returns a *Time when successful +func (m *Milestone) GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.closed_at +} +// GetClosedIssues gets the closed_issues property value. The closed_issues property +// returns a *int32 when successful +func (m *Milestone) GetClosedIssues()(*int32) { + return m.closed_issues +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Milestone) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCreator gets the creator property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Milestone) GetCreator()(NullableSimpleUserable) { + return m.creator +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *Milestone) GetDescription()(*string) { + return m.description +} +// GetDueOn gets the due_on property value. The due_on property +// returns a *Time when successful +func (m *Milestone) GetDueOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.due_on +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Milestone) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["closed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetClosedAt(val) + } + return nil + } + res["closed_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetClosedIssues(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["creator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreator(val.(NullableSimpleUserable)) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["due_on"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDueOn(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseMilestone_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*Milestone_state)) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Milestone) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Milestone) GetId()(*int32) { + return m.id +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *Milestone) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Milestone) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. The number of the milestone. +// returns a *int32 when successful +func (m *Milestone) GetNumber()(*int32) { + return m.number +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *Milestone) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetState gets the state property value. The state of the milestone. +// returns a *Milestone_state when successful +func (m *Milestone) GetState()(*Milestone_state) { + return m.state +} +// GetTitle gets the title property value. The title of the milestone. +// returns a *string when successful +func (m *Milestone) GetTitle()(*string) { + return m.title +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Milestone) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Milestone) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Milestone) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("closed_at", m.GetClosedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("closed_issues", m.GetClosedIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("creator", m.GetCreator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("due_on", m.GetDueOn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Milestone) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClosedAt sets the closed_at property value. The closed_at property +func (m *Milestone) SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.closed_at = value +} +// SetClosedIssues sets the closed_issues property value. The closed_issues property +func (m *Milestone) SetClosedIssues(value *int32)() { + m.closed_issues = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Milestone) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCreator sets the creator property value. A GitHub user. +func (m *Milestone) SetCreator(value NullableSimpleUserable)() { + m.creator = value +} +// SetDescription sets the description property value. The description property +func (m *Milestone) SetDescription(value *string)() { + m.description = value +} +// SetDueOn sets the due_on property value. The due_on property +func (m *Milestone) SetDueOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.due_on = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Milestone) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Milestone) SetId(value *int32)() { + m.id = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *Milestone) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Milestone) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. The number of the milestone. +func (m *Milestone) SetNumber(value *int32)() { + m.number = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *Milestone) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetState sets the state property value. The state of the milestone. +func (m *Milestone) SetState(value *Milestone_state)() { + m.state = value +} +// SetTitle sets the title property value. The title of the milestone. +func (m *Milestone) SetTitle(value *string)() { + m.title = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Milestone) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Milestone) SetUrl(value *string)() { + m.url = value +} +type Milestoneable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetClosedIssues()(*int32) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreator()(NullableSimpleUserable) + GetDescription()(*string) + GetDueOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLabelsUrl()(*string) + GetNodeId()(*string) + GetNumber()(*int32) + GetOpenIssues()(*int32) + GetState()(*Milestone_state) + GetTitle()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetClosedIssues(value *int32)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreator(value NullableSimpleUserable)() + SetDescription(value *string)() + SetDueOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLabelsUrl(value *string)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetOpenIssues(value *int32)() + SetState(value *Milestone_state)() + SetTitle(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/milestone_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/milestone_state.go new file mode 100644 index 000000000..1ff9c4924 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/milestone_state.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The state of the milestone. +type Milestone_state int + +const ( + OPEN_MILESTONE_STATE Milestone_state = iota + CLOSED_MILESTONE_STATE +) + +func (i Milestone_state) String() string { + return []string{"open", "closed"}[i] +} +func ParseMilestone_state(v string) (any, error) { + result := OPEN_MILESTONE_STATE + switch v { + case "open": + result = OPEN_MILESTONE_STATE + case "closed": + result = CLOSED_MILESTONE_STATE + default: + return 0, errors.New("Unknown Milestone_state value: " + v) + } + return &result, nil +} +func SerializeMilestone_state(values []Milestone_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Milestone_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/milestoned_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/milestoned_issue_event.go new file mode 100644 index 000000000..0184fee93 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/milestoned_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// MilestonedIssueEvent milestoned Issue Event +type MilestonedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The milestone property + milestone MilestonedIssueEvent_milestoneable + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewMilestonedIssueEvent instantiates a new MilestonedIssueEvent and sets the default values. +func NewMilestonedIssueEvent()(*MilestonedIssueEvent) { + m := &MilestonedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMilestonedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMilestonedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMilestonedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *MilestonedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *MilestonedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *MilestonedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *MilestonedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *MilestonedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *MilestonedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MilestonedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMilestonedIssueEvent_milestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(MilestonedIssueEvent_milestoneable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *MilestonedIssueEvent) GetId()(*int32) { + return m.id +} +// GetMilestone gets the milestone property value. The milestone property +// returns a MilestonedIssueEvent_milestoneable when successful +func (m *MilestonedIssueEvent) GetMilestone()(MilestonedIssueEvent_milestoneable) { + return m.milestone +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *MilestonedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *MilestonedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *MilestonedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *MilestonedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *MilestonedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *MilestonedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *MilestonedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *MilestonedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *MilestonedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *MilestonedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *MilestonedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetMilestone sets the milestone property value. The milestone property +func (m *MilestonedIssueEvent) SetMilestone(value MilestonedIssueEvent_milestoneable)() { + m.milestone = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *MilestonedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *MilestonedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *MilestonedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type MilestonedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetMilestone()(MilestonedIssueEvent_milestoneable) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetMilestone(value MilestonedIssueEvent_milestoneable)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/milestoned_issue_event_milestone.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/milestoned_issue_event_milestone.go new file mode 100644 index 000000000..bfb57493e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/milestoned_issue_event_milestone.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MilestonedIssueEvent_milestone struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The title property + title *string +} +// NewMilestonedIssueEvent_milestone instantiates a new MilestonedIssueEvent_milestone and sets the default values. +func NewMilestonedIssueEvent_milestone()(*MilestonedIssueEvent_milestone) { + m := &MilestonedIssueEvent_milestone{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMilestonedIssueEvent_milestoneFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMilestonedIssueEvent_milestoneFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMilestonedIssueEvent_milestone(), 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 *MilestonedIssueEvent_milestone) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MilestonedIssueEvent_milestone) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *MilestonedIssueEvent_milestone) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *MilestonedIssueEvent_milestone) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *MilestonedIssueEvent_milestone) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTitle sets the title property value. The title property +func (m *MilestonedIssueEvent_milestone) SetTitle(value *string)() { + m.title = value +} +type MilestonedIssueEvent_milestoneable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTitle()(*string) + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/minimal_repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/minimal_repository.go new file mode 100644 index 000000000..39576166b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/minimal_repository.go @@ -0,0 +1,2582 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// MinimalRepository minimal Repository +type MinimalRepository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The allow_forking property + allow_forking *bool + // The archive_url property + archive_url *string + // The archived property + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // Code Of Conduct + code_of_conduct CodeOfConductable + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default_branch property + default_branch *string + // The delete_branch_on_merge property + delete_branch_on_merge *bool + // The deployments_url property + deployments_url *string + // The description property + description *string + // The disabled property + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // The has_discussions property + has_discussions *bool + // The has_downloads property + has_downloads *bool + // The has_issues property + has_issues *bool + // The has_pages property + has_pages *bool + // The has_projects property + has_projects *bool + // The has_wiki property + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int64 + // The is_template property + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // The license property + license MinimalRepository_licenseable + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name property + name *string + // The network_count property + network_count *int32 + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // A GitHub user. + owner SimpleUserable + // The permissions property + permissions MinimalRepository_permissionsable + // The private property + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The role_name property + role_name *string + // The security_and_analysis property + security_and_analysis SecurityAndAnalysisable + // The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + size *int32 + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The statuses_url property + statuses_url *string + // The subscribers_count property + subscribers_count *int32 + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The visibility property + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // The web_commit_signoff_required property + web_commit_signoff_required *bool +} +// NewMinimalRepository instantiates a new MinimalRepository and sets the default values. +func NewMinimalRepository()(*MinimalRepository) { + m := &MinimalRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMinimalRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMinimalRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMinimalRepository(), 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 *MinimalRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowForking gets the allow_forking property value. The allow_forking property +// returns a *bool when successful +func (m *MinimalRepository) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetArchived gets the archived property value. The archived property +// returns a *bool when successful +func (m *MinimalRepository) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *MinimalRepository) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *MinimalRepository) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *MinimalRepository) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *MinimalRepository) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *MinimalRepository) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCodeOfConduct gets the code_of_conduct property value. Code Of Conduct +// returns a CodeOfConductable when successful +func (m *MinimalRepository) GetCodeOfConduct()(CodeOfConductable) { + return m.code_of_conduct +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *MinimalRepository) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *MinimalRepository) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *MinimalRepository) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *MinimalRepository) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *MinimalRepository) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *MinimalRepository) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *MinimalRepository) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default_branch property +// returns a *string when successful +func (m *MinimalRepository) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. The delete_branch_on_merge property +// returns a *bool when successful +func (m *MinimalRepository) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *MinimalRepository) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *MinimalRepository) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. The disabled property +// returns a *bool when successful +func (m *MinimalRepository) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *MinimalRepository) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *MinimalRepository) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MinimalRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["code_of_conduct"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeOfConductFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCodeOfConduct(val.(CodeOfConductable)) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepository_licenseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(MinimalRepository_licenseable)) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["network_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNetworkCount(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepository_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(MinimalRepository_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["role_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRoleName(val) + } + return nil + } + res["security_and_analysis"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSecurityAndAnalysisFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAndAnalysis(val.(SecurityAndAnalysisable)) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersCount(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["topics"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *MinimalRepository) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *MinimalRepository) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *MinimalRepository) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *MinimalRepository) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *MinimalRepository) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *MinimalRepository) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *MinimalRepository) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *MinimalRepository) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *MinimalRepository) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDiscussions gets the has_discussions property value. The has_discussions property +// returns a *bool when successful +func (m *MinimalRepository) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. The has_downloads property +// returns a *bool when successful +func (m *MinimalRepository) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. The has_issues property +// returns a *bool when successful +func (m *MinimalRepository) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *MinimalRepository) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. The has_projects property +// returns a *bool when successful +func (m *MinimalRepository) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. The has_wiki property +// returns a *bool when successful +func (m *MinimalRepository) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *MinimalRepository) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *MinimalRepository) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *MinimalRepository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *MinimalRepository) GetId()(*int64) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *MinimalRepository) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *MinimalRepository) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *MinimalRepository) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. The is_template property +// returns a *bool when successful +func (m *MinimalRepository) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *MinimalRepository) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *MinimalRepository) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *MinimalRepository) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *MinimalRepository) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. The license property +// returns a MinimalRepository_licenseable when successful +func (m *MinimalRepository) GetLicense()(MinimalRepository_licenseable) { + return m.license +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *MinimalRepository) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *MinimalRepository) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *MinimalRepository) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *MinimalRepository) GetName()(*string) { + return m.name +} +// GetNetworkCount gets the network_count property value. The network_count property +// returns a *int32 when successful +func (m *MinimalRepository) GetNetworkCount()(*int32) { + return m.network_count +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *MinimalRepository) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *MinimalRepository) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *MinimalRepository) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *MinimalRepository) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *MinimalRepository) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a MinimalRepository_permissionsable when successful +func (m *MinimalRepository) GetPermissions()(MinimalRepository_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. The private property +// returns a *bool when successful +func (m *MinimalRepository) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *MinimalRepository) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *MinimalRepository) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *MinimalRepository) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetRoleName gets the role_name property value. The role_name property +// returns a *string when successful +func (m *MinimalRepository) GetRoleName()(*string) { + return m.role_name +} +// GetSecurityAndAnalysis gets the security_and_analysis property value. The security_and_analysis property +// returns a SecurityAndAnalysisable when successful +func (m *MinimalRepository) GetSecurityAndAnalysis()(SecurityAndAnalysisable) { + return m.security_and_analysis +} +// GetSize gets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +// returns a *int32 when successful +func (m *MinimalRepository) GetSize()(*int32) { + return m.size +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *MinimalRepository) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *MinimalRepository) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *MinimalRepository) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *MinimalRepository) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersCount gets the subscribers_count property value. The subscribers_count property +// returns a *int32 when successful +func (m *MinimalRepository) GetSubscribersCount()(*int32) { + return m.subscribers_count +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *MinimalRepository) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *MinimalRepository) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *MinimalRepository) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *MinimalRepository) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *MinimalRepository) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *MinimalRepository) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *MinimalRepository) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *MinimalRepository) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *MinimalRepository) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *MinimalRepository) GetUrl()(*string) { + return m.url +} +// GetVisibility gets the visibility property value. The visibility property +// returns a *string when successful +func (m *MinimalRepository) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *MinimalRepository) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *MinimalRepository) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. The web_commit_signoff_required property +// returns a *bool when successful +func (m *MinimalRepository) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *MinimalRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("code_of_conduct", m.GetCodeOfConduct()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("network_count", m.GetNetworkCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("role_name", m.GetRoleName()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("security_and_analysis", m.GetSecurityAndAnalysis()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("subscribers_count", m.GetSubscribersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *MinimalRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowForking sets the allow_forking property value. The allow_forking property +func (m *MinimalRepository) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetArchived sets the archived property value. The archived property +func (m *MinimalRepository) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *MinimalRepository) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *MinimalRepository) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *MinimalRepository) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *MinimalRepository) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *MinimalRepository) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCodeOfConduct sets the code_of_conduct property value. Code Of Conduct +func (m *MinimalRepository) SetCodeOfConduct(value CodeOfConductable)() { + m.code_of_conduct = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *MinimalRepository) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *MinimalRepository) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *MinimalRepository) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *MinimalRepository) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *MinimalRepository) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *MinimalRepository) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *MinimalRepository) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default_branch property +func (m *MinimalRepository) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. The delete_branch_on_merge property +func (m *MinimalRepository) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *MinimalRepository) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *MinimalRepository) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. The disabled property +func (m *MinimalRepository) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *MinimalRepository) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *MinimalRepository) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *MinimalRepository) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *MinimalRepository) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *MinimalRepository) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *MinimalRepository) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *MinimalRepository) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *MinimalRepository) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *MinimalRepository) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *MinimalRepository) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *MinimalRepository) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDiscussions sets the has_discussions property value. The has_discussions property +func (m *MinimalRepository) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. The has_downloads property +func (m *MinimalRepository) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. The has_issues property +func (m *MinimalRepository) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *MinimalRepository) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. The has_projects property +func (m *MinimalRepository) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. The has_wiki property +func (m *MinimalRepository) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *MinimalRepository) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *MinimalRepository) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *MinimalRepository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *MinimalRepository) SetId(value *int64)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *MinimalRepository) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *MinimalRepository) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *MinimalRepository) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. The is_template property +func (m *MinimalRepository) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *MinimalRepository) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *MinimalRepository) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *MinimalRepository) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *MinimalRepository) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. The license property +func (m *MinimalRepository) SetLicense(value MinimalRepository_licenseable)() { + m.license = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *MinimalRepository) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *MinimalRepository) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *MinimalRepository) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name property +func (m *MinimalRepository) SetName(value *string)() { + m.name = value +} +// SetNetworkCount sets the network_count property value. The network_count property +func (m *MinimalRepository) SetNetworkCount(value *int32)() { + m.network_count = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *MinimalRepository) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *MinimalRepository) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *MinimalRepository) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *MinimalRepository) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *MinimalRepository) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *MinimalRepository) SetPermissions(value MinimalRepository_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. The private property +func (m *MinimalRepository) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *MinimalRepository) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *MinimalRepository) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *MinimalRepository) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetRoleName sets the role_name property value. The role_name property +func (m *MinimalRepository) SetRoleName(value *string)() { + m.role_name = value +} +// SetSecurityAndAnalysis sets the security_and_analysis property value. The security_and_analysis property +func (m *MinimalRepository) SetSecurityAndAnalysis(value SecurityAndAnalysisable)() { + m.security_and_analysis = value +} +// SetSize sets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +func (m *MinimalRepository) SetSize(value *int32)() { + m.size = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *MinimalRepository) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *MinimalRepository) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *MinimalRepository) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *MinimalRepository) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersCount sets the subscribers_count property value. The subscribers_count property +func (m *MinimalRepository) SetSubscribersCount(value *int32)() { + m.subscribers_count = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *MinimalRepository) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *MinimalRepository) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *MinimalRepository) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *MinimalRepository) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *MinimalRepository) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *MinimalRepository) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTopics sets the topics property value. The topics property +func (m *MinimalRepository) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *MinimalRepository) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *MinimalRepository) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *MinimalRepository) SetUrl(value *string)() { + m.url = value +} +// SetVisibility sets the visibility property value. The visibility property +func (m *MinimalRepository) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *MinimalRepository) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *MinimalRepository) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. The web_commit_signoff_required property +func (m *MinimalRepository) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type MinimalRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowForking()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCodeOfConduct()(CodeOfConductable) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(MinimalRepository_licenseable) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNetworkCount()(*int32) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOwner()(SimpleUserable) + GetPermissions()(MinimalRepository_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetRoleName()(*string) + GetSecurityAndAnalysis()(SecurityAndAnalysisable) + GetSize()(*int32) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersCount()(*int32) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowForking(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCodeOfConduct(value CodeOfConductable)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value MinimalRepository_licenseable)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNetworkCount(value *int32)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOwner(value SimpleUserable)() + SetPermissions(value MinimalRepository_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetRoleName(value *string)() + SetSecurityAndAnalysis(value SecurityAndAnalysisable)() + SetSize(value *int32)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersCount(value *int32)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/minimal_repository_license.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/minimal_repository_license.go new file mode 100644 index 000000000..24e81d1ea --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/minimal_repository_license.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MinimalRepository_license struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The key property + key *string + // The name property + name *string + // The node_id property + node_id *string + // The spdx_id property + spdx_id *string + // The url property + url *string +} +// NewMinimalRepository_license instantiates a new MinimalRepository_license and sets the default values. +func NewMinimalRepository_license()(*MinimalRepository_license) { + m := &MinimalRepository_license{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMinimalRepository_licenseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMinimalRepository_licenseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMinimalRepository_license(), 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 *MinimalRepository_license) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MinimalRepository_license) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["spdx_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSpdxId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *MinimalRepository_license) GetKey()(*string) { + return m.key +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *MinimalRepository_license) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *MinimalRepository_license) GetNodeId()(*string) { + return m.node_id +} +// GetSpdxId gets the spdx_id property value. The spdx_id property +// returns a *string when successful +func (m *MinimalRepository_license) GetSpdxId()(*string) { + return m.spdx_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *MinimalRepository_license) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *MinimalRepository_license) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("spdx_id", m.GetSpdxId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *MinimalRepository_license) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The key property +func (m *MinimalRepository_license) SetKey(value *string)() { + m.key = value +} +// SetName sets the name property value. The name property +func (m *MinimalRepository_license) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *MinimalRepository_license) SetNodeId(value *string)() { + m.node_id = value +} +// SetSpdxId sets the spdx_id property value. The spdx_id property +func (m *MinimalRepository_license) SetSpdxId(value *string)() { + m.spdx_id = value +} +// SetUrl sets the url property value. The url property +func (m *MinimalRepository_license) SetUrl(value *string)() { + m.url = value +} +type MinimalRepository_licenseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetName()(*string) + GetNodeId()(*string) + GetSpdxId()(*string) + GetUrl()(*string) + SetKey(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetSpdxId(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/minimal_repository_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/minimal_repository_permissions.go new file mode 100644 index 000000000..b52bacc08 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/minimal_repository_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MinimalRepository_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewMinimalRepository_permissions instantiates a new MinimalRepository_permissions and sets the default values. +func NewMinimalRepository_permissions()(*MinimalRepository_permissions) { + m := &MinimalRepository_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMinimalRepository_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMinimalRepository_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMinimalRepository_permissions(), 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 *MinimalRepository_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *MinimalRepository_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MinimalRepository_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *MinimalRepository_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *MinimalRepository_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *MinimalRepository_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *MinimalRepository_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *MinimalRepository_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *MinimalRepository_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *MinimalRepository_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *MinimalRepository_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *MinimalRepository_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *MinimalRepository_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *MinimalRepository_permissions) SetTriage(value *bool)() { + m.triage = value +} +type MinimalRepository_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/moved_column_in_project_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/moved_column_in_project_issue_event.go new file mode 100644 index 000000000..bc0607094 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/moved_column_in_project_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// MovedColumnInProjectIssueEvent moved Column in Project Issue Event +type MovedColumnInProjectIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The project_card property + project_card MovedColumnInProjectIssueEvent_project_cardable + // The url property + url *string +} +// NewMovedColumnInProjectIssueEvent instantiates a new MovedColumnInProjectIssueEvent and sets the default values. +func NewMovedColumnInProjectIssueEvent()(*MovedColumnInProjectIssueEvent) { + m := &MovedColumnInProjectIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMovedColumnInProjectIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMovedColumnInProjectIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMovedColumnInProjectIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *MovedColumnInProjectIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *MovedColumnInProjectIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MovedColumnInProjectIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["project_card"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMovedColumnInProjectIssueEvent_project_cardFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProjectCard(val.(MovedColumnInProjectIssueEvent_project_cardable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *MovedColumnInProjectIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *MovedColumnInProjectIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetProjectCard gets the project_card property value. The project_card property +// returns a MovedColumnInProjectIssueEvent_project_cardable when successful +func (m *MovedColumnInProjectIssueEvent) GetProjectCard()(MovedColumnInProjectIssueEvent_project_cardable) { + return m.project_card +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *MovedColumnInProjectIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("project_card", m.GetProjectCard()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *MovedColumnInProjectIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *MovedColumnInProjectIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *MovedColumnInProjectIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *MovedColumnInProjectIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *MovedColumnInProjectIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *MovedColumnInProjectIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *MovedColumnInProjectIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *MovedColumnInProjectIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *MovedColumnInProjectIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetProjectCard sets the project_card property value. The project_card property +func (m *MovedColumnInProjectIssueEvent) SetProjectCard(value MovedColumnInProjectIssueEvent_project_cardable)() { + m.project_card = value +} +// SetUrl sets the url property value. The url property +func (m *MovedColumnInProjectIssueEvent) SetUrl(value *string)() { + m.url = value +} +type MovedColumnInProjectIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetProjectCard()(MovedColumnInProjectIssueEvent_project_cardable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetProjectCard(value MovedColumnInProjectIssueEvent_project_cardable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/moved_column_in_project_issue_event_project_card.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/moved_column_in_project_issue_event_project_card.go new file mode 100644 index 000000000..b0542ecac --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/moved_column_in_project_issue_event_project_card.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MovedColumnInProjectIssueEvent_project_card struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The column_name property + column_name *string + // The id property + id *int32 + // The previous_column_name property + previous_column_name *string + // The project_id property + project_id *int32 + // The project_url property + project_url *string + // The url property + url *string +} +// NewMovedColumnInProjectIssueEvent_project_card instantiates a new MovedColumnInProjectIssueEvent_project_card and sets the default values. +func NewMovedColumnInProjectIssueEvent_project_card()(*MovedColumnInProjectIssueEvent_project_card) { + m := &MovedColumnInProjectIssueEvent_project_card{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMovedColumnInProjectIssueEvent_project_cardFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMovedColumnInProjectIssueEvent_project_cardFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMovedColumnInProjectIssueEvent_project_card(), 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 *MovedColumnInProjectIssueEvent_project_card) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColumnName gets the column_name property value. The column_name property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent_project_card) GetColumnName()(*string) { + return m.column_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MovedColumnInProjectIssueEvent_project_card) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnName(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["previous_column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviousColumnName(val) + } + return nil + } + res["project_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetProjectId(val) + } + return nil + } + res["project_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProjectUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *MovedColumnInProjectIssueEvent_project_card) GetId()(*int32) { + return m.id +} +// GetPreviousColumnName gets the previous_column_name property value. The previous_column_name property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent_project_card) GetPreviousColumnName()(*string) { + return m.previous_column_name +} +// GetProjectId gets the project_id property value. The project_id property +// returns a *int32 when successful +func (m *MovedColumnInProjectIssueEvent_project_card) GetProjectId()(*int32) { + return m.project_id +} +// GetProjectUrl gets the project_url property value. The project_url property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent_project_card) GetProjectUrl()(*string) { + return m.project_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent_project_card) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *MovedColumnInProjectIssueEvent_project_card) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("column_name", m.GetColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("previous_column_name", m.GetPreviousColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("project_id", m.GetProjectId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("project_url", m.GetProjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *MovedColumnInProjectIssueEvent_project_card) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColumnName sets the column_name property value. The column_name property +func (m *MovedColumnInProjectIssueEvent_project_card) SetColumnName(value *string)() { + m.column_name = value +} +// SetId sets the id property value. The id property +func (m *MovedColumnInProjectIssueEvent_project_card) SetId(value *int32)() { + m.id = value +} +// SetPreviousColumnName sets the previous_column_name property value. The previous_column_name property +func (m *MovedColumnInProjectIssueEvent_project_card) SetPreviousColumnName(value *string)() { + m.previous_column_name = value +} +// SetProjectId sets the project_id property value. The project_id property +func (m *MovedColumnInProjectIssueEvent_project_card) SetProjectId(value *int32)() { + m.project_id = value +} +// SetProjectUrl sets the project_url property value. The project_url property +func (m *MovedColumnInProjectIssueEvent_project_card) SetProjectUrl(value *string)() { + m.project_url = value +} +// SetUrl sets the url property value. The url property +func (m *MovedColumnInProjectIssueEvent_project_card) SetUrl(value *string)() { + m.url = value +} +type MovedColumnInProjectIssueEvent_project_cardable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColumnName()(*string) + GetId()(*int32) + GetPreviousColumnName()(*string) + GetProjectId()(*int32) + GetProjectUrl()(*string) + GetUrl()(*string) + SetColumnName(value *string)() + SetId(value *int32)() + SetPreviousColumnName(value *string)() + SetProjectId(value *int32)() + SetProjectUrl(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_code_of_conduct_simple.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_code_of_conduct_simple.go new file mode 100644 index 000000000..5c00acde7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_code_of_conduct_simple.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableCodeOfConductSimple code of Conduct Simple +type NullableCodeOfConductSimple struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html_url property + html_url *string + // The key property + key *string + // The name property + name *string + // The url property + url *string +} +// NewNullableCodeOfConductSimple instantiates a new NullableCodeOfConductSimple and sets the default values. +func NewNullableCodeOfConductSimple()(*NullableCodeOfConductSimple) { + m := &NullableCodeOfConductSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableCodeOfConductSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableCodeOfConductSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableCodeOfConductSimple(), 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 *NullableCodeOfConductSimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableCodeOfConductSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableCodeOfConductSimple) GetHtmlUrl()(*string) { + return m.html_url +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *NullableCodeOfConductSimple) GetKey()(*string) { + return m.key +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *NullableCodeOfConductSimple) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableCodeOfConductSimple) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *NullableCodeOfConductSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *NullableCodeOfConductSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableCodeOfConductSimple) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetKey sets the key property value. The key property +func (m *NullableCodeOfConductSimple) SetKey(value *string)() { + m.key = value +} +// SetName sets the name property value. The name property +func (m *NullableCodeOfConductSimple) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url property +func (m *NullableCodeOfConductSimple) SetUrl(value *string)() { + m.url = value +} +type NullableCodeOfConductSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetKey()(*string) + GetName()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetKey(value *string)() + SetName(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_codespace_machine.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_codespace_machine.go new file mode 100644 index 000000000..e56481667 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_codespace_machine.go @@ -0,0 +1,256 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableCodespaceMachine a description of the machine powering a codespace. +type NullableCodespaceMachine struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How many cores are available to the codespace. + cpus *int32 + // The display name of the machine includes cores, memory, and storage. + display_name *string + // How much memory is available to the codespace. + memory_in_bytes *int32 + // The name of the machine. + name *string + // The operating system of the machine. + operating_system *string + // Whether a prebuild is currently available when creating a codespace for this machine and repository. If a branch was not specified as a ref, the default branch will be assumed. Value will be "null" if prebuilds are not supported or prebuild availability could not be determined. Value will be "none" if no prebuild is available. Latest values "ready" and "in_progress" indicate the prebuild availability status. + prebuild_availability *NullableCodespaceMachine_prebuild_availability + // How much storage is available to the codespace. + storage_in_bytes *int32 +} +// NewNullableCodespaceMachine instantiates a new NullableCodespaceMachine and sets the default values. +func NewNullableCodespaceMachine()(*NullableCodespaceMachine) { + m := &NullableCodespaceMachine{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableCodespaceMachineFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableCodespaceMachineFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableCodespaceMachine(), 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 *NullableCodespaceMachine) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCpus gets the cpus property value. How many cores are available to the codespace. +// returns a *int32 when successful +func (m *NullableCodespaceMachine) GetCpus()(*int32) { + return m.cpus +} +// GetDisplayName gets the display_name property value. The display name of the machine includes cores, memory, and storage. +// returns a *string when successful +func (m *NullableCodespaceMachine) GetDisplayName()(*string) { + return m.display_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableCodespaceMachine) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cpus"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCpus(val) + } + return nil + } + res["display_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["memory_in_bytes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMemoryInBytes(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["operating_system"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOperatingSystem(val) + } + return nil + } + res["prebuild_availability"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableCodespaceMachine_prebuild_availability) + if err != nil { + return err + } + if val != nil { + m.SetPrebuildAvailability(val.(*NullableCodespaceMachine_prebuild_availability)) + } + return nil + } + res["storage_in_bytes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStorageInBytes(val) + } + return nil + } + return res +} +// GetMemoryInBytes gets the memory_in_bytes property value. How much memory is available to the codespace. +// returns a *int32 when successful +func (m *NullableCodespaceMachine) GetMemoryInBytes()(*int32) { + return m.memory_in_bytes +} +// GetName gets the name property value. The name of the machine. +// returns a *string when successful +func (m *NullableCodespaceMachine) GetName()(*string) { + return m.name +} +// GetOperatingSystem gets the operating_system property value. The operating system of the machine. +// returns a *string when successful +func (m *NullableCodespaceMachine) GetOperatingSystem()(*string) { + return m.operating_system +} +// GetPrebuildAvailability gets the prebuild_availability property value. Whether a prebuild is currently available when creating a codespace for this machine and repository. If a branch was not specified as a ref, the default branch will be assumed. Value will be "null" if prebuilds are not supported or prebuild availability could not be determined. Value will be "none" if no prebuild is available. Latest values "ready" and "in_progress" indicate the prebuild availability status. +// returns a *NullableCodespaceMachine_prebuild_availability when successful +func (m *NullableCodespaceMachine) GetPrebuildAvailability()(*NullableCodespaceMachine_prebuild_availability) { + return m.prebuild_availability +} +// GetStorageInBytes gets the storage_in_bytes property value. How much storage is available to the codespace. +// returns a *int32 when successful +func (m *NullableCodespaceMachine) GetStorageInBytes()(*int32) { + return m.storage_in_bytes +} +// Serialize serializes information the current object +func (m *NullableCodespaceMachine) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("cpus", m.GetCpus()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("display_name", m.GetDisplayName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("memory_in_bytes", m.GetMemoryInBytes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("operating_system", m.GetOperatingSystem()) + if err != nil { + return err + } + } + if m.GetPrebuildAvailability() != nil { + cast := (*m.GetPrebuildAvailability()).String() + err := writer.WriteStringValue("prebuild_availability", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("storage_in_bytes", m.GetStorageInBytes()) + 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 *NullableCodespaceMachine) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCpus sets the cpus property value. How many cores are available to the codespace. +func (m *NullableCodespaceMachine) SetCpus(value *int32)() { + m.cpus = value +} +// SetDisplayName sets the display_name property value. The display name of the machine includes cores, memory, and storage. +func (m *NullableCodespaceMachine) SetDisplayName(value *string)() { + m.display_name = value +} +// SetMemoryInBytes sets the memory_in_bytes property value. How much memory is available to the codespace. +func (m *NullableCodespaceMachine) SetMemoryInBytes(value *int32)() { + m.memory_in_bytes = value +} +// SetName sets the name property value. The name of the machine. +func (m *NullableCodespaceMachine) SetName(value *string)() { + m.name = value +} +// SetOperatingSystem sets the operating_system property value. The operating system of the machine. +func (m *NullableCodespaceMachine) SetOperatingSystem(value *string)() { + m.operating_system = value +} +// SetPrebuildAvailability sets the prebuild_availability property value. Whether a prebuild is currently available when creating a codespace for this machine and repository. If a branch was not specified as a ref, the default branch will be assumed. Value will be "null" if prebuilds are not supported or prebuild availability could not be determined. Value will be "none" if no prebuild is available. Latest values "ready" and "in_progress" indicate the prebuild availability status. +func (m *NullableCodespaceMachine) SetPrebuildAvailability(value *NullableCodespaceMachine_prebuild_availability)() { + m.prebuild_availability = value +} +// SetStorageInBytes sets the storage_in_bytes property value. How much storage is available to the codespace. +func (m *NullableCodespaceMachine) SetStorageInBytes(value *int32)() { + m.storage_in_bytes = value +} +type NullableCodespaceMachineable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCpus()(*int32) + GetDisplayName()(*string) + GetMemoryInBytes()(*int32) + GetName()(*string) + GetOperatingSystem()(*string) + GetPrebuildAvailability()(*NullableCodespaceMachine_prebuild_availability) + GetStorageInBytes()(*int32) + SetCpus(value *int32)() + SetDisplayName(value *string)() + SetMemoryInBytes(value *int32)() + SetName(value *string)() + SetOperatingSystem(value *string)() + SetPrebuildAvailability(value *NullableCodespaceMachine_prebuild_availability)() + SetStorageInBytes(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_codespace_machine_prebuild_availability.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_codespace_machine_prebuild_availability.go new file mode 100644 index 000000000..c690735ec --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_codespace_machine_prebuild_availability.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// Whether a prebuild is currently available when creating a codespace for this machine and repository. If a branch was not specified as a ref, the default branch will be assumed. Value will be "null" if prebuilds are not supported or prebuild availability could not be determined. Value will be "none" if no prebuild is available. Latest values "ready" and "in_progress" indicate the prebuild availability status. +type NullableCodespaceMachine_prebuild_availability int + +const ( + NONE_NULLABLECODESPACEMACHINE_PREBUILD_AVAILABILITY NullableCodespaceMachine_prebuild_availability = iota + READY_NULLABLECODESPACEMACHINE_PREBUILD_AVAILABILITY + IN_PROGRESS_NULLABLECODESPACEMACHINE_PREBUILD_AVAILABILITY +) + +func (i NullableCodespaceMachine_prebuild_availability) String() string { + return []string{"none", "ready", "in_progress"}[i] +} +func ParseNullableCodespaceMachine_prebuild_availability(v string) (any, error) { + result := NONE_NULLABLECODESPACEMACHINE_PREBUILD_AVAILABILITY + switch v { + case "none": + result = NONE_NULLABLECODESPACEMACHINE_PREBUILD_AVAILABILITY + case "ready": + result = READY_NULLABLECODESPACEMACHINE_PREBUILD_AVAILABILITY + case "in_progress": + result = IN_PROGRESS_NULLABLECODESPACEMACHINE_PREBUILD_AVAILABILITY + default: + return 0, errors.New("Unknown NullableCodespaceMachine_prebuild_availability value: " + v) + } + return &result, nil +} +func SerializeNullableCodespaceMachine_prebuild_availability(values []NullableCodespaceMachine_prebuild_availability) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableCodespaceMachine_prebuild_availability) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_collaborator.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_collaborator.go new file mode 100644 index 000000000..3eab0a57b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_collaborator.go @@ -0,0 +1,690 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableCollaborator collaborator +type NullableCollaborator struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The email property + email *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int64 + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The permissions property + permissions NullableCollaborator_permissionsable + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The role_name property + role_name *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewNullableCollaborator instantiates a new NullableCollaborator and sets the default values. +func NewNullableCollaborator()(*NullableCollaborator) { + m := &NullableCollaborator{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableCollaboratorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableCollaboratorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableCollaborator(), 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 *NullableCollaborator) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *NullableCollaborator) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *NullableCollaborator) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *NullableCollaborator) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableCollaborator) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableCollaborator_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(NullableCollaborator_permissionsable)) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["role_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRoleName(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *NullableCollaborator) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *NullableCollaborator) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *NullableCollaborator) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *NullableCollaborator) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableCollaborator) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *NullableCollaborator) GetId()(*int64) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *NullableCollaborator) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *NullableCollaborator) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableCollaborator) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *NullableCollaborator) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetPermissions gets the permissions property value. The permissions property +// returns a NullableCollaborator_permissionsable when successful +func (m *NullableCollaborator) GetPermissions()(NullableCollaborator_permissionsable) { + return m.permissions +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *NullableCollaborator) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *NullableCollaborator) GetReposUrl()(*string) { + return m.repos_url +} +// GetRoleName gets the role_name property value. The role_name property +// returns a *string when successful +func (m *NullableCollaborator) GetRoleName()(*string) { + return m.role_name +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *NullableCollaborator) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *NullableCollaborator) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *NullableCollaborator) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *NullableCollaborator) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableCollaborator) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *NullableCollaborator) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("role_name", m.GetRoleName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *NullableCollaborator) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *NullableCollaborator) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEmail sets the email property value. The email property +func (m *NullableCollaborator) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *NullableCollaborator) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *NullableCollaborator) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *NullableCollaborator) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *NullableCollaborator) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *NullableCollaborator) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableCollaborator) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *NullableCollaborator) SetId(value *int64)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *NullableCollaborator) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *NullableCollaborator) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableCollaborator) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *NullableCollaborator) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *NullableCollaborator) SetPermissions(value NullableCollaborator_permissionsable)() { + m.permissions = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *NullableCollaborator) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *NullableCollaborator) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetRoleName sets the role_name property value. The role_name property +func (m *NullableCollaborator) SetRoleName(value *string)() { + m.role_name = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *NullableCollaborator) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *NullableCollaborator) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *NullableCollaborator) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *NullableCollaborator) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *NullableCollaborator) SetUrl(value *string)() { + m.url = value +} +type NullableCollaboratorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetPermissions()(NullableCollaborator_permissionsable) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetRoleName()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetPermissions(value NullableCollaborator_permissionsable)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetRoleName(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_collaborator_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_collaborator_permissions.go new file mode 100644 index 000000000..fb3065f0e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_collaborator_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type NullableCollaborator_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewNullableCollaborator_permissions instantiates a new NullableCollaborator_permissions and sets the default values. +func NewNullableCollaborator_permissions()(*NullableCollaborator_permissions) { + m := &NullableCollaborator_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableCollaborator_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableCollaborator_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableCollaborator_permissions(), 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 *NullableCollaborator_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *NullableCollaborator_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableCollaborator_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *NullableCollaborator_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *NullableCollaborator_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *NullableCollaborator_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *NullableCollaborator_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *NullableCollaborator_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *NullableCollaborator_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *NullableCollaborator_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *NullableCollaborator_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *NullableCollaborator_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *NullableCollaborator_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *NullableCollaborator_permissions) SetTriage(value *bool)() { + m.triage = value +} +type NullableCollaborator_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_community_health_file.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_community_health_file.go new file mode 100644 index 000000000..a221c4373 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_community_health_file.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type NullableCommunityHealthFile struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html_url property + html_url *string + // The url property + url *string +} +// NewNullableCommunityHealthFile instantiates a new NullableCommunityHealthFile and sets the default values. +func NewNullableCommunityHealthFile()(*NullableCommunityHealthFile) { + m := &NullableCommunityHealthFile{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableCommunityHealthFileFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableCommunityHealthFileFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableCommunityHealthFile(), 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 *NullableCommunityHealthFile) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableCommunityHealthFile) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableCommunityHealthFile) GetHtmlUrl()(*string) { + return m.html_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableCommunityHealthFile) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *NullableCommunityHealthFile) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *NullableCommunityHealthFile) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableCommunityHealthFile) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetUrl sets the url property value. The url property +func (m *NullableCommunityHealthFile) SetUrl(value *string)() { + m.url = value +} +type NullableCommunityHealthFileable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_git_user.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_git_user.go new file mode 100644 index 000000000..ab70ce38d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_git_user.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableGitUser metaproperties for Git author/committer information. +type NullableGitUser struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The date property + date *string + // The email property + email *string + // The name property + name *string +} +// NewNullableGitUser instantiates a new NullableGitUser and sets the default values. +func NewNullableGitUser()(*NullableGitUser) { + m := &NullableGitUser{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableGitUserFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableGitUserFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableGitUser(), 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 *NullableGitUser) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. The date property +// returns a *string when successful +func (m *NullableGitUser) GetDate()(*string) { + return m.date +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *NullableGitUser) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableGitUser) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *NullableGitUser) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *NullableGitUser) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *NullableGitUser) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. The date property +func (m *NullableGitUser) SetDate(value *string)() { + m.date = value +} +// SetEmail sets the email property value. The email property +func (m *NullableGitUser) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name property +func (m *NullableGitUser) SetName(value *string)() { + m.name = value +} +type NullableGitUserable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*string) + GetEmail()(*string) + GetName()(*string) + SetDate(value *string)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_integration.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_integration.go new file mode 100644 index 000000000..8cc0ccf54 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_integration.go @@ -0,0 +1,552 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableIntegration gitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +type NullableIntegration struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The client_id property + client_id *string + // The client_secret property + client_secret *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The description property + description *string + // The list of events for the GitHub app + events []string + // The external_url property + external_url *string + // The html_url property + html_url *string + // Unique identifier of the GitHub app + id *int32 + // The number of installations associated with the GitHub app + installations_count *int32 + // The name of the GitHub app + name *string + // The node_id property + node_id *string + // A GitHub user. + owner NullableSimpleUserable + // The pem property + pem *string + // The set of permissions for the GitHub app + permissions NullableIntegration_permissionsable + // The slug name of the GitHub app + slug *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The webhook_secret property + webhook_secret *string +} +// NewNullableIntegration instantiates a new NullableIntegration and sets the default values. +func NewNullableIntegration()(*NullableIntegration) { + m := &NullableIntegration{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableIntegrationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableIntegrationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableIntegration(), 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 *NullableIntegration) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientId gets the client_id property value. The client_id property +// returns a *string when successful +func (m *NullableIntegration) GetClientId()(*string) { + return m.client_id +} +// GetClientSecret gets the client_secret property value. The client_secret property +// returns a *string when successful +func (m *NullableIntegration) GetClientSecret()(*string) { + return m.client_secret +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *NullableIntegration) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *NullableIntegration) GetDescription()(*string) { + return m.description +} +// GetEvents gets the events property value. The list of events for the GitHub app +// returns a []string when successful +func (m *NullableIntegration) GetEvents()([]string) { + return m.events +} +// GetExternalUrl gets the external_url property value. The external_url property +// returns a *string when successful +func (m *NullableIntegration) GetExternalUrl()(*string) { + return m.external_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableIntegration) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientId(val) + } + return nil + } + res["client_secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientSecret(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetEvents(res) + } + return nil + } + res["external_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExternalUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["installations_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetInstallationsCount(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(NullableSimpleUserable)) + } + return nil + } + res["pem"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPem(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegration_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(NullableIntegration_permissionsable)) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["webhook_secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWebhookSecret(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableIntegration) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the GitHub app +// returns a *int32 when successful +func (m *NullableIntegration) GetId()(*int32) { + return m.id +} +// GetInstallationsCount gets the installations_count property value. The number of installations associated with the GitHub app +// returns a *int32 when successful +func (m *NullableIntegration) GetInstallationsCount()(*int32) { + return m.installations_count +} +// GetName gets the name property value. The name of the GitHub app +// returns a *string when successful +func (m *NullableIntegration) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableIntegration) GetNodeId()(*string) { + return m.node_id +} +// GetOwner gets the owner property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *NullableIntegration) GetOwner()(NullableSimpleUserable) { + return m.owner +} +// GetPem gets the pem property value. The pem property +// returns a *string when successful +func (m *NullableIntegration) GetPem()(*string) { + return m.pem +} +// GetPermissions gets the permissions property value. The set of permissions for the GitHub app +// returns a NullableIntegration_permissionsable when successful +func (m *NullableIntegration) GetPermissions()(NullableIntegration_permissionsable) { + return m.permissions +} +// GetSlug gets the slug property value. The slug name of the GitHub app +// returns a *string when successful +func (m *NullableIntegration) GetSlug()(*string) { + return m.slug +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *NullableIntegration) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetWebhookSecret gets the webhook_secret property value. The webhook_secret property +// returns a *string when successful +func (m *NullableIntegration) GetWebhookSecret()(*string) { + return m.webhook_secret +} +// Serialize serializes information the current object +func (m *NullableIntegration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("client_id", m.GetClientId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("client_secret", m.GetClientSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("external_url", m.GetExternalUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("installations_count", m.GetInstallationsCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pem", m.GetPem()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("webhook_secret", m.GetWebhookSecret()) + 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 *NullableIntegration) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientId sets the client_id property value. The client_id property +func (m *NullableIntegration) SetClientId(value *string)() { + m.client_id = value +} +// SetClientSecret sets the client_secret property value. The client_secret property +func (m *NullableIntegration) SetClientSecret(value *string)() { + m.client_secret = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *NullableIntegration) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *NullableIntegration) SetDescription(value *string)() { + m.description = value +} +// SetEvents sets the events property value. The list of events for the GitHub app +func (m *NullableIntegration) SetEvents(value []string)() { + m.events = value +} +// SetExternalUrl sets the external_url property value. The external_url property +func (m *NullableIntegration) SetExternalUrl(value *string)() { + m.external_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableIntegration) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the GitHub app +func (m *NullableIntegration) SetId(value *int32)() { + m.id = value +} +// SetInstallationsCount sets the installations_count property value. The number of installations associated with the GitHub app +func (m *NullableIntegration) SetInstallationsCount(value *int32)() { + m.installations_count = value +} +// SetName sets the name property value. The name of the GitHub app +func (m *NullableIntegration) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableIntegration) SetNodeId(value *string)() { + m.node_id = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *NullableIntegration) SetOwner(value NullableSimpleUserable)() { + m.owner = value +} +// SetPem sets the pem property value. The pem property +func (m *NullableIntegration) SetPem(value *string)() { + m.pem = value +} +// SetPermissions sets the permissions property value. The set of permissions for the GitHub app +func (m *NullableIntegration) SetPermissions(value NullableIntegration_permissionsable)() { + m.permissions = value +} +// SetSlug sets the slug property value. The slug name of the GitHub app +func (m *NullableIntegration) SetSlug(value *string)() { + m.slug = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *NullableIntegration) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetWebhookSecret sets the webhook_secret property value. The webhook_secret property +func (m *NullableIntegration) SetWebhookSecret(value *string)() { + m.webhook_secret = value +} +type NullableIntegrationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientId()(*string) + GetClientSecret()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetEvents()([]string) + GetExternalUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetInstallationsCount()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetOwner()(NullableSimpleUserable) + GetPem()(*string) + GetPermissions()(NullableIntegration_permissionsable) + GetSlug()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetWebhookSecret()(*string) + SetClientId(value *string)() + SetClientSecret(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetEvents(value []string)() + SetExternalUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetInstallationsCount(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetOwner(value NullableSimpleUserable)() + SetPem(value *string)() + SetPermissions(value NullableIntegration_permissionsable)() + SetSlug(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetWebhookSecret(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_integration_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_integration_permissions.go new file mode 100644 index 000000000..d7f5b02d1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_integration_permissions.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableIntegration_permissions the set of permissions for the GitHub app +type NullableIntegration_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The checks property + checks *string + // The contents property + contents *string + // The deployments property + deployments *string + // The issues property + issues *string + // The metadata property + metadata *string +} +// NewNullableIntegration_permissions instantiates a new NullableIntegration_permissions and sets the default values. +func NewNullableIntegration_permissions()(*NullableIntegration_permissions) { + m := &NullableIntegration_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableIntegration_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableIntegration_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableIntegration_permissions(), 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 *NullableIntegration_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChecks gets the checks property value. The checks property +// returns a *string when successful +func (m *NullableIntegration_permissions) GetChecks()(*string) { + return m.checks +} +// GetContents gets the contents property value. The contents property +// returns a *string when successful +func (m *NullableIntegration_permissions) GetContents()(*string) { + return m.contents +} +// GetDeployments gets the deployments property value. The deployments property +// returns a *string when successful +func (m *NullableIntegration_permissions) GetDeployments()(*string) { + return m.deployments +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableIntegration_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetChecks(val) + } + return nil + } + res["contents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContents(val) + } + return nil + } + res["deployments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeployments(val) + } + return nil + } + res["issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssues(val) + } + return nil + } + res["metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMetadata(val) + } + return nil + } + return res +} +// GetIssues gets the issues property value. The issues property +// returns a *string when successful +func (m *NullableIntegration_permissions) GetIssues()(*string) { + return m.issues +} +// GetMetadata gets the metadata property value. The metadata property +// returns a *string when successful +func (m *NullableIntegration_permissions) GetMetadata()(*string) { + return m.metadata +} +// Serialize serializes information the current object +func (m *NullableIntegration_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("checks", m.GetChecks()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents", m.GetContents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments", m.GetDeployments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues", m.GetIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("metadata", m.GetMetadata()) + 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 *NullableIntegration_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChecks sets the checks property value. The checks property +func (m *NullableIntegration_permissions) SetChecks(value *string)() { + m.checks = value +} +// SetContents sets the contents property value. The contents property +func (m *NullableIntegration_permissions) SetContents(value *string)() { + m.contents = value +} +// SetDeployments sets the deployments property value. The deployments property +func (m *NullableIntegration_permissions) SetDeployments(value *string)() { + m.deployments = value +} +// SetIssues sets the issues property value. The issues property +func (m *NullableIntegration_permissions) SetIssues(value *string)() { + m.issues = value +} +// SetMetadata sets the metadata property value. The metadata property +func (m *NullableIntegration_permissions) SetMetadata(value *string)() { + m.metadata = value +} +type NullableIntegration_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChecks()(*string) + GetContents()(*string) + GetDeployments()(*string) + GetIssues()(*string) + GetMetadata()(*string) + SetChecks(value *string)() + SetContents(value *string)() + SetDeployments(value *string)() + SetIssues(value *string)() + SetMetadata(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_issue.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_issue.go new file mode 100644 index 000000000..8eb356a5d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_issue.go @@ -0,0 +1,1059 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableIssue issues are a great way to keep track of tasks, enhancements, and bugs for your projects. +type NullableIssue struct { + // The active_lock_reason property + active_lock_reason *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee NullableSimpleUserable + // The assignees property + assignees []SimpleUserable + // How the author is associated with the repository. + author_association *AuthorAssociation + // Contents of the issue + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // The closed_at property + closed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + closed_by NullableSimpleUserable + // The comments property + comments *int32 + // The comments_url property + comments_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The draft property + draft *bool + // The events_url property + events_url *string + // The html_url property + html_url *string + // The id property + id *int64 + // Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository + labels []string + // The labels_url property + labels_url *string + // The locked property + locked *bool + // A collection of related issues and pull requests. + milestone NullableMilestoneable + // The node_id property + node_id *string + // Number uniquely identifying the issue within its repository + number *int32 + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The pull_request property + pull_request NullableIssue_pull_requestable + // The reactions property + reactions ReactionRollupable + // A repository on GitHub. + repository Repositoryable + // The repository_url property + repository_url *string + // State of the issue; either 'open' or 'closed' + state *string + // The reason for the current state + state_reason *NullableIssue_state_reason + // The timeline_url property + timeline_url *string + // Title of the issue + title *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // URL for the issue + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewNullableIssue instantiates a new NullableIssue and sets the default values. +func NewNullableIssue()(*NullableIssue) { + m := &NullableIssue{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableIssueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableIssueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableIssue(), nil +} +// GetActiveLockReason gets the active_lock_reason property value. The active_lock_reason property +// returns a *string when successful +func (m *NullableIssue) GetActiveLockReason()(*string) { + return m.active_lock_reason +} +// 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 *NullableIssue) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *NullableIssue) GetAssignee()(NullableSimpleUserable) { + return m.assignee +} +// GetAssignees gets the assignees property value. The assignees property +// returns a []SimpleUserable when successful +func (m *NullableIssue) GetAssignees()([]SimpleUserable) { + return m.assignees +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *NullableIssue) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. Contents of the issue +// returns a *string when successful +func (m *NullableIssue) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *NullableIssue) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *NullableIssue) GetBodyText()(*string) { + return m.body_text +} +// GetClosedAt gets the closed_at property value. The closed_at property +// returns a *Time when successful +func (m *NullableIssue) GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.closed_at +} +// GetClosedBy gets the closed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *NullableIssue) GetClosedBy()(NullableSimpleUserable) { + return m.closed_by +} +// GetComments gets the comments property value. The comments property +// returns a *int32 when successful +func (m *NullableIssue) GetComments()(*int32) { + return m.comments +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *NullableIssue) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *NullableIssue) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDraft gets the draft property value. The draft property +// returns a *bool when successful +func (m *NullableIssue) GetDraft()(*bool) { + return m.draft +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *NullableIssue) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableIssue) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active_lock_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetActiveLockReason(val) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(NullableSimpleUserable)) + } + return nil + } + res["assignees"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetAssignees(res) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + res["closed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetClosedAt(val) + } + return nil + } + res["closed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetClosedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetComments(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetLabels(res) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["locked"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLocked(val) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableMilestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(NullableMilestoneable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["pull_request"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIssue_pull_requestFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPullRequest(val.(NullableIssue_pull_requestable)) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(Repositoryable)) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["state_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableIssue_state_reason) + if err != nil { + return err + } + if val != nil { + m.SetStateReason(val.(*NullableIssue_state_reason)) + } + return nil + } + res["timeline_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTimelineUrl(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableIssue) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *NullableIssue) GetId()(*int64) { + return m.id +} +// GetLabels gets the labels property value. Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository +// returns a []string when successful +func (m *NullableIssue) GetLabels()([]string) { + return m.labels +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *NullableIssue) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLocked gets the locked property value. The locked property +// returns a *bool when successful +func (m *NullableIssue) GetLocked()(*bool) { + return m.locked +} +// GetMilestone gets the milestone property value. A collection of related issues and pull requests. +// returns a NullableMilestoneable when successful +func (m *NullableIssue) GetMilestone()(NullableMilestoneable) { + return m.milestone +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableIssue) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. Number uniquely identifying the issue within its repository +// returns a *int32 when successful +func (m *NullableIssue) GetNumber()(*int32) { + return m.number +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *NullableIssue) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetPullRequest gets the pull_request property value. The pull_request property +// returns a NullableIssue_pull_requestable when successful +func (m *NullableIssue) GetPullRequest()(NullableIssue_pull_requestable) { + return m.pull_request +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *NullableIssue) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetRepository gets the repository property value. A repository on GitHub. +// returns a Repositoryable when successful +func (m *NullableIssue) GetRepository()(Repositoryable) { + return m.repository +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *NullableIssue) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetState gets the state property value. State of the issue; either 'open' or 'closed' +// returns a *string when successful +func (m *NullableIssue) GetState()(*string) { + return m.state +} +// GetStateReason gets the state_reason property value. The reason for the current state +// returns a *NullableIssue_state_reason when successful +func (m *NullableIssue) GetStateReason()(*NullableIssue_state_reason) { + return m.state_reason +} +// GetTimelineUrl gets the timeline_url property value. The timeline_url property +// returns a *string when successful +func (m *NullableIssue) GetTimelineUrl()(*string) { + return m.timeline_url +} +// GetTitle gets the title property value. Title of the issue +// returns a *string when successful +func (m *NullableIssue) GetTitle()(*string) { + return m.title +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *NullableIssue) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. URL for the issue +// returns a *string when successful +func (m *NullableIssue) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *NullableIssue) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *NullableIssue) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("active_lock_reason", m.GetActiveLockReason()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + if m.GetAssignees() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAssignees())) + for i, v := range m.GetAssignees() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("assignees", cast) + if err != nil { + return err + } + } + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("closed_at", m.GetClosedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("closed_by", m.GetClosedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("locked", m.GetLocked()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pull_request", m.GetPullRequest()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + if m.GetStateReason() != nil { + cast := (*m.GetStateReason()).String() + err := writer.WriteStringValue("state_reason", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("timeline_url", m.GetTimelineUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActiveLockReason sets the active_lock_reason property value. The active_lock_reason property +func (m *NullableIssue) SetActiveLockReason(value *string)() { + m.active_lock_reason = value +} +// 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 *NullableIssue) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *NullableIssue) SetAssignee(value NullableSimpleUserable)() { + m.assignee = value +} +// SetAssignees sets the assignees property value. The assignees property +func (m *NullableIssue) SetAssignees(value []SimpleUserable)() { + m.assignees = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *NullableIssue) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. Contents of the issue +func (m *NullableIssue) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *NullableIssue) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *NullableIssue) SetBodyText(value *string)() { + m.body_text = value +} +// SetClosedAt sets the closed_at property value. The closed_at property +func (m *NullableIssue) SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.closed_at = value +} +// SetClosedBy sets the closed_by property value. A GitHub user. +func (m *NullableIssue) SetClosedBy(value NullableSimpleUserable)() { + m.closed_by = value +} +// SetComments sets the comments property value. The comments property +func (m *NullableIssue) SetComments(value *int32)() { + m.comments = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *NullableIssue) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *NullableIssue) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDraft sets the draft property value. The draft property +func (m *NullableIssue) SetDraft(value *bool)() { + m.draft = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *NullableIssue) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableIssue) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *NullableIssue) SetId(value *int64)() { + m.id = value +} +// SetLabels sets the labels property value. Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository +func (m *NullableIssue) SetLabels(value []string)() { + m.labels = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *NullableIssue) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLocked sets the locked property value. The locked property +func (m *NullableIssue) SetLocked(value *bool)() { + m.locked = value +} +// SetMilestone sets the milestone property value. A collection of related issues and pull requests. +func (m *NullableIssue) SetMilestone(value NullableMilestoneable)() { + m.milestone = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableIssue) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. Number uniquely identifying the issue within its repository +func (m *NullableIssue) SetNumber(value *int32)() { + m.number = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *NullableIssue) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetPullRequest sets the pull_request property value. The pull_request property +func (m *NullableIssue) SetPullRequest(value NullableIssue_pull_requestable)() { + m.pull_request = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *NullableIssue) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetRepository sets the repository property value. A repository on GitHub. +func (m *NullableIssue) SetRepository(value Repositoryable)() { + m.repository = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *NullableIssue) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetState sets the state property value. State of the issue; either 'open' or 'closed' +func (m *NullableIssue) SetState(value *string)() { + m.state = value +} +// SetStateReason sets the state_reason property value. The reason for the current state +func (m *NullableIssue) SetStateReason(value *NullableIssue_state_reason)() { + m.state_reason = value +} +// SetTimelineUrl sets the timeline_url property value. The timeline_url property +func (m *NullableIssue) SetTimelineUrl(value *string)() { + m.timeline_url = value +} +// SetTitle sets the title property value. Title of the issue +func (m *NullableIssue) SetTitle(value *string)() { + m.title = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *NullableIssue) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. URL for the issue +func (m *NullableIssue) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *NullableIssue) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type NullableIssueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActiveLockReason()(*string) + GetAssignee()(NullableSimpleUserable) + GetAssignees()([]SimpleUserable) + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetClosedBy()(NullableSimpleUserable) + GetComments()(*int32) + GetCommentsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDraft()(*bool) + GetEventsUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLabels()([]string) + GetLabelsUrl()(*string) + GetLocked()(*bool) + GetMilestone()(NullableMilestoneable) + GetNodeId()(*string) + GetNumber()(*int32) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetPullRequest()(NullableIssue_pull_requestable) + GetReactions()(ReactionRollupable) + GetRepository()(Repositoryable) + GetRepositoryUrl()(*string) + GetState()(*string) + GetStateReason()(*NullableIssue_state_reason) + GetTimelineUrl()(*string) + GetTitle()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetActiveLockReason(value *string)() + SetAssignee(value NullableSimpleUserable)() + SetAssignees(value []SimpleUserable)() + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetClosedBy(value NullableSimpleUserable)() + SetComments(value *int32)() + SetCommentsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDraft(value *bool)() + SetEventsUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLabels(value []string)() + SetLabelsUrl(value *string)() + SetLocked(value *bool)() + SetMilestone(value NullableMilestoneable)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetPullRequest(value NullableIssue_pull_requestable)() + SetReactions(value ReactionRollupable)() + SetRepository(value Repositoryable)() + SetRepositoryUrl(value *string)() + SetState(value *string)() + SetStateReason(value *NullableIssue_state_reason)() + SetTimelineUrl(value *string)() + SetTitle(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_issue_pull_request.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_issue_pull_request.go new file mode 100644 index 000000000..6929bb292 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_issue_pull_request.go @@ -0,0 +1,197 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type NullableIssue_pull_request struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The diff_url property + diff_url *string + // The html_url property + html_url *string + // The merged_at property + merged_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The patch_url property + patch_url *string + // The url property + url *string +} +// NewNullableIssue_pull_request instantiates a new NullableIssue_pull_request and sets the default values. +func NewNullableIssue_pull_request()(*NullableIssue_pull_request) { + m := &NullableIssue_pull_request{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableIssue_pull_requestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableIssue_pull_requestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableIssue_pull_request(), 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 *NullableIssue_pull_request) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDiffUrl gets the diff_url property value. The diff_url property +// returns a *string when successful +func (m *NullableIssue_pull_request) GetDiffUrl()(*string) { + return m.diff_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableIssue_pull_request) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["diff_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiffUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["merged_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetMergedAt(val) + } + return nil + } + res["patch_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatchUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableIssue_pull_request) GetHtmlUrl()(*string) { + return m.html_url +} +// GetMergedAt gets the merged_at property value. The merged_at property +// returns a *Time when successful +func (m *NullableIssue_pull_request) GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.merged_at +} +// GetPatchUrl gets the patch_url property value. The patch_url property +// returns a *string when successful +func (m *NullableIssue_pull_request) GetPatchUrl()(*string) { + return m.patch_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableIssue_pull_request) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *NullableIssue_pull_request) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("diff_url", m.GetDiffUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("merged_at", m.GetMergedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patch_url", m.GetPatchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *NullableIssue_pull_request) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDiffUrl sets the diff_url property value. The diff_url property +func (m *NullableIssue_pull_request) SetDiffUrl(value *string)() { + m.diff_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableIssue_pull_request) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetMergedAt sets the merged_at property value. The merged_at property +func (m *NullableIssue_pull_request) SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.merged_at = value +} +// SetPatchUrl sets the patch_url property value. The patch_url property +func (m *NullableIssue_pull_request) SetPatchUrl(value *string)() { + m.patch_url = value +} +// SetUrl sets the url property value. The url property +func (m *NullableIssue_pull_request) SetUrl(value *string)() { + m.url = value +} +type NullableIssue_pull_requestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDiffUrl()(*string) + GetHtmlUrl()(*string) + GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetPatchUrl()(*string) + GetUrl()(*string) + SetDiffUrl(value *string)() + SetHtmlUrl(value *string)() + SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetPatchUrl(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_issue_state_reason.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_issue_state_reason.go new file mode 100644 index 000000000..74b1a9640 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_issue_state_reason.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The reason for the current state +type NullableIssue_state_reason int + +const ( + COMPLETED_NULLABLEISSUE_STATE_REASON NullableIssue_state_reason = iota + REOPENED_NULLABLEISSUE_STATE_REASON + NOT_PLANNED_NULLABLEISSUE_STATE_REASON +) + +func (i NullableIssue_state_reason) String() string { + return []string{"completed", "reopened", "not_planned"}[i] +} +func ParseNullableIssue_state_reason(v string) (any, error) { + result := COMPLETED_NULLABLEISSUE_STATE_REASON + switch v { + case "completed": + result = COMPLETED_NULLABLEISSUE_STATE_REASON + case "reopened": + result = REOPENED_NULLABLEISSUE_STATE_REASON + case "not_planned": + result = NOT_PLANNED_NULLABLEISSUE_STATE_REASON + default: + return 0, errors.New("Unknown NullableIssue_state_reason value: " + v) + } + return &result, nil +} +func SerializeNullableIssue_state_reason(values []NullableIssue_state_reason) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableIssue_state_reason) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_license_simple.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_license_simple.go new file mode 100644 index 000000000..38f6ea7dc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_license_simple.go @@ -0,0 +1,226 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableLicenseSimple license Simple +type NullableLicenseSimple struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html_url property + html_url *string + // The key property + key *string + // The name property + name *string + // The node_id property + node_id *string + // The spdx_id property + spdx_id *string + // The url property + url *string +} +// NewNullableLicenseSimple instantiates a new NullableLicenseSimple and sets the default values. +func NewNullableLicenseSimple()(*NullableLicenseSimple) { + m := &NullableLicenseSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableLicenseSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableLicenseSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableLicenseSimple(), 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 *NullableLicenseSimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableLicenseSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["spdx_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSpdxId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableLicenseSimple) GetHtmlUrl()(*string) { + return m.html_url +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *NullableLicenseSimple) GetKey()(*string) { + return m.key +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *NullableLicenseSimple) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableLicenseSimple) GetNodeId()(*string) { + return m.node_id +} +// GetSpdxId gets the spdx_id property value. The spdx_id property +// returns a *string when successful +func (m *NullableLicenseSimple) GetSpdxId()(*string) { + return m.spdx_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableLicenseSimple) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *NullableLicenseSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("spdx_id", m.GetSpdxId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *NullableLicenseSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableLicenseSimple) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetKey sets the key property value. The key property +func (m *NullableLicenseSimple) SetKey(value *string)() { + m.key = value +} +// SetName sets the name property value. The name property +func (m *NullableLicenseSimple) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableLicenseSimple) SetNodeId(value *string)() { + m.node_id = value +} +// SetSpdxId sets the spdx_id property value. The spdx_id property +func (m *NullableLicenseSimple) SetSpdxId(value *string)() { + m.spdx_id = value +} +// SetUrl sets the url property value. The url property +func (m *NullableLicenseSimple) SetUrl(value *string)() { + m.url = value +} +type NullableLicenseSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetKey()(*string) + GetName()(*string) + GetNodeId()(*string) + GetSpdxId()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetKey(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetSpdxId(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_milestone.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_milestone.go new file mode 100644 index 000000000..d997e357f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_milestone.go @@ -0,0 +1,520 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableMilestone a collection of related issues and pull requests. +type NullableMilestone struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The closed_at property + closed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The closed_issues property + closed_issues *int32 + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + creator NullableSimpleUserable + // The description property + description *string + // The due_on property + due_on *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The html_url property + html_url *string + // The id property + id *int32 + // The labels_url property + labels_url *string + // The node_id property + node_id *string + // The number of the milestone. + number *int32 + // The open_issues property + open_issues *int32 + // The state of the milestone. + state *NullableMilestone_state + // The title of the milestone. + title *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewNullableMilestone instantiates a new NullableMilestone and sets the default values. +func NewNullableMilestone()(*NullableMilestone) { + m := &NullableMilestone{ + } + m.SetAdditionalData(make(map[string]any)) + stateValue := OPEN_NULLABLEMILESTONE_STATE + m.SetState(&stateValue) + return m +} +// CreateNullableMilestoneFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableMilestoneFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableMilestone(), 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 *NullableMilestone) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClosedAt gets the closed_at property value. The closed_at property +// returns a *Time when successful +func (m *NullableMilestone) GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.closed_at +} +// GetClosedIssues gets the closed_issues property value. The closed_issues property +// returns a *int32 when successful +func (m *NullableMilestone) GetClosedIssues()(*int32) { + return m.closed_issues +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *NullableMilestone) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCreator gets the creator property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *NullableMilestone) GetCreator()(NullableSimpleUserable) { + return m.creator +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *NullableMilestone) GetDescription()(*string) { + return m.description +} +// GetDueOn gets the due_on property value. The due_on property +// returns a *Time when successful +func (m *NullableMilestone) GetDueOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.due_on +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableMilestone) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["closed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetClosedAt(val) + } + return nil + } + res["closed_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetClosedIssues(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["creator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreator(val.(NullableSimpleUserable)) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["due_on"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDueOn(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableMilestone_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*NullableMilestone_state)) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableMilestone) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *NullableMilestone) GetId()(*int32) { + return m.id +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *NullableMilestone) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableMilestone) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. The number of the milestone. +// returns a *int32 when successful +func (m *NullableMilestone) GetNumber()(*int32) { + return m.number +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *NullableMilestone) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetState gets the state property value. The state of the milestone. +// returns a *NullableMilestone_state when successful +func (m *NullableMilestone) GetState()(*NullableMilestone_state) { + return m.state +} +// GetTitle gets the title property value. The title of the milestone. +// returns a *string when successful +func (m *NullableMilestone) GetTitle()(*string) { + return m.title +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *NullableMilestone) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableMilestone) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *NullableMilestone) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("closed_at", m.GetClosedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("closed_issues", m.GetClosedIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("creator", m.GetCreator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("due_on", m.GetDueOn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *NullableMilestone) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClosedAt sets the closed_at property value. The closed_at property +func (m *NullableMilestone) SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.closed_at = value +} +// SetClosedIssues sets the closed_issues property value. The closed_issues property +func (m *NullableMilestone) SetClosedIssues(value *int32)() { + m.closed_issues = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *NullableMilestone) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCreator sets the creator property value. A GitHub user. +func (m *NullableMilestone) SetCreator(value NullableSimpleUserable)() { + m.creator = value +} +// SetDescription sets the description property value. The description property +func (m *NullableMilestone) SetDescription(value *string)() { + m.description = value +} +// SetDueOn sets the due_on property value. The due_on property +func (m *NullableMilestone) SetDueOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.due_on = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableMilestone) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *NullableMilestone) SetId(value *int32)() { + m.id = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *NullableMilestone) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableMilestone) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. The number of the milestone. +func (m *NullableMilestone) SetNumber(value *int32)() { + m.number = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *NullableMilestone) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetState sets the state property value. The state of the milestone. +func (m *NullableMilestone) SetState(value *NullableMilestone_state)() { + m.state = value +} +// SetTitle sets the title property value. The title of the milestone. +func (m *NullableMilestone) SetTitle(value *string)() { + m.title = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *NullableMilestone) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *NullableMilestone) SetUrl(value *string)() { + m.url = value +} +type NullableMilestoneable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetClosedIssues()(*int32) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreator()(NullableSimpleUserable) + GetDescription()(*string) + GetDueOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLabelsUrl()(*string) + GetNodeId()(*string) + GetNumber()(*int32) + GetOpenIssues()(*int32) + GetState()(*NullableMilestone_state) + GetTitle()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetClosedIssues(value *int32)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreator(value NullableSimpleUserable)() + SetDescription(value *string)() + SetDueOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLabelsUrl(value *string)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetOpenIssues(value *int32)() + SetState(value *NullableMilestone_state)() + SetTitle(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_milestone_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_milestone_state.go new file mode 100644 index 000000000..02a8c64f6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_milestone_state.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The state of the milestone. +type NullableMilestone_state int + +const ( + OPEN_NULLABLEMILESTONE_STATE NullableMilestone_state = iota + CLOSED_NULLABLEMILESTONE_STATE +) + +func (i NullableMilestone_state) String() string { + return []string{"open", "closed"}[i] +} +func ParseNullableMilestone_state(v string) (any, error) { + result := OPEN_NULLABLEMILESTONE_STATE + switch v { + case "open": + result = OPEN_NULLABLEMILESTONE_STATE + case "closed": + result = CLOSED_NULLABLEMILESTONE_STATE + default: + return 0, errors.New("Unknown NullableMilestone_state value: " + v) + } + return &result, nil +} +func SerializeNullableMilestone_state(values []NullableMilestone_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableMilestone_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_minimal_repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_minimal_repository.go new file mode 100644 index 000000000..56399ad4c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_minimal_repository.go @@ -0,0 +1,2582 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableMinimalRepository minimal Repository +type NullableMinimalRepository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The allow_forking property + allow_forking *bool + // The archive_url property + archive_url *string + // The archived property + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // Code Of Conduct + code_of_conduct CodeOfConductable + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default_branch property + default_branch *string + // The delete_branch_on_merge property + delete_branch_on_merge *bool + // The deployments_url property + deployments_url *string + // The description property + description *string + // The disabled property + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // The has_discussions property + has_discussions *bool + // The has_downloads property + has_downloads *bool + // The has_issues property + has_issues *bool + // The has_pages property + has_pages *bool + // The has_projects property + has_projects *bool + // The has_wiki property + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int64 + // The is_template property + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // The license property + license NullableMinimalRepository_licenseable + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name property + name *string + // The network_count property + network_count *int32 + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // A GitHub user. + owner SimpleUserable + // The permissions property + permissions NullableMinimalRepository_permissionsable + // The private property + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The role_name property + role_name *string + // The security_and_analysis property + security_and_analysis SecurityAndAnalysisable + // The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + size *int32 + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The statuses_url property + statuses_url *string + // The subscribers_count property + subscribers_count *int32 + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The visibility property + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // The web_commit_signoff_required property + web_commit_signoff_required *bool +} +// NewNullableMinimalRepository instantiates a new NullableMinimalRepository and sets the default values. +func NewNullableMinimalRepository()(*NullableMinimalRepository) { + m := &NullableMinimalRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableMinimalRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableMinimalRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableMinimalRepository(), 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 *NullableMinimalRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowForking gets the allow_forking property value. The allow_forking property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetArchived gets the archived property value. The archived property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCodeOfConduct gets the code_of_conduct property value. Code Of Conduct +// returns a CodeOfConductable when successful +func (m *NullableMinimalRepository) GetCodeOfConduct()(CodeOfConductable) { + return m.code_of_conduct +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *NullableMinimalRepository) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default_branch property +// returns a *string when successful +func (m *NullableMinimalRepository) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. The delete_branch_on_merge property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *NullableMinimalRepository) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. The disabled property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableMinimalRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["code_of_conduct"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeOfConductFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCodeOfConduct(val.(CodeOfConductable)) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableMinimalRepository_licenseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(NullableMinimalRepository_licenseable)) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["network_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNetworkCount(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableMinimalRepository_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(NullableMinimalRepository_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["role_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRoleName(val) + } + return nil + } + res["security_and_analysis"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSecurityAndAnalysisFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAndAnalysis(val.(SecurityAndAnalysisable)) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersCount(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["topics"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *NullableMinimalRepository) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDiscussions gets the has_discussions property value. The has_discussions property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. The has_downloads property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. The has_issues property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. The has_projects property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. The has_wiki property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *NullableMinimalRepository) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *NullableMinimalRepository) GetId()(*int64) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. The is_template property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *NullableMinimalRepository) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. The license property +// returns a NullableMinimalRepository_licenseable when successful +func (m *NullableMinimalRepository) GetLicense()(NullableMinimalRepository_licenseable) { + return m.license +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *NullableMinimalRepository) GetName()(*string) { + return m.name +} +// GetNetworkCount gets the network_count property value. The network_count property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetNetworkCount()(*int32) { + return m.network_count +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableMinimalRepository) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *NullableMinimalRepository) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a NullableMinimalRepository_permissionsable when successful +func (m *NullableMinimalRepository) GetPermissions()(NullableMinimalRepository_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. The private property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *NullableMinimalRepository) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetRoleName gets the role_name property value. The role_name property +// returns a *string when successful +func (m *NullableMinimalRepository) GetRoleName()(*string) { + return m.role_name +} +// GetSecurityAndAnalysis gets the security_and_analysis property value. The security_and_analysis property +// returns a SecurityAndAnalysisable when successful +func (m *NullableMinimalRepository) GetSecurityAndAnalysis()(SecurityAndAnalysisable) { + return m.security_and_analysis +} +// GetSize gets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetSize()(*int32) { + return m.size +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersCount gets the subscribers_count property value. The subscribers_count property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetSubscribersCount()(*int32) { + return m.subscribers_count +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *NullableMinimalRepository) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *NullableMinimalRepository) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *NullableMinimalRepository) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetUrl()(*string) { + return m.url +} +// GetVisibility gets the visibility property value. The visibility property +// returns a *string when successful +func (m *NullableMinimalRepository) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. The web_commit_signoff_required property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *NullableMinimalRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("code_of_conduct", m.GetCodeOfConduct()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("network_count", m.GetNetworkCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("role_name", m.GetRoleName()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("security_and_analysis", m.GetSecurityAndAnalysis()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("subscribers_count", m.GetSubscribersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *NullableMinimalRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowForking sets the allow_forking property value. The allow_forking property +func (m *NullableMinimalRepository) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetArchived sets the archived property value. The archived property +func (m *NullableMinimalRepository) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *NullableMinimalRepository) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *NullableMinimalRepository) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *NullableMinimalRepository) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *NullableMinimalRepository) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *NullableMinimalRepository) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCodeOfConduct sets the code_of_conduct property value. Code Of Conduct +func (m *NullableMinimalRepository) SetCodeOfConduct(value CodeOfConductable)() { + m.code_of_conduct = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *NullableMinimalRepository) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *NullableMinimalRepository) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *NullableMinimalRepository) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *NullableMinimalRepository) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *NullableMinimalRepository) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *NullableMinimalRepository) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *NullableMinimalRepository) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default_branch property +func (m *NullableMinimalRepository) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. The delete_branch_on_merge property +func (m *NullableMinimalRepository) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *NullableMinimalRepository) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *NullableMinimalRepository) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. The disabled property +func (m *NullableMinimalRepository) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *NullableMinimalRepository) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *NullableMinimalRepository) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *NullableMinimalRepository) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *NullableMinimalRepository) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *NullableMinimalRepository) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *NullableMinimalRepository) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *NullableMinimalRepository) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *NullableMinimalRepository) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *NullableMinimalRepository) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *NullableMinimalRepository) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *NullableMinimalRepository) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDiscussions sets the has_discussions property value. The has_discussions property +func (m *NullableMinimalRepository) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. The has_downloads property +func (m *NullableMinimalRepository) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. The has_issues property +func (m *NullableMinimalRepository) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *NullableMinimalRepository) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. The has_projects property +func (m *NullableMinimalRepository) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. The has_wiki property +func (m *NullableMinimalRepository) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *NullableMinimalRepository) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *NullableMinimalRepository) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableMinimalRepository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *NullableMinimalRepository) SetId(value *int64)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *NullableMinimalRepository) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *NullableMinimalRepository) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *NullableMinimalRepository) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. The is_template property +func (m *NullableMinimalRepository) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *NullableMinimalRepository) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *NullableMinimalRepository) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *NullableMinimalRepository) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *NullableMinimalRepository) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. The license property +func (m *NullableMinimalRepository) SetLicense(value NullableMinimalRepository_licenseable)() { + m.license = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *NullableMinimalRepository) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *NullableMinimalRepository) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *NullableMinimalRepository) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name property +func (m *NullableMinimalRepository) SetName(value *string)() { + m.name = value +} +// SetNetworkCount sets the network_count property value. The network_count property +func (m *NullableMinimalRepository) SetNetworkCount(value *int32)() { + m.network_count = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableMinimalRepository) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *NullableMinimalRepository) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *NullableMinimalRepository) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *NullableMinimalRepository) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *NullableMinimalRepository) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *NullableMinimalRepository) SetPermissions(value NullableMinimalRepository_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. The private property +func (m *NullableMinimalRepository) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *NullableMinimalRepository) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *NullableMinimalRepository) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *NullableMinimalRepository) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetRoleName sets the role_name property value. The role_name property +func (m *NullableMinimalRepository) SetRoleName(value *string)() { + m.role_name = value +} +// SetSecurityAndAnalysis sets the security_and_analysis property value. The security_and_analysis property +func (m *NullableMinimalRepository) SetSecurityAndAnalysis(value SecurityAndAnalysisable)() { + m.security_and_analysis = value +} +// SetSize sets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +func (m *NullableMinimalRepository) SetSize(value *int32)() { + m.size = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *NullableMinimalRepository) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *NullableMinimalRepository) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *NullableMinimalRepository) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *NullableMinimalRepository) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersCount sets the subscribers_count property value. The subscribers_count property +func (m *NullableMinimalRepository) SetSubscribersCount(value *int32)() { + m.subscribers_count = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *NullableMinimalRepository) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *NullableMinimalRepository) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *NullableMinimalRepository) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *NullableMinimalRepository) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *NullableMinimalRepository) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *NullableMinimalRepository) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTopics sets the topics property value. The topics property +func (m *NullableMinimalRepository) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *NullableMinimalRepository) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *NullableMinimalRepository) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *NullableMinimalRepository) SetUrl(value *string)() { + m.url = value +} +// SetVisibility sets the visibility property value. The visibility property +func (m *NullableMinimalRepository) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *NullableMinimalRepository) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *NullableMinimalRepository) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. The web_commit_signoff_required property +func (m *NullableMinimalRepository) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type NullableMinimalRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowForking()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCodeOfConduct()(CodeOfConductable) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(NullableMinimalRepository_licenseable) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNetworkCount()(*int32) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOwner()(SimpleUserable) + GetPermissions()(NullableMinimalRepository_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetRoleName()(*string) + GetSecurityAndAnalysis()(SecurityAndAnalysisable) + GetSize()(*int32) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersCount()(*int32) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowForking(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCodeOfConduct(value CodeOfConductable)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value NullableMinimalRepository_licenseable)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNetworkCount(value *int32)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOwner(value SimpleUserable)() + SetPermissions(value NullableMinimalRepository_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetRoleName(value *string)() + SetSecurityAndAnalysis(value SecurityAndAnalysisable)() + SetSize(value *int32)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersCount(value *int32)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_minimal_repository_license.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_minimal_repository_license.go new file mode 100644 index 000000000..fc5616a8d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_minimal_repository_license.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type NullableMinimalRepository_license struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The key property + key *string + // The name property + name *string + // The node_id property + node_id *string + // The spdx_id property + spdx_id *string + // The url property + url *string +} +// NewNullableMinimalRepository_license instantiates a new NullableMinimalRepository_license and sets the default values. +func NewNullableMinimalRepository_license()(*NullableMinimalRepository_license) { + m := &NullableMinimalRepository_license{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableMinimalRepository_licenseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableMinimalRepository_licenseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableMinimalRepository_license(), 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 *NullableMinimalRepository_license) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableMinimalRepository_license) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["spdx_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSpdxId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *NullableMinimalRepository_license) GetKey()(*string) { + return m.key +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *NullableMinimalRepository_license) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableMinimalRepository_license) GetNodeId()(*string) { + return m.node_id +} +// GetSpdxId gets the spdx_id property value. The spdx_id property +// returns a *string when successful +func (m *NullableMinimalRepository_license) GetSpdxId()(*string) { + return m.spdx_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableMinimalRepository_license) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *NullableMinimalRepository_license) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("spdx_id", m.GetSpdxId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *NullableMinimalRepository_license) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The key property +func (m *NullableMinimalRepository_license) SetKey(value *string)() { + m.key = value +} +// SetName sets the name property value. The name property +func (m *NullableMinimalRepository_license) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableMinimalRepository_license) SetNodeId(value *string)() { + m.node_id = value +} +// SetSpdxId sets the spdx_id property value. The spdx_id property +func (m *NullableMinimalRepository_license) SetSpdxId(value *string)() { + m.spdx_id = value +} +// SetUrl sets the url property value. The url property +func (m *NullableMinimalRepository_license) SetUrl(value *string)() { + m.url = value +} +type NullableMinimalRepository_licenseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetName()(*string) + GetNodeId()(*string) + GetSpdxId()(*string) + GetUrl()(*string) + SetKey(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetSpdxId(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_minimal_repository_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_minimal_repository_permissions.go new file mode 100644 index 000000000..4a043afcd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_minimal_repository_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type NullableMinimalRepository_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewNullableMinimalRepository_permissions instantiates a new NullableMinimalRepository_permissions and sets the default values. +func NewNullableMinimalRepository_permissions()(*NullableMinimalRepository_permissions) { + m := &NullableMinimalRepository_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableMinimalRepository_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableMinimalRepository_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableMinimalRepository_permissions(), 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 *NullableMinimalRepository_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *NullableMinimalRepository_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableMinimalRepository_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *NullableMinimalRepository_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *NullableMinimalRepository_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *NullableMinimalRepository_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *NullableMinimalRepository_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *NullableMinimalRepository_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *NullableMinimalRepository_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *NullableMinimalRepository_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *NullableMinimalRepository_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *NullableMinimalRepository_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *NullableMinimalRepository_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *NullableMinimalRepository_permissions) SetTriage(value *bool)() { + m.triage = value +} +type NullableMinimalRepository_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository.go new file mode 100644 index 000000000..c3080c628 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository.go @@ -0,0 +1,2826 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableRepository a repository on GitHub. +type NullableRepository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether to allow Auto-merge to be used on pull requests. + allow_auto_merge *bool + // Whether to allow forking this repo + allow_forking *bool + // Whether to allow merge commits for pull requests. + allow_merge_commit *bool + // Whether to allow rebase merges for pull requests. + allow_rebase_merge *bool + // Whether to allow squash merges for pull requests. + allow_squash_merge *bool + // Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. + allow_update_branch *bool + // Whether anonymous git access is enabled for this repository + anonymous_access_enabled *bool + // The archive_url property + archive_url *string + // Whether the repository is archived. + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default branch of the repository. + default_branch *string + // Whether to delete head branches when pull requests are merged + delete_branch_on_merge *bool + // The deployments_url property + deployments_url *string + // The description property + description *string + // Returns whether or not this repository disabled. + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // Whether discussions are enabled. + has_discussions *bool + // Whether downloads are enabled. + // Deprecated: + has_downloads *bool + // Whether issues are enabled. + has_issues *bool + // The has_pages property + has_pages *bool + // Whether projects are enabled. + has_projects *bool + // Whether the wiki is enabled. + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // Unique identifier of the repository + id *int64 + // Whether this repository acts as a template that can be used to generate new repositories. + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // License Simple + license NullableLicenseSimpleable + // The master_branch property + master_branch *string + // The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. + merge_commit_message *NullableRepository_merge_commit_message + // The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + merge_commit_title *NullableRepository_merge_commit_title + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name of the repository. + name *string + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // A GitHub user. + owner SimpleUserable + // The permissions property + permissions NullableRepository_permissionsable + // Whether the repository is private or public. + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + size *int32 + // The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. + squash_merge_commit_message *NullableRepository_squash_merge_commit_message + // The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + squash_merge_commit_title *NullableRepository_squash_merge_commit_title + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The starred_at property + starred_at *string + // The statuses_url property + statuses_url *string + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + // Deprecated: + use_squash_pr_title_as_default *bool + // The repository visibility: public, private, or internal. + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // Whether to require contributors to sign off on web-based commits + web_commit_signoff_required *bool +} +// NewNullableRepository instantiates a new NullableRepository and sets the default values. +func NewNullableRepository()(*NullableRepository) { + m := &NullableRepository{ + } + m.SetAdditionalData(make(map[string]any)) + visibilityValue := "public" + m.SetVisibility(&visibilityValue) + return m +} +// CreateNullableRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableRepository(), 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 *NullableRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. Whether to allow Auto-merge to be used on pull requests. +// returns a *bool when successful +func (m *NullableRepository) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowForking gets the allow_forking property value. Whether to allow forking this repo +// returns a *bool when successful +func (m *NullableRepository) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. Whether to allow merge commits for pull requests. +// returns a *bool when successful +func (m *NullableRepository) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. Whether to allow rebase merges for pull requests. +// returns a *bool when successful +func (m *NullableRepository) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. Whether to allow squash merges for pull requests. +// returns a *bool when successful +func (m *NullableRepository) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetAllowUpdateBranch gets the allow_update_branch property value. Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. +// returns a *bool when successful +func (m *NullableRepository) GetAllowUpdateBranch()(*bool) { + return m.allow_update_branch +} +// GetAnonymousAccessEnabled gets the anonymous_access_enabled property value. Whether anonymous git access is enabled for this repository +// returns a *bool when successful +func (m *NullableRepository) GetAnonymousAccessEnabled()(*bool) { + return m.anonymous_access_enabled +} +// GetArchived gets the archived property value. Whether the repository is archived. +// returns a *bool when successful +func (m *NullableRepository) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *NullableRepository) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *NullableRepository) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *NullableRepository) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *NullableRepository) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *NullableRepository) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *NullableRepository) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *NullableRepository) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *NullableRepository) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *NullableRepository) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *NullableRepository) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *NullableRepository) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *NullableRepository) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default branch of the repository. +// returns a *string when successful +func (m *NullableRepository) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged +// returns a *bool when successful +func (m *NullableRepository) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *NullableRepository) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *NullableRepository) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. Returns whether or not this repository disabled. +// returns a *bool when successful +func (m *NullableRepository) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *NullableRepository) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *NullableRepository) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["allow_update_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowUpdateBranch(val) + } + return nil + } + res["anonymous_access_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAnonymousAccessEnabled(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableLicenseSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(NullableLicenseSimpleable)) + } + return nil + } + res["master_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMasterBranch(val) + } + return nil + } + res["merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableRepository_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitMessage(val.(*NullableRepository_merge_commit_message)) + } + return nil + } + res["merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableRepository_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitTitle(val.(*NullableRepository_merge_commit_title)) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableRepository_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(NullableRepository_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["squash_merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableRepository_squash_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitMessage(val.(*NullableRepository_squash_merge_commit_message)) + } + return nil + } + res["squash_merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableRepository_squash_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitTitle(val.(*NullableRepository_squash_merge_commit_title)) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["starred_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredAt(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["topics"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["use_squash_pr_title_as_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseSquashPrTitleAsDefault(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *NullableRepository) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *NullableRepository) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *NullableRepository) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *NullableRepository) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *NullableRepository) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *NullableRepository) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *NullableRepository) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *NullableRepository) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *NullableRepository) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDiscussions gets the has_discussions property value. Whether discussions are enabled. +// returns a *bool when successful +func (m *NullableRepository) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. Whether downloads are enabled. +// Deprecated: +// returns a *bool when successful +func (m *NullableRepository) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. Whether issues are enabled. +// returns a *bool when successful +func (m *NullableRepository) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *NullableRepository) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. Whether projects are enabled. +// returns a *bool when successful +func (m *NullableRepository) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. Whether the wiki is enabled. +// returns a *bool when successful +func (m *NullableRepository) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *NullableRepository) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *NullableRepository) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableRepository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the repository +// returns a *int64 when successful +func (m *NullableRepository) GetId()(*int64) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *NullableRepository) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *NullableRepository) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *NullableRepository) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. Whether this repository acts as a template that can be used to generate new repositories. +// returns a *bool when successful +func (m *NullableRepository) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *NullableRepository) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *NullableRepository) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *NullableRepository) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *NullableRepository) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. License Simple +// returns a NullableLicenseSimpleable when successful +func (m *NullableRepository) GetLicense()(NullableLicenseSimpleable) { + return m.license +} +// GetMasterBranch gets the master_branch property value. The master_branch property +// returns a *string when successful +func (m *NullableRepository) GetMasterBranch()(*string) { + return m.master_branch +} +// GetMergeCommitMessage gets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +// returns a *NullableRepository_merge_commit_message when successful +func (m *NullableRepository) GetMergeCommitMessage()(*NullableRepository_merge_commit_message) { + return m.merge_commit_message +} +// GetMergeCommitTitle gets the merge_commit_title property value. The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +// returns a *NullableRepository_merge_commit_title when successful +func (m *NullableRepository) GetMergeCommitTitle()(*NullableRepository_merge_commit_title) { + return m.merge_commit_title +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *NullableRepository) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *NullableRepository) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *NullableRepository) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name of the repository. +// returns a *string when successful +func (m *NullableRepository) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableRepository) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *NullableRepository) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *NullableRepository) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *NullableRepository) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *NullableRepository) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a NullableRepository_permissionsable when successful +func (m *NullableRepository) GetPermissions()(NullableRepository_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. Whether the repository is private or public. +// returns a *bool when successful +func (m *NullableRepository) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *NullableRepository) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *NullableRepository) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *NullableRepository) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetSize gets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +// returns a *int32 when successful +func (m *NullableRepository) GetSize()(*int32) { + return m.size +} +// GetSquashMergeCommitMessage gets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +// returns a *NullableRepository_squash_merge_commit_message when successful +func (m *NullableRepository) GetSquashMergeCommitMessage()(*NullableRepository_squash_merge_commit_message) { + return m.squash_merge_commit_message +} +// GetSquashMergeCommitTitle gets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +// returns a *NullableRepository_squash_merge_commit_title when successful +func (m *NullableRepository) GetSquashMergeCommitTitle()(*NullableRepository_squash_merge_commit_title) { + return m.squash_merge_commit_title +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *NullableRepository) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *NullableRepository) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *NullableRepository) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStarredAt gets the starred_at property value. The starred_at property +// returns a *string when successful +func (m *NullableRepository) GetStarredAt()(*string) { + return m.starred_at +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *NullableRepository) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *NullableRepository) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *NullableRepository) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *NullableRepository) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *NullableRepository) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *NullableRepository) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *NullableRepository) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *NullableRepository) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *NullableRepository) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *NullableRepository) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableRepository) GetUrl()(*string) { + return m.url +} +// GetUseSquashPrTitleAsDefault gets the use_squash_pr_title_as_default property value. Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +// returns a *bool when successful +func (m *NullableRepository) GetUseSquashPrTitleAsDefault()(*bool) { + return m.use_squash_pr_title_as_default +} +// GetVisibility gets the visibility property value. The repository visibility: public, private, or internal. +// returns a *string when successful +func (m *NullableRepository) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *NullableRepository) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *NullableRepository) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. Whether to require contributors to sign off on web-based commits +// returns a *bool when successful +func (m *NullableRepository) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *NullableRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_update_branch", m.GetAllowUpdateBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("anonymous_access_enabled", m.GetAnonymousAccessEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("master_branch", m.GetMasterBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + if m.GetMergeCommitMessage() != nil { + cast := (*m.GetMergeCommitMessage()).String() + err := writer.WriteStringValue("merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetMergeCommitTitle() != nil { + cast := (*m.GetMergeCommitTitle()).String() + err := writer.WriteStringValue("merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitMessage() != nil { + cast := (*m.GetSquashMergeCommitMessage()).String() + err := writer.WriteStringValue("squash_merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitTitle() != nil { + cast := (*m.GetSquashMergeCommitTitle()).String() + err := writer.WriteStringValue("squash_merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_at", m.GetStarredAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_squash_pr_title_as_default", m.GetUseSquashPrTitleAsDefault()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *NullableRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. Whether to allow Auto-merge to be used on pull requests. +func (m *NullableRepository) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowForking sets the allow_forking property value. Whether to allow forking this repo +func (m *NullableRepository) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. Whether to allow merge commits for pull requests. +func (m *NullableRepository) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. Whether to allow rebase merges for pull requests. +func (m *NullableRepository) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. Whether to allow squash merges for pull requests. +func (m *NullableRepository) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetAllowUpdateBranch sets the allow_update_branch property value. Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. +func (m *NullableRepository) SetAllowUpdateBranch(value *bool)() { + m.allow_update_branch = value +} +// SetAnonymousAccessEnabled sets the anonymous_access_enabled property value. Whether anonymous git access is enabled for this repository +func (m *NullableRepository) SetAnonymousAccessEnabled(value *bool)() { + m.anonymous_access_enabled = value +} +// SetArchived sets the archived property value. Whether the repository is archived. +func (m *NullableRepository) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *NullableRepository) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *NullableRepository) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *NullableRepository) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *NullableRepository) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *NullableRepository) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *NullableRepository) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *NullableRepository) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *NullableRepository) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *NullableRepository) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *NullableRepository) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *NullableRepository) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *NullableRepository) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default branch of the repository. +func (m *NullableRepository) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged +func (m *NullableRepository) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *NullableRepository) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *NullableRepository) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. Returns whether or not this repository disabled. +func (m *NullableRepository) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *NullableRepository) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *NullableRepository) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *NullableRepository) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *NullableRepository) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *NullableRepository) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *NullableRepository) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *NullableRepository) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *NullableRepository) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *NullableRepository) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *NullableRepository) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *NullableRepository) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDiscussions sets the has_discussions property value. Whether discussions are enabled. +func (m *NullableRepository) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. Whether downloads are enabled. +// Deprecated: +func (m *NullableRepository) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. Whether issues are enabled. +func (m *NullableRepository) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *NullableRepository) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. Whether projects are enabled. +func (m *NullableRepository) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. Whether the wiki is enabled. +func (m *NullableRepository) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *NullableRepository) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *NullableRepository) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableRepository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the repository +func (m *NullableRepository) SetId(value *int64)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *NullableRepository) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *NullableRepository) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *NullableRepository) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. Whether this repository acts as a template that can be used to generate new repositories. +func (m *NullableRepository) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *NullableRepository) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *NullableRepository) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *NullableRepository) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *NullableRepository) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. License Simple +func (m *NullableRepository) SetLicense(value NullableLicenseSimpleable)() { + m.license = value +} +// SetMasterBranch sets the master_branch property value. The master_branch property +func (m *NullableRepository) SetMasterBranch(value *string)() { + m.master_branch = value +} +// SetMergeCommitMessage sets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +func (m *NullableRepository) SetMergeCommitMessage(value *NullableRepository_merge_commit_message)() { + m.merge_commit_message = value +} +// SetMergeCommitTitle sets the merge_commit_title property value. The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +func (m *NullableRepository) SetMergeCommitTitle(value *NullableRepository_merge_commit_title)() { + m.merge_commit_title = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *NullableRepository) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *NullableRepository) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *NullableRepository) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name of the repository. +func (m *NullableRepository) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableRepository) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *NullableRepository) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *NullableRepository) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *NullableRepository) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *NullableRepository) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *NullableRepository) SetPermissions(value NullableRepository_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. Whether the repository is private or public. +func (m *NullableRepository) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *NullableRepository) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *NullableRepository) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *NullableRepository) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetSize sets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +func (m *NullableRepository) SetSize(value *int32)() { + m.size = value +} +// SetSquashMergeCommitMessage sets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +func (m *NullableRepository) SetSquashMergeCommitMessage(value *NullableRepository_squash_merge_commit_message)() { + m.squash_merge_commit_message = value +} +// SetSquashMergeCommitTitle sets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +func (m *NullableRepository) SetSquashMergeCommitTitle(value *NullableRepository_squash_merge_commit_title)() { + m.squash_merge_commit_title = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *NullableRepository) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *NullableRepository) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *NullableRepository) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStarredAt sets the starred_at property value. The starred_at property +func (m *NullableRepository) SetStarredAt(value *string)() { + m.starred_at = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *NullableRepository) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *NullableRepository) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *NullableRepository) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *NullableRepository) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *NullableRepository) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *NullableRepository) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *NullableRepository) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTopics sets the topics property value. The topics property +func (m *NullableRepository) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *NullableRepository) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *NullableRepository) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *NullableRepository) SetUrl(value *string)() { + m.url = value +} +// SetUseSquashPrTitleAsDefault sets the use_squash_pr_title_as_default property value. Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +func (m *NullableRepository) SetUseSquashPrTitleAsDefault(value *bool)() { + m.use_squash_pr_title_as_default = value +} +// SetVisibility sets the visibility property value. The repository visibility: public, private, or internal. +func (m *NullableRepository) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *NullableRepository) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *NullableRepository) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. Whether to require contributors to sign off on web-based commits +func (m *NullableRepository) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type NullableRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetAllowUpdateBranch()(*bool) + GetAnonymousAccessEnabled()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(NullableLicenseSimpleable) + GetMasterBranch()(*string) + GetMergeCommitMessage()(*NullableRepository_merge_commit_message) + GetMergeCommitTitle()(*NullableRepository_merge_commit_title) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOwner()(SimpleUserable) + GetPermissions()(NullableRepository_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetSize()(*int32) + GetSquashMergeCommitMessage()(*NullableRepository_squash_merge_commit_message) + GetSquashMergeCommitTitle()(*NullableRepository_squash_merge_commit_title) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStarredAt()(*string) + GetStatusesUrl()(*string) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUseSquashPrTitleAsDefault()(*bool) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowAutoMerge(value *bool)() + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetAllowUpdateBranch(value *bool)() + SetAnonymousAccessEnabled(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value NullableLicenseSimpleable)() + SetMasterBranch(value *string)() + SetMergeCommitMessage(value *NullableRepository_merge_commit_message)() + SetMergeCommitTitle(value *NullableRepository_merge_commit_title)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOwner(value SimpleUserable)() + SetPermissions(value NullableRepository_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetSize(value *int32)() + SetSquashMergeCommitMessage(value *NullableRepository_squash_merge_commit_message)() + SetSquashMergeCommitTitle(value *NullableRepository_squash_merge_commit_title)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStarredAt(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUseSquashPrTitleAsDefault(value *bool)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_merge_commit_message.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_merge_commit_message.go new file mode 100644 index 000000000..8799176d2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_merge_commit_message.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +type NullableRepository_merge_commit_message int + +const ( + PR_BODY_NULLABLEREPOSITORY_MERGE_COMMIT_MESSAGE NullableRepository_merge_commit_message = iota + PR_TITLE_NULLABLEREPOSITORY_MERGE_COMMIT_MESSAGE + BLANK_NULLABLEREPOSITORY_MERGE_COMMIT_MESSAGE +) + +func (i NullableRepository_merge_commit_message) String() string { + return []string{"PR_BODY", "PR_TITLE", "BLANK"}[i] +} +func ParseNullableRepository_merge_commit_message(v string) (any, error) { + result := PR_BODY_NULLABLEREPOSITORY_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_NULLABLEREPOSITORY_MERGE_COMMIT_MESSAGE + case "PR_TITLE": + result = PR_TITLE_NULLABLEREPOSITORY_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_NULLABLEREPOSITORY_MERGE_COMMIT_MESSAGE + default: + return 0, errors.New("Unknown NullableRepository_merge_commit_message value: " + v) + } + return &result, nil +} +func SerializeNullableRepository_merge_commit_message(values []NullableRepository_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableRepository_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_merge_commit_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_merge_commit_title.go new file mode 100644 index 000000000..513530c53 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_merge_commit_title.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +type NullableRepository_merge_commit_title int + +const ( + PR_TITLE_NULLABLEREPOSITORY_MERGE_COMMIT_TITLE NullableRepository_merge_commit_title = iota + MERGE_MESSAGE_NULLABLEREPOSITORY_MERGE_COMMIT_TITLE +) + +func (i NullableRepository_merge_commit_title) String() string { + return []string{"PR_TITLE", "MERGE_MESSAGE"}[i] +} +func ParseNullableRepository_merge_commit_title(v string) (any, error) { + result := PR_TITLE_NULLABLEREPOSITORY_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_NULLABLEREPOSITORY_MERGE_COMMIT_TITLE + case "MERGE_MESSAGE": + result = MERGE_MESSAGE_NULLABLEREPOSITORY_MERGE_COMMIT_TITLE + default: + return 0, errors.New("Unknown NullableRepository_merge_commit_title value: " + v) + } + return &result, nil +} +func SerializeNullableRepository_merge_commit_title(values []NullableRepository_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableRepository_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_permissions.go new file mode 100644 index 000000000..81ce08e83 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type NullableRepository_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewNullableRepository_permissions instantiates a new NullableRepository_permissions and sets the default values. +func NewNullableRepository_permissions()(*NullableRepository_permissions) { + m := &NullableRepository_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableRepository_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableRepository_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableRepository_permissions(), 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 *NullableRepository_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *NullableRepository_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableRepository_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *NullableRepository_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *NullableRepository_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *NullableRepository_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *NullableRepository_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *NullableRepository_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *NullableRepository_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *NullableRepository_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *NullableRepository_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *NullableRepository_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *NullableRepository_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *NullableRepository_permissions) SetTriage(value *bool)() { + m.triage = value +} +type NullableRepository_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_squash_merge_commit_message.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_squash_merge_commit_message.go new file mode 100644 index 000000000..77bc0ee3c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_squash_merge_commit_message.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +type NullableRepository_squash_merge_commit_message int + +const ( + PR_BODY_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE NullableRepository_squash_merge_commit_message = iota + COMMIT_MESSAGES_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + BLANK_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE +) + +func (i NullableRepository_squash_merge_commit_message) String() string { + return []string{"PR_BODY", "COMMIT_MESSAGES", "BLANK"}[i] +} +func ParseNullableRepository_squash_merge_commit_message(v string) (any, error) { + result := PR_BODY_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + case "COMMIT_MESSAGES": + result = COMMIT_MESSAGES_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + default: + return 0, errors.New("Unknown NullableRepository_squash_merge_commit_message value: " + v) + } + return &result, nil +} +func SerializeNullableRepository_squash_merge_commit_message(values []NullableRepository_squash_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableRepository_squash_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_squash_merge_commit_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_squash_merge_commit_title.go new file mode 100644 index 000000000..57aef86b4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_squash_merge_commit_title.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +type NullableRepository_squash_merge_commit_title int + +const ( + PR_TITLE_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_TITLE NullableRepository_squash_merge_commit_title = iota + COMMIT_OR_PR_TITLE_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_TITLE +) + +func (i NullableRepository_squash_merge_commit_title) String() string { + return []string{"PR_TITLE", "COMMIT_OR_PR_TITLE"}[i] +} +func ParseNullableRepository_squash_merge_commit_title(v string) (any, error) { + result := PR_TITLE_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_TITLE + case "COMMIT_OR_PR_TITLE": + result = COMMIT_OR_PR_TITLE_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_TITLE + default: + return 0, errors.New("Unknown NullableRepository_squash_merge_commit_title value: " + v) + } + return &result, nil +} +func SerializeNullableRepository_squash_merge_commit_title(values []NullableRepository_squash_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableRepository_squash_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository.go new file mode 100644 index 000000000..305d396df --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository.go @@ -0,0 +1,2496 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableRepository_template_repository +type NullableRepository_template_repository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The allow_auto_merge property + allow_auto_merge *bool + // The allow_merge_commit property + allow_merge_commit *bool + // The allow_rebase_merge property + allow_rebase_merge *bool + // The allow_squash_merge property + allow_squash_merge *bool + // The allow_update_branch property + allow_update_branch *bool + // The archive_url property + archive_url *string + // The archived property + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *string + // The default_branch property + default_branch *string + // The delete_branch_on_merge property + delete_branch_on_merge *bool + // The deployments_url property + deployments_url *string + // The description property + description *string + // The disabled property + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // The has_downloads property + has_downloads *bool + // The has_issues property + has_issues *bool + // The has_pages property + has_pages *bool + // The has_projects property + has_projects *bool + // The has_wiki property + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The is_template property + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. + merge_commit_message *NullableRepository_template_repository_merge_commit_message + // The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + merge_commit_title *NullableRepository_template_repository_merge_commit_title + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name property + name *string + // The network_count property + network_count *int32 + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues_count property + open_issues_count *int32 + // The owner property + owner NullableRepository_template_repository_ownerable + // The permissions property + permissions NullableRepository_template_repository_permissionsable + // The private property + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *string + // The releases_url property + releases_url *string + // The size property + size *int32 + // The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. + squash_merge_commit_message *NullableRepository_template_repository_squash_merge_commit_message + // The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + squash_merge_commit_title *NullableRepository_template_repository_squash_merge_commit_title + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The statuses_url property + statuses_url *string + // The subscribers_count property + subscribers_count *int32 + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *string + // The url property + url *string + // The use_squash_pr_title_as_default property + use_squash_pr_title_as_default *bool + // The visibility property + visibility *string + // The watchers_count property + watchers_count *int32 +} +// NewNullableRepository_template_repository instantiates a new nullableRepository_template_repository and sets the default values. +func NewNullableRepository_template_repository()(*NullableRepository_template_repository) { + m := &NullableRepository_template_repository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableRepository_template_repositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateNullableRepository_template_repositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableRepository_template_repository(), 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. +func (m *NullableRepository_template_repository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. The allow_auto_merge property +func (m *NullableRepository_template_repository) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowMergeCommit gets the allow_merge_commit property value. The allow_merge_commit property +func (m *NullableRepository_template_repository) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. The allow_rebase_merge property +func (m *NullableRepository_template_repository) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. The allow_squash_merge property +func (m *NullableRepository_template_repository) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetAllowUpdateBranch gets the allow_update_branch property value. The allow_update_branch property +func (m *NullableRepository_template_repository) GetAllowUpdateBranch()(*bool) { + return m.allow_update_branch +} +// GetArchived gets the archived property value. The archived property +func (m *NullableRepository_template_repository) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +func (m *NullableRepository_template_repository) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +func (m *NullableRepository_template_repository) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +func (m *NullableRepository_template_repository) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +func (m *NullableRepository_template_repository) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +func (m *NullableRepository_template_repository) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +func (m *NullableRepository_template_repository) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +func (m *NullableRepository_template_repository) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +func (m *NullableRepository_template_repository) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +func (m *NullableRepository_template_repository) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +func (m *NullableRepository_template_repository) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +func (m *NullableRepository_template_repository) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +func (m *NullableRepository_template_repository) GetCreatedAt()(*string) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default_branch property +func (m *NullableRepository_template_repository) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. The delete_branch_on_merge property +func (m *NullableRepository_template_repository) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +func (m *NullableRepository_template_repository) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +func (m *NullableRepository_template_repository) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. The disabled property +func (m *NullableRepository_template_repository) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +func (m *NullableRepository_template_repository) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +func (m *NullableRepository_template_repository) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +func (m *NullableRepository_template_repository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["allow_update_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowUpdateBranch(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableRepository_template_repository_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitMessage(val.(*NullableRepository_template_repository_merge_commit_message)) + } + return nil + } + res["merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableRepository_template_repository_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitTitle(val.(*NullableRepository_template_repository_merge_commit_title)) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["network_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNetworkCount(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableRepository_template_repository_ownerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(NullableRepository_template_repository_ownerable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableRepository_template_repository_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(NullableRepository_template_repository_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["squash_merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableRepository_template_repository_squash_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitMessage(val.(*NullableRepository_template_repository_squash_merge_commit_message)) + } + return nil + } + res["squash_merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableRepository_template_repository_squash_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitTitle(val.(*NullableRepository_template_repository_squash_merge_commit_title)) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersCount(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["topics"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["use_squash_pr_title_as_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseSquashPrTitleAsDefault(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +func (m *NullableRepository_template_repository) GetFork()(*bool) { + return m.fork +} +// GetForksCount gets the forks_count property value. The forks_count property +func (m *NullableRepository_template_repository) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +func (m *NullableRepository_template_repository) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +func (m *NullableRepository_template_repository) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +func (m *NullableRepository_template_repository) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +func (m *NullableRepository_template_repository) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +func (m *NullableRepository_template_repository) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +func (m *NullableRepository_template_repository) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDownloads gets the has_downloads property value. The has_downloads property +func (m *NullableRepository_template_repository) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. The has_issues property +func (m *NullableRepository_template_repository) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +func (m *NullableRepository_template_repository) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. The has_projects property +func (m *NullableRepository_template_repository) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. The has_wiki property +func (m *NullableRepository_template_repository) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +func (m *NullableRepository_template_repository) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +func (m *NullableRepository_template_repository) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +func (m *NullableRepository_template_repository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +func (m *NullableRepository_template_repository) GetId()(*int32) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +func (m *NullableRepository_template_repository) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +func (m *NullableRepository_template_repository) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +func (m *NullableRepository_template_repository) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. The is_template property +func (m *NullableRepository_template_repository) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +func (m *NullableRepository_template_repository) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +func (m *NullableRepository_template_repository) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +func (m *NullableRepository_template_repository) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +func (m *NullableRepository_template_repository) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetMergeCommitMessage gets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +func (m *NullableRepository_template_repository) GetMergeCommitMessage()(*NullableRepository_template_repository_merge_commit_message) { + return m.merge_commit_message +} +// GetMergeCommitTitle gets the merge_commit_title property value. The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +func (m *NullableRepository_template_repository) GetMergeCommitTitle()(*NullableRepository_template_repository_merge_commit_title) { + return m.merge_commit_title +} +// GetMergesUrl gets the merges_url property value. The merges_url property +func (m *NullableRepository_template_repository) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +func (m *NullableRepository_template_repository) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +func (m *NullableRepository_template_repository) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name property +func (m *NullableRepository_template_repository) GetName()(*string) { + return m.name +} +// GetNetworkCount gets the network_count property value. The network_count property +func (m *NullableRepository_template_repository) GetNetworkCount()(*int32) { + return m.network_count +} +// GetNodeId gets the node_id property value. The node_id property +func (m *NullableRepository_template_repository) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +func (m *NullableRepository_template_repository) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +func (m *NullableRepository_template_repository) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. The owner property +func (m *NullableRepository_template_repository) GetOwner()(NullableRepository_template_repository_ownerable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +func (m *NullableRepository_template_repository) GetPermissions()(NullableRepository_template_repository_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. The private property +func (m *NullableRepository_template_repository) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +func (m *NullableRepository_template_repository) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +func (m *NullableRepository_template_repository) GetPushedAt()(*string) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +func (m *NullableRepository_template_repository) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetSize gets the size property value. The size property +func (m *NullableRepository_template_repository) GetSize()(*int32) { + return m.size +} +// GetSquashMergeCommitMessage gets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +func (m *NullableRepository_template_repository) GetSquashMergeCommitMessage()(*NullableRepository_template_repository_squash_merge_commit_message) { + return m.squash_merge_commit_message +} +// GetSquashMergeCommitTitle gets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +func (m *NullableRepository_template_repository) GetSquashMergeCommitTitle()(*NullableRepository_template_repository_squash_merge_commit_title) { + return m.squash_merge_commit_title +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +func (m *NullableRepository_template_repository) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +func (m *NullableRepository_template_repository) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +func (m *NullableRepository_template_repository) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +func (m *NullableRepository_template_repository) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersCount gets the subscribers_count property value. The subscribers_count property +func (m *NullableRepository_template_repository) GetSubscribersCount()(*int32) { + return m.subscribers_count +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +func (m *NullableRepository_template_repository) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +func (m *NullableRepository_template_repository) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +func (m *NullableRepository_template_repository) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +func (m *NullableRepository_template_repository) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +func (m *NullableRepository_template_repository) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +func (m *NullableRepository_template_repository) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTopics gets the topics property value. The topics property +func (m *NullableRepository_template_repository) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +func (m *NullableRepository_template_repository) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +func (m *NullableRepository_template_repository) GetUpdatedAt()(*string) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +func (m *NullableRepository_template_repository) GetUrl()(*string) { + return m.url +} +// GetUseSquashPrTitleAsDefault gets the use_squash_pr_title_as_default property value. The use_squash_pr_title_as_default property +func (m *NullableRepository_template_repository) GetUseSquashPrTitleAsDefault()(*bool) { + return m.use_squash_pr_title_as_default +} +// GetVisibility gets the visibility property value. The visibility property +func (m *NullableRepository_template_repository) GetVisibility()(*string) { + return m.visibility +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +func (m *NullableRepository_template_repository) GetWatchersCount()(*int32) { + return m.watchers_count +} +// Serialize serializes information the current object +func (m *NullableRepository_template_repository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_update_branch", m.GetAllowUpdateBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + if m.GetMergeCommitMessage() != nil { + cast := (*m.GetMergeCommitMessage()).String() + err := writer.WriteStringValue("merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetMergeCommitTitle() != nil { + cast := (*m.GetMergeCommitTitle()).String() + err := writer.WriteStringValue("merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("network_count", m.GetNetworkCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitMessage() != nil { + cast := (*m.GetSquashMergeCommitMessage()).String() + err := writer.WriteStringValue("squash_merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitTitle() != nil { + cast := (*m.GetSquashMergeCommitTitle()).String() + err := writer.WriteStringValue("squash_merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("subscribers_count", m.GetSubscribersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_squash_pr_title_as_default", m.GetUseSquashPrTitleAsDefault()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + 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 *NullableRepository_template_repository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. The allow_auto_merge property +func (m *NullableRepository_template_repository) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. The allow_merge_commit property +func (m *NullableRepository_template_repository) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. The allow_rebase_merge property +func (m *NullableRepository_template_repository) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. The allow_squash_merge property +func (m *NullableRepository_template_repository) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetAllowUpdateBranch sets the allow_update_branch property value. The allow_update_branch property +func (m *NullableRepository_template_repository) SetAllowUpdateBranch(value *bool)() { + m.allow_update_branch = value +} +// SetArchived sets the archived property value. The archived property +func (m *NullableRepository_template_repository) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *NullableRepository_template_repository) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *NullableRepository_template_repository) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *NullableRepository_template_repository) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *NullableRepository_template_repository) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *NullableRepository_template_repository) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *NullableRepository_template_repository) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *NullableRepository_template_repository) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *NullableRepository_template_repository) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *NullableRepository_template_repository) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *NullableRepository_template_repository) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *NullableRepository_template_repository) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *NullableRepository_template_repository) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default_branch property +func (m *NullableRepository_template_repository) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. The delete_branch_on_merge property +func (m *NullableRepository_template_repository) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *NullableRepository_template_repository) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *NullableRepository_template_repository) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. The disabled property +func (m *NullableRepository_template_repository) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *NullableRepository_template_repository) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *NullableRepository_template_repository) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *NullableRepository_template_repository) SetFork(value *bool)() { + m.fork = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *NullableRepository_template_repository) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *NullableRepository_template_repository) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *NullableRepository_template_repository) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *NullableRepository_template_repository) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *NullableRepository_template_repository) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *NullableRepository_template_repository) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *NullableRepository_template_repository) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDownloads sets the has_downloads property value. The has_downloads property +func (m *NullableRepository_template_repository) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. The has_issues property +func (m *NullableRepository_template_repository) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *NullableRepository_template_repository) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. The has_projects property +func (m *NullableRepository_template_repository) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. The has_wiki property +func (m *NullableRepository_template_repository) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *NullableRepository_template_repository) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *NullableRepository_template_repository) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableRepository_template_repository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *NullableRepository_template_repository) SetId(value *int32)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *NullableRepository_template_repository) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *NullableRepository_template_repository) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *NullableRepository_template_repository) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. The is_template property +func (m *NullableRepository_template_repository) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *NullableRepository_template_repository) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *NullableRepository_template_repository) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *NullableRepository_template_repository) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *NullableRepository_template_repository) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetMergeCommitMessage sets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +func (m *NullableRepository_template_repository) SetMergeCommitMessage(value *NullableRepository_template_repository_merge_commit_message)() { + m.merge_commit_message = value +} +// SetMergeCommitTitle sets the merge_commit_title property value. The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +func (m *NullableRepository_template_repository) SetMergeCommitTitle(value *NullableRepository_template_repository_merge_commit_title)() { + m.merge_commit_title = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *NullableRepository_template_repository) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *NullableRepository_template_repository) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *NullableRepository_template_repository) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name property +func (m *NullableRepository_template_repository) SetName(value *string)() { + m.name = value +} +// SetNetworkCount sets the network_count property value. The network_count property +func (m *NullableRepository_template_repository) SetNetworkCount(value *int32)() { + m.network_count = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableRepository_template_repository) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *NullableRepository_template_repository) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *NullableRepository_template_repository) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. The owner property +func (m *NullableRepository_template_repository) SetOwner(value NullableRepository_template_repository_ownerable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *NullableRepository_template_repository) SetPermissions(value NullableRepository_template_repository_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. The private property +func (m *NullableRepository_template_repository) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *NullableRepository_template_repository) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *NullableRepository_template_repository) SetPushedAt(value *string)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *NullableRepository_template_repository) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetSize sets the size property value. The size property +func (m *NullableRepository_template_repository) SetSize(value *int32)() { + m.size = value +} +// SetSquashMergeCommitMessage sets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +func (m *NullableRepository_template_repository) SetSquashMergeCommitMessage(value *NullableRepository_template_repository_squash_merge_commit_message)() { + m.squash_merge_commit_message = value +} +// SetSquashMergeCommitTitle sets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +func (m *NullableRepository_template_repository) SetSquashMergeCommitTitle(value *NullableRepository_template_repository_squash_merge_commit_title)() { + m.squash_merge_commit_title = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *NullableRepository_template_repository) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *NullableRepository_template_repository) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *NullableRepository_template_repository) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *NullableRepository_template_repository) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersCount sets the subscribers_count property value. The subscribers_count property +func (m *NullableRepository_template_repository) SetSubscribersCount(value *int32)() { + m.subscribers_count = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *NullableRepository_template_repository) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *NullableRepository_template_repository) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *NullableRepository_template_repository) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *NullableRepository_template_repository) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *NullableRepository_template_repository) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *NullableRepository_template_repository) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTopics sets the topics property value. The topics property +func (m *NullableRepository_template_repository) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *NullableRepository_template_repository) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *NullableRepository_template_repository) SetUpdatedAt(value *string)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *NullableRepository_template_repository) SetUrl(value *string)() { + m.url = value +} +// SetUseSquashPrTitleAsDefault sets the use_squash_pr_title_as_default property value. The use_squash_pr_title_as_default property +func (m *NullableRepository_template_repository) SetUseSquashPrTitleAsDefault(value *bool)() { + m.use_squash_pr_title_as_default = value +} +// SetVisibility sets the visibility property value. The visibility property +func (m *NullableRepository_template_repository) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *NullableRepository_template_repository) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// NullableRepository_template_repositoryable +type NullableRepository_template_repositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetAllowUpdateBranch()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*string) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetMergeCommitMessage()(*NullableRepository_template_repository_merge_commit_message) + GetMergeCommitTitle()(*NullableRepository_template_repository_merge_commit_title) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNetworkCount()(*int32) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssuesCount()(*int32) + GetOwner()(NullableRepository_template_repository_ownerable) + GetPermissions()(NullableRepository_template_repository_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*string) + GetReleasesUrl()(*string) + GetSize()(*int32) + GetSquashMergeCommitMessage()(*NullableRepository_template_repository_squash_merge_commit_message) + GetSquashMergeCommitTitle()(*NullableRepository_template_repository_squash_merge_commit_title) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersCount()(*int32) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*string) + GetUrl()(*string) + GetUseSquashPrTitleAsDefault()(*bool) + GetVisibility()(*string) + GetWatchersCount()(*int32) + SetAllowAutoMerge(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetAllowUpdateBranch(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *string)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetMergeCommitMessage(value *NullableRepository_template_repository_merge_commit_message)() + SetMergeCommitTitle(value *NullableRepository_template_repository_merge_commit_title)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNetworkCount(value *int32)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssuesCount(value *int32)() + SetOwner(value NullableRepository_template_repository_ownerable)() + SetPermissions(value NullableRepository_template_repository_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *string)() + SetReleasesUrl(value *string)() + SetSize(value *int32)() + SetSquashMergeCommitMessage(value *NullableRepository_template_repository_squash_merge_commit_message)() + SetSquashMergeCommitTitle(value *NullableRepository_template_repository_squash_merge_commit_title)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersCount(value *int32)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *string)() + SetUrl(value *string)() + SetUseSquashPrTitleAsDefault(value *bool)() + SetVisibility(value *string)() + SetWatchersCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_merge_commit_message.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_merge_commit_message.go new file mode 100644 index 000000000..09cdd7842 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_merge_commit_message.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +type NullableRepository_template_repository_merge_commit_message int + +const ( + PR_BODY_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_MESSAGE NullableRepository_template_repository_merge_commit_message = iota + PR_TITLE_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_MESSAGE + BLANK_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_MESSAGE +) + +func (i NullableRepository_template_repository_merge_commit_message) String() string { + return []string{"PR_BODY", "PR_TITLE", "BLANK"}[i] +} +func ParseNullableRepository_template_repository_merge_commit_message(v string) (any, error) { + result := PR_BODY_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_MESSAGE + case "PR_TITLE": + result = PR_TITLE_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_MESSAGE + default: + return 0, errors.New("Unknown NullableRepository_template_repository_merge_commit_message value: " + v) + } + return &result, nil +} +func SerializeNullableRepository_template_repository_merge_commit_message(values []NullableRepository_template_repository_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableRepository_template_repository_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_merge_commit_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_merge_commit_title.go new file mode 100644 index 000000000..c354f80c1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_merge_commit_title.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +type NullableRepository_template_repository_merge_commit_title int + +const ( + PR_TITLE_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_TITLE NullableRepository_template_repository_merge_commit_title = iota + MERGE_MESSAGE_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_TITLE +) + +func (i NullableRepository_template_repository_merge_commit_title) String() string { + return []string{"PR_TITLE", "MERGE_MESSAGE"}[i] +} +func ParseNullableRepository_template_repository_merge_commit_title(v string) (any, error) { + result := PR_TITLE_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_TITLE + case "MERGE_MESSAGE": + result = MERGE_MESSAGE_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_TITLE + default: + return 0, errors.New("Unknown NullableRepository_template_repository_merge_commit_title value: " + v) + } + return &result, nil +} +func SerializeNullableRepository_template_repository_merge_commit_title(values []NullableRepository_template_repository_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableRepository_template_repository_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_owner.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_owner.go new file mode 100644 index 000000000..c4bf37f1a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_owner.go @@ -0,0 +1,554 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableRepository_template_repository_owner +type NullableRepository_template_repository_owner struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int32 + // The login property + login *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewNullableRepository_template_repository_owner instantiates a new nullableRepository_template_repository_owner and sets the default values. +func NewNullableRepository_template_repository_owner()(*NullableRepository_template_repository_owner) { + m := &NullableRepository_template_repository_owner{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableRepository_template_repository_ownerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateNullableRepository_template_repository_ownerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableRepository_template_repository_owner(), 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. +func (m *NullableRepository_template_repository_owner) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +func (m *NullableRepository_template_repository_owner) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEventsUrl gets the events_url property value. The events_url property +func (m *NullableRepository_template_repository_owner) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +func (m *NullableRepository_template_repository_owner) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +func (m *NullableRepository_template_repository_owner) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +func (m *NullableRepository_template_repository_owner) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +func (m *NullableRepository_template_repository_owner) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +func (m *NullableRepository_template_repository_owner) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +func (m *NullableRepository_template_repository_owner) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +func (m *NullableRepository_template_repository_owner) GetId()(*int32) { + return m.id +} +// GetLogin gets the login property value. The login property +func (m *NullableRepository_template_repository_owner) GetLogin()(*string) { + return m.login +} +// GetNodeId gets the node_id property value. The node_id property +func (m *NullableRepository_template_repository_owner) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +func (m *NullableRepository_template_repository_owner) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +func (m *NullableRepository_template_repository_owner) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +func (m *NullableRepository_template_repository_owner) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +func (m *NullableRepository_template_repository_owner) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +func (m *NullableRepository_template_repository_owner) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +func (m *NullableRepository_template_repository_owner) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +func (m *NullableRepository_template_repository_owner) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +func (m *NullableRepository_template_repository_owner) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *NullableRepository_template_repository_owner) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *NullableRepository_template_repository_owner) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *NullableRepository_template_repository_owner) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *NullableRepository_template_repository_owner) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *NullableRepository_template_repository_owner) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *NullableRepository_template_repository_owner) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *NullableRepository_template_repository_owner) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *NullableRepository_template_repository_owner) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableRepository_template_repository_owner) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *NullableRepository_template_repository_owner) SetId(value *int32)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *NullableRepository_template_repository_owner) SetLogin(value *string)() { + m.login = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableRepository_template_repository_owner) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *NullableRepository_template_repository_owner) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *NullableRepository_template_repository_owner) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *NullableRepository_template_repository_owner) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *NullableRepository_template_repository_owner) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *NullableRepository_template_repository_owner) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *NullableRepository_template_repository_owner) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *NullableRepository_template_repository_owner) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *NullableRepository_template_repository_owner) SetUrl(value *string)() { + m.url = value +} +// NullableRepository_template_repository_ownerable +type NullableRepository_template_repository_ownerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLogin()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLogin(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_permissions.go new file mode 100644 index 000000000..95973cb93 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_permissions.go @@ -0,0 +1,190 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableRepository_template_repository_permissions +type NullableRepository_template_repository_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewNullableRepository_template_repository_permissions instantiates a new nullableRepository_template_repository_permissions and sets the default values. +func NewNullableRepository_template_repository_permissions()(*NullableRepository_template_repository_permissions) { + m := &NullableRepository_template_repository_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableRepository_template_repository_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateNullableRepository_template_repository_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableRepository_template_repository_permissions(), 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. +func (m *NullableRepository_template_repository_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +func (m *NullableRepository_template_repository_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +func (m *NullableRepository_template_repository_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +func (m *NullableRepository_template_repository_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +func (m *NullableRepository_template_repository_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +func (m *NullableRepository_template_repository_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +func (m *NullableRepository_template_repository_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *NullableRepository_template_repository_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *NullableRepository_template_repository_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *NullableRepository_template_repository_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *NullableRepository_template_repository_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *NullableRepository_template_repository_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *NullableRepository_template_repository_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *NullableRepository_template_repository_permissions) SetTriage(value *bool)() { + m.triage = value +} +// NullableRepository_template_repository_permissionsable +type NullableRepository_template_repository_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_squash_merge_commit_message.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_squash_merge_commit_message.go new file mode 100644 index 000000000..695bb178d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_squash_merge_commit_message.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +type NullableRepository_template_repository_squash_merge_commit_message int + +const ( + PR_BODY_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE NullableRepository_template_repository_squash_merge_commit_message = iota + COMMIT_MESSAGES_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + BLANK_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE +) + +func (i NullableRepository_template_repository_squash_merge_commit_message) String() string { + return []string{"PR_BODY", "COMMIT_MESSAGES", "BLANK"}[i] +} +func ParseNullableRepository_template_repository_squash_merge_commit_message(v string) (any, error) { + result := PR_BODY_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + case "COMMIT_MESSAGES": + result = COMMIT_MESSAGES_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + default: + return 0, errors.New("Unknown NullableRepository_template_repository_squash_merge_commit_message value: " + v) + } + return &result, nil +} +func SerializeNullableRepository_template_repository_squash_merge_commit_message(values []NullableRepository_template_repository_squash_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableRepository_template_repository_squash_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_squash_merge_commit_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_squash_merge_commit_title.go new file mode 100644 index 000000000..5c0f3bd0b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_repository_template_repository_squash_merge_commit_title.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +type NullableRepository_template_repository_squash_merge_commit_title int + +const ( + PR_TITLE_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE NullableRepository_template_repository_squash_merge_commit_title = iota + COMMIT_OR_PR_TITLE_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE +) + +func (i NullableRepository_template_repository_squash_merge_commit_title) String() string { + return []string{"PR_TITLE", "COMMIT_OR_PR_TITLE"}[i] +} +func ParseNullableRepository_template_repository_squash_merge_commit_title(v string) (any, error) { + result := PR_TITLE_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE + case "COMMIT_OR_PR_TITLE": + result = COMMIT_OR_PR_TITLE_NULLABLEREPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE + default: + return 0, errors.New("Unknown NullableRepository_template_repository_squash_merge_commit_title value: " + v) + } + return &result, nil +} +func SerializeNullableRepository_template_repository_squash_merge_commit_title(values []NullableRepository_template_repository_squash_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableRepository_template_repository_squash_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_scoped_installation.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_scoped_installation.go new file mode 100644 index 000000000..774a11c6c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_scoped_installation.go @@ -0,0 +1,261 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type NullableScopedInstallation struct { + // A GitHub user. + account SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The has_multiple_single_files property + has_multiple_single_files *bool + // The permissions granted to the user access token. + permissions AppPermissionsable + // The repositories_url property + repositories_url *string + // Describe whether all repositories have been selected or there's a selection involved + repository_selection *NullableScopedInstallation_repository_selection + // The single_file_name property + single_file_name *string + // The single_file_paths property + single_file_paths []string +} +// NewNullableScopedInstallation instantiates a new NullableScopedInstallation and sets the default values. +func NewNullableScopedInstallation()(*NullableScopedInstallation) { + m := &NullableScopedInstallation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableScopedInstallationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableScopedInstallationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableScopedInstallation(), nil +} +// GetAccount gets the account property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *NullableScopedInstallation) GetAccount()(SimpleUserable) { + return m.account +} +// 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 *NullableScopedInstallation) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableScopedInstallation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["account"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAccount(val.(SimpleUserable)) + } + return nil + } + res["has_multiple_single_files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasMultipleSingleFiles(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAppPermissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(AppPermissionsable)) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["repository_selection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableScopedInstallation_repository_selection) + if err != nil { + return err + } + if val != nil { + m.SetRepositorySelection(val.(*NullableScopedInstallation_repository_selection)) + } + return nil + } + res["single_file_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSingleFileName(val) + } + return nil + } + res["single_file_paths"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetSingleFilePaths(res) + } + return nil + } + return res +} +// GetHasMultipleSingleFiles gets the has_multiple_single_files property value. The has_multiple_single_files property +// returns a *bool when successful +func (m *NullableScopedInstallation) GetHasMultipleSingleFiles()(*bool) { + return m.has_multiple_single_files +} +// GetPermissions gets the permissions property value. The permissions granted to the user access token. +// returns a AppPermissionsable when successful +func (m *NullableScopedInstallation) GetPermissions()(AppPermissionsable) { + return m.permissions +} +// GetRepositoriesUrl gets the repositories_url property value. The repositories_url property +// returns a *string when successful +func (m *NullableScopedInstallation) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetRepositorySelection gets the repository_selection property value. Describe whether all repositories have been selected or there's a selection involved +// returns a *NullableScopedInstallation_repository_selection when successful +func (m *NullableScopedInstallation) GetRepositorySelection()(*NullableScopedInstallation_repository_selection) { + return m.repository_selection +} +// GetSingleFileName gets the single_file_name property value. The single_file_name property +// returns a *string when successful +func (m *NullableScopedInstallation) GetSingleFileName()(*string) { + return m.single_file_name +} +// GetSingleFilePaths gets the single_file_paths property value. The single_file_paths property +// returns a []string when successful +func (m *NullableScopedInstallation) GetSingleFilePaths()([]string) { + return m.single_file_paths +} +// Serialize serializes information the current object +func (m *NullableScopedInstallation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("account", m.GetAccount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_multiple_single_files", m.GetHasMultipleSingleFiles()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + if m.GetRepositorySelection() != nil { + cast := (*m.GetRepositorySelection()).String() + err := writer.WriteStringValue("repository_selection", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("single_file_name", m.GetSingleFileName()) + if err != nil { + return err + } + } + if m.GetSingleFilePaths() != nil { + err := writer.WriteCollectionOfStringValues("single_file_paths", m.GetSingleFilePaths()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccount sets the account property value. A GitHub user. +func (m *NullableScopedInstallation) SetAccount(value SimpleUserable)() { + m.account = value +} +// 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 *NullableScopedInstallation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHasMultipleSingleFiles sets the has_multiple_single_files property value. The has_multiple_single_files property +func (m *NullableScopedInstallation) SetHasMultipleSingleFiles(value *bool)() { + m.has_multiple_single_files = value +} +// SetPermissions sets the permissions property value. The permissions granted to the user access token. +func (m *NullableScopedInstallation) SetPermissions(value AppPermissionsable)() { + m.permissions = value +} +// SetRepositoriesUrl sets the repositories_url property value. The repositories_url property +func (m *NullableScopedInstallation) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetRepositorySelection sets the repository_selection property value. Describe whether all repositories have been selected or there's a selection involved +func (m *NullableScopedInstallation) SetRepositorySelection(value *NullableScopedInstallation_repository_selection)() { + m.repository_selection = value +} +// SetSingleFileName sets the single_file_name property value. The single_file_name property +func (m *NullableScopedInstallation) SetSingleFileName(value *string)() { + m.single_file_name = value +} +// SetSingleFilePaths sets the single_file_paths property value. The single_file_paths property +func (m *NullableScopedInstallation) SetSingleFilePaths(value []string)() { + m.single_file_paths = value +} +type NullableScopedInstallationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccount()(SimpleUserable) + GetHasMultipleSingleFiles()(*bool) + GetPermissions()(AppPermissionsable) + GetRepositoriesUrl()(*string) + GetRepositorySelection()(*NullableScopedInstallation_repository_selection) + GetSingleFileName()(*string) + GetSingleFilePaths()([]string) + SetAccount(value SimpleUserable)() + SetHasMultipleSingleFiles(value *bool)() + SetPermissions(value AppPermissionsable)() + SetRepositoriesUrl(value *string)() + SetRepositorySelection(value *NullableScopedInstallation_repository_selection)() + SetSingleFileName(value *string)() + SetSingleFilePaths(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_scoped_installation_repository_selection.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_scoped_installation_repository_selection.go new file mode 100644 index 000000000..393459a9b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_scoped_installation_repository_selection.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// Describe whether all repositories have been selected or there's a selection involved +type NullableScopedInstallation_repository_selection int + +const ( + ALL_NULLABLESCOPEDINSTALLATION_REPOSITORY_SELECTION NullableScopedInstallation_repository_selection = iota + SELECTED_NULLABLESCOPEDINSTALLATION_REPOSITORY_SELECTION +) + +func (i NullableScopedInstallation_repository_selection) String() string { + return []string{"all", "selected"}[i] +} +func ParseNullableScopedInstallation_repository_selection(v string) (any, error) { + result := ALL_NULLABLESCOPEDINSTALLATION_REPOSITORY_SELECTION + switch v { + case "all": + result = ALL_NULLABLESCOPEDINSTALLATION_REPOSITORY_SELECTION + case "selected": + result = SELECTED_NULLABLESCOPEDINSTALLATION_REPOSITORY_SELECTION + default: + return 0, errors.New("Unknown NullableScopedInstallation_repository_selection value: " + v) + } + return &result, nil +} +func SerializeNullableScopedInstallation_repository_selection(values []NullableScopedInstallation_repository_selection) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableScopedInstallation_repository_selection) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_simple_commit.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_simple_commit.go new file mode 100644 index 000000000..0071232bc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_simple_commit.go @@ -0,0 +1,227 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableSimpleCommit a commit. +type NullableSimpleCommit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Information about the Git author + author NullableSimpleCommit_authorable + // Information about the Git committer + committer NullableSimpleCommit_committerable + // SHA for the commit + id *string + // Message describing the purpose of the commit + message *string + // Timestamp of the commit + timestamp *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // SHA for the commit's tree + tree_id *string +} +// NewNullableSimpleCommit instantiates a new NullableSimpleCommit and sets the default values. +func NewNullableSimpleCommit()(*NullableSimpleCommit) { + m := &NullableSimpleCommit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableSimpleCommitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableSimpleCommitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableSimpleCommit(), 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 *NullableSimpleCommit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. Information about the Git author +// returns a NullableSimpleCommit_authorable when successful +func (m *NullableSimpleCommit) GetAuthor()(NullableSimpleCommit_authorable) { + return m.author +} +// GetCommitter gets the committer property value. Information about the Git committer +// returns a NullableSimpleCommit_committerable when successful +func (m *NullableSimpleCommit) GetCommitter()(NullableSimpleCommit_committerable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableSimpleCommit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleCommit_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(NullableSimpleCommit_authorable)) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleCommit_committerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(NullableSimpleCommit_committerable)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["timestamp"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetTimestamp(val) + } + return nil + } + res["tree_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreeId(val) + } + return nil + } + return res +} +// GetId gets the id property value. SHA for the commit +// returns a *string when successful +func (m *NullableSimpleCommit) GetId()(*string) { + return m.id +} +// GetMessage gets the message property value. Message describing the purpose of the commit +// returns a *string when successful +func (m *NullableSimpleCommit) GetMessage()(*string) { + return m.message +} +// GetTimestamp gets the timestamp property value. Timestamp of the commit +// returns a *Time when successful +func (m *NullableSimpleCommit) GetTimestamp()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.timestamp +} +// GetTreeId gets the tree_id property value. SHA for the commit's tree +// returns a *string when successful +func (m *NullableSimpleCommit) GetTreeId()(*string) { + return m.tree_id +} +// Serialize serializes information the current object +func (m *NullableSimpleCommit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("timestamp", m.GetTimestamp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tree_id", m.GetTreeId()) + 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 *NullableSimpleCommit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. Information about the Git author +func (m *NullableSimpleCommit) SetAuthor(value NullableSimpleCommit_authorable)() { + m.author = value +} +// SetCommitter sets the committer property value. Information about the Git committer +func (m *NullableSimpleCommit) SetCommitter(value NullableSimpleCommit_committerable)() { + m.committer = value +} +// SetId sets the id property value. SHA for the commit +func (m *NullableSimpleCommit) SetId(value *string)() { + m.id = value +} +// SetMessage sets the message property value. Message describing the purpose of the commit +func (m *NullableSimpleCommit) SetMessage(value *string)() { + m.message = value +} +// SetTimestamp sets the timestamp property value. Timestamp of the commit +func (m *NullableSimpleCommit) SetTimestamp(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.timestamp = value +} +// SetTreeId sets the tree_id property value. SHA for the commit's tree +func (m *NullableSimpleCommit) SetTreeId(value *string)() { + m.tree_id = value +} +type NullableSimpleCommitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(NullableSimpleCommit_authorable) + GetCommitter()(NullableSimpleCommit_committerable) + GetId()(*string) + GetMessage()(*string) + GetTimestamp()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetTreeId()(*string) + SetAuthor(value NullableSimpleCommit_authorable)() + SetCommitter(value NullableSimpleCommit_committerable)() + SetId(value *string)() + SetMessage(value *string)() + SetTimestamp(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetTreeId(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_simple_commit_author.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_simple_commit_author.go new file mode 100644 index 000000000..2fc6105bb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_simple_commit_author.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableSimpleCommit_author information about the Git author +type NullableSimpleCommit_author struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Git email address of the commit's author + email *string + // Name of the commit's author + name *string +} +// NewNullableSimpleCommit_author instantiates a new NullableSimpleCommit_author and sets the default values. +func NewNullableSimpleCommit_author()(*NullableSimpleCommit_author) { + m := &NullableSimpleCommit_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableSimpleCommit_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableSimpleCommit_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableSimpleCommit_author(), 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 *NullableSimpleCommit_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. Git email address of the commit's author +// returns a *string when successful +func (m *NullableSimpleCommit_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableSimpleCommit_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. Name of the commit's author +// returns a *string when successful +func (m *NullableSimpleCommit_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *NullableSimpleCommit_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *NullableSimpleCommit_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. Git email address of the commit's author +func (m *NullableSimpleCommit_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. Name of the commit's author +func (m *NullableSimpleCommit_author) SetName(value *string)() { + m.name = value +} +type NullableSimpleCommit_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetName()(*string) + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_simple_commit_committer.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_simple_commit_committer.go new file mode 100644 index 000000000..45c96b857 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_simple_commit_committer.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableSimpleCommit_committer information about the Git committer +type NullableSimpleCommit_committer struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Git email address of the commit's committer + email *string + // Name of the commit's committer + name *string +} +// NewNullableSimpleCommit_committer instantiates a new NullableSimpleCommit_committer and sets the default values. +func NewNullableSimpleCommit_committer()(*NullableSimpleCommit_committer) { + m := &NullableSimpleCommit_committer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableSimpleCommit_committerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableSimpleCommit_committerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableSimpleCommit_committer(), 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 *NullableSimpleCommit_committer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. Git email address of the commit's committer +// returns a *string when successful +func (m *NullableSimpleCommit_committer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableSimpleCommit_committer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. Name of the commit's committer +// returns a *string when successful +func (m *NullableSimpleCommit_committer) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *NullableSimpleCommit_committer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *NullableSimpleCommit_committer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. Git email address of the commit's committer +func (m *NullableSimpleCommit_committer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. Name of the commit's committer +func (m *NullableSimpleCommit_committer) SetName(value *string)() { + m.name = value +} +type NullableSimpleCommit_committerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetName()(*string) + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_simple_user.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_simple_user.go new file mode 100644 index 000000000..2ccb4d3c4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_simple_user.go @@ -0,0 +1,661 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableSimpleUser a GitHub user. +type NullableSimpleUser struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The email property + email *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int64 + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_at property + starred_at *string + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewNullableSimpleUser instantiates a new NullableSimpleUser and sets the default values. +func NewNullableSimpleUser()(*NullableSimpleUser) { + m := &NullableSimpleUser{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableSimpleUserFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableSimpleUserFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableSimpleUser(), 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 *NullableSimpleUser) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *NullableSimpleUser) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableSimpleUser) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredAt(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *NullableSimpleUser) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *NullableSimpleUser) GetId()(*int64) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *NullableSimpleUser) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *NullableSimpleUser) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableSimpleUser) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *NullableSimpleUser) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredAt gets the starred_at property value. The starred_at property +// returns a *string when successful +func (m *NullableSimpleUser) GetStarredAt()(*string) { + return m.starred_at +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *NullableSimpleUser) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableSimpleUser) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *NullableSimpleUser) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_at", m.GetStarredAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *NullableSimpleUser) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *NullableSimpleUser) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEmail sets the email property value. The email property +func (m *NullableSimpleUser) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *NullableSimpleUser) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *NullableSimpleUser) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *NullableSimpleUser) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *NullableSimpleUser) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *NullableSimpleUser) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableSimpleUser) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *NullableSimpleUser) SetId(value *int64)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *NullableSimpleUser) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *NullableSimpleUser) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableSimpleUser) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *NullableSimpleUser) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *NullableSimpleUser) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *NullableSimpleUser) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *NullableSimpleUser) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredAt sets the starred_at property value. The starred_at property +func (m *NullableSimpleUser) SetStarredAt(value *string)() { + m.starred_at = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *NullableSimpleUser) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *NullableSimpleUser) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *NullableSimpleUser) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *NullableSimpleUser) SetUrl(value *string)() { + m.url = value +} +type NullableSimpleUserable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredAt()(*string) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredAt(value *string)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_team_simple.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_team_simple.go new file mode 100644 index 000000000..7a4e86f5e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/nullable_team_simple.go @@ -0,0 +1,429 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableTeamSimple groups of organization members that gives permissions on specified repositories. +type NullableTeamSimple struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Description of the team + description *string + // The html_url property + html_url *string + // Unique identifier of the team + id *int32 + // Distinguished Name (DN) that team maps to within LDAP environment + ldap_dn *string + // The members_url property + members_url *string + // Name of the team + name *string + // The node_id property + node_id *string + // The notification setting the team has set + notification_setting *string + // Permission that the team will have for its repositories + permission *string + // The level of privacy this team should have + privacy *string + // The repositories_url property + repositories_url *string + // The slug property + slug *string + // URL for the team + url *string +} +// NewNullableTeamSimple instantiates a new NullableTeamSimple and sets the default values. +func NewNullableTeamSimple()(*NullableTeamSimple) { + m := &NullableTeamSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableTeamSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableTeamSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableTeamSimple(), 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 *NullableTeamSimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. Description of the team +// returns a *string when successful +func (m *NullableTeamSimple) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableTeamSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["ldap_dn"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLdapDn(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notification_setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationSetting(val) + } + return nil + } + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + res["privacy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivacy(val) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableTeamSimple) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the team +// returns a *int32 when successful +func (m *NullableTeamSimple) GetId()(*int32) { + return m.id +} +// GetLdapDn gets the ldap_dn property value. Distinguished Name (DN) that team maps to within LDAP environment +// returns a *string when successful +func (m *NullableTeamSimple) GetLdapDn()(*string) { + return m.ldap_dn +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *NullableTeamSimple) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. Name of the team +// returns a *string when successful +func (m *NullableTeamSimple) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableTeamSimple) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationSetting gets the notification_setting property value. The notification setting the team has set +// returns a *string when successful +func (m *NullableTeamSimple) GetNotificationSetting()(*string) { + return m.notification_setting +} +// GetPermission gets the permission property value. Permission that the team will have for its repositories +// returns a *string when successful +func (m *NullableTeamSimple) GetPermission()(*string) { + return m.permission +} +// GetPrivacy gets the privacy property value. The level of privacy this team should have +// returns a *string when successful +func (m *NullableTeamSimple) GetPrivacy()(*string) { + return m.privacy +} +// GetRepositoriesUrl gets the repositories_url property value. The repositories_url property +// returns a *string when successful +func (m *NullableTeamSimple) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetSlug gets the slug property value. The slug property +// returns a *string when successful +func (m *NullableTeamSimple) GetSlug()(*string) { + return m.slug +} +// GetUrl gets the url property value. URL for the team +// returns a *string when successful +func (m *NullableTeamSimple) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *NullableTeamSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ldap_dn", m.GetLdapDn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notification_setting", m.GetNotificationSetting()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("permission", m.GetPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("privacy", m.GetPrivacy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *NullableTeamSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. Description of the team +func (m *NullableTeamSimple) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableTeamSimple) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the team +func (m *NullableTeamSimple) SetId(value *int32)() { + m.id = value +} +// SetLdapDn sets the ldap_dn property value. Distinguished Name (DN) that team maps to within LDAP environment +func (m *NullableTeamSimple) SetLdapDn(value *string)() { + m.ldap_dn = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *NullableTeamSimple) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. Name of the team +func (m *NullableTeamSimple) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableTeamSimple) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationSetting sets the notification_setting property value. The notification setting the team has set +func (m *NullableTeamSimple) SetNotificationSetting(value *string)() { + m.notification_setting = value +} +// SetPermission sets the permission property value. Permission that the team will have for its repositories +func (m *NullableTeamSimple) SetPermission(value *string)() { + m.permission = value +} +// SetPrivacy sets the privacy property value. The level of privacy this team should have +func (m *NullableTeamSimple) SetPrivacy(value *string)() { + m.privacy = value +} +// SetRepositoriesUrl sets the repositories_url property value. The repositories_url property +func (m *NullableTeamSimple) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetSlug sets the slug property value. The slug property +func (m *NullableTeamSimple) SetSlug(value *string)() { + m.slug = value +} +// SetUrl sets the url property value. URL for the team +func (m *NullableTeamSimple) SetUrl(value *string)() { + m.url = value +} +type NullableTeamSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLdapDn()(*string) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationSetting()(*string) + GetPermission()(*string) + GetPrivacy()(*string) + GetRepositoriesUrl()(*string) + GetSlug()(*string) + GetUrl()(*string) + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLdapDn(value *string)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationSetting(value *string)() + SetPermission(value *string)() + SetPrivacy(value *string)() + SetRepositoriesUrl(value *string)() + SetSlug(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/oidc_custom_sub.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/oidc_custom_sub.go new file mode 100644 index 000000000..961b84520 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/oidc_custom_sub.go @@ -0,0 +1,87 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OidcCustomSub actions OIDC Subject customization +type OidcCustomSub struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. + include_claim_keys []string +} +// NewOidcCustomSub instantiates a new OidcCustomSub and sets the default values. +func NewOidcCustomSub()(*OidcCustomSub) { + m := &OidcCustomSub{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOidcCustomSubFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOidcCustomSubFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOidcCustomSub(), 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 *OidcCustomSub) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OidcCustomSub) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["include_claim_keys"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetIncludeClaimKeys(res) + } + return nil + } + return res +} +// GetIncludeClaimKeys gets the include_claim_keys property value. Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. +// returns a []string when successful +func (m *OidcCustomSub) GetIncludeClaimKeys()([]string) { + return m.include_claim_keys +} +// Serialize serializes information the current object +func (m *OidcCustomSub) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIncludeClaimKeys() != nil { + err := writer.WriteCollectionOfStringValues("include_claim_keys", m.GetIncludeClaimKeys()) + 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 *OidcCustomSub) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncludeClaimKeys sets the include_claim_keys property value. Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. +func (m *OidcCustomSub) SetIncludeClaimKeys(value []string)() { + m.include_claim_keys = value +} +type OidcCustomSubable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncludeClaimKeys()([]string) + SetIncludeClaimKeys(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/oidc_custom_sub_repo.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/oidc_custom_sub_repo.go new file mode 100644 index 000000000..69a46fe0d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/oidc_custom_sub_repo.go @@ -0,0 +1,116 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OidcCustomSubRepo actions OIDC subject customization for a repository +type OidcCustomSubRepo struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. + include_claim_keys []string + // Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. + use_default *bool +} +// NewOidcCustomSubRepo instantiates a new OidcCustomSubRepo and sets the default values. +func NewOidcCustomSubRepo()(*OidcCustomSubRepo) { + m := &OidcCustomSubRepo{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOidcCustomSubRepoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOidcCustomSubRepoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOidcCustomSubRepo(), 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 *OidcCustomSubRepo) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OidcCustomSubRepo) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["include_claim_keys"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetIncludeClaimKeys(res) + } + return nil + } + res["use_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseDefault(val) + } + return nil + } + return res +} +// GetIncludeClaimKeys gets the include_claim_keys property value. Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. +// returns a []string when successful +func (m *OidcCustomSubRepo) GetIncludeClaimKeys()([]string) { + return m.include_claim_keys +} +// GetUseDefault gets the use_default property value. Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. +// returns a *bool when successful +func (m *OidcCustomSubRepo) GetUseDefault()(*bool) { + return m.use_default +} +// Serialize serializes information the current object +func (m *OidcCustomSubRepo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIncludeClaimKeys() != nil { + err := writer.WriteCollectionOfStringValues("include_claim_keys", m.GetIncludeClaimKeys()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_default", m.GetUseDefault()) + 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 *OidcCustomSubRepo) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncludeClaimKeys sets the include_claim_keys property value. Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. +func (m *OidcCustomSubRepo) SetIncludeClaimKeys(value []string)() { + m.include_claim_keys = value +} +// SetUseDefault sets the use_default property value. Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. +func (m *OidcCustomSubRepo) SetUseDefault(value *bool)() { + m.use_default = value +} +type OidcCustomSubRepoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncludeClaimKeys()([]string) + GetUseDefault()(*bool) + SetIncludeClaimKeys(value []string)() + SetUseDefault(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/org_custom_property.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_custom_property.go new file mode 100644 index 000000000..24d49e4b8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_custom_property.go @@ -0,0 +1,334 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrgCustomProperty custom property defined on an organization +type OrgCustomProperty struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // An ordered list of the allowed values of the property.The property can have up to 200 allowed values. + allowed_values []string + // Default value of the property + default_value OrgCustomProperty_OrgCustomProperty_default_valueable + // Short description of the property + description *string + // The name of the property + property_name *string + // Whether the property is required. + required *bool + // The type of the value for the property + value_type *OrgCustomProperty_value_type + // Who can edit the values of the property + values_editable_by *OrgCustomProperty_values_editable_by +} +// OrgCustomProperty_OrgCustomProperty_default_value composed type wrapper for classes string +type OrgCustomProperty_OrgCustomProperty_default_value struct { + // Composed type representation for type string + string *string +} +// NewOrgCustomProperty_OrgCustomProperty_default_value instantiates a new OrgCustomProperty_OrgCustomProperty_default_value and sets the default values. +func NewOrgCustomProperty_OrgCustomProperty_default_value()(*OrgCustomProperty_OrgCustomProperty_default_value) { + m := &OrgCustomProperty_OrgCustomProperty_default_value{ + } + return m +} +// CreateOrgCustomProperty_OrgCustomProperty_default_valueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrgCustomProperty_OrgCustomProperty_default_valueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewOrgCustomProperty_OrgCustomProperty_default_value() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrgCustomProperty_OrgCustomProperty_default_value) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *OrgCustomProperty_OrgCustomProperty_default_value) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *OrgCustomProperty_OrgCustomProperty_default_value) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *OrgCustomProperty_OrgCustomProperty_default_value) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetString sets the string property value. Composed type representation for type string +func (m *OrgCustomProperty_OrgCustomProperty_default_value) SetString(value *string)() { + m.string = value +} +type OrgCustomProperty_OrgCustomProperty_default_valueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetString()(*string) + SetString(value *string)() +} +// NewOrgCustomProperty instantiates a new OrgCustomProperty and sets the default values. +func NewOrgCustomProperty()(*OrgCustomProperty) { + m := &OrgCustomProperty{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrgCustomPropertyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrgCustomPropertyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrgCustomProperty(), 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 *OrgCustomProperty) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowedValues gets the allowed_values property value. An ordered list of the allowed values of the property.The property can have up to 200 allowed values. +// returns a []string when successful +func (m *OrgCustomProperty) GetAllowedValues()([]string) { + return m.allowed_values +} +// GetDefaultValue gets the default_value property value. Default value of the property +// returns a OrgCustomProperty_OrgCustomProperty_default_valueable when successful +func (m *OrgCustomProperty) GetDefaultValue()(OrgCustomProperty_OrgCustomProperty_default_valueable) { + return m.default_value +} +// GetDescription gets the description property value. Short description of the property +// returns a *string when successful +func (m *OrgCustomProperty) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrgCustomProperty) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allowed_values"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetAllowedValues(res) + } + return nil + } + res["default_value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrgCustomProperty_OrgCustomProperty_default_valueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDefaultValue(val.(OrgCustomProperty_OrgCustomProperty_default_valueable)) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["property_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPropertyName(val) + } + return nil + } + res["required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequired(val) + } + return nil + } + res["value_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrgCustomProperty_value_type) + if err != nil { + return err + } + if val != nil { + m.SetValueType(val.(*OrgCustomProperty_value_type)) + } + return nil + } + res["values_editable_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrgCustomProperty_values_editable_by) + if err != nil { + return err + } + if val != nil { + m.SetValuesEditableBy(val.(*OrgCustomProperty_values_editable_by)) + } + return nil + } + return res +} +// GetPropertyName gets the property_name property value. The name of the property +// returns a *string when successful +func (m *OrgCustomProperty) GetPropertyName()(*string) { + return m.property_name +} +// GetRequired gets the required property value. Whether the property is required. +// returns a *bool when successful +func (m *OrgCustomProperty) GetRequired()(*bool) { + return m.required +} +// GetValuesEditableBy gets the values_editable_by property value. Who can edit the values of the property +// returns a *OrgCustomProperty_values_editable_by when successful +func (m *OrgCustomProperty) GetValuesEditableBy()(*OrgCustomProperty_values_editable_by) { + return m.values_editable_by +} +// GetValueType gets the value_type property value. The type of the value for the property +// returns a *OrgCustomProperty_value_type when successful +func (m *OrgCustomProperty) GetValueType()(*OrgCustomProperty_value_type) { + return m.value_type +} +// Serialize serializes information the current object +func (m *OrgCustomProperty) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAllowedValues() != nil { + err := writer.WriteCollectionOfStringValues("allowed_values", m.GetAllowedValues()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("default_value", m.GetDefaultValue()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("property_name", m.GetPropertyName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("required", m.GetRequired()) + if err != nil { + return err + } + } + if m.GetValuesEditableBy() != nil { + cast := (*m.GetValuesEditableBy()).String() + err := writer.WriteStringValue("values_editable_by", &cast) + if err != nil { + return err + } + } + if m.GetValueType() != nil { + cast := (*m.GetValueType()).String() + err := writer.WriteStringValue("value_type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *OrgCustomProperty) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowedValues sets the allowed_values property value. An ordered list of the allowed values of the property.The property can have up to 200 allowed values. +func (m *OrgCustomProperty) SetAllowedValues(value []string)() { + m.allowed_values = value +} +// SetDefaultValue sets the default_value property value. Default value of the property +func (m *OrgCustomProperty) SetDefaultValue(value OrgCustomProperty_OrgCustomProperty_default_valueable)() { + m.default_value = value +} +// SetDescription sets the description property value. Short description of the property +func (m *OrgCustomProperty) SetDescription(value *string)() { + m.description = value +} +// SetPropertyName sets the property_name property value. The name of the property +func (m *OrgCustomProperty) SetPropertyName(value *string)() { + m.property_name = value +} +// SetRequired sets the required property value. Whether the property is required. +func (m *OrgCustomProperty) SetRequired(value *bool)() { + m.required = value +} +// SetValuesEditableBy sets the values_editable_by property value. Who can edit the values of the property +func (m *OrgCustomProperty) SetValuesEditableBy(value *OrgCustomProperty_values_editable_by)() { + m.values_editable_by = value +} +// SetValueType sets the value_type property value. The type of the value for the property +func (m *OrgCustomProperty) SetValueType(value *OrgCustomProperty_value_type)() { + m.value_type = value +} +type OrgCustomPropertyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowedValues()([]string) + GetDefaultValue()(OrgCustomProperty_OrgCustomProperty_default_valueable) + GetDescription()(*string) + GetPropertyName()(*string) + GetRequired()(*bool) + GetValuesEditableBy()(*OrgCustomProperty_values_editable_by) + GetValueType()(*OrgCustomProperty_value_type) + SetAllowedValues(value []string)() + SetDefaultValue(value OrgCustomProperty_OrgCustomProperty_default_valueable)() + SetDescription(value *string)() + SetPropertyName(value *string)() + SetRequired(value *bool)() + SetValuesEditableBy(value *OrgCustomProperty_values_editable_by)() + SetValueType(value *OrgCustomProperty_value_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/org_custom_property_value_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_custom_property_value_type.go new file mode 100644 index 000000000..7ad5c0cea --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_custom_property_value_type.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The type of the value for the property +type OrgCustomProperty_value_type int + +const ( + STRING_ORGCUSTOMPROPERTY_VALUE_TYPE OrgCustomProperty_value_type = iota + SINGLE_SELECT_ORGCUSTOMPROPERTY_VALUE_TYPE + MULTI_SELECT_ORGCUSTOMPROPERTY_VALUE_TYPE + TRUE_FALSE_ORGCUSTOMPROPERTY_VALUE_TYPE +) + +func (i OrgCustomProperty_value_type) String() string { + return []string{"string", "single_select", "multi_select", "true_false"}[i] +} +func ParseOrgCustomProperty_value_type(v string) (any, error) { + result := STRING_ORGCUSTOMPROPERTY_VALUE_TYPE + switch v { + case "string": + result = STRING_ORGCUSTOMPROPERTY_VALUE_TYPE + case "single_select": + result = SINGLE_SELECT_ORGCUSTOMPROPERTY_VALUE_TYPE + case "multi_select": + result = MULTI_SELECT_ORGCUSTOMPROPERTY_VALUE_TYPE + case "true_false": + result = TRUE_FALSE_ORGCUSTOMPROPERTY_VALUE_TYPE + default: + return 0, errors.New("Unknown OrgCustomProperty_value_type value: " + v) + } + return &result, nil +} +func SerializeOrgCustomProperty_value_type(values []OrgCustomProperty_value_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrgCustomProperty_value_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/org_custom_property_values_editable_by.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_custom_property_values_editable_by.go new file mode 100644 index 000000000..a21cfec63 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_custom_property_values_editable_by.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// Who can edit the values of the property +type OrgCustomProperty_values_editable_by int + +const ( + ORG_ACTORS_ORGCUSTOMPROPERTY_VALUES_EDITABLE_BY OrgCustomProperty_values_editable_by = iota + ORG_AND_REPO_ACTORS_ORGCUSTOMPROPERTY_VALUES_EDITABLE_BY +) + +func (i OrgCustomProperty_values_editable_by) String() string { + return []string{"org_actors", "org_and_repo_actors"}[i] +} +func ParseOrgCustomProperty_values_editable_by(v string) (any, error) { + result := ORG_ACTORS_ORGCUSTOMPROPERTY_VALUES_EDITABLE_BY + switch v { + case "org_actors": + result = ORG_ACTORS_ORGCUSTOMPROPERTY_VALUES_EDITABLE_BY + case "org_and_repo_actors": + result = ORG_AND_REPO_ACTORS_ORGCUSTOMPROPERTY_VALUES_EDITABLE_BY + default: + return 0, errors.New("Unknown OrgCustomProperty_values_editable_by value: " + v) + } + return &result, nil +} +func SerializeOrgCustomProperty_values_editable_by(values []OrgCustomProperty_values_editable_by) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrgCustomProperty_values_editable_by) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/org_hook.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_hook.go new file mode 100644 index 000000000..3170ad559 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_hook.go @@ -0,0 +1,378 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrgHook org Hook +type OrgHook struct { + // The active property + active *bool + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The config property + config OrgHook_configable + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The deliveries_url property + deliveries_url *string + // The events property + events []string + // The id property + id *int32 + // The name property + name *string + // The ping_url property + ping_url *string + // The type property + typeEscaped *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewOrgHook instantiates a new OrgHook and sets the default values. +func NewOrgHook()(*OrgHook) { + m := &OrgHook{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrgHookFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrgHookFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrgHook(), nil +} +// GetActive gets the active property value. The active property +// returns a *bool when successful +func (m *OrgHook) GetActive()(*bool) { + return m.active +} +// 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 *OrgHook) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfig gets the config property value. The config property +// returns a OrgHook_configable when successful +func (m *OrgHook) GetConfig()(OrgHook_configable) { + return m.config +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *OrgHook) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDeliveriesUrl gets the deliveries_url property value. The deliveries_url property +// returns a *string when successful +func (m *OrgHook) GetDeliveriesUrl()(*string) { + return m.deliveries_url +} +// GetEvents gets the events property value. The events property +// returns a []string when successful +func (m *OrgHook) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrgHook) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrgHook_configFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfig(val.(OrgHook_configable)) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["deliveries_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeliveriesUrl(val) + } + return nil + } + res["events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetEvents(res) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["ping_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPingUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *OrgHook) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *OrgHook) GetName()(*string) { + return m.name +} +// GetPingUrl gets the ping_url property value. The ping_url property +// returns a *string when successful +func (m *OrgHook) GetPingUrl()(*string) { + return m.ping_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *OrgHook) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *OrgHook) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *OrgHook) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *OrgHook) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("config", m.GetConfig()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deliveries_url", m.GetDeliveriesUrl()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ping_url", m.GetPingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActive sets the active property value. The active property +func (m *OrgHook) SetActive(value *bool)() { + m.active = value +} +// 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 *OrgHook) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfig sets the config property value. The config property +func (m *OrgHook) SetConfig(value OrgHook_configable)() { + m.config = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *OrgHook) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDeliveriesUrl sets the deliveries_url property value. The deliveries_url property +func (m *OrgHook) SetDeliveriesUrl(value *string)() { + m.deliveries_url = value +} +// SetEvents sets the events property value. The events property +func (m *OrgHook) SetEvents(value []string)() { + m.events = value +} +// SetId sets the id property value. The id property +func (m *OrgHook) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *OrgHook) SetName(value *string)() { + m.name = value +} +// SetPingUrl sets the ping_url property value. The ping_url property +func (m *OrgHook) SetPingUrl(value *string)() { + m.ping_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *OrgHook) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *OrgHook) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *OrgHook) SetUrl(value *string)() { + m.url = value +} +type OrgHookable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetConfig()(OrgHook_configable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDeliveriesUrl()(*string) + GetEvents()([]string) + GetId()(*int32) + GetName()(*string) + GetPingUrl()(*string) + GetTypeEscaped()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetActive(value *bool)() + SetConfig(value OrgHook_configable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDeliveriesUrl(value *string)() + SetEvents(value []string)() + SetId(value *int32)() + SetName(value *string)() + SetPingUrl(value *string)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/org_hook_config.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_hook_config.go new file mode 100644 index 000000000..25c1768c7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_hook_config.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrgHook_config struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The content_type property + content_type *string + // The insecure_ssl property + insecure_ssl *string + // The secret property + secret *string + // The url property + url *string +} +// NewOrgHook_config instantiates a new OrgHook_config and sets the default values. +func NewOrgHook_config()(*OrgHook_config) { + m := &OrgHook_config{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrgHook_configFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrgHook_configFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrgHook_config(), 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 *OrgHook_config) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The content_type property +// returns a *string when successful +func (m *OrgHook_config) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrgHook_config) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a *string when successful +func (m *OrgHook_config) GetInsecureSsl()(*string) { + return m.insecure_ssl +} +// GetSecret gets the secret property value. The secret property +// returns a *string when successful +func (m *OrgHook_config) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *OrgHook_config) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *OrgHook_config) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *OrgHook_config) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The content_type property +func (m *OrgHook_config) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *OrgHook_config) SetInsecureSsl(value *string)() { + m.insecure_ssl = value +} +// SetSecret sets the secret property value. The secret property +func (m *OrgHook_config) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The url property +func (m *OrgHook_config) SetUrl(value *string)() { + m.url = value +} +type OrgHook_configable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(*string) + GetSecret()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value *string)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/org_membership.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_membership.go new file mode 100644 index 000000000..e968e928d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_membership.go @@ -0,0 +1,257 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrgMembership org Membership +type OrgMembership struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub organization. + organization OrganizationSimpleable + // The organization_url property + organization_url *string + // The permissions property + permissions OrgMembership_permissionsable + // The user's membership type in the organization. + role *OrgMembership_role + // The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation. + state *OrgMembership_state + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewOrgMembership instantiates a new OrgMembership and sets the default values. +func NewOrgMembership()(*OrgMembership) { + m := &OrgMembership{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrgMembershipFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrgMembershipFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrgMembership(), 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 *OrgMembership) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrgMembership) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrganization(val.(OrganizationSimpleable)) + } + return nil + } + res["organization_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationUrl(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrgMembership_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(OrgMembership_permissionsable)) + } + return nil + } + res["role"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrgMembership_role) + if err != nil { + return err + } + if val != nil { + m.SetRole(val.(*OrgMembership_role)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrgMembership_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*OrgMembership_state)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetOrganization gets the organization property value. A GitHub organization. +// returns a OrganizationSimpleable when successful +func (m *OrgMembership) GetOrganization()(OrganizationSimpleable) { + return m.organization +} +// GetOrganizationUrl gets the organization_url property value. The organization_url property +// returns a *string when successful +func (m *OrgMembership) GetOrganizationUrl()(*string) { + return m.organization_url +} +// GetPermissions gets the permissions property value. The permissions property +// returns a OrgMembership_permissionsable when successful +func (m *OrgMembership) GetPermissions()(OrgMembership_permissionsable) { + return m.permissions +} +// GetRole gets the role property value. The user's membership type in the organization. +// returns a *OrgMembership_role when successful +func (m *OrgMembership) GetRole()(*OrgMembership_role) { + return m.role +} +// GetState gets the state property value. The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation. +// returns a *OrgMembership_state when successful +func (m *OrgMembership) GetState()(*OrgMembership_state) { + return m.state +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *OrgMembership) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *OrgMembership) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *OrgMembership) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("organization", m.GetOrganization()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization_url", m.GetOrganizationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + if m.GetRole() != nil { + cast := (*m.GetRole()).String() + err := writer.WriteStringValue("role", &cast) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *OrgMembership) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetOrganization sets the organization property value. A GitHub organization. +func (m *OrgMembership) SetOrganization(value OrganizationSimpleable)() { + m.organization = value +} +// SetOrganizationUrl sets the organization_url property value. The organization_url property +func (m *OrgMembership) SetOrganizationUrl(value *string)() { + m.organization_url = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *OrgMembership) SetPermissions(value OrgMembership_permissionsable)() { + m.permissions = value +} +// SetRole sets the role property value. The user's membership type in the organization. +func (m *OrgMembership) SetRole(value *OrgMembership_role)() { + m.role = value +} +// SetState sets the state property value. The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation. +func (m *OrgMembership) SetState(value *OrgMembership_state)() { + m.state = value +} +// SetUrl sets the url property value. The url property +func (m *OrgMembership) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *OrgMembership) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type OrgMembershipable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetOrganization()(OrganizationSimpleable) + GetOrganizationUrl()(*string) + GetPermissions()(OrgMembership_permissionsable) + GetRole()(*OrgMembership_role) + GetState()(*OrgMembership_state) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetOrganization(value OrganizationSimpleable)() + SetOrganizationUrl(value *string)() + SetPermissions(value OrgMembership_permissionsable)() + SetRole(value *OrgMembership_role)() + SetState(value *OrgMembership_state)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/org_membership_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_membership_permissions.go new file mode 100644 index 000000000..06dd0bd87 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_membership_permissions.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrgMembership_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The can_create_repository property + can_create_repository *bool +} +// NewOrgMembership_permissions instantiates a new OrgMembership_permissions and sets the default values. +func NewOrgMembership_permissions()(*OrgMembership_permissions) { + m := &OrgMembership_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrgMembership_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrgMembership_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrgMembership_permissions(), 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 *OrgMembership_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCanCreateRepository gets the can_create_repository property value. The can_create_repository property +// returns a *bool when successful +func (m *OrgMembership_permissions) GetCanCreateRepository()(*bool) { + return m.can_create_repository +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrgMembership_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["can_create_repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanCreateRepository(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *OrgMembership_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("can_create_repository", m.GetCanCreateRepository()) + 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 *OrgMembership_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCanCreateRepository sets the can_create_repository property value. The can_create_repository property +func (m *OrgMembership_permissions) SetCanCreateRepository(value *bool)() { + m.can_create_repository = value +} +type OrgMembership_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCanCreateRepository()(*bool) + SetCanCreateRepository(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/org_membership_role.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_membership_role.go new file mode 100644 index 000000000..2626a419e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_membership_role.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The user's membership type in the organization. +type OrgMembership_role int + +const ( + ADMIN_ORGMEMBERSHIP_ROLE OrgMembership_role = iota + MEMBER_ORGMEMBERSHIP_ROLE + BILLING_MANAGER_ORGMEMBERSHIP_ROLE +) + +func (i OrgMembership_role) String() string { + return []string{"admin", "member", "billing_manager"}[i] +} +func ParseOrgMembership_role(v string) (any, error) { + result := ADMIN_ORGMEMBERSHIP_ROLE + switch v { + case "admin": + result = ADMIN_ORGMEMBERSHIP_ROLE + case "member": + result = MEMBER_ORGMEMBERSHIP_ROLE + case "billing_manager": + result = BILLING_MANAGER_ORGMEMBERSHIP_ROLE + default: + return 0, errors.New("Unknown OrgMembership_role value: " + v) + } + return &result, nil +} +func SerializeOrgMembership_role(values []OrgMembership_role) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrgMembership_role) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/org_membership_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_membership_state.go new file mode 100644 index 000000000..d0f4d50c6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_membership_state.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation. +type OrgMembership_state int + +const ( + ACTIVE_ORGMEMBERSHIP_STATE OrgMembership_state = iota + PENDING_ORGMEMBERSHIP_STATE +) + +func (i OrgMembership_state) String() string { + return []string{"active", "pending"}[i] +} +func ParseOrgMembership_state(v string) (any, error) { + result := ACTIVE_ORGMEMBERSHIP_STATE + switch v { + case "active": + result = ACTIVE_ORGMEMBERSHIP_STATE + case "pending": + result = PENDING_ORGMEMBERSHIP_STATE + default: + return 0, errors.New("Unknown OrgMembership_state value: " + v) + } + return &result, nil +} +func SerializeOrgMembership_state(values []OrgMembership_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrgMembership_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/org_repo_custom_property_values.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_repo_custom_property_values.go new file mode 100644 index 000000000..baef3837c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_repo_custom_property_values.go @@ -0,0 +1,180 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrgRepoCustomPropertyValues list of custom property values for a repository +type OrgRepoCustomPropertyValues struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // List of custom property names and associated values + properties []CustomPropertyValueable + // The repository_full_name property + repository_full_name *string + // The repository_id property + repository_id *int32 + // The repository_name property + repository_name *string +} +// NewOrgRepoCustomPropertyValues instantiates a new OrgRepoCustomPropertyValues and sets the default values. +func NewOrgRepoCustomPropertyValues()(*OrgRepoCustomPropertyValues) { + m := &OrgRepoCustomPropertyValues{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrgRepoCustomPropertyValuesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrgRepoCustomPropertyValuesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrgRepoCustomPropertyValues(), 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 *OrgRepoCustomPropertyValues) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrgRepoCustomPropertyValues) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCustomPropertyValueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CustomPropertyValueable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CustomPropertyValueable) + } + } + m.SetProperties(res) + } + return nil + } + res["repository_full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryFullName(val) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + res["repository_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryName(val) + } + return nil + } + return res +} +// GetProperties gets the properties property value. List of custom property names and associated values +// returns a []CustomPropertyValueable when successful +func (m *OrgRepoCustomPropertyValues) GetProperties()([]CustomPropertyValueable) { + return m.properties +} +// GetRepositoryFullName gets the repository_full_name property value. The repository_full_name property +// returns a *string when successful +func (m *OrgRepoCustomPropertyValues) GetRepositoryFullName()(*string) { + return m.repository_full_name +} +// GetRepositoryId gets the repository_id property value. The repository_id property +// returns a *int32 when successful +func (m *OrgRepoCustomPropertyValues) GetRepositoryId()(*int32) { + return m.repository_id +} +// GetRepositoryName gets the repository_name property value. The repository_name property +// returns a *string when successful +func (m *OrgRepoCustomPropertyValues) GetRepositoryName()(*string) { + return m.repository_name +} +// Serialize serializes information the current object +func (m *OrgRepoCustomPropertyValues) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetProperties() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetProperties())) + for i, v := range m.GetProperties() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("properties", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_full_name", m.GetRepositoryFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_name", m.GetRepositoryName()) + 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 *OrgRepoCustomPropertyValues) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetProperties sets the properties property value. List of custom property names and associated values +func (m *OrgRepoCustomPropertyValues) SetProperties(value []CustomPropertyValueable)() { + m.properties = value +} +// SetRepositoryFullName sets the repository_full_name property value. The repository_full_name property +func (m *OrgRepoCustomPropertyValues) SetRepositoryFullName(value *string)() { + m.repository_full_name = value +} +// SetRepositoryId sets the repository_id property value. The repository_id property +func (m *OrgRepoCustomPropertyValues) SetRepositoryId(value *int32)() { + m.repository_id = value +} +// SetRepositoryName sets the repository_name property value. The repository_name property +func (m *OrgRepoCustomPropertyValues) SetRepositoryName(value *string)() { + m.repository_name = value +} +type OrgRepoCustomPropertyValuesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetProperties()([]CustomPropertyValueable) + GetRepositoryFullName()(*string) + GetRepositoryId()(*int32) + GetRepositoryName()(*string) + SetProperties(value []CustomPropertyValueable)() + SetRepositoryFullName(value *string)() + SetRepositoryId(value *int32)() + SetRepositoryName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/org_ruleset_conditions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_ruleset_conditions.go new file mode 100644 index 000000000..c51912ade --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/org_ruleset_conditions.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrgRulesetConditions conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties. +type OrgRulesetConditions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewOrgRulesetConditions instantiates a new OrgRulesetConditions and sets the default values. +func NewOrgRulesetConditions()(*OrgRulesetConditions) { + m := &OrgRulesetConditions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrgRulesetConditionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrgRulesetConditionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrgRulesetConditions(), 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 *OrgRulesetConditions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrgRulesetConditions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *OrgRulesetConditions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *OrgRulesetConditions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type OrgRulesetConditionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization.go new file mode 100644 index 000000000..9f2d69085 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization.go @@ -0,0 +1,894 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Organization gitHub account for managing multiple users, teams, and repositories +type Organization struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // Display blog url for the organization + blog *string + // Display company name for the organization + company *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The description property + description *string + // Display email for the organization + email *string + // The events_url property + events_url *string + // The followers property + followers *int32 + // The following property + following *int32 + // Specifies if organization projects are enabled for this org + has_organization_projects *bool + // Specifies if repository projects are enabled for repositories that belong to this org + has_repository_projects *bool + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The is_verified property + is_verified *bool + // The issues_url property + issues_url *string + // Display location for the organization + location *string + // Unique login name of the organization + login *string + // The members_url property + members_url *string + // Display name for the organization + name *string + // The node_id property + node_id *string + // The plan property + plan Organization_planable + // The public_gists property + public_gists *int32 + // The public_members_url property + public_members_url *string + // The public_repos property + public_repos *int32 + // The repos_url property + repos_url *string + // The type property + typeEscaped *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // URL for the organization + url *string +} +// NewOrganization instantiates a new Organization and sets the default values. +func NewOrganization()(*Organization) { + m := &Organization{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganization(), 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 *Organization) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *Organization) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetBlog gets the blog property value. Display blog url for the organization +// returns a *string when successful +func (m *Organization) GetBlog()(*string) { + return m.blog +} +// GetCompany gets the company property value. Display company name for the organization +// returns a *string when successful +func (m *Organization) GetCompany()(*string) { + return m.company +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Organization) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *Organization) GetDescription()(*string) { + return m.description +} +// GetEmail gets the email property value. Display email for the organization +// returns a *string when successful +func (m *Organization) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *Organization) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Organization) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["blog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlog(val) + } + return nil + } + res["company"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompany(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowers(val) + } + return nil + } + res["following"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowing(val) + } + return nil + } + res["has_organization_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasOrganizationProjects(val) + } + return nil + } + res["has_repository_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasRepositoryProjects(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsVerified(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["plan"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganization_planFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPlan(val.(Organization_planable)) + } + return nil + } + res["public_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicGists(val) + } + return nil + } + res["public_members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicMembersUrl(val) + } + return nil + } + res["public_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicRepos(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowers gets the followers property value. The followers property +// returns a *int32 when successful +func (m *Organization) GetFollowers()(*int32) { + return m.followers +} +// GetFollowing gets the following property value. The following property +// returns a *int32 when successful +func (m *Organization) GetFollowing()(*int32) { + return m.following +} +// GetHasOrganizationProjects gets the has_organization_projects property value. Specifies if organization projects are enabled for this org +// returns a *bool when successful +func (m *Organization) GetHasOrganizationProjects()(*bool) { + return m.has_organization_projects +} +// GetHasRepositoryProjects gets the has_repository_projects property value. Specifies if repository projects are enabled for repositories that belong to this org +// returns a *bool when successful +func (m *Organization) GetHasRepositoryProjects()(*bool) { + return m.has_repository_projects +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *Organization) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Organization) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Organization) GetId()(*int32) { + return m.id +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *Organization) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsVerified gets the is_verified property value. The is_verified property +// returns a *bool when successful +func (m *Organization) GetIsVerified()(*bool) { + return m.is_verified +} +// GetLocation gets the location property value. Display location for the organization +// returns a *string when successful +func (m *Organization) GetLocation()(*string) { + return m.location +} +// GetLogin gets the login property value. Unique login name of the organization +// returns a *string when successful +func (m *Organization) GetLogin()(*string) { + return m.login +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *Organization) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. Display name for the organization +// returns a *string when successful +func (m *Organization) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Organization) GetNodeId()(*string) { + return m.node_id +} +// GetPlan gets the plan property value. The plan property +// returns a Organization_planable when successful +func (m *Organization) GetPlan()(Organization_planable) { + return m.plan +} +// GetPublicGists gets the public_gists property value. The public_gists property +// returns a *int32 when successful +func (m *Organization) GetPublicGists()(*int32) { + return m.public_gists +} +// GetPublicMembersUrl gets the public_members_url property value. The public_members_url property +// returns a *string when successful +func (m *Organization) GetPublicMembersUrl()(*string) { + return m.public_members_url +} +// GetPublicRepos gets the public_repos property value. The public_repos property +// returns a *int32 when successful +func (m *Organization) GetPublicRepos()(*int32) { + return m.public_repos +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *Organization) GetReposUrl()(*string) { + return m.repos_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *Organization) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Organization) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. URL for the organization +// returns a *string when successful +func (m *Organization) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Organization) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blog", m.GetBlog()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("company", m.GetCompany()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("followers", m.GetFollowers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("following", m.GetFollowing()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_organization_projects", m.GetHasOrganizationProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_repository_projects", m.GetHasRepositoryProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_verified", m.GetIsVerified()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("plan", m.GetPlan()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_gists", m.GetPublicGists()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("public_members_url", m.GetPublicMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_repos", m.GetPublicRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Organization) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *Organization) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetBlog sets the blog property value. Display blog url for the organization +func (m *Organization) SetBlog(value *string)() { + m.blog = value +} +// SetCompany sets the company property value. Display company name for the organization +func (m *Organization) SetCompany(value *string)() { + m.company = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Organization) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *Organization) SetDescription(value *string)() { + m.description = value +} +// SetEmail sets the email property value. Display email for the organization +func (m *Organization) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *Organization) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowers sets the followers property value. The followers property +func (m *Organization) SetFollowers(value *int32)() { + m.followers = value +} +// SetFollowing sets the following property value. The following property +func (m *Organization) SetFollowing(value *int32)() { + m.following = value +} +// SetHasOrganizationProjects sets the has_organization_projects property value. Specifies if organization projects are enabled for this org +func (m *Organization) SetHasOrganizationProjects(value *bool)() { + m.has_organization_projects = value +} +// SetHasRepositoryProjects sets the has_repository_projects property value. Specifies if repository projects are enabled for repositories that belong to this org +func (m *Organization) SetHasRepositoryProjects(value *bool)() { + m.has_repository_projects = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *Organization) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Organization) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Organization) SetId(value *int32)() { + m.id = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *Organization) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsVerified sets the is_verified property value. The is_verified property +func (m *Organization) SetIsVerified(value *bool)() { + m.is_verified = value +} +// SetLocation sets the location property value. Display location for the organization +func (m *Organization) SetLocation(value *string)() { + m.location = value +} +// SetLogin sets the login property value. Unique login name of the organization +func (m *Organization) SetLogin(value *string)() { + m.login = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *Organization) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. Display name for the organization +func (m *Organization) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Organization) SetNodeId(value *string)() { + m.node_id = value +} +// SetPlan sets the plan property value. The plan property +func (m *Organization) SetPlan(value Organization_planable)() { + m.plan = value +} +// SetPublicGists sets the public_gists property value. The public_gists property +func (m *Organization) SetPublicGists(value *int32)() { + m.public_gists = value +} +// SetPublicMembersUrl sets the public_members_url property value. The public_members_url property +func (m *Organization) SetPublicMembersUrl(value *string)() { + m.public_members_url = value +} +// SetPublicRepos sets the public_repos property value. The public_repos property +func (m *Organization) SetPublicRepos(value *int32)() { + m.public_repos = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *Organization) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Organization) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Organization) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. URL for the organization +func (m *Organization) SetUrl(value *string)() { + m.url = value +} +type Organizationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetBlog()(*string) + GetCompany()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowers()(*int32) + GetFollowing()(*int32) + GetHasOrganizationProjects()(*bool) + GetHasRepositoryProjects()(*bool) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssuesUrl()(*string) + GetIsVerified()(*bool) + GetLocation()(*string) + GetLogin()(*string) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetPlan()(Organization_planable) + GetPublicGists()(*int32) + GetPublicMembersUrl()(*string) + GetPublicRepos()(*int32) + GetReposUrl()(*string) + GetTypeEscaped()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetBlog(value *string)() + SetCompany(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowers(value *int32)() + SetFollowing(value *int32)() + SetHasOrganizationProjects(value *bool)() + SetHasRepositoryProjects(value *bool)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssuesUrl(value *string)() + SetIsVerified(value *bool)() + SetLocation(value *string)() + SetLogin(value *string)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetPlan(value Organization_planable)() + SetPublicGists(value *int32)() + SetPublicMembersUrl(value *string)() + SetPublicRepos(value *int32)() + SetReposUrl(value *string)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_actions_secret.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_actions_secret.go new file mode 100644 index 000000000..2d290a173 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_actions_secret.go @@ -0,0 +1,199 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationActionsSecret secrets for GitHub Actions for an organization. +type OrganizationActionsSecret struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the secret. + name *string + // The selected_repositories_url property + selected_repositories_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Visibility of a secret + visibility *OrganizationActionsSecret_visibility +} +// NewOrganizationActionsSecret instantiates a new OrganizationActionsSecret and sets the default values. +func NewOrganizationActionsSecret()(*OrganizationActionsSecret) { + m := &OrganizationActionsSecret{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationActionsSecretFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationActionsSecretFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationActionsSecret(), 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 *OrganizationActionsSecret) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *OrganizationActionsSecret) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationActionsSecret) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["selected_repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedRepositoriesUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrganizationActionsSecret_visibility) + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val.(*OrganizationActionsSecret_visibility)) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the secret. +// returns a *string when successful +func (m *OrganizationActionsSecret) GetName()(*string) { + return m.name +} +// GetSelectedRepositoriesUrl gets the selected_repositories_url property value. The selected_repositories_url property +// returns a *string when successful +func (m *OrganizationActionsSecret) GetSelectedRepositoriesUrl()(*string) { + return m.selected_repositories_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *OrganizationActionsSecret) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetVisibility gets the visibility property value. Visibility of a secret +// returns a *OrganizationActionsSecret_visibility when successful +func (m *OrganizationActionsSecret) GetVisibility()(*OrganizationActionsSecret_visibility) { + return m.visibility +} +// Serialize serializes information the current object +func (m *OrganizationActionsSecret) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("selected_repositories_url", m.GetSelectedRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + if m.GetVisibility() != nil { + cast := (*m.GetVisibility()).String() + err := writer.WriteStringValue("visibility", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *OrganizationActionsSecret) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *OrganizationActionsSecret) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetName sets the name property value. The name of the secret. +func (m *OrganizationActionsSecret) SetName(value *string)() { + m.name = value +} +// SetSelectedRepositoriesUrl sets the selected_repositories_url property value. The selected_repositories_url property +func (m *OrganizationActionsSecret) SetSelectedRepositoriesUrl(value *string)() { + m.selected_repositories_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *OrganizationActionsSecret) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetVisibility sets the visibility property value. Visibility of a secret +func (m *OrganizationActionsSecret) SetVisibility(value *OrganizationActionsSecret_visibility)() { + m.visibility = value +} +type OrganizationActionsSecretable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetSelectedRepositoriesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetVisibility()(*OrganizationActionsSecret_visibility) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetSelectedRepositoriesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetVisibility(value *OrganizationActionsSecret_visibility)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_actions_secret_visibility.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_actions_secret_visibility.go new file mode 100644 index 000000000..f4cc988ed --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_actions_secret_visibility.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// Visibility of a secret +type OrganizationActionsSecret_visibility int + +const ( + ALL_ORGANIZATIONACTIONSSECRET_VISIBILITY OrganizationActionsSecret_visibility = iota + PRIVATE_ORGANIZATIONACTIONSSECRET_VISIBILITY + SELECTED_ORGANIZATIONACTIONSSECRET_VISIBILITY +) + +func (i OrganizationActionsSecret_visibility) String() string { + return []string{"all", "private", "selected"}[i] +} +func ParseOrganizationActionsSecret_visibility(v string) (any, error) { + result := ALL_ORGANIZATIONACTIONSSECRET_VISIBILITY + switch v { + case "all": + result = ALL_ORGANIZATIONACTIONSSECRET_VISIBILITY + case "private": + result = PRIVATE_ORGANIZATIONACTIONSSECRET_VISIBILITY + case "selected": + result = SELECTED_ORGANIZATIONACTIONSSECRET_VISIBILITY + default: + return 0, errors.New("Unknown OrganizationActionsSecret_visibility value: " + v) + } + return &result, nil +} +func SerializeOrganizationActionsSecret_visibility(values []OrganizationActionsSecret_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrganizationActionsSecret_visibility) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_actions_variable.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_actions_variable.go new file mode 100644 index 000000000..e38deef08 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_actions_variable.go @@ -0,0 +1,228 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationActionsVariable organization variable for GitHub Actions. +type OrganizationActionsVariable struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The date and time at which the variable was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the variable. + name *string + // The selected_repositories_url property + selected_repositories_url *string + // The date and time at which the variable was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The value of the variable. + value *string + // Visibility of a variable + visibility *OrganizationActionsVariable_visibility +} +// NewOrganizationActionsVariable instantiates a new OrganizationActionsVariable and sets the default values. +func NewOrganizationActionsVariable()(*OrganizationActionsVariable) { + m := &OrganizationActionsVariable{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationActionsVariableFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationActionsVariableFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationActionsVariable(), 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 *OrganizationActionsVariable) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The date and time at which the variable was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +// returns a *Time when successful +func (m *OrganizationActionsVariable) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationActionsVariable) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["selected_repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedRepositoriesUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrganizationActionsVariable_visibility) + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val.(*OrganizationActionsVariable_visibility)) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *OrganizationActionsVariable) GetName()(*string) { + return m.name +} +// GetSelectedRepositoriesUrl gets the selected_repositories_url property value. The selected_repositories_url property +// returns a *string when successful +func (m *OrganizationActionsVariable) GetSelectedRepositoriesUrl()(*string) { + return m.selected_repositories_url +} +// GetUpdatedAt gets the updated_at property value. The date and time at which the variable was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +// returns a *Time when successful +func (m *OrganizationActionsVariable) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *OrganizationActionsVariable) GetValue()(*string) { + return m.value +} +// GetVisibility gets the visibility property value. Visibility of a variable +// returns a *OrganizationActionsVariable_visibility when successful +func (m *OrganizationActionsVariable) GetVisibility()(*OrganizationActionsVariable_visibility) { + return m.visibility +} +// Serialize serializes information the current object +func (m *OrganizationActionsVariable) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("selected_repositories_url", m.GetSelectedRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + if err != nil { + return err + } + } + if m.GetVisibility() != nil { + cast := (*m.GetVisibility()).String() + err := writer.WriteStringValue("visibility", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *OrganizationActionsVariable) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The date and time at which the variable was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +func (m *OrganizationActionsVariable) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetName sets the name property value. The name of the variable. +func (m *OrganizationActionsVariable) SetName(value *string)() { + m.name = value +} +// SetSelectedRepositoriesUrl sets the selected_repositories_url property value. The selected_repositories_url property +func (m *OrganizationActionsVariable) SetSelectedRepositoriesUrl(value *string)() { + m.selected_repositories_url = value +} +// SetUpdatedAt sets the updated_at property value. The date and time at which the variable was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +func (m *OrganizationActionsVariable) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetValue sets the value property value. The value of the variable. +func (m *OrganizationActionsVariable) SetValue(value *string)() { + m.value = value +} +// SetVisibility sets the visibility property value. Visibility of a variable +func (m *OrganizationActionsVariable) SetVisibility(value *OrganizationActionsVariable_visibility)() { + m.visibility = value +} +type OrganizationActionsVariableable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetSelectedRepositoriesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetValue()(*string) + GetVisibility()(*OrganizationActionsVariable_visibility) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetSelectedRepositoriesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetValue(value *string)() + SetVisibility(value *OrganizationActionsVariable_visibility)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_actions_variable_visibility.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_actions_variable_visibility.go new file mode 100644 index 000000000..ef61952a6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_actions_variable_visibility.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// Visibility of a variable +type OrganizationActionsVariable_visibility int + +const ( + ALL_ORGANIZATIONACTIONSVARIABLE_VISIBILITY OrganizationActionsVariable_visibility = iota + PRIVATE_ORGANIZATIONACTIONSVARIABLE_VISIBILITY + SELECTED_ORGANIZATIONACTIONSVARIABLE_VISIBILITY +) + +func (i OrganizationActionsVariable_visibility) String() string { + return []string{"all", "private", "selected"}[i] +} +func ParseOrganizationActionsVariable_visibility(v string) (any, error) { + result := ALL_ORGANIZATIONACTIONSVARIABLE_VISIBILITY + switch v { + case "all": + result = ALL_ORGANIZATIONACTIONSVARIABLE_VISIBILITY + case "private": + result = PRIVATE_ORGANIZATIONACTIONSVARIABLE_VISIBILITY + case "selected": + result = SELECTED_ORGANIZATIONACTIONSVARIABLE_VISIBILITY + default: + return 0, errors.New("Unknown OrganizationActionsVariable_visibility value: " + v) + } + return &result, nil +} +func SerializeOrganizationActionsVariable_visibility(values []OrganizationActionsVariable_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrganizationActionsVariable_visibility) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_dependabot_secret.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_dependabot_secret.go new file mode 100644 index 000000000..4cb480aa6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_dependabot_secret.go @@ -0,0 +1,199 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationDependabotSecret secrets for GitHub Dependabot for an organization. +type OrganizationDependabotSecret struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the secret. + name *string + // The selected_repositories_url property + selected_repositories_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Visibility of a secret + visibility *OrganizationDependabotSecret_visibility +} +// NewOrganizationDependabotSecret instantiates a new OrganizationDependabotSecret and sets the default values. +func NewOrganizationDependabotSecret()(*OrganizationDependabotSecret) { + m := &OrganizationDependabotSecret{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationDependabotSecretFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationDependabotSecretFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationDependabotSecret(), 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 *OrganizationDependabotSecret) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *OrganizationDependabotSecret) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationDependabotSecret) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["selected_repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedRepositoriesUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrganizationDependabotSecret_visibility) + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val.(*OrganizationDependabotSecret_visibility)) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the secret. +// returns a *string when successful +func (m *OrganizationDependabotSecret) GetName()(*string) { + return m.name +} +// GetSelectedRepositoriesUrl gets the selected_repositories_url property value. The selected_repositories_url property +// returns a *string when successful +func (m *OrganizationDependabotSecret) GetSelectedRepositoriesUrl()(*string) { + return m.selected_repositories_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *OrganizationDependabotSecret) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetVisibility gets the visibility property value. Visibility of a secret +// returns a *OrganizationDependabotSecret_visibility when successful +func (m *OrganizationDependabotSecret) GetVisibility()(*OrganizationDependabotSecret_visibility) { + return m.visibility +} +// Serialize serializes information the current object +func (m *OrganizationDependabotSecret) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("selected_repositories_url", m.GetSelectedRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + if m.GetVisibility() != nil { + cast := (*m.GetVisibility()).String() + err := writer.WriteStringValue("visibility", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *OrganizationDependabotSecret) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *OrganizationDependabotSecret) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetName sets the name property value. The name of the secret. +func (m *OrganizationDependabotSecret) SetName(value *string)() { + m.name = value +} +// SetSelectedRepositoriesUrl sets the selected_repositories_url property value. The selected_repositories_url property +func (m *OrganizationDependabotSecret) SetSelectedRepositoriesUrl(value *string)() { + m.selected_repositories_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *OrganizationDependabotSecret) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetVisibility sets the visibility property value. Visibility of a secret +func (m *OrganizationDependabotSecret) SetVisibility(value *OrganizationDependabotSecret_visibility)() { + m.visibility = value +} +type OrganizationDependabotSecretable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetSelectedRepositoriesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetVisibility()(*OrganizationDependabotSecret_visibility) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetSelectedRepositoriesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetVisibility(value *OrganizationDependabotSecret_visibility)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_dependabot_secret_visibility.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_dependabot_secret_visibility.go new file mode 100644 index 000000000..8609e727d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_dependabot_secret_visibility.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// Visibility of a secret +type OrganizationDependabotSecret_visibility int + +const ( + ALL_ORGANIZATIONDEPENDABOTSECRET_VISIBILITY OrganizationDependabotSecret_visibility = iota + PRIVATE_ORGANIZATIONDEPENDABOTSECRET_VISIBILITY + SELECTED_ORGANIZATIONDEPENDABOTSECRET_VISIBILITY +) + +func (i OrganizationDependabotSecret_visibility) String() string { + return []string{"all", "private", "selected"}[i] +} +func ParseOrganizationDependabotSecret_visibility(v string) (any, error) { + result := ALL_ORGANIZATIONDEPENDABOTSECRET_VISIBILITY + switch v { + case "all": + result = ALL_ORGANIZATIONDEPENDABOTSECRET_VISIBILITY + case "private": + result = PRIVATE_ORGANIZATIONDEPENDABOTSECRET_VISIBILITY + case "selected": + result = SELECTED_ORGANIZATIONDEPENDABOTSECRET_VISIBILITY + default: + return 0, errors.New("Unknown OrganizationDependabotSecret_visibility value: " + v) + } + return &result, nil +} +func SerializeOrganizationDependabotSecret_visibility(values []OrganizationDependabotSecret_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrganizationDependabotSecret_visibility) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_fine_grained_permission.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_fine_grained_permission.go new file mode 100644 index 000000000..e7f188543 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_fine_grained_permission.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationFineGrainedPermission a fine-grained permission that protects organization resources. +type OrganizationFineGrainedPermission struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The description property + description *string + // The name property + name *string +} +// NewOrganizationFineGrainedPermission instantiates a new OrganizationFineGrainedPermission and sets the default values. +func NewOrganizationFineGrainedPermission()(*OrganizationFineGrainedPermission) { + m := &OrganizationFineGrainedPermission{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationFineGrainedPermissionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationFineGrainedPermissionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationFineGrainedPermission(), 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 *OrganizationFineGrainedPermission) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *OrganizationFineGrainedPermission) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationFineGrainedPermission) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *OrganizationFineGrainedPermission) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *OrganizationFineGrainedPermission) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *OrganizationFineGrainedPermission) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description property +func (m *OrganizationFineGrainedPermission) SetDescription(value *string)() { + m.description = value +} +// SetName sets the name property value. The name property +func (m *OrganizationFineGrainedPermission) SetName(value *string)() { + m.name = value +} +type OrganizationFineGrainedPermissionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetName()(*string) + SetDescription(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_full.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_full.go new file mode 100644 index 000000000..0b936c702 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_full.go @@ -0,0 +1,1706 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationFull organization Full +type OrganizationFull struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether GitHub Advanced Security is enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. + advanced_security_enabled_for_new_repositories *bool + // The archived_at property + archived_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The avatar_url property + avatar_url *string + // The billing_email property + billing_email *string + // The blog property + blog *string + // The collaborators property + collaborators *int32 + // The company property + company *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default_repository_permission property + default_repository_permission *string + // Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred tothis organization.This field is only visible to organization owners or members of a team with the security manager role. + dependabot_alerts_enabled_for_new_repositories *bool + // Whether dependabot security updates are automatically enabled for new repositories and repositories transferredto this organization.This field is only visible to organization owners or members of a team with the security manager role. + dependabot_security_updates_enabled_for_new_repositories *bool + // Whether dependency graph is automatically enabled for new repositories and repositories transferred to thisorganization.This field is only visible to organization owners or members of a team with the security manager role. + dependency_graph_enabled_for_new_repositories *bool + // The description property + description *string + // The disk_usage property + disk_usage *int32 + // The email property + email *string + // The events_url property + events_url *string + // The followers property + followers *int32 + // The following property + following *int32 + // The has_organization_projects property + has_organization_projects *bool + // The has_repository_projects property + has_repository_projects *bool + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The is_verified property + is_verified *bool + // The issues_url property + issues_url *string + // The location property + location *string + // The login property + login *string + // The members_allowed_repository_creation_type property + members_allowed_repository_creation_type *string + // The members_can_create_internal_repositories property + members_can_create_internal_repositories *bool + // The members_can_create_pages property + members_can_create_pages *bool + // The members_can_create_private_pages property + members_can_create_private_pages *bool + // The members_can_create_private_repositories property + members_can_create_private_repositories *bool + // The members_can_create_public_pages property + members_can_create_public_pages *bool + // The members_can_create_public_repositories property + members_can_create_public_repositories *bool + // The members_can_create_repositories property + members_can_create_repositories *bool + // The members_can_fork_private_repositories property + members_can_fork_private_repositories *bool + // The members_url property + members_url *string + // The name property + name *string + // The node_id property + node_id *string + // The owned_private_repos property + owned_private_repos *int32 + // The plan property + plan OrganizationFull_planable + // The private_gists property + private_gists *int32 + // The public_gists property + public_gists *int32 + // The public_members_url property + public_members_url *string + // The public_repos property + public_repos *int32 + // The repos_url property + repos_url *string + // Whether secret scanning is automatically enabled for new repositories and repositories transferred to thisorganization.This field is only visible to organization owners or members of a team with the security manager role. + secret_scanning_enabled_for_new_repositories *bool + // An optional URL string to display to contributors who are blocked from pushing a secret. + secret_scanning_push_protection_custom_link *string + // Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. + secret_scanning_push_protection_custom_link_enabled *bool + // Whether secret scanning push protection is automatically enabled for new repositories and repositoriestransferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. + secret_scanning_push_protection_enabled_for_new_repositories *bool + // The total_private_repos property + total_private_repos *int32 + // The twitter_username property + twitter_username *string + // The two_factor_requirement_enabled property + two_factor_requirement_enabled *bool + // The type property + typeEscaped *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The web_commit_signoff_required property + web_commit_signoff_required *bool +} +// NewOrganizationFull instantiates a new OrganizationFull and sets the default values. +func NewOrganizationFull()(*OrganizationFull) { + m := &OrganizationFull{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationFullFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationFullFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationFull(), 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 *OrganizationFull) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvancedSecurityEnabledForNewRepositories gets the advanced_security_enabled_for_new_repositories property value. Whether GitHub Advanced Security is enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. +// returns a *bool when successful +func (m *OrganizationFull) GetAdvancedSecurityEnabledForNewRepositories()(*bool) { + return m.advanced_security_enabled_for_new_repositories +} +// GetArchivedAt gets the archived_at property value. The archived_at property +// returns a *Time when successful +func (m *OrganizationFull) GetArchivedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.archived_at +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *OrganizationFull) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetBillingEmail gets the billing_email property value. The billing_email property +// returns a *string when successful +func (m *OrganizationFull) GetBillingEmail()(*string) { + return m.billing_email +} +// GetBlog gets the blog property value. The blog property +// returns a *string when successful +func (m *OrganizationFull) GetBlog()(*string) { + return m.blog +} +// GetCollaborators gets the collaborators property value. The collaborators property +// returns a *int32 when successful +func (m *OrganizationFull) GetCollaborators()(*int32) { + return m.collaborators +} +// GetCompany gets the company property value. The company property +// returns a *string when successful +func (m *OrganizationFull) GetCompany()(*string) { + return m.company +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *OrganizationFull) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultRepositoryPermission gets the default_repository_permission property value. The default_repository_permission property +// returns a *string when successful +func (m *OrganizationFull) GetDefaultRepositoryPermission()(*string) { + return m.default_repository_permission +} +// GetDependabotAlertsEnabledForNewRepositories gets the dependabot_alerts_enabled_for_new_repositories property value. Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred tothis organization.This field is only visible to organization owners or members of a team with the security manager role. +// returns a *bool when successful +func (m *OrganizationFull) GetDependabotAlertsEnabledForNewRepositories()(*bool) { + return m.dependabot_alerts_enabled_for_new_repositories +} +// GetDependabotSecurityUpdatesEnabledForNewRepositories gets the dependabot_security_updates_enabled_for_new_repositories property value. Whether dependabot security updates are automatically enabled for new repositories and repositories transferredto this organization.This field is only visible to organization owners or members of a team with the security manager role. +// returns a *bool when successful +func (m *OrganizationFull) GetDependabotSecurityUpdatesEnabledForNewRepositories()(*bool) { + return m.dependabot_security_updates_enabled_for_new_repositories +} +// GetDependencyGraphEnabledForNewRepositories gets the dependency_graph_enabled_for_new_repositories property value. Whether dependency graph is automatically enabled for new repositories and repositories transferred to thisorganization.This field is only visible to organization owners or members of a team with the security manager role. +// returns a *bool when successful +func (m *OrganizationFull) GetDependencyGraphEnabledForNewRepositories()(*bool) { + return m.dependency_graph_enabled_for_new_repositories +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *OrganizationFull) GetDescription()(*string) { + return m.description +} +// GetDiskUsage gets the disk_usage property value. The disk_usage property +// returns a *int32 when successful +func (m *OrganizationFull) GetDiskUsage()(*int32) { + return m.disk_usage +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *OrganizationFull) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *OrganizationFull) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationFull) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["advanced_security_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurityEnabledForNewRepositories(val) + } + return nil + } + res["archived_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetArchivedAt(val) + } + return nil + } + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["billing_email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBillingEmail(val) + } + return nil + } + res["blog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlog(val) + } + return nil + } + res["collaborators"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCollaborators(val) + } + return nil + } + res["company"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompany(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["default_repository_permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultRepositoryPermission(val) + } + return nil + } + res["dependabot_alerts_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDependabotAlertsEnabledForNewRepositories(val) + } + return nil + } + res["dependabot_security_updates_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDependabotSecurityUpdatesEnabledForNewRepositories(val) + } + return nil + } + res["dependency_graph_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDependencyGraphEnabledForNewRepositories(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["disk_usage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDiskUsage(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowers(val) + } + return nil + } + res["following"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowing(val) + } + return nil + } + res["has_organization_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasOrganizationProjects(val) + } + return nil + } + res["has_repository_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasRepositoryProjects(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsVerified(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["members_allowed_repository_creation_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersAllowedRepositoryCreationType(val) + } + return nil + } + res["members_can_create_internal_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreateInternalRepositories(val) + } + return nil + } + res["members_can_create_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePages(val) + } + return nil + } + res["members_can_create_private_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePrivatePages(val) + } + return nil + } + res["members_can_create_private_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePrivateRepositories(val) + } + return nil + } + res["members_can_create_public_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePublicPages(val) + } + return nil + } + res["members_can_create_public_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePublicRepositories(val) + } + return nil + } + res["members_can_create_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreateRepositories(val) + } + return nil + } + res["members_can_fork_private_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanForkPrivateRepositories(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["owned_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOwnedPrivateRepos(val) + } + return nil + } + res["plan"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationFull_planFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPlan(val.(OrganizationFull_planable)) + } + return nil + } + res["private_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateGists(val) + } + return nil + } + res["public_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicGists(val) + } + return nil + } + res["public_members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicMembersUrl(val) + } + return nil + } + res["public_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicRepos(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["secret_scanning_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningEnabledForNewRepositories(val) + } + return nil + } + res["secret_scanning_push_protection_custom_link"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtectionCustomLink(val) + } + return nil + } + res["secret_scanning_push_protection_custom_link_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtectionCustomLinkEnabled(val) + } + return nil + } + res["secret_scanning_push_protection_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtectionEnabledForNewRepositories(val) + } + return nil + } + res["total_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalPrivateRepos(val) + } + return nil + } + res["twitter_username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTwitterUsername(val) + } + return nil + } + res["two_factor_requirement_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTwoFactorRequirementEnabled(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFollowers gets the followers property value. The followers property +// returns a *int32 when successful +func (m *OrganizationFull) GetFollowers()(*int32) { + return m.followers +} +// GetFollowing gets the following property value. The following property +// returns a *int32 when successful +func (m *OrganizationFull) GetFollowing()(*int32) { + return m.following +} +// GetHasOrganizationProjects gets the has_organization_projects property value. The has_organization_projects property +// returns a *bool when successful +func (m *OrganizationFull) GetHasOrganizationProjects()(*bool) { + return m.has_organization_projects +} +// GetHasRepositoryProjects gets the has_repository_projects property value. The has_repository_projects property +// returns a *bool when successful +func (m *OrganizationFull) GetHasRepositoryProjects()(*bool) { + return m.has_repository_projects +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *OrganizationFull) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *OrganizationFull) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *OrganizationFull) GetId()(*int32) { + return m.id +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *OrganizationFull) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsVerified gets the is_verified property value. The is_verified property +// returns a *bool when successful +func (m *OrganizationFull) GetIsVerified()(*bool) { + return m.is_verified +} +// GetLocation gets the location property value. The location property +// returns a *string when successful +func (m *OrganizationFull) GetLocation()(*string) { + return m.location +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *OrganizationFull) GetLogin()(*string) { + return m.login +} +// GetMembersAllowedRepositoryCreationType gets the members_allowed_repository_creation_type property value. The members_allowed_repository_creation_type property +// returns a *string when successful +func (m *OrganizationFull) GetMembersAllowedRepositoryCreationType()(*string) { + return m.members_allowed_repository_creation_type +} +// GetMembersCanCreateInternalRepositories gets the members_can_create_internal_repositories property value. The members_can_create_internal_repositories property +// returns a *bool when successful +func (m *OrganizationFull) GetMembersCanCreateInternalRepositories()(*bool) { + return m.members_can_create_internal_repositories +} +// GetMembersCanCreatePages gets the members_can_create_pages property value. The members_can_create_pages property +// returns a *bool when successful +func (m *OrganizationFull) GetMembersCanCreatePages()(*bool) { + return m.members_can_create_pages +} +// GetMembersCanCreatePrivatePages gets the members_can_create_private_pages property value. The members_can_create_private_pages property +// returns a *bool when successful +func (m *OrganizationFull) GetMembersCanCreatePrivatePages()(*bool) { + return m.members_can_create_private_pages +} +// GetMembersCanCreatePrivateRepositories gets the members_can_create_private_repositories property value. The members_can_create_private_repositories property +// returns a *bool when successful +func (m *OrganizationFull) GetMembersCanCreatePrivateRepositories()(*bool) { + return m.members_can_create_private_repositories +} +// GetMembersCanCreatePublicPages gets the members_can_create_public_pages property value. The members_can_create_public_pages property +// returns a *bool when successful +func (m *OrganizationFull) GetMembersCanCreatePublicPages()(*bool) { + return m.members_can_create_public_pages +} +// GetMembersCanCreatePublicRepositories gets the members_can_create_public_repositories property value. The members_can_create_public_repositories property +// returns a *bool when successful +func (m *OrganizationFull) GetMembersCanCreatePublicRepositories()(*bool) { + return m.members_can_create_public_repositories +} +// GetMembersCanCreateRepositories gets the members_can_create_repositories property value. The members_can_create_repositories property +// returns a *bool when successful +func (m *OrganizationFull) GetMembersCanCreateRepositories()(*bool) { + return m.members_can_create_repositories +} +// GetMembersCanForkPrivateRepositories gets the members_can_fork_private_repositories property value. The members_can_fork_private_repositories property +// returns a *bool when successful +func (m *OrganizationFull) GetMembersCanForkPrivateRepositories()(*bool) { + return m.members_can_fork_private_repositories +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *OrganizationFull) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *OrganizationFull) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *OrganizationFull) GetNodeId()(*string) { + return m.node_id +} +// GetOwnedPrivateRepos gets the owned_private_repos property value. The owned_private_repos property +// returns a *int32 when successful +func (m *OrganizationFull) GetOwnedPrivateRepos()(*int32) { + return m.owned_private_repos +} +// GetPlan gets the plan property value. The plan property +// returns a OrganizationFull_planable when successful +func (m *OrganizationFull) GetPlan()(OrganizationFull_planable) { + return m.plan +} +// GetPrivateGists gets the private_gists property value. The private_gists property +// returns a *int32 when successful +func (m *OrganizationFull) GetPrivateGists()(*int32) { + return m.private_gists +} +// GetPublicGists gets the public_gists property value. The public_gists property +// returns a *int32 when successful +func (m *OrganizationFull) GetPublicGists()(*int32) { + return m.public_gists +} +// GetPublicMembersUrl gets the public_members_url property value. The public_members_url property +// returns a *string when successful +func (m *OrganizationFull) GetPublicMembersUrl()(*string) { + return m.public_members_url +} +// GetPublicRepos gets the public_repos property value. The public_repos property +// returns a *int32 when successful +func (m *OrganizationFull) GetPublicRepos()(*int32) { + return m.public_repos +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *OrganizationFull) GetReposUrl()(*string) { + return m.repos_url +} +// GetSecretScanningEnabledForNewRepositories gets the secret_scanning_enabled_for_new_repositories property value. Whether secret scanning is automatically enabled for new repositories and repositories transferred to thisorganization.This field is only visible to organization owners or members of a team with the security manager role. +// returns a *bool when successful +func (m *OrganizationFull) GetSecretScanningEnabledForNewRepositories()(*bool) { + return m.secret_scanning_enabled_for_new_repositories +} +// GetSecretScanningPushProtectionCustomLink gets the secret_scanning_push_protection_custom_link property value. An optional URL string to display to contributors who are blocked from pushing a secret. +// returns a *string when successful +func (m *OrganizationFull) GetSecretScanningPushProtectionCustomLink()(*string) { + return m.secret_scanning_push_protection_custom_link +} +// GetSecretScanningPushProtectionCustomLinkEnabled gets the secret_scanning_push_protection_custom_link_enabled property value. Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. +// returns a *bool when successful +func (m *OrganizationFull) GetSecretScanningPushProtectionCustomLinkEnabled()(*bool) { + return m.secret_scanning_push_protection_custom_link_enabled +} +// GetSecretScanningPushProtectionEnabledForNewRepositories gets the secret_scanning_push_protection_enabled_for_new_repositories property value. Whether secret scanning push protection is automatically enabled for new repositories and repositoriestransferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. +// returns a *bool when successful +func (m *OrganizationFull) GetSecretScanningPushProtectionEnabledForNewRepositories()(*bool) { + return m.secret_scanning_push_protection_enabled_for_new_repositories +} +// GetTotalPrivateRepos gets the total_private_repos property value. The total_private_repos property +// returns a *int32 when successful +func (m *OrganizationFull) GetTotalPrivateRepos()(*int32) { + return m.total_private_repos +} +// GetTwitterUsername gets the twitter_username property value. The twitter_username property +// returns a *string when successful +func (m *OrganizationFull) GetTwitterUsername()(*string) { + return m.twitter_username +} +// GetTwoFactorRequirementEnabled gets the two_factor_requirement_enabled property value. The two_factor_requirement_enabled property +// returns a *bool when successful +func (m *OrganizationFull) GetTwoFactorRequirementEnabled()(*bool) { + return m.two_factor_requirement_enabled +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *OrganizationFull) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *OrganizationFull) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *OrganizationFull) GetUrl()(*string) { + return m.url +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. The web_commit_signoff_required property +// returns a *bool when successful +func (m *OrganizationFull) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *OrganizationFull) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("advanced_security_enabled_for_new_repositories", m.GetAdvancedSecurityEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("archived_at", m.GetArchivedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("billing_email", m.GetBillingEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blog", m.GetBlog()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("collaborators", m.GetCollaborators()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("company", m.GetCompany()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_repository_permission", m.GetDefaultRepositoryPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dependabot_alerts_enabled_for_new_repositories", m.GetDependabotAlertsEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dependabot_security_updates_enabled_for_new_repositories", m.GetDependabotSecurityUpdatesEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dependency_graph_enabled_for_new_repositories", m.GetDependencyGraphEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("disk_usage", m.GetDiskUsage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("followers", m.GetFollowers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("following", m.GetFollowing()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_organization_projects", m.GetHasOrganizationProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_repository_projects", m.GetHasRepositoryProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_verified", m.GetIsVerified()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_allowed_repository_creation_type", m.GetMembersAllowedRepositoryCreationType()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_internal_repositories", m.GetMembersCanCreateInternalRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_pages", m.GetMembersCanCreatePages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_private_pages", m.GetMembersCanCreatePrivatePages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_private_repositories", m.GetMembersCanCreatePrivateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_public_pages", m.GetMembersCanCreatePublicPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_public_repositories", m.GetMembersCanCreatePublicRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_repositories", m.GetMembersCanCreateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_fork_private_repositories", m.GetMembersCanForkPrivateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("owned_private_repos", m.GetOwnedPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("plan", m.GetPlan()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_gists", m.GetPrivateGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_gists", m.GetPublicGists()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("public_members_url", m.GetPublicMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_repos", m.GetPublicRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("secret_scanning_enabled_for_new_repositories", m.GetSecretScanningEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret_scanning_push_protection_custom_link", m.GetSecretScanningPushProtectionCustomLink()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("secret_scanning_push_protection_custom_link_enabled", m.GetSecretScanningPushProtectionCustomLinkEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("secret_scanning_push_protection_enabled_for_new_repositories", m.GetSecretScanningPushProtectionEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_private_repos", m.GetTotalPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("twitter_username", m.GetTwitterUsername()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("two_factor_requirement_enabled", m.GetTwoFactorRequirementEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *OrganizationFull) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvancedSecurityEnabledForNewRepositories sets the advanced_security_enabled_for_new_repositories property value. Whether GitHub Advanced Security is enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. +func (m *OrganizationFull) SetAdvancedSecurityEnabledForNewRepositories(value *bool)() { + m.advanced_security_enabled_for_new_repositories = value +} +// SetArchivedAt sets the archived_at property value. The archived_at property +func (m *OrganizationFull) SetArchivedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.archived_at = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *OrganizationFull) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetBillingEmail sets the billing_email property value. The billing_email property +func (m *OrganizationFull) SetBillingEmail(value *string)() { + m.billing_email = value +} +// SetBlog sets the blog property value. The blog property +func (m *OrganizationFull) SetBlog(value *string)() { + m.blog = value +} +// SetCollaborators sets the collaborators property value. The collaborators property +func (m *OrganizationFull) SetCollaborators(value *int32)() { + m.collaborators = value +} +// SetCompany sets the company property value. The company property +func (m *OrganizationFull) SetCompany(value *string)() { + m.company = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *OrganizationFull) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultRepositoryPermission sets the default_repository_permission property value. The default_repository_permission property +func (m *OrganizationFull) SetDefaultRepositoryPermission(value *string)() { + m.default_repository_permission = value +} +// SetDependabotAlertsEnabledForNewRepositories sets the dependabot_alerts_enabled_for_new_repositories property value. Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred tothis organization.This field is only visible to organization owners or members of a team with the security manager role. +func (m *OrganizationFull) SetDependabotAlertsEnabledForNewRepositories(value *bool)() { + m.dependabot_alerts_enabled_for_new_repositories = value +} +// SetDependabotSecurityUpdatesEnabledForNewRepositories sets the dependabot_security_updates_enabled_for_new_repositories property value. Whether dependabot security updates are automatically enabled for new repositories and repositories transferredto this organization.This field is only visible to organization owners or members of a team with the security manager role. +func (m *OrganizationFull) SetDependabotSecurityUpdatesEnabledForNewRepositories(value *bool)() { + m.dependabot_security_updates_enabled_for_new_repositories = value +} +// SetDependencyGraphEnabledForNewRepositories sets the dependency_graph_enabled_for_new_repositories property value. Whether dependency graph is automatically enabled for new repositories and repositories transferred to thisorganization.This field is only visible to organization owners or members of a team with the security manager role. +func (m *OrganizationFull) SetDependencyGraphEnabledForNewRepositories(value *bool)() { + m.dependency_graph_enabled_for_new_repositories = value +} +// SetDescription sets the description property value. The description property +func (m *OrganizationFull) SetDescription(value *string)() { + m.description = value +} +// SetDiskUsage sets the disk_usage property value. The disk_usage property +func (m *OrganizationFull) SetDiskUsage(value *int32)() { + m.disk_usage = value +} +// SetEmail sets the email property value. The email property +func (m *OrganizationFull) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *OrganizationFull) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowers sets the followers property value. The followers property +func (m *OrganizationFull) SetFollowers(value *int32)() { + m.followers = value +} +// SetFollowing sets the following property value. The following property +func (m *OrganizationFull) SetFollowing(value *int32)() { + m.following = value +} +// SetHasOrganizationProjects sets the has_organization_projects property value. The has_organization_projects property +func (m *OrganizationFull) SetHasOrganizationProjects(value *bool)() { + m.has_organization_projects = value +} +// SetHasRepositoryProjects sets the has_repository_projects property value. The has_repository_projects property +func (m *OrganizationFull) SetHasRepositoryProjects(value *bool)() { + m.has_repository_projects = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *OrganizationFull) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *OrganizationFull) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *OrganizationFull) SetId(value *int32)() { + m.id = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *OrganizationFull) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsVerified sets the is_verified property value. The is_verified property +func (m *OrganizationFull) SetIsVerified(value *bool)() { + m.is_verified = value +} +// SetLocation sets the location property value. The location property +func (m *OrganizationFull) SetLocation(value *string)() { + m.location = value +} +// SetLogin sets the login property value. The login property +func (m *OrganizationFull) SetLogin(value *string)() { + m.login = value +} +// SetMembersAllowedRepositoryCreationType sets the members_allowed_repository_creation_type property value. The members_allowed_repository_creation_type property +func (m *OrganizationFull) SetMembersAllowedRepositoryCreationType(value *string)() { + m.members_allowed_repository_creation_type = value +} +// SetMembersCanCreateInternalRepositories sets the members_can_create_internal_repositories property value. The members_can_create_internal_repositories property +func (m *OrganizationFull) SetMembersCanCreateInternalRepositories(value *bool)() { + m.members_can_create_internal_repositories = value +} +// SetMembersCanCreatePages sets the members_can_create_pages property value. The members_can_create_pages property +func (m *OrganizationFull) SetMembersCanCreatePages(value *bool)() { + m.members_can_create_pages = value +} +// SetMembersCanCreatePrivatePages sets the members_can_create_private_pages property value. The members_can_create_private_pages property +func (m *OrganizationFull) SetMembersCanCreatePrivatePages(value *bool)() { + m.members_can_create_private_pages = value +} +// SetMembersCanCreatePrivateRepositories sets the members_can_create_private_repositories property value. The members_can_create_private_repositories property +func (m *OrganizationFull) SetMembersCanCreatePrivateRepositories(value *bool)() { + m.members_can_create_private_repositories = value +} +// SetMembersCanCreatePublicPages sets the members_can_create_public_pages property value. The members_can_create_public_pages property +func (m *OrganizationFull) SetMembersCanCreatePublicPages(value *bool)() { + m.members_can_create_public_pages = value +} +// SetMembersCanCreatePublicRepositories sets the members_can_create_public_repositories property value. The members_can_create_public_repositories property +func (m *OrganizationFull) SetMembersCanCreatePublicRepositories(value *bool)() { + m.members_can_create_public_repositories = value +} +// SetMembersCanCreateRepositories sets the members_can_create_repositories property value. The members_can_create_repositories property +func (m *OrganizationFull) SetMembersCanCreateRepositories(value *bool)() { + m.members_can_create_repositories = value +} +// SetMembersCanForkPrivateRepositories sets the members_can_fork_private_repositories property value. The members_can_fork_private_repositories property +func (m *OrganizationFull) SetMembersCanForkPrivateRepositories(value *bool)() { + m.members_can_fork_private_repositories = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *OrganizationFull) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. The name property +func (m *OrganizationFull) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *OrganizationFull) SetNodeId(value *string)() { + m.node_id = value +} +// SetOwnedPrivateRepos sets the owned_private_repos property value. The owned_private_repos property +func (m *OrganizationFull) SetOwnedPrivateRepos(value *int32)() { + m.owned_private_repos = value +} +// SetPlan sets the plan property value. The plan property +func (m *OrganizationFull) SetPlan(value OrganizationFull_planable)() { + m.plan = value +} +// SetPrivateGists sets the private_gists property value. The private_gists property +func (m *OrganizationFull) SetPrivateGists(value *int32)() { + m.private_gists = value +} +// SetPublicGists sets the public_gists property value. The public_gists property +func (m *OrganizationFull) SetPublicGists(value *int32)() { + m.public_gists = value +} +// SetPublicMembersUrl sets the public_members_url property value. The public_members_url property +func (m *OrganizationFull) SetPublicMembersUrl(value *string)() { + m.public_members_url = value +} +// SetPublicRepos sets the public_repos property value. The public_repos property +func (m *OrganizationFull) SetPublicRepos(value *int32)() { + m.public_repos = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *OrganizationFull) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSecretScanningEnabledForNewRepositories sets the secret_scanning_enabled_for_new_repositories property value. Whether secret scanning is automatically enabled for new repositories and repositories transferred to thisorganization.This field is only visible to organization owners or members of a team with the security manager role. +func (m *OrganizationFull) SetSecretScanningEnabledForNewRepositories(value *bool)() { + m.secret_scanning_enabled_for_new_repositories = value +} +// SetSecretScanningPushProtectionCustomLink sets the secret_scanning_push_protection_custom_link property value. An optional URL string to display to contributors who are blocked from pushing a secret. +func (m *OrganizationFull) SetSecretScanningPushProtectionCustomLink(value *string)() { + m.secret_scanning_push_protection_custom_link = value +} +// SetSecretScanningPushProtectionCustomLinkEnabled sets the secret_scanning_push_protection_custom_link_enabled property value. Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. +func (m *OrganizationFull) SetSecretScanningPushProtectionCustomLinkEnabled(value *bool)() { + m.secret_scanning_push_protection_custom_link_enabled = value +} +// SetSecretScanningPushProtectionEnabledForNewRepositories sets the secret_scanning_push_protection_enabled_for_new_repositories property value. Whether secret scanning push protection is automatically enabled for new repositories and repositoriestransferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. +func (m *OrganizationFull) SetSecretScanningPushProtectionEnabledForNewRepositories(value *bool)() { + m.secret_scanning_push_protection_enabled_for_new_repositories = value +} +// SetTotalPrivateRepos sets the total_private_repos property value. The total_private_repos property +func (m *OrganizationFull) SetTotalPrivateRepos(value *int32)() { + m.total_private_repos = value +} +// SetTwitterUsername sets the twitter_username property value. The twitter_username property +func (m *OrganizationFull) SetTwitterUsername(value *string)() { + m.twitter_username = value +} +// SetTwoFactorRequirementEnabled sets the two_factor_requirement_enabled property value. The two_factor_requirement_enabled property +func (m *OrganizationFull) SetTwoFactorRequirementEnabled(value *bool)() { + m.two_factor_requirement_enabled = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *OrganizationFull) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *OrganizationFull) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *OrganizationFull) SetUrl(value *string)() { + m.url = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. The web_commit_signoff_required property +func (m *OrganizationFull) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type OrganizationFullable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdvancedSecurityEnabledForNewRepositories()(*bool) + GetArchivedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetAvatarUrl()(*string) + GetBillingEmail()(*string) + GetBlog()(*string) + GetCollaborators()(*int32) + GetCompany()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultRepositoryPermission()(*string) + GetDependabotAlertsEnabledForNewRepositories()(*bool) + GetDependabotSecurityUpdatesEnabledForNewRepositories()(*bool) + GetDependencyGraphEnabledForNewRepositories()(*bool) + GetDescription()(*string) + GetDiskUsage()(*int32) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowers()(*int32) + GetFollowing()(*int32) + GetHasOrganizationProjects()(*bool) + GetHasRepositoryProjects()(*bool) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssuesUrl()(*string) + GetIsVerified()(*bool) + GetLocation()(*string) + GetLogin()(*string) + GetMembersAllowedRepositoryCreationType()(*string) + GetMembersCanCreateInternalRepositories()(*bool) + GetMembersCanCreatePages()(*bool) + GetMembersCanCreatePrivatePages()(*bool) + GetMembersCanCreatePrivateRepositories()(*bool) + GetMembersCanCreatePublicPages()(*bool) + GetMembersCanCreatePublicRepositories()(*bool) + GetMembersCanCreateRepositories()(*bool) + GetMembersCanForkPrivateRepositories()(*bool) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOwnedPrivateRepos()(*int32) + GetPlan()(OrganizationFull_planable) + GetPrivateGists()(*int32) + GetPublicGists()(*int32) + GetPublicMembersUrl()(*string) + GetPublicRepos()(*int32) + GetReposUrl()(*string) + GetSecretScanningEnabledForNewRepositories()(*bool) + GetSecretScanningPushProtectionCustomLink()(*string) + GetSecretScanningPushProtectionCustomLinkEnabled()(*bool) + GetSecretScanningPushProtectionEnabledForNewRepositories()(*bool) + GetTotalPrivateRepos()(*int32) + GetTwitterUsername()(*string) + GetTwoFactorRequirementEnabled()(*bool) + GetTypeEscaped()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetWebCommitSignoffRequired()(*bool) + SetAdvancedSecurityEnabledForNewRepositories(value *bool)() + SetArchivedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetAvatarUrl(value *string)() + SetBillingEmail(value *string)() + SetBlog(value *string)() + SetCollaborators(value *int32)() + SetCompany(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultRepositoryPermission(value *string)() + SetDependabotAlertsEnabledForNewRepositories(value *bool)() + SetDependabotSecurityUpdatesEnabledForNewRepositories(value *bool)() + SetDependencyGraphEnabledForNewRepositories(value *bool)() + SetDescription(value *string)() + SetDiskUsage(value *int32)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowers(value *int32)() + SetFollowing(value *int32)() + SetHasOrganizationProjects(value *bool)() + SetHasRepositoryProjects(value *bool)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssuesUrl(value *string)() + SetIsVerified(value *bool)() + SetLocation(value *string)() + SetLogin(value *string)() + SetMembersAllowedRepositoryCreationType(value *string)() + SetMembersCanCreateInternalRepositories(value *bool)() + SetMembersCanCreatePages(value *bool)() + SetMembersCanCreatePrivatePages(value *bool)() + SetMembersCanCreatePrivateRepositories(value *bool)() + SetMembersCanCreatePublicPages(value *bool)() + SetMembersCanCreatePublicRepositories(value *bool)() + SetMembersCanCreateRepositories(value *bool)() + SetMembersCanForkPrivateRepositories(value *bool)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOwnedPrivateRepos(value *int32)() + SetPlan(value OrganizationFull_planable)() + SetPrivateGists(value *int32)() + SetPublicGists(value *int32)() + SetPublicMembersUrl(value *string)() + SetPublicRepos(value *int32)() + SetReposUrl(value *string)() + SetSecretScanningEnabledForNewRepositories(value *bool)() + SetSecretScanningPushProtectionCustomLink(value *string)() + SetSecretScanningPushProtectionCustomLinkEnabled(value *bool)() + SetSecretScanningPushProtectionEnabledForNewRepositories(value *bool)() + SetTotalPrivateRepos(value *int32)() + SetTwitterUsername(value *string)() + SetTwoFactorRequirementEnabled(value *bool)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_full_plan.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_full_plan.go new file mode 100644 index 000000000..9c81e2a12 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_full_plan.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationFull_plan struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The filled_seats property + filled_seats *int32 + // The name property + name *string + // The private_repos property + private_repos *int32 + // The seats property + seats *int32 + // The space property + space *int32 +} +// NewOrganizationFull_plan instantiates a new OrganizationFull_plan and sets the default values. +func NewOrganizationFull_plan()(*OrganizationFull_plan) { + m := &OrganizationFull_plan{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationFull_planFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationFull_planFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationFull_plan(), 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 *OrganizationFull_plan) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationFull_plan) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["filled_seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFilledSeats(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateRepos(val) + } + return nil + } + res["seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSeats(val) + } + return nil + } + res["space"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSpace(val) + } + return nil + } + return res +} +// GetFilledSeats gets the filled_seats property value. The filled_seats property +// returns a *int32 when successful +func (m *OrganizationFull_plan) GetFilledSeats()(*int32) { + return m.filled_seats +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *OrganizationFull_plan) GetName()(*string) { + return m.name +} +// GetPrivateRepos gets the private_repos property value. The private_repos property +// returns a *int32 when successful +func (m *OrganizationFull_plan) GetPrivateRepos()(*int32) { + return m.private_repos +} +// GetSeats gets the seats property value. The seats property +// returns a *int32 when successful +func (m *OrganizationFull_plan) GetSeats()(*int32) { + return m.seats +} +// GetSpace gets the space property value. The space property +// returns a *int32 when successful +func (m *OrganizationFull_plan) GetSpace()(*int32) { + return m.space +} +// Serialize serializes information the current object +func (m *OrganizationFull_plan) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("filled_seats", m.GetFilledSeats()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_repos", m.GetPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("seats", m.GetSeats()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("space", m.GetSpace()) + 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 *OrganizationFull_plan) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFilledSeats sets the filled_seats property value. The filled_seats property +func (m *OrganizationFull_plan) SetFilledSeats(value *int32)() { + m.filled_seats = value +} +// SetName sets the name property value. The name property +func (m *OrganizationFull_plan) SetName(value *string)() { + m.name = value +} +// SetPrivateRepos sets the private_repos property value. The private_repos property +func (m *OrganizationFull_plan) SetPrivateRepos(value *int32)() { + m.private_repos = value +} +// SetSeats sets the seats property value. The seats property +func (m *OrganizationFull_plan) SetSeats(value *int32)() { + m.seats = value +} +// SetSpace sets the space property value. The space property +func (m *OrganizationFull_plan) SetSpace(value *int32)() { + m.space = value +} +type OrganizationFull_planable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFilledSeats()(*int32) + GetName()(*string) + GetPrivateRepos()(*int32) + GetSeats()(*int32) + GetSpace()(*int32) + SetFilledSeats(value *int32)() + SetName(value *string)() + SetPrivateRepos(value *int32)() + SetSeats(value *int32)() + SetSpace(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_invitation.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_invitation.go new file mode 100644 index 000000000..ba2621656 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_invitation.go @@ -0,0 +1,400 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationInvitation organization Invitation +type OrganizationInvitation struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *string + // The email property + email *string + // The failed_at property + failed_at *string + // The failed_reason property + failed_reason *string + // The id property + id *int64 + // The invitation_source property + invitation_source *string + // The invitation_teams_url property + invitation_teams_url *string + // A GitHub user. + inviter SimpleUserable + // The login property + login *string + // The node_id property + node_id *string + // The role property + role *string + // The team_count property + team_count *int32 +} +// NewOrganizationInvitation instantiates a new OrganizationInvitation and sets the default values. +func NewOrganizationInvitation()(*OrganizationInvitation) { + m := &OrganizationInvitation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationInvitationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationInvitationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationInvitation(), 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 *OrganizationInvitation) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *OrganizationInvitation) GetCreatedAt()(*string) { + return m.created_at +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *OrganizationInvitation) GetEmail()(*string) { + return m.email +} +// GetFailedAt gets the failed_at property value. The failed_at property +// returns a *string when successful +func (m *OrganizationInvitation) GetFailedAt()(*string) { + return m.failed_at +} +// GetFailedReason gets the failed_reason property value. The failed_reason property +// returns a *string when successful +func (m *OrganizationInvitation) GetFailedReason()(*string) { + return m.failed_reason +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationInvitation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["failed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFailedAt(val) + } + return nil + } + res["failed_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFailedReason(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["invitation_source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInvitationSource(val) + } + return nil + } + res["invitation_teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInvitationTeamsUrl(val) + } + return nil + } + res["inviter"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInviter(val.(SimpleUserable)) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["role"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRole(val) + } + return nil + } + res["team_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTeamCount(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *OrganizationInvitation) GetId()(*int64) { + return m.id +} +// GetInvitationSource gets the invitation_source property value. The invitation_source property +// returns a *string when successful +func (m *OrganizationInvitation) GetInvitationSource()(*string) { + return m.invitation_source +} +// GetInvitationTeamsUrl gets the invitation_teams_url property value. The invitation_teams_url property +// returns a *string when successful +func (m *OrganizationInvitation) GetInvitationTeamsUrl()(*string) { + return m.invitation_teams_url +} +// GetInviter gets the inviter property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *OrganizationInvitation) GetInviter()(SimpleUserable) { + return m.inviter +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *OrganizationInvitation) GetLogin()(*string) { + return m.login +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *OrganizationInvitation) GetNodeId()(*string) { + return m.node_id +} +// GetRole gets the role property value. The role property +// returns a *string when successful +func (m *OrganizationInvitation) GetRole()(*string) { + return m.role +} +// GetTeamCount gets the team_count property value. The team_count property +// returns a *int32 when successful +func (m *OrganizationInvitation) GetTeamCount()(*int32) { + return m.team_count +} +// Serialize serializes information the current object +func (m *OrganizationInvitation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("failed_at", m.GetFailedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("failed_reason", m.GetFailedReason()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("invitation_source", m.GetInvitationSource()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("invitation_teams_url", m.GetInvitationTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("inviter", m.GetInviter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("role", m.GetRole()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("team_count", m.GetTeamCount()) + 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 *OrganizationInvitation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *OrganizationInvitation) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEmail sets the email property value. The email property +func (m *OrganizationInvitation) SetEmail(value *string)() { + m.email = value +} +// SetFailedAt sets the failed_at property value. The failed_at property +func (m *OrganizationInvitation) SetFailedAt(value *string)() { + m.failed_at = value +} +// SetFailedReason sets the failed_reason property value. The failed_reason property +func (m *OrganizationInvitation) SetFailedReason(value *string)() { + m.failed_reason = value +} +// SetId sets the id property value. The id property +func (m *OrganizationInvitation) SetId(value *int64)() { + m.id = value +} +// SetInvitationSource sets the invitation_source property value. The invitation_source property +func (m *OrganizationInvitation) SetInvitationSource(value *string)() { + m.invitation_source = value +} +// SetInvitationTeamsUrl sets the invitation_teams_url property value. The invitation_teams_url property +func (m *OrganizationInvitation) SetInvitationTeamsUrl(value *string)() { + m.invitation_teams_url = value +} +// SetInviter sets the inviter property value. A GitHub user. +func (m *OrganizationInvitation) SetInviter(value SimpleUserable)() { + m.inviter = value +} +// SetLogin sets the login property value. The login property +func (m *OrganizationInvitation) SetLogin(value *string)() { + m.login = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *OrganizationInvitation) SetNodeId(value *string)() { + m.node_id = value +} +// SetRole sets the role property value. The role property +func (m *OrganizationInvitation) SetRole(value *string)() { + m.role = value +} +// SetTeamCount sets the team_count property value. The team_count property +func (m *OrganizationInvitation) SetTeamCount(value *int32)() { + m.team_count = value +} +type OrganizationInvitationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*string) + GetEmail()(*string) + GetFailedAt()(*string) + GetFailedReason()(*string) + GetId()(*int64) + GetInvitationSource()(*string) + GetInvitationTeamsUrl()(*string) + GetInviter()(SimpleUserable) + GetLogin()(*string) + GetNodeId()(*string) + GetRole()(*string) + GetTeamCount()(*int32) + SetCreatedAt(value *string)() + SetEmail(value *string)() + SetFailedAt(value *string)() + SetFailedReason(value *string)() + SetId(value *int64)() + SetInvitationSource(value *string)() + SetInvitationTeamsUrl(value *string)() + SetInviter(value SimpleUserable)() + SetLogin(value *string)() + SetNodeId(value *string)() + SetRole(value *string)() + SetTeamCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_plan.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_plan.go new file mode 100644 index 000000000..3e37d4b5a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_plan.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Organization_plan struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The filled_seats property + filled_seats *int32 + // The name property + name *string + // The private_repos property + private_repos *int32 + // The seats property + seats *int32 + // The space property + space *int32 +} +// NewOrganization_plan instantiates a new Organization_plan and sets the default values. +func NewOrganization_plan()(*Organization_plan) { + m := &Organization_plan{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganization_planFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganization_planFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganization_plan(), 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 *Organization_plan) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Organization_plan) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["filled_seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFilledSeats(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateRepos(val) + } + return nil + } + res["seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSeats(val) + } + return nil + } + res["space"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSpace(val) + } + return nil + } + return res +} +// GetFilledSeats gets the filled_seats property value. The filled_seats property +// returns a *int32 when successful +func (m *Organization_plan) GetFilledSeats()(*int32) { + return m.filled_seats +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *Organization_plan) GetName()(*string) { + return m.name +} +// GetPrivateRepos gets the private_repos property value. The private_repos property +// returns a *int32 when successful +func (m *Organization_plan) GetPrivateRepos()(*int32) { + return m.private_repos +} +// GetSeats gets the seats property value. The seats property +// returns a *int32 when successful +func (m *Organization_plan) GetSeats()(*int32) { + return m.seats +} +// GetSpace gets the space property value. The space property +// returns a *int32 when successful +func (m *Organization_plan) GetSpace()(*int32) { + return m.space +} +// Serialize serializes information the current object +func (m *Organization_plan) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("filled_seats", m.GetFilledSeats()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_repos", m.GetPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("seats", m.GetSeats()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("space", m.GetSpace()) + 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 *Organization_plan) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFilledSeats sets the filled_seats property value. The filled_seats property +func (m *Organization_plan) SetFilledSeats(value *int32)() { + m.filled_seats = value +} +// SetName sets the name property value. The name property +func (m *Organization_plan) SetName(value *string)() { + m.name = value +} +// SetPrivateRepos sets the private_repos property value. The private_repos property +func (m *Organization_plan) SetPrivateRepos(value *int32)() { + m.private_repos = value +} +// SetSeats sets the seats property value. The seats property +func (m *Organization_plan) SetSeats(value *int32)() { + m.seats = value +} +// SetSpace sets the space property value. The space property +func (m *Organization_plan) SetSpace(value *int32)() { + m.space = value +} +type Organization_planable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFilledSeats()(*int32) + GetName()(*string) + GetPrivateRepos()(*int32) + GetSeats()(*int32) + GetSpace()(*int32) + SetFilledSeats(value *int32)() + SetName(value *string)() + SetPrivateRepos(value *int32)() + SetSeats(value *int32)() + SetSpace(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant.go new file mode 100644 index 000000000..a2da9c61e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant.go @@ -0,0 +1,314 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationProgrammaticAccessGrant minimal representation of an organization programmatic access grant for enumerations +type OrganizationProgrammaticAccessGrant struct { + // Date and time when the fine-grained personal access token was approved to access the organization. + access_granted_at *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Unique identifier of the fine-grained personal access token. The `pat_id` used to get details about an approved fine-grained personal access token. + id *int32 + // A GitHub user. + owner SimpleUserable + // Permissions requested, categorized by type of permission. + permissions OrganizationProgrammaticAccessGrant_permissionsable + // URL to the list of repositories the fine-grained personal access token can access. Only follow when `repository_selection` is `subset`. + repositories_url *string + // Type of repository selection requested. + repository_selection *OrganizationProgrammaticAccessGrant_repository_selection + // Whether the associated fine-grained personal access token has expired. + token_expired *bool + // Date and time when the associated fine-grained personal access token expires. + token_expires_at *string + // Date and time when the associated fine-grained personal access token was last used for authentication. + token_last_used_at *string +} +// NewOrganizationProgrammaticAccessGrant instantiates a new OrganizationProgrammaticAccessGrant and sets the default values. +func NewOrganizationProgrammaticAccessGrant()(*OrganizationProgrammaticAccessGrant) { + m := &OrganizationProgrammaticAccessGrant{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrantFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrantFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrant(), nil +} +// GetAccessGrantedAt gets the access_granted_at property value. Date and time when the fine-grained personal access token was approved to access the organization. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrant) GetAccessGrantedAt()(*string) { + return m.access_granted_at +} +// 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 *OrganizationProgrammaticAccessGrant) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationProgrammaticAccessGrant) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["access_granted_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAccessGrantedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationProgrammaticAccessGrant_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(OrganizationProgrammaticAccessGrant_permissionsable)) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["repository_selection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrganizationProgrammaticAccessGrant_repository_selection) + if err != nil { + return err + } + if val != nil { + m.SetRepositorySelection(val.(*OrganizationProgrammaticAccessGrant_repository_selection)) + } + return nil + } + res["token_expired"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTokenExpired(val) + } + return nil + } + res["token_expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTokenExpiresAt(val) + } + return nil + } + res["token_last_used_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTokenLastUsedAt(val) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the fine-grained personal access token. The `pat_id` used to get details about an approved fine-grained personal access token. +// returns a *int32 when successful +func (m *OrganizationProgrammaticAccessGrant) GetId()(*int32) { + return m.id +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *OrganizationProgrammaticAccessGrant) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPermissions gets the permissions property value. Permissions requested, categorized by type of permission. +// returns a OrganizationProgrammaticAccessGrant_permissionsable when successful +func (m *OrganizationProgrammaticAccessGrant) GetPermissions()(OrganizationProgrammaticAccessGrant_permissionsable) { + return m.permissions +} +// GetRepositoriesUrl gets the repositories_url property value. URL to the list of repositories the fine-grained personal access token can access. Only follow when `repository_selection` is `subset`. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrant) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetRepositorySelection gets the repository_selection property value. Type of repository selection requested. +// returns a *OrganizationProgrammaticAccessGrant_repository_selection when successful +func (m *OrganizationProgrammaticAccessGrant) GetRepositorySelection()(*OrganizationProgrammaticAccessGrant_repository_selection) { + return m.repository_selection +} +// GetTokenExpired gets the token_expired property value. Whether the associated fine-grained personal access token has expired. +// returns a *bool when successful +func (m *OrganizationProgrammaticAccessGrant) GetTokenExpired()(*bool) { + return m.token_expired +} +// GetTokenExpiresAt gets the token_expires_at property value. Date and time when the associated fine-grained personal access token expires. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrant) GetTokenExpiresAt()(*string) { + return m.token_expires_at +} +// GetTokenLastUsedAt gets the token_last_used_at property value. Date and time when the associated fine-grained personal access token was last used for authentication. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrant) GetTokenLastUsedAt()(*string) { + return m.token_last_used_at +} +// Serialize serializes information the current object +func (m *OrganizationProgrammaticAccessGrant) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("access_granted_at", m.GetAccessGrantedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + if m.GetRepositorySelection() != nil { + cast := (*m.GetRepositorySelection()).String() + err := writer.WriteStringValue("repository_selection", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("token_expired", m.GetTokenExpired()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token_expires_at", m.GetTokenExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token_last_used_at", m.GetTokenLastUsedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccessGrantedAt sets the access_granted_at property value. Date and time when the fine-grained personal access token was approved to access the organization. +func (m *OrganizationProgrammaticAccessGrant) SetAccessGrantedAt(value *string)() { + m.access_granted_at = value +} +// 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 *OrganizationProgrammaticAccessGrant) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. Unique identifier of the fine-grained personal access token. The `pat_id` used to get details about an approved fine-grained personal access token. +func (m *OrganizationProgrammaticAccessGrant) SetId(value *int32)() { + m.id = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *OrganizationProgrammaticAccessGrant) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. Permissions requested, categorized by type of permission. +func (m *OrganizationProgrammaticAccessGrant) SetPermissions(value OrganizationProgrammaticAccessGrant_permissionsable)() { + m.permissions = value +} +// SetRepositoriesUrl sets the repositories_url property value. URL to the list of repositories the fine-grained personal access token can access. Only follow when `repository_selection` is `subset`. +func (m *OrganizationProgrammaticAccessGrant) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetRepositorySelection sets the repository_selection property value. Type of repository selection requested. +func (m *OrganizationProgrammaticAccessGrant) SetRepositorySelection(value *OrganizationProgrammaticAccessGrant_repository_selection)() { + m.repository_selection = value +} +// SetTokenExpired sets the token_expired property value. Whether the associated fine-grained personal access token has expired. +func (m *OrganizationProgrammaticAccessGrant) SetTokenExpired(value *bool)() { + m.token_expired = value +} +// SetTokenExpiresAt sets the token_expires_at property value. Date and time when the associated fine-grained personal access token expires. +func (m *OrganizationProgrammaticAccessGrant) SetTokenExpiresAt(value *string)() { + m.token_expires_at = value +} +// SetTokenLastUsedAt sets the token_last_used_at property value. Date and time when the associated fine-grained personal access token was last used for authentication. +func (m *OrganizationProgrammaticAccessGrant) SetTokenLastUsedAt(value *string)() { + m.token_last_used_at = value +} +type OrganizationProgrammaticAccessGrantable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessGrantedAt()(*string) + GetId()(*int32) + GetOwner()(SimpleUserable) + GetPermissions()(OrganizationProgrammaticAccessGrant_permissionsable) + GetRepositoriesUrl()(*string) + GetRepositorySelection()(*OrganizationProgrammaticAccessGrant_repository_selection) + GetTokenExpired()(*bool) + GetTokenExpiresAt()(*string) + GetTokenLastUsedAt()(*string) + SetAccessGrantedAt(value *string)() + SetId(value *int32)() + SetOwner(value SimpleUserable)() + SetPermissions(value OrganizationProgrammaticAccessGrant_permissionsable)() + SetRepositoriesUrl(value *string)() + SetRepositorySelection(value *OrganizationProgrammaticAccessGrant_repository_selection)() + SetTokenExpired(value *bool)() + SetTokenExpiresAt(value *string)() + SetTokenLastUsedAt(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_permissions.go new file mode 100644 index 000000000..14b93bf8a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_permissions.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationProgrammaticAccessGrant_permissions permissions requested, categorized by type of permission. +type OrganizationProgrammaticAccessGrant_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The organization property + organization OrganizationProgrammaticAccessGrant_permissions_organizationable + // The other property + other OrganizationProgrammaticAccessGrant_permissions_otherable + // The repository property + repository OrganizationProgrammaticAccessGrant_permissions_repositoryable +} +// NewOrganizationProgrammaticAccessGrant_permissions instantiates a new OrganizationProgrammaticAccessGrant_permissions and sets the default values. +func NewOrganizationProgrammaticAccessGrant_permissions()(*OrganizationProgrammaticAccessGrant_permissions) { + m := &OrganizationProgrammaticAccessGrant_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrant_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrant_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrant_permissions(), 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 *OrganizationProgrammaticAccessGrant_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationProgrammaticAccessGrant_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationProgrammaticAccessGrant_permissions_organizationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrganization(val.(OrganizationProgrammaticAccessGrant_permissions_organizationable)) + } + return nil + } + res["other"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationProgrammaticAccessGrant_permissions_otherFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOther(val.(OrganizationProgrammaticAccessGrant_permissions_otherable)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationProgrammaticAccessGrant_permissions_repositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(OrganizationProgrammaticAccessGrant_permissions_repositoryable)) + } + return nil + } + return res +} +// GetOrganization gets the organization property value. The organization property +// returns a OrganizationProgrammaticAccessGrant_permissions_organizationable when successful +func (m *OrganizationProgrammaticAccessGrant_permissions) GetOrganization()(OrganizationProgrammaticAccessGrant_permissions_organizationable) { + return m.organization +} +// GetOther gets the other property value. The other property +// returns a OrganizationProgrammaticAccessGrant_permissions_otherable when successful +func (m *OrganizationProgrammaticAccessGrant_permissions) GetOther()(OrganizationProgrammaticAccessGrant_permissions_otherable) { + return m.other +} +// GetRepository gets the repository property value. The repository property +// returns a OrganizationProgrammaticAccessGrant_permissions_repositoryable when successful +func (m *OrganizationProgrammaticAccessGrant_permissions) GetRepository()(OrganizationProgrammaticAccessGrant_permissions_repositoryable) { + return m.repository +} +// Serialize serializes information the current object +func (m *OrganizationProgrammaticAccessGrant_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("organization", m.GetOrganization()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("other", m.GetOther()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + 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 *OrganizationProgrammaticAccessGrant_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetOrganization sets the organization property value. The organization property +func (m *OrganizationProgrammaticAccessGrant_permissions) SetOrganization(value OrganizationProgrammaticAccessGrant_permissions_organizationable)() { + m.organization = value +} +// SetOther sets the other property value. The other property +func (m *OrganizationProgrammaticAccessGrant_permissions) SetOther(value OrganizationProgrammaticAccessGrant_permissions_otherable)() { + m.other = value +} +// SetRepository sets the repository property value. The repository property +func (m *OrganizationProgrammaticAccessGrant_permissions) SetRepository(value OrganizationProgrammaticAccessGrant_permissions_repositoryable)() { + m.repository = value +} +type OrganizationProgrammaticAccessGrant_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetOrganization()(OrganizationProgrammaticAccessGrant_permissions_organizationable) + GetOther()(OrganizationProgrammaticAccessGrant_permissions_otherable) + GetRepository()(OrganizationProgrammaticAccessGrant_permissions_repositoryable) + SetOrganization(value OrganizationProgrammaticAccessGrant_permissions_organizationable)() + SetOther(value OrganizationProgrammaticAccessGrant_permissions_otherable)() + SetRepository(value OrganizationProgrammaticAccessGrant_permissions_repositoryable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_permissions_organization.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_permissions_organization.go new file mode 100644 index 000000000..10594a367 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_permissions_organization.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationProgrammaticAccessGrant_permissions_organization struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewOrganizationProgrammaticAccessGrant_permissions_organization instantiates a new OrganizationProgrammaticAccessGrant_permissions_organization and sets the default values. +func NewOrganizationProgrammaticAccessGrant_permissions_organization()(*OrganizationProgrammaticAccessGrant_permissions_organization) { + m := &OrganizationProgrammaticAccessGrant_permissions_organization{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrant_permissions_organizationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrant_permissions_organizationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrant_permissions_organization(), 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 *OrganizationProgrammaticAccessGrant_permissions_organization) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationProgrammaticAccessGrant_permissions_organization) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *OrganizationProgrammaticAccessGrant_permissions_organization) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *OrganizationProgrammaticAccessGrant_permissions_organization) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type OrganizationProgrammaticAccessGrant_permissions_organizationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_permissions_other.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_permissions_other.go new file mode 100644 index 000000000..1fad3c886 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_permissions_other.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationProgrammaticAccessGrant_permissions_other struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewOrganizationProgrammaticAccessGrant_permissions_other instantiates a new OrganizationProgrammaticAccessGrant_permissions_other and sets the default values. +func NewOrganizationProgrammaticAccessGrant_permissions_other()(*OrganizationProgrammaticAccessGrant_permissions_other) { + m := &OrganizationProgrammaticAccessGrant_permissions_other{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrant_permissions_otherFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrant_permissions_otherFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrant_permissions_other(), 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 *OrganizationProgrammaticAccessGrant_permissions_other) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationProgrammaticAccessGrant_permissions_other) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *OrganizationProgrammaticAccessGrant_permissions_other) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *OrganizationProgrammaticAccessGrant_permissions_other) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type OrganizationProgrammaticAccessGrant_permissions_otherable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_permissions_repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_permissions_repository.go new file mode 100644 index 000000000..515467497 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_permissions_repository.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationProgrammaticAccessGrant_permissions_repository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewOrganizationProgrammaticAccessGrant_permissions_repository instantiates a new OrganizationProgrammaticAccessGrant_permissions_repository and sets the default values. +func NewOrganizationProgrammaticAccessGrant_permissions_repository()(*OrganizationProgrammaticAccessGrant_permissions_repository) { + m := &OrganizationProgrammaticAccessGrant_permissions_repository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrant_permissions_repositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrant_permissions_repositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrant_permissions_repository(), 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 *OrganizationProgrammaticAccessGrant_permissions_repository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationProgrammaticAccessGrant_permissions_repository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *OrganizationProgrammaticAccessGrant_permissions_repository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *OrganizationProgrammaticAccessGrant_permissions_repository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type OrganizationProgrammaticAccessGrant_permissions_repositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_repository_selection.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_repository_selection.go new file mode 100644 index 000000000..f77c53f29 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_repository_selection.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// Type of repository selection requested. +type OrganizationProgrammaticAccessGrant_repository_selection int + +const ( + NONE_ORGANIZATIONPROGRAMMATICACCESSGRANT_REPOSITORY_SELECTION OrganizationProgrammaticAccessGrant_repository_selection = iota + ALL_ORGANIZATIONPROGRAMMATICACCESSGRANT_REPOSITORY_SELECTION + SUBSET_ORGANIZATIONPROGRAMMATICACCESSGRANT_REPOSITORY_SELECTION +) + +func (i OrganizationProgrammaticAccessGrant_repository_selection) String() string { + return []string{"none", "all", "subset"}[i] +} +func ParseOrganizationProgrammaticAccessGrant_repository_selection(v string) (any, error) { + result := NONE_ORGANIZATIONPROGRAMMATICACCESSGRANT_REPOSITORY_SELECTION + switch v { + case "none": + result = NONE_ORGANIZATIONPROGRAMMATICACCESSGRANT_REPOSITORY_SELECTION + case "all": + result = ALL_ORGANIZATIONPROGRAMMATICACCESSGRANT_REPOSITORY_SELECTION + case "subset": + result = SUBSET_ORGANIZATIONPROGRAMMATICACCESSGRANT_REPOSITORY_SELECTION + default: + return 0, errors.New("Unknown OrganizationProgrammaticAccessGrant_repository_selection value: " + v) + } + return &result, nil +} +func SerializeOrganizationProgrammaticAccessGrant_repository_selection(values []OrganizationProgrammaticAccessGrant_repository_selection) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrganizationProgrammaticAccessGrant_repository_selection) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request.go new file mode 100644 index 000000000..c3b0e2881 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request.go @@ -0,0 +1,343 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationProgrammaticAccessGrantRequest minimal representation of an organization programmatic access grant request for enumerations +type OrganizationProgrammaticAccessGrantRequest struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Date and time when the request for access was created. + created_at *string + // Unique identifier of the request for access via fine-grained personal access token. The `pat_request_id` used to review PAT requests. + id *int32 + // A GitHub user. + owner SimpleUserable + // Permissions requested, categorized by type of permission. + permissions OrganizationProgrammaticAccessGrantRequest_permissionsable + // Reason for requesting access. + reason *string + // URL to the list of repositories requested to be accessed via fine-grained personal access token. Should only be followed when `repository_selection` is `subset`. + repositories_url *string + // Type of repository selection requested. + repository_selection *OrganizationProgrammaticAccessGrantRequest_repository_selection + // Whether the associated fine-grained personal access token has expired. + token_expired *bool + // Date and time when the associated fine-grained personal access token expires. + token_expires_at *string + // Date and time when the associated fine-grained personal access token was last used for authentication. + token_last_used_at *string +} +// NewOrganizationProgrammaticAccessGrantRequest instantiates a new OrganizationProgrammaticAccessGrantRequest and sets the default values. +func NewOrganizationProgrammaticAccessGrantRequest()(*OrganizationProgrammaticAccessGrantRequest) { + m := &OrganizationProgrammaticAccessGrantRequest{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrantRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrantRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrantRequest(), 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 *OrganizationProgrammaticAccessGrantRequest) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. Date and time when the request for access was created. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetCreatedAt()(*string) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationProgrammaticAccessGrantRequest_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(OrganizationProgrammaticAccessGrantRequest_permissionsable)) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["repository_selection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrganizationProgrammaticAccessGrantRequest_repository_selection) + if err != nil { + return err + } + if val != nil { + m.SetRepositorySelection(val.(*OrganizationProgrammaticAccessGrantRequest_repository_selection)) + } + return nil + } + res["token_expired"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTokenExpired(val) + } + return nil + } + res["token_expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTokenExpiresAt(val) + } + return nil + } + res["token_last_used_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTokenLastUsedAt(val) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the request for access via fine-grained personal access token. The `pat_request_id` used to review PAT requests. +// returns a *int32 when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetId()(*int32) { + return m.id +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPermissions gets the permissions property value. Permissions requested, categorized by type of permission. +// returns a OrganizationProgrammaticAccessGrantRequest_permissionsable when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetPermissions()(OrganizationProgrammaticAccessGrantRequest_permissionsable) { + return m.permissions +} +// GetReason gets the reason property value. Reason for requesting access. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetReason()(*string) { + return m.reason +} +// GetRepositoriesUrl gets the repositories_url property value. URL to the list of repositories requested to be accessed via fine-grained personal access token. Should only be followed when `repository_selection` is `subset`. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetRepositorySelection gets the repository_selection property value. Type of repository selection requested. +// returns a *OrganizationProgrammaticAccessGrantRequest_repository_selection when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetRepositorySelection()(*OrganizationProgrammaticAccessGrantRequest_repository_selection) { + return m.repository_selection +} +// GetTokenExpired gets the token_expired property value. Whether the associated fine-grained personal access token has expired. +// returns a *bool when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetTokenExpired()(*bool) { + return m.token_expired +} +// GetTokenExpiresAt gets the token_expires_at property value. Date and time when the associated fine-grained personal access token expires. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetTokenExpiresAt()(*string) { + return m.token_expires_at +} +// GetTokenLastUsedAt gets the token_last_used_at property value. Date and time when the associated fine-grained personal access token was last used for authentication. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetTokenLastUsedAt()(*string) { + return m.token_last_used_at +} +// Serialize serializes information the current object +func (m *OrganizationProgrammaticAccessGrantRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + if m.GetRepositorySelection() != nil { + cast := (*m.GetRepositorySelection()).String() + err := writer.WriteStringValue("repository_selection", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("token_expired", m.GetTokenExpired()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token_expires_at", m.GetTokenExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token_last_used_at", m.GetTokenLastUsedAt()) + 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 *OrganizationProgrammaticAccessGrantRequest) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. Date and time when the request for access was created. +func (m *OrganizationProgrammaticAccessGrantRequest) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetId sets the id property value. Unique identifier of the request for access via fine-grained personal access token. The `pat_request_id` used to review PAT requests. +func (m *OrganizationProgrammaticAccessGrantRequest) SetId(value *int32)() { + m.id = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *OrganizationProgrammaticAccessGrantRequest) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. Permissions requested, categorized by type of permission. +func (m *OrganizationProgrammaticAccessGrantRequest) SetPermissions(value OrganizationProgrammaticAccessGrantRequest_permissionsable)() { + m.permissions = value +} +// SetReason sets the reason property value. Reason for requesting access. +func (m *OrganizationProgrammaticAccessGrantRequest) SetReason(value *string)() { + m.reason = value +} +// SetRepositoriesUrl sets the repositories_url property value. URL to the list of repositories requested to be accessed via fine-grained personal access token. Should only be followed when `repository_selection` is `subset`. +func (m *OrganizationProgrammaticAccessGrantRequest) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetRepositorySelection sets the repository_selection property value. Type of repository selection requested. +func (m *OrganizationProgrammaticAccessGrantRequest) SetRepositorySelection(value *OrganizationProgrammaticAccessGrantRequest_repository_selection)() { + m.repository_selection = value +} +// SetTokenExpired sets the token_expired property value. Whether the associated fine-grained personal access token has expired. +func (m *OrganizationProgrammaticAccessGrantRequest) SetTokenExpired(value *bool)() { + m.token_expired = value +} +// SetTokenExpiresAt sets the token_expires_at property value. Date and time when the associated fine-grained personal access token expires. +func (m *OrganizationProgrammaticAccessGrantRequest) SetTokenExpiresAt(value *string)() { + m.token_expires_at = value +} +// SetTokenLastUsedAt sets the token_last_used_at property value. Date and time when the associated fine-grained personal access token was last used for authentication. +func (m *OrganizationProgrammaticAccessGrantRequest) SetTokenLastUsedAt(value *string)() { + m.token_last_used_at = value +} +type OrganizationProgrammaticAccessGrantRequestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*string) + GetId()(*int32) + GetOwner()(SimpleUserable) + GetPermissions()(OrganizationProgrammaticAccessGrantRequest_permissionsable) + GetReason()(*string) + GetRepositoriesUrl()(*string) + GetRepositorySelection()(*OrganizationProgrammaticAccessGrantRequest_repository_selection) + GetTokenExpired()(*bool) + GetTokenExpiresAt()(*string) + GetTokenLastUsedAt()(*string) + SetCreatedAt(value *string)() + SetId(value *int32)() + SetOwner(value SimpleUserable)() + SetPermissions(value OrganizationProgrammaticAccessGrantRequest_permissionsable)() + SetReason(value *string)() + SetRepositoriesUrl(value *string)() + SetRepositorySelection(value *OrganizationProgrammaticAccessGrantRequest_repository_selection)() + SetTokenExpired(value *bool)() + SetTokenExpiresAt(value *string)() + SetTokenLastUsedAt(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request_permissions.go new file mode 100644 index 000000000..25ae983d7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request_permissions.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationProgrammaticAccessGrantRequest_permissions permissions requested, categorized by type of permission. +type OrganizationProgrammaticAccessGrantRequest_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The organization property + organization OrganizationProgrammaticAccessGrantRequest_permissions_organizationable + // The other property + other OrganizationProgrammaticAccessGrantRequest_permissions_otherable + // The repository property + repository OrganizationProgrammaticAccessGrantRequest_permissions_repositoryable +} +// NewOrganizationProgrammaticAccessGrantRequest_permissions instantiates a new OrganizationProgrammaticAccessGrantRequest_permissions and sets the default values. +func NewOrganizationProgrammaticAccessGrantRequest_permissions()(*OrganizationProgrammaticAccessGrantRequest_permissions) { + m := &OrganizationProgrammaticAccessGrantRequest_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrantRequest_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrantRequest_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrantRequest_permissions(), 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 *OrganizationProgrammaticAccessGrantRequest_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationProgrammaticAccessGrantRequest_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationProgrammaticAccessGrantRequest_permissions_organizationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrganization(val.(OrganizationProgrammaticAccessGrantRequest_permissions_organizationable)) + } + return nil + } + res["other"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationProgrammaticAccessGrantRequest_permissions_otherFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOther(val.(OrganizationProgrammaticAccessGrantRequest_permissions_otherable)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationProgrammaticAccessGrantRequest_permissions_repositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(OrganizationProgrammaticAccessGrantRequest_permissions_repositoryable)) + } + return nil + } + return res +} +// GetOrganization gets the organization property value. The organization property +// returns a OrganizationProgrammaticAccessGrantRequest_permissions_organizationable when successful +func (m *OrganizationProgrammaticAccessGrantRequest_permissions) GetOrganization()(OrganizationProgrammaticAccessGrantRequest_permissions_organizationable) { + return m.organization +} +// GetOther gets the other property value. The other property +// returns a OrganizationProgrammaticAccessGrantRequest_permissions_otherable when successful +func (m *OrganizationProgrammaticAccessGrantRequest_permissions) GetOther()(OrganizationProgrammaticAccessGrantRequest_permissions_otherable) { + return m.other +} +// GetRepository gets the repository property value. The repository property +// returns a OrganizationProgrammaticAccessGrantRequest_permissions_repositoryable when successful +func (m *OrganizationProgrammaticAccessGrantRequest_permissions) GetRepository()(OrganizationProgrammaticAccessGrantRequest_permissions_repositoryable) { + return m.repository +} +// Serialize serializes information the current object +func (m *OrganizationProgrammaticAccessGrantRequest_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("organization", m.GetOrganization()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("other", m.GetOther()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + 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 *OrganizationProgrammaticAccessGrantRequest_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetOrganization sets the organization property value. The organization property +func (m *OrganizationProgrammaticAccessGrantRequest_permissions) SetOrganization(value OrganizationProgrammaticAccessGrantRequest_permissions_organizationable)() { + m.organization = value +} +// SetOther sets the other property value. The other property +func (m *OrganizationProgrammaticAccessGrantRequest_permissions) SetOther(value OrganizationProgrammaticAccessGrantRequest_permissions_otherable)() { + m.other = value +} +// SetRepository sets the repository property value. The repository property +func (m *OrganizationProgrammaticAccessGrantRequest_permissions) SetRepository(value OrganizationProgrammaticAccessGrantRequest_permissions_repositoryable)() { + m.repository = value +} +type OrganizationProgrammaticAccessGrantRequest_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetOrganization()(OrganizationProgrammaticAccessGrantRequest_permissions_organizationable) + GetOther()(OrganizationProgrammaticAccessGrantRequest_permissions_otherable) + GetRepository()(OrganizationProgrammaticAccessGrantRequest_permissions_repositoryable) + SetOrganization(value OrganizationProgrammaticAccessGrantRequest_permissions_organizationable)() + SetOther(value OrganizationProgrammaticAccessGrantRequest_permissions_otherable)() + SetRepository(value OrganizationProgrammaticAccessGrantRequest_permissions_repositoryable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request_permissions_organization.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request_permissions_organization.go new file mode 100644 index 000000000..7cfcc16f6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request_permissions_organization.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationProgrammaticAccessGrantRequest_permissions_organization struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewOrganizationProgrammaticAccessGrantRequest_permissions_organization instantiates a new OrganizationProgrammaticAccessGrantRequest_permissions_organization and sets the default values. +func NewOrganizationProgrammaticAccessGrantRequest_permissions_organization()(*OrganizationProgrammaticAccessGrantRequest_permissions_organization) { + m := &OrganizationProgrammaticAccessGrantRequest_permissions_organization{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrantRequest_permissions_organizationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrantRequest_permissions_organizationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrantRequest_permissions_organization(), 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 *OrganizationProgrammaticAccessGrantRequest_permissions_organization) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationProgrammaticAccessGrantRequest_permissions_organization) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *OrganizationProgrammaticAccessGrantRequest_permissions_organization) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *OrganizationProgrammaticAccessGrantRequest_permissions_organization) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type OrganizationProgrammaticAccessGrantRequest_permissions_organizationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request_permissions_other.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request_permissions_other.go new file mode 100644 index 000000000..69c85d929 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request_permissions_other.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationProgrammaticAccessGrantRequest_permissions_other struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewOrganizationProgrammaticAccessGrantRequest_permissions_other instantiates a new OrganizationProgrammaticAccessGrantRequest_permissions_other and sets the default values. +func NewOrganizationProgrammaticAccessGrantRequest_permissions_other()(*OrganizationProgrammaticAccessGrantRequest_permissions_other) { + m := &OrganizationProgrammaticAccessGrantRequest_permissions_other{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrantRequest_permissions_otherFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrantRequest_permissions_otherFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrantRequest_permissions_other(), 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 *OrganizationProgrammaticAccessGrantRequest_permissions_other) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationProgrammaticAccessGrantRequest_permissions_other) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *OrganizationProgrammaticAccessGrantRequest_permissions_other) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *OrganizationProgrammaticAccessGrantRequest_permissions_other) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type OrganizationProgrammaticAccessGrantRequest_permissions_otherable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request_permissions_repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request_permissions_repository.go new file mode 100644 index 000000000..46d78df77 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request_permissions_repository.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationProgrammaticAccessGrantRequest_permissions_repository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewOrganizationProgrammaticAccessGrantRequest_permissions_repository instantiates a new OrganizationProgrammaticAccessGrantRequest_permissions_repository and sets the default values. +func NewOrganizationProgrammaticAccessGrantRequest_permissions_repository()(*OrganizationProgrammaticAccessGrantRequest_permissions_repository) { + m := &OrganizationProgrammaticAccessGrantRequest_permissions_repository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrantRequest_permissions_repositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrantRequest_permissions_repositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrantRequest_permissions_repository(), 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 *OrganizationProgrammaticAccessGrantRequest_permissions_repository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationProgrammaticAccessGrantRequest_permissions_repository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *OrganizationProgrammaticAccessGrantRequest_permissions_repository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *OrganizationProgrammaticAccessGrantRequest_permissions_repository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type OrganizationProgrammaticAccessGrantRequest_permissions_repositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request_repository_selection.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request_repository_selection.go new file mode 100644 index 000000000..50a6b2146 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_programmatic_access_grant_request_repository_selection.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// Type of repository selection requested. +type OrganizationProgrammaticAccessGrantRequest_repository_selection int + +const ( + NONE_ORGANIZATIONPROGRAMMATICACCESSGRANTREQUEST_REPOSITORY_SELECTION OrganizationProgrammaticAccessGrantRequest_repository_selection = iota + ALL_ORGANIZATIONPROGRAMMATICACCESSGRANTREQUEST_REPOSITORY_SELECTION + SUBSET_ORGANIZATIONPROGRAMMATICACCESSGRANTREQUEST_REPOSITORY_SELECTION +) + +func (i OrganizationProgrammaticAccessGrantRequest_repository_selection) String() string { + return []string{"none", "all", "subset"}[i] +} +func ParseOrganizationProgrammaticAccessGrantRequest_repository_selection(v string) (any, error) { + result := NONE_ORGANIZATIONPROGRAMMATICACCESSGRANTREQUEST_REPOSITORY_SELECTION + switch v { + case "none": + result = NONE_ORGANIZATIONPROGRAMMATICACCESSGRANTREQUEST_REPOSITORY_SELECTION + case "all": + result = ALL_ORGANIZATIONPROGRAMMATICACCESSGRANTREQUEST_REPOSITORY_SELECTION + case "subset": + result = SUBSET_ORGANIZATIONPROGRAMMATICACCESSGRANTREQUEST_REPOSITORY_SELECTION + default: + return 0, errors.New("Unknown OrganizationProgrammaticAccessGrantRequest_repository_selection value: " + v) + } + return &result, nil +} +func SerializeOrganizationProgrammaticAccessGrantRequest_repository_selection(values []OrganizationProgrammaticAccessGrantRequest_repository_selection) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrganizationProgrammaticAccessGrantRequest_repository_selection) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_role.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_role.go new file mode 100644 index 000000000..db45a281b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_role.go @@ -0,0 +1,262 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationRole organization roles +type OrganizationRole struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The date and time the role was created. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A short description about who this role is for or what permissions it grants. + description *string + // The unique identifier of the role. + id *int64 + // The name of the role. + name *string + // A GitHub user. + organization NullableSimpleUserable + // A list of permissions included in this role. + permissions []string + // The date and time the role was last updated. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewOrganizationRole instantiates a new OrganizationRole and sets the default values. +func NewOrganizationRole()(*OrganizationRole) { + m := &OrganizationRole{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationRoleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationRoleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationRole(), 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 *OrganizationRole) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The date and time the role was created. +// returns a *Time when successful +func (m *OrganizationRole) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. A short description about who this role is for or what permissions it grants. +// returns a *string when successful +func (m *OrganizationRole) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationRole) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrganization(val.(NullableSimpleUserable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetPermissions(res) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetId gets the id property value. The unique identifier of the role. +// returns a *int64 when successful +func (m *OrganizationRole) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name of the role. +// returns a *string when successful +func (m *OrganizationRole) GetName()(*string) { + return m.name +} +// GetOrganization gets the organization property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *OrganizationRole) GetOrganization()(NullableSimpleUserable) { + return m.organization +} +// GetPermissions gets the permissions property value. A list of permissions included in this role. +// returns a []string when successful +func (m *OrganizationRole) GetPermissions()([]string) { + return m.permissions +} +// GetUpdatedAt gets the updated_at property value. The date and time the role was last updated. +// returns a *Time when successful +func (m *OrganizationRole) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *OrganizationRole) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("organization", m.GetOrganization()) + if err != nil { + return err + } + } + if m.GetPermissions() != nil { + err := writer.WriteCollectionOfStringValues("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + 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 *OrganizationRole) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The date and time the role was created. +func (m *OrganizationRole) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. A short description about who this role is for or what permissions it grants. +func (m *OrganizationRole) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. The unique identifier of the role. +func (m *OrganizationRole) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name of the role. +func (m *OrganizationRole) SetName(value *string)() { + m.name = value +} +// SetOrganization sets the organization property value. A GitHub user. +func (m *OrganizationRole) SetOrganization(value NullableSimpleUserable)() { + m.organization = value +} +// SetPermissions sets the permissions property value. A list of permissions included in this role. +func (m *OrganizationRole) SetPermissions(value []string)() { + m.permissions = value +} +// SetUpdatedAt sets the updated_at property value. The date and time the role was last updated. +func (m *OrganizationRole) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type OrganizationRoleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetId()(*int64) + GetName()(*string) + GetOrganization()(NullableSimpleUserable) + GetPermissions()([]string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetId(value *int64)() + SetName(value *string)() + SetOrganization(value NullableSimpleUserable)() + SetPermissions(value []string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_secret_scanning_alert.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_secret_scanning_alert.go new file mode 100644 index 000000000..20461e9f8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_secret_scanning_alert.go @@ -0,0 +1,576 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationSecretScanningAlert struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The GitHub URL of the alert resource. + html_url *string + // The REST API URL of the code locations for this alert. + locations_url *string + // The security alert number. + number *int32 + // Whether push protection was bypassed for the detected secret. + push_protection_bypassed *bool + // The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + push_protection_bypassed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + push_protection_bypassed_by NullableSimpleUserable + // A GitHub repository. + repository SimpleRepositoryable + // **Required when the `state` is `resolved`.** The reason for resolving the alert. + resolution *SecretScanningAlertResolution + // The comment that was optionally added when this alert was closed + resolution_comment *string + // The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + resolved_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + resolved_by NullableSimpleUserable + // The secret that was detected. + secret *string + // The type of secret that secret scanning detected. + secret_type *string + // User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Secret scanning patterns](https://docs.github.com/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)." + secret_type_display_name *string + // Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. + state *SecretScanningAlertState + // The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The REST API URL of the alert resource. + url *string + // The token status as of the latest validity check. + validity *OrganizationSecretScanningAlert_validity +} +// NewOrganizationSecretScanningAlert instantiates a new OrganizationSecretScanningAlert and sets the default values. +func NewOrganizationSecretScanningAlert()(*OrganizationSecretScanningAlert) { + m := &OrganizationSecretScanningAlert{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationSecretScanningAlertFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationSecretScanningAlertFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationSecretScanningAlert(), 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 *OrganizationSecretScanningAlert) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *OrganizationSecretScanningAlert) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationSecretScanningAlert) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["locations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocationsUrl(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["push_protection_bypassed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPushProtectionBypassed(val) + } + return nil + } + res["push_protection_bypassed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushProtectionBypassedAt(val) + } + return nil + } + res["push_protection_bypassed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPushProtectionBypassedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(SimpleRepositoryable)) + } + return nil + } + res["resolution"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecretScanningAlertResolution) + if err != nil { + return err + } + if val != nil { + m.SetResolution(val.(*SecretScanningAlertResolution)) + } + return nil + } + res["resolution_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResolutionComment(val) + } + return nil + } + res["resolved_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetResolvedAt(val) + } + return nil + } + res["resolved_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetResolvedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["secret_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretType(val) + } + return nil + } + res["secret_type_display_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretTypeDisplayName(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecretScanningAlertState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*SecretScanningAlertState)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["validity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrganizationSecretScanningAlert_validity) + if err != nil { + return err + } + if val != nil { + m.SetValidity(val.(*OrganizationSecretScanningAlert_validity)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The GitHub URL of the alert resource. +// returns a *string when successful +func (m *OrganizationSecretScanningAlert) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLocationsUrl gets the locations_url property value. The REST API URL of the code locations for this alert. +// returns a *string when successful +func (m *OrganizationSecretScanningAlert) GetLocationsUrl()(*string) { + return m.locations_url +} +// GetNumber gets the number property value. The security alert number. +// returns a *int32 when successful +func (m *OrganizationSecretScanningAlert) GetNumber()(*int32) { + return m.number +} +// GetPushProtectionBypassed gets the push_protection_bypassed property value. Whether push protection was bypassed for the detected secret. +// returns a *bool when successful +func (m *OrganizationSecretScanningAlert) GetPushProtectionBypassed()(*bool) { + return m.push_protection_bypassed +} +// GetPushProtectionBypassedAt gets the push_protection_bypassed_at property value. The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *OrganizationSecretScanningAlert) GetPushProtectionBypassedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.push_protection_bypassed_at +} +// GetPushProtectionBypassedBy gets the push_protection_bypassed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *OrganizationSecretScanningAlert) GetPushProtectionBypassedBy()(NullableSimpleUserable) { + return m.push_protection_bypassed_by +} +// GetRepository gets the repository property value. A GitHub repository. +// returns a SimpleRepositoryable when successful +func (m *OrganizationSecretScanningAlert) GetRepository()(SimpleRepositoryable) { + return m.repository +} +// GetResolution gets the resolution property value. **Required when the `state` is `resolved`.** The reason for resolving the alert. +// returns a *SecretScanningAlertResolution when successful +func (m *OrganizationSecretScanningAlert) GetResolution()(*SecretScanningAlertResolution) { + return m.resolution +} +// GetResolutionComment gets the resolution_comment property value. The comment that was optionally added when this alert was closed +// returns a *string when successful +func (m *OrganizationSecretScanningAlert) GetResolutionComment()(*string) { + return m.resolution_comment +} +// GetResolvedAt gets the resolved_at property value. The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *OrganizationSecretScanningAlert) GetResolvedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.resolved_at +} +// GetResolvedBy gets the resolved_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *OrganizationSecretScanningAlert) GetResolvedBy()(NullableSimpleUserable) { + return m.resolved_by +} +// GetSecret gets the secret property value. The secret that was detected. +// returns a *string when successful +func (m *OrganizationSecretScanningAlert) GetSecret()(*string) { + return m.secret +} +// GetSecretType gets the secret_type property value. The type of secret that secret scanning detected. +// returns a *string when successful +func (m *OrganizationSecretScanningAlert) GetSecretType()(*string) { + return m.secret_type +} +// GetSecretTypeDisplayName gets the secret_type_display_name property value. User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Secret scanning patterns](https://docs.github.com/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)." +// returns a *string when successful +func (m *OrganizationSecretScanningAlert) GetSecretTypeDisplayName()(*string) { + return m.secret_type_display_name +} +// GetState gets the state property value. Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. +// returns a *SecretScanningAlertState when successful +func (m *OrganizationSecretScanningAlert) GetState()(*SecretScanningAlertState) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *OrganizationSecretScanningAlert) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The REST API URL of the alert resource. +// returns a *string when successful +func (m *OrganizationSecretScanningAlert) GetUrl()(*string) { + return m.url +} +// GetValidity gets the validity property value. The token status as of the latest validity check. +// returns a *OrganizationSecretScanningAlert_validity when successful +func (m *OrganizationSecretScanningAlert) GetValidity()(*OrganizationSecretScanningAlert_validity) { + return m.validity +} +// Serialize serializes information the current object +func (m *OrganizationSecretScanningAlert) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("locations_url", m.GetLocationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push_protection_bypassed", m.GetPushProtectionBypassed()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("push_protection_bypassed_at", m.GetPushProtectionBypassedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("push_protection_bypassed_by", m.GetPushProtectionBypassedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + if m.GetResolution() != nil { + cast := (*m.GetResolution()).String() + err := writer.WriteStringValue("resolution", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("resolution_comment", m.GetResolutionComment()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("resolved_at", m.GetResolvedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("resolved_by", m.GetResolvedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret_type", m.GetSecretType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret_type_display_name", m.GetSecretTypeDisplayName()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + if m.GetValidity() != nil { + cast := (*m.GetValidity()).String() + err := writer.WriteStringValue("validity", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *OrganizationSecretScanningAlert) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *OrganizationSecretScanningAlert) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The GitHub URL of the alert resource. +func (m *OrganizationSecretScanningAlert) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLocationsUrl sets the locations_url property value. The REST API URL of the code locations for this alert. +func (m *OrganizationSecretScanningAlert) SetLocationsUrl(value *string)() { + m.locations_url = value +} +// SetNumber sets the number property value. The security alert number. +func (m *OrganizationSecretScanningAlert) SetNumber(value *int32)() { + m.number = value +} +// SetPushProtectionBypassed sets the push_protection_bypassed property value. Whether push protection was bypassed for the detected secret. +func (m *OrganizationSecretScanningAlert) SetPushProtectionBypassed(value *bool)() { + m.push_protection_bypassed = value +} +// SetPushProtectionBypassedAt sets the push_protection_bypassed_at property value. The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *OrganizationSecretScanningAlert) SetPushProtectionBypassedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.push_protection_bypassed_at = value +} +// SetPushProtectionBypassedBy sets the push_protection_bypassed_by property value. A GitHub user. +func (m *OrganizationSecretScanningAlert) SetPushProtectionBypassedBy(value NullableSimpleUserable)() { + m.push_protection_bypassed_by = value +} +// SetRepository sets the repository property value. A GitHub repository. +func (m *OrganizationSecretScanningAlert) SetRepository(value SimpleRepositoryable)() { + m.repository = value +} +// SetResolution sets the resolution property value. **Required when the `state` is `resolved`.** The reason for resolving the alert. +func (m *OrganizationSecretScanningAlert) SetResolution(value *SecretScanningAlertResolution)() { + m.resolution = value +} +// SetResolutionComment sets the resolution_comment property value. The comment that was optionally added when this alert was closed +func (m *OrganizationSecretScanningAlert) SetResolutionComment(value *string)() { + m.resolution_comment = value +} +// SetResolvedAt sets the resolved_at property value. The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *OrganizationSecretScanningAlert) SetResolvedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.resolved_at = value +} +// SetResolvedBy sets the resolved_by property value. A GitHub user. +func (m *OrganizationSecretScanningAlert) SetResolvedBy(value NullableSimpleUserable)() { + m.resolved_by = value +} +// SetSecret sets the secret property value. The secret that was detected. +func (m *OrganizationSecretScanningAlert) SetSecret(value *string)() { + m.secret = value +} +// SetSecretType sets the secret_type property value. The type of secret that secret scanning detected. +func (m *OrganizationSecretScanningAlert) SetSecretType(value *string)() { + m.secret_type = value +} +// SetSecretTypeDisplayName sets the secret_type_display_name property value. User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Secret scanning patterns](https://docs.github.com/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)." +func (m *OrganizationSecretScanningAlert) SetSecretTypeDisplayName(value *string)() { + m.secret_type_display_name = value +} +// SetState sets the state property value. Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. +func (m *OrganizationSecretScanningAlert) SetState(value *SecretScanningAlertState)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *OrganizationSecretScanningAlert) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The REST API URL of the alert resource. +func (m *OrganizationSecretScanningAlert) SetUrl(value *string)() { + m.url = value +} +// SetValidity sets the validity property value. The token status as of the latest validity check. +func (m *OrganizationSecretScanningAlert) SetValidity(value *OrganizationSecretScanningAlert_validity)() { + m.validity = value +} +type OrganizationSecretScanningAlertable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetLocationsUrl()(*string) + GetNumber()(*int32) + GetPushProtectionBypassed()(*bool) + GetPushProtectionBypassedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetPushProtectionBypassedBy()(NullableSimpleUserable) + GetRepository()(SimpleRepositoryable) + GetResolution()(*SecretScanningAlertResolution) + GetResolutionComment()(*string) + GetResolvedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetResolvedBy()(NullableSimpleUserable) + GetSecret()(*string) + GetSecretType()(*string) + GetSecretTypeDisplayName()(*string) + GetState()(*SecretScanningAlertState) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetValidity()(*OrganizationSecretScanningAlert_validity) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetLocationsUrl(value *string)() + SetNumber(value *int32)() + SetPushProtectionBypassed(value *bool)() + SetPushProtectionBypassedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetPushProtectionBypassedBy(value NullableSimpleUserable)() + SetRepository(value SimpleRepositoryable)() + SetResolution(value *SecretScanningAlertResolution)() + SetResolutionComment(value *string)() + SetResolvedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetResolvedBy(value NullableSimpleUserable)() + SetSecret(value *string)() + SetSecretType(value *string)() + SetSecretTypeDisplayName(value *string)() + SetState(value *SecretScanningAlertState)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetValidity(value *OrganizationSecretScanningAlert_validity)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_secret_scanning_alert_validity.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_secret_scanning_alert_validity.go new file mode 100644 index 000000000..4fc12b76c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_secret_scanning_alert_validity.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The token status as of the latest validity check. +type OrganizationSecretScanningAlert_validity int + +const ( + ACTIVE_ORGANIZATIONSECRETSCANNINGALERT_VALIDITY OrganizationSecretScanningAlert_validity = iota + INACTIVE_ORGANIZATIONSECRETSCANNINGALERT_VALIDITY + UNKNOWN_ORGANIZATIONSECRETSCANNINGALERT_VALIDITY +) + +func (i OrganizationSecretScanningAlert_validity) String() string { + return []string{"active", "inactive", "unknown"}[i] +} +func ParseOrganizationSecretScanningAlert_validity(v string) (any, error) { + result := ACTIVE_ORGANIZATIONSECRETSCANNINGALERT_VALIDITY + switch v { + case "active": + result = ACTIVE_ORGANIZATIONSECRETSCANNINGALERT_VALIDITY + case "inactive": + result = INACTIVE_ORGANIZATIONSECRETSCANNINGALERT_VALIDITY + case "unknown": + result = UNKNOWN_ORGANIZATIONSECRETSCANNINGALERT_VALIDITY + default: + return 0, errors.New("Unknown OrganizationSecretScanningAlert_validity value: " + v) + } + return &result, nil +} +func SerializeOrganizationSecretScanningAlert_validity(values []OrganizationSecretScanningAlert_validity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrganizationSecretScanningAlert_validity) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_simple.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_simple.go new file mode 100644 index 000000000..e6568d26a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/organization_simple.go @@ -0,0 +1,400 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationSimple a GitHub organization. +type OrganizationSimple struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The description property + description *string + // The events_url property + events_url *string + // The hooks_url property + hooks_url *string + // The id property + id *int32 + // The issues_url property + issues_url *string + // The login property + login *string + // The members_url property + members_url *string + // The node_id property + node_id *string + // The public_members_url property + public_members_url *string + // The repos_url property + repos_url *string + // The url property + url *string +} +// NewOrganizationSimple instantiates a new OrganizationSimple and sets the default values. +func NewOrganizationSimple()(*OrganizationSimple) { + m := &OrganizationSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationSimple(), 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 *OrganizationSimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *OrganizationSimple) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *OrganizationSimple) GetDescription()(*string) { + return m.description +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *OrganizationSimple) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["public_members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicMembersUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *OrganizationSimple) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *OrganizationSimple) GetId()(*int32) { + return m.id +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *OrganizationSimple) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *OrganizationSimple) GetLogin()(*string) { + return m.login +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *OrganizationSimple) GetMembersUrl()(*string) { + return m.members_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *OrganizationSimple) GetNodeId()(*string) { + return m.node_id +} +// GetPublicMembersUrl gets the public_members_url property value. The public_members_url property +// returns a *string when successful +func (m *OrganizationSimple) GetPublicMembersUrl()(*string) { + return m.public_members_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *OrganizationSimple) GetReposUrl()(*string) { + return m.repos_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *OrganizationSimple) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *OrganizationSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("public_members_url", m.GetPublicMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *OrganizationSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *OrganizationSimple) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetDescription sets the description property value. The description property +func (m *OrganizationSimple) SetDescription(value *string)() { + m.description = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *OrganizationSimple) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *OrganizationSimple) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetId sets the id property value. The id property +func (m *OrganizationSimple) SetId(value *int32)() { + m.id = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *OrganizationSimple) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetLogin sets the login property value. The login property +func (m *OrganizationSimple) SetLogin(value *string)() { + m.login = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *OrganizationSimple) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *OrganizationSimple) SetNodeId(value *string)() { + m.node_id = value +} +// SetPublicMembersUrl sets the public_members_url property value. The public_members_url property +func (m *OrganizationSimple) SetPublicMembersUrl(value *string)() { + m.public_members_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *OrganizationSimple) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetUrl sets the url property value. The url property +func (m *OrganizationSimple) SetUrl(value *string)() { + m.url = value +} +type OrganizationSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetDescription()(*string) + GetEventsUrl()(*string) + GetHooksUrl()(*string) + GetId()(*int32) + GetIssuesUrl()(*string) + GetLogin()(*string) + GetMembersUrl()(*string) + GetNodeId()(*string) + GetPublicMembersUrl()(*string) + GetReposUrl()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetDescription(value *string)() + SetEventsUrl(value *string)() + SetHooksUrl(value *string)() + SetId(value *int32)() + SetIssuesUrl(value *string)() + SetLogin(value *string)() + SetMembersUrl(value *string)() + SetNodeId(value *string)() + SetPublicMembersUrl(value *string)() + SetReposUrl(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/package_escaped.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/package_escaped.go new file mode 100644 index 000000000..d32fe6a33 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/package_escaped.go @@ -0,0 +1,374 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PackageEscaped a software package +type PackageEscaped struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The html_url property + html_url *string + // Unique identifier of the package. + id *int32 + // The name of the package. + name *string + // A GitHub user. + owner NullableSimpleUserable + // The package_type property + package_type *Package_package_type + // Minimal Repository + repository NullableMinimalRepositoryable + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The number of versions of the package. + version_count *int32 + // The visibility property + visibility *Package_visibility +} +// NewPackageEscaped instantiates a new PackageEscaped and sets the default values. +func NewPackageEscaped()(*PackageEscaped) { + m := &PackageEscaped{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePackageEscapedFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePackageEscapedFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPackageEscaped(), 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 *PackageEscaped) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PackageEscaped) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PackageEscaped) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(NullableSimpleUserable)) + } + return nil + } + res["package_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePackage_package_type) + if err != nil { + return err + } + if val != nil { + m.SetPackageType(val.(*Package_package_type)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(NullableMinimalRepositoryable)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["version_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetVersionCount(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePackage_visibility) + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val.(*Package_visibility)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PackageEscaped) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the package. +// returns a *int32 when successful +func (m *PackageEscaped) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name of the package. +// returns a *string when successful +func (m *PackageEscaped) GetName()(*string) { + return m.name +} +// GetOwner gets the owner property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PackageEscaped) GetOwner()(NullableSimpleUserable) { + return m.owner +} +// GetPackageType gets the package_type property value. The package_type property +// returns a *Package_package_type when successful +func (m *PackageEscaped) GetPackageType()(*Package_package_type) { + return m.package_type +} +// GetRepository gets the repository property value. Minimal Repository +// returns a NullableMinimalRepositoryable when successful +func (m *PackageEscaped) GetRepository()(NullableMinimalRepositoryable) { + return m.repository +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PackageEscaped) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PackageEscaped) GetUrl()(*string) { + return m.url +} +// GetVersionCount gets the version_count property value. The number of versions of the package. +// returns a *int32 when successful +func (m *PackageEscaped) GetVersionCount()(*int32) { + return m.version_count +} +// GetVisibility gets the visibility property value. The visibility property +// returns a *Package_visibility when successful +func (m *PackageEscaped) GetVisibility()(*Package_visibility) { + return m.visibility +} +// Serialize serializes information the current object +func (m *PackageEscaped) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + if m.GetPackageType() != nil { + cast := (*m.GetPackageType()).String() + err := writer.WriteStringValue("package_type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("version_count", m.GetVersionCount()) + if err != nil { + return err + } + } + if m.GetVisibility() != nil { + cast := (*m.GetVisibility()).String() + err := writer.WriteStringValue("visibility", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *PackageEscaped) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PackageEscaped) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PackageEscaped) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the package. +func (m *PackageEscaped) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name of the package. +func (m *PackageEscaped) SetName(value *string)() { + m.name = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *PackageEscaped) SetOwner(value NullableSimpleUserable)() { + m.owner = value +} +// SetPackageType sets the package_type property value. The package_type property +func (m *PackageEscaped) SetPackageType(value *Package_package_type)() { + m.package_type = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *PackageEscaped) SetRepository(value NullableMinimalRepositoryable)() { + m.repository = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PackageEscaped) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PackageEscaped) SetUrl(value *string)() { + m.url = value +} +// SetVersionCount sets the version_count property value. The number of versions of the package. +func (m *PackageEscaped) SetVersionCount(value *int32)() { + m.version_count = value +} +// SetVisibility sets the visibility property value. The visibility property +func (m *PackageEscaped) SetVisibility(value *Package_visibility)() { + m.visibility = value +} +type PackageEscapedable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetId()(*int32) + GetName()(*string) + GetOwner()(NullableSimpleUserable) + GetPackageType()(*Package_package_type) + GetRepository()(NullableMinimalRepositoryable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetVersionCount()(*int32) + GetVisibility()(*Package_visibility) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetOwner(value NullableSimpleUserable)() + SetPackageType(value *Package_package_type)() + SetRepository(value NullableMinimalRepositoryable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetVersionCount(value *int32)() + SetVisibility(value *Package_visibility)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/package_package_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/package_package_type.go new file mode 100644 index 000000000..cee351391 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/package_package_type.go @@ -0,0 +1,48 @@ +package models +import ( + "errors" +) +type Package_package_type int + +const ( + NPM_PACKAGE_PACKAGE_TYPE Package_package_type = iota + MAVEN_PACKAGE_PACKAGE_TYPE + RUBYGEMS_PACKAGE_PACKAGE_TYPE + DOCKER_PACKAGE_PACKAGE_TYPE + NUGET_PACKAGE_PACKAGE_TYPE + CONTAINER_PACKAGE_PACKAGE_TYPE +) + +func (i Package_package_type) String() string { + return []string{"npm", "maven", "rubygems", "docker", "nuget", "container"}[i] +} +func ParsePackage_package_type(v string) (any, error) { + result := NPM_PACKAGE_PACKAGE_TYPE + switch v { + case "npm": + result = NPM_PACKAGE_PACKAGE_TYPE + case "maven": + result = MAVEN_PACKAGE_PACKAGE_TYPE + case "rubygems": + result = RUBYGEMS_PACKAGE_PACKAGE_TYPE + case "docker": + result = DOCKER_PACKAGE_PACKAGE_TYPE + case "nuget": + result = NUGET_PACKAGE_PACKAGE_TYPE + case "container": + result = CONTAINER_PACKAGE_PACKAGE_TYPE + default: + return 0, errors.New("Unknown Package_package_type value: " + v) + } + return &result, nil +} +func SerializePackage_package_type(values []Package_package_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Package_package_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/package_version.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/package_version.go new file mode 100644 index 000000000..3373e88be --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/package_version.go @@ -0,0 +1,372 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PackageVersion a version of a software package +type PackageVersion struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The deleted_at property + deleted_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The description property + description *string + // The html_url property + html_url *string + // Unique identifier of the package version. + id *int32 + // The license property + license *string + // The metadata property + metadata PackageVersion_metadataable + // The name of the package version. + name *string + // The package_html_url property + package_html_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewPackageVersion instantiates a new PackageVersion and sets the default values. +func NewPackageVersion()(*PackageVersion) { + m := &PackageVersion{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePackageVersionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePackageVersionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPackageVersion(), 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 *PackageVersion) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PackageVersion) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDeletedAt gets the deleted_at property value. The deleted_at property +// returns a *Time when successful +func (m *PackageVersion) GetDeletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.deleted_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *PackageVersion) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PackageVersion) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["deleted_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDeletedAt(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLicense(val) + } + return nil + } + res["metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePackageVersion_metadataFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMetadata(val.(PackageVersion_metadataable)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["package_html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPackageHtmlUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PackageVersion) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the package version. +// returns a *int32 when successful +func (m *PackageVersion) GetId()(*int32) { + return m.id +} +// GetLicense gets the license property value. The license property +// returns a *string when successful +func (m *PackageVersion) GetLicense()(*string) { + return m.license +} +// GetMetadata gets the metadata property value. The metadata property +// returns a PackageVersion_metadataable when successful +func (m *PackageVersion) GetMetadata()(PackageVersion_metadataable) { + return m.metadata +} +// GetName gets the name property value. The name of the package version. +// returns a *string when successful +func (m *PackageVersion) GetName()(*string) { + return m.name +} +// GetPackageHtmlUrl gets the package_html_url property value. The package_html_url property +// returns a *string when successful +func (m *PackageVersion) GetPackageHtmlUrl()(*string) { + return m.package_html_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PackageVersion) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PackageVersion) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PackageVersion) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("deleted_at", m.GetDeletedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("metadata", m.GetMetadata()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("package_html_url", m.GetPackageHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PackageVersion) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PackageVersion) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDeletedAt sets the deleted_at property value. The deleted_at property +func (m *PackageVersion) SetDeletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.deleted_at = value +} +// SetDescription sets the description property value. The description property +func (m *PackageVersion) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PackageVersion) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the package version. +func (m *PackageVersion) SetId(value *int32)() { + m.id = value +} +// SetLicense sets the license property value. The license property +func (m *PackageVersion) SetLicense(value *string)() { + m.license = value +} +// SetMetadata sets the metadata property value. The metadata property +func (m *PackageVersion) SetMetadata(value PackageVersion_metadataable)() { + m.metadata = value +} +// SetName sets the name property value. The name of the package version. +func (m *PackageVersion) SetName(value *string)() { + m.name = value +} +// SetPackageHtmlUrl sets the package_html_url property value. The package_html_url property +func (m *PackageVersion) SetPackageHtmlUrl(value *string)() { + m.package_html_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PackageVersion) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PackageVersion) SetUrl(value *string)() { + m.url = value +} +type PackageVersionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDeletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLicense()(*string) + GetMetadata()(PackageVersion_metadataable) + GetName()(*string) + GetPackageHtmlUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDeletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLicense(value *string)() + SetMetadata(value PackageVersion_metadataable)() + SetName(value *string)() + SetPackageHtmlUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/package_version_metadata.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/package_version_metadata.go new file mode 100644 index 000000000..fe42fb0c3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/package_version_metadata.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PackageVersion_metadata struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The container property + container PackageVersion_metadata_containerable + // The docker property + docker PackageVersion_metadata_dockerable + // The package_type property + package_type *PackageVersion_metadata_package_type +} +// NewPackageVersion_metadata instantiates a new PackageVersion_metadata and sets the default values. +func NewPackageVersion_metadata()(*PackageVersion_metadata) { + m := &PackageVersion_metadata{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePackageVersion_metadataFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePackageVersion_metadataFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPackageVersion_metadata(), 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 *PackageVersion_metadata) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContainer gets the container property value. The container property +// returns a PackageVersion_metadata_containerable when successful +func (m *PackageVersion_metadata) GetContainer()(PackageVersion_metadata_containerable) { + return m.container +} +// GetDocker gets the docker property value. The docker property +// returns a PackageVersion_metadata_dockerable when successful +func (m *PackageVersion_metadata) GetDocker()(PackageVersion_metadata_dockerable) { + return m.docker +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PackageVersion_metadata) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["container"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePackageVersion_metadata_containerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetContainer(val.(PackageVersion_metadata_containerable)) + } + return nil + } + res["docker"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePackageVersion_metadata_dockerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDocker(val.(PackageVersion_metadata_dockerable)) + } + return nil + } + res["package_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePackageVersion_metadata_package_type) + if err != nil { + return err + } + if val != nil { + m.SetPackageType(val.(*PackageVersion_metadata_package_type)) + } + return nil + } + return res +} +// GetPackageType gets the package_type property value. The package_type property +// returns a *PackageVersion_metadata_package_type when successful +func (m *PackageVersion_metadata) GetPackageType()(*PackageVersion_metadata_package_type) { + return m.package_type +} +// Serialize serializes information the current object +func (m *PackageVersion_metadata) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("container", m.GetContainer()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("docker", m.GetDocker()) + if err != nil { + return err + } + } + if m.GetPackageType() != nil { + cast := (*m.GetPackageType()).String() + err := writer.WriteStringValue("package_type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *PackageVersion_metadata) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContainer sets the container property value. The container property +func (m *PackageVersion_metadata) SetContainer(value PackageVersion_metadata_containerable)() { + m.container = value +} +// SetDocker sets the docker property value. The docker property +func (m *PackageVersion_metadata) SetDocker(value PackageVersion_metadata_dockerable)() { + m.docker = value +} +// SetPackageType sets the package_type property value. The package_type property +func (m *PackageVersion_metadata) SetPackageType(value *PackageVersion_metadata_package_type)() { + m.package_type = value +} +type PackageVersion_metadataable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContainer()(PackageVersion_metadata_containerable) + GetDocker()(PackageVersion_metadata_dockerable) + GetPackageType()(*PackageVersion_metadata_package_type) + SetContainer(value PackageVersion_metadata_containerable)() + SetDocker(value PackageVersion_metadata_dockerable)() + SetPackageType(value *PackageVersion_metadata_package_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/package_version_metadata_container.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/package_version_metadata_container.go new file mode 100644 index 000000000..8271a0712 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/package_version_metadata_container.go @@ -0,0 +1,86 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PackageVersion_metadata_container struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The tags property + tags []string +} +// NewPackageVersion_metadata_container instantiates a new PackageVersion_metadata_container and sets the default values. +func NewPackageVersion_metadata_container()(*PackageVersion_metadata_container) { + m := &PackageVersion_metadata_container{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePackageVersion_metadata_containerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePackageVersion_metadata_containerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPackageVersion_metadata_container(), 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 *PackageVersion_metadata_container) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PackageVersion_metadata_container) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["tags"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTags(res) + } + return nil + } + return res +} +// GetTags gets the tags property value. The tags property +// returns a []string when successful +func (m *PackageVersion_metadata_container) GetTags()([]string) { + return m.tags +} +// Serialize serializes information the current object +func (m *PackageVersion_metadata_container) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTags() != nil { + err := writer.WriteCollectionOfStringValues("tags", m.GetTags()) + 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 *PackageVersion_metadata_container) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTags sets the tags property value. The tags property +func (m *PackageVersion_metadata_container) SetTags(value []string)() { + m.tags = value +} +type PackageVersion_metadata_containerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTags()([]string) + SetTags(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/package_version_metadata_docker.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/package_version_metadata_docker.go new file mode 100644 index 000000000..e380dcd53 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/package_version_metadata_docker.go @@ -0,0 +1,86 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PackageVersion_metadata_docker struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The tag property + tag []string +} +// NewPackageVersion_metadata_docker instantiates a new PackageVersion_metadata_docker and sets the default values. +func NewPackageVersion_metadata_docker()(*PackageVersion_metadata_docker) { + m := &PackageVersion_metadata_docker{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePackageVersion_metadata_dockerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePackageVersion_metadata_dockerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPackageVersion_metadata_docker(), 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 *PackageVersion_metadata_docker) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PackageVersion_metadata_docker) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["tag"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTag(res) + } + return nil + } + return res +} +// GetTag gets the tag property value. The tag property +// returns a []string when successful +func (m *PackageVersion_metadata_docker) GetTag()([]string) { + return m.tag +} +// Serialize serializes information the current object +func (m *PackageVersion_metadata_docker) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTag() != nil { + err := writer.WriteCollectionOfStringValues("tag", m.GetTag()) + 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 *PackageVersion_metadata_docker) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTag sets the tag property value. The tag property +func (m *PackageVersion_metadata_docker) SetTag(value []string)() { + m.tag = value +} +type PackageVersion_metadata_dockerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTag()([]string) + SetTag(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/package_version_metadata_package_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/package_version_metadata_package_type.go new file mode 100644 index 000000000..56d93a533 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/package_version_metadata_package_type.go @@ -0,0 +1,48 @@ +package models +import ( + "errors" +) +type PackageVersion_metadata_package_type int + +const ( + NPM_PACKAGEVERSION_METADATA_PACKAGE_TYPE PackageVersion_metadata_package_type = iota + MAVEN_PACKAGEVERSION_METADATA_PACKAGE_TYPE + RUBYGEMS_PACKAGEVERSION_METADATA_PACKAGE_TYPE + DOCKER_PACKAGEVERSION_METADATA_PACKAGE_TYPE + NUGET_PACKAGEVERSION_METADATA_PACKAGE_TYPE + CONTAINER_PACKAGEVERSION_METADATA_PACKAGE_TYPE +) + +func (i PackageVersion_metadata_package_type) String() string { + return []string{"npm", "maven", "rubygems", "docker", "nuget", "container"}[i] +} +func ParsePackageVersion_metadata_package_type(v string) (any, error) { + result := NPM_PACKAGEVERSION_METADATA_PACKAGE_TYPE + switch v { + case "npm": + result = NPM_PACKAGEVERSION_METADATA_PACKAGE_TYPE + case "maven": + result = MAVEN_PACKAGEVERSION_METADATA_PACKAGE_TYPE + case "rubygems": + result = RUBYGEMS_PACKAGEVERSION_METADATA_PACKAGE_TYPE + case "docker": + result = DOCKER_PACKAGEVERSION_METADATA_PACKAGE_TYPE + case "nuget": + result = NUGET_PACKAGEVERSION_METADATA_PACKAGE_TYPE + case "container": + result = CONTAINER_PACKAGEVERSION_METADATA_PACKAGE_TYPE + default: + return 0, errors.New("Unknown PackageVersion_metadata_package_type value: " + v) + } + return &result, nil +} +func SerializePackageVersion_metadata_package_type(values []PackageVersion_metadata_package_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PackageVersion_metadata_package_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/package_visibility.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/package_visibility.go new file mode 100644 index 000000000..fed8e15c2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/package_visibility.go @@ -0,0 +1,36 @@ +package models +import ( + "errors" +) +type Package_visibility int + +const ( + PRIVATE_PACKAGE_VISIBILITY Package_visibility = iota + PUBLIC_PACKAGE_VISIBILITY +) + +func (i Package_visibility) String() string { + return []string{"private", "public"}[i] +} +func ParsePackage_visibility(v string) (any, error) { + result := PRIVATE_PACKAGE_VISIBILITY + switch v { + case "private": + result = PRIVATE_PACKAGE_VISIBILITY + case "public": + result = PUBLIC_PACKAGE_VISIBILITY + default: + return 0, errors.New("Unknown Package_visibility value: " + v) + } + return &result, nil +} +func SerializePackage_visibility(values []Package_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Package_visibility) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/packages_billing_usage.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/packages_billing_usage.go new file mode 100644 index 000000000..04d36e0c7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/packages_billing_usage.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PackagesBillingUsage struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Free storage space (GB) for GitHub Packages. + included_gigabytes_bandwidth *int32 + // Sum of the free and paid storage space (GB) for GitHuub Packages. + total_gigabytes_bandwidth_used *int32 + // Total paid storage space (GB) for GitHuub Packages. + total_paid_gigabytes_bandwidth_used *int32 +} +// NewPackagesBillingUsage instantiates a new PackagesBillingUsage and sets the default values. +func NewPackagesBillingUsage()(*PackagesBillingUsage) { + m := &PackagesBillingUsage{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePackagesBillingUsageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePackagesBillingUsageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPackagesBillingUsage(), 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 *PackagesBillingUsage) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PackagesBillingUsage) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["included_gigabytes_bandwidth"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetIncludedGigabytesBandwidth(val) + } + return nil + } + res["total_gigabytes_bandwidth_used"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalGigabytesBandwidthUsed(val) + } + return nil + } + res["total_paid_gigabytes_bandwidth_used"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalPaidGigabytesBandwidthUsed(val) + } + return nil + } + return res +} +// GetIncludedGigabytesBandwidth gets the included_gigabytes_bandwidth property value. Free storage space (GB) for GitHub Packages. +// returns a *int32 when successful +func (m *PackagesBillingUsage) GetIncludedGigabytesBandwidth()(*int32) { + return m.included_gigabytes_bandwidth +} +// GetTotalGigabytesBandwidthUsed gets the total_gigabytes_bandwidth_used property value. Sum of the free and paid storage space (GB) for GitHuub Packages. +// returns a *int32 when successful +func (m *PackagesBillingUsage) GetTotalGigabytesBandwidthUsed()(*int32) { + return m.total_gigabytes_bandwidth_used +} +// GetTotalPaidGigabytesBandwidthUsed gets the total_paid_gigabytes_bandwidth_used property value. Total paid storage space (GB) for GitHuub Packages. +// returns a *int32 when successful +func (m *PackagesBillingUsage) GetTotalPaidGigabytesBandwidthUsed()(*int32) { + return m.total_paid_gigabytes_bandwidth_used +} +// Serialize serializes information the current object +func (m *PackagesBillingUsage) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("included_gigabytes_bandwidth", m.GetIncludedGigabytesBandwidth()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_gigabytes_bandwidth_used", m.GetTotalGigabytesBandwidthUsed()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_paid_gigabytes_bandwidth_used", m.GetTotalPaidGigabytesBandwidthUsed()) + 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 *PackagesBillingUsage) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncludedGigabytesBandwidth sets the included_gigabytes_bandwidth property value. Free storage space (GB) for GitHub Packages. +func (m *PackagesBillingUsage) SetIncludedGigabytesBandwidth(value *int32)() { + m.included_gigabytes_bandwidth = value +} +// SetTotalGigabytesBandwidthUsed sets the total_gigabytes_bandwidth_used property value. Sum of the free and paid storage space (GB) for GitHuub Packages. +func (m *PackagesBillingUsage) SetTotalGigabytesBandwidthUsed(value *int32)() { + m.total_gigabytes_bandwidth_used = value +} +// SetTotalPaidGigabytesBandwidthUsed sets the total_paid_gigabytes_bandwidth_used property value. Total paid storage space (GB) for GitHuub Packages. +func (m *PackagesBillingUsage) SetTotalPaidGigabytesBandwidthUsed(value *int32)() { + m.total_paid_gigabytes_bandwidth_used = value +} +type PackagesBillingUsageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncludedGigabytesBandwidth()(*int32) + GetTotalGigabytesBandwidthUsed()(*int32) + GetTotalPaidGigabytesBandwidthUsed()(*int32) + SetIncludedGigabytesBandwidth(value *int32)() + SetTotalGigabytesBandwidthUsed(value *int32)() + SetTotalPaidGigabytesBandwidthUsed(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/page.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/page.go new file mode 100644 index 000000000..62c997abb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/page.go @@ -0,0 +1,404 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Page the configuration for GitHub Pages for a repository. +type Page struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The process in which the Page will be built. + build_type *Page_build_type + // The Pages site's custom domain + cname *string + // Whether the Page has a custom 404 page. + custom_404 *bool + // The web address the Page can be accessed from. + html_url *string + // The https_certificate property + https_certificate PagesHttpsCertificateable + // Whether https is enabled on the domain + https_enforced *bool + // The timestamp when a pending domain becomes unverified. + pending_domain_unverified_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The state if the domain is verified + protected_domain_state *Page_protected_domain_state + // Whether the GitHub Pages site is publicly visible. If set to `true`, the site is accessible to anyone on the internet. If set to `false`, the site will only be accessible to users who have at least `read` access to the repository that published the site. + public *bool + // The source property + source PagesSourceHashable + // The status of the most recent build of the Page. + status *Page_status + // The API address for accessing this Page resource. + url *string +} +// NewPage instantiates a new Page and sets the default values. +func NewPage()(*Page) { + m := &Page{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPage(), 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 *Page) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBuildType gets the build_type property value. The process in which the Page will be built. +// returns a *Page_build_type when successful +func (m *Page) GetBuildType()(*Page_build_type) { + return m.build_type +} +// GetCname gets the cname property value. The Pages site's custom domain +// returns a *string when successful +func (m *Page) GetCname()(*string) { + return m.cname +} +// GetCustom404 gets the custom_404 property value. Whether the Page has a custom 404 page. +// returns a *bool when successful +func (m *Page) GetCustom404()(*bool) { + return m.custom_404 +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Page) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["build_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePage_build_type) + if err != nil { + return err + } + if val != nil { + m.SetBuildType(val.(*Page_build_type)) + } + return nil + } + res["cname"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCname(val) + } + return nil + } + res["custom_404"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCustom404(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["https_certificate"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePagesHttpsCertificateFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHttpsCertificate(val.(PagesHttpsCertificateable)) + } + return nil + } + res["https_enforced"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHttpsEnforced(val) + } + return nil + } + res["pending_domain_unverified_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPendingDomainUnverifiedAt(val) + } + return nil + } + res["protected_domain_state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePage_protected_domain_state) + if err != nil { + return err + } + if val != nil { + m.SetProtectedDomainState(val.(*Page_protected_domain_state)) + } + return nil + } + res["public"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPublic(val) + } + return nil + } + res["source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePagesSourceHashFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSource(val.(PagesSourceHashable)) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePage_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*Page_status)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The web address the Page can be accessed from. +// returns a *string when successful +func (m *Page) GetHtmlUrl()(*string) { + return m.html_url +} +// GetHttpsCertificate gets the https_certificate property value. The https_certificate property +// returns a PagesHttpsCertificateable when successful +func (m *Page) GetHttpsCertificate()(PagesHttpsCertificateable) { + return m.https_certificate +} +// GetHttpsEnforced gets the https_enforced property value. Whether https is enabled on the domain +// returns a *bool when successful +func (m *Page) GetHttpsEnforced()(*bool) { + return m.https_enforced +} +// GetPendingDomainUnverifiedAt gets the pending_domain_unverified_at property value. The timestamp when a pending domain becomes unverified. +// returns a *Time when successful +func (m *Page) GetPendingDomainUnverifiedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pending_domain_unverified_at +} +// GetProtectedDomainState gets the protected_domain_state property value. The state if the domain is verified +// returns a *Page_protected_domain_state when successful +func (m *Page) GetProtectedDomainState()(*Page_protected_domain_state) { + return m.protected_domain_state +} +// GetPublic gets the public property value. Whether the GitHub Pages site is publicly visible. If set to `true`, the site is accessible to anyone on the internet. If set to `false`, the site will only be accessible to users who have at least `read` access to the repository that published the site. +// returns a *bool when successful +func (m *Page) GetPublic()(*bool) { + return m.public +} +// GetSource gets the source property value. The source property +// returns a PagesSourceHashable when successful +func (m *Page) GetSource()(PagesSourceHashable) { + return m.source +} +// GetStatus gets the status property value. The status of the most recent build of the Page. +// returns a *Page_status when successful +func (m *Page) GetStatus()(*Page_status) { + return m.status +} +// GetUrl gets the url property value. The API address for accessing this Page resource. +// returns a *string when successful +func (m *Page) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Page) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBuildType() != nil { + cast := (*m.GetBuildType()).String() + err := writer.WriteStringValue("build_type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("cname", m.GetCname()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("custom_404", m.GetCustom404()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("https_certificate", m.GetHttpsCertificate()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("https_enforced", m.GetHttpsEnforced()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pending_domain_unverified_at", m.GetPendingDomainUnverifiedAt()) + if err != nil { + return err + } + } + if m.GetProtectedDomainState() != nil { + cast := (*m.GetProtectedDomainState()).String() + err := writer.WriteStringValue("protected_domain_state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("public", m.GetPublic()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("source", m.GetSource()) + if err != nil { + return err + } + } + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err := writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Page) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBuildType sets the build_type property value. The process in which the Page will be built. +func (m *Page) SetBuildType(value *Page_build_type)() { + m.build_type = value +} +// SetCname sets the cname property value. The Pages site's custom domain +func (m *Page) SetCname(value *string)() { + m.cname = value +} +// SetCustom404 sets the custom_404 property value. Whether the Page has a custom 404 page. +func (m *Page) SetCustom404(value *bool)() { + m.custom_404 = value +} +// SetHtmlUrl sets the html_url property value. The web address the Page can be accessed from. +func (m *Page) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetHttpsCertificate sets the https_certificate property value. The https_certificate property +func (m *Page) SetHttpsCertificate(value PagesHttpsCertificateable)() { + m.https_certificate = value +} +// SetHttpsEnforced sets the https_enforced property value. Whether https is enabled on the domain +func (m *Page) SetHttpsEnforced(value *bool)() { + m.https_enforced = value +} +// SetPendingDomainUnverifiedAt sets the pending_domain_unverified_at property value. The timestamp when a pending domain becomes unverified. +func (m *Page) SetPendingDomainUnverifiedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pending_domain_unverified_at = value +} +// SetProtectedDomainState sets the protected_domain_state property value. The state if the domain is verified +func (m *Page) SetProtectedDomainState(value *Page_protected_domain_state)() { + m.protected_domain_state = value +} +// SetPublic sets the public property value. Whether the GitHub Pages site is publicly visible. If set to `true`, the site is accessible to anyone on the internet. If set to `false`, the site will only be accessible to users who have at least `read` access to the repository that published the site. +func (m *Page) SetPublic(value *bool)() { + m.public = value +} +// SetSource sets the source property value. The source property +func (m *Page) SetSource(value PagesSourceHashable)() { + m.source = value +} +// SetStatus sets the status property value. The status of the most recent build of the Page. +func (m *Page) SetStatus(value *Page_status)() { + m.status = value +} +// SetUrl sets the url property value. The API address for accessing this Page resource. +func (m *Page) SetUrl(value *string)() { + m.url = value +} +type Pageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBuildType()(*Page_build_type) + GetCname()(*string) + GetCustom404()(*bool) + GetHtmlUrl()(*string) + GetHttpsCertificate()(PagesHttpsCertificateable) + GetHttpsEnforced()(*bool) + GetPendingDomainUnverifiedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetProtectedDomainState()(*Page_protected_domain_state) + GetPublic()(*bool) + GetSource()(PagesSourceHashable) + GetStatus()(*Page_status) + GetUrl()(*string) + SetBuildType(value *Page_build_type)() + SetCname(value *string)() + SetCustom404(value *bool)() + SetHtmlUrl(value *string)() + SetHttpsCertificate(value PagesHttpsCertificateable)() + SetHttpsEnforced(value *bool)() + SetPendingDomainUnverifiedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetProtectedDomainState(value *Page_protected_domain_state)() + SetPublic(value *bool)() + SetSource(value PagesSourceHashable)() + SetStatus(value *Page_status)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/page_build.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/page_build.go new file mode 100644 index 000000000..d56a59675 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/page_build.go @@ -0,0 +1,285 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PageBuild page Build +type PageBuild struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit property + commit *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The duration property + duration *int32 + // The error property + error PageBuild_errorable + // A GitHub user. + pusher NullableSimpleUserable + // The status property + status *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewPageBuild instantiates a new PageBuild and sets the default values. +func NewPageBuild()(*PageBuild) { + m := &PageBuild{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePageBuildFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePageBuildFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPageBuild(), 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 *PageBuild) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommit gets the commit property value. The commit property +// returns a *string when successful +func (m *PageBuild) GetCommit()(*string) { + return m.commit +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PageBuild) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDuration gets the duration property value. The duration property +// returns a *int32 when successful +func (m *PageBuild) GetDuration()(*int32) { + return m.duration +} +// GetError gets the error property value. The error property +// returns a PageBuild_errorable when successful +func (m *PageBuild) GetError()(PageBuild_errorable) { + return m.error +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PageBuild) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommit(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["duration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDuration(val) + } + return nil + } + res["error"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePageBuild_errorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetError(val.(PageBuild_errorable)) + } + return nil + } + res["pusher"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPusher(val.(NullableSimpleUserable)) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetPusher gets the pusher property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PageBuild) GetPusher()(NullableSimpleUserable) { + return m.pusher +} +// GetStatus gets the status property value. The status property +// returns a *string when successful +func (m *PageBuild) GetStatus()(*string) { + return m.status +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PageBuild) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PageBuild) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PageBuild) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("commit", m.GetCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("duration", m.GetDuration()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("error", m.GetError()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pusher", m.GetPusher()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status", m.GetStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PageBuild) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommit sets the commit property value. The commit property +func (m *PageBuild) SetCommit(value *string)() { + m.commit = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PageBuild) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDuration sets the duration property value. The duration property +func (m *PageBuild) SetDuration(value *int32)() { + m.duration = value +} +// SetError sets the error property value. The error property +func (m *PageBuild) SetError(value PageBuild_errorable)() { + m.error = value +} +// SetPusher sets the pusher property value. A GitHub user. +func (m *PageBuild) SetPusher(value NullableSimpleUserable)() { + m.pusher = value +} +// SetStatus sets the status property value. The status property +func (m *PageBuild) SetStatus(value *string)() { + m.status = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PageBuild) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PageBuild) SetUrl(value *string)() { + m.url = value +} +type PageBuildable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommit()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDuration()(*int32) + GetError()(PageBuild_errorable) + GetPusher()(NullableSimpleUserable) + GetStatus()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCommit(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDuration(value *int32)() + SetError(value PageBuild_errorable)() + SetPusher(value NullableSimpleUserable)() + SetStatus(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/page_build_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/page_build_error.go new file mode 100644 index 000000000..243336d88 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/page_build_error.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PageBuild_error struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The message property + message *string +} +// NewPageBuild_error instantiates a new PageBuild_error and sets the default values. +func NewPageBuild_error()(*PageBuild_error) { + m := &PageBuild_error{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePageBuild_errorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePageBuild_errorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPageBuild_error(), 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 *PageBuild_error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PageBuild_error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *PageBuild_error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *PageBuild_error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *PageBuild_error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. The message property +func (m *PageBuild_error) SetMessage(value *string)() { + m.message = value +} +type PageBuild_errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/page_build_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/page_build_status.go new file mode 100644 index 000000000..103d32ab3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/page_build_status.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PageBuildStatus page Build Status +type PageBuildStatus struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The status property + status *string + // The url property + url *string +} +// NewPageBuildStatus instantiates a new PageBuildStatus and sets the default values. +func NewPageBuildStatus()(*PageBuildStatus) { + m := &PageBuildStatus{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePageBuildStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePageBuildStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPageBuildStatus(), 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 *PageBuildStatus) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PageBuildStatus) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetStatus gets the status property value. The status property +// returns a *string when successful +func (m *PageBuildStatus) GetStatus()(*string) { + return m.status +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PageBuildStatus) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PageBuildStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("status", m.GetStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PageBuildStatus) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. The status property +func (m *PageBuildStatus) SetStatus(value *string)() { + m.status = value +} +// SetUrl sets the url property value. The url property +func (m *PageBuildStatus) SetUrl(value *string)() { + m.url = value +} +type PageBuildStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*string) + GetUrl()(*string) + SetStatus(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/page_build_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/page_build_type.go new file mode 100644 index 000000000..7c4faf248 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/page_build_type.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The process in which the Page will be built. +type Page_build_type int + +const ( + LEGACY_PAGE_BUILD_TYPE Page_build_type = iota + WORKFLOW_PAGE_BUILD_TYPE +) + +func (i Page_build_type) String() string { + return []string{"legacy", "workflow"}[i] +} +func ParsePage_build_type(v string) (any, error) { + result := LEGACY_PAGE_BUILD_TYPE + switch v { + case "legacy": + result = LEGACY_PAGE_BUILD_TYPE + case "workflow": + result = WORKFLOW_PAGE_BUILD_TYPE + default: + return 0, errors.New("Unknown Page_build_type value: " + v) + } + return &result, nil +} +func SerializePage_build_type(values []Page_build_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Page_build_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/page_deployment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/page_deployment.go new file mode 100644 index 000000000..6fc5d249c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/page_deployment.go @@ -0,0 +1,262 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PageDeployment the GitHub Pages deployment status. +type PageDeployment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The ID of the GitHub Pages deployment. This is the Git SHA of the deployed commit. + id PageDeployment_PageDeployment_idable + // The URI to the deployed GitHub Pages. + page_url *string + // The URI to the deployed GitHub Pages preview. + preview_url *string + // The URI to monitor GitHub Pages deployment status. + status_url *string +} +// PageDeployment_PageDeployment_id composed type wrapper for classes int32, string +type PageDeployment_PageDeployment_id struct { + // Composed type representation for type int32 + integer *int32 + // Composed type representation for type string + string *string +} +// NewPageDeployment_PageDeployment_id instantiates a new PageDeployment_PageDeployment_id and sets the default values. +func NewPageDeployment_PageDeployment_id()(*PageDeployment_PageDeployment_id) { + m := &PageDeployment_PageDeployment_id{ + } + return m +} +// CreatePageDeployment_PageDeployment_idFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePageDeployment_PageDeployment_idFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewPageDeployment_PageDeployment_id() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetInt32Value(); val != nil { + if err != nil { + return nil, err + } + result.SetInteger(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PageDeployment_PageDeployment_id) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetInteger gets the integer property value. Composed type representation for type int32 +// returns a *int32 when successful +func (m *PageDeployment_PageDeployment_id) GetInteger()(*int32) { + return m.integer +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *PageDeployment_PageDeployment_id) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *PageDeployment_PageDeployment_id) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *PageDeployment_PageDeployment_id) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInteger() != nil { + err := writer.WriteInt32Value("", m.GetInteger()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetInteger sets the integer property value. Composed type representation for type int32 +func (m *PageDeployment_PageDeployment_id) SetInteger(value *int32)() { + m.integer = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *PageDeployment_PageDeployment_id) SetString(value *string)() { + m.string = value +} +type PageDeployment_PageDeployment_idable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInteger()(*int32) + GetString()(*string) + SetInteger(value *int32)() + SetString(value *string)() +} +// NewPageDeployment instantiates a new PageDeployment and sets the default values. +func NewPageDeployment()(*PageDeployment) { + m := &PageDeployment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePageDeploymentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePageDeploymentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPageDeployment(), 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 *PageDeployment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PageDeployment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePageDeployment_PageDeployment_idFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetId(val.(PageDeployment_PageDeployment_idable)) + } + 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["preview_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviewUrl(val) + } + return nil + } + res["status_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The ID of the GitHub Pages deployment. This is the Git SHA of the deployed commit. +// returns a PageDeployment_PageDeployment_idable when successful +func (m *PageDeployment) GetId()(PageDeployment_PageDeployment_idable) { + return m.id +} +// GetPageUrl gets the page_url property value. The URI to the deployed GitHub Pages. +// returns a *string when successful +func (m *PageDeployment) GetPageUrl()(*string) { + return m.page_url +} +// GetPreviewUrl gets the preview_url property value. The URI to the deployed GitHub Pages preview. +// returns a *string when successful +func (m *PageDeployment) GetPreviewUrl()(*string) { + return m.preview_url +} +// GetStatusUrl gets the status_url property value. The URI to monitor GitHub Pages deployment status. +// returns a *string when successful +func (m *PageDeployment) GetStatusUrl()(*string) { + return m.status_url +} +// Serialize serializes information the current object +func (m *PageDeployment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("page_url", m.GetPageUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("preview_url", m.GetPreviewUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status_url", m.GetStatusUrl()) + 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 *PageDeployment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The ID of the GitHub Pages deployment. This is the Git SHA of the deployed commit. +func (m *PageDeployment) SetId(value PageDeployment_PageDeployment_idable)() { + m.id = value +} +// SetPageUrl sets the page_url property value. The URI to the deployed GitHub Pages. +func (m *PageDeployment) SetPageUrl(value *string)() { + m.page_url = value +} +// SetPreviewUrl sets the preview_url property value. The URI to the deployed GitHub Pages preview. +func (m *PageDeployment) SetPreviewUrl(value *string)() { + m.preview_url = value +} +// SetStatusUrl sets the status_url property value. The URI to monitor GitHub Pages deployment status. +func (m *PageDeployment) SetStatusUrl(value *string)() { + m.status_url = value +} +type PageDeploymentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(PageDeployment_PageDeployment_idable) + GetPageUrl()(*string) + GetPreviewUrl()(*string) + GetStatusUrl()(*string) + SetId(value PageDeployment_PageDeployment_idable)() + SetPageUrl(value *string)() + SetPreviewUrl(value *string)() + SetStatusUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/page_protected_domain_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/page_protected_domain_state.go new file mode 100644 index 000000000..c00a76351 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/page_protected_domain_state.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The state if the domain is verified +type Page_protected_domain_state int + +const ( + PENDING_PAGE_PROTECTED_DOMAIN_STATE Page_protected_domain_state = iota + VERIFIED_PAGE_PROTECTED_DOMAIN_STATE + UNVERIFIED_PAGE_PROTECTED_DOMAIN_STATE +) + +func (i Page_protected_domain_state) String() string { + return []string{"pending", "verified", "unverified"}[i] +} +func ParsePage_protected_domain_state(v string) (any, error) { + result := PENDING_PAGE_PROTECTED_DOMAIN_STATE + switch v { + case "pending": + result = PENDING_PAGE_PROTECTED_DOMAIN_STATE + case "verified": + result = VERIFIED_PAGE_PROTECTED_DOMAIN_STATE + case "unverified": + result = UNVERIFIED_PAGE_PROTECTED_DOMAIN_STATE + default: + return 0, errors.New("Unknown Page_protected_domain_state value: " + v) + } + return &result, nil +} +func SerializePage_protected_domain_state(values []Page_protected_domain_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Page_protected_domain_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/page_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/page_status.go new file mode 100644 index 000000000..5228e6924 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/page_status.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The status of the most recent build of the Page. +type Page_status int + +const ( + BUILT_PAGE_STATUS Page_status = iota + BUILDING_PAGE_STATUS + ERRORED_PAGE_STATUS +) + +func (i Page_status) String() string { + return []string{"built", "building", "errored"}[i] +} +func ParsePage_status(v string) (any, error) { + result := BUILT_PAGE_STATUS + switch v { + case "built": + result = BUILT_PAGE_STATUS + case "building": + result = BUILDING_PAGE_STATUS + case "errored": + result = ERRORED_PAGE_STATUS + default: + return 0, errors.New("Unknown Page_status value: " + v) + } + return &result, nil +} +func SerializePage_status(values []Page_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Page_status) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_deployment_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_deployment_status.go new file mode 100644 index 000000000..c039c5e28 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_deployment_status.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PagesDeploymentStatus struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The current status of the deployment. + status *PagesDeploymentStatus_status +} +// NewPagesDeploymentStatus instantiates a new PagesDeploymentStatus and sets the default values. +func NewPagesDeploymentStatus()(*PagesDeploymentStatus) { + m := &PagesDeploymentStatus{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePagesDeploymentStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePagesDeploymentStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPagesDeploymentStatus(), 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 *PagesDeploymentStatus) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PagesDeploymentStatus) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePagesDeploymentStatus_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*PagesDeploymentStatus_status)) + } + return nil + } + return res +} +// GetStatus gets the status property value. The current status of the deployment. +// returns a *PagesDeploymentStatus_status when successful +func (m *PagesDeploymentStatus) GetStatus()(*PagesDeploymentStatus_status) { + return m.status +} +// Serialize serializes information the current object +func (m *PagesDeploymentStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err := writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *PagesDeploymentStatus) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. The current status of the deployment. +func (m *PagesDeploymentStatus) SetStatus(value *PagesDeploymentStatus_status)() { + m.status = value +} +type PagesDeploymentStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*PagesDeploymentStatus_status) + SetStatus(value *PagesDeploymentStatus_status)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_deployment_status_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_deployment_status_status.go new file mode 100644 index 000000000..b284bc654 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_deployment_status_status.go @@ -0,0 +1,64 @@ +package models +import ( + "errors" +) +// The current status of the deployment. +type PagesDeploymentStatus_status int + +const ( + DEPLOYMENT_IN_PROGRESS_PAGESDEPLOYMENTSTATUS_STATUS PagesDeploymentStatus_status = iota + SYNCING_FILES_PAGESDEPLOYMENTSTATUS_STATUS + FINISHED_FILE_SYNC_PAGESDEPLOYMENTSTATUS_STATUS + UPDATING_PAGES_PAGESDEPLOYMENTSTATUS_STATUS + PURGING_CDN_PAGESDEPLOYMENTSTATUS_STATUS + DEPLOYMENT_CANCELLED_PAGESDEPLOYMENTSTATUS_STATUS + DEPLOYMENT_FAILED_PAGESDEPLOYMENTSTATUS_STATUS + DEPLOYMENT_CONTENT_FAILED_PAGESDEPLOYMENTSTATUS_STATUS + DEPLOYMENT_ATTEMPT_ERROR_PAGESDEPLOYMENTSTATUS_STATUS + DEPLOYMENT_LOST_PAGESDEPLOYMENTSTATUS_STATUS + SUCCEED_PAGESDEPLOYMENTSTATUS_STATUS +) + +func (i PagesDeploymentStatus_status) String() string { + return []string{"deployment_in_progress", "syncing_files", "finished_file_sync", "updating_pages", "purging_cdn", "deployment_cancelled", "deployment_failed", "deployment_content_failed", "deployment_attempt_error", "deployment_lost", "succeed"}[i] +} +func ParsePagesDeploymentStatus_status(v string) (any, error) { + result := DEPLOYMENT_IN_PROGRESS_PAGESDEPLOYMENTSTATUS_STATUS + switch v { + case "deployment_in_progress": + result = DEPLOYMENT_IN_PROGRESS_PAGESDEPLOYMENTSTATUS_STATUS + case "syncing_files": + result = SYNCING_FILES_PAGESDEPLOYMENTSTATUS_STATUS + case "finished_file_sync": + result = FINISHED_FILE_SYNC_PAGESDEPLOYMENTSTATUS_STATUS + case "updating_pages": + result = UPDATING_PAGES_PAGESDEPLOYMENTSTATUS_STATUS + case "purging_cdn": + result = PURGING_CDN_PAGESDEPLOYMENTSTATUS_STATUS + case "deployment_cancelled": + result = DEPLOYMENT_CANCELLED_PAGESDEPLOYMENTSTATUS_STATUS + case "deployment_failed": + result = DEPLOYMENT_FAILED_PAGESDEPLOYMENTSTATUS_STATUS + case "deployment_content_failed": + result = DEPLOYMENT_CONTENT_FAILED_PAGESDEPLOYMENTSTATUS_STATUS + case "deployment_attempt_error": + result = DEPLOYMENT_ATTEMPT_ERROR_PAGESDEPLOYMENTSTATUS_STATUS + case "deployment_lost": + result = DEPLOYMENT_LOST_PAGESDEPLOYMENTSTATUS_STATUS + case "succeed": + result = SUCCEED_PAGESDEPLOYMENTSTATUS_STATUS + default: + return 0, errors.New("Unknown PagesDeploymentStatus_status value: " + v) + } + return &result, nil +} +func SerializePagesDeploymentStatus_status(values []PagesDeploymentStatus_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PagesDeploymentStatus_status) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_health_check.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_health_check.go new file mode 100644 index 000000000..a5f5c9eb9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_health_check.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PagesHealthCheck pages Health Check Status +type PagesHealthCheck struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The alt_domain property + alt_domain PagesHealthCheck_alt_domainable + // The domain property + domain PagesHealthCheck_domainable +} +// NewPagesHealthCheck instantiates a new PagesHealthCheck and sets the default values. +func NewPagesHealthCheck()(*PagesHealthCheck) { + m := &PagesHealthCheck{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePagesHealthCheckFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePagesHealthCheckFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPagesHealthCheck(), 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 *PagesHealthCheck) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAltDomain gets the alt_domain property value. The alt_domain property +// returns a PagesHealthCheck_alt_domainable when successful +func (m *PagesHealthCheck) GetAltDomain()(PagesHealthCheck_alt_domainable) { + return m.alt_domain +} +// GetDomain gets the domain property value. The domain property +// returns a PagesHealthCheck_domainable when successful +func (m *PagesHealthCheck) GetDomain()(PagesHealthCheck_domainable) { + return m.domain +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PagesHealthCheck) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["alt_domain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePagesHealthCheck_alt_domainFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAltDomain(val.(PagesHealthCheck_alt_domainable)) + } + return nil + } + res["domain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePagesHealthCheck_domainFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDomain(val.(PagesHealthCheck_domainable)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *PagesHealthCheck) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("alt_domain", m.GetAltDomain()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("domain", m.GetDomain()) + 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 *PagesHealthCheck) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAltDomain sets the alt_domain property value. The alt_domain property +func (m *PagesHealthCheck) SetAltDomain(value PagesHealthCheck_alt_domainable)() { + m.alt_domain = value +} +// SetDomain sets the domain property value. The domain property +func (m *PagesHealthCheck) SetDomain(value PagesHealthCheck_domainable)() { + m.domain = value +} +type PagesHealthCheckable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAltDomain()(PagesHealthCheck_alt_domainable) + GetDomain()(PagesHealthCheck_domainable) + SetAltDomain(value PagesHealthCheck_alt_domainable)() + SetDomain(value PagesHealthCheck_domainable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_health_check_alt_domain.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_health_check_alt_domain.go new file mode 100644 index 000000000..8972a4277 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_health_check_alt_domain.go @@ -0,0 +1,863 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PagesHealthCheck_alt_domain struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The caa_error property + caa_error *string + // The dns_resolves property + dns_resolves *bool + // The enforces_https property + enforces_https *bool + // The has_cname_record property + has_cname_record *bool + // The has_mx_records_present property + has_mx_records_present *bool + // The host property + host *string + // The https_error property + https_error *string + // The is_a_record property + is_a_record *bool + // The is_apex_domain property + is_apex_domain *bool + // The is_cloudflare_ip property + is_cloudflare_ip *bool + // The is_cname_to_fastly property + is_cname_to_fastly *bool + // The is_cname_to_github_user_domain property + is_cname_to_github_user_domain *bool + // The is_cname_to_pages_dot_github_dot_com property + is_cname_to_pages_dot_github_dot_com *bool + // The is_fastly_ip property + is_fastly_ip *bool + // The is_https_eligible property + is_https_eligible *bool + // The is_non_github_pages_ip_present property + is_non_github_pages_ip_present *bool + // The is_old_ip_address property + is_old_ip_address *bool + // The is_pages_domain property + is_pages_domain *bool + // The is_pointed_to_github_pages_ip property + is_pointed_to_github_pages_ip *bool + // The is_proxied property + is_proxied *bool + // The is_served_by_pages property + is_served_by_pages *bool + // The is_valid property + is_valid *bool + // The is_valid_domain property + is_valid_domain *bool + // The nameservers property + nameservers *string + // The reason property + reason *string + // The responds_to_https property + responds_to_https *bool + // The should_be_a_record property + should_be_a_record *bool + // The uri property + uri *string +} +// NewPagesHealthCheck_alt_domain instantiates a new PagesHealthCheck_alt_domain and sets the default values. +func NewPagesHealthCheck_alt_domain()(*PagesHealthCheck_alt_domain) { + m := &PagesHealthCheck_alt_domain{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePagesHealthCheck_alt_domainFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePagesHealthCheck_alt_domainFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPagesHealthCheck_alt_domain(), 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 *PagesHealthCheck_alt_domain) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCaaError gets the caa_error property value. The caa_error property +// returns a *string when successful +func (m *PagesHealthCheck_alt_domain) GetCaaError()(*string) { + return m.caa_error +} +// GetDnsResolves gets the dns_resolves property value. The dns_resolves property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetDnsResolves()(*bool) { + return m.dns_resolves +} +// GetEnforcesHttps gets the enforces_https property value. The enforces_https property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetEnforcesHttps()(*bool) { + return m.enforces_https +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PagesHealthCheck_alt_domain) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["caa_error"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCaaError(val) + } + return nil + } + res["dns_resolves"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDnsResolves(val) + } + return nil + } + res["enforces_https"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnforcesHttps(val) + } + return nil + } + res["has_cname_record"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasCnameRecord(val) + } + return nil + } + res["has_mx_records_present"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasMxRecordsPresent(val) + } + return nil + } + res["host"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHost(val) + } + return nil + } + res["https_error"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHttpsError(val) + } + return nil + } + res["is_a_record"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsARecord(val) + } + return nil + } + res["is_apex_domain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsApexDomain(val) + } + return nil + } + res["is_cloudflare_ip"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsCloudflareIp(val) + } + return nil + } + res["is_cname_to_fastly"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsCnameToFastly(val) + } + return nil + } + res["is_cname_to_github_user_domain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsCnameToGithubUserDomain(val) + } + return nil + } + res["is_cname_to_pages_dot_github_dot_com"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsCnameToPagesDotGithubDotCom(val) + } + return nil + } + res["is_fastly_ip"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsFastlyIp(val) + } + return nil + } + res["is_https_eligible"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsHttpsEligible(val) + } + return nil + } + res["is_non_github_pages_ip_present"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsNonGithubPagesIpPresent(val) + } + return nil + } + res["is_old_ip_address"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsOldIpAddress(val) + } + return nil + } + res["is_pages_domain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsPagesDomain(val) + } + return nil + } + res["is_pointed_to_github_pages_ip"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsPointedToGithubPagesIp(val) + } + return nil + } + res["is_proxied"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsProxied(val) + } + return nil + } + res["is_served_by_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsServedByPages(val) + } + return nil + } + res["is_valid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsValid(val) + } + return nil + } + res["is_valid_domain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsValidDomain(val) + } + return nil + } + res["nameservers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNameservers(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["responds_to_https"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRespondsToHttps(val) + } + return nil + } + res["should_be_a_record"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetShouldBeARecord(val) + } + return nil + } + res["uri"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUri(val) + } + return nil + } + return res +} +// GetHasCnameRecord gets the has_cname_record property value. The has_cname_record property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetHasCnameRecord()(*bool) { + return m.has_cname_record +} +// GetHasMxRecordsPresent gets the has_mx_records_present property value. The has_mx_records_present property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetHasMxRecordsPresent()(*bool) { + return m.has_mx_records_present +} +// GetHost gets the host property value. The host property +// returns a *string when successful +func (m *PagesHealthCheck_alt_domain) GetHost()(*string) { + return m.host +} +// GetHttpsError gets the https_error property value. The https_error property +// returns a *string when successful +func (m *PagesHealthCheck_alt_domain) GetHttpsError()(*string) { + return m.https_error +} +// GetIsApexDomain gets the is_apex_domain property value. The is_apex_domain property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetIsApexDomain()(*bool) { + return m.is_apex_domain +} +// GetIsARecord gets the is_a_record property value. The is_a_record property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetIsARecord()(*bool) { + return m.is_a_record +} +// GetIsCloudflareIp gets the is_cloudflare_ip property value. The is_cloudflare_ip property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetIsCloudflareIp()(*bool) { + return m.is_cloudflare_ip +} +// GetIsCnameToFastly gets the is_cname_to_fastly property value. The is_cname_to_fastly property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetIsCnameToFastly()(*bool) { + return m.is_cname_to_fastly +} +// GetIsCnameToGithubUserDomain gets the is_cname_to_github_user_domain property value. The is_cname_to_github_user_domain property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetIsCnameToGithubUserDomain()(*bool) { + return m.is_cname_to_github_user_domain +} +// GetIsCnameToPagesDotGithubDotCom gets the is_cname_to_pages_dot_github_dot_com property value. The is_cname_to_pages_dot_github_dot_com property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetIsCnameToPagesDotGithubDotCom()(*bool) { + return m.is_cname_to_pages_dot_github_dot_com +} +// GetIsFastlyIp gets the is_fastly_ip property value. The is_fastly_ip property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetIsFastlyIp()(*bool) { + return m.is_fastly_ip +} +// GetIsHttpsEligible gets the is_https_eligible property value. The is_https_eligible property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetIsHttpsEligible()(*bool) { + return m.is_https_eligible +} +// GetIsNonGithubPagesIpPresent gets the is_non_github_pages_ip_present property value. The is_non_github_pages_ip_present property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetIsNonGithubPagesIpPresent()(*bool) { + return m.is_non_github_pages_ip_present +} +// GetIsOldIpAddress gets the is_old_ip_address property value. The is_old_ip_address property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetIsOldIpAddress()(*bool) { + return m.is_old_ip_address +} +// GetIsPagesDomain gets the is_pages_domain property value. The is_pages_domain property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetIsPagesDomain()(*bool) { + return m.is_pages_domain +} +// GetIsPointedToGithubPagesIp gets the is_pointed_to_github_pages_ip property value. The is_pointed_to_github_pages_ip property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetIsPointedToGithubPagesIp()(*bool) { + return m.is_pointed_to_github_pages_ip +} +// GetIsProxied gets the is_proxied property value. The is_proxied property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetIsProxied()(*bool) { + return m.is_proxied +} +// GetIsServedByPages gets the is_served_by_pages property value. The is_served_by_pages property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetIsServedByPages()(*bool) { + return m.is_served_by_pages +} +// GetIsValid gets the is_valid property value. The is_valid property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetIsValid()(*bool) { + return m.is_valid +} +// GetIsValidDomain gets the is_valid_domain property value. The is_valid_domain property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetIsValidDomain()(*bool) { + return m.is_valid_domain +} +// GetNameservers gets the nameservers property value. The nameservers property +// returns a *string when successful +func (m *PagesHealthCheck_alt_domain) GetNameservers()(*string) { + return m.nameservers +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *PagesHealthCheck_alt_domain) GetReason()(*string) { + return m.reason +} +// GetRespondsToHttps gets the responds_to_https property value. The responds_to_https property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetRespondsToHttps()(*bool) { + return m.responds_to_https +} +// GetShouldBeARecord gets the should_be_a_record property value. The should_be_a_record property +// returns a *bool when successful +func (m *PagesHealthCheck_alt_domain) GetShouldBeARecord()(*bool) { + return m.should_be_a_record +} +// GetUri gets the uri property value. The uri property +// returns a *string when successful +func (m *PagesHealthCheck_alt_domain) GetUri()(*string) { + return m.uri +} +// Serialize serializes information the current object +func (m *PagesHealthCheck_alt_domain) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("caa_error", m.GetCaaError()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dns_resolves", m.GetDnsResolves()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enforces_https", m.GetEnforcesHttps()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_cname_record", m.GetHasCnameRecord()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_mx_records_present", m.GetHasMxRecordsPresent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("host", m.GetHost()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("https_error", m.GetHttpsError()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_apex_domain", m.GetIsApexDomain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_a_record", m.GetIsARecord()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_cloudflare_ip", m.GetIsCloudflareIp()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_cname_to_fastly", m.GetIsCnameToFastly()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_cname_to_github_user_domain", m.GetIsCnameToGithubUserDomain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_cname_to_pages_dot_github_dot_com", m.GetIsCnameToPagesDotGithubDotCom()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_fastly_ip", m.GetIsFastlyIp()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_https_eligible", m.GetIsHttpsEligible()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_non_github_pages_ip_present", m.GetIsNonGithubPagesIpPresent()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_old_ip_address", m.GetIsOldIpAddress()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_pages_domain", m.GetIsPagesDomain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_pointed_to_github_pages_ip", m.GetIsPointedToGithubPagesIp()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_proxied", m.GetIsProxied()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_served_by_pages", m.GetIsServedByPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_valid", m.GetIsValid()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_valid_domain", m.GetIsValidDomain()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("nameservers", m.GetNameservers()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("responds_to_https", m.GetRespondsToHttps()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("should_be_a_record", m.GetShouldBeARecord()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("uri", m.GetUri()) + 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 *PagesHealthCheck_alt_domain) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCaaError sets the caa_error property value. The caa_error property +func (m *PagesHealthCheck_alt_domain) SetCaaError(value *string)() { + m.caa_error = value +} +// SetDnsResolves sets the dns_resolves property value. The dns_resolves property +func (m *PagesHealthCheck_alt_domain) SetDnsResolves(value *bool)() { + m.dns_resolves = value +} +// SetEnforcesHttps sets the enforces_https property value. The enforces_https property +func (m *PagesHealthCheck_alt_domain) SetEnforcesHttps(value *bool)() { + m.enforces_https = value +} +// SetHasCnameRecord sets the has_cname_record property value. The has_cname_record property +func (m *PagesHealthCheck_alt_domain) SetHasCnameRecord(value *bool)() { + m.has_cname_record = value +} +// SetHasMxRecordsPresent sets the has_mx_records_present property value. The has_mx_records_present property +func (m *PagesHealthCheck_alt_domain) SetHasMxRecordsPresent(value *bool)() { + m.has_mx_records_present = value +} +// SetHost sets the host property value. The host property +func (m *PagesHealthCheck_alt_domain) SetHost(value *string)() { + m.host = value +} +// SetHttpsError sets the https_error property value. The https_error property +func (m *PagesHealthCheck_alt_domain) SetHttpsError(value *string)() { + m.https_error = value +} +// SetIsApexDomain sets the is_apex_domain property value. The is_apex_domain property +func (m *PagesHealthCheck_alt_domain) SetIsApexDomain(value *bool)() { + m.is_apex_domain = value +} +// SetIsARecord sets the is_a_record property value. The is_a_record property +func (m *PagesHealthCheck_alt_domain) SetIsARecord(value *bool)() { + m.is_a_record = value +} +// SetIsCloudflareIp sets the is_cloudflare_ip property value. The is_cloudflare_ip property +func (m *PagesHealthCheck_alt_domain) SetIsCloudflareIp(value *bool)() { + m.is_cloudflare_ip = value +} +// SetIsCnameToFastly sets the is_cname_to_fastly property value. The is_cname_to_fastly property +func (m *PagesHealthCheck_alt_domain) SetIsCnameToFastly(value *bool)() { + m.is_cname_to_fastly = value +} +// SetIsCnameToGithubUserDomain sets the is_cname_to_github_user_domain property value. The is_cname_to_github_user_domain property +func (m *PagesHealthCheck_alt_domain) SetIsCnameToGithubUserDomain(value *bool)() { + m.is_cname_to_github_user_domain = value +} +// SetIsCnameToPagesDotGithubDotCom sets the is_cname_to_pages_dot_github_dot_com property value. The is_cname_to_pages_dot_github_dot_com property +func (m *PagesHealthCheck_alt_domain) SetIsCnameToPagesDotGithubDotCom(value *bool)() { + m.is_cname_to_pages_dot_github_dot_com = value +} +// SetIsFastlyIp sets the is_fastly_ip property value. The is_fastly_ip property +func (m *PagesHealthCheck_alt_domain) SetIsFastlyIp(value *bool)() { + m.is_fastly_ip = value +} +// SetIsHttpsEligible sets the is_https_eligible property value. The is_https_eligible property +func (m *PagesHealthCheck_alt_domain) SetIsHttpsEligible(value *bool)() { + m.is_https_eligible = value +} +// SetIsNonGithubPagesIpPresent sets the is_non_github_pages_ip_present property value. The is_non_github_pages_ip_present property +func (m *PagesHealthCheck_alt_domain) SetIsNonGithubPagesIpPresent(value *bool)() { + m.is_non_github_pages_ip_present = value +} +// SetIsOldIpAddress sets the is_old_ip_address property value. The is_old_ip_address property +func (m *PagesHealthCheck_alt_domain) SetIsOldIpAddress(value *bool)() { + m.is_old_ip_address = value +} +// SetIsPagesDomain sets the is_pages_domain property value. The is_pages_domain property +func (m *PagesHealthCheck_alt_domain) SetIsPagesDomain(value *bool)() { + m.is_pages_domain = value +} +// SetIsPointedToGithubPagesIp sets the is_pointed_to_github_pages_ip property value. The is_pointed_to_github_pages_ip property +func (m *PagesHealthCheck_alt_domain) SetIsPointedToGithubPagesIp(value *bool)() { + m.is_pointed_to_github_pages_ip = value +} +// SetIsProxied sets the is_proxied property value. The is_proxied property +func (m *PagesHealthCheck_alt_domain) SetIsProxied(value *bool)() { + m.is_proxied = value +} +// SetIsServedByPages sets the is_served_by_pages property value. The is_served_by_pages property +func (m *PagesHealthCheck_alt_domain) SetIsServedByPages(value *bool)() { + m.is_served_by_pages = value +} +// SetIsValid sets the is_valid property value. The is_valid property +func (m *PagesHealthCheck_alt_domain) SetIsValid(value *bool)() { + m.is_valid = value +} +// SetIsValidDomain sets the is_valid_domain property value. The is_valid_domain property +func (m *PagesHealthCheck_alt_domain) SetIsValidDomain(value *bool)() { + m.is_valid_domain = value +} +// SetNameservers sets the nameservers property value. The nameservers property +func (m *PagesHealthCheck_alt_domain) SetNameservers(value *string)() { + m.nameservers = value +} +// SetReason sets the reason property value. The reason property +func (m *PagesHealthCheck_alt_domain) SetReason(value *string)() { + m.reason = value +} +// SetRespondsToHttps sets the responds_to_https property value. The responds_to_https property +func (m *PagesHealthCheck_alt_domain) SetRespondsToHttps(value *bool)() { + m.responds_to_https = value +} +// SetShouldBeARecord sets the should_be_a_record property value. The should_be_a_record property +func (m *PagesHealthCheck_alt_domain) SetShouldBeARecord(value *bool)() { + m.should_be_a_record = value +} +// SetUri sets the uri property value. The uri property +func (m *PagesHealthCheck_alt_domain) SetUri(value *string)() { + m.uri = value +} +type PagesHealthCheck_alt_domainable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCaaError()(*string) + GetDnsResolves()(*bool) + GetEnforcesHttps()(*bool) + GetHasCnameRecord()(*bool) + GetHasMxRecordsPresent()(*bool) + GetHost()(*string) + GetHttpsError()(*string) + GetIsApexDomain()(*bool) + GetIsARecord()(*bool) + GetIsCloudflareIp()(*bool) + GetIsCnameToFastly()(*bool) + GetIsCnameToGithubUserDomain()(*bool) + GetIsCnameToPagesDotGithubDotCom()(*bool) + GetIsFastlyIp()(*bool) + GetIsHttpsEligible()(*bool) + GetIsNonGithubPagesIpPresent()(*bool) + GetIsOldIpAddress()(*bool) + GetIsPagesDomain()(*bool) + GetIsPointedToGithubPagesIp()(*bool) + GetIsProxied()(*bool) + GetIsServedByPages()(*bool) + GetIsValid()(*bool) + GetIsValidDomain()(*bool) + GetNameservers()(*string) + GetReason()(*string) + GetRespondsToHttps()(*bool) + GetShouldBeARecord()(*bool) + GetUri()(*string) + SetCaaError(value *string)() + SetDnsResolves(value *bool)() + SetEnforcesHttps(value *bool)() + SetHasCnameRecord(value *bool)() + SetHasMxRecordsPresent(value *bool)() + SetHost(value *string)() + SetHttpsError(value *string)() + SetIsApexDomain(value *bool)() + SetIsARecord(value *bool)() + SetIsCloudflareIp(value *bool)() + SetIsCnameToFastly(value *bool)() + SetIsCnameToGithubUserDomain(value *bool)() + SetIsCnameToPagesDotGithubDotCom(value *bool)() + SetIsFastlyIp(value *bool)() + SetIsHttpsEligible(value *bool)() + SetIsNonGithubPagesIpPresent(value *bool)() + SetIsOldIpAddress(value *bool)() + SetIsPagesDomain(value *bool)() + SetIsPointedToGithubPagesIp(value *bool)() + SetIsProxied(value *bool)() + SetIsServedByPages(value *bool)() + SetIsValid(value *bool)() + SetIsValidDomain(value *bool)() + SetNameservers(value *string)() + SetReason(value *string)() + SetRespondsToHttps(value *bool)() + SetShouldBeARecord(value *bool)() + SetUri(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_health_check_domain.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_health_check_domain.go new file mode 100644 index 000000000..e0ebb0467 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_health_check_domain.go @@ -0,0 +1,863 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PagesHealthCheck_domain struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The caa_error property + caa_error *string + // The dns_resolves property + dns_resolves *bool + // The enforces_https property + enforces_https *bool + // The has_cname_record property + has_cname_record *bool + // The has_mx_records_present property + has_mx_records_present *bool + // The host property + host *string + // The https_error property + https_error *string + // The is_a_record property + is_a_record *bool + // The is_apex_domain property + is_apex_domain *bool + // The is_cloudflare_ip property + is_cloudflare_ip *bool + // The is_cname_to_fastly property + is_cname_to_fastly *bool + // The is_cname_to_github_user_domain property + is_cname_to_github_user_domain *bool + // The is_cname_to_pages_dot_github_dot_com property + is_cname_to_pages_dot_github_dot_com *bool + // The is_fastly_ip property + is_fastly_ip *bool + // The is_https_eligible property + is_https_eligible *bool + // The is_non_github_pages_ip_present property + is_non_github_pages_ip_present *bool + // The is_old_ip_address property + is_old_ip_address *bool + // The is_pages_domain property + is_pages_domain *bool + // The is_pointed_to_github_pages_ip property + is_pointed_to_github_pages_ip *bool + // The is_proxied property + is_proxied *bool + // The is_served_by_pages property + is_served_by_pages *bool + // The is_valid property + is_valid *bool + // The is_valid_domain property + is_valid_domain *bool + // The nameservers property + nameservers *string + // The reason property + reason *string + // The responds_to_https property + responds_to_https *bool + // The should_be_a_record property + should_be_a_record *bool + // The uri property + uri *string +} +// NewPagesHealthCheck_domain instantiates a new PagesHealthCheck_domain and sets the default values. +func NewPagesHealthCheck_domain()(*PagesHealthCheck_domain) { + m := &PagesHealthCheck_domain{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePagesHealthCheck_domainFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePagesHealthCheck_domainFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPagesHealthCheck_domain(), 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 *PagesHealthCheck_domain) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCaaError gets the caa_error property value. The caa_error property +// returns a *string when successful +func (m *PagesHealthCheck_domain) GetCaaError()(*string) { + return m.caa_error +} +// GetDnsResolves gets the dns_resolves property value. The dns_resolves property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetDnsResolves()(*bool) { + return m.dns_resolves +} +// GetEnforcesHttps gets the enforces_https property value. The enforces_https property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetEnforcesHttps()(*bool) { + return m.enforces_https +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PagesHealthCheck_domain) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["caa_error"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCaaError(val) + } + return nil + } + res["dns_resolves"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDnsResolves(val) + } + return nil + } + res["enforces_https"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnforcesHttps(val) + } + return nil + } + res["has_cname_record"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasCnameRecord(val) + } + return nil + } + res["has_mx_records_present"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasMxRecordsPresent(val) + } + return nil + } + res["host"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHost(val) + } + return nil + } + res["https_error"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHttpsError(val) + } + return nil + } + res["is_a_record"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsARecord(val) + } + return nil + } + res["is_apex_domain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsApexDomain(val) + } + return nil + } + res["is_cloudflare_ip"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsCloudflareIp(val) + } + return nil + } + res["is_cname_to_fastly"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsCnameToFastly(val) + } + return nil + } + res["is_cname_to_github_user_domain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsCnameToGithubUserDomain(val) + } + return nil + } + res["is_cname_to_pages_dot_github_dot_com"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsCnameToPagesDotGithubDotCom(val) + } + return nil + } + res["is_fastly_ip"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsFastlyIp(val) + } + return nil + } + res["is_https_eligible"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsHttpsEligible(val) + } + return nil + } + res["is_non_github_pages_ip_present"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsNonGithubPagesIpPresent(val) + } + return nil + } + res["is_old_ip_address"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsOldIpAddress(val) + } + return nil + } + res["is_pages_domain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsPagesDomain(val) + } + return nil + } + res["is_pointed_to_github_pages_ip"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsPointedToGithubPagesIp(val) + } + return nil + } + res["is_proxied"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsProxied(val) + } + return nil + } + res["is_served_by_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsServedByPages(val) + } + return nil + } + res["is_valid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsValid(val) + } + return nil + } + res["is_valid_domain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsValidDomain(val) + } + return nil + } + res["nameservers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNameservers(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["responds_to_https"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRespondsToHttps(val) + } + return nil + } + res["should_be_a_record"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetShouldBeARecord(val) + } + return nil + } + res["uri"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUri(val) + } + return nil + } + return res +} +// GetHasCnameRecord gets the has_cname_record property value. The has_cname_record property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetHasCnameRecord()(*bool) { + return m.has_cname_record +} +// GetHasMxRecordsPresent gets the has_mx_records_present property value. The has_mx_records_present property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetHasMxRecordsPresent()(*bool) { + return m.has_mx_records_present +} +// GetHost gets the host property value. The host property +// returns a *string when successful +func (m *PagesHealthCheck_domain) GetHost()(*string) { + return m.host +} +// GetHttpsError gets the https_error property value. The https_error property +// returns a *string when successful +func (m *PagesHealthCheck_domain) GetHttpsError()(*string) { + return m.https_error +} +// GetIsApexDomain gets the is_apex_domain property value. The is_apex_domain property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetIsApexDomain()(*bool) { + return m.is_apex_domain +} +// GetIsARecord gets the is_a_record property value. The is_a_record property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetIsARecord()(*bool) { + return m.is_a_record +} +// GetIsCloudflareIp gets the is_cloudflare_ip property value. The is_cloudflare_ip property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetIsCloudflareIp()(*bool) { + return m.is_cloudflare_ip +} +// GetIsCnameToFastly gets the is_cname_to_fastly property value. The is_cname_to_fastly property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetIsCnameToFastly()(*bool) { + return m.is_cname_to_fastly +} +// GetIsCnameToGithubUserDomain gets the is_cname_to_github_user_domain property value. The is_cname_to_github_user_domain property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetIsCnameToGithubUserDomain()(*bool) { + return m.is_cname_to_github_user_domain +} +// GetIsCnameToPagesDotGithubDotCom gets the is_cname_to_pages_dot_github_dot_com property value. The is_cname_to_pages_dot_github_dot_com property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetIsCnameToPagesDotGithubDotCom()(*bool) { + return m.is_cname_to_pages_dot_github_dot_com +} +// GetIsFastlyIp gets the is_fastly_ip property value. The is_fastly_ip property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetIsFastlyIp()(*bool) { + return m.is_fastly_ip +} +// GetIsHttpsEligible gets the is_https_eligible property value. The is_https_eligible property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetIsHttpsEligible()(*bool) { + return m.is_https_eligible +} +// GetIsNonGithubPagesIpPresent gets the is_non_github_pages_ip_present property value. The is_non_github_pages_ip_present property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetIsNonGithubPagesIpPresent()(*bool) { + return m.is_non_github_pages_ip_present +} +// GetIsOldIpAddress gets the is_old_ip_address property value. The is_old_ip_address property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetIsOldIpAddress()(*bool) { + return m.is_old_ip_address +} +// GetIsPagesDomain gets the is_pages_domain property value. The is_pages_domain property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetIsPagesDomain()(*bool) { + return m.is_pages_domain +} +// GetIsPointedToGithubPagesIp gets the is_pointed_to_github_pages_ip property value. The is_pointed_to_github_pages_ip property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetIsPointedToGithubPagesIp()(*bool) { + return m.is_pointed_to_github_pages_ip +} +// GetIsProxied gets the is_proxied property value. The is_proxied property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetIsProxied()(*bool) { + return m.is_proxied +} +// GetIsServedByPages gets the is_served_by_pages property value. The is_served_by_pages property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetIsServedByPages()(*bool) { + return m.is_served_by_pages +} +// GetIsValid gets the is_valid property value. The is_valid property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetIsValid()(*bool) { + return m.is_valid +} +// GetIsValidDomain gets the is_valid_domain property value. The is_valid_domain property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetIsValidDomain()(*bool) { + return m.is_valid_domain +} +// GetNameservers gets the nameservers property value. The nameservers property +// returns a *string when successful +func (m *PagesHealthCheck_domain) GetNameservers()(*string) { + return m.nameservers +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *PagesHealthCheck_domain) GetReason()(*string) { + return m.reason +} +// GetRespondsToHttps gets the responds_to_https property value. The responds_to_https property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetRespondsToHttps()(*bool) { + return m.responds_to_https +} +// GetShouldBeARecord gets the should_be_a_record property value. The should_be_a_record property +// returns a *bool when successful +func (m *PagesHealthCheck_domain) GetShouldBeARecord()(*bool) { + return m.should_be_a_record +} +// GetUri gets the uri property value. The uri property +// returns a *string when successful +func (m *PagesHealthCheck_domain) GetUri()(*string) { + return m.uri +} +// Serialize serializes information the current object +func (m *PagesHealthCheck_domain) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("caa_error", m.GetCaaError()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dns_resolves", m.GetDnsResolves()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enforces_https", m.GetEnforcesHttps()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_cname_record", m.GetHasCnameRecord()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_mx_records_present", m.GetHasMxRecordsPresent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("host", m.GetHost()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("https_error", m.GetHttpsError()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_apex_domain", m.GetIsApexDomain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_a_record", m.GetIsARecord()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_cloudflare_ip", m.GetIsCloudflareIp()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_cname_to_fastly", m.GetIsCnameToFastly()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_cname_to_github_user_domain", m.GetIsCnameToGithubUserDomain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_cname_to_pages_dot_github_dot_com", m.GetIsCnameToPagesDotGithubDotCom()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_fastly_ip", m.GetIsFastlyIp()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_https_eligible", m.GetIsHttpsEligible()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_non_github_pages_ip_present", m.GetIsNonGithubPagesIpPresent()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_old_ip_address", m.GetIsOldIpAddress()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_pages_domain", m.GetIsPagesDomain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_pointed_to_github_pages_ip", m.GetIsPointedToGithubPagesIp()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_proxied", m.GetIsProxied()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_served_by_pages", m.GetIsServedByPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_valid", m.GetIsValid()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_valid_domain", m.GetIsValidDomain()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("nameservers", m.GetNameservers()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("responds_to_https", m.GetRespondsToHttps()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("should_be_a_record", m.GetShouldBeARecord()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("uri", m.GetUri()) + 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 *PagesHealthCheck_domain) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCaaError sets the caa_error property value. The caa_error property +func (m *PagesHealthCheck_domain) SetCaaError(value *string)() { + m.caa_error = value +} +// SetDnsResolves sets the dns_resolves property value. The dns_resolves property +func (m *PagesHealthCheck_domain) SetDnsResolves(value *bool)() { + m.dns_resolves = value +} +// SetEnforcesHttps sets the enforces_https property value. The enforces_https property +func (m *PagesHealthCheck_domain) SetEnforcesHttps(value *bool)() { + m.enforces_https = value +} +// SetHasCnameRecord sets the has_cname_record property value. The has_cname_record property +func (m *PagesHealthCheck_domain) SetHasCnameRecord(value *bool)() { + m.has_cname_record = value +} +// SetHasMxRecordsPresent sets the has_mx_records_present property value. The has_mx_records_present property +func (m *PagesHealthCheck_domain) SetHasMxRecordsPresent(value *bool)() { + m.has_mx_records_present = value +} +// SetHost sets the host property value. The host property +func (m *PagesHealthCheck_domain) SetHost(value *string)() { + m.host = value +} +// SetHttpsError sets the https_error property value. The https_error property +func (m *PagesHealthCheck_domain) SetHttpsError(value *string)() { + m.https_error = value +} +// SetIsApexDomain sets the is_apex_domain property value. The is_apex_domain property +func (m *PagesHealthCheck_domain) SetIsApexDomain(value *bool)() { + m.is_apex_domain = value +} +// SetIsARecord sets the is_a_record property value. The is_a_record property +func (m *PagesHealthCheck_domain) SetIsARecord(value *bool)() { + m.is_a_record = value +} +// SetIsCloudflareIp sets the is_cloudflare_ip property value. The is_cloudflare_ip property +func (m *PagesHealthCheck_domain) SetIsCloudflareIp(value *bool)() { + m.is_cloudflare_ip = value +} +// SetIsCnameToFastly sets the is_cname_to_fastly property value. The is_cname_to_fastly property +func (m *PagesHealthCheck_domain) SetIsCnameToFastly(value *bool)() { + m.is_cname_to_fastly = value +} +// SetIsCnameToGithubUserDomain sets the is_cname_to_github_user_domain property value. The is_cname_to_github_user_domain property +func (m *PagesHealthCheck_domain) SetIsCnameToGithubUserDomain(value *bool)() { + m.is_cname_to_github_user_domain = value +} +// SetIsCnameToPagesDotGithubDotCom sets the is_cname_to_pages_dot_github_dot_com property value. The is_cname_to_pages_dot_github_dot_com property +func (m *PagesHealthCheck_domain) SetIsCnameToPagesDotGithubDotCom(value *bool)() { + m.is_cname_to_pages_dot_github_dot_com = value +} +// SetIsFastlyIp sets the is_fastly_ip property value. The is_fastly_ip property +func (m *PagesHealthCheck_domain) SetIsFastlyIp(value *bool)() { + m.is_fastly_ip = value +} +// SetIsHttpsEligible sets the is_https_eligible property value. The is_https_eligible property +func (m *PagesHealthCheck_domain) SetIsHttpsEligible(value *bool)() { + m.is_https_eligible = value +} +// SetIsNonGithubPagesIpPresent sets the is_non_github_pages_ip_present property value. The is_non_github_pages_ip_present property +func (m *PagesHealthCheck_domain) SetIsNonGithubPagesIpPresent(value *bool)() { + m.is_non_github_pages_ip_present = value +} +// SetIsOldIpAddress sets the is_old_ip_address property value. The is_old_ip_address property +func (m *PagesHealthCheck_domain) SetIsOldIpAddress(value *bool)() { + m.is_old_ip_address = value +} +// SetIsPagesDomain sets the is_pages_domain property value. The is_pages_domain property +func (m *PagesHealthCheck_domain) SetIsPagesDomain(value *bool)() { + m.is_pages_domain = value +} +// SetIsPointedToGithubPagesIp sets the is_pointed_to_github_pages_ip property value. The is_pointed_to_github_pages_ip property +func (m *PagesHealthCheck_domain) SetIsPointedToGithubPagesIp(value *bool)() { + m.is_pointed_to_github_pages_ip = value +} +// SetIsProxied sets the is_proxied property value. The is_proxied property +func (m *PagesHealthCheck_domain) SetIsProxied(value *bool)() { + m.is_proxied = value +} +// SetIsServedByPages sets the is_served_by_pages property value. The is_served_by_pages property +func (m *PagesHealthCheck_domain) SetIsServedByPages(value *bool)() { + m.is_served_by_pages = value +} +// SetIsValid sets the is_valid property value. The is_valid property +func (m *PagesHealthCheck_domain) SetIsValid(value *bool)() { + m.is_valid = value +} +// SetIsValidDomain sets the is_valid_domain property value. The is_valid_domain property +func (m *PagesHealthCheck_domain) SetIsValidDomain(value *bool)() { + m.is_valid_domain = value +} +// SetNameservers sets the nameservers property value. The nameservers property +func (m *PagesHealthCheck_domain) SetNameservers(value *string)() { + m.nameservers = value +} +// SetReason sets the reason property value. The reason property +func (m *PagesHealthCheck_domain) SetReason(value *string)() { + m.reason = value +} +// SetRespondsToHttps sets the responds_to_https property value. The responds_to_https property +func (m *PagesHealthCheck_domain) SetRespondsToHttps(value *bool)() { + m.responds_to_https = value +} +// SetShouldBeARecord sets the should_be_a_record property value. The should_be_a_record property +func (m *PagesHealthCheck_domain) SetShouldBeARecord(value *bool)() { + m.should_be_a_record = value +} +// SetUri sets the uri property value. The uri property +func (m *PagesHealthCheck_domain) SetUri(value *string)() { + m.uri = value +} +type PagesHealthCheck_domainable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCaaError()(*string) + GetDnsResolves()(*bool) + GetEnforcesHttps()(*bool) + GetHasCnameRecord()(*bool) + GetHasMxRecordsPresent()(*bool) + GetHost()(*string) + GetHttpsError()(*string) + GetIsApexDomain()(*bool) + GetIsARecord()(*bool) + GetIsCloudflareIp()(*bool) + GetIsCnameToFastly()(*bool) + GetIsCnameToGithubUserDomain()(*bool) + GetIsCnameToPagesDotGithubDotCom()(*bool) + GetIsFastlyIp()(*bool) + GetIsHttpsEligible()(*bool) + GetIsNonGithubPagesIpPresent()(*bool) + GetIsOldIpAddress()(*bool) + GetIsPagesDomain()(*bool) + GetIsPointedToGithubPagesIp()(*bool) + GetIsProxied()(*bool) + GetIsServedByPages()(*bool) + GetIsValid()(*bool) + GetIsValidDomain()(*bool) + GetNameservers()(*string) + GetReason()(*string) + GetRespondsToHttps()(*bool) + GetShouldBeARecord()(*bool) + GetUri()(*string) + SetCaaError(value *string)() + SetDnsResolves(value *bool)() + SetEnforcesHttps(value *bool)() + SetHasCnameRecord(value *bool)() + SetHasMxRecordsPresent(value *bool)() + SetHost(value *string)() + SetHttpsError(value *string)() + SetIsApexDomain(value *bool)() + SetIsARecord(value *bool)() + SetIsCloudflareIp(value *bool)() + SetIsCnameToFastly(value *bool)() + SetIsCnameToGithubUserDomain(value *bool)() + SetIsCnameToPagesDotGithubDotCom(value *bool)() + SetIsFastlyIp(value *bool)() + SetIsHttpsEligible(value *bool)() + SetIsNonGithubPagesIpPresent(value *bool)() + SetIsOldIpAddress(value *bool)() + SetIsPagesDomain(value *bool)() + SetIsPointedToGithubPagesIp(value *bool)() + SetIsProxied(value *bool)() + SetIsServedByPages(value *bool)() + SetIsValid(value *bool)() + SetIsValidDomain(value *bool)() + SetNameservers(value *string)() + SetReason(value *string)() + SetRespondsToHttps(value *bool)() + SetShouldBeARecord(value *bool)() + SetUri(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_https_certificate.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_https_certificate.go new file mode 100644 index 000000000..784734145 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_https_certificate.go @@ -0,0 +1,174 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PagesHttpsCertificate struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The description property + description *string + // Array of the domain set and its alternate name (if it is configured) + domains []string + // The expires_at property + expires_at *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly + // The state property + state *PagesHttpsCertificate_state +} +// NewPagesHttpsCertificate instantiates a new PagesHttpsCertificate and sets the default values. +func NewPagesHttpsCertificate()(*PagesHttpsCertificate) { + m := &PagesHttpsCertificate{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePagesHttpsCertificateFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePagesHttpsCertificateFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPagesHttpsCertificate(), 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 *PagesHttpsCertificate) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *PagesHttpsCertificate) GetDescription()(*string) { + return m.description +} +// GetDomains gets the domains property value. Array of the domain set and its alternate name (if it is configured) +// returns a []string when successful +func (m *PagesHttpsCertificate) GetDomains()([]string) { + return m.domains +} +// GetExpiresAt gets the expires_at property value. The expires_at property +// returns a *DateOnly when successful +func (m *PagesHttpsCertificate) GetExpiresAt()(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly) { + return m.expires_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PagesHttpsCertificate) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["domains"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetDomains(res) + } + return nil + } + res["expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetDateOnlyValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresAt(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePagesHttpsCertificate_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*PagesHttpsCertificate_state)) + } + return nil + } + return res +} +// GetState gets the state property value. The state property +// returns a *PagesHttpsCertificate_state when successful +func (m *PagesHttpsCertificate) GetState()(*PagesHttpsCertificate_state) { + return m.state +} +// Serialize serializes information the current object +func (m *PagesHttpsCertificate) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + if m.GetDomains() != nil { + err := writer.WriteCollectionOfStringValues("domains", m.GetDomains()) + if err != nil { + return err + } + } + { + err := writer.WriteDateOnlyValue("expires_at", m.GetExpiresAt()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *PagesHttpsCertificate) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description property +func (m *PagesHttpsCertificate) SetDescription(value *string)() { + m.description = value +} +// SetDomains sets the domains property value. Array of the domain set and its alternate name (if it is configured) +func (m *PagesHttpsCertificate) SetDomains(value []string)() { + m.domains = value +} +// SetExpiresAt sets the expires_at property value. The expires_at property +func (m *PagesHttpsCertificate) SetExpiresAt(value *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly)() { + m.expires_at = value +} +// SetState sets the state property value. The state property +func (m *PagesHttpsCertificate) SetState(value *PagesHttpsCertificate_state)() { + m.state = value +} +type PagesHttpsCertificateable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetDomains()([]string) + GetExpiresAt()(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly) + GetState()(*PagesHttpsCertificate_state) + SetDescription(value *string)() + SetDomains(value []string)() + SetExpiresAt(value *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly)() + SetState(value *PagesHttpsCertificate_state)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_https_certificate_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_https_certificate_state.go new file mode 100644 index 000000000..8973a06d9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_https_certificate_state.go @@ -0,0 +1,66 @@ +package models +import ( + "errors" +) +type PagesHttpsCertificate_state int + +const ( + NEW_PAGESHTTPSCERTIFICATE_STATE PagesHttpsCertificate_state = iota + AUTHORIZATION_CREATED_PAGESHTTPSCERTIFICATE_STATE + AUTHORIZATION_PENDING_PAGESHTTPSCERTIFICATE_STATE + AUTHORIZED_PAGESHTTPSCERTIFICATE_STATE + AUTHORIZATION_REVOKED_PAGESHTTPSCERTIFICATE_STATE + ISSUED_PAGESHTTPSCERTIFICATE_STATE + UPLOADED_PAGESHTTPSCERTIFICATE_STATE + APPROVED_PAGESHTTPSCERTIFICATE_STATE + ERRORED_PAGESHTTPSCERTIFICATE_STATE + BAD_AUTHZ_PAGESHTTPSCERTIFICATE_STATE + DESTROY_PENDING_PAGESHTTPSCERTIFICATE_STATE + DNS_CHANGED_PAGESHTTPSCERTIFICATE_STATE +) + +func (i PagesHttpsCertificate_state) String() string { + return []string{"new", "authorization_created", "authorization_pending", "authorized", "authorization_revoked", "issued", "uploaded", "approved", "errored", "bad_authz", "destroy_pending", "dns_changed"}[i] +} +func ParsePagesHttpsCertificate_state(v string) (any, error) { + result := NEW_PAGESHTTPSCERTIFICATE_STATE + switch v { + case "new": + result = NEW_PAGESHTTPSCERTIFICATE_STATE + case "authorization_created": + result = AUTHORIZATION_CREATED_PAGESHTTPSCERTIFICATE_STATE + case "authorization_pending": + result = AUTHORIZATION_PENDING_PAGESHTTPSCERTIFICATE_STATE + case "authorized": + result = AUTHORIZED_PAGESHTTPSCERTIFICATE_STATE + case "authorization_revoked": + result = AUTHORIZATION_REVOKED_PAGESHTTPSCERTIFICATE_STATE + case "issued": + result = ISSUED_PAGESHTTPSCERTIFICATE_STATE + case "uploaded": + result = UPLOADED_PAGESHTTPSCERTIFICATE_STATE + case "approved": + result = APPROVED_PAGESHTTPSCERTIFICATE_STATE + case "errored": + result = ERRORED_PAGESHTTPSCERTIFICATE_STATE + case "bad_authz": + result = BAD_AUTHZ_PAGESHTTPSCERTIFICATE_STATE + case "destroy_pending": + result = DESTROY_PENDING_PAGESHTTPSCERTIFICATE_STATE + case "dns_changed": + result = DNS_CHANGED_PAGESHTTPSCERTIFICATE_STATE + default: + return 0, errors.New("Unknown PagesHttpsCertificate_state value: " + v) + } + return &result, nil +} +func SerializePagesHttpsCertificate_state(values []PagesHttpsCertificate_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PagesHttpsCertificate_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_source_hash.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_source_hash.go new file mode 100644 index 000000000..6cdc5baf0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pages_source_hash.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PagesSourceHash struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The branch property + branch *string + // The path property + path *string +} +// NewPagesSourceHash instantiates a new PagesSourceHash and sets the default values. +func NewPagesSourceHash()(*PagesSourceHash) { + m := &PagesSourceHash{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePagesSourceHashFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePagesSourceHashFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPagesSourceHash(), 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 *PagesSourceHash) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBranch gets the branch property value. The branch property +// returns a *string when successful +func (m *PagesSourceHash) GetBranch()(*string) { + return m.branch +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PagesSourceHash) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranch(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 + } + return res +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *PagesSourceHash) GetPath()(*string) { + return m.path +} +// Serialize serializes information the current object +func (m *PagesSourceHash) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("branch", m.GetBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + 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 *PagesSourceHash) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBranch sets the branch property value. The branch property +func (m *PagesSourceHash) SetBranch(value *string)() { + m.branch = value +} +// SetPath sets the path property value. The path property +func (m *PagesSourceHash) SetPath(value *string)() { + m.path = value +} +type PagesSourceHashable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBranch()(*string) + GetPath()(*string) + SetBranch(value *string)() + SetPath(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/participation_stats.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/participation_stats.go new file mode 100644 index 000000000..1461c7bd5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/participation_stats.go @@ -0,0 +1,121 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ParticipationStats struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The all property + all []int32 + // The owner property + owner []int32 +} +// NewParticipationStats instantiates a new ParticipationStats and sets the default values. +func NewParticipationStats()(*ParticipationStats) { + m := &ParticipationStats{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateParticipationStatsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateParticipationStatsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewParticipationStats(), 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 *ParticipationStats) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAll gets the all property value. The all property +// returns a []int32 when successful +func (m *ParticipationStats) GetAll()([]int32) { + return m.all +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ParticipationStats) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["all"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetAll(res) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetOwner(res) + } + return nil + } + return res +} +// GetOwner gets the owner property value. The owner property +// returns a []int32 when successful +func (m *ParticipationStats) GetOwner()([]int32) { + return m.owner +} +// Serialize serializes information the current object +func (m *ParticipationStats) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAll() != nil { + err := writer.WriteCollectionOfInt32Values("all", m.GetAll()) + if err != nil { + return err + } + } + if m.GetOwner() != nil { + err := writer.WriteCollectionOfInt32Values("owner", m.GetOwner()) + 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 *ParticipationStats) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAll sets the all property value. The all property +func (m *ParticipationStats) SetAll(value []int32)() { + m.all = value +} +// SetOwner sets the owner property value. The owner property +func (m *ParticipationStats) SetOwner(value []int32)() { + m.owner = value +} +type ParticipationStatsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAll()([]int32) + GetOwner()([]int32) + SetAll(value []int32)() + SetOwner(value []int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pending_deployment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pending_deployment.go new file mode 100644 index 000000000..c63faabb2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pending_deployment.go @@ -0,0 +1,210 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PendingDeployment details of a deployment that is waiting for protection rules to pass +type PendingDeployment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether the currently authenticated user can approve the deployment + current_user_can_approve *bool + // The environment property + environment PendingDeployment_environmentable + // The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. + reviewers []PendingDeployment_reviewersable + // The set duration of the wait timer + wait_timer *int32 + // The time that the wait timer began. + wait_timer_started_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewPendingDeployment instantiates a new PendingDeployment and sets the default values. +func NewPendingDeployment()(*PendingDeployment) { + m := &PendingDeployment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePendingDeploymentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePendingDeploymentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPendingDeployment(), 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 *PendingDeployment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCurrentUserCanApprove gets the current_user_can_approve property value. Whether the currently authenticated user can approve the deployment +// returns a *bool when successful +func (m *PendingDeployment) GetCurrentUserCanApprove()(*bool) { + return m.current_user_can_approve +} +// GetEnvironment gets the environment property value. The environment property +// returns a PendingDeployment_environmentable when successful +func (m *PendingDeployment) GetEnvironment()(PendingDeployment_environmentable) { + return m.environment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PendingDeployment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["current_user_can_approve"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserCanApprove(val) + } + return nil + } + res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePendingDeployment_environmentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val.(PendingDeployment_environmentable)) + } + return nil + } + res["reviewers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePendingDeployment_reviewersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PendingDeployment_reviewersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PendingDeployment_reviewersable) + } + } + m.SetReviewers(res) + } + return nil + } + res["wait_timer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWaitTimer(val) + } + return nil + } + res["wait_timer_started_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetWaitTimerStartedAt(val) + } + return nil + } + return res +} +// GetReviewers gets the reviewers property value. The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. +// returns a []PendingDeployment_reviewersable when successful +func (m *PendingDeployment) GetReviewers()([]PendingDeployment_reviewersable) { + return m.reviewers +} +// GetWaitTimer gets the wait_timer property value. The set duration of the wait timer +// returns a *int32 when successful +func (m *PendingDeployment) GetWaitTimer()(*int32) { + return m.wait_timer +} +// GetWaitTimerStartedAt gets the wait_timer_started_at property value. The time that the wait timer began. +// returns a *Time when successful +func (m *PendingDeployment) GetWaitTimerStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.wait_timer_started_at +} +// Serialize serializes information the current object +func (m *PendingDeployment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("current_user_can_approve", m.GetCurrentUserCanApprove()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + if m.GetReviewers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetReviewers())) + for i, v := range m.GetReviewers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("reviewers", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("wait_timer", m.GetWaitTimer()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("wait_timer_started_at", m.GetWaitTimerStartedAt()) + 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 *PendingDeployment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCurrentUserCanApprove sets the current_user_can_approve property value. Whether the currently authenticated user can approve the deployment +func (m *PendingDeployment) SetCurrentUserCanApprove(value *bool)() { + m.current_user_can_approve = value +} +// SetEnvironment sets the environment property value. The environment property +func (m *PendingDeployment) SetEnvironment(value PendingDeployment_environmentable)() { + m.environment = value +} +// SetReviewers sets the reviewers property value. The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. +func (m *PendingDeployment) SetReviewers(value []PendingDeployment_reviewersable)() { + m.reviewers = value +} +// SetWaitTimer sets the wait_timer property value. The set duration of the wait timer +func (m *PendingDeployment) SetWaitTimer(value *int32)() { + m.wait_timer = value +} +// SetWaitTimerStartedAt sets the wait_timer_started_at property value. The time that the wait timer began. +func (m *PendingDeployment) SetWaitTimerStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.wait_timer_started_at = value +} +type PendingDeploymentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCurrentUserCanApprove()(*bool) + GetEnvironment()(PendingDeployment_environmentable) + GetReviewers()([]PendingDeployment_reviewersable) + GetWaitTimer()(*int32) + GetWaitTimerStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetCurrentUserCanApprove(value *bool)() + SetEnvironment(value PendingDeployment_environmentable)() + SetReviewers(value []PendingDeployment_reviewersable)() + SetWaitTimer(value *int32)() + SetWaitTimerStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pending_deployment_environment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pending_deployment_environment.go new file mode 100644 index 000000000..2c386d4e5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pending_deployment_environment.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PendingDeployment_environment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html_url property + html_url *string + // The id of the environment. + id *int64 + // The name of the environment. + name *string + // The node_id property + node_id *string + // The url property + url *string +} +// NewPendingDeployment_environment instantiates a new PendingDeployment_environment and sets the default values. +func NewPendingDeployment_environment()(*PendingDeployment_environment) { + m := &PendingDeployment_environment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePendingDeployment_environmentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePendingDeployment_environmentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPendingDeployment_environment(), 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 *PendingDeployment_environment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PendingDeployment_environment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PendingDeployment_environment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id of the environment. +// returns a *int64 when successful +func (m *PendingDeployment_environment) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name of the environment. +// returns a *string when successful +func (m *PendingDeployment_environment) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PendingDeployment_environment) GetNodeId()(*string) { + return m.node_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PendingDeployment_environment) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PendingDeployment_environment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PendingDeployment_environment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PendingDeployment_environment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id of the environment. +func (m *PendingDeployment_environment) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name of the environment. +func (m *PendingDeployment_environment) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PendingDeployment_environment) SetNodeId(value *string)() { + m.node_id = value +} +// SetUrl sets the url property value. The url property +func (m *PendingDeployment_environment) SetUrl(value *string)() { + m.url = value +} +type PendingDeployment_environmentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetId()(*int64) + GetName()(*string) + GetNodeId()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetName(value *string)() + SetNodeId(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pending_deployment_reviewers.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pending_deployment_reviewers.go new file mode 100644 index 000000000..090518129 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pending_deployment_reviewers.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PendingDeployment_reviewers struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The reviewer property + reviewer PendingDeployment_reviewers_PendingDeployment_reviewers_reviewerable + // The type of reviewer. + typeEscaped *DeploymentReviewerType +} +// PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer composed type wrapper for classes SimpleUserable, Teamable +type PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer struct { + // Composed type representation for type SimpleUserable + simpleUser SimpleUserable + // Composed type representation for type Teamable + team Teamable +} +// NewPendingDeployment_reviewers_PendingDeployment_reviewers_reviewer instantiates a new PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer and sets the default values. +func NewPendingDeployment_reviewers_PendingDeployment_reviewers_reviewer()(*PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer) { + m := &PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer{ + } + return m +} +// CreatePendingDeployment_reviewers_PendingDeployment_reviewers_reviewerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePendingDeployment_reviewers_PendingDeployment_reviewers_reviewerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewPendingDeployment_reviewers_PendingDeployment_reviewers_reviewer() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateSimpleUserFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(SimpleUserable); ok { + result.SetSimpleUser(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTeamFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(Teamable); ok { + result.SetTeam(cast) + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer) GetIsComposedType()(bool) { + return true +} +// GetSimpleUser gets the simpleUser property value. Composed type representation for type SimpleUserable +// returns a SimpleUserable when successful +func (m *PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer) GetSimpleUser()(SimpleUserable) { + return m.simpleUser +} +// GetTeam gets the team property value. Composed type representation for type Teamable +// returns a Teamable when successful +func (m *PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer) GetTeam()(Teamable) { + return m.team +} +// Serialize serializes information the current object +func (m *PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSimpleUser() != nil { + err := writer.WriteObjectValue("", m.GetSimpleUser()) + if err != nil { + return err + } + } else if m.GetTeam() != nil { + err := writer.WriteObjectValue("", m.GetTeam()) + if err != nil { + return err + } + } + return nil +} +// SetSimpleUser sets the simpleUser property value. Composed type representation for type SimpleUserable +func (m *PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer) SetSimpleUser(value SimpleUserable)() { + m.simpleUser = value +} +// SetTeam sets the team property value. Composed type representation for type Teamable +func (m *PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer) SetTeam(value Teamable)() { + m.team = value +} +type PendingDeployment_reviewers_PendingDeployment_reviewers_reviewerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSimpleUser()(SimpleUserable) + GetTeam()(Teamable) + SetSimpleUser(value SimpleUserable)() + SetTeam(value Teamable)() +} +// NewPendingDeployment_reviewers instantiates a new PendingDeployment_reviewers and sets the default values. +func NewPendingDeployment_reviewers()(*PendingDeployment_reviewers) { + m := &PendingDeployment_reviewers{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePendingDeployment_reviewersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePendingDeployment_reviewersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPendingDeployment_reviewers(), 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 *PendingDeployment_reviewers) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PendingDeployment_reviewers) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["reviewer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePendingDeployment_reviewers_PendingDeployment_reviewers_reviewerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewer(val.(PendingDeployment_reviewers_PendingDeployment_reviewers_reviewerable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDeploymentReviewerType) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*DeploymentReviewerType)) + } + return nil + } + return res +} +// GetReviewer gets the reviewer property value. The reviewer property +// returns a PendingDeployment_reviewers_PendingDeployment_reviewers_reviewerable when successful +func (m *PendingDeployment_reviewers) GetReviewer()(PendingDeployment_reviewers_PendingDeployment_reviewers_reviewerable) { + return m.reviewer +} +// GetTypeEscaped gets the type property value. The type of reviewer. +// returns a *DeploymentReviewerType when successful +func (m *PendingDeployment_reviewers) GetTypeEscaped()(*DeploymentReviewerType) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *PendingDeployment_reviewers) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("reviewer", m.GetReviewer()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *PendingDeployment_reviewers) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetReviewer sets the reviewer property value. The reviewer property +func (m *PendingDeployment_reviewers) SetReviewer(value PendingDeployment_reviewers_PendingDeployment_reviewers_reviewerable)() { + m.reviewer = value +} +// SetTypeEscaped sets the type property value. The type of reviewer. +func (m *PendingDeployment_reviewers) SetTypeEscaped(value *DeploymentReviewerType)() { + m.typeEscaped = value +} +type PendingDeployment_reviewersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetReviewer()(PendingDeployment_reviewers_PendingDeployment_reviewers_reviewerable) + GetTypeEscaped()(*DeploymentReviewerType) + SetReviewer(value PendingDeployment_reviewers_PendingDeployment_reviewers_reviewerable)() + SetTypeEscaped(value *DeploymentReviewerType)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/porter_author.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/porter_author.go new file mode 100644 index 000000000..193f0bb1c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/porter_author.go @@ -0,0 +1,255 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PorterAuthor porter Author +type PorterAuthor struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The email property + email *string + // The id property + id *int32 + // The import_url property + import_url *string + // The name property + name *string + // The remote_id property + remote_id *string + // The remote_name property + remote_name *string + // The url property + url *string +} +// NewPorterAuthor instantiates a new PorterAuthor and sets the default values. +func NewPorterAuthor()(*PorterAuthor) { + m := &PorterAuthor{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePorterAuthorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePorterAuthorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPorterAuthor(), 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 *PorterAuthor) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *PorterAuthor) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PorterAuthor) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["import_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetImportUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["remote_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRemoteId(val) + } + return nil + } + res["remote_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRemoteName(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *PorterAuthor) GetId()(*int32) { + return m.id +} +// GetImportUrl gets the import_url property value. The import_url property +// returns a *string when successful +func (m *PorterAuthor) GetImportUrl()(*string) { + return m.import_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PorterAuthor) GetName()(*string) { + return m.name +} +// GetRemoteId gets the remote_id property value. The remote_id property +// returns a *string when successful +func (m *PorterAuthor) GetRemoteId()(*string) { + return m.remote_id +} +// GetRemoteName gets the remote_name property value. The remote_name property +// returns a *string when successful +func (m *PorterAuthor) GetRemoteName()(*string) { + return m.remote_name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PorterAuthor) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PorterAuthor) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("import_url", m.GetImportUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("remote_id", m.GetRemoteId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("remote_name", m.GetRemoteName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PorterAuthor) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. The email property +func (m *PorterAuthor) SetEmail(value *string)() { + m.email = value +} +// SetId sets the id property value. The id property +func (m *PorterAuthor) SetId(value *int32)() { + m.id = value +} +// SetImportUrl sets the import_url property value. The import_url property +func (m *PorterAuthor) SetImportUrl(value *string)() { + m.import_url = value +} +// SetName sets the name property value. The name property +func (m *PorterAuthor) SetName(value *string)() { + m.name = value +} +// SetRemoteId sets the remote_id property value. The remote_id property +func (m *PorterAuthor) SetRemoteId(value *string)() { + m.remote_id = value +} +// SetRemoteName sets the remote_name property value. The remote_name property +func (m *PorterAuthor) SetRemoteName(value *string)() { + m.remote_name = value +} +// SetUrl sets the url property value. The url property +func (m *PorterAuthor) SetUrl(value *string)() { + m.url = value +} +type PorterAuthorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetId()(*int32) + GetImportUrl()(*string) + GetName()(*string) + GetRemoteId()(*string) + GetRemoteName()(*string) + GetUrl()(*string) + SetEmail(value *string)() + SetId(value *int32)() + SetImportUrl(value *string)() + SetName(value *string)() + SetRemoteId(value *string)() + SetRemoteName(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/porter_large_file.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/porter_large_file.go new file mode 100644 index 000000000..2a0c7b18c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/porter_large_file.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PorterLargeFile porter Large File +type PorterLargeFile struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The oid property + oid *string + // The path property + path *string + // The ref_name property + ref_name *string + // The size property + size *int32 +} +// NewPorterLargeFile instantiates a new PorterLargeFile and sets the default values. +func NewPorterLargeFile()(*PorterLargeFile) { + m := &PorterLargeFile{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePorterLargeFileFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePorterLargeFileFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPorterLargeFile(), 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 *PorterLargeFile) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PorterLargeFile) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["oid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOid(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["ref_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRefName(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + return res +} +// GetOid gets the oid property value. The oid property +// returns a *string when successful +func (m *PorterLargeFile) GetOid()(*string) { + return m.oid +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *PorterLargeFile) GetPath()(*string) { + return m.path +} +// GetRefName gets the ref_name property value. The ref_name property +// returns a *string when successful +func (m *PorterLargeFile) GetRefName()(*string) { + return m.ref_name +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *PorterLargeFile) GetSize()(*int32) { + return m.size +} +// Serialize serializes information the current object +func (m *PorterLargeFile) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("oid", m.GetOid()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref_name", m.GetRefName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + 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 *PorterLargeFile) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetOid sets the oid property value. The oid property +func (m *PorterLargeFile) SetOid(value *string)() { + m.oid = value +} +// SetPath sets the path property value. The path property +func (m *PorterLargeFile) SetPath(value *string)() { + m.path = value +} +// SetRefName sets the ref_name property value. The ref_name property +func (m *PorterLargeFile) SetRefName(value *string)() { + m.ref_name = value +} +// SetSize sets the size property value. The size property +func (m *PorterLargeFile) SetSize(value *int32)() { + m.size = value +} +type PorterLargeFileable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetOid()(*string) + GetPath()(*string) + GetRefName()(*string) + GetSize()(*int32) + SetOid(value *string)() + SetPath(value *string)() + SetRefName(value *string)() + SetSize(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/private_user.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/private_user.go new file mode 100644 index 000000000..80946649c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/private_user.go @@ -0,0 +1,1300 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PrivateUser private User +type PrivateUser struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The bio property + bio *string + // The blog property + blog *string + // The business_plus property + business_plus *bool + // The collaborators property + collaborators *int32 + // The company property + company *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The disk_usage property + disk_usage *int32 + // The email property + email *string + // The events_url property + events_url *string + // The followers property + followers *int32 + // The followers_url property + followers_url *string + // The following property + following *int32 + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The hireable property + hireable *bool + // The html_url property + html_url *string + // The id property + id *int64 + // The ldap_dn property + ldap_dn *string + // The location property + location *string + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The notification_email property + notification_email *string + // The organizations_url property + organizations_url *string + // The owned_private_repos property + owned_private_repos *int32 + // The plan property + plan PrivateUser_planable + // The private_gists property + private_gists *int32 + // The public_gists property + public_gists *int32 + // The public_repos property + public_repos *int32 + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The suspended_at property + suspended_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The total_private_repos property + total_private_repos *int32 + // The twitter_username property + twitter_username *string + // The two_factor_authentication property + two_factor_authentication *bool + // The type property + typeEscaped *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewPrivateUser instantiates a new PrivateUser and sets the default values. +func NewPrivateUser()(*PrivateUser) { + m := &PrivateUser{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePrivateUserFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePrivateUserFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPrivateUser(), 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 *PrivateUser) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *PrivateUser) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetBio gets the bio property value. The bio property +// returns a *string when successful +func (m *PrivateUser) GetBio()(*string) { + return m.bio +} +// GetBlog gets the blog property value. The blog property +// returns a *string when successful +func (m *PrivateUser) GetBlog()(*string) { + return m.blog +} +// GetBusinessPlus gets the business_plus property value. The business_plus property +// returns a *bool when successful +func (m *PrivateUser) GetBusinessPlus()(*bool) { + return m.business_plus +} +// GetCollaborators gets the collaborators property value. The collaborators property +// returns a *int32 when successful +func (m *PrivateUser) GetCollaborators()(*int32) { + return m.collaborators +} +// GetCompany gets the company property value. The company property +// returns a *string when successful +func (m *PrivateUser) GetCompany()(*string) { + return m.company +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PrivateUser) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDiskUsage gets the disk_usage property value. The disk_usage property +// returns a *int32 when successful +func (m *PrivateUser) GetDiskUsage()(*int32) { + return m.disk_usage +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *PrivateUser) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *PrivateUser) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PrivateUser) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["bio"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBio(val) + } + return nil + } + res["blog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlog(val) + } + return nil + } + res["business_plus"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetBusinessPlus(val) + } + return nil + } + res["collaborators"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCollaborators(val) + } + return nil + } + res["company"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompany(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["disk_usage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDiskUsage(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowers(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowing(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["hireable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHireable(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["ldap_dn"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLdapDn(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notification_email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationEmail(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["owned_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOwnedPrivateRepos(val) + } + return nil + } + res["plan"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePrivateUser_planFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPlan(val.(PrivateUser_planable)) + } + return nil + } + res["private_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateGists(val) + } + return nil + } + res["public_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicGists(val) + } + return nil + } + res["public_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicRepos(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["suspended_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetSuspendedAt(val) + } + return nil + } + res["total_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalPrivateRepos(val) + } + return nil + } + res["twitter_username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTwitterUsername(val) + } + return nil + } + res["two_factor_authentication"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTwoFactorAuthentication(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowers gets the followers property value. The followers property +// returns a *int32 when successful +func (m *PrivateUser) GetFollowers()(*int32) { + return m.followers +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *PrivateUser) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowing gets the following property value. The following property +// returns a *int32 when successful +func (m *PrivateUser) GetFollowing()(*int32) { + return m.following +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *PrivateUser) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *PrivateUser) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *PrivateUser) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHireable gets the hireable property value. The hireable property +// returns a *bool when successful +func (m *PrivateUser) GetHireable()(*bool) { + return m.hireable +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PrivateUser) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PrivateUser) GetId()(*int64) { + return m.id +} +// GetLdapDn gets the ldap_dn property value. The ldap_dn property +// returns a *string when successful +func (m *PrivateUser) GetLdapDn()(*string) { + return m.ldap_dn +} +// GetLocation gets the location property value. The location property +// returns a *string when successful +func (m *PrivateUser) GetLocation()(*string) { + return m.location +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *PrivateUser) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PrivateUser) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PrivateUser) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationEmail gets the notification_email property value. The notification_email property +// returns a *string when successful +func (m *PrivateUser) GetNotificationEmail()(*string) { + return m.notification_email +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *PrivateUser) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetOwnedPrivateRepos gets the owned_private_repos property value. The owned_private_repos property +// returns a *int32 when successful +func (m *PrivateUser) GetOwnedPrivateRepos()(*int32) { + return m.owned_private_repos +} +// GetPlan gets the plan property value. The plan property +// returns a PrivateUser_planable when successful +func (m *PrivateUser) GetPlan()(PrivateUser_planable) { + return m.plan +} +// GetPrivateGists gets the private_gists property value. The private_gists property +// returns a *int32 when successful +func (m *PrivateUser) GetPrivateGists()(*int32) { + return m.private_gists +} +// GetPublicGists gets the public_gists property value. The public_gists property +// returns a *int32 when successful +func (m *PrivateUser) GetPublicGists()(*int32) { + return m.public_gists +} +// GetPublicRepos gets the public_repos property value. The public_repos property +// returns a *int32 when successful +func (m *PrivateUser) GetPublicRepos()(*int32) { + return m.public_repos +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *PrivateUser) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *PrivateUser) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *PrivateUser) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *PrivateUser) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *PrivateUser) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetSuspendedAt gets the suspended_at property value. The suspended_at property +// returns a *Time when successful +func (m *PrivateUser) GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.suspended_at +} +// GetTotalPrivateRepos gets the total_private_repos property value. The total_private_repos property +// returns a *int32 when successful +func (m *PrivateUser) GetTotalPrivateRepos()(*int32) { + return m.total_private_repos +} +// GetTwitterUsername gets the twitter_username property value. The twitter_username property +// returns a *string when successful +func (m *PrivateUser) GetTwitterUsername()(*string) { + return m.twitter_username +} +// GetTwoFactorAuthentication gets the two_factor_authentication property value. The two_factor_authentication property +// returns a *bool when successful +func (m *PrivateUser) GetTwoFactorAuthentication()(*bool) { + return m.two_factor_authentication +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *PrivateUser) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PrivateUser) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PrivateUser) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PrivateUser) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("bio", m.GetBio()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blog", m.GetBlog()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("business_plus", m.GetBusinessPlus()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("collaborators", m.GetCollaborators()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("company", m.GetCompany()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("disk_usage", m.GetDiskUsage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("followers", m.GetFollowers()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("following", m.GetFollowing()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("hireable", m.GetHireable()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ldap_dn", m.GetLdapDn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notification_email", m.GetNotificationEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("owned_private_repos", m.GetOwnedPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("plan", m.GetPlan()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_gists", m.GetPrivateGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_gists", m.GetPublicGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_repos", m.GetPublicRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("suspended_at", m.GetSuspendedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_private_repos", m.GetTotalPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("twitter_username", m.GetTwitterUsername()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("two_factor_authentication", m.GetTwoFactorAuthentication()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PrivateUser) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *PrivateUser) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetBio sets the bio property value. The bio property +func (m *PrivateUser) SetBio(value *string)() { + m.bio = value +} +// SetBlog sets the blog property value. The blog property +func (m *PrivateUser) SetBlog(value *string)() { + m.blog = value +} +// SetBusinessPlus sets the business_plus property value. The business_plus property +func (m *PrivateUser) SetBusinessPlus(value *bool)() { + m.business_plus = value +} +// SetCollaborators sets the collaborators property value. The collaborators property +func (m *PrivateUser) SetCollaborators(value *int32)() { + m.collaborators = value +} +// SetCompany sets the company property value. The company property +func (m *PrivateUser) SetCompany(value *string)() { + m.company = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PrivateUser) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDiskUsage sets the disk_usage property value. The disk_usage property +func (m *PrivateUser) SetDiskUsage(value *int32)() { + m.disk_usage = value +} +// SetEmail sets the email property value. The email property +func (m *PrivateUser) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *PrivateUser) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowers sets the followers property value. The followers property +func (m *PrivateUser) SetFollowers(value *int32)() { + m.followers = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *PrivateUser) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowing sets the following property value. The following property +func (m *PrivateUser) SetFollowing(value *int32)() { + m.following = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *PrivateUser) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *PrivateUser) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *PrivateUser) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHireable sets the hireable property value. The hireable property +func (m *PrivateUser) SetHireable(value *bool)() { + m.hireable = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PrivateUser) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PrivateUser) SetId(value *int64)() { + m.id = value +} +// SetLdapDn sets the ldap_dn property value. The ldap_dn property +func (m *PrivateUser) SetLdapDn(value *string)() { + m.ldap_dn = value +} +// SetLocation sets the location property value. The location property +func (m *PrivateUser) SetLocation(value *string)() { + m.location = value +} +// SetLogin sets the login property value. The login property +func (m *PrivateUser) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *PrivateUser) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PrivateUser) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationEmail sets the notification_email property value. The notification_email property +func (m *PrivateUser) SetNotificationEmail(value *string)() { + m.notification_email = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *PrivateUser) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetOwnedPrivateRepos sets the owned_private_repos property value. The owned_private_repos property +func (m *PrivateUser) SetOwnedPrivateRepos(value *int32)() { + m.owned_private_repos = value +} +// SetPlan sets the plan property value. The plan property +func (m *PrivateUser) SetPlan(value PrivateUser_planable)() { + m.plan = value +} +// SetPrivateGists sets the private_gists property value. The private_gists property +func (m *PrivateUser) SetPrivateGists(value *int32)() { + m.private_gists = value +} +// SetPublicGists sets the public_gists property value. The public_gists property +func (m *PrivateUser) SetPublicGists(value *int32)() { + m.public_gists = value +} +// SetPublicRepos sets the public_repos property value. The public_repos property +func (m *PrivateUser) SetPublicRepos(value *int32)() { + m.public_repos = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *PrivateUser) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *PrivateUser) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *PrivateUser) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *PrivateUser) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *PrivateUser) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetSuspendedAt sets the suspended_at property value. The suspended_at property +func (m *PrivateUser) SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.suspended_at = value +} +// SetTotalPrivateRepos sets the total_private_repos property value. The total_private_repos property +func (m *PrivateUser) SetTotalPrivateRepos(value *int32)() { + m.total_private_repos = value +} +// SetTwitterUsername sets the twitter_username property value. The twitter_username property +func (m *PrivateUser) SetTwitterUsername(value *string)() { + m.twitter_username = value +} +// SetTwoFactorAuthentication sets the two_factor_authentication property value. The two_factor_authentication property +func (m *PrivateUser) SetTwoFactorAuthentication(value *bool)() { + m.two_factor_authentication = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *PrivateUser) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PrivateUser) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PrivateUser) SetUrl(value *string)() { + m.url = value +} +type PrivateUserable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetBio()(*string) + GetBlog()(*string) + GetBusinessPlus()(*bool) + GetCollaborators()(*int32) + GetCompany()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDiskUsage()(*int32) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowers()(*int32) + GetFollowersUrl()(*string) + GetFollowing()(*int32) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHireable()(*bool) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLdapDn()(*string) + GetLocation()(*string) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationEmail()(*string) + GetOrganizationsUrl()(*string) + GetOwnedPrivateRepos()(*int32) + GetPlan()(PrivateUser_planable) + GetPrivateGists()(*int32) + GetPublicGists()(*int32) + GetPublicRepos()(*int32) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetTotalPrivateRepos()(*int32) + GetTwitterUsername()(*string) + GetTwoFactorAuthentication()(*bool) + GetTypeEscaped()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetBio(value *string)() + SetBlog(value *string)() + SetBusinessPlus(value *bool)() + SetCollaborators(value *int32)() + SetCompany(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDiskUsage(value *int32)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowers(value *int32)() + SetFollowersUrl(value *string)() + SetFollowing(value *int32)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHireable(value *bool)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLdapDn(value *string)() + SetLocation(value *string)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationEmail(value *string)() + SetOrganizationsUrl(value *string)() + SetOwnedPrivateRepos(value *int32)() + SetPlan(value PrivateUser_planable)() + SetPrivateGists(value *int32)() + SetPublicGists(value *int32)() + SetPublicRepos(value *int32)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetTotalPrivateRepos(value *int32)() + SetTwitterUsername(value *string)() + SetTwoFactorAuthentication(value *bool)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/private_user_plan.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/private_user_plan.go new file mode 100644 index 000000000..0ab80ac66 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/private_user_plan.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PrivateUser_plan struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The collaborators property + collaborators *int32 + // The name property + name *string + // The private_repos property + private_repos *int32 + // The space property + space *int32 +} +// NewPrivateUser_plan instantiates a new PrivateUser_plan and sets the default values. +func NewPrivateUser_plan()(*PrivateUser_plan) { + m := &PrivateUser_plan{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePrivateUser_planFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePrivateUser_planFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPrivateUser_plan(), 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 *PrivateUser_plan) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCollaborators gets the collaborators property value. The collaborators property +// returns a *int32 when successful +func (m *PrivateUser_plan) GetCollaborators()(*int32) { + return m.collaborators +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PrivateUser_plan) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["collaborators"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCollaborators(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateRepos(val) + } + return nil + } + res["space"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSpace(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PrivateUser_plan) GetName()(*string) { + return m.name +} +// GetPrivateRepos gets the private_repos property value. The private_repos property +// returns a *int32 when successful +func (m *PrivateUser_plan) GetPrivateRepos()(*int32) { + return m.private_repos +} +// GetSpace gets the space property value. The space property +// returns a *int32 when successful +func (m *PrivateUser_plan) GetSpace()(*int32) { + return m.space +} +// Serialize serializes information the current object +func (m *PrivateUser_plan) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("collaborators", m.GetCollaborators()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_repos", m.GetPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("space", m.GetSpace()) + 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 *PrivateUser_plan) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCollaborators sets the collaborators property value. The collaborators property +func (m *PrivateUser_plan) SetCollaborators(value *int32)() { + m.collaborators = value +} +// SetName sets the name property value. The name property +func (m *PrivateUser_plan) SetName(value *string)() { + m.name = value +} +// SetPrivateRepos sets the private_repos property value. The private_repos property +func (m *PrivateUser_plan) SetPrivateRepos(value *int32)() { + m.private_repos = value +} +// SetSpace sets the space property value. The space property +func (m *PrivateUser_plan) SetSpace(value *int32)() { + m.space = value +} +type PrivateUser_planable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCollaborators()(*int32) + GetName()(*string) + GetPrivateRepos()(*int32) + GetSpace()(*int32) + SetCollaborators(value *int32)() + SetName(value *string)() + SetPrivateRepos(value *int32)() + SetSpace(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/private_vulnerability_report_create.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/private_vulnerability_report_create.go new file mode 100644 index 000000000..81d7d51f8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/private_vulnerability_report_create.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PrivateVulnerabilityReportCreate struct { + // The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`. + cvss_vector_string *string + // A list of Common Weakness Enumeration (CWE) IDs. + cwe_ids []string + // A detailed description of what the advisory impacts. + description *string + // The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. + severity *PrivateVulnerabilityReportCreate_severity + // Whether to create a temporary private fork of the repository to collaborate on a fix. + start_private_fork *bool + // A short summary of the advisory. + summary *string + // An array of products affected by the vulnerability detailed in a repository security advisory. + vulnerabilities []PrivateVulnerabilityReportCreate_vulnerabilitiesable +} +// NewPrivateVulnerabilityReportCreate instantiates a new PrivateVulnerabilityReportCreate and sets the default values. +func NewPrivateVulnerabilityReportCreate()(*PrivateVulnerabilityReportCreate) { + m := &PrivateVulnerabilityReportCreate{ + } + return m +} +// CreatePrivateVulnerabilityReportCreateFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePrivateVulnerabilityReportCreateFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPrivateVulnerabilityReportCreate(), nil +} +// GetCvssVectorString gets the cvss_vector_string property value. The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`. +// returns a *string when successful +func (m *PrivateVulnerabilityReportCreate) GetCvssVectorString()(*string) { + return m.cvss_vector_string +} +// GetCweIds gets the cwe_ids property value. A list of Common Weakness Enumeration (CWE) IDs. +// returns a []string when successful +func (m *PrivateVulnerabilityReportCreate) GetCweIds()([]string) { + return m.cwe_ids +} +// GetDescription gets the description property value. A detailed description of what the advisory impacts. +// returns a *string when successful +func (m *PrivateVulnerabilityReportCreate) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PrivateVulnerabilityReportCreate) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cvss_vector_string"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCvssVectorString(val) + } + return nil + } + res["cwe_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetCweIds(res) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["severity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePrivateVulnerabilityReportCreate_severity) + if err != nil { + return err + } + if val != nil { + m.SetSeverity(val.(*PrivateVulnerabilityReportCreate_severity)) + } + return nil + } + res["start_private_fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetStartPrivateFork(val) + } + return nil + } + res["summary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSummary(val) + } + return nil + } + res["vulnerabilities"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePrivateVulnerabilityReportCreate_vulnerabilitiesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PrivateVulnerabilityReportCreate_vulnerabilitiesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PrivateVulnerabilityReportCreate_vulnerabilitiesable) + } + } + m.SetVulnerabilities(res) + } + return nil + } + return res +} +// GetSeverity gets the severity property value. The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. +// returns a *PrivateVulnerabilityReportCreate_severity when successful +func (m *PrivateVulnerabilityReportCreate) GetSeverity()(*PrivateVulnerabilityReportCreate_severity) { + return m.severity +} +// GetStartPrivateFork gets the start_private_fork property value. Whether to create a temporary private fork of the repository to collaborate on a fix. +// returns a *bool when successful +func (m *PrivateVulnerabilityReportCreate) GetStartPrivateFork()(*bool) { + return m.start_private_fork +} +// GetSummary gets the summary property value. A short summary of the advisory. +// returns a *string when successful +func (m *PrivateVulnerabilityReportCreate) GetSummary()(*string) { + return m.summary +} +// GetVulnerabilities gets the vulnerabilities property value. An array of products affected by the vulnerability detailed in a repository security advisory. +// returns a []PrivateVulnerabilityReportCreate_vulnerabilitiesable when successful +func (m *PrivateVulnerabilityReportCreate) GetVulnerabilities()([]PrivateVulnerabilityReportCreate_vulnerabilitiesable) { + return m.vulnerabilities +} +// Serialize serializes information the current object +func (m *PrivateVulnerabilityReportCreate) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("cvss_vector_string", m.GetCvssVectorString()) + if err != nil { + return err + } + } + if m.GetCweIds() != nil { + err := writer.WriteCollectionOfStringValues("cwe_ids", m.GetCweIds()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + if m.GetSeverity() != nil { + cast := (*m.GetSeverity()).String() + err := writer.WriteStringValue("severity", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("start_private_fork", m.GetStartPrivateFork()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("summary", m.GetSummary()) + if err != nil { + return err + } + } + if m.GetVulnerabilities() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVulnerabilities())) + for i, v := range m.GetVulnerabilities() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("vulnerabilities", cast) + if err != nil { + return err + } + } + return nil +} +// SetCvssVectorString sets the cvss_vector_string property value. The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`. +func (m *PrivateVulnerabilityReportCreate) SetCvssVectorString(value *string)() { + m.cvss_vector_string = value +} +// SetCweIds sets the cwe_ids property value. A list of Common Weakness Enumeration (CWE) IDs. +func (m *PrivateVulnerabilityReportCreate) SetCweIds(value []string)() { + m.cwe_ids = value +} +// SetDescription sets the description property value. A detailed description of what the advisory impacts. +func (m *PrivateVulnerabilityReportCreate) SetDescription(value *string)() { + m.description = value +} +// SetSeverity sets the severity property value. The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. +func (m *PrivateVulnerabilityReportCreate) SetSeverity(value *PrivateVulnerabilityReportCreate_severity)() { + m.severity = value +} +// SetStartPrivateFork sets the start_private_fork property value. Whether to create a temporary private fork of the repository to collaborate on a fix. +func (m *PrivateVulnerabilityReportCreate) SetStartPrivateFork(value *bool)() { + m.start_private_fork = value +} +// SetSummary sets the summary property value. A short summary of the advisory. +func (m *PrivateVulnerabilityReportCreate) SetSummary(value *string)() { + m.summary = value +} +// SetVulnerabilities sets the vulnerabilities property value. An array of products affected by the vulnerability detailed in a repository security advisory. +func (m *PrivateVulnerabilityReportCreate) SetVulnerabilities(value []PrivateVulnerabilityReportCreate_vulnerabilitiesable)() { + m.vulnerabilities = value +} +type PrivateVulnerabilityReportCreateable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCvssVectorString()(*string) + GetCweIds()([]string) + GetDescription()(*string) + GetSeverity()(*PrivateVulnerabilityReportCreate_severity) + GetStartPrivateFork()(*bool) + GetSummary()(*string) + GetVulnerabilities()([]PrivateVulnerabilityReportCreate_vulnerabilitiesable) + SetCvssVectorString(value *string)() + SetCweIds(value []string)() + SetDescription(value *string)() + SetSeverity(value *PrivateVulnerabilityReportCreate_severity)() + SetStartPrivateFork(value *bool)() + SetSummary(value *string)() + SetVulnerabilities(value []PrivateVulnerabilityReportCreate_vulnerabilitiesable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/private_vulnerability_report_create_severity.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/private_vulnerability_report_create_severity.go new file mode 100644 index 000000000..1d02cc5a1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/private_vulnerability_report_create_severity.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. +type PrivateVulnerabilityReportCreate_severity int + +const ( + CRITICAL_PRIVATEVULNERABILITYREPORTCREATE_SEVERITY PrivateVulnerabilityReportCreate_severity = iota + HIGH_PRIVATEVULNERABILITYREPORTCREATE_SEVERITY + MEDIUM_PRIVATEVULNERABILITYREPORTCREATE_SEVERITY + LOW_PRIVATEVULNERABILITYREPORTCREATE_SEVERITY +) + +func (i PrivateVulnerabilityReportCreate_severity) String() string { + return []string{"critical", "high", "medium", "low"}[i] +} +func ParsePrivateVulnerabilityReportCreate_severity(v string) (any, error) { + result := CRITICAL_PRIVATEVULNERABILITYREPORTCREATE_SEVERITY + switch v { + case "critical": + result = CRITICAL_PRIVATEVULNERABILITYREPORTCREATE_SEVERITY + case "high": + result = HIGH_PRIVATEVULNERABILITYREPORTCREATE_SEVERITY + case "medium": + result = MEDIUM_PRIVATEVULNERABILITYREPORTCREATE_SEVERITY + case "low": + result = LOW_PRIVATEVULNERABILITYREPORTCREATE_SEVERITY + default: + return 0, errors.New("Unknown PrivateVulnerabilityReportCreate_severity value: " + v) + } + return &result, nil +} +func SerializePrivateVulnerabilityReportCreate_severity(values []PrivateVulnerabilityReportCreate_severity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PrivateVulnerabilityReportCreate_severity) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/private_vulnerability_report_create_vulnerabilities.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/private_vulnerability_report_create_vulnerabilities.go new file mode 100644 index 000000000..cb889ee29 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/private_vulnerability_report_create_vulnerabilities.go @@ -0,0 +1,154 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PrivateVulnerabilityReportCreate_vulnerabilities struct { + // The name of the package affected by the vulnerability. + packageEscaped PrivateVulnerabilityReportCreate_vulnerabilities_packageable + // The package version(s) that resolve the vulnerability. + patched_versions *string + // The functions in the package that are affected. + vulnerable_functions []string + // The range of the package versions affected by the vulnerability. + vulnerable_version_range *string +} +// NewPrivateVulnerabilityReportCreate_vulnerabilities instantiates a new PrivateVulnerabilityReportCreate_vulnerabilities and sets the default values. +func NewPrivateVulnerabilityReportCreate_vulnerabilities()(*PrivateVulnerabilityReportCreate_vulnerabilities) { + m := &PrivateVulnerabilityReportCreate_vulnerabilities{ + } + return m +} +// CreatePrivateVulnerabilityReportCreate_vulnerabilitiesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePrivateVulnerabilityReportCreate_vulnerabilitiesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPrivateVulnerabilityReportCreate_vulnerabilities(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PrivateVulnerabilityReportCreate_vulnerabilities) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["package"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePrivateVulnerabilityReportCreate_vulnerabilities_packageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPackageEscaped(val.(PrivateVulnerabilityReportCreate_vulnerabilities_packageable)) + } + return nil + } + res["patched_versions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatchedVersions(val) + } + return nil + } + res["vulnerable_functions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetVulnerableFunctions(res) + } + return nil + } + res["vulnerable_version_range"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVulnerableVersionRange(val) + } + return nil + } + return res +} +// GetPackageEscaped gets the package property value. The name of the package affected by the vulnerability. +// returns a PrivateVulnerabilityReportCreate_vulnerabilities_packageable when successful +func (m *PrivateVulnerabilityReportCreate_vulnerabilities) GetPackageEscaped()(PrivateVulnerabilityReportCreate_vulnerabilities_packageable) { + return m.packageEscaped +} +// GetPatchedVersions gets the patched_versions property value. The package version(s) that resolve the vulnerability. +// returns a *string when successful +func (m *PrivateVulnerabilityReportCreate_vulnerabilities) GetPatchedVersions()(*string) { + return m.patched_versions +} +// GetVulnerableFunctions gets the vulnerable_functions property value. The functions in the package that are affected. +// returns a []string when successful +func (m *PrivateVulnerabilityReportCreate_vulnerabilities) GetVulnerableFunctions()([]string) { + return m.vulnerable_functions +} +// GetVulnerableVersionRange gets the vulnerable_version_range property value. The range of the package versions affected by the vulnerability. +// returns a *string when successful +func (m *PrivateVulnerabilityReportCreate_vulnerabilities) GetVulnerableVersionRange()(*string) { + return m.vulnerable_version_range +} +// Serialize serializes information the current object +func (m *PrivateVulnerabilityReportCreate_vulnerabilities) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("package", m.GetPackageEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patched_versions", m.GetPatchedVersions()) + if err != nil { + return err + } + } + if m.GetVulnerableFunctions() != nil { + err := writer.WriteCollectionOfStringValues("vulnerable_functions", m.GetVulnerableFunctions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("vulnerable_version_range", m.GetVulnerableVersionRange()) + if err != nil { + return err + } + } + return nil +} +// SetPackageEscaped sets the package property value. The name of the package affected by the vulnerability. +func (m *PrivateVulnerabilityReportCreate_vulnerabilities) SetPackageEscaped(value PrivateVulnerabilityReportCreate_vulnerabilities_packageable)() { + m.packageEscaped = value +} +// SetPatchedVersions sets the patched_versions property value. The package version(s) that resolve the vulnerability. +func (m *PrivateVulnerabilityReportCreate_vulnerabilities) SetPatchedVersions(value *string)() { + m.patched_versions = value +} +// SetVulnerableFunctions sets the vulnerable_functions property value. The functions in the package that are affected. +func (m *PrivateVulnerabilityReportCreate_vulnerabilities) SetVulnerableFunctions(value []string)() { + m.vulnerable_functions = value +} +// SetVulnerableVersionRange sets the vulnerable_version_range property value. The range of the package versions affected by the vulnerability. +func (m *PrivateVulnerabilityReportCreate_vulnerabilities) SetVulnerableVersionRange(value *string)() { + m.vulnerable_version_range = value +} +type PrivateVulnerabilityReportCreate_vulnerabilitiesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPackageEscaped()(PrivateVulnerabilityReportCreate_vulnerabilities_packageable) + GetPatchedVersions()(*string) + GetVulnerableFunctions()([]string) + GetVulnerableVersionRange()(*string) + SetPackageEscaped(value PrivateVulnerabilityReportCreate_vulnerabilities_packageable)() + SetPatchedVersions(value *string)() + SetVulnerableFunctions(value []string)() + SetVulnerableVersionRange(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/private_vulnerability_report_create_vulnerabilities_package.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/private_vulnerability_report_create_vulnerabilities_package.go new file mode 100644 index 000000000..572b64822 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/private_vulnerability_report_create_vulnerabilities_package.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PrivateVulnerabilityReportCreate_vulnerabilities_package the name of the package affected by the vulnerability. +type PrivateVulnerabilityReportCreate_vulnerabilities_package struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The package's language or package management ecosystem. + ecosystem *SecurityAdvisoryEcosystems + // The unique package name within its ecosystem. + name *string +} +// NewPrivateVulnerabilityReportCreate_vulnerabilities_package instantiates a new PrivateVulnerabilityReportCreate_vulnerabilities_package and sets the default values. +func NewPrivateVulnerabilityReportCreate_vulnerabilities_package()(*PrivateVulnerabilityReportCreate_vulnerabilities_package) { + m := &PrivateVulnerabilityReportCreate_vulnerabilities_package{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePrivateVulnerabilityReportCreate_vulnerabilities_packageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePrivateVulnerabilityReportCreate_vulnerabilities_packageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPrivateVulnerabilityReportCreate_vulnerabilities_package(), 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 *PrivateVulnerabilityReportCreate_vulnerabilities_package) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEcosystem gets the ecosystem property value. The package's language or package management ecosystem. +// returns a *SecurityAdvisoryEcosystems when successful +func (m *PrivateVulnerabilityReportCreate_vulnerabilities_package) GetEcosystem()(*SecurityAdvisoryEcosystems) { + return m.ecosystem +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PrivateVulnerabilityReportCreate_vulnerabilities_package) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ecosystem"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAdvisoryEcosystems) + if err != nil { + return err + } + if val != nil { + m.SetEcosystem(val.(*SecurityAdvisoryEcosystems)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The unique package name within its ecosystem. +// returns a *string when successful +func (m *PrivateVulnerabilityReportCreate_vulnerabilities_package) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *PrivateVulnerabilityReportCreate_vulnerabilities_package) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEcosystem() != nil { + cast := (*m.GetEcosystem()).String() + err := writer.WriteStringValue("ecosystem", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *PrivateVulnerabilityReportCreate_vulnerabilities_package) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEcosystem sets the ecosystem property value. The package's language or package management ecosystem. +func (m *PrivateVulnerabilityReportCreate_vulnerabilities_package) SetEcosystem(value *SecurityAdvisoryEcosystems)() { + m.ecosystem = value +} +// SetName sets the name property value. The unique package name within its ecosystem. +func (m *PrivateVulnerabilityReportCreate_vulnerabilities_package) SetName(value *string)() { + m.name = value +} +type PrivateVulnerabilityReportCreate_vulnerabilities_packageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEcosystem()(*SecurityAdvisoryEcosystems) + GetName()(*string) + SetEcosystem(value *SecurityAdvisoryEcosystems)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/project.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/project.go new file mode 100644 index 000000000..431310d51 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/project.go @@ -0,0 +1,489 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Project projects are a way to organize columns and cards of work. +type Project struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Body of the project + body *string + // The columns_url property + columns_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + creator NullableSimpleUserable + // The html_url property + html_url *string + // The id property + id *int32 + // Name of the project + name *string + // The node_id property + node_id *string + // The number property + number *int32 + // The baseline permission that all organization members have on this project. Only present if owner is an organization. + organization_permission *Project_organization_permission + // The owner_url property + owner_url *string + // Whether or not this project can be seen by everyone. Only present if owner is an organization. + private *bool + // State of the project; either 'open' or 'closed' + state *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewProject instantiates a new Project and sets the default values. +func NewProject()(*Project) { + m := &Project{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProjectFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProjectFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProject(), 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 *Project) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. Body of the project +// returns a *string when successful +func (m *Project) GetBody()(*string) { + return m.body +} +// GetColumnsUrl gets the columns_url property value. The columns_url property +// returns a *string when successful +func (m *Project) GetColumnsUrl()(*string) { + return m.columns_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Project) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCreator gets the creator property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Project) GetCreator()(NullableSimpleUserable) { + return m.creator +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Project) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["columns_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["creator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreator(val.(NullableSimpleUserable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["organization_permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseProject_organization_permission) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationPermission(val.(*Project_organization_permission)) + } + return nil + } + res["owner_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOwnerUrl(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Project) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Project) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. Name of the project +// returns a *string when successful +func (m *Project) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Project) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. The number property +// returns a *int32 when successful +func (m *Project) GetNumber()(*int32) { + return m.number +} +// GetOrganizationPermission gets the organization_permission property value. The baseline permission that all organization members have on this project. Only present if owner is an organization. +// returns a *Project_organization_permission when successful +func (m *Project) GetOrganizationPermission()(*Project_organization_permission) { + return m.organization_permission +} +// GetOwnerUrl gets the owner_url property value. The owner_url property +// returns a *string when successful +func (m *Project) GetOwnerUrl()(*string) { + return m.owner_url +} +// GetPrivate gets the private property value. Whether or not this project can be seen by everyone. Only present if owner is an organization. +// returns a *bool when successful +func (m *Project) GetPrivate()(*bool) { + return m.private +} +// GetState gets the state property value. State of the project; either 'open' or 'closed' +// returns a *string when successful +func (m *Project) GetState()(*string) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Project) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Project) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Project) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("columns_url", m.GetColumnsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("creator", m.GetCreator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + if m.GetOrganizationPermission() != nil { + cast := (*m.GetOrganizationPermission()).String() + err := writer.WriteStringValue("organization_permission", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("owner_url", m.GetOwnerUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Project) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. Body of the project +func (m *Project) SetBody(value *string)() { + m.body = value +} +// SetColumnsUrl sets the columns_url property value. The columns_url property +func (m *Project) SetColumnsUrl(value *string)() { + m.columns_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Project) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCreator sets the creator property value. A GitHub user. +func (m *Project) SetCreator(value NullableSimpleUserable)() { + m.creator = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Project) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Project) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. Name of the project +func (m *Project) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Project) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. The number property +func (m *Project) SetNumber(value *int32)() { + m.number = value +} +// SetOrganizationPermission sets the organization_permission property value. The baseline permission that all organization members have on this project. Only present if owner is an organization. +func (m *Project) SetOrganizationPermission(value *Project_organization_permission)() { + m.organization_permission = value +} +// SetOwnerUrl sets the owner_url property value. The owner_url property +func (m *Project) SetOwnerUrl(value *string)() { + m.owner_url = value +} +// SetPrivate sets the private property value. Whether or not this project can be seen by everyone. Only present if owner is an organization. +func (m *Project) SetPrivate(value *bool)() { + m.private = value +} +// SetState sets the state property value. State of the project; either 'open' or 'closed' +func (m *Project) SetState(value *string)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Project) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Project) SetUrl(value *string)() { + m.url = value +} +type Projectable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetColumnsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreator()(NullableSimpleUserable) + GetHtmlUrl()(*string) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetNumber()(*int32) + GetOrganizationPermission()(*Project_organization_permission) + GetOwnerUrl()(*string) + GetPrivate()(*bool) + GetState()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetBody(value *string)() + SetColumnsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreator(value NullableSimpleUserable)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetOrganizationPermission(value *Project_organization_permission)() + SetOwnerUrl(value *string)() + SetPrivate(value *bool)() + SetState(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/project_card.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/project_card.go new file mode 100644 index 000000000..16288b5c8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/project_card.go @@ -0,0 +1,430 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProjectCard project cards represent a scope of work. +type ProjectCard struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether or not the card is archived + archived *bool + // The column_name property + column_name *string + // The column_url property + column_url *string + // The content_url property + content_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + creator NullableSimpleUserable + // The project card's ID + id *int64 + // The node_id property + node_id *string + // The note property + note *string + // The project_id property + project_id *string + // The project_url property + project_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewProjectCard instantiates a new ProjectCard and sets the default values. +func NewProjectCard()(*ProjectCard) { + m := &ProjectCard{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProjectCardFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProjectCardFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProjectCard(), 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 *ProjectCard) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArchived gets the archived property value. Whether or not the card is archived +// returns a *bool when successful +func (m *ProjectCard) GetArchived()(*bool) { + return m.archived +} +// GetColumnName gets the column_name property value. The column_name property +// returns a *string when successful +func (m *ProjectCard) GetColumnName()(*string) { + return m.column_name +} +// GetColumnUrl gets the column_url property value. The column_url property +// returns a *string when successful +func (m *ProjectCard) GetColumnUrl()(*string) { + return m.column_url +} +// GetContentUrl gets the content_url property value. The content_url property +// returns a *string when successful +func (m *ProjectCard) GetContentUrl()(*string) { + return m.content_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *ProjectCard) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCreator gets the creator property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *ProjectCard) GetCreator()(NullableSimpleUserable) { + return m.creator +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProjectCard) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnName(val) + } + return nil + } + res["column_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnUrl(val) + } + return nil + } + res["content_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["creator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreator(val.(NullableSimpleUserable)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["note"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNote(val) + } + return nil + } + res["project_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProjectId(val) + } + return nil + } + res["project_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProjectUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The project card's ID +// returns a *int64 when successful +func (m *ProjectCard) GetId()(*int64) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *ProjectCard) GetNodeId()(*string) { + return m.node_id +} +// GetNote gets the note property value. The note property +// returns a *string when successful +func (m *ProjectCard) GetNote()(*string) { + return m.note +} +// GetProjectId gets the project_id property value. The project_id property +// returns a *string when successful +func (m *ProjectCard) GetProjectId()(*string) { + return m.project_id +} +// GetProjectUrl gets the project_url property value. The project_url property +// returns a *string when successful +func (m *ProjectCard) GetProjectUrl()(*string) { + return m.project_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *ProjectCard) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProjectCard) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProjectCard) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("column_name", m.GetColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("column_url", m.GetColumnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("content_url", m.GetContentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("creator", m.GetCreator()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("note", m.GetNote()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("project_id", m.GetProjectId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("project_url", m.GetProjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ProjectCard) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArchived sets the archived property value. Whether or not the card is archived +func (m *ProjectCard) SetArchived(value *bool)() { + m.archived = value +} +// SetColumnName sets the column_name property value. The column_name property +func (m *ProjectCard) SetColumnName(value *string)() { + m.column_name = value +} +// SetColumnUrl sets the column_url property value. The column_url property +func (m *ProjectCard) SetColumnUrl(value *string)() { + m.column_url = value +} +// SetContentUrl sets the content_url property value. The content_url property +func (m *ProjectCard) SetContentUrl(value *string)() { + m.content_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ProjectCard) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCreator sets the creator property value. A GitHub user. +func (m *ProjectCard) SetCreator(value NullableSimpleUserable)() { + m.creator = value +} +// SetId sets the id property value. The project card's ID +func (m *ProjectCard) SetId(value *int64)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *ProjectCard) SetNodeId(value *string)() { + m.node_id = value +} +// SetNote sets the note property value. The note property +func (m *ProjectCard) SetNote(value *string)() { + m.note = value +} +// SetProjectId sets the project_id property value. The project_id property +func (m *ProjectCard) SetProjectId(value *string)() { + m.project_id = value +} +// SetProjectUrl sets the project_url property value. The project_url property +func (m *ProjectCard) SetProjectUrl(value *string)() { + m.project_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *ProjectCard) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *ProjectCard) SetUrl(value *string)() { + m.url = value +} +type ProjectCardable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArchived()(*bool) + GetColumnName()(*string) + GetColumnUrl()(*string) + GetContentUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreator()(NullableSimpleUserable) + GetId()(*int64) + GetNodeId()(*string) + GetNote()(*string) + GetProjectId()(*string) + GetProjectUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetArchived(value *bool)() + SetColumnName(value *string)() + SetColumnUrl(value *string)() + SetContentUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreator(value NullableSimpleUserable)() + SetId(value *int64)() + SetNodeId(value *string)() + SetNote(value *string)() + SetProjectId(value *string)() + SetProjectUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/project_collaborator_permission.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/project_collaborator_permission.go new file mode 100644 index 000000000..d78be0ff1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/project_collaborator_permission.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProjectCollaboratorPermission project Collaborator Permission +type ProjectCollaboratorPermission struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The permission property + permission *string + // A GitHub user. + user NullableSimpleUserable +} +// NewProjectCollaboratorPermission instantiates a new ProjectCollaboratorPermission and sets the default values. +func NewProjectCollaboratorPermission()(*ProjectCollaboratorPermission) { + m := &ProjectCollaboratorPermission{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProjectCollaboratorPermissionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProjectCollaboratorPermissionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProjectCollaboratorPermission(), 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 *ProjectCollaboratorPermission) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProjectCollaboratorPermission) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetPermission gets the permission property value. The permission property +// returns a *string when successful +func (m *ProjectCollaboratorPermission) GetPermission()(*string) { + return m.permission +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *ProjectCollaboratorPermission) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *ProjectCollaboratorPermission) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("permission", m.GetPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *ProjectCollaboratorPermission) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPermission sets the permission property value. The permission property +func (m *ProjectCollaboratorPermission) SetPermission(value *string)() { + m.permission = value +} +// SetUser sets the user property value. A GitHub user. +func (m *ProjectCollaboratorPermission) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type ProjectCollaboratorPermissionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPermission()(*string) + GetUser()(NullableSimpleUserable) + SetPermission(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/project_column.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/project_column.go new file mode 100644 index 000000000..27059199a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/project_column.go @@ -0,0 +1,285 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProjectColumn project columns contain cards of work. +type ProjectColumn struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The cards_url property + cards_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The unique identifier of the project column + id *int32 + // Name of the project column + name *string + // The node_id property + node_id *string + // The project_url property + project_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewProjectColumn instantiates a new ProjectColumn and sets the default values. +func NewProjectColumn()(*ProjectColumn) { + m := &ProjectColumn{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProjectColumnFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProjectColumnFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProjectColumn(), 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 *ProjectColumn) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCardsUrl gets the cards_url property value. The cards_url property +// returns a *string when successful +func (m *ProjectColumn) GetCardsUrl()(*string) { + return m.cards_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *ProjectColumn) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProjectColumn) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cards_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCardsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["project_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProjectUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The unique identifier of the project column +// returns a *int32 when successful +func (m *ProjectColumn) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. Name of the project column +// returns a *string when successful +func (m *ProjectColumn) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *ProjectColumn) GetNodeId()(*string) { + return m.node_id +} +// GetProjectUrl gets the project_url property value. The project_url property +// returns a *string when successful +func (m *ProjectColumn) GetProjectUrl()(*string) { + return m.project_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *ProjectColumn) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProjectColumn) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProjectColumn) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("cards_url", m.GetCardsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("project_url", m.GetProjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ProjectColumn) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCardsUrl sets the cards_url property value. The cards_url property +func (m *ProjectColumn) SetCardsUrl(value *string)() { + m.cards_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ProjectColumn) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The unique identifier of the project column +func (m *ProjectColumn) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. Name of the project column +func (m *ProjectColumn) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *ProjectColumn) SetNodeId(value *string)() { + m.node_id = value +} +// SetProjectUrl sets the project_url property value. The project_url property +func (m *ProjectColumn) SetProjectUrl(value *string)() { + m.project_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *ProjectColumn) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *ProjectColumn) SetUrl(value *string)() { + m.url = value +} +type ProjectColumnable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCardsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetProjectUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCardsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetProjectUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/project_organization_permission.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/project_organization_permission.go new file mode 100644 index 000000000..20b829c76 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/project_organization_permission.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The baseline permission that all organization members have on this project. Only present if owner is an organization. +type Project_organization_permission int + +const ( + READ_PROJECT_ORGANIZATION_PERMISSION Project_organization_permission = iota + WRITE_PROJECT_ORGANIZATION_PERMISSION + ADMIN_PROJECT_ORGANIZATION_PERMISSION + NONE_PROJECT_ORGANIZATION_PERMISSION +) + +func (i Project_organization_permission) String() string { + return []string{"read", "write", "admin", "none"}[i] +} +func ParseProject_organization_permission(v string) (any, error) { + result := READ_PROJECT_ORGANIZATION_PERMISSION + switch v { + case "read": + result = READ_PROJECT_ORGANIZATION_PERMISSION + case "write": + result = WRITE_PROJECT_ORGANIZATION_PERMISSION + case "admin": + result = ADMIN_PROJECT_ORGANIZATION_PERMISSION + case "none": + result = NONE_PROJECT_ORGANIZATION_PERMISSION + default: + return 0, errors.New("Unknown Project_organization_permission value: " + v) + } + return &result, nil +} +func SerializeProject_organization_permission(values []Project_organization_permission) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Project_organization_permission) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch.go new file mode 100644 index 000000000..370d5b6e3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch.go @@ -0,0 +1,429 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProtectedBranch branch protections protect branches +type ProtectedBranch struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The allow_deletions property + allow_deletions ProtectedBranch_allow_deletionsable + // The allow_force_pushes property + allow_force_pushes ProtectedBranch_allow_force_pushesable + // Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. + allow_fork_syncing ProtectedBranch_allow_fork_syncingable + // The block_creations property + block_creations ProtectedBranch_block_creationsable + // The enforce_admins property + enforce_admins ProtectedBranch_enforce_adminsable + // Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. + lock_branch ProtectedBranch_lock_branchable + // The required_conversation_resolution property + required_conversation_resolution ProtectedBranch_required_conversation_resolutionable + // The required_linear_history property + required_linear_history ProtectedBranch_required_linear_historyable + // The required_pull_request_reviews property + required_pull_request_reviews ProtectedBranch_required_pull_request_reviewsable + // The required_signatures property + required_signatures ProtectedBranch_required_signaturesable + // Status Check Policy + required_status_checks StatusCheckPolicyable + // Branch Restriction Policy + restrictions BranchRestrictionPolicyable + // The url property + url *string +} +// NewProtectedBranch instantiates a new ProtectedBranch and sets the default values. +func NewProtectedBranch()(*ProtectedBranch) { + m := &ProtectedBranch{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranchFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranchFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch(), 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 *ProtectedBranch) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowDeletions gets the allow_deletions property value. The allow_deletions property +// returns a ProtectedBranch_allow_deletionsable when successful +func (m *ProtectedBranch) GetAllowDeletions()(ProtectedBranch_allow_deletionsable) { + return m.allow_deletions +} +// GetAllowForcePushes gets the allow_force_pushes property value. The allow_force_pushes property +// returns a ProtectedBranch_allow_force_pushesable when successful +func (m *ProtectedBranch) GetAllowForcePushes()(ProtectedBranch_allow_force_pushesable) { + return m.allow_force_pushes +} +// GetAllowForkSyncing gets the allow_fork_syncing property value. Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. +// returns a ProtectedBranch_allow_fork_syncingable when successful +func (m *ProtectedBranch) GetAllowForkSyncing()(ProtectedBranch_allow_fork_syncingable) { + return m.allow_fork_syncing +} +// GetBlockCreations gets the block_creations property value. The block_creations property +// returns a ProtectedBranch_block_creationsable when successful +func (m *ProtectedBranch) GetBlockCreations()(ProtectedBranch_block_creationsable) { + return m.block_creations +} +// GetEnforceAdmins gets the enforce_admins property value. The enforce_admins property +// returns a ProtectedBranch_enforce_adminsable when successful +func (m *ProtectedBranch) GetEnforceAdmins()(ProtectedBranch_enforce_adminsable) { + return m.enforce_admins +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_deletions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_allow_deletionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAllowDeletions(val.(ProtectedBranch_allow_deletionsable)) + } + return nil + } + res["allow_force_pushes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_allow_force_pushesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAllowForcePushes(val.(ProtectedBranch_allow_force_pushesable)) + } + return nil + } + res["allow_fork_syncing"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_allow_fork_syncingFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAllowForkSyncing(val.(ProtectedBranch_allow_fork_syncingable)) + } + return nil + } + res["block_creations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_block_creationsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBlockCreations(val.(ProtectedBranch_block_creationsable)) + } + return nil + } + res["enforce_admins"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_enforce_adminsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetEnforceAdmins(val.(ProtectedBranch_enforce_adminsable)) + } + return nil + } + res["lock_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_lock_branchFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLockBranch(val.(ProtectedBranch_lock_branchable)) + } + return nil + } + res["required_conversation_resolution"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_required_conversation_resolutionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredConversationResolution(val.(ProtectedBranch_required_conversation_resolutionable)) + } + return nil + } + res["required_linear_history"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_required_linear_historyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredLinearHistory(val.(ProtectedBranch_required_linear_historyable)) + } + return nil + } + res["required_pull_request_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_required_pull_request_reviewsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredPullRequestReviews(val.(ProtectedBranch_required_pull_request_reviewsable)) + } + return nil + } + res["required_signatures"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_required_signaturesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredSignatures(val.(ProtectedBranch_required_signaturesable)) + } + return nil + } + res["required_status_checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateStatusCheckPolicyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredStatusChecks(val.(StatusCheckPolicyable)) + } + return nil + } + res["restrictions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchRestrictionPolicyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRestrictions(val.(BranchRestrictionPolicyable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetLockBranch gets the lock_branch property value. Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. +// returns a ProtectedBranch_lock_branchable when successful +func (m *ProtectedBranch) GetLockBranch()(ProtectedBranch_lock_branchable) { + return m.lock_branch +} +// GetRequiredConversationResolution gets the required_conversation_resolution property value. The required_conversation_resolution property +// returns a ProtectedBranch_required_conversation_resolutionable when successful +func (m *ProtectedBranch) GetRequiredConversationResolution()(ProtectedBranch_required_conversation_resolutionable) { + return m.required_conversation_resolution +} +// GetRequiredLinearHistory gets the required_linear_history property value. The required_linear_history property +// returns a ProtectedBranch_required_linear_historyable when successful +func (m *ProtectedBranch) GetRequiredLinearHistory()(ProtectedBranch_required_linear_historyable) { + return m.required_linear_history +} +// GetRequiredPullRequestReviews gets the required_pull_request_reviews property value. The required_pull_request_reviews property +// returns a ProtectedBranch_required_pull_request_reviewsable when successful +func (m *ProtectedBranch) GetRequiredPullRequestReviews()(ProtectedBranch_required_pull_request_reviewsable) { + return m.required_pull_request_reviews +} +// GetRequiredSignatures gets the required_signatures property value. The required_signatures property +// returns a ProtectedBranch_required_signaturesable when successful +func (m *ProtectedBranch) GetRequiredSignatures()(ProtectedBranch_required_signaturesable) { + return m.required_signatures +} +// GetRequiredStatusChecks gets the required_status_checks property value. Status Check Policy +// returns a StatusCheckPolicyable when successful +func (m *ProtectedBranch) GetRequiredStatusChecks()(StatusCheckPolicyable) { + return m.required_status_checks +} +// GetRestrictions gets the restrictions property value. Branch Restriction Policy +// returns a BranchRestrictionPolicyable when successful +func (m *ProtectedBranch) GetRestrictions()(BranchRestrictionPolicyable) { + return m.restrictions +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranch) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProtectedBranch) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("allow_deletions", m.GetAllowDeletions()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("allow_force_pushes", m.GetAllowForcePushes()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("allow_fork_syncing", m.GetAllowForkSyncing()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("block_creations", m.GetBlockCreations()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("enforce_admins", m.GetEnforceAdmins()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("lock_branch", m.GetLockBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_conversation_resolution", m.GetRequiredConversationResolution()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_linear_history", m.GetRequiredLinearHistory()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_pull_request_reviews", m.GetRequiredPullRequestReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_signatures", m.GetRequiredSignatures()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_status_checks", m.GetRequiredStatusChecks()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("restrictions", m.GetRestrictions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ProtectedBranch) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowDeletions sets the allow_deletions property value. The allow_deletions property +func (m *ProtectedBranch) SetAllowDeletions(value ProtectedBranch_allow_deletionsable)() { + m.allow_deletions = value +} +// SetAllowForcePushes sets the allow_force_pushes property value. The allow_force_pushes property +func (m *ProtectedBranch) SetAllowForcePushes(value ProtectedBranch_allow_force_pushesable)() { + m.allow_force_pushes = value +} +// SetAllowForkSyncing sets the allow_fork_syncing property value. Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. +func (m *ProtectedBranch) SetAllowForkSyncing(value ProtectedBranch_allow_fork_syncingable)() { + m.allow_fork_syncing = value +} +// SetBlockCreations sets the block_creations property value. The block_creations property +func (m *ProtectedBranch) SetBlockCreations(value ProtectedBranch_block_creationsable)() { + m.block_creations = value +} +// SetEnforceAdmins sets the enforce_admins property value. The enforce_admins property +func (m *ProtectedBranch) SetEnforceAdmins(value ProtectedBranch_enforce_adminsable)() { + m.enforce_admins = value +} +// SetLockBranch sets the lock_branch property value. Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. +func (m *ProtectedBranch) SetLockBranch(value ProtectedBranch_lock_branchable)() { + m.lock_branch = value +} +// SetRequiredConversationResolution sets the required_conversation_resolution property value. The required_conversation_resolution property +func (m *ProtectedBranch) SetRequiredConversationResolution(value ProtectedBranch_required_conversation_resolutionable)() { + m.required_conversation_resolution = value +} +// SetRequiredLinearHistory sets the required_linear_history property value. The required_linear_history property +func (m *ProtectedBranch) SetRequiredLinearHistory(value ProtectedBranch_required_linear_historyable)() { + m.required_linear_history = value +} +// SetRequiredPullRequestReviews sets the required_pull_request_reviews property value. The required_pull_request_reviews property +func (m *ProtectedBranch) SetRequiredPullRequestReviews(value ProtectedBranch_required_pull_request_reviewsable)() { + m.required_pull_request_reviews = value +} +// SetRequiredSignatures sets the required_signatures property value. The required_signatures property +func (m *ProtectedBranch) SetRequiredSignatures(value ProtectedBranch_required_signaturesable)() { + m.required_signatures = value +} +// SetRequiredStatusChecks sets the required_status_checks property value. Status Check Policy +func (m *ProtectedBranch) SetRequiredStatusChecks(value StatusCheckPolicyable)() { + m.required_status_checks = value +} +// SetRestrictions sets the restrictions property value. Branch Restriction Policy +func (m *ProtectedBranch) SetRestrictions(value BranchRestrictionPolicyable)() { + m.restrictions = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranch) SetUrl(value *string)() { + m.url = value +} +type ProtectedBranchable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowDeletions()(ProtectedBranch_allow_deletionsable) + GetAllowForcePushes()(ProtectedBranch_allow_force_pushesable) + GetAllowForkSyncing()(ProtectedBranch_allow_fork_syncingable) + GetBlockCreations()(ProtectedBranch_block_creationsable) + GetEnforceAdmins()(ProtectedBranch_enforce_adminsable) + GetLockBranch()(ProtectedBranch_lock_branchable) + GetRequiredConversationResolution()(ProtectedBranch_required_conversation_resolutionable) + GetRequiredLinearHistory()(ProtectedBranch_required_linear_historyable) + GetRequiredPullRequestReviews()(ProtectedBranch_required_pull_request_reviewsable) + GetRequiredSignatures()(ProtectedBranch_required_signaturesable) + GetRequiredStatusChecks()(StatusCheckPolicyable) + GetRestrictions()(BranchRestrictionPolicyable) + GetUrl()(*string) + SetAllowDeletions(value ProtectedBranch_allow_deletionsable)() + SetAllowForcePushes(value ProtectedBranch_allow_force_pushesable)() + SetAllowForkSyncing(value ProtectedBranch_allow_fork_syncingable)() + SetBlockCreations(value ProtectedBranch_block_creationsable)() + SetEnforceAdmins(value ProtectedBranch_enforce_adminsable)() + SetLockBranch(value ProtectedBranch_lock_branchable)() + SetRequiredConversationResolution(value ProtectedBranch_required_conversation_resolutionable)() + SetRequiredLinearHistory(value ProtectedBranch_required_linear_historyable)() + SetRequiredPullRequestReviews(value ProtectedBranch_required_pull_request_reviewsable)() + SetRequiredSignatures(value ProtectedBranch_required_signaturesable)() + SetRequiredStatusChecks(value StatusCheckPolicyable)() + SetRestrictions(value BranchRestrictionPolicyable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_admin_enforced.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_admin_enforced.go new file mode 100644 index 000000000..589a4a8c1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_admin_enforced.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProtectedBranchAdminEnforced protected Branch Admin Enforced +type ProtectedBranchAdminEnforced struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The enabled property + enabled *bool + // The url property + url *string +} +// NewProtectedBranchAdminEnforced instantiates a new ProtectedBranchAdminEnforced and sets the default values. +func NewProtectedBranchAdminEnforced()(*ProtectedBranchAdminEnforced) { + m := &ProtectedBranchAdminEnforced{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranchAdminEnforcedFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranchAdminEnforcedFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranchAdminEnforced(), 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 *ProtectedBranchAdminEnforced) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranchAdminEnforced) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranchAdminEnforced) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranchAdminEnforced) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProtectedBranchAdminEnforced) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ProtectedBranchAdminEnforced) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranchAdminEnforced) SetEnabled(value *bool)() { + m.enabled = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranchAdminEnforced) SetUrl(value *string)() { + m.url = value +} +type ProtectedBranchAdminEnforcedable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + GetUrl()(*string) + SetEnabled(value *bool)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_allow_deletions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_allow_deletions.go new file mode 100644 index 000000000..484697425 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_allow_deletions.go @@ -0,0 +1,61 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_allow_deletions struct { + // The enabled property + enabled *bool +} +// NewProtectedBranch_allow_deletions instantiates a new ProtectedBranch_allow_deletions and sets the default values. +func NewProtectedBranch_allow_deletions()(*ProtectedBranch_allow_deletions) { + m := &ProtectedBranch_allow_deletions{ + } + return m +} +// CreateProtectedBranch_allow_deletionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_allow_deletionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_allow_deletions(), nil +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_allow_deletions) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_allow_deletions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ProtectedBranch_allow_deletions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + return nil +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_allow_deletions) SetEnabled(value *bool)() { + m.enabled = value +} +type ProtectedBranch_allow_deletionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_allow_force_pushes.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_allow_force_pushes.go new file mode 100644 index 000000000..b047ac9ee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_allow_force_pushes.go @@ -0,0 +1,61 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_allow_force_pushes struct { + // The enabled property + enabled *bool +} +// NewProtectedBranch_allow_force_pushes instantiates a new ProtectedBranch_allow_force_pushes and sets the default values. +func NewProtectedBranch_allow_force_pushes()(*ProtectedBranch_allow_force_pushes) { + m := &ProtectedBranch_allow_force_pushes{ + } + return m +} +// CreateProtectedBranch_allow_force_pushesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_allow_force_pushesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_allow_force_pushes(), nil +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_allow_force_pushes) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_allow_force_pushes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ProtectedBranch_allow_force_pushes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + return nil +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_allow_force_pushes) SetEnabled(value *bool)() { + m.enabled = value +} +type ProtectedBranch_allow_force_pushesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_allow_fork_syncing.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_allow_fork_syncing.go new file mode 100644 index 000000000..9cb77625c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_allow_fork_syncing.go @@ -0,0 +1,62 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProtectedBranch_allow_fork_syncing whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. +type ProtectedBranch_allow_fork_syncing struct { + // The enabled property + enabled *bool +} +// NewProtectedBranch_allow_fork_syncing instantiates a new ProtectedBranch_allow_fork_syncing and sets the default values. +func NewProtectedBranch_allow_fork_syncing()(*ProtectedBranch_allow_fork_syncing) { + m := &ProtectedBranch_allow_fork_syncing{ + } + return m +} +// CreateProtectedBranch_allow_fork_syncingFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_allow_fork_syncingFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_allow_fork_syncing(), nil +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_allow_fork_syncing) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_allow_fork_syncing) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ProtectedBranch_allow_fork_syncing) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + return nil +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_allow_fork_syncing) SetEnabled(value *bool)() { + m.enabled = value +} +type ProtectedBranch_allow_fork_syncingable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_block_creations.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_block_creations.go new file mode 100644 index 000000000..584d8f040 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_block_creations.go @@ -0,0 +1,61 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_block_creations struct { + // The enabled property + enabled *bool +} +// NewProtectedBranch_block_creations instantiates a new ProtectedBranch_block_creations and sets the default values. +func NewProtectedBranch_block_creations()(*ProtectedBranch_block_creations) { + m := &ProtectedBranch_block_creations{ + } + return m +} +// CreateProtectedBranch_block_creationsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_block_creationsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_block_creations(), nil +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_block_creations) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_block_creations) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ProtectedBranch_block_creations) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + return nil +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_block_creations) SetEnabled(value *bool)() { + m.enabled = value +} +type ProtectedBranch_block_creationsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_enforce_admins.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_enforce_admins.go new file mode 100644 index 000000000..82f42d3de --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_enforce_admins.go @@ -0,0 +1,90 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_enforce_admins struct { + // The enabled property + enabled *bool + // The url property + url *string +} +// NewProtectedBranch_enforce_admins instantiates a new ProtectedBranch_enforce_admins and sets the default values. +func NewProtectedBranch_enforce_admins()(*ProtectedBranch_enforce_admins) { + m := &ProtectedBranch_enforce_admins{ + } + return m +} +// CreateProtectedBranch_enforce_adminsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_enforce_adminsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_enforce_admins(), nil +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_enforce_admins) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_enforce_admins) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranch_enforce_admins) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProtectedBranch_enforce_admins) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + return nil +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_enforce_admins) SetEnabled(value *bool)() { + m.enabled = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranch_enforce_admins) SetUrl(value *string)() { + m.url = value +} +type ProtectedBranch_enforce_adminsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + GetUrl()(*string) + SetEnabled(value *bool)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_lock_branch.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_lock_branch.go new file mode 100644 index 000000000..4dc414f07 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_lock_branch.go @@ -0,0 +1,62 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProtectedBranch_lock_branch whether to set the branch as read-only. If this is true, users will not be able to push to the branch. +type ProtectedBranch_lock_branch struct { + // The enabled property + enabled *bool +} +// NewProtectedBranch_lock_branch instantiates a new ProtectedBranch_lock_branch and sets the default values. +func NewProtectedBranch_lock_branch()(*ProtectedBranch_lock_branch) { + m := &ProtectedBranch_lock_branch{ + } + return m +} +// CreateProtectedBranch_lock_branchFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_lock_branchFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_lock_branch(), nil +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_lock_branch) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_lock_branch) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ProtectedBranch_lock_branch) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + return nil +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_lock_branch) SetEnabled(value *bool)() { + m.enabled = value +} +type ProtectedBranch_lock_branchable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_pull_request_review.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_pull_request_review.go new file mode 100644 index 000000000..0fd40a63d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_pull_request_review.go @@ -0,0 +1,255 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProtectedBranchPullRequestReview protected Branch Pull Request Review +type ProtectedBranchPullRequestReview struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Allow specific users, teams, or apps to bypass pull request requirements. + bypass_pull_request_allowances ProtectedBranchPullRequestReview_bypass_pull_request_allowancesable + // The dismiss_stale_reviews property + dismiss_stale_reviews *bool + // The dismissal_restrictions property + dismissal_restrictions ProtectedBranchPullRequestReview_dismissal_restrictionsable + // The require_code_owner_reviews property + require_code_owner_reviews *bool + // Whether the most recent push must be approved by someone other than the person who pushed it. + require_last_push_approval *bool + // The required_approving_review_count property + required_approving_review_count *int32 + // The url property + url *string +} +// NewProtectedBranchPullRequestReview instantiates a new ProtectedBranchPullRequestReview and sets the default values. +func NewProtectedBranchPullRequestReview()(*ProtectedBranchPullRequestReview) { + m := &ProtectedBranchPullRequestReview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranchPullRequestReviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranchPullRequestReviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranchPullRequestReview(), 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 *ProtectedBranchPullRequestReview) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassPullRequestAllowances gets the bypass_pull_request_allowances property value. Allow specific users, teams, or apps to bypass pull request requirements. +// returns a ProtectedBranchPullRequestReview_bypass_pull_request_allowancesable when successful +func (m *ProtectedBranchPullRequestReview) GetBypassPullRequestAllowances()(ProtectedBranchPullRequestReview_bypass_pull_request_allowancesable) { + return m.bypass_pull_request_allowances +} +// GetDismissalRestrictions gets the dismissal_restrictions property value. The dismissal_restrictions property +// returns a ProtectedBranchPullRequestReview_dismissal_restrictionsable when successful +func (m *ProtectedBranchPullRequestReview) GetDismissalRestrictions()(ProtectedBranchPullRequestReview_dismissal_restrictionsable) { + return m.dismissal_restrictions +} +// GetDismissStaleReviews gets the dismiss_stale_reviews property value. The dismiss_stale_reviews property +// returns a *bool when successful +func (m *ProtectedBranchPullRequestReview) GetDismissStaleReviews()(*bool) { + return m.dismiss_stale_reviews +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranchPullRequestReview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bypass_pull_request_allowances"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranchPullRequestReview_bypass_pull_request_allowancesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBypassPullRequestAllowances(val.(ProtectedBranchPullRequestReview_bypass_pull_request_allowancesable)) + } + return nil + } + res["dismiss_stale_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissStaleReviews(val) + } + return nil + } + res["dismissal_restrictions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranchPullRequestReview_dismissal_restrictionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissalRestrictions(val.(ProtectedBranchPullRequestReview_dismissal_restrictionsable)) + } + return nil + } + res["require_code_owner_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireCodeOwnerReviews(val) + } + return nil + } + res["require_last_push_approval"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireLastPushApproval(val) + } + return nil + } + res["required_approving_review_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRequiredApprovingReviewCount(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetRequireCodeOwnerReviews gets the require_code_owner_reviews property value. The require_code_owner_reviews property +// returns a *bool when successful +func (m *ProtectedBranchPullRequestReview) GetRequireCodeOwnerReviews()(*bool) { + return m.require_code_owner_reviews +} +// GetRequiredApprovingReviewCount gets the required_approving_review_count property value. The required_approving_review_count property +// returns a *int32 when successful +func (m *ProtectedBranchPullRequestReview) GetRequiredApprovingReviewCount()(*int32) { + return m.required_approving_review_count +} +// GetRequireLastPushApproval gets the require_last_push_approval property value. Whether the most recent push must be approved by someone other than the person who pushed it. +// returns a *bool when successful +func (m *ProtectedBranchPullRequestReview) GetRequireLastPushApproval()(*bool) { + return m.require_last_push_approval +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranchPullRequestReview) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProtectedBranchPullRequestReview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("bypass_pull_request_allowances", m.GetBypassPullRequestAllowances()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("dismissal_restrictions", m.GetDismissalRestrictions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dismiss_stale_reviews", m.GetDismissStaleReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("required_approving_review_count", m.GetRequiredApprovingReviewCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_code_owner_reviews", m.GetRequireCodeOwnerReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_last_push_approval", m.GetRequireLastPushApproval()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ProtectedBranchPullRequestReview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassPullRequestAllowances sets the bypass_pull_request_allowances property value. Allow specific users, teams, or apps to bypass pull request requirements. +func (m *ProtectedBranchPullRequestReview) SetBypassPullRequestAllowances(value ProtectedBranchPullRequestReview_bypass_pull_request_allowancesable)() { + m.bypass_pull_request_allowances = value +} +// SetDismissalRestrictions sets the dismissal_restrictions property value. The dismissal_restrictions property +func (m *ProtectedBranchPullRequestReview) SetDismissalRestrictions(value ProtectedBranchPullRequestReview_dismissal_restrictionsable)() { + m.dismissal_restrictions = value +} +// SetDismissStaleReviews sets the dismiss_stale_reviews property value. The dismiss_stale_reviews property +func (m *ProtectedBranchPullRequestReview) SetDismissStaleReviews(value *bool)() { + m.dismiss_stale_reviews = value +} +// SetRequireCodeOwnerReviews sets the require_code_owner_reviews property value. The require_code_owner_reviews property +func (m *ProtectedBranchPullRequestReview) SetRequireCodeOwnerReviews(value *bool)() { + m.require_code_owner_reviews = value +} +// SetRequiredApprovingReviewCount sets the required_approving_review_count property value. The required_approving_review_count property +func (m *ProtectedBranchPullRequestReview) SetRequiredApprovingReviewCount(value *int32)() { + m.required_approving_review_count = value +} +// SetRequireLastPushApproval sets the require_last_push_approval property value. Whether the most recent push must be approved by someone other than the person who pushed it. +func (m *ProtectedBranchPullRequestReview) SetRequireLastPushApproval(value *bool)() { + m.require_last_push_approval = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranchPullRequestReview) SetUrl(value *string)() { + m.url = value +} +type ProtectedBranchPullRequestReviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassPullRequestAllowances()(ProtectedBranchPullRequestReview_bypass_pull_request_allowancesable) + GetDismissalRestrictions()(ProtectedBranchPullRequestReview_dismissal_restrictionsable) + GetDismissStaleReviews()(*bool) + GetRequireCodeOwnerReviews()(*bool) + GetRequiredApprovingReviewCount()(*int32) + GetRequireLastPushApproval()(*bool) + GetUrl()(*string) + SetBypassPullRequestAllowances(value ProtectedBranchPullRequestReview_bypass_pull_request_allowancesable)() + SetDismissalRestrictions(value ProtectedBranchPullRequestReview_dismissal_restrictionsable)() + SetDismissStaleReviews(value *bool)() + SetRequireCodeOwnerReviews(value *bool)() + SetRequiredApprovingReviewCount(value *int32)() + SetRequireLastPushApproval(value *bool)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_pull_request_review_bypass_pull_request_allowances.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_pull_request_review_bypass_pull_request_allowances.go new file mode 100644 index 000000000..9d82acd4c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_pull_request_review_bypass_pull_request_allowances.go @@ -0,0 +1,175 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProtectedBranchPullRequestReview_bypass_pull_request_allowances allow specific users, teams, or apps to bypass pull request requirements. +type ProtectedBranchPullRequestReview_bypass_pull_request_allowances struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The list of apps allowed to bypass pull request requirements. + apps []Integrationable + // The list of teams allowed to bypass pull request requirements. + teams []Teamable + // The list of users allowed to bypass pull request requirements. + users []SimpleUserable +} +// NewProtectedBranchPullRequestReview_bypass_pull_request_allowances instantiates a new ProtectedBranchPullRequestReview_bypass_pull_request_allowances and sets the default values. +func NewProtectedBranchPullRequestReview_bypass_pull_request_allowances()(*ProtectedBranchPullRequestReview_bypass_pull_request_allowances) { + m := &ProtectedBranchPullRequestReview_bypass_pull_request_allowances{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranchPullRequestReview_bypass_pull_request_allowancesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranchPullRequestReview_bypass_pull_request_allowancesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranchPullRequestReview_bypass_pull_request_allowances(), 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 *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The list of apps allowed to bypass pull request requirements. +// returns a []Integrationable when successful +func (m *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) GetApps()([]Integrationable) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Integrationable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Integrationable) + } + } + m.SetApps(res) + } + return nil + } + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Teamable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Teamable) + } + } + m.SetTeams(res) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetUsers(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The list of teams allowed to bypass pull request requirements. +// returns a []Teamable when successful +func (m *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) GetTeams()([]Teamable) { + return m.teams +} +// GetUsers gets the users property value. The list of users allowed to bypass pull request requirements. +// returns a []SimpleUserable when successful +func (m *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) GetUsers()([]SimpleUserable) { + return m.users +} +// Serialize serializes information the current object +func (m *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetApps())) + for i, v := range m.GetApps() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("apps", cast) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTeams())) + for i, v := range m.GetTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("teams", cast) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetUsers())) + for i, v := range m.GetUsers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("users", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The list of apps allowed to bypass pull request requirements. +func (m *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) SetApps(value []Integrationable)() { + m.apps = value +} +// SetTeams sets the teams property value. The list of teams allowed to bypass pull request requirements. +func (m *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) SetTeams(value []Teamable)() { + m.teams = value +} +// SetUsers sets the users property value. The list of users allowed to bypass pull request requirements. +func (m *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) SetUsers(value []SimpleUserable)() { + m.users = value +} +type ProtectedBranchPullRequestReview_bypass_pull_request_allowancesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]Integrationable) + GetTeams()([]Teamable) + GetUsers()([]SimpleUserable) + SetApps(value []Integrationable)() + SetTeams(value []Teamable)() + SetUsers(value []SimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_pull_request_review_dismissal_restrictions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_pull_request_review_dismissal_restrictions.go new file mode 100644 index 000000000..349f9a071 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_pull_request_review_dismissal_restrictions.go @@ -0,0 +1,261 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranchPullRequestReview_dismissal_restrictions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The list of apps with review dismissal access. + apps []Integrationable + // The list of teams with review dismissal access. + teams []Teamable + // The teams_url property + teams_url *string + // The url property + url *string + // The list of users with review dismissal access. + users []SimpleUserable + // The users_url property + users_url *string +} +// NewProtectedBranchPullRequestReview_dismissal_restrictions instantiates a new ProtectedBranchPullRequestReview_dismissal_restrictions and sets the default values. +func NewProtectedBranchPullRequestReview_dismissal_restrictions()(*ProtectedBranchPullRequestReview_dismissal_restrictions) { + m := &ProtectedBranchPullRequestReview_dismissal_restrictions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranchPullRequestReview_dismissal_restrictionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranchPullRequestReview_dismissal_restrictionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranchPullRequestReview_dismissal_restrictions(), 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 *ProtectedBranchPullRequestReview_dismissal_restrictions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The list of apps with review dismissal access. +// returns a []Integrationable when successful +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) GetApps()([]Integrationable) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Integrationable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Integrationable) + } + } + m.SetApps(res) + } + return nil + } + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Teamable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Teamable) + } + } + m.SetTeams(res) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetUsers(res) + } + return nil + } + res["users_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUsersUrl(val) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The list of teams with review dismissal access. +// returns a []Teamable when successful +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) GetTeams()([]Teamable) { + return m.teams +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) GetUrl()(*string) { + return m.url +} +// GetUsers gets the users property value. The list of users with review dismissal access. +// returns a []SimpleUserable when successful +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) GetUsers()([]SimpleUserable) { + return m.users +} +// GetUsersUrl gets the users_url property value. The users_url property +// returns a *string when successful +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) GetUsersUrl()(*string) { + return m.users_url +} +// Serialize serializes information the current object +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetApps())) + for i, v := range m.GetApps() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("apps", cast) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTeams())) + for i, v := range m.GetTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("teams", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetUsers())) + for i, v := range m.GetUsers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("users", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("users_url", m.GetUsersUrl()) + 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 *ProtectedBranchPullRequestReview_dismissal_restrictions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The list of apps with review dismissal access. +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) SetApps(value []Integrationable)() { + m.apps = value +} +// SetTeams sets the teams property value. The list of teams with review dismissal access. +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) SetTeams(value []Teamable)() { + m.teams = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) SetUrl(value *string)() { + m.url = value +} +// SetUsers sets the users property value. The list of users with review dismissal access. +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) SetUsers(value []SimpleUserable)() { + m.users = value +} +// SetUsersUrl sets the users_url property value. The users_url property +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) SetUsersUrl(value *string)() { + m.users_url = value +} +type ProtectedBranchPullRequestReview_dismissal_restrictionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]Integrationable) + GetTeams()([]Teamable) + GetTeamsUrl()(*string) + GetUrl()(*string) + GetUsers()([]SimpleUserable) + GetUsersUrl()(*string) + SetApps(value []Integrationable)() + SetTeams(value []Teamable)() + SetTeamsUrl(value *string)() + SetUrl(value *string)() + SetUsers(value []SimpleUserable)() + SetUsersUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_conversation_resolution.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_conversation_resolution.go new file mode 100644 index 000000000..9501e4cbf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_conversation_resolution.go @@ -0,0 +1,61 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_required_conversation_resolution struct { + // The enabled property + enabled *bool +} +// NewProtectedBranch_required_conversation_resolution instantiates a new ProtectedBranch_required_conversation_resolution and sets the default values. +func NewProtectedBranch_required_conversation_resolution()(*ProtectedBranch_required_conversation_resolution) { + m := &ProtectedBranch_required_conversation_resolution{ + } + return m +} +// CreateProtectedBranch_required_conversation_resolutionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_required_conversation_resolutionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_required_conversation_resolution(), nil +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_required_conversation_resolution) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_required_conversation_resolution) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ProtectedBranch_required_conversation_resolution) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + return nil +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_required_conversation_resolution) SetEnabled(value *bool)() { + m.enabled = value +} +type ProtectedBranch_required_conversation_resolutionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_linear_history.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_linear_history.go new file mode 100644 index 000000000..eebaf8429 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_linear_history.go @@ -0,0 +1,61 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_required_linear_history struct { + // The enabled property + enabled *bool +} +// NewProtectedBranch_required_linear_history instantiates a new ProtectedBranch_required_linear_history and sets the default values. +func NewProtectedBranch_required_linear_history()(*ProtectedBranch_required_linear_history) { + m := &ProtectedBranch_required_linear_history{ + } + return m +} +// CreateProtectedBranch_required_linear_historyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_required_linear_historyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_required_linear_history(), nil +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_required_linear_history) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_required_linear_history) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ProtectedBranch_required_linear_history) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + return nil +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_required_linear_history) SetEnabled(value *bool)() { + m.enabled = value +} +type ProtectedBranch_required_linear_historyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_pull_request_reviews.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_pull_request_reviews.go new file mode 100644 index 000000000..acc2ee231 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_pull_request_reviews.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_required_pull_request_reviews struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The bypass_pull_request_allowances property + bypass_pull_request_allowances ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesable + // The dismiss_stale_reviews property + dismiss_stale_reviews *bool + // The dismissal_restrictions property + dismissal_restrictions ProtectedBranch_required_pull_request_reviews_dismissal_restrictionsable + // The require_code_owner_reviews property + require_code_owner_reviews *bool + // Whether the most recent push must be approved by someone other than the person who pushed it. + require_last_push_approval *bool + // The required_approving_review_count property + required_approving_review_count *int32 + // The url property + url *string +} +// NewProtectedBranch_required_pull_request_reviews instantiates a new ProtectedBranch_required_pull_request_reviews and sets the default values. +func NewProtectedBranch_required_pull_request_reviews()(*ProtectedBranch_required_pull_request_reviews) { + m := &ProtectedBranch_required_pull_request_reviews{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranch_required_pull_request_reviewsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_required_pull_request_reviewsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_required_pull_request_reviews(), 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 *ProtectedBranch_required_pull_request_reviews) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassPullRequestAllowances gets the bypass_pull_request_allowances property value. The bypass_pull_request_allowances property +// returns a ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesable when successful +func (m *ProtectedBranch_required_pull_request_reviews) GetBypassPullRequestAllowances()(ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesable) { + return m.bypass_pull_request_allowances +} +// GetDismissalRestrictions gets the dismissal_restrictions property value. The dismissal_restrictions property +// returns a ProtectedBranch_required_pull_request_reviews_dismissal_restrictionsable when successful +func (m *ProtectedBranch_required_pull_request_reviews) GetDismissalRestrictions()(ProtectedBranch_required_pull_request_reviews_dismissal_restrictionsable) { + return m.dismissal_restrictions +} +// GetDismissStaleReviews gets the dismiss_stale_reviews property value. The dismiss_stale_reviews property +// returns a *bool when successful +func (m *ProtectedBranch_required_pull_request_reviews) GetDismissStaleReviews()(*bool) { + return m.dismiss_stale_reviews +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_required_pull_request_reviews) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bypass_pull_request_allowances"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBypassPullRequestAllowances(val.(ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesable)) + } + return nil + } + res["dismiss_stale_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissStaleReviews(val) + } + return nil + } + res["dismissal_restrictions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_required_pull_request_reviews_dismissal_restrictionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissalRestrictions(val.(ProtectedBranch_required_pull_request_reviews_dismissal_restrictionsable)) + } + return nil + } + res["require_code_owner_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireCodeOwnerReviews(val) + } + return nil + } + res["require_last_push_approval"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireLastPushApproval(val) + } + return nil + } + res["required_approving_review_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRequiredApprovingReviewCount(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetRequireCodeOwnerReviews gets the require_code_owner_reviews property value. The require_code_owner_reviews property +// returns a *bool when successful +func (m *ProtectedBranch_required_pull_request_reviews) GetRequireCodeOwnerReviews()(*bool) { + return m.require_code_owner_reviews +} +// GetRequiredApprovingReviewCount gets the required_approving_review_count property value. The required_approving_review_count property +// returns a *int32 when successful +func (m *ProtectedBranch_required_pull_request_reviews) GetRequiredApprovingReviewCount()(*int32) { + return m.required_approving_review_count +} +// GetRequireLastPushApproval gets the require_last_push_approval property value. Whether the most recent push must be approved by someone other than the person who pushed it. +// returns a *bool when successful +func (m *ProtectedBranch_required_pull_request_reviews) GetRequireLastPushApproval()(*bool) { + return m.require_last_push_approval +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranch_required_pull_request_reviews) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProtectedBranch_required_pull_request_reviews) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("bypass_pull_request_allowances", m.GetBypassPullRequestAllowances()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("dismissal_restrictions", m.GetDismissalRestrictions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dismiss_stale_reviews", m.GetDismissStaleReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("required_approving_review_count", m.GetRequiredApprovingReviewCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_code_owner_reviews", m.GetRequireCodeOwnerReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_last_push_approval", m.GetRequireLastPushApproval()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ProtectedBranch_required_pull_request_reviews) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassPullRequestAllowances sets the bypass_pull_request_allowances property value. The bypass_pull_request_allowances property +func (m *ProtectedBranch_required_pull_request_reviews) SetBypassPullRequestAllowances(value ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesable)() { + m.bypass_pull_request_allowances = value +} +// SetDismissalRestrictions sets the dismissal_restrictions property value. The dismissal_restrictions property +func (m *ProtectedBranch_required_pull_request_reviews) SetDismissalRestrictions(value ProtectedBranch_required_pull_request_reviews_dismissal_restrictionsable)() { + m.dismissal_restrictions = value +} +// SetDismissStaleReviews sets the dismiss_stale_reviews property value. The dismiss_stale_reviews property +func (m *ProtectedBranch_required_pull_request_reviews) SetDismissStaleReviews(value *bool)() { + m.dismiss_stale_reviews = value +} +// SetRequireCodeOwnerReviews sets the require_code_owner_reviews property value. The require_code_owner_reviews property +func (m *ProtectedBranch_required_pull_request_reviews) SetRequireCodeOwnerReviews(value *bool)() { + m.require_code_owner_reviews = value +} +// SetRequiredApprovingReviewCount sets the required_approving_review_count property value. The required_approving_review_count property +func (m *ProtectedBranch_required_pull_request_reviews) SetRequiredApprovingReviewCount(value *int32)() { + m.required_approving_review_count = value +} +// SetRequireLastPushApproval sets the require_last_push_approval property value. Whether the most recent push must be approved by someone other than the person who pushed it. +func (m *ProtectedBranch_required_pull_request_reviews) SetRequireLastPushApproval(value *bool)() { + m.require_last_push_approval = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranch_required_pull_request_reviews) SetUrl(value *string)() { + m.url = value +} +type ProtectedBranch_required_pull_request_reviewsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassPullRequestAllowances()(ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesable) + GetDismissalRestrictions()(ProtectedBranch_required_pull_request_reviews_dismissal_restrictionsable) + GetDismissStaleReviews()(*bool) + GetRequireCodeOwnerReviews()(*bool) + GetRequiredApprovingReviewCount()(*int32) + GetRequireLastPushApproval()(*bool) + GetUrl()(*string) + SetBypassPullRequestAllowances(value ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesable)() + SetDismissalRestrictions(value ProtectedBranch_required_pull_request_reviews_dismissal_restrictionsable)() + SetDismissStaleReviews(value *bool)() + SetRequireCodeOwnerReviews(value *bool)() + SetRequiredApprovingReviewCount(value *int32)() + SetRequireLastPushApproval(value *bool)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_pull_request_reviews_bypass_pull_request_allowances.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_pull_request_reviews_bypass_pull_request_allowances.go new file mode 100644 index 000000000..615588594 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_pull_request_reviews_bypass_pull_request_allowances.go @@ -0,0 +1,174 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The apps property + apps []Integrationable + // The teams property + teams []Teamable + // The users property + users []SimpleUserable +} +// NewProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances instantiates a new ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances and sets the default values. +func NewProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances()(*ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) { + m := &ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances(), 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 *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The apps property +// returns a []Integrationable when successful +func (m *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) GetApps()([]Integrationable) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Integrationable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Integrationable) + } + } + m.SetApps(res) + } + return nil + } + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Teamable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Teamable) + } + } + m.SetTeams(res) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetUsers(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The teams property +// returns a []Teamable when successful +func (m *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) GetTeams()([]Teamable) { + return m.teams +} +// GetUsers gets the users property value. The users property +// returns a []SimpleUserable when successful +func (m *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) GetUsers()([]SimpleUserable) { + return m.users +} +// Serialize serializes information the current object +func (m *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetApps())) + for i, v := range m.GetApps() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("apps", cast) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTeams())) + for i, v := range m.GetTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("teams", cast) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetUsers())) + for i, v := range m.GetUsers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("users", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The apps property +func (m *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) SetApps(value []Integrationable)() { + m.apps = value +} +// SetTeams sets the teams property value. The teams property +func (m *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) SetTeams(value []Teamable)() { + m.teams = value +} +// SetUsers sets the users property value. The users property +func (m *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) SetUsers(value []SimpleUserable)() { + m.users = value +} +type ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]Integrationable) + GetTeams()([]Teamable) + GetUsers()([]SimpleUserable) + SetApps(value []Integrationable)() + SetTeams(value []Teamable)() + SetUsers(value []SimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_pull_request_reviews_dismissal_restrictions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_pull_request_reviews_dismissal_restrictions.go new file mode 100644 index 000000000..9bb12639c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_pull_request_reviews_dismissal_restrictions.go @@ -0,0 +1,261 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_required_pull_request_reviews_dismissal_restrictions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The apps property + apps []Integrationable + // The teams property + teams []Teamable + // The teams_url property + teams_url *string + // The url property + url *string + // The users property + users []SimpleUserable + // The users_url property + users_url *string +} +// NewProtectedBranch_required_pull_request_reviews_dismissal_restrictions instantiates a new ProtectedBranch_required_pull_request_reviews_dismissal_restrictions and sets the default values. +func NewProtectedBranch_required_pull_request_reviews_dismissal_restrictions()(*ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) { + m := &ProtectedBranch_required_pull_request_reviews_dismissal_restrictions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranch_required_pull_request_reviews_dismissal_restrictionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_required_pull_request_reviews_dismissal_restrictionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_required_pull_request_reviews_dismissal_restrictions(), 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 *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The apps property +// returns a []Integrationable when successful +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) GetApps()([]Integrationable) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Integrationable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Integrationable) + } + } + m.SetApps(res) + } + return nil + } + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Teamable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Teamable) + } + } + m.SetTeams(res) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetUsers(res) + } + return nil + } + res["users_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUsersUrl(val) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The teams property +// returns a []Teamable when successful +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) GetTeams()([]Teamable) { + return m.teams +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) GetUrl()(*string) { + return m.url +} +// GetUsers gets the users property value. The users property +// returns a []SimpleUserable when successful +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) GetUsers()([]SimpleUserable) { + return m.users +} +// GetUsersUrl gets the users_url property value. The users_url property +// returns a *string when successful +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) GetUsersUrl()(*string) { + return m.users_url +} +// Serialize serializes information the current object +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetApps())) + for i, v := range m.GetApps() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("apps", cast) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTeams())) + for i, v := range m.GetTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("teams", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetUsers())) + for i, v := range m.GetUsers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("users", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("users_url", m.GetUsersUrl()) + 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 *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The apps property +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) SetApps(value []Integrationable)() { + m.apps = value +} +// SetTeams sets the teams property value. The teams property +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) SetTeams(value []Teamable)() { + m.teams = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) SetUrl(value *string)() { + m.url = value +} +// SetUsers sets the users property value. The users property +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) SetUsers(value []SimpleUserable)() { + m.users = value +} +// SetUsersUrl sets the users_url property value. The users_url property +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) SetUsersUrl(value *string)() { + m.users_url = value +} +type ProtectedBranch_required_pull_request_reviews_dismissal_restrictionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]Integrationable) + GetTeams()([]Teamable) + GetTeamsUrl()(*string) + GetUrl()(*string) + GetUsers()([]SimpleUserable) + GetUsersUrl()(*string) + SetApps(value []Integrationable)() + SetTeams(value []Teamable)() + SetTeamsUrl(value *string)() + SetUrl(value *string)() + SetUsers(value []SimpleUserable)() + SetUsersUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_signatures.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_signatures.go new file mode 100644 index 000000000..67d7575e1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_signatures.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_required_signatures struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The enabled property + enabled *bool + // The url property + url *string +} +// NewProtectedBranch_required_signatures instantiates a new ProtectedBranch_required_signatures and sets the default values. +func NewProtectedBranch_required_signatures()(*ProtectedBranch_required_signatures) { + m := &ProtectedBranch_required_signatures{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranch_required_signaturesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_required_signaturesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_required_signatures(), 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 *ProtectedBranch_required_signatures) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_required_signatures) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_required_signatures) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranch_required_signatures) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProtectedBranch_required_signatures) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ProtectedBranch_required_signatures) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_required_signatures) SetEnabled(value *bool)() { + m.enabled = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranch_required_signatures) SetUrl(value *string)() { + m.url = value +} +type ProtectedBranch_required_signaturesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + GetUrl()(*string) + SetEnabled(value *bool)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_status_check.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_status_check.go new file mode 100644 index 000000000..c76b75093 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_status_check.go @@ -0,0 +1,244 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProtectedBranchRequiredStatusCheck protected Branch Required Status Check +type ProtectedBranchRequiredStatusCheck struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The checks property + checks []ProtectedBranchRequiredStatusCheck_checksable + // The contexts property + contexts []string + // The contexts_url property + contexts_url *string + // The enforcement_level property + enforcement_level *string + // The strict property + strict *bool + // The url property + url *string +} +// NewProtectedBranchRequiredStatusCheck instantiates a new ProtectedBranchRequiredStatusCheck and sets the default values. +func NewProtectedBranchRequiredStatusCheck()(*ProtectedBranchRequiredStatusCheck) { + m := &ProtectedBranchRequiredStatusCheck{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranchRequiredStatusCheckFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranchRequiredStatusCheckFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranchRequiredStatusCheck(), 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 *ProtectedBranchRequiredStatusCheck) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChecks gets the checks property value. The checks property +// returns a []ProtectedBranchRequiredStatusCheck_checksable when successful +func (m *ProtectedBranchRequiredStatusCheck) GetChecks()([]ProtectedBranchRequiredStatusCheck_checksable) { + return m.checks +} +// GetContexts gets the contexts property value. The contexts property +// returns a []string when successful +func (m *ProtectedBranchRequiredStatusCheck) GetContexts()([]string) { + return m.contexts +} +// GetContextsUrl gets the contexts_url property value. The contexts_url property +// returns a *string when successful +func (m *ProtectedBranchRequiredStatusCheck) GetContextsUrl()(*string) { + return m.contexts_url +} +// GetEnforcementLevel gets the enforcement_level property value. The enforcement_level property +// returns a *string when successful +func (m *ProtectedBranchRequiredStatusCheck) GetEnforcementLevel()(*string) { + return m.enforcement_level +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranchRequiredStatusCheck) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateProtectedBranchRequiredStatusCheck_checksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ProtectedBranchRequiredStatusCheck_checksable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ProtectedBranchRequiredStatusCheck_checksable) + } + } + m.SetChecks(res) + } + return nil + } + res["contexts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetContexts(res) + } + return nil + } + res["contexts_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContextsUrl(val) + } + return nil + } + res["enforcement_level"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnforcementLevel(val) + } + return nil + } + res["strict"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetStrict(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetStrict gets the strict property value. The strict property +// returns a *bool when successful +func (m *ProtectedBranchRequiredStatusCheck) GetStrict()(*bool) { + return m.strict +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranchRequiredStatusCheck) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProtectedBranchRequiredStatusCheck) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetChecks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetChecks())) + for i, v := range m.GetChecks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("checks", cast) + if err != nil { + return err + } + } + if m.GetContexts() != nil { + err := writer.WriteCollectionOfStringValues("contexts", m.GetContexts()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contexts_url", m.GetContextsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("enforcement_level", m.GetEnforcementLevel()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("strict", m.GetStrict()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ProtectedBranchRequiredStatusCheck) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChecks sets the checks property value. The checks property +func (m *ProtectedBranchRequiredStatusCheck) SetChecks(value []ProtectedBranchRequiredStatusCheck_checksable)() { + m.checks = value +} +// SetContexts sets the contexts property value. The contexts property +func (m *ProtectedBranchRequiredStatusCheck) SetContexts(value []string)() { + m.contexts = value +} +// SetContextsUrl sets the contexts_url property value. The contexts_url property +func (m *ProtectedBranchRequiredStatusCheck) SetContextsUrl(value *string)() { + m.contexts_url = value +} +// SetEnforcementLevel sets the enforcement_level property value. The enforcement_level property +func (m *ProtectedBranchRequiredStatusCheck) SetEnforcementLevel(value *string)() { + m.enforcement_level = value +} +// SetStrict sets the strict property value. The strict property +func (m *ProtectedBranchRequiredStatusCheck) SetStrict(value *bool)() { + m.strict = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranchRequiredStatusCheck) SetUrl(value *string)() { + m.url = value +} +type ProtectedBranchRequiredStatusCheckable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChecks()([]ProtectedBranchRequiredStatusCheck_checksable) + GetContexts()([]string) + GetContextsUrl()(*string) + GetEnforcementLevel()(*string) + GetStrict()(*bool) + GetUrl()(*string) + SetChecks(value []ProtectedBranchRequiredStatusCheck_checksable)() + SetContexts(value []string)() + SetContextsUrl(value *string)() + SetEnforcementLevel(value *string)() + SetStrict(value *bool)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_status_check_checks.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_status_check_checks.go new file mode 100644 index 000000000..3903ef2c9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/protected_branch_required_status_check_checks.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranchRequiredStatusCheck_checks struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The app_id property + app_id *int32 + // The context property + context *string +} +// NewProtectedBranchRequiredStatusCheck_checks instantiates a new ProtectedBranchRequiredStatusCheck_checks and sets the default values. +func NewProtectedBranchRequiredStatusCheck_checks()(*ProtectedBranchRequiredStatusCheck_checks) { + m := &ProtectedBranchRequiredStatusCheck_checks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranchRequiredStatusCheck_checksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranchRequiredStatusCheck_checksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranchRequiredStatusCheck_checks(), 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 *ProtectedBranchRequiredStatusCheck_checks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAppId gets the app_id property value. The app_id property +// returns a *int32 when successful +func (m *ProtectedBranchRequiredStatusCheck_checks) GetAppId()(*int32) { + return m.app_id +} +// GetContext gets the context property value. The context property +// returns a *string when successful +func (m *ProtectedBranchRequiredStatusCheck_checks) GetContext()(*string) { + return m.context +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranchRequiredStatusCheck_checks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ProtectedBranchRequiredStatusCheck_checks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("app_id", m.GetAppId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("context", m.GetContext()) + 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 *ProtectedBranchRequiredStatusCheck_checks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAppId sets the app_id property value. The app_id property +func (m *ProtectedBranchRequiredStatusCheck_checks) SetAppId(value *int32)() { + m.app_id = value +} +// SetContext sets the context property value. The context property +func (m *ProtectedBranchRequiredStatusCheck_checks) SetContext(value *string)() { + m.context = value +} +type ProtectedBranchRequiredStatusCheck_checksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppId()(*int32) + GetContext()(*string) + SetAppId(value *int32)() + SetContext(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/public_user.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/public_user.go new file mode 100644 index 000000000..34064bf7e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/public_user.go @@ -0,0 +1,1194 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PublicUser public User +type PublicUser struct { + // The avatar_url property + avatar_url *string + // The bio property + bio *string + // The blog property + blog *string + // The collaborators property + collaborators *int32 + // The company property + company *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The disk_usage property + disk_usage *int32 + // The email property + email *string + // The events_url property + events_url *string + // The followers property + followers *int32 + // The followers_url property + followers_url *string + // The following property + following *int32 + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The hireable property + hireable *bool + // The html_url property + html_url *string + // The id property + id *int64 + // The location property + location *string + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The notification_email property + notification_email *string + // The organizations_url property + organizations_url *string + // The owned_private_repos property + owned_private_repos *int32 + // The plan property + plan PublicUser_planable + // The private_gists property + private_gists *int32 + // The public_gists property + public_gists *int32 + // The public_repos property + public_repos *int32 + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The suspended_at property + suspended_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The total_private_repos property + total_private_repos *int32 + // The twitter_username property + twitter_username *string + // The type property + typeEscaped *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewPublicUser instantiates a new PublicUser and sets the default values. +func NewPublicUser()(*PublicUser) { + m := &PublicUser{ + } + return m +} +// CreatePublicUserFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePublicUserFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPublicUser(), nil +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *PublicUser) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetBio gets the bio property value. The bio property +// returns a *string when successful +func (m *PublicUser) GetBio()(*string) { + return m.bio +} +// GetBlog gets the blog property value. The blog property +// returns a *string when successful +func (m *PublicUser) GetBlog()(*string) { + return m.blog +} +// GetCollaborators gets the collaborators property value. The collaborators property +// returns a *int32 when successful +func (m *PublicUser) GetCollaborators()(*int32) { + return m.collaborators +} +// GetCompany gets the company property value. The company property +// returns a *string when successful +func (m *PublicUser) GetCompany()(*string) { + return m.company +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PublicUser) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDiskUsage gets the disk_usage property value. The disk_usage property +// returns a *int32 when successful +func (m *PublicUser) GetDiskUsage()(*int32) { + return m.disk_usage +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *PublicUser) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *PublicUser) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PublicUser) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["bio"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBio(val) + } + return nil + } + res["blog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlog(val) + } + return nil + } + res["collaborators"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCollaborators(val) + } + return nil + } + res["company"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompany(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["disk_usage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDiskUsage(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowers(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowing(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["hireable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHireable(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notification_email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationEmail(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["owned_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOwnedPrivateRepos(val) + } + return nil + } + res["plan"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePublicUser_planFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPlan(val.(PublicUser_planable)) + } + return nil + } + res["private_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateGists(val) + } + return nil + } + res["public_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicGists(val) + } + return nil + } + res["public_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicRepos(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["suspended_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetSuspendedAt(val) + } + return nil + } + res["total_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalPrivateRepos(val) + } + return nil + } + res["twitter_username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTwitterUsername(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowers gets the followers property value. The followers property +// returns a *int32 when successful +func (m *PublicUser) GetFollowers()(*int32) { + return m.followers +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *PublicUser) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowing gets the following property value. The following property +// returns a *int32 when successful +func (m *PublicUser) GetFollowing()(*int32) { + return m.following +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *PublicUser) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *PublicUser) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *PublicUser) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHireable gets the hireable property value. The hireable property +// returns a *bool when successful +func (m *PublicUser) GetHireable()(*bool) { + return m.hireable +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PublicUser) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PublicUser) GetId()(*int64) { + return m.id +} +// GetLocation gets the location property value. The location property +// returns a *string when successful +func (m *PublicUser) GetLocation()(*string) { + return m.location +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *PublicUser) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PublicUser) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PublicUser) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationEmail gets the notification_email property value. The notification_email property +// returns a *string when successful +func (m *PublicUser) GetNotificationEmail()(*string) { + return m.notification_email +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *PublicUser) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetOwnedPrivateRepos gets the owned_private_repos property value. The owned_private_repos property +// returns a *int32 when successful +func (m *PublicUser) GetOwnedPrivateRepos()(*int32) { + return m.owned_private_repos +} +// GetPlan gets the plan property value. The plan property +// returns a PublicUser_planable when successful +func (m *PublicUser) GetPlan()(PublicUser_planable) { + return m.plan +} +// GetPrivateGists gets the private_gists property value. The private_gists property +// returns a *int32 when successful +func (m *PublicUser) GetPrivateGists()(*int32) { + return m.private_gists +} +// GetPublicGists gets the public_gists property value. The public_gists property +// returns a *int32 when successful +func (m *PublicUser) GetPublicGists()(*int32) { + return m.public_gists +} +// GetPublicRepos gets the public_repos property value. The public_repos property +// returns a *int32 when successful +func (m *PublicUser) GetPublicRepos()(*int32) { + return m.public_repos +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *PublicUser) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *PublicUser) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *PublicUser) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *PublicUser) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *PublicUser) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetSuspendedAt gets the suspended_at property value. The suspended_at property +// returns a *Time when successful +func (m *PublicUser) GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.suspended_at +} +// GetTotalPrivateRepos gets the total_private_repos property value. The total_private_repos property +// returns a *int32 when successful +func (m *PublicUser) GetTotalPrivateRepos()(*int32) { + return m.total_private_repos +} +// GetTwitterUsername gets the twitter_username property value. The twitter_username property +// returns a *string when successful +func (m *PublicUser) GetTwitterUsername()(*string) { + return m.twitter_username +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *PublicUser) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PublicUser) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PublicUser) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PublicUser) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("bio", m.GetBio()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blog", m.GetBlog()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("collaborators", m.GetCollaborators()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("company", m.GetCompany()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("disk_usage", m.GetDiskUsage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("followers", m.GetFollowers()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("following", m.GetFollowing()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("hireable", m.GetHireable()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notification_email", m.GetNotificationEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("owned_private_repos", m.GetOwnedPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("plan", m.GetPlan()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_gists", m.GetPrivateGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_gists", m.GetPublicGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_repos", m.GetPublicRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("suspended_at", m.GetSuspendedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_private_repos", m.GetTotalPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("twitter_username", m.GetTwitterUsername()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + return nil +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *PublicUser) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetBio sets the bio property value. The bio property +func (m *PublicUser) SetBio(value *string)() { + m.bio = value +} +// SetBlog sets the blog property value. The blog property +func (m *PublicUser) SetBlog(value *string)() { + m.blog = value +} +// SetCollaborators sets the collaborators property value. The collaborators property +func (m *PublicUser) SetCollaborators(value *int32)() { + m.collaborators = value +} +// SetCompany sets the company property value. The company property +func (m *PublicUser) SetCompany(value *string)() { + m.company = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PublicUser) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDiskUsage sets the disk_usage property value. The disk_usage property +func (m *PublicUser) SetDiskUsage(value *int32)() { + m.disk_usage = value +} +// SetEmail sets the email property value. The email property +func (m *PublicUser) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *PublicUser) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowers sets the followers property value. The followers property +func (m *PublicUser) SetFollowers(value *int32)() { + m.followers = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *PublicUser) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowing sets the following property value. The following property +func (m *PublicUser) SetFollowing(value *int32)() { + m.following = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *PublicUser) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *PublicUser) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *PublicUser) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHireable sets the hireable property value. The hireable property +func (m *PublicUser) SetHireable(value *bool)() { + m.hireable = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PublicUser) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PublicUser) SetId(value *int64)() { + m.id = value +} +// SetLocation sets the location property value. The location property +func (m *PublicUser) SetLocation(value *string)() { + m.location = value +} +// SetLogin sets the login property value. The login property +func (m *PublicUser) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *PublicUser) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PublicUser) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationEmail sets the notification_email property value. The notification_email property +func (m *PublicUser) SetNotificationEmail(value *string)() { + m.notification_email = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *PublicUser) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetOwnedPrivateRepos sets the owned_private_repos property value. The owned_private_repos property +func (m *PublicUser) SetOwnedPrivateRepos(value *int32)() { + m.owned_private_repos = value +} +// SetPlan sets the plan property value. The plan property +func (m *PublicUser) SetPlan(value PublicUser_planable)() { + m.plan = value +} +// SetPrivateGists sets the private_gists property value. The private_gists property +func (m *PublicUser) SetPrivateGists(value *int32)() { + m.private_gists = value +} +// SetPublicGists sets the public_gists property value. The public_gists property +func (m *PublicUser) SetPublicGists(value *int32)() { + m.public_gists = value +} +// SetPublicRepos sets the public_repos property value. The public_repos property +func (m *PublicUser) SetPublicRepos(value *int32)() { + m.public_repos = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *PublicUser) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *PublicUser) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *PublicUser) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *PublicUser) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *PublicUser) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetSuspendedAt sets the suspended_at property value. The suspended_at property +func (m *PublicUser) SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.suspended_at = value +} +// SetTotalPrivateRepos sets the total_private_repos property value. The total_private_repos property +func (m *PublicUser) SetTotalPrivateRepos(value *int32)() { + m.total_private_repos = value +} +// SetTwitterUsername sets the twitter_username property value. The twitter_username property +func (m *PublicUser) SetTwitterUsername(value *string)() { + m.twitter_username = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *PublicUser) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PublicUser) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PublicUser) SetUrl(value *string)() { + m.url = value +} +type PublicUserable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetBio()(*string) + GetBlog()(*string) + GetCollaborators()(*int32) + GetCompany()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDiskUsage()(*int32) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowers()(*int32) + GetFollowersUrl()(*string) + GetFollowing()(*int32) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHireable()(*bool) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLocation()(*string) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationEmail()(*string) + GetOrganizationsUrl()(*string) + GetOwnedPrivateRepos()(*int32) + GetPlan()(PublicUser_planable) + GetPrivateGists()(*int32) + GetPublicGists()(*int32) + GetPublicRepos()(*int32) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetTotalPrivateRepos()(*int32) + GetTwitterUsername()(*string) + GetTypeEscaped()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetBio(value *string)() + SetBlog(value *string)() + SetCollaborators(value *int32)() + SetCompany(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDiskUsage(value *int32)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowers(value *int32)() + SetFollowersUrl(value *string)() + SetFollowing(value *int32)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHireable(value *bool)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLocation(value *string)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationEmail(value *string)() + SetOrganizationsUrl(value *string)() + SetOwnedPrivateRepos(value *int32)() + SetPlan(value PublicUser_planable)() + SetPrivateGists(value *int32)() + SetPublicGists(value *int32)() + SetPublicRepos(value *int32)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetTotalPrivateRepos(value *int32)() + SetTwitterUsername(value *string)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/public_user_plan.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/public_user_plan.go new file mode 100644 index 000000000..4bec18acc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/public_user_plan.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PublicUser_plan struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The collaborators property + collaborators *int32 + // The name property + name *string + // The private_repos property + private_repos *int32 + // The space property + space *int32 +} +// NewPublicUser_plan instantiates a new PublicUser_plan and sets the default values. +func NewPublicUser_plan()(*PublicUser_plan) { + m := &PublicUser_plan{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePublicUser_planFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePublicUser_planFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPublicUser_plan(), 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 *PublicUser_plan) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCollaborators gets the collaborators property value. The collaborators property +// returns a *int32 when successful +func (m *PublicUser_plan) GetCollaborators()(*int32) { + return m.collaborators +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PublicUser_plan) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["collaborators"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCollaborators(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateRepos(val) + } + return nil + } + res["space"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSpace(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PublicUser_plan) GetName()(*string) { + return m.name +} +// GetPrivateRepos gets the private_repos property value. The private_repos property +// returns a *int32 when successful +func (m *PublicUser_plan) GetPrivateRepos()(*int32) { + return m.private_repos +} +// GetSpace gets the space property value. The space property +// returns a *int32 when successful +func (m *PublicUser_plan) GetSpace()(*int32) { + return m.space +} +// Serialize serializes information the current object +func (m *PublicUser_plan) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("collaborators", m.GetCollaborators()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_repos", m.GetPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("space", m.GetSpace()) + 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 *PublicUser_plan) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCollaborators sets the collaborators property value. The collaborators property +func (m *PublicUser_plan) SetCollaborators(value *int32)() { + m.collaborators = value +} +// SetName sets the name property value. The name property +func (m *PublicUser_plan) SetName(value *string)() { + m.name = value +} +// SetPrivateRepos sets the private_repos property value. The private_repos property +func (m *PublicUser_plan) SetPrivateRepos(value *int32)() { + m.private_repos = value +} +// SetSpace sets the space property value. The space property +func (m *PublicUser_plan) SetSpace(value *int32)() { + m.space = value +} +type PublicUser_planable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCollaborators()(*int32) + GetName()(*string) + GetPrivateRepos()(*int32) + GetSpace()(*int32) + SetCollaborators(value *int32)() + SetName(value *string)() + SetPrivateRepos(value *int32)() + SetSpace(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request.go new file mode 100644 index 000000000..f1d5c8079 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request.go @@ -0,0 +1,1495 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PullRequest pull requests let you tell others about changes you've pushed to a repository on GitHub. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary. +type PullRequest struct { + // The _links property + _links PullRequest__linksable + // The active_lock_reason property + active_lock_reason *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The additions property + additions *int32 + // A GitHub user. + assignee NullableSimpleUserable + // The assignees property + assignees []SimpleUserable + // How the author is associated with the repository. + author_association *AuthorAssociation + // The status of auto merging a pull request. + auto_merge AutoMergeable + // The base property + base PullRequest_baseable + // The body property + body *string + // The changed_files property + changed_files *int32 + // The closed_at property + closed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The comments property + comments *int32 + // The comments_url property + comments_url *string + // The commits property + commits *int32 + // The commits_url property + commits_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The deletions property + deletions *int32 + // The diff_url property + diff_url *string + // Indicates whether or not the pull request is a draft. + draft *bool + // The head property + head PullRequest_headable + // The html_url property + html_url *string + // The id property + id *int64 + // The issue_url property + issue_url *string + // The labels property + labels []PullRequest_labelsable + // The locked property + locked *bool + // Indicates whether maintainers can modify the pull request. + maintainer_can_modify *bool + // The merge_commit_sha property + merge_commit_sha *string + // The mergeable property + mergeable *bool + // The mergeable_state property + mergeable_state *string + // The merged property + merged *bool + // The merged_at property + merged_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + merged_by NullableSimpleUserable + // A collection of related issues and pull requests. + milestone NullableMilestoneable + // The node_id property + node_id *string + // Number uniquely identifying the pull request within its repository. + number *int32 + // The patch_url property + patch_url *string + // The rebaseable property + rebaseable *bool + // The requested_reviewers property + requested_reviewers []SimpleUserable + // The requested_teams property + requested_teams []TeamSimpleable + // The review_comment_url property + review_comment_url *string + // The review_comments property + review_comments *int32 + // The review_comments_url property + review_comments_url *string + // State of this Pull Request. Either `open` or `closed`. + state *PullRequest_state + // The statuses_url property + statuses_url *string + // The title of the pull request. + title *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user SimpleUserable +} +// NewPullRequest instantiates a new PullRequest and sets the default values. +func NewPullRequest()(*PullRequest) { + m := &PullRequest{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest(), nil +} +// GetActiveLockReason gets the active_lock_reason property value. The active_lock_reason property +// returns a *string when successful +func (m *PullRequest) GetActiveLockReason()(*string) { + return m.active_lock_reason +} +// 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 *PullRequest) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdditions gets the additions property value. The additions property +// returns a *int32 when successful +func (m *PullRequest) GetAdditions()(*int32) { + return m.additions +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PullRequest) GetAssignee()(NullableSimpleUserable) { + return m.assignee +} +// GetAssignees gets the assignees property value. The assignees property +// returns a []SimpleUserable when successful +func (m *PullRequest) GetAssignees()([]SimpleUserable) { + return m.assignees +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *PullRequest) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetAutoMerge gets the auto_merge property value. The status of auto merging a pull request. +// returns a AutoMergeable when successful +func (m *PullRequest) GetAutoMerge()(AutoMergeable) { + return m.auto_merge +} +// GetBase gets the base property value. The base property +// returns a PullRequest_baseable when successful +func (m *PullRequest) GetBase()(PullRequest_baseable) { + return m.base +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *PullRequest) GetBody()(*string) { + return m.body +} +// GetChangedFiles gets the changed_files property value. The changed_files property +// returns a *int32 when successful +func (m *PullRequest) GetChangedFiles()(*int32) { + return m.changed_files +} +// GetClosedAt gets the closed_at property value. The closed_at property +// returns a *Time when successful +func (m *PullRequest) GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.closed_at +} +// GetComments gets the comments property value. The comments property +// returns a *int32 when successful +func (m *PullRequest) GetComments()(*int32) { + return m.comments +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *PullRequest) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommits gets the commits property value. The commits property +// returns a *int32 when successful +func (m *PullRequest) GetCommits()(*int32) { + return m.commits +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *PullRequest) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PullRequest) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDeletions gets the deletions property value. The deletions property +// returns a *int32 when successful +func (m *PullRequest) GetDeletions()(*int32) { + return m.deletions +} +// GetDiffUrl gets the diff_url property value. The diff_url property +// returns a *string when successful +func (m *PullRequest) GetDiffUrl()(*string) { + return m.diff_url +} +// GetDraft gets the draft property value. Indicates whether or not the pull request is a draft. +// returns a *bool when successful +func (m *PullRequest) GetDraft()(*bool) { + return m.draft +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(PullRequest__linksable)) + } + return nil + } + res["active_lock_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetActiveLockReason(val) + } + return nil + } + res["additions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAdditions(val) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(NullableSimpleUserable)) + } + return nil + } + res["assignees"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetAssignees(res) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAutoMergeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAutoMerge(val.(AutoMergeable)) + } + return nil + } + res["base"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_baseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBase(val.(PullRequest_baseable)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["changed_files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetChangedFiles(val) + } + return nil + } + res["closed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetClosedAt(val) + } + return nil + } + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetComments(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCommits(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["deletions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDeletions(val) + } + return nil + } + res["diff_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiffUrl(val) + } + return nil + } + res["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(val) + } + return nil + } + res["head"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_headFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHead(val.(PullRequest_headable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["issue_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueUrl(val) + } + return nil + } + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePullRequest_labelsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PullRequest_labelsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PullRequest_labelsable) + } + } + m.SetLabels(res) + } + return nil + } + res["locked"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLocked(val) + } + return nil + } + res["maintainer_can_modify"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintainerCanModify(val) + } + return nil + } + res["merge_commit_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitSha(val) + } + return nil + } + res["mergeable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMergeable(val) + } + return nil + } + res["mergeable_state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergeableState(val) + } + return nil + } + res["merged"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMerged(val) + } + return nil + } + res["merged_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetMergedAt(val) + } + return nil + } + res["merged_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMergedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableMilestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(NullableMilestoneable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["patch_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatchUrl(val) + } + return nil + } + res["rebaseable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRebaseable(val) + } + return nil + } + res["requested_reviewers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetRequestedReviewers(res) + } + return nil + } + res["requested_teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTeamSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]TeamSimpleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(TeamSimpleable) + } + } + m.SetRequestedTeams(res) + } + return nil + } + res["review_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReviewCommentUrl(val) + } + return nil + } + res["review_comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetReviewComments(val) + } + return nil + } + res["review_comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReviewCommentsUrl(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePullRequest_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*PullRequest_state)) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(SimpleUserable)) + } + return nil + } + return res +} +// GetHead gets the head property value. The head property +// returns a PullRequest_headable when successful +func (m *PullRequest) GetHead()(PullRequest_headable) { + return m.head +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequest) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequest) GetId()(*int64) { + return m.id +} +// GetIssueUrl gets the issue_url property value. The issue_url property +// returns a *string when successful +func (m *PullRequest) GetIssueUrl()(*string) { + return m.issue_url +} +// GetLabels gets the labels property value. The labels property +// returns a []PullRequest_labelsable when successful +func (m *PullRequest) GetLabels()([]PullRequest_labelsable) { + return m.labels +} +// GetLinks gets the _links property value. The _links property +// returns a PullRequest__linksable when successful +func (m *PullRequest) GetLinks()(PullRequest__linksable) { + return m._links +} +// GetLocked gets the locked property value. The locked property +// returns a *bool when successful +func (m *PullRequest) GetLocked()(*bool) { + return m.locked +} +// GetMaintainerCanModify gets the maintainer_can_modify property value. Indicates whether maintainers can modify the pull request. +// returns a *bool when successful +func (m *PullRequest) GetMaintainerCanModify()(*bool) { + return m.maintainer_can_modify +} +// GetMergeable gets the mergeable property value. The mergeable property +// returns a *bool when successful +func (m *PullRequest) GetMergeable()(*bool) { + return m.mergeable +} +// GetMergeableState gets the mergeable_state property value. The mergeable_state property +// returns a *string when successful +func (m *PullRequest) GetMergeableState()(*string) { + return m.mergeable_state +} +// GetMergeCommitSha gets the merge_commit_sha property value. The merge_commit_sha property +// returns a *string when successful +func (m *PullRequest) GetMergeCommitSha()(*string) { + return m.merge_commit_sha +} +// GetMerged gets the merged property value. The merged property +// returns a *bool when successful +func (m *PullRequest) GetMerged()(*bool) { + return m.merged +} +// GetMergedAt gets the merged_at property value. The merged_at property +// returns a *Time when successful +func (m *PullRequest) GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.merged_at +} +// GetMergedBy gets the merged_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PullRequest) GetMergedBy()(NullableSimpleUserable) { + return m.merged_by +} +// GetMilestone gets the milestone property value. A collection of related issues and pull requests. +// returns a NullableMilestoneable when successful +func (m *PullRequest) GetMilestone()(NullableMilestoneable) { + return m.milestone +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. Number uniquely identifying the pull request within its repository. +// returns a *int32 when successful +func (m *PullRequest) GetNumber()(*int32) { + return m.number +} +// GetPatchUrl gets the patch_url property value. The patch_url property +// returns a *string when successful +func (m *PullRequest) GetPatchUrl()(*string) { + return m.patch_url +} +// GetRebaseable gets the rebaseable property value. The rebaseable property +// returns a *bool when successful +func (m *PullRequest) GetRebaseable()(*bool) { + return m.rebaseable +} +// GetRequestedReviewers gets the requested_reviewers property value. The requested_reviewers property +// returns a []SimpleUserable when successful +func (m *PullRequest) GetRequestedReviewers()([]SimpleUserable) { + return m.requested_reviewers +} +// GetRequestedTeams gets the requested_teams property value. The requested_teams property +// returns a []TeamSimpleable when successful +func (m *PullRequest) GetRequestedTeams()([]TeamSimpleable) { + return m.requested_teams +} +// GetReviewComments gets the review_comments property value. The review_comments property +// returns a *int32 when successful +func (m *PullRequest) GetReviewComments()(*int32) { + return m.review_comments +} +// GetReviewCommentsUrl gets the review_comments_url property value. The review_comments_url property +// returns a *string when successful +func (m *PullRequest) GetReviewCommentsUrl()(*string) { + return m.review_comments_url +} +// GetReviewCommentUrl gets the review_comment_url property value. The review_comment_url property +// returns a *string when successful +func (m *PullRequest) GetReviewCommentUrl()(*string) { + return m.review_comment_url +} +// GetState gets the state property value. State of this Pull Request. Either `open` or `closed`. +// returns a *PullRequest_state when successful +func (m *PullRequest) GetState()(*PullRequest_state) { + return m.state +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *PullRequest) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetTitle gets the title property value. The title of the pull request. +// returns a *string when successful +func (m *PullRequest) GetTitle()(*string) { + return m.title +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PullRequest) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *PullRequest) GetUser()(SimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *PullRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("active_lock_reason", m.GetActiveLockReason()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("additions", m.GetAdditions()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + if m.GetAssignees() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAssignees())) + for i, v := range m.GetAssignees() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("assignees", cast) + if err != nil { + return err + } + } + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("auto_merge", m.GetAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("base", m.GetBase()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("changed_files", m.GetChangedFiles()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("closed_at", m.GetClosedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("commits", m.GetCommits()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("deletions", m.GetDeletions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("diff_url", m.GetDiffUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("head", m.GetHead()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_url", m.GetIssueUrl()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("locked", m.GetLocked()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintainer_can_modify", m.GetMaintainerCanModify()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("mergeable", m.GetMergeable()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mergeable_state", m.GetMergeableState()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("merged", m.GetMerged()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("merged_at", m.GetMergedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("merged_by", m.GetMergedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merge_commit_sha", m.GetMergeCommitSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patch_url", m.GetPatchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("rebaseable", m.GetRebaseable()) + if err != nil { + return err + } + } + if m.GetRequestedReviewers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRequestedReviewers())) + for i, v := range m.GetRequestedReviewers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("requested_reviewers", cast) + if err != nil { + return err + } + } + if m.GetRequestedTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRequestedTeams())) + for i, v := range m.GetRequestedTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("requested_teams", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("review_comments", m.GetReviewComments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("review_comments_url", m.GetReviewCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("review_comment_url", m.GetReviewCommentUrl()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActiveLockReason sets the active_lock_reason property value. The active_lock_reason property +func (m *PullRequest) SetActiveLockReason(value *string)() { + m.active_lock_reason = value +} +// 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 *PullRequest) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdditions sets the additions property value. The additions property +func (m *PullRequest) SetAdditions(value *int32)() { + m.additions = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *PullRequest) SetAssignee(value NullableSimpleUserable)() { + m.assignee = value +} +// SetAssignees sets the assignees property value. The assignees property +func (m *PullRequest) SetAssignees(value []SimpleUserable)() { + m.assignees = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *PullRequest) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetAutoMerge sets the auto_merge property value. The status of auto merging a pull request. +func (m *PullRequest) SetAutoMerge(value AutoMergeable)() { + m.auto_merge = value +} +// SetBase sets the base property value. The base property +func (m *PullRequest) SetBase(value PullRequest_baseable)() { + m.base = value +} +// SetBody sets the body property value. The body property +func (m *PullRequest) SetBody(value *string)() { + m.body = value +} +// SetChangedFiles sets the changed_files property value. The changed_files property +func (m *PullRequest) SetChangedFiles(value *int32)() { + m.changed_files = value +} +// SetClosedAt sets the closed_at property value. The closed_at property +func (m *PullRequest) SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.closed_at = value +} +// SetComments sets the comments property value. The comments property +func (m *PullRequest) SetComments(value *int32)() { + m.comments = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *PullRequest) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommits sets the commits property value. The commits property +func (m *PullRequest) SetCommits(value *int32)() { + m.commits = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *PullRequest) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PullRequest) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDeletions sets the deletions property value. The deletions property +func (m *PullRequest) SetDeletions(value *int32)() { + m.deletions = value +} +// SetDiffUrl sets the diff_url property value. The diff_url property +func (m *PullRequest) SetDiffUrl(value *string)() { + m.diff_url = value +} +// SetDraft sets the draft property value. Indicates whether or not the pull request is a draft. +func (m *PullRequest) SetDraft(value *bool)() { + m.draft = value +} +// SetHead sets the head property value. The head property +func (m *PullRequest) SetHead(value PullRequest_headable)() { + m.head = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequest) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PullRequest) SetId(value *int64)() { + m.id = value +} +// SetIssueUrl sets the issue_url property value. The issue_url property +func (m *PullRequest) SetIssueUrl(value *string)() { + m.issue_url = value +} +// SetLabels sets the labels property value. The labels property +func (m *PullRequest) SetLabels(value []PullRequest_labelsable)() { + m.labels = value +} +// SetLinks sets the _links property value. The _links property +func (m *PullRequest) SetLinks(value PullRequest__linksable)() { + m._links = value +} +// SetLocked sets the locked property value. The locked property +func (m *PullRequest) SetLocked(value *bool)() { + m.locked = value +} +// SetMaintainerCanModify sets the maintainer_can_modify property value. Indicates whether maintainers can modify the pull request. +func (m *PullRequest) SetMaintainerCanModify(value *bool)() { + m.maintainer_can_modify = value +} +// SetMergeable sets the mergeable property value. The mergeable property +func (m *PullRequest) SetMergeable(value *bool)() { + m.mergeable = value +} +// SetMergeableState sets the mergeable_state property value. The mergeable_state property +func (m *PullRequest) SetMergeableState(value *string)() { + m.mergeable_state = value +} +// SetMergeCommitSha sets the merge_commit_sha property value. The merge_commit_sha property +func (m *PullRequest) SetMergeCommitSha(value *string)() { + m.merge_commit_sha = value +} +// SetMerged sets the merged property value. The merged property +func (m *PullRequest) SetMerged(value *bool)() { + m.merged = value +} +// SetMergedAt sets the merged_at property value. The merged_at property +func (m *PullRequest) SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.merged_at = value +} +// SetMergedBy sets the merged_by property value. A GitHub user. +func (m *PullRequest) SetMergedBy(value NullableSimpleUserable)() { + m.merged_by = value +} +// SetMilestone sets the milestone property value. A collection of related issues and pull requests. +func (m *PullRequest) SetMilestone(value NullableMilestoneable)() { + m.milestone = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. Number uniquely identifying the pull request within its repository. +func (m *PullRequest) SetNumber(value *int32)() { + m.number = value +} +// SetPatchUrl sets the patch_url property value. The patch_url property +func (m *PullRequest) SetPatchUrl(value *string)() { + m.patch_url = value +} +// SetRebaseable sets the rebaseable property value. The rebaseable property +func (m *PullRequest) SetRebaseable(value *bool)() { + m.rebaseable = value +} +// SetRequestedReviewers sets the requested_reviewers property value. The requested_reviewers property +func (m *PullRequest) SetRequestedReviewers(value []SimpleUserable)() { + m.requested_reviewers = value +} +// SetRequestedTeams sets the requested_teams property value. The requested_teams property +func (m *PullRequest) SetRequestedTeams(value []TeamSimpleable)() { + m.requested_teams = value +} +// SetReviewComments sets the review_comments property value. The review_comments property +func (m *PullRequest) SetReviewComments(value *int32)() { + m.review_comments = value +} +// SetReviewCommentsUrl sets the review_comments_url property value. The review_comments_url property +func (m *PullRequest) SetReviewCommentsUrl(value *string)() { + m.review_comments_url = value +} +// SetReviewCommentUrl sets the review_comment_url property value. The review_comment_url property +func (m *PullRequest) SetReviewCommentUrl(value *string)() { + m.review_comment_url = value +} +// SetState sets the state property value. State of this Pull Request. Either `open` or `closed`. +func (m *PullRequest) SetState(value *PullRequest_state)() { + m.state = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *PullRequest) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetTitle sets the title property value. The title of the pull request. +func (m *PullRequest) SetTitle(value *string)() { + m.title = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PullRequest) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *PullRequest) SetUser(value SimpleUserable)() { + m.user = value +} +type PullRequestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActiveLockReason()(*string) + GetAdditions()(*int32) + GetAssignee()(NullableSimpleUserable) + GetAssignees()([]SimpleUserable) + GetAuthorAssociation()(*AuthorAssociation) + GetAutoMerge()(AutoMergeable) + GetBase()(PullRequest_baseable) + GetBody()(*string) + GetChangedFiles()(*int32) + GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetComments()(*int32) + GetCommentsUrl()(*string) + GetCommits()(*int32) + GetCommitsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDeletions()(*int32) + GetDiffUrl()(*string) + GetDraft()(*bool) + GetHead()(PullRequest_headable) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueUrl()(*string) + GetLabels()([]PullRequest_labelsable) + GetLinks()(PullRequest__linksable) + GetLocked()(*bool) + GetMaintainerCanModify()(*bool) + GetMergeable()(*bool) + GetMergeableState()(*string) + GetMergeCommitSha()(*string) + GetMerged()(*bool) + GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetMergedBy()(NullableSimpleUserable) + GetMilestone()(NullableMilestoneable) + GetNodeId()(*string) + GetNumber()(*int32) + GetPatchUrl()(*string) + GetRebaseable()(*bool) + GetRequestedReviewers()([]SimpleUserable) + GetRequestedTeams()([]TeamSimpleable) + GetReviewComments()(*int32) + GetReviewCommentsUrl()(*string) + GetReviewCommentUrl()(*string) + GetState()(*PullRequest_state) + GetStatusesUrl()(*string) + GetTitle()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(SimpleUserable) + SetActiveLockReason(value *string)() + SetAdditions(value *int32)() + SetAssignee(value NullableSimpleUserable)() + SetAssignees(value []SimpleUserable)() + SetAuthorAssociation(value *AuthorAssociation)() + SetAutoMerge(value AutoMergeable)() + SetBase(value PullRequest_baseable)() + SetBody(value *string)() + SetChangedFiles(value *int32)() + SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetComments(value *int32)() + SetCommentsUrl(value *string)() + SetCommits(value *int32)() + SetCommitsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDeletions(value *int32)() + SetDiffUrl(value *string)() + SetDraft(value *bool)() + SetHead(value PullRequest_headable)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueUrl(value *string)() + SetLabels(value []PullRequest_labelsable)() + SetLinks(value PullRequest__linksable)() + SetLocked(value *bool)() + SetMaintainerCanModify(value *bool)() + SetMergeable(value *bool)() + SetMergeableState(value *string)() + SetMergeCommitSha(value *string)() + SetMerged(value *bool)() + SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetMergedBy(value NullableSimpleUserable)() + SetMilestone(value NullableMilestoneable)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetPatchUrl(value *string)() + SetRebaseable(value *bool)() + SetRequestedReviewers(value []SimpleUserable)() + SetRequestedTeams(value []TeamSimpleable)() + SetReviewComments(value *int32)() + SetReviewCommentsUrl(value *string)() + SetReviewCommentUrl(value *string)() + SetState(value *PullRequest_state)() + SetStatusesUrl(value *string)() + SetTitle(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value SimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request503_error.go new file mode 100644 index 000000000..ed9cd4134 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewPullRequest503Error instantiates a new PullRequest503Error and sets the default values. +func NewPullRequest503Error()(*PullRequest503Error) { + m := &PullRequest503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *PullRequest503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *PullRequest503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *PullRequest503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *PullRequest503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *PullRequest503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *PullRequest503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *PullRequest503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *PullRequest503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *PullRequest503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *PullRequest503Error) SetMessage(value *string)() { + m.message = value +} +type PullRequest503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request__links.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request__links.go new file mode 100644 index 000000000..f00509826 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request__links.go @@ -0,0 +1,283 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Hypermedia Link + comments Linkable + // Hypermedia Link + commits Linkable + // Hypermedia Link + html Linkable + // Hypermedia Link + issue Linkable + // Hypermedia Link + review_comment Linkable + // Hypermedia Link + review_comments Linkable + // Hypermedia Link + self Linkable + // Hypermedia Link + statuses Linkable +} +// NewPullRequest__links instantiates a new PullRequest__links and sets the default values. +func NewPullRequest__links()(*PullRequest__links) { + m := &PullRequest__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest__links(), 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 *PullRequest__links) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComments gets the comments property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequest__links) GetComments()(Linkable) { + return m.comments +} +// GetCommits gets the commits property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequest__links) GetCommits()(Linkable) { + return m.commits +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetComments(val.(Linkable)) + } + return nil + } + res["commits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommits(val.(Linkable)) + } + return nil + } + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHtml(val.(Linkable)) + } + return nil + } + res["issue"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIssue(val.(Linkable)) + } + return nil + } + res["review_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewComment(val.(Linkable)) + } + return nil + } + res["review_comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewComments(val.(Linkable)) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSelf(val.(Linkable)) + } + return nil + } + res["statuses"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetStatuses(val.(Linkable)) + } + return nil + } + return res +} +// GetHtml gets the html property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequest__links) GetHtml()(Linkable) { + return m.html +} +// GetIssue gets the issue property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequest__links) GetIssue()(Linkable) { + return m.issue +} +// GetReviewComment gets the review_comment property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequest__links) GetReviewComment()(Linkable) { + return m.review_comment +} +// GetReviewComments gets the review_comments property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequest__links) GetReviewComments()(Linkable) { + return m.review_comments +} +// GetSelf gets the self property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequest__links) GetSelf()(Linkable) { + return m.self +} +// GetStatuses gets the statuses property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequest__links) GetStatuses()(Linkable) { + return m.statuses +} +// Serialize serializes information the current object +func (m *PullRequest__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("commits", m.GetCommits()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("issue", m.GetIssue()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("review_comment", m.GetReviewComment()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("review_comments", m.GetReviewComments()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("self", m.GetSelf()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("statuses", m.GetStatuses()) + 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 *PullRequest__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComments sets the comments property value. Hypermedia Link +func (m *PullRequest__links) SetComments(value Linkable)() { + m.comments = value +} +// SetCommits sets the commits property value. Hypermedia Link +func (m *PullRequest__links) SetCommits(value Linkable)() { + m.commits = value +} +// SetHtml sets the html property value. Hypermedia Link +func (m *PullRequest__links) SetHtml(value Linkable)() { + m.html = value +} +// SetIssue sets the issue property value. Hypermedia Link +func (m *PullRequest__links) SetIssue(value Linkable)() { + m.issue = value +} +// SetReviewComment sets the review_comment property value. Hypermedia Link +func (m *PullRequest__links) SetReviewComment(value Linkable)() { + m.review_comment = value +} +// SetReviewComments sets the review_comments property value. Hypermedia Link +func (m *PullRequest__links) SetReviewComments(value Linkable)() { + m.review_comments = value +} +// SetSelf sets the self property value. Hypermedia Link +func (m *PullRequest__links) SetSelf(value Linkable)() { + m.self = value +} +// SetStatuses sets the statuses property value. Hypermedia Link +func (m *PullRequest__links) SetStatuses(value Linkable)() { + m.statuses = value +} +type PullRequest__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComments()(Linkable) + GetCommits()(Linkable) + GetHtml()(Linkable) + GetIssue()(Linkable) + GetReviewComment()(Linkable) + GetReviewComments()(Linkable) + GetSelf()(Linkable) + GetStatuses()(Linkable) + SetComments(value Linkable)() + SetCommits(value Linkable)() + SetHtml(value Linkable)() + SetIssue(value Linkable)() + SetReviewComment(value Linkable)() + SetReviewComments(value Linkable)() + SetSelf(value Linkable)() + SetStatuses(value Linkable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_base.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_base.go new file mode 100644 index 000000000..141ccdc65 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_base.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_base struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The label property + label *string + // The ref property + ref *string + // The repo property + repo PullRequest_base_repoable + // The sha property + sha *string + // The user property + user PullRequest_base_userable +} +// NewPullRequest_base instantiates a new PullRequest_base and sets the default values. +func NewPullRequest_base()(*PullRequest_base) { + m := &PullRequest_base{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_baseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_baseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_base(), 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 *PullRequest_base) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_base) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabel(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_base_repoFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepo(val.(PullRequest_base_repoable)) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_base_userFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(PullRequest_base_userable)) + } + return nil + } + return res +} +// GetLabel gets the label property value. The label property +// returns a *string when successful +func (m *PullRequest_base) GetLabel()(*string) { + return m.label +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *PullRequest_base) GetRef()(*string) { + return m.ref +} +// GetRepo gets the repo property value. The repo property +// returns a PullRequest_base_repoable when successful +func (m *PullRequest_base) GetRepo()(PullRequest_base_repoable) { + return m.repo +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *PullRequest_base) GetSha()(*string) { + return m.sha +} +// GetUser gets the user property value. The user property +// returns a PullRequest_base_userable when successful +func (m *PullRequest_base) GetUser()(PullRequest_base_userable) { + return m.user +} +// Serialize serializes information the current object +func (m *PullRequest_base) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repo", m.GetRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *PullRequest_base) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabel sets the label property value. The label property +func (m *PullRequest_base) SetLabel(value *string)() { + m.label = value +} +// SetRef sets the ref property value. The ref property +func (m *PullRequest_base) SetRef(value *string)() { + m.ref = value +} +// SetRepo sets the repo property value. The repo property +func (m *PullRequest_base) SetRepo(value PullRequest_base_repoable)() { + m.repo = value +} +// SetSha sets the sha property value. The sha property +func (m *PullRequest_base) SetSha(value *string)() { + m.sha = value +} +// SetUser sets the user property value. The user property +func (m *PullRequest_base) SetUser(value PullRequest_base_userable)() { + m.user = value +} +type PullRequest_baseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabel()(*string) + GetRef()(*string) + GetRepo()(PullRequest_base_repoable) + GetSha()(*string) + GetUser()(PullRequest_base_userable) + SetLabel(value *string)() + SetRef(value *string)() + SetRepo(value PullRequest_base_repoable)() + SetSha(value *string)() + SetUser(value PullRequest_base_userable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_base_repo.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_base_repo.go new file mode 100644 index 000000000..8a5860461 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_base_repo.go @@ -0,0 +1,2523 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_base_repo struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The allow_forking property + allow_forking *bool + // The allow_merge_commit property + allow_merge_commit *bool + // The allow_rebase_merge property + allow_rebase_merge *bool + // The allow_squash_merge property + allow_squash_merge *bool + // The archive_url property + archive_url *string + // The archived property + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default_branch property + default_branch *string + // The deployments_url property + deployments_url *string + // The description property + description *string + // The disabled property + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // The has_discussions property + has_discussions *bool + // The has_downloads property + has_downloads *bool + // The has_issues property + has_issues *bool + // The has_pages property + has_pages *bool + // The has_projects property + has_projects *bool + // The has_wiki property + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The is_template property + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // License Simple + license NullableLicenseSimpleable + // The master_branch property + master_branch *string + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name property + name *string + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // The owner property + owner PullRequest_base_repo_ownerable + // The permissions property + permissions PullRequest_base_repo_permissionsable + // The private property + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The size property + size *int32 + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The statuses_url property + statuses_url *string + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The repository visibility: public, private, or internal. + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // The web_commit_signoff_required property + web_commit_signoff_required *bool +} +// NewPullRequest_base_repo instantiates a new PullRequest_base_repo and sets the default values. +func NewPullRequest_base_repo()(*PullRequest_base_repo) { + m := &PullRequest_base_repo{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_base_repoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_base_repoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_base_repo(), 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 *PullRequest_base_repo) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowForking gets the allow_forking property value. The allow_forking property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. The allow_merge_commit property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. The allow_rebase_merge property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. The allow_squash_merge property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetArchived gets the archived property value. The archived property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PullRequest_base_repo) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default_branch property +// returns a *string when successful +func (m *PullRequest_base_repo) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *PullRequest_base_repo) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. The disabled property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_base_repo) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableLicenseSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(NullableLicenseSimpleable)) + } + return nil + } + res["master_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMasterBranch(val) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_base_repo_ownerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(PullRequest_base_repo_ownerable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_base_repo_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(PullRequest_base_repo_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["topics"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *PullRequest_base_repo) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDiscussions gets the has_discussions property value. The has_discussions property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. The has_downloads property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. The has_issues property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. The has_projects property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. The has_wiki property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *PullRequest_base_repo) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetId()(*int32) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. The is_template property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *PullRequest_base_repo) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. License Simple +// returns a NullableLicenseSimpleable when successful +func (m *PullRequest_base_repo) GetLicense()(NullableLicenseSimpleable) { + return m.license +} +// GetMasterBranch gets the master_branch property value. The master_branch property +// returns a *string when successful +func (m *PullRequest_base_repo) GetMasterBranch()(*string) { + return m.master_branch +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PullRequest_base_repo) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest_base_repo) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. The owner property +// returns a PullRequest_base_repo_ownerable when successful +func (m *PullRequest_base_repo) GetOwner()(PullRequest_base_repo_ownerable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a PullRequest_base_repo_permissionsable when successful +func (m *PullRequest_base_repo) GetPermissions()(PullRequest_base_repo_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. The private property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *PullRequest_base_repo) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetSize()(*int32) { + return m.size +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *PullRequest_base_repo) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *PullRequest_base_repo) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PullRequest_base_repo) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetUrl()(*string) { + return m.url +} +// GetVisibility gets the visibility property value. The repository visibility: public, private, or internal. +// returns a *string when successful +func (m *PullRequest_base_repo) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. The web_commit_signoff_required property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *PullRequest_base_repo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("master_branch", m.GetMasterBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *PullRequest_base_repo) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowForking sets the allow_forking property value. The allow_forking property +func (m *PullRequest_base_repo) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. The allow_merge_commit property +func (m *PullRequest_base_repo) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. The allow_rebase_merge property +func (m *PullRequest_base_repo) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. The allow_squash_merge property +func (m *PullRequest_base_repo) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetArchived sets the archived property value. The archived property +func (m *PullRequest_base_repo) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *PullRequest_base_repo) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *PullRequest_base_repo) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *PullRequest_base_repo) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *PullRequest_base_repo) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *PullRequest_base_repo) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *PullRequest_base_repo) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *PullRequest_base_repo) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *PullRequest_base_repo) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *PullRequest_base_repo) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *PullRequest_base_repo) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *PullRequest_base_repo) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PullRequest_base_repo) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default_branch property +func (m *PullRequest_base_repo) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *PullRequest_base_repo) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *PullRequest_base_repo) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. The disabled property +func (m *PullRequest_base_repo) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *PullRequest_base_repo) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *PullRequest_base_repo) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *PullRequest_base_repo) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *PullRequest_base_repo) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *PullRequest_base_repo) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *PullRequest_base_repo) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *PullRequest_base_repo) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *PullRequest_base_repo) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *PullRequest_base_repo) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *PullRequest_base_repo) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *PullRequest_base_repo) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDiscussions sets the has_discussions property value. The has_discussions property +func (m *PullRequest_base_repo) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. The has_downloads property +func (m *PullRequest_base_repo) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. The has_issues property +func (m *PullRequest_base_repo) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *PullRequest_base_repo) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. The has_projects property +func (m *PullRequest_base_repo) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. The has_wiki property +func (m *PullRequest_base_repo) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *PullRequest_base_repo) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *PullRequest_base_repo) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequest_base_repo) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PullRequest_base_repo) SetId(value *int32)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *PullRequest_base_repo) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *PullRequest_base_repo) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *PullRequest_base_repo) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. The is_template property +func (m *PullRequest_base_repo) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *PullRequest_base_repo) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *PullRequest_base_repo) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *PullRequest_base_repo) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *PullRequest_base_repo) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. License Simple +func (m *PullRequest_base_repo) SetLicense(value NullableLicenseSimpleable)() { + m.license = value +} +// SetMasterBranch sets the master_branch property value. The master_branch property +func (m *PullRequest_base_repo) SetMasterBranch(value *string)() { + m.master_branch = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *PullRequest_base_repo) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *PullRequest_base_repo) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *PullRequest_base_repo) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name property +func (m *PullRequest_base_repo) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest_base_repo) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *PullRequest_base_repo) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *PullRequest_base_repo) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *PullRequest_base_repo) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. The owner property +func (m *PullRequest_base_repo) SetOwner(value PullRequest_base_repo_ownerable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *PullRequest_base_repo) SetPermissions(value PullRequest_base_repo_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. The private property +func (m *PullRequest_base_repo) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *PullRequest_base_repo) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *PullRequest_base_repo) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *PullRequest_base_repo) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetSize sets the size property value. The size property +func (m *PullRequest_base_repo) SetSize(value *int32)() { + m.size = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *PullRequest_base_repo) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *PullRequest_base_repo) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *PullRequest_base_repo) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *PullRequest_base_repo) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *PullRequest_base_repo) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *PullRequest_base_repo) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *PullRequest_base_repo) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *PullRequest_base_repo) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *PullRequest_base_repo) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *PullRequest_base_repo) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTopics sets the topics property value. The topics property +func (m *PullRequest_base_repo) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *PullRequest_base_repo) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PullRequest_base_repo) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest_base_repo) SetUrl(value *string)() { + m.url = value +} +// SetVisibility sets the visibility property value. The repository visibility: public, private, or internal. +func (m *PullRequest_base_repo) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *PullRequest_base_repo) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *PullRequest_base_repo) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. The web_commit_signoff_required property +func (m *PullRequest_base_repo) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type PullRequest_base_repoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultBranch()(*string) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(NullableLicenseSimpleable) + GetMasterBranch()(*string) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOwner()(PullRequest_base_repo_ownerable) + GetPermissions()(PullRequest_base_repo_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetSize()(*int32) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultBranch(value *string)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value NullableLicenseSimpleable)() + SetMasterBranch(value *string)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOwner(value PullRequest_base_repo_ownerable)() + SetPermissions(value PullRequest_base_repo_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetSize(value *int32)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_base_repo_owner.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_base_repo_owner.go new file mode 100644 index 000000000..80915d117 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_base_repo_owner.go @@ -0,0 +1,573 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_base_repo_owner struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int32 + // The login property + login *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewPullRequest_base_repo_owner instantiates a new PullRequest_base_repo_owner and sets the default values. +func NewPullRequest_base_repo_owner()(*PullRequest_base_repo_owner) { + m := &PullRequest_base_repo_owner{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_base_repo_ownerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_base_repo_ownerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_base_repo_owner(), 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 *PullRequest_base_repo_owner) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_base_repo_owner) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *PullRequest_base_repo_owner) GetId()(*int32) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetLogin()(*string) { + return m.login +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *PullRequest_base_repo_owner) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequest_base_repo_owner) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequest_base_repo_owner) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *PullRequest_base_repo_owner) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *PullRequest_base_repo_owner) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *PullRequest_base_repo_owner) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *PullRequest_base_repo_owner) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *PullRequest_base_repo_owner) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *PullRequest_base_repo_owner) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequest_base_repo_owner) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PullRequest_base_repo_owner) SetId(value *int32)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *PullRequest_base_repo_owner) SetLogin(value *string)() { + m.login = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest_base_repo_owner) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *PullRequest_base_repo_owner) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *PullRequest_base_repo_owner) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *PullRequest_base_repo_owner) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *PullRequest_base_repo_owner) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *PullRequest_base_repo_owner) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *PullRequest_base_repo_owner) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *PullRequest_base_repo_owner) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest_base_repo_owner) SetUrl(value *string)() { + m.url = value +} +type PullRequest_base_repo_ownerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLogin()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLogin(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_base_repo_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_base_repo_permissions.go new file mode 100644 index 000000000..65df8f052 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_base_repo_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_base_repo_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewPullRequest_base_repo_permissions instantiates a new PullRequest_base_repo_permissions and sets the default values. +func NewPullRequest_base_repo_permissions()(*PullRequest_base_repo_permissions) { + m := &PullRequest_base_repo_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_base_repo_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_base_repo_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_base_repo_permissions(), 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 *PullRequest_base_repo_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *PullRequest_base_repo_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_base_repo_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *PullRequest_base_repo_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *PullRequest_base_repo_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *PullRequest_base_repo_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *PullRequest_base_repo_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *PullRequest_base_repo_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *PullRequest_base_repo_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *PullRequest_base_repo_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *PullRequest_base_repo_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *PullRequest_base_repo_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *PullRequest_base_repo_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *PullRequest_base_repo_permissions) SetTriage(value *bool)() { + m.triage = value +} +type PullRequest_base_repo_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_base_user.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_base_user.go new file mode 100644 index 000000000..dfc31c569 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_base_user.go @@ -0,0 +1,573 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_base_user struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int64 + // The login property + login *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewPullRequest_base_user instantiates a new PullRequest_base_user and sets the default values. +func NewPullRequest_base_user()(*PullRequest_base_user) { + m := &PullRequest_base_user{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_base_userFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_base_userFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_base_user(), 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 *PullRequest_base_user) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_base_user) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *PullRequest_base_user) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequest_base_user) GetId()(*int64) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *PullRequest_base_user) GetLogin()(*string) { + return m.login +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest_base_user) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *PullRequest_base_user) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *PullRequest_base_user) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest_base_user) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequest_base_user) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequest_base_user) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *PullRequest_base_user) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *PullRequest_base_user) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *PullRequest_base_user) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *PullRequest_base_user) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *PullRequest_base_user) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *PullRequest_base_user) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequest_base_user) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PullRequest_base_user) SetId(value *int64)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *PullRequest_base_user) SetLogin(value *string)() { + m.login = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest_base_user) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *PullRequest_base_user) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *PullRequest_base_user) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *PullRequest_base_user) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *PullRequest_base_user) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *PullRequest_base_user) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *PullRequest_base_user) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *PullRequest_base_user) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest_base_user) SetUrl(value *string)() { + m.url = value +} +type PullRequest_base_userable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLogin()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLogin(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head.go new file mode 100644 index 000000000..b5a049bd6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_head struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The label property + label *string + // The ref property + ref *string + // The repo property + repo PullRequest_head_repoable + // The sha property + sha *string + // The user property + user PullRequest_head_userable +} +// NewPullRequest_head instantiates a new PullRequest_head and sets the default values. +func NewPullRequest_head()(*PullRequest_head) { + m := &PullRequest_head{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_headFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_headFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_head(), 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 *PullRequest_head) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_head) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabel(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_head_repoFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepo(val.(PullRequest_head_repoable)) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_head_userFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(PullRequest_head_userable)) + } + return nil + } + return res +} +// GetLabel gets the label property value. The label property +// returns a *string when successful +func (m *PullRequest_head) GetLabel()(*string) { + return m.label +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *PullRequest_head) GetRef()(*string) { + return m.ref +} +// GetRepo gets the repo property value. The repo property +// returns a PullRequest_head_repoable when successful +func (m *PullRequest_head) GetRepo()(PullRequest_head_repoable) { + return m.repo +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *PullRequest_head) GetSha()(*string) { + return m.sha +} +// GetUser gets the user property value. The user property +// returns a PullRequest_head_userable when successful +func (m *PullRequest_head) GetUser()(PullRequest_head_userable) { + return m.user +} +// Serialize serializes information the current object +func (m *PullRequest_head) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repo", m.GetRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *PullRequest_head) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabel sets the label property value. The label property +func (m *PullRequest_head) SetLabel(value *string)() { + m.label = value +} +// SetRef sets the ref property value. The ref property +func (m *PullRequest_head) SetRef(value *string)() { + m.ref = value +} +// SetRepo sets the repo property value. The repo property +func (m *PullRequest_head) SetRepo(value PullRequest_head_repoable)() { + m.repo = value +} +// SetSha sets the sha property value. The sha property +func (m *PullRequest_head) SetSha(value *string)() { + m.sha = value +} +// SetUser sets the user property value. The user property +func (m *PullRequest_head) SetUser(value PullRequest_head_userable)() { + m.user = value +} +type PullRequest_headable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabel()(*string) + GetRef()(*string) + GetRepo()(PullRequest_head_repoable) + GetSha()(*string) + GetUser()(PullRequest_head_userable) + SetLabel(value *string)() + SetRef(value *string)() + SetRepo(value PullRequest_head_repoable)() + SetSha(value *string)() + SetUser(value PullRequest_head_userable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head_repo.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head_repo.go new file mode 100644 index 000000000..6a6fe9ad3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head_repo.go @@ -0,0 +1,2523 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_head_repo struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The allow_forking property + allow_forking *bool + // The allow_merge_commit property + allow_merge_commit *bool + // The allow_rebase_merge property + allow_rebase_merge *bool + // The allow_squash_merge property + allow_squash_merge *bool + // The archive_url property + archive_url *string + // The archived property + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default_branch property + default_branch *string + // The deployments_url property + deployments_url *string + // The description property + description *string + // The disabled property + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // The has_discussions property + has_discussions *bool + // The has_downloads property + has_downloads *bool + // The has_issues property + has_issues *bool + // The has_pages property + has_pages *bool + // The has_projects property + has_projects *bool + // The has_wiki property + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The is_template property + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // The license property + license PullRequest_head_repo_licenseable + // The master_branch property + master_branch *string + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name property + name *string + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // The owner property + owner PullRequest_head_repo_ownerable + // The permissions property + permissions PullRequest_head_repo_permissionsable + // The private property + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The size property + size *int32 + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The statuses_url property + statuses_url *string + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The repository visibility: public, private, or internal. + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // The web_commit_signoff_required property + web_commit_signoff_required *bool +} +// NewPullRequest_head_repo instantiates a new PullRequest_head_repo and sets the default values. +func NewPullRequest_head_repo()(*PullRequest_head_repo) { + m := &PullRequest_head_repo{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_head_repoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_head_repoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_head_repo(), 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 *PullRequest_head_repo) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowForking gets the allow_forking property value. The allow_forking property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. The allow_merge_commit property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. The allow_rebase_merge property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. The allow_squash_merge property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetArchived gets the archived property value. The archived property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PullRequest_head_repo) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default_branch property +// returns a *string when successful +func (m *PullRequest_head_repo) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *PullRequest_head_repo) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. The disabled property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_head_repo) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_head_repo_licenseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(PullRequest_head_repo_licenseable)) + } + return nil + } + res["master_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMasterBranch(val) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_head_repo_ownerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(PullRequest_head_repo_ownerable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_head_repo_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(PullRequest_head_repo_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["topics"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *PullRequest_head_repo) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDiscussions gets the has_discussions property value. The has_discussions property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. The has_downloads property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. The has_issues property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. The has_projects property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. The has_wiki property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *PullRequest_head_repo) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetId()(*int32) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. The is_template property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *PullRequest_head_repo) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. The license property +// returns a PullRequest_head_repo_licenseable when successful +func (m *PullRequest_head_repo) GetLicense()(PullRequest_head_repo_licenseable) { + return m.license +} +// GetMasterBranch gets the master_branch property value. The master_branch property +// returns a *string when successful +func (m *PullRequest_head_repo) GetMasterBranch()(*string) { + return m.master_branch +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PullRequest_head_repo) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest_head_repo) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. The owner property +// returns a PullRequest_head_repo_ownerable when successful +func (m *PullRequest_head_repo) GetOwner()(PullRequest_head_repo_ownerable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a PullRequest_head_repo_permissionsable when successful +func (m *PullRequest_head_repo) GetPermissions()(PullRequest_head_repo_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. The private property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *PullRequest_head_repo) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetSize()(*int32) { + return m.size +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *PullRequest_head_repo) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *PullRequest_head_repo) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PullRequest_head_repo) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetUrl()(*string) { + return m.url +} +// GetVisibility gets the visibility property value. The repository visibility: public, private, or internal. +// returns a *string when successful +func (m *PullRequest_head_repo) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. The web_commit_signoff_required property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *PullRequest_head_repo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("master_branch", m.GetMasterBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *PullRequest_head_repo) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowForking sets the allow_forking property value. The allow_forking property +func (m *PullRequest_head_repo) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. The allow_merge_commit property +func (m *PullRequest_head_repo) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. The allow_rebase_merge property +func (m *PullRequest_head_repo) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. The allow_squash_merge property +func (m *PullRequest_head_repo) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetArchived sets the archived property value. The archived property +func (m *PullRequest_head_repo) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *PullRequest_head_repo) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *PullRequest_head_repo) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *PullRequest_head_repo) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *PullRequest_head_repo) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *PullRequest_head_repo) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *PullRequest_head_repo) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *PullRequest_head_repo) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *PullRequest_head_repo) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *PullRequest_head_repo) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *PullRequest_head_repo) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *PullRequest_head_repo) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PullRequest_head_repo) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default_branch property +func (m *PullRequest_head_repo) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *PullRequest_head_repo) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *PullRequest_head_repo) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. The disabled property +func (m *PullRequest_head_repo) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *PullRequest_head_repo) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *PullRequest_head_repo) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *PullRequest_head_repo) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *PullRequest_head_repo) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *PullRequest_head_repo) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *PullRequest_head_repo) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *PullRequest_head_repo) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *PullRequest_head_repo) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *PullRequest_head_repo) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *PullRequest_head_repo) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *PullRequest_head_repo) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDiscussions sets the has_discussions property value. The has_discussions property +func (m *PullRequest_head_repo) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. The has_downloads property +func (m *PullRequest_head_repo) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. The has_issues property +func (m *PullRequest_head_repo) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *PullRequest_head_repo) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. The has_projects property +func (m *PullRequest_head_repo) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. The has_wiki property +func (m *PullRequest_head_repo) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *PullRequest_head_repo) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *PullRequest_head_repo) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequest_head_repo) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PullRequest_head_repo) SetId(value *int32)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *PullRequest_head_repo) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *PullRequest_head_repo) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *PullRequest_head_repo) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. The is_template property +func (m *PullRequest_head_repo) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *PullRequest_head_repo) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *PullRequest_head_repo) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *PullRequest_head_repo) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *PullRequest_head_repo) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. The license property +func (m *PullRequest_head_repo) SetLicense(value PullRequest_head_repo_licenseable)() { + m.license = value +} +// SetMasterBranch sets the master_branch property value. The master_branch property +func (m *PullRequest_head_repo) SetMasterBranch(value *string)() { + m.master_branch = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *PullRequest_head_repo) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *PullRequest_head_repo) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *PullRequest_head_repo) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name property +func (m *PullRequest_head_repo) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest_head_repo) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *PullRequest_head_repo) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *PullRequest_head_repo) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *PullRequest_head_repo) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. The owner property +func (m *PullRequest_head_repo) SetOwner(value PullRequest_head_repo_ownerable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *PullRequest_head_repo) SetPermissions(value PullRequest_head_repo_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. The private property +func (m *PullRequest_head_repo) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *PullRequest_head_repo) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *PullRequest_head_repo) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *PullRequest_head_repo) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetSize sets the size property value. The size property +func (m *PullRequest_head_repo) SetSize(value *int32)() { + m.size = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *PullRequest_head_repo) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *PullRequest_head_repo) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *PullRequest_head_repo) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *PullRequest_head_repo) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *PullRequest_head_repo) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *PullRequest_head_repo) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *PullRequest_head_repo) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *PullRequest_head_repo) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *PullRequest_head_repo) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *PullRequest_head_repo) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTopics sets the topics property value. The topics property +func (m *PullRequest_head_repo) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *PullRequest_head_repo) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PullRequest_head_repo) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest_head_repo) SetUrl(value *string)() { + m.url = value +} +// SetVisibility sets the visibility property value. The repository visibility: public, private, or internal. +func (m *PullRequest_head_repo) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *PullRequest_head_repo) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *PullRequest_head_repo) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. The web_commit_signoff_required property +func (m *PullRequest_head_repo) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type PullRequest_head_repoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultBranch()(*string) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(PullRequest_head_repo_licenseable) + GetMasterBranch()(*string) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOwner()(PullRequest_head_repo_ownerable) + GetPermissions()(PullRequest_head_repo_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetSize()(*int32) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultBranch(value *string)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value PullRequest_head_repo_licenseable)() + SetMasterBranch(value *string)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOwner(value PullRequest_head_repo_ownerable)() + SetPermissions(value PullRequest_head_repo_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetSize(value *int32)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head_repo_license.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head_repo_license.go new file mode 100644 index 000000000..fa29afcc8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head_repo_license.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_head_repo_license struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The key property + key *string + // The name property + name *string + // The node_id property + node_id *string + // The spdx_id property + spdx_id *string + // The url property + url *string +} +// NewPullRequest_head_repo_license instantiates a new PullRequest_head_repo_license and sets the default values. +func NewPullRequest_head_repo_license()(*PullRequest_head_repo_license) { + m := &PullRequest_head_repo_license{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_head_repo_licenseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_head_repo_licenseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_head_repo_license(), 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 *PullRequest_head_repo_license) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_head_repo_license) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["spdx_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSpdxId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *PullRequest_head_repo_license) GetKey()(*string) { + return m.key +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PullRequest_head_repo_license) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest_head_repo_license) GetNodeId()(*string) { + return m.node_id +} +// GetSpdxId gets the spdx_id property value. The spdx_id property +// returns a *string when successful +func (m *PullRequest_head_repo_license) GetSpdxId()(*string) { + return m.spdx_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest_head_repo_license) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequest_head_repo_license) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("spdx_id", m.GetSpdxId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequest_head_repo_license) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The key property +func (m *PullRequest_head_repo_license) SetKey(value *string)() { + m.key = value +} +// SetName sets the name property value. The name property +func (m *PullRequest_head_repo_license) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest_head_repo_license) SetNodeId(value *string)() { + m.node_id = value +} +// SetSpdxId sets the spdx_id property value. The spdx_id property +func (m *PullRequest_head_repo_license) SetSpdxId(value *string)() { + m.spdx_id = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest_head_repo_license) SetUrl(value *string)() { + m.url = value +} +type PullRequest_head_repo_licenseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetName()(*string) + GetNodeId()(*string) + GetSpdxId()(*string) + GetUrl()(*string) + SetKey(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetSpdxId(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head_repo_owner.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head_repo_owner.go new file mode 100644 index 000000000..fc90b908c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head_repo_owner.go @@ -0,0 +1,573 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_head_repo_owner struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int32 + // The login property + login *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewPullRequest_head_repo_owner instantiates a new PullRequest_head_repo_owner and sets the default values. +func NewPullRequest_head_repo_owner()(*PullRequest_head_repo_owner) { + m := &PullRequest_head_repo_owner{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_head_repo_ownerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_head_repo_ownerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_head_repo_owner(), 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 *PullRequest_head_repo_owner) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_head_repo_owner) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *PullRequest_head_repo_owner) GetId()(*int32) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetLogin()(*string) { + return m.login +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *PullRequest_head_repo_owner) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequest_head_repo_owner) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequest_head_repo_owner) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *PullRequest_head_repo_owner) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *PullRequest_head_repo_owner) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *PullRequest_head_repo_owner) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *PullRequest_head_repo_owner) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *PullRequest_head_repo_owner) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *PullRequest_head_repo_owner) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequest_head_repo_owner) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PullRequest_head_repo_owner) SetId(value *int32)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *PullRequest_head_repo_owner) SetLogin(value *string)() { + m.login = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest_head_repo_owner) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *PullRequest_head_repo_owner) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *PullRequest_head_repo_owner) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *PullRequest_head_repo_owner) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *PullRequest_head_repo_owner) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *PullRequest_head_repo_owner) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *PullRequest_head_repo_owner) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *PullRequest_head_repo_owner) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest_head_repo_owner) SetUrl(value *string)() { + m.url = value +} +type PullRequest_head_repo_ownerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLogin()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLogin(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head_repo_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head_repo_permissions.go new file mode 100644 index 000000000..fa9bee53a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head_repo_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_head_repo_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewPullRequest_head_repo_permissions instantiates a new PullRequest_head_repo_permissions and sets the default values. +func NewPullRequest_head_repo_permissions()(*PullRequest_head_repo_permissions) { + m := &PullRequest_head_repo_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_head_repo_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_head_repo_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_head_repo_permissions(), 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 *PullRequest_head_repo_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *PullRequest_head_repo_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_head_repo_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *PullRequest_head_repo_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *PullRequest_head_repo_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *PullRequest_head_repo_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *PullRequest_head_repo_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *PullRequest_head_repo_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *PullRequest_head_repo_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *PullRequest_head_repo_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *PullRequest_head_repo_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *PullRequest_head_repo_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *PullRequest_head_repo_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *PullRequest_head_repo_permissions) SetTriage(value *bool)() { + m.triage = value +} +type PullRequest_head_repo_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head_user.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head_user.go new file mode 100644 index 000000000..9dc93398b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_head_user.go @@ -0,0 +1,573 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_head_user struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int64 + // The login property + login *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewPullRequest_head_user instantiates a new PullRequest_head_user and sets the default values. +func NewPullRequest_head_user()(*PullRequest_head_user) { + m := &PullRequest_head_user{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_head_userFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_head_userFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_head_user(), 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 *PullRequest_head_user) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_head_user) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *PullRequest_head_user) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequest_head_user) GetId()(*int64) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *PullRequest_head_user) GetLogin()(*string) { + return m.login +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest_head_user) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *PullRequest_head_user) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *PullRequest_head_user) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest_head_user) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequest_head_user) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequest_head_user) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *PullRequest_head_user) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *PullRequest_head_user) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *PullRequest_head_user) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *PullRequest_head_user) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *PullRequest_head_user) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *PullRequest_head_user) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequest_head_user) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PullRequest_head_user) SetId(value *int64)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *PullRequest_head_user) SetLogin(value *string)() { + m.login = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest_head_user) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *PullRequest_head_user) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *PullRequest_head_user) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *PullRequest_head_user) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *PullRequest_head_user) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *PullRequest_head_user) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *PullRequest_head_user) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *PullRequest_head_user) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest_head_user) SetUrl(value *string)() { + m.url = value +} +type PullRequest_head_userable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLogin()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLogin(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_labels.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_labels.go new file mode 100644 index 000000000..c1f0e2869 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_labels.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_labels struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The color property + color *string + // The default property + defaultEscaped *bool + // The description property + description *string + // The id property + id *int64 + // The name property + name *string + // The node_id property + node_id *string + // The url property + url *string +} +// NewPullRequest_labels instantiates a new PullRequest_labels and sets the default values. +func NewPullRequest_labels()(*PullRequest_labels) { + m := &PullRequest_labels{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_labelsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_labelsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_labels(), 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 *PullRequest_labels) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The color property +// returns a *string when successful +func (m *PullRequest_labels) GetColor()(*string) { + return m.color +} +// GetDefaultEscaped gets the default property value. The default property +// returns a *bool when successful +func (m *PullRequest_labels) GetDefaultEscaped()(*bool) { + return m.defaultEscaped +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *PullRequest_labels) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_labels) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(val) + } + return nil + } + res["default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultEscaped(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequest_labels) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PullRequest_labels) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest_labels) GetNodeId()(*string) { + return m.node_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest_labels) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequest_labels) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("default", m.GetDefaultEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequest_labels) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The color property +func (m *PullRequest_labels) SetColor(value *string)() { + m.color = value +} +// SetDefaultEscaped sets the default property value. The default property +func (m *PullRequest_labels) SetDefaultEscaped(value *bool)() { + m.defaultEscaped = value +} +// SetDescription sets the description property value. The description property +func (m *PullRequest_labels) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. The id property +func (m *PullRequest_labels) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *PullRequest_labels) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest_labels) SetNodeId(value *string)() { + m.node_id = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest_labels) SetUrl(value *string)() { + m.url = value +} +type PullRequest_labelsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetDefaultEscaped()(*bool) + GetDescription()(*string) + GetId()(*int64) + GetName()(*string) + GetNodeId()(*string) + GetUrl()(*string) + SetColor(value *string)() + SetDefaultEscaped(value *bool)() + SetDescription(value *string)() + SetId(value *int64)() + SetName(value *string)() + SetNodeId(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_merge_result.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_merge_result.go new file mode 100644 index 000000000..69c858f29 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_merge_result.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PullRequestMergeResult pull Request Merge Result +type PullRequestMergeResult struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The merged property + merged *bool + // The message property + message *string + // The sha property + sha *string +} +// NewPullRequestMergeResult instantiates a new PullRequestMergeResult and sets the default values. +func NewPullRequestMergeResult()(*PullRequestMergeResult) { + m := &PullRequestMergeResult{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestMergeResultFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestMergeResultFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestMergeResult(), 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 *PullRequestMergeResult) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestMergeResult) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["merged"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMerged(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetMerged gets the merged property value. The merged property +// returns a *bool when successful +func (m *PullRequestMergeResult) GetMerged()(*bool) { + return m.merged +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *PullRequestMergeResult) GetMessage()(*string) { + return m.message +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *PullRequestMergeResult) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *PullRequestMergeResult) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("merged", m.GetMerged()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *PullRequestMergeResult) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMerged sets the merged property value. The merged property +func (m *PullRequestMergeResult) SetMerged(value *bool)() { + m.merged = value +} +// SetMessage sets the message property value. The message property +func (m *PullRequestMergeResult) SetMessage(value *string)() { + m.message = value +} +// SetSha sets the sha property value. The sha property +func (m *PullRequestMergeResult) SetSha(value *string)() { + m.sha = value +} +type PullRequestMergeResultable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMerged()(*bool) + GetMessage()(*string) + GetSha()(*string) + SetMerged(value *bool)() + SetMessage(value *string)() + SetSha(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_minimal.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_minimal.go new file mode 100644 index 000000000..d7c372cd6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_minimal.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestMinimal struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The base property + base PullRequestMinimal_baseable + // The head property + head PullRequestMinimal_headable + // The id property + id *int64 + // The number property + number *int32 + // The url property + url *string +} +// NewPullRequestMinimal instantiates a new PullRequestMinimal and sets the default values. +func NewPullRequestMinimal()(*PullRequestMinimal) { + m := &PullRequestMinimal{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestMinimalFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestMinimalFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestMinimal(), 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 *PullRequestMinimal) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBase gets the base property value. The base property +// returns a PullRequestMinimal_baseable when successful +func (m *PullRequestMinimal) GetBase()(PullRequestMinimal_baseable) { + return m.base +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestMinimal) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["base"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestMinimal_baseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBase(val.(PullRequestMinimal_baseable)) + } + return nil + } + res["head"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestMinimal_headFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHead(val.(PullRequestMinimal_headable)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHead gets the head property value. The head property +// returns a PullRequestMinimal_headable when successful +func (m *PullRequestMinimal) GetHead()(PullRequestMinimal_headable) { + return m.head +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequestMinimal) GetId()(*int64) { + return m.id +} +// GetNumber gets the number property value. The number property +// returns a *int32 when successful +func (m *PullRequestMinimal) GetNumber()(*int32) { + return m.number +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequestMinimal) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequestMinimal) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("base", m.GetBase()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("head", m.GetHead()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequestMinimal) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBase sets the base property value. The base property +func (m *PullRequestMinimal) SetBase(value PullRequestMinimal_baseable)() { + m.base = value +} +// SetHead sets the head property value. The head property +func (m *PullRequestMinimal) SetHead(value PullRequestMinimal_headable)() { + m.head = value +} +// SetId sets the id property value. The id property +func (m *PullRequestMinimal) SetId(value *int64)() { + m.id = value +} +// SetNumber sets the number property value. The number property +func (m *PullRequestMinimal) SetNumber(value *int32)() { + m.number = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequestMinimal) SetUrl(value *string)() { + m.url = value +} +type PullRequestMinimalable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBase()(PullRequestMinimal_baseable) + GetHead()(PullRequestMinimal_headable) + GetId()(*int64) + GetNumber()(*int32) + GetUrl()(*string) + SetBase(value PullRequestMinimal_baseable)() + SetHead(value PullRequestMinimal_headable)() + SetId(value *int64)() + SetNumber(value *int32)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_minimal_base.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_minimal_base.go new file mode 100644 index 000000000..c2475b8f2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_minimal_base.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestMinimal_base struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The ref property + ref *string + // The repo property + repo PullRequestMinimal_base_repoable + // The sha property + sha *string +} +// NewPullRequestMinimal_base instantiates a new PullRequestMinimal_base and sets the default values. +func NewPullRequestMinimal_base()(*PullRequestMinimal_base) { + m := &PullRequestMinimal_base{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestMinimal_baseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestMinimal_baseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestMinimal_base(), 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 *PullRequestMinimal_base) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestMinimal_base) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestMinimal_base_repoFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepo(val.(PullRequestMinimal_base_repoable)) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *PullRequestMinimal_base) GetRef()(*string) { + return m.ref +} +// GetRepo gets the repo property value. The repo property +// returns a PullRequestMinimal_base_repoable when successful +func (m *PullRequestMinimal_base) GetRepo()(PullRequestMinimal_base_repoable) { + return m.repo +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *PullRequestMinimal_base) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *PullRequestMinimal_base) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repo", m.GetRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *PullRequestMinimal_base) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRef sets the ref property value. The ref property +func (m *PullRequestMinimal_base) SetRef(value *string)() { + m.ref = value +} +// SetRepo sets the repo property value. The repo property +func (m *PullRequestMinimal_base) SetRepo(value PullRequestMinimal_base_repoable)() { + m.repo = value +} +// SetSha sets the sha property value. The sha property +func (m *PullRequestMinimal_base) SetSha(value *string)() { + m.sha = value +} +type PullRequestMinimal_baseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRef()(*string) + GetRepo()(PullRequestMinimal_base_repoable) + GetSha()(*string) + SetRef(value *string)() + SetRepo(value PullRequestMinimal_base_repoable)() + SetSha(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_minimal_base_repo.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_minimal_base_repo.go new file mode 100644 index 000000000..3651138f3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_minimal_base_repo.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestMinimal_base_repo struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int64 + // The name property + name *string + // The url property + url *string +} +// NewPullRequestMinimal_base_repo instantiates a new PullRequestMinimal_base_repo and sets the default values. +func NewPullRequestMinimal_base_repo()(*PullRequestMinimal_base_repo) { + m := &PullRequestMinimal_base_repo{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestMinimal_base_repoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestMinimal_base_repoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestMinimal_base_repo(), 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 *PullRequestMinimal_base_repo) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestMinimal_base_repo) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequestMinimal_base_repo) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PullRequestMinimal_base_repo) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequestMinimal_base_repo) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequestMinimal_base_repo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequestMinimal_base_repo) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *PullRequestMinimal_base_repo) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *PullRequestMinimal_base_repo) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequestMinimal_base_repo) SetUrl(value *string)() { + m.url = value +} +type PullRequestMinimal_base_repoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int64) + GetName()(*string) + GetUrl()(*string) + SetId(value *int64)() + SetName(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_minimal_head.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_minimal_head.go new file mode 100644 index 000000000..c8368738e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_minimal_head.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestMinimal_head struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The ref property + ref *string + // The repo property + repo PullRequestMinimal_head_repoable + // The sha property + sha *string +} +// NewPullRequestMinimal_head instantiates a new PullRequestMinimal_head and sets the default values. +func NewPullRequestMinimal_head()(*PullRequestMinimal_head) { + m := &PullRequestMinimal_head{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestMinimal_headFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestMinimal_headFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestMinimal_head(), 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 *PullRequestMinimal_head) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestMinimal_head) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestMinimal_head_repoFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepo(val.(PullRequestMinimal_head_repoable)) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *PullRequestMinimal_head) GetRef()(*string) { + return m.ref +} +// GetRepo gets the repo property value. The repo property +// returns a PullRequestMinimal_head_repoable when successful +func (m *PullRequestMinimal_head) GetRepo()(PullRequestMinimal_head_repoable) { + return m.repo +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *PullRequestMinimal_head) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *PullRequestMinimal_head) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repo", m.GetRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *PullRequestMinimal_head) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRef sets the ref property value. The ref property +func (m *PullRequestMinimal_head) SetRef(value *string)() { + m.ref = value +} +// SetRepo sets the repo property value. The repo property +func (m *PullRequestMinimal_head) SetRepo(value PullRequestMinimal_head_repoable)() { + m.repo = value +} +// SetSha sets the sha property value. The sha property +func (m *PullRequestMinimal_head) SetSha(value *string)() { + m.sha = value +} +type PullRequestMinimal_headable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRef()(*string) + GetRepo()(PullRequestMinimal_head_repoable) + GetSha()(*string) + SetRef(value *string)() + SetRepo(value PullRequestMinimal_head_repoable)() + SetSha(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_minimal_head_repo.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_minimal_head_repo.go new file mode 100644 index 000000000..8851842c4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_minimal_head_repo.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestMinimal_head_repo struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int64 + // The name property + name *string + // The url property + url *string +} +// NewPullRequestMinimal_head_repo instantiates a new PullRequestMinimal_head_repo and sets the default values. +func NewPullRequestMinimal_head_repo()(*PullRequestMinimal_head_repo) { + m := &PullRequestMinimal_head_repo{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestMinimal_head_repoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestMinimal_head_repoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestMinimal_head_repo(), 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 *PullRequestMinimal_head_repo) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestMinimal_head_repo) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequestMinimal_head_repo) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PullRequestMinimal_head_repo) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequestMinimal_head_repo) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequestMinimal_head_repo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequestMinimal_head_repo) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *PullRequestMinimal_head_repo) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *PullRequestMinimal_head_repo) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequestMinimal_head_repo) SetUrl(value *string)() { + m.url = value +} +type PullRequestMinimal_head_repoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int64) + GetName()(*string) + GetUrl()(*string) + SetId(value *int64)() + SetName(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review.go new file mode 100644 index 000000000..544ee8d60 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review.go @@ -0,0 +1,431 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PullRequestReview pull Request Reviews are reviews on pull requests. +type PullRequestReview struct { + // The _links property + _links PullRequestReview__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How the author is associated with the repository. + author_association *AuthorAssociation + // The text of the review. + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // A commit SHA for the review. If the commit object was garbage collected or forcibly deleted, then it no longer exists in Git and this value will be `null`. + commit_id *string + // The html_url property + html_url *string + // Unique identifier of the review + id *int32 + // The node_id property + node_id *string + // The pull_request_url property + pull_request_url *string + // The state property + state *string + // The submitted_at property + submitted_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + user NullableSimpleUserable +} +// NewPullRequestReview instantiates a new PullRequestReview and sets the default values. +func NewPullRequestReview()(*PullRequestReview) { + m := &PullRequestReview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReview(), 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 *PullRequestReview) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *PullRequestReview) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. The text of the review. +// returns a *string when successful +func (m *PullRequestReview) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *PullRequestReview) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *PullRequestReview) GetBodyText()(*string) { + return m.body_text +} +// GetCommitId gets the commit_id property value. A commit SHA for the review. If the commit object was garbage collected or forcibly deleted, then it no longer exists in Git and this value will be `null`. +// returns a *string when successful +func (m *PullRequestReview) GetCommitId()(*string) { + return m.commit_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestReview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestReview__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(PullRequestReview__linksable)) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["pull_request_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestUrl(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["submitted_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetSubmittedAt(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequestReview) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the review +// returns a *int32 when successful +func (m *PullRequestReview) GetId()(*int32) { + return m.id +} +// GetLinks gets the _links property value. The _links property +// returns a PullRequestReview__linksable when successful +func (m *PullRequestReview) GetLinks()(PullRequestReview__linksable) { + return m._links +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequestReview) GetNodeId()(*string) { + return m.node_id +} +// GetPullRequestUrl gets the pull_request_url property value. The pull_request_url property +// returns a *string when successful +func (m *PullRequestReview) GetPullRequestUrl()(*string) { + return m.pull_request_url +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *PullRequestReview) GetState()(*string) { + return m.state +} +// GetSubmittedAt gets the submitted_at property value. The submitted_at property +// returns a *Time when successful +func (m *PullRequestReview) GetSubmittedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.submitted_at +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PullRequestReview) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *PullRequestReview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pull_request_url", m.GetPullRequestUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("submitted_at", m.GetSubmittedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *PullRequestReview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *PullRequestReview) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. The text of the review. +func (m *PullRequestReview) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *PullRequestReview) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *PullRequestReview) SetBodyText(value *string)() { + m.body_text = value +} +// SetCommitId sets the commit_id property value. A commit SHA for the review. If the commit object was garbage collected or forcibly deleted, then it no longer exists in Git and this value will be `null`. +func (m *PullRequestReview) SetCommitId(value *string)() { + m.commit_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequestReview) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the review +func (m *PullRequestReview) SetId(value *int32)() { + m.id = value +} +// SetLinks sets the _links property value. The _links property +func (m *PullRequestReview) SetLinks(value PullRequestReview__linksable)() { + m._links = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequestReview) SetNodeId(value *string)() { + m.node_id = value +} +// SetPullRequestUrl sets the pull_request_url property value. The pull_request_url property +func (m *PullRequestReview) SetPullRequestUrl(value *string)() { + m.pull_request_url = value +} +// SetState sets the state property value. The state property +func (m *PullRequestReview) SetState(value *string)() { + m.state = value +} +// SetSubmittedAt sets the submitted_at property value. The submitted_at property +func (m *PullRequestReview) SetSubmittedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.submitted_at = value +} +// SetUser sets the user property value. A GitHub user. +func (m *PullRequestReview) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type PullRequestReviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetCommitId()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLinks()(PullRequestReview__linksable) + GetNodeId()(*string) + GetPullRequestUrl()(*string) + GetState()(*string) + GetSubmittedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUser()(NullableSimpleUserable) + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetCommitId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLinks(value PullRequestReview__linksable)() + SetNodeId(value *string)() + SetPullRequestUrl(value *string)() + SetState(value *string)() + SetSubmittedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUser(value NullableSimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review__links.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review__links.go new file mode 100644 index 000000000..bf661f43f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review__links.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestReview__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html property + html PullRequestReview__links_htmlable + // The pull_request property + pull_request PullRequestReview__links_pull_requestable +} +// NewPullRequestReview__links instantiates a new PullRequestReview__links and sets the default values. +func NewPullRequestReview__links()(*PullRequestReview__links) { + m := &PullRequestReview__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReview__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReview__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReview__links(), 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 *PullRequestReview__links) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestReview__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestReview__links_htmlFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHtml(val.(PullRequestReview__links_htmlable)) + } + return nil + } + res["pull_request"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestReview__links_pull_requestFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPullRequest(val.(PullRequestReview__links_pull_requestable)) + } + return nil + } + return res +} +// GetHtml gets the html property value. The html property +// returns a PullRequestReview__links_htmlable when successful +func (m *PullRequestReview__links) GetHtml()(PullRequestReview__links_htmlable) { + return m.html +} +// GetPullRequest gets the pull_request property value. The pull_request property +// returns a PullRequestReview__links_pull_requestable when successful +func (m *PullRequestReview__links) GetPullRequest()(PullRequestReview__links_pull_requestable) { + return m.pull_request +} +// Serialize serializes information the current object +func (m *PullRequestReview__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pull_request", m.GetPullRequest()) + 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 *PullRequestReview__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtml sets the html property value. The html property +func (m *PullRequestReview__links) SetHtml(value PullRequestReview__links_htmlable)() { + m.html = value +} +// SetPullRequest sets the pull_request property value. The pull_request property +func (m *PullRequestReview__links) SetPullRequest(value PullRequestReview__links_pull_requestable)() { + m.pull_request = value +} +type PullRequestReview__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtml()(PullRequestReview__links_htmlable) + GetPullRequest()(PullRequestReview__links_pull_requestable) + SetHtml(value PullRequestReview__links_htmlable)() + SetPullRequest(value PullRequestReview__links_pull_requestable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review__links_html.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review__links_html.go new file mode 100644 index 000000000..4dd6ceeab --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review__links_html.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestReview__links_html struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The href property + href *string +} +// NewPullRequestReview__links_html instantiates a new PullRequestReview__links_html and sets the default values. +func NewPullRequestReview__links_html()(*PullRequestReview__links_html) { + m := &PullRequestReview__links_html{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReview__links_htmlFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReview__links_htmlFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReview__links_html(), 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 *PullRequestReview__links_html) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestReview__links_html) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *PullRequestReview__links_html) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *PullRequestReview__links_html) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *PullRequestReview__links_html) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *PullRequestReview__links_html) SetHref(value *string)() { + m.href = value +} +type PullRequestReview__links_htmlable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review__links_pull_request.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review__links_pull_request.go new file mode 100644 index 000000000..3d58c6902 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review__links_pull_request.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestReview__links_pull_request struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The href property + href *string +} +// NewPullRequestReview__links_pull_request instantiates a new PullRequestReview__links_pull_request and sets the default values. +func NewPullRequestReview__links_pull_request()(*PullRequestReview__links_pull_request) { + m := &PullRequestReview__links_pull_request{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReview__links_pull_requestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReview__links_pull_requestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReview__links_pull_request(), 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 *PullRequestReview__links_pull_request) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestReview__links_pull_request) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *PullRequestReview__links_pull_request) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *PullRequestReview__links_pull_request) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *PullRequestReview__links_pull_request) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *PullRequestReview__links_pull_request) SetHref(value *string)() { + m.href = value +} +type PullRequestReview__links_pull_requestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment.go new file mode 100644 index 000000000..fcbc299d1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment.go @@ -0,0 +1,902 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PullRequestReviewComment pull Request Review Comments are comments on a portion of the Pull Request's diff. +type PullRequestReviewComment struct { + // The _links property + _links PullRequestReviewComment__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How the author is associated with the repository. + author_association *AuthorAssociation + // The text of the comment. + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // The SHA of the commit to which the comment applies. + commit_id *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The diff of the line that the comment refers to. + diff_hunk *string + // HTML URL for the pull request review comment. + html_url *string + // The ID of the pull request review comment. + id *int64 + // The comment ID to reply to. + in_reply_to_id *int32 + // The line of the blob to which the comment applies. The last line of the range for a multi-line comment + line *int32 + // The node ID of the pull request review comment. + node_id *string + // The SHA of the original commit to which the comment applies. + original_commit_id *string + // The line of the blob to which the comment applies. The last line of the range for a multi-line comment + original_line *int32 + // The index of the original line in the diff to which the comment applies. This field is deprecated; use `original_line` instead. + original_position *int32 + // The first line of the range for a multi-line comment. + original_start_line *int32 + // The relative path of the file to which the comment applies. + path *string + // The line index in the diff to which the comment applies. This field is deprecated; use `line` instead. + position *int32 + // The ID of the pull request review to which the comment belongs. + pull_request_review_id *int64 + // URL for the pull request that the review comment belongs to. + pull_request_url *string + // The reactions property + reactions ReactionRollupable + // The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment + side *PullRequestReviewComment_side + // The first line of the range for a multi-line comment. + start_line *int32 + // The side of the first line of the range for a multi-line comment. + start_side *PullRequestReviewComment_start_side + // The level at which the comment is targeted, can be a diff line or a file. + subject_type *PullRequestReviewComment_subject_type + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // URL for the pull request review comment + url *string + // A GitHub user. + user SimpleUserable +} +// NewPullRequestReviewComment instantiates a new PullRequestReviewComment and sets the default values. +func NewPullRequestReviewComment()(*PullRequestReviewComment) { + m := &PullRequestReviewComment{ + } + m.SetAdditionalData(make(map[string]any)) + sideValue := RIGHT_PULLREQUESTREVIEWCOMMENT_SIDE + m.SetSide(&sideValue) + start_sideValue := RIGHT_PULLREQUESTREVIEWCOMMENT_START_SIDE + m.SetStartSide(&start_sideValue) + return m +} +// CreatePullRequestReviewCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReviewCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReviewComment(), 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 *PullRequestReviewComment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *PullRequestReviewComment) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. The text of the comment. +// returns a *string when successful +func (m *PullRequestReviewComment) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *PullRequestReviewComment) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *PullRequestReviewComment) GetBodyText()(*string) { + return m.body_text +} +// GetCommitId gets the commit_id property value. The SHA of the commit to which the comment applies. +// returns a *string when successful +func (m *PullRequestReviewComment) GetCommitId()(*string) { + return m.commit_id +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PullRequestReviewComment) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDiffHunk gets the diff_hunk property value. The diff of the line that the comment refers to. +// returns a *string when successful +func (m *PullRequestReviewComment) GetDiffHunk()(*string) { + return m.diff_hunk +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestReviewComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestReviewComment__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(PullRequestReviewComment__linksable)) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["diff_hunk"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiffHunk(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["in_reply_to_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetInReplyToId(val) + } + return nil + } + res["line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLine(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["original_commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOriginalCommitId(val) + } + return nil + } + res["original_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOriginalLine(val) + } + return nil + } + res["original_position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOriginalPosition(val) + } + return nil + } + res["original_start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOriginalStartLine(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["position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPosition(val) + } + return nil + } + res["pull_request_review_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestReviewId(val) + } + return nil + } + res["pull_request_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestUrl(val) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["side"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePullRequestReviewComment_side) + if err != nil { + return err + } + if val != nil { + m.SetSide(val.(*PullRequestReviewComment_side)) + } + return nil + } + res["start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartLine(val) + } + return nil + } + res["start_side"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePullRequestReviewComment_start_side) + if err != nil { + return err + } + if val != nil { + m.SetStartSide(val.(*PullRequestReviewComment_start_side)) + } + return nil + } + res["subject_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePullRequestReviewComment_subject_type) + if err != nil { + return err + } + if val != nil { + m.SetSubjectType(val.(*PullRequestReviewComment_subject_type)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(SimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. HTML URL for the pull request review comment. +// returns a *string when successful +func (m *PullRequestReviewComment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The ID of the pull request review comment. +// returns a *int64 when successful +func (m *PullRequestReviewComment) GetId()(*int64) { + return m.id +} +// GetInReplyToId gets the in_reply_to_id property value. The comment ID to reply to. +// returns a *int32 when successful +func (m *PullRequestReviewComment) GetInReplyToId()(*int32) { + return m.in_reply_to_id +} +// GetLine gets the line property value. The line of the blob to which the comment applies. The last line of the range for a multi-line comment +// returns a *int32 when successful +func (m *PullRequestReviewComment) GetLine()(*int32) { + return m.line +} +// GetLinks gets the _links property value. The _links property +// returns a PullRequestReviewComment__linksable when successful +func (m *PullRequestReviewComment) GetLinks()(PullRequestReviewComment__linksable) { + return m._links +} +// GetNodeId gets the node_id property value. The node ID of the pull request review comment. +// returns a *string when successful +func (m *PullRequestReviewComment) GetNodeId()(*string) { + return m.node_id +} +// GetOriginalCommitId gets the original_commit_id property value. The SHA of the original commit to which the comment applies. +// returns a *string when successful +func (m *PullRequestReviewComment) GetOriginalCommitId()(*string) { + return m.original_commit_id +} +// GetOriginalLine gets the original_line property value. The line of the blob to which the comment applies. The last line of the range for a multi-line comment +// returns a *int32 when successful +func (m *PullRequestReviewComment) GetOriginalLine()(*int32) { + return m.original_line +} +// GetOriginalPosition gets the original_position property value. The index of the original line in the diff to which the comment applies. This field is deprecated; use `original_line` instead. +// returns a *int32 when successful +func (m *PullRequestReviewComment) GetOriginalPosition()(*int32) { + return m.original_position +} +// GetOriginalStartLine gets the original_start_line property value. The first line of the range for a multi-line comment. +// returns a *int32 when successful +func (m *PullRequestReviewComment) GetOriginalStartLine()(*int32) { + return m.original_start_line +} +// GetPath gets the path property value. The relative path of the file to which the comment applies. +// returns a *string when successful +func (m *PullRequestReviewComment) GetPath()(*string) { + return m.path +} +// GetPosition gets the position property value. The line index in the diff to which the comment applies. This field is deprecated; use `line` instead. +// returns a *int32 when successful +func (m *PullRequestReviewComment) GetPosition()(*int32) { + return m.position +} +// GetPullRequestReviewId gets the pull_request_review_id property value. The ID of the pull request review to which the comment belongs. +// returns a *int64 when successful +func (m *PullRequestReviewComment) GetPullRequestReviewId()(*int64) { + return m.pull_request_review_id +} +// GetPullRequestUrl gets the pull_request_url property value. URL for the pull request that the review comment belongs to. +// returns a *string when successful +func (m *PullRequestReviewComment) GetPullRequestUrl()(*string) { + return m.pull_request_url +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *PullRequestReviewComment) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetSide gets the side property value. The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment +// returns a *PullRequestReviewComment_side when successful +func (m *PullRequestReviewComment) GetSide()(*PullRequestReviewComment_side) { + return m.side +} +// GetStartLine gets the start_line property value. The first line of the range for a multi-line comment. +// returns a *int32 when successful +func (m *PullRequestReviewComment) GetStartLine()(*int32) { + return m.start_line +} +// GetStartSide gets the start_side property value. The side of the first line of the range for a multi-line comment. +// returns a *PullRequestReviewComment_start_side when successful +func (m *PullRequestReviewComment) GetStartSide()(*PullRequestReviewComment_start_side) { + return m.start_side +} +// GetSubjectType gets the subject_type property value. The level at which the comment is targeted, can be a diff line or a file. +// returns a *PullRequestReviewComment_subject_type when successful +func (m *PullRequestReviewComment) GetSubjectType()(*PullRequestReviewComment_subject_type) { + return m.subject_type +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PullRequestReviewComment) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. URL for the pull request review comment +// returns a *string when successful +func (m *PullRequestReviewComment) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *PullRequestReviewComment) GetUser()(SimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *PullRequestReviewComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("diff_hunk", m.GetDiffHunk()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("in_reply_to_id", m.GetInReplyToId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("line", m.GetLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("original_commit_id", m.GetOriginalCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("original_line", m.GetOriginalLine()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("original_position", m.GetOriginalPosition()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("original_start_line", m.GetOriginalStartLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("position", m.GetPosition()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("pull_request_review_id", m.GetPullRequestReviewId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pull_request_url", m.GetPullRequestUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + if m.GetSide() != nil { + cast := (*m.GetSide()).String() + err := writer.WriteStringValue("side", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("start_line", m.GetStartLine()) + if err != nil { + return err + } + } + if m.GetStartSide() != nil { + cast := (*m.GetStartSide()).String() + err := writer.WriteStringValue("start_side", &cast) + if err != nil { + return err + } + } + if m.GetSubjectType() != nil { + cast := (*m.GetSubjectType()).String() + err := writer.WriteStringValue("subject_type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *PullRequestReviewComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *PullRequestReviewComment) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. The text of the comment. +func (m *PullRequestReviewComment) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *PullRequestReviewComment) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *PullRequestReviewComment) SetBodyText(value *string)() { + m.body_text = value +} +// SetCommitId sets the commit_id property value. The SHA of the commit to which the comment applies. +func (m *PullRequestReviewComment) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PullRequestReviewComment) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDiffHunk sets the diff_hunk property value. The diff of the line that the comment refers to. +func (m *PullRequestReviewComment) SetDiffHunk(value *string)() { + m.diff_hunk = value +} +// SetHtmlUrl sets the html_url property value. HTML URL for the pull request review comment. +func (m *PullRequestReviewComment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The ID of the pull request review comment. +func (m *PullRequestReviewComment) SetId(value *int64)() { + m.id = value +} +// SetInReplyToId sets the in_reply_to_id property value. The comment ID to reply to. +func (m *PullRequestReviewComment) SetInReplyToId(value *int32)() { + m.in_reply_to_id = value +} +// SetLine sets the line property value. The line of the blob to which the comment applies. The last line of the range for a multi-line comment +func (m *PullRequestReviewComment) SetLine(value *int32)() { + m.line = value +} +// SetLinks sets the _links property value. The _links property +func (m *PullRequestReviewComment) SetLinks(value PullRequestReviewComment__linksable)() { + m._links = value +} +// SetNodeId sets the node_id property value. The node ID of the pull request review comment. +func (m *PullRequestReviewComment) SetNodeId(value *string)() { + m.node_id = value +} +// SetOriginalCommitId sets the original_commit_id property value. The SHA of the original commit to which the comment applies. +func (m *PullRequestReviewComment) SetOriginalCommitId(value *string)() { + m.original_commit_id = value +} +// SetOriginalLine sets the original_line property value. The line of the blob to which the comment applies. The last line of the range for a multi-line comment +func (m *PullRequestReviewComment) SetOriginalLine(value *int32)() { + m.original_line = value +} +// SetOriginalPosition sets the original_position property value. The index of the original line in the diff to which the comment applies. This field is deprecated; use `original_line` instead. +func (m *PullRequestReviewComment) SetOriginalPosition(value *int32)() { + m.original_position = value +} +// SetOriginalStartLine sets the original_start_line property value. The first line of the range for a multi-line comment. +func (m *PullRequestReviewComment) SetOriginalStartLine(value *int32)() { + m.original_start_line = value +} +// SetPath sets the path property value. The relative path of the file to which the comment applies. +func (m *PullRequestReviewComment) SetPath(value *string)() { + m.path = value +} +// SetPosition sets the position property value. The line index in the diff to which the comment applies. This field is deprecated; use `line` instead. +func (m *PullRequestReviewComment) SetPosition(value *int32)() { + m.position = value +} +// SetPullRequestReviewId sets the pull_request_review_id property value. The ID of the pull request review to which the comment belongs. +func (m *PullRequestReviewComment) SetPullRequestReviewId(value *int64)() { + m.pull_request_review_id = value +} +// SetPullRequestUrl sets the pull_request_url property value. URL for the pull request that the review comment belongs to. +func (m *PullRequestReviewComment) SetPullRequestUrl(value *string)() { + m.pull_request_url = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *PullRequestReviewComment) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetSide sets the side property value. The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment +func (m *PullRequestReviewComment) SetSide(value *PullRequestReviewComment_side)() { + m.side = value +} +// SetStartLine sets the start_line property value. The first line of the range for a multi-line comment. +func (m *PullRequestReviewComment) SetStartLine(value *int32)() { + m.start_line = value +} +// SetStartSide sets the start_side property value. The side of the first line of the range for a multi-line comment. +func (m *PullRequestReviewComment) SetStartSide(value *PullRequestReviewComment_start_side)() { + m.start_side = value +} +// SetSubjectType sets the subject_type property value. The level at which the comment is targeted, can be a diff line or a file. +func (m *PullRequestReviewComment) SetSubjectType(value *PullRequestReviewComment_subject_type)() { + m.subject_type = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PullRequestReviewComment) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. URL for the pull request review comment +func (m *PullRequestReviewComment) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *PullRequestReviewComment) SetUser(value SimpleUserable)() { + m.user = value +} +type PullRequestReviewCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetCommitId()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDiffHunk()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetInReplyToId()(*int32) + GetLine()(*int32) + GetLinks()(PullRequestReviewComment__linksable) + GetNodeId()(*string) + GetOriginalCommitId()(*string) + GetOriginalLine()(*int32) + GetOriginalPosition()(*int32) + GetOriginalStartLine()(*int32) + GetPath()(*string) + GetPosition()(*int32) + GetPullRequestReviewId()(*int64) + GetPullRequestUrl()(*string) + GetReactions()(ReactionRollupable) + GetSide()(*PullRequestReviewComment_side) + GetStartLine()(*int32) + GetStartSide()(*PullRequestReviewComment_start_side) + GetSubjectType()(*PullRequestReviewComment_subject_type) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(SimpleUserable) + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetCommitId(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDiffHunk(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetInReplyToId(value *int32)() + SetLine(value *int32)() + SetLinks(value PullRequestReviewComment__linksable)() + SetNodeId(value *string)() + SetOriginalCommitId(value *string)() + SetOriginalLine(value *int32)() + SetOriginalPosition(value *int32)() + SetOriginalStartLine(value *int32)() + SetPath(value *string)() + SetPosition(value *int32)() + SetPullRequestReviewId(value *int64)() + SetPullRequestUrl(value *string)() + SetReactions(value ReactionRollupable)() + SetSide(value *PullRequestReviewComment_side)() + SetStartLine(value *int32)() + SetStartSide(value *PullRequestReviewComment_start_side)() + SetSubjectType(value *PullRequestReviewComment_subject_type)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value SimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment__links.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment__links.go new file mode 100644 index 000000000..c5d7a9c72 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment__links.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestReviewComment__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html property + html PullRequestReviewComment__links_htmlable + // The pull_request property + pull_request PullRequestReviewComment__links_pull_requestable + // The self property + self PullRequestReviewComment__links_selfable +} +// NewPullRequestReviewComment__links instantiates a new PullRequestReviewComment__links and sets the default values. +func NewPullRequestReviewComment__links()(*PullRequestReviewComment__links) { + m := &PullRequestReviewComment__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReviewComment__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReviewComment__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReviewComment__links(), 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 *PullRequestReviewComment__links) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestReviewComment__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestReviewComment__links_htmlFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHtml(val.(PullRequestReviewComment__links_htmlable)) + } + return nil + } + res["pull_request"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestReviewComment__links_pull_requestFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPullRequest(val.(PullRequestReviewComment__links_pull_requestable)) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestReviewComment__links_selfFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSelf(val.(PullRequestReviewComment__links_selfable)) + } + return nil + } + return res +} +// GetHtml gets the html property value. The html property +// returns a PullRequestReviewComment__links_htmlable when successful +func (m *PullRequestReviewComment__links) GetHtml()(PullRequestReviewComment__links_htmlable) { + return m.html +} +// GetPullRequest gets the pull_request property value. The pull_request property +// returns a PullRequestReviewComment__links_pull_requestable when successful +func (m *PullRequestReviewComment__links) GetPullRequest()(PullRequestReviewComment__links_pull_requestable) { + return m.pull_request +} +// GetSelf gets the self property value. The self property +// returns a PullRequestReviewComment__links_selfable when successful +func (m *PullRequestReviewComment__links) GetSelf()(PullRequestReviewComment__links_selfable) { + return m.self +} +// Serialize serializes information the current object +func (m *PullRequestReviewComment__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pull_request", m.GetPullRequest()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("self", m.GetSelf()) + 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 *PullRequestReviewComment__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtml sets the html property value. The html property +func (m *PullRequestReviewComment__links) SetHtml(value PullRequestReviewComment__links_htmlable)() { + m.html = value +} +// SetPullRequest sets the pull_request property value. The pull_request property +func (m *PullRequestReviewComment__links) SetPullRequest(value PullRequestReviewComment__links_pull_requestable)() { + m.pull_request = value +} +// SetSelf sets the self property value. The self property +func (m *PullRequestReviewComment__links) SetSelf(value PullRequestReviewComment__links_selfable)() { + m.self = value +} +type PullRequestReviewComment__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtml()(PullRequestReviewComment__links_htmlable) + GetPullRequest()(PullRequestReviewComment__links_pull_requestable) + GetSelf()(PullRequestReviewComment__links_selfable) + SetHtml(value PullRequestReviewComment__links_htmlable)() + SetPullRequest(value PullRequestReviewComment__links_pull_requestable)() + SetSelf(value PullRequestReviewComment__links_selfable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment__links_html.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment__links_html.go new file mode 100644 index 000000000..d29426138 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment__links_html.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestReviewComment__links_html struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The href property + href *string +} +// NewPullRequestReviewComment__links_html instantiates a new PullRequestReviewComment__links_html and sets the default values. +func NewPullRequestReviewComment__links_html()(*PullRequestReviewComment__links_html) { + m := &PullRequestReviewComment__links_html{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReviewComment__links_htmlFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReviewComment__links_htmlFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReviewComment__links_html(), 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 *PullRequestReviewComment__links_html) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestReviewComment__links_html) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *PullRequestReviewComment__links_html) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *PullRequestReviewComment__links_html) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *PullRequestReviewComment__links_html) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *PullRequestReviewComment__links_html) SetHref(value *string)() { + m.href = value +} +type PullRequestReviewComment__links_htmlable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment__links_pull_request.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment__links_pull_request.go new file mode 100644 index 000000000..b7d904cb3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment__links_pull_request.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestReviewComment__links_pull_request struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The href property + href *string +} +// NewPullRequestReviewComment__links_pull_request instantiates a new PullRequestReviewComment__links_pull_request and sets the default values. +func NewPullRequestReviewComment__links_pull_request()(*PullRequestReviewComment__links_pull_request) { + m := &PullRequestReviewComment__links_pull_request{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReviewComment__links_pull_requestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReviewComment__links_pull_requestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReviewComment__links_pull_request(), 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 *PullRequestReviewComment__links_pull_request) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestReviewComment__links_pull_request) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *PullRequestReviewComment__links_pull_request) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *PullRequestReviewComment__links_pull_request) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *PullRequestReviewComment__links_pull_request) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *PullRequestReviewComment__links_pull_request) SetHref(value *string)() { + m.href = value +} +type PullRequestReviewComment__links_pull_requestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment__links_self.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment__links_self.go new file mode 100644 index 000000000..ae145723e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment__links_self.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestReviewComment__links_self struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The href property + href *string +} +// NewPullRequestReviewComment__links_self instantiates a new PullRequestReviewComment__links_self and sets the default values. +func NewPullRequestReviewComment__links_self()(*PullRequestReviewComment__links_self) { + m := &PullRequestReviewComment__links_self{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReviewComment__links_selfFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReviewComment__links_selfFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReviewComment__links_self(), 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 *PullRequestReviewComment__links_self) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestReviewComment__links_self) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *PullRequestReviewComment__links_self) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *PullRequestReviewComment__links_self) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *PullRequestReviewComment__links_self) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *PullRequestReviewComment__links_self) SetHref(value *string)() { + m.href = value +} +type PullRequestReviewComment__links_selfable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment_side.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment_side.go new file mode 100644 index 000000000..b94739b7b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment_side.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment +type PullRequestReviewComment_side int + +const ( + LEFT_PULLREQUESTREVIEWCOMMENT_SIDE PullRequestReviewComment_side = iota + RIGHT_PULLREQUESTREVIEWCOMMENT_SIDE +) + +func (i PullRequestReviewComment_side) String() string { + return []string{"LEFT", "RIGHT"}[i] +} +func ParsePullRequestReviewComment_side(v string) (any, error) { + result := LEFT_PULLREQUESTREVIEWCOMMENT_SIDE + switch v { + case "LEFT": + result = LEFT_PULLREQUESTREVIEWCOMMENT_SIDE + case "RIGHT": + result = RIGHT_PULLREQUESTREVIEWCOMMENT_SIDE + default: + return 0, errors.New("Unknown PullRequestReviewComment_side value: " + v) + } + return &result, nil +} +func SerializePullRequestReviewComment_side(values []PullRequestReviewComment_side) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PullRequestReviewComment_side) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment_start_side.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment_start_side.go new file mode 100644 index 000000000..a65835194 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment_start_side.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The side of the first line of the range for a multi-line comment. +type PullRequestReviewComment_start_side int + +const ( + LEFT_PULLREQUESTREVIEWCOMMENT_START_SIDE PullRequestReviewComment_start_side = iota + RIGHT_PULLREQUESTREVIEWCOMMENT_START_SIDE +) + +func (i PullRequestReviewComment_start_side) String() string { + return []string{"LEFT", "RIGHT"}[i] +} +func ParsePullRequestReviewComment_start_side(v string) (any, error) { + result := LEFT_PULLREQUESTREVIEWCOMMENT_START_SIDE + switch v { + case "LEFT": + result = LEFT_PULLREQUESTREVIEWCOMMENT_START_SIDE + case "RIGHT": + result = RIGHT_PULLREQUESTREVIEWCOMMENT_START_SIDE + default: + return 0, errors.New("Unknown PullRequestReviewComment_start_side value: " + v) + } + return &result, nil +} +func SerializePullRequestReviewComment_start_side(values []PullRequestReviewComment_start_side) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PullRequestReviewComment_start_side) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment_subject_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment_subject_type.go new file mode 100644 index 000000000..deb3ad4c3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_comment_subject_type.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level at which the comment is targeted, can be a diff line or a file. +type PullRequestReviewComment_subject_type int + +const ( + LINE_PULLREQUESTREVIEWCOMMENT_SUBJECT_TYPE PullRequestReviewComment_subject_type = iota + FILE_PULLREQUESTREVIEWCOMMENT_SUBJECT_TYPE +) + +func (i PullRequestReviewComment_subject_type) String() string { + return []string{"line", "file"}[i] +} +func ParsePullRequestReviewComment_subject_type(v string) (any, error) { + result := LINE_PULLREQUESTREVIEWCOMMENT_SUBJECT_TYPE + switch v { + case "line": + result = LINE_PULLREQUESTREVIEWCOMMENT_SUBJECT_TYPE + case "file": + result = FILE_PULLREQUESTREVIEWCOMMENT_SUBJECT_TYPE + default: + return 0, errors.New("Unknown PullRequestReviewComment_subject_type value: " + v) + } + return &result, nil +} +func SerializePullRequestReviewComment_subject_type(values []PullRequestReviewComment_subject_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PullRequestReviewComment_subject_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_request.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_request.go new file mode 100644 index 000000000..3b52ba389 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_review_request.go @@ -0,0 +1,134 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PullRequestReviewRequest pull Request Review Request +type PullRequestReviewRequest struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The teams property + teams []Teamable + // The users property + users []SimpleUserable +} +// NewPullRequestReviewRequest instantiates a new PullRequestReviewRequest and sets the default values. +func NewPullRequestReviewRequest()(*PullRequestReviewRequest) { + m := &PullRequestReviewRequest{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReviewRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReviewRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReviewRequest(), 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 *PullRequestReviewRequest) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestReviewRequest) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Teamable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Teamable) + } + } + m.SetTeams(res) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetUsers(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The teams property +// returns a []Teamable when successful +func (m *PullRequestReviewRequest) GetTeams()([]Teamable) { + return m.teams +} +// GetUsers gets the users property value. The users property +// returns a []SimpleUserable when successful +func (m *PullRequestReviewRequest) GetUsers()([]SimpleUserable) { + return m.users +} +// Serialize serializes information the current object +func (m *PullRequestReviewRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTeams())) + for i, v := range m.GetTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("teams", cast) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetUsers())) + for i, v := range m.GetUsers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("users", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *PullRequestReviewRequest) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTeams sets the teams property value. The teams property +func (m *PullRequestReviewRequest) SetTeams(value []Teamable)() { + m.teams = value +} +// SetUsers sets the users property value. The users property +func (m *PullRequestReviewRequest) SetUsers(value []SimpleUserable)() { + m.users = value +} +type PullRequestReviewRequestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTeams()([]Teamable) + GetUsers()([]SimpleUserable) + SetTeams(value []Teamable)() + SetUsers(value []SimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_simple.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_simple.go new file mode 100644 index 000000000..eea899388 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_simple.go @@ -0,0 +1,1146 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PullRequestSimple pull Request Simple +type PullRequestSimple struct { + // The _links property + _links PullRequestSimple__linksable + // The active_lock_reason property + active_lock_reason *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee NullableSimpleUserable + // The assignees property + assignees []SimpleUserable + // How the author is associated with the repository. + author_association *AuthorAssociation + // The status of auto merging a pull request. + auto_merge AutoMergeable + // The base property + base PullRequestSimple_baseable + // The body property + body *string + // The closed_at property + closed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The diff_url property + diff_url *string + // Indicates whether or not the pull request is a draft. + draft *bool + // The head property + head PullRequestSimple_headable + // The html_url property + html_url *string + // The id property + id *int64 + // The issue_url property + issue_url *string + // The labels property + labels []PullRequestSimple_labelsable + // The locked property + locked *bool + // The merge_commit_sha property + merge_commit_sha *string + // The merged_at property + merged_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A collection of related issues and pull requests. + milestone NullableMilestoneable + // The node_id property + node_id *string + // The number property + number *int32 + // The patch_url property + patch_url *string + // The requested_reviewers property + requested_reviewers []SimpleUserable + // The requested_teams property + requested_teams []Teamable + // The review_comment_url property + review_comment_url *string + // The review_comments_url property + review_comments_url *string + // The state property + state *string + // The statuses_url property + statuses_url *string + // The title property + title *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewPullRequestSimple instantiates a new PullRequestSimple and sets the default values. +func NewPullRequestSimple()(*PullRequestSimple) { + m := &PullRequestSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestSimple(), nil +} +// GetActiveLockReason gets the active_lock_reason property value. The active_lock_reason property +// returns a *string when successful +func (m *PullRequestSimple) GetActiveLockReason()(*string) { + return m.active_lock_reason +} +// 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 *PullRequestSimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PullRequestSimple) GetAssignee()(NullableSimpleUserable) { + return m.assignee +} +// GetAssignees gets the assignees property value. The assignees property +// returns a []SimpleUserable when successful +func (m *PullRequestSimple) GetAssignees()([]SimpleUserable) { + return m.assignees +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *PullRequestSimple) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetAutoMerge gets the auto_merge property value. The status of auto merging a pull request. +// returns a AutoMergeable when successful +func (m *PullRequestSimple) GetAutoMerge()(AutoMergeable) { + return m.auto_merge +} +// GetBase gets the base property value. The base property +// returns a PullRequestSimple_baseable when successful +func (m *PullRequestSimple) GetBase()(PullRequestSimple_baseable) { + return m.base +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *PullRequestSimple) GetBody()(*string) { + return m.body +} +// GetClosedAt gets the closed_at property value. The closed_at property +// returns a *Time when successful +func (m *PullRequestSimple) GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.closed_at +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *PullRequestSimple) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *PullRequestSimple) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PullRequestSimple) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDiffUrl gets the diff_url property value. The diff_url property +// returns a *string when successful +func (m *PullRequestSimple) GetDiffUrl()(*string) { + return m.diff_url +} +// GetDraft gets the draft property value. Indicates whether or not the pull request is a draft. +// returns a *bool when successful +func (m *PullRequestSimple) GetDraft()(*bool) { + return m.draft +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestSimple__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(PullRequestSimple__linksable)) + } + return nil + } + res["active_lock_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetActiveLockReason(val) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(NullableSimpleUserable)) + } + return nil + } + res["assignees"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetAssignees(res) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAutoMergeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAutoMerge(val.(AutoMergeable)) + } + return nil + } + res["base"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestSimple_baseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBase(val.(PullRequestSimple_baseable)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["closed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetClosedAt(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["diff_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiffUrl(val) + } + return nil + } + res["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(val) + } + return nil + } + res["head"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestSimple_headFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHead(val.(PullRequestSimple_headable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["issue_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueUrl(val) + } + return nil + } + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePullRequestSimple_labelsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PullRequestSimple_labelsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PullRequestSimple_labelsable) + } + } + m.SetLabels(res) + } + return nil + } + res["locked"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLocked(val) + } + return nil + } + res["merge_commit_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitSha(val) + } + return nil + } + res["merged_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetMergedAt(val) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableMilestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(NullableMilestoneable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["patch_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatchUrl(val) + } + return nil + } + res["requested_reviewers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetRequestedReviewers(res) + } + return nil + } + res["requested_teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Teamable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Teamable) + } + } + m.SetRequestedTeams(res) + } + return nil + } + res["review_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReviewCommentUrl(val) + } + return nil + } + res["review_comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReviewCommentsUrl(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetHead gets the head property value. The head property +// returns a PullRequestSimple_headable when successful +func (m *PullRequestSimple) GetHead()(PullRequestSimple_headable) { + return m.head +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequestSimple) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequestSimple) GetId()(*int64) { + return m.id +} +// GetIssueUrl gets the issue_url property value. The issue_url property +// returns a *string when successful +func (m *PullRequestSimple) GetIssueUrl()(*string) { + return m.issue_url +} +// GetLabels gets the labels property value. The labels property +// returns a []PullRequestSimple_labelsable when successful +func (m *PullRequestSimple) GetLabels()([]PullRequestSimple_labelsable) { + return m.labels +} +// GetLinks gets the _links property value. The _links property +// returns a PullRequestSimple__linksable when successful +func (m *PullRequestSimple) GetLinks()(PullRequestSimple__linksable) { + return m._links +} +// GetLocked gets the locked property value. The locked property +// returns a *bool when successful +func (m *PullRequestSimple) GetLocked()(*bool) { + return m.locked +} +// GetMergeCommitSha gets the merge_commit_sha property value. The merge_commit_sha property +// returns a *string when successful +func (m *PullRequestSimple) GetMergeCommitSha()(*string) { + return m.merge_commit_sha +} +// GetMergedAt gets the merged_at property value. The merged_at property +// returns a *Time when successful +func (m *PullRequestSimple) GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.merged_at +} +// GetMilestone gets the milestone property value. A collection of related issues and pull requests. +// returns a NullableMilestoneable when successful +func (m *PullRequestSimple) GetMilestone()(NullableMilestoneable) { + return m.milestone +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequestSimple) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. The number property +// returns a *int32 when successful +func (m *PullRequestSimple) GetNumber()(*int32) { + return m.number +} +// GetPatchUrl gets the patch_url property value. The patch_url property +// returns a *string when successful +func (m *PullRequestSimple) GetPatchUrl()(*string) { + return m.patch_url +} +// GetRequestedReviewers gets the requested_reviewers property value. The requested_reviewers property +// returns a []SimpleUserable when successful +func (m *PullRequestSimple) GetRequestedReviewers()([]SimpleUserable) { + return m.requested_reviewers +} +// GetRequestedTeams gets the requested_teams property value. The requested_teams property +// returns a []Teamable when successful +func (m *PullRequestSimple) GetRequestedTeams()([]Teamable) { + return m.requested_teams +} +// GetReviewCommentsUrl gets the review_comments_url property value. The review_comments_url property +// returns a *string when successful +func (m *PullRequestSimple) GetReviewCommentsUrl()(*string) { + return m.review_comments_url +} +// GetReviewCommentUrl gets the review_comment_url property value. The review_comment_url property +// returns a *string when successful +func (m *PullRequestSimple) GetReviewCommentUrl()(*string) { + return m.review_comment_url +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *PullRequestSimple) GetState()(*string) { + return m.state +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *PullRequestSimple) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *PullRequestSimple) GetTitle()(*string) { + return m.title +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PullRequestSimple) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequestSimple) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PullRequestSimple) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *PullRequestSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("active_lock_reason", m.GetActiveLockReason()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + if m.GetAssignees() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAssignees())) + for i, v := range m.GetAssignees() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("assignees", cast) + if err != nil { + return err + } + } + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("auto_merge", m.GetAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("base", m.GetBase()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("closed_at", m.GetClosedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("diff_url", m.GetDiffUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("head", m.GetHead()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_url", m.GetIssueUrl()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("locked", m.GetLocked()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("merged_at", m.GetMergedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merge_commit_sha", m.GetMergeCommitSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patch_url", m.GetPatchUrl()) + if err != nil { + return err + } + } + if m.GetRequestedReviewers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRequestedReviewers())) + for i, v := range m.GetRequestedReviewers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("requested_reviewers", cast) + if err != nil { + return err + } + } + if m.GetRequestedTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRequestedTeams())) + for i, v := range m.GetRequestedTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("requested_teams", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("review_comments_url", m.GetReviewCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("review_comment_url", m.GetReviewCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActiveLockReason sets the active_lock_reason property value. The active_lock_reason property +func (m *PullRequestSimple) SetActiveLockReason(value *string)() { + m.active_lock_reason = value +} +// 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 *PullRequestSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *PullRequestSimple) SetAssignee(value NullableSimpleUserable)() { + m.assignee = value +} +// SetAssignees sets the assignees property value. The assignees property +func (m *PullRequestSimple) SetAssignees(value []SimpleUserable)() { + m.assignees = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *PullRequestSimple) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetAutoMerge sets the auto_merge property value. The status of auto merging a pull request. +func (m *PullRequestSimple) SetAutoMerge(value AutoMergeable)() { + m.auto_merge = value +} +// SetBase sets the base property value. The base property +func (m *PullRequestSimple) SetBase(value PullRequestSimple_baseable)() { + m.base = value +} +// SetBody sets the body property value. The body property +func (m *PullRequestSimple) SetBody(value *string)() { + m.body = value +} +// SetClosedAt sets the closed_at property value. The closed_at property +func (m *PullRequestSimple) SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.closed_at = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *PullRequestSimple) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *PullRequestSimple) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PullRequestSimple) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDiffUrl sets the diff_url property value. The diff_url property +func (m *PullRequestSimple) SetDiffUrl(value *string)() { + m.diff_url = value +} +// SetDraft sets the draft property value. Indicates whether or not the pull request is a draft. +func (m *PullRequestSimple) SetDraft(value *bool)() { + m.draft = value +} +// SetHead sets the head property value. The head property +func (m *PullRequestSimple) SetHead(value PullRequestSimple_headable)() { + m.head = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequestSimple) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PullRequestSimple) SetId(value *int64)() { + m.id = value +} +// SetIssueUrl sets the issue_url property value. The issue_url property +func (m *PullRequestSimple) SetIssueUrl(value *string)() { + m.issue_url = value +} +// SetLabels sets the labels property value. The labels property +func (m *PullRequestSimple) SetLabels(value []PullRequestSimple_labelsable)() { + m.labels = value +} +// SetLinks sets the _links property value. The _links property +func (m *PullRequestSimple) SetLinks(value PullRequestSimple__linksable)() { + m._links = value +} +// SetLocked sets the locked property value. The locked property +func (m *PullRequestSimple) SetLocked(value *bool)() { + m.locked = value +} +// SetMergeCommitSha sets the merge_commit_sha property value. The merge_commit_sha property +func (m *PullRequestSimple) SetMergeCommitSha(value *string)() { + m.merge_commit_sha = value +} +// SetMergedAt sets the merged_at property value. The merged_at property +func (m *PullRequestSimple) SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.merged_at = value +} +// SetMilestone sets the milestone property value. A collection of related issues and pull requests. +func (m *PullRequestSimple) SetMilestone(value NullableMilestoneable)() { + m.milestone = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequestSimple) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. The number property +func (m *PullRequestSimple) SetNumber(value *int32)() { + m.number = value +} +// SetPatchUrl sets the patch_url property value. The patch_url property +func (m *PullRequestSimple) SetPatchUrl(value *string)() { + m.patch_url = value +} +// SetRequestedReviewers sets the requested_reviewers property value. The requested_reviewers property +func (m *PullRequestSimple) SetRequestedReviewers(value []SimpleUserable)() { + m.requested_reviewers = value +} +// SetRequestedTeams sets the requested_teams property value. The requested_teams property +func (m *PullRequestSimple) SetRequestedTeams(value []Teamable)() { + m.requested_teams = value +} +// SetReviewCommentsUrl sets the review_comments_url property value. The review_comments_url property +func (m *PullRequestSimple) SetReviewCommentsUrl(value *string)() { + m.review_comments_url = value +} +// SetReviewCommentUrl sets the review_comment_url property value. The review_comment_url property +func (m *PullRequestSimple) SetReviewCommentUrl(value *string)() { + m.review_comment_url = value +} +// SetState sets the state property value. The state property +func (m *PullRequestSimple) SetState(value *string)() { + m.state = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *PullRequestSimple) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetTitle sets the title property value. The title property +func (m *PullRequestSimple) SetTitle(value *string)() { + m.title = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PullRequestSimple) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequestSimple) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *PullRequestSimple) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type PullRequestSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActiveLockReason()(*string) + GetAssignee()(NullableSimpleUserable) + GetAssignees()([]SimpleUserable) + GetAuthorAssociation()(*AuthorAssociation) + GetAutoMerge()(AutoMergeable) + GetBase()(PullRequestSimple_baseable) + GetBody()(*string) + GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDiffUrl()(*string) + GetDraft()(*bool) + GetHead()(PullRequestSimple_headable) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueUrl()(*string) + GetLabels()([]PullRequestSimple_labelsable) + GetLinks()(PullRequestSimple__linksable) + GetLocked()(*bool) + GetMergeCommitSha()(*string) + GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetMilestone()(NullableMilestoneable) + GetNodeId()(*string) + GetNumber()(*int32) + GetPatchUrl()(*string) + GetRequestedReviewers()([]SimpleUserable) + GetRequestedTeams()([]Teamable) + GetReviewCommentsUrl()(*string) + GetReviewCommentUrl()(*string) + GetState()(*string) + GetStatusesUrl()(*string) + GetTitle()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetActiveLockReason(value *string)() + SetAssignee(value NullableSimpleUserable)() + SetAssignees(value []SimpleUserable)() + SetAuthorAssociation(value *AuthorAssociation)() + SetAutoMerge(value AutoMergeable)() + SetBase(value PullRequestSimple_baseable)() + SetBody(value *string)() + SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDiffUrl(value *string)() + SetDraft(value *bool)() + SetHead(value PullRequestSimple_headable)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueUrl(value *string)() + SetLabels(value []PullRequestSimple_labelsable)() + SetLinks(value PullRequestSimple__linksable)() + SetLocked(value *bool)() + SetMergeCommitSha(value *string)() + SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetMilestone(value NullableMilestoneable)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetPatchUrl(value *string)() + SetRequestedReviewers(value []SimpleUserable)() + SetRequestedTeams(value []Teamable)() + SetReviewCommentsUrl(value *string)() + SetReviewCommentUrl(value *string)() + SetState(value *string)() + SetStatusesUrl(value *string)() + SetTitle(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_simple__links.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_simple__links.go new file mode 100644 index 000000000..f964ceb42 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_simple__links.go @@ -0,0 +1,283 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestSimple__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Hypermedia Link + comments Linkable + // Hypermedia Link + commits Linkable + // Hypermedia Link + html Linkable + // Hypermedia Link + issue Linkable + // Hypermedia Link + review_comment Linkable + // Hypermedia Link + review_comments Linkable + // Hypermedia Link + self Linkable + // Hypermedia Link + statuses Linkable +} +// NewPullRequestSimple__links instantiates a new PullRequestSimple__links and sets the default values. +func NewPullRequestSimple__links()(*PullRequestSimple__links) { + m := &PullRequestSimple__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestSimple__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestSimple__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestSimple__links(), 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 *PullRequestSimple__links) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComments gets the comments property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequestSimple__links) GetComments()(Linkable) { + return m.comments +} +// GetCommits gets the commits property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequestSimple__links) GetCommits()(Linkable) { + return m.commits +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestSimple__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetComments(val.(Linkable)) + } + return nil + } + res["commits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommits(val.(Linkable)) + } + return nil + } + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHtml(val.(Linkable)) + } + return nil + } + res["issue"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIssue(val.(Linkable)) + } + return nil + } + res["review_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewComment(val.(Linkable)) + } + return nil + } + res["review_comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewComments(val.(Linkable)) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSelf(val.(Linkable)) + } + return nil + } + res["statuses"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetStatuses(val.(Linkable)) + } + return nil + } + return res +} +// GetHtml gets the html property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequestSimple__links) GetHtml()(Linkable) { + return m.html +} +// GetIssue gets the issue property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequestSimple__links) GetIssue()(Linkable) { + return m.issue +} +// GetReviewComment gets the review_comment property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequestSimple__links) GetReviewComment()(Linkable) { + return m.review_comment +} +// GetReviewComments gets the review_comments property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequestSimple__links) GetReviewComments()(Linkable) { + return m.review_comments +} +// GetSelf gets the self property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequestSimple__links) GetSelf()(Linkable) { + return m.self +} +// GetStatuses gets the statuses property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequestSimple__links) GetStatuses()(Linkable) { + return m.statuses +} +// Serialize serializes information the current object +func (m *PullRequestSimple__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("commits", m.GetCommits()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("issue", m.GetIssue()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("review_comment", m.GetReviewComment()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("review_comments", m.GetReviewComments()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("self", m.GetSelf()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("statuses", m.GetStatuses()) + 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 *PullRequestSimple__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComments sets the comments property value. Hypermedia Link +func (m *PullRequestSimple__links) SetComments(value Linkable)() { + m.comments = value +} +// SetCommits sets the commits property value. Hypermedia Link +func (m *PullRequestSimple__links) SetCommits(value Linkable)() { + m.commits = value +} +// SetHtml sets the html property value. Hypermedia Link +func (m *PullRequestSimple__links) SetHtml(value Linkable)() { + m.html = value +} +// SetIssue sets the issue property value. Hypermedia Link +func (m *PullRequestSimple__links) SetIssue(value Linkable)() { + m.issue = value +} +// SetReviewComment sets the review_comment property value. Hypermedia Link +func (m *PullRequestSimple__links) SetReviewComment(value Linkable)() { + m.review_comment = value +} +// SetReviewComments sets the review_comments property value. Hypermedia Link +func (m *PullRequestSimple__links) SetReviewComments(value Linkable)() { + m.review_comments = value +} +// SetSelf sets the self property value. Hypermedia Link +func (m *PullRequestSimple__links) SetSelf(value Linkable)() { + m.self = value +} +// SetStatuses sets the statuses property value. Hypermedia Link +func (m *PullRequestSimple__links) SetStatuses(value Linkable)() { + m.statuses = value +} +type PullRequestSimple__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComments()(Linkable) + GetCommits()(Linkable) + GetHtml()(Linkable) + GetIssue()(Linkable) + GetReviewComment()(Linkable) + GetReviewComments()(Linkable) + GetSelf()(Linkable) + GetStatuses()(Linkable) + SetComments(value Linkable)() + SetCommits(value Linkable)() + SetHtml(value Linkable)() + SetIssue(value Linkable)() + SetReviewComment(value Linkable)() + SetReviewComments(value Linkable)() + SetSelf(value Linkable)() + SetStatuses(value Linkable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_simple_base.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_simple_base.go new file mode 100644 index 000000000..4c67fa0c0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_simple_base.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestSimple_base struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The label property + label *string + // The ref property + ref *string + // A repository on GitHub. + repo Repositoryable + // The sha property + sha *string + // A GitHub user. + user NullableSimpleUserable +} +// NewPullRequestSimple_base instantiates a new PullRequestSimple_base and sets the default values. +func NewPullRequestSimple_base()(*PullRequestSimple_base) { + m := &PullRequestSimple_base{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestSimple_baseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestSimple_baseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestSimple_base(), 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 *PullRequestSimple_base) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestSimple_base) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabel(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepo(val.(Repositoryable)) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetLabel gets the label property value. The label property +// returns a *string when successful +func (m *PullRequestSimple_base) GetLabel()(*string) { + return m.label +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *PullRequestSimple_base) GetRef()(*string) { + return m.ref +} +// GetRepo gets the repo property value. A repository on GitHub. +// returns a Repositoryable when successful +func (m *PullRequestSimple_base) GetRepo()(Repositoryable) { + return m.repo +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *PullRequestSimple_base) GetSha()(*string) { + return m.sha +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PullRequestSimple_base) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *PullRequestSimple_base) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repo", m.GetRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *PullRequestSimple_base) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabel sets the label property value. The label property +func (m *PullRequestSimple_base) SetLabel(value *string)() { + m.label = value +} +// SetRef sets the ref property value. The ref property +func (m *PullRequestSimple_base) SetRef(value *string)() { + m.ref = value +} +// SetRepo sets the repo property value. A repository on GitHub. +func (m *PullRequestSimple_base) SetRepo(value Repositoryable)() { + m.repo = value +} +// SetSha sets the sha property value. The sha property +func (m *PullRequestSimple_base) SetSha(value *string)() { + m.sha = value +} +// SetUser sets the user property value. A GitHub user. +func (m *PullRequestSimple_base) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type PullRequestSimple_baseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabel()(*string) + GetRef()(*string) + GetRepo()(Repositoryable) + GetSha()(*string) + GetUser()(NullableSimpleUserable) + SetLabel(value *string)() + SetRef(value *string)() + SetRepo(value Repositoryable)() + SetSha(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_simple_head.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_simple_head.go new file mode 100644 index 000000000..53ffb3208 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_simple_head.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestSimple_head struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The label property + label *string + // The ref property + ref *string + // A repository on GitHub. + repo Repositoryable + // The sha property + sha *string + // A GitHub user. + user NullableSimpleUserable +} +// NewPullRequestSimple_head instantiates a new PullRequestSimple_head and sets the default values. +func NewPullRequestSimple_head()(*PullRequestSimple_head) { + m := &PullRequestSimple_head{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestSimple_headFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestSimple_headFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestSimple_head(), 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 *PullRequestSimple_head) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestSimple_head) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabel(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepo(val.(Repositoryable)) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetLabel gets the label property value. The label property +// returns a *string when successful +func (m *PullRequestSimple_head) GetLabel()(*string) { + return m.label +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *PullRequestSimple_head) GetRef()(*string) { + return m.ref +} +// GetRepo gets the repo property value. A repository on GitHub. +// returns a Repositoryable when successful +func (m *PullRequestSimple_head) GetRepo()(Repositoryable) { + return m.repo +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *PullRequestSimple_head) GetSha()(*string) { + return m.sha +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PullRequestSimple_head) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *PullRequestSimple_head) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repo", m.GetRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *PullRequestSimple_head) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabel sets the label property value. The label property +func (m *PullRequestSimple_head) SetLabel(value *string)() { + m.label = value +} +// SetRef sets the ref property value. The ref property +func (m *PullRequestSimple_head) SetRef(value *string)() { + m.ref = value +} +// SetRepo sets the repo property value. A repository on GitHub. +func (m *PullRequestSimple_head) SetRepo(value Repositoryable)() { + m.repo = value +} +// SetSha sets the sha property value. The sha property +func (m *PullRequestSimple_head) SetSha(value *string)() { + m.sha = value +} +// SetUser sets the user property value. A GitHub user. +func (m *PullRequestSimple_head) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type PullRequestSimple_headable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabel()(*string) + GetRef()(*string) + GetRepo()(Repositoryable) + GetSha()(*string) + GetUser()(NullableSimpleUserable) + SetLabel(value *string)() + SetRef(value *string)() + SetRepo(value Repositoryable)() + SetSha(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_simple_labels.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_simple_labels.go new file mode 100644 index 000000000..93cd37eaf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_simple_labels.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestSimple_labels struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The color property + color *string + // The default property + defaultEscaped *bool + // The description property + description *string + // The id property + id *int64 + // The name property + name *string + // The node_id property + node_id *string + // The url property + url *string +} +// NewPullRequestSimple_labels instantiates a new PullRequestSimple_labels and sets the default values. +func NewPullRequestSimple_labels()(*PullRequestSimple_labels) { + m := &PullRequestSimple_labels{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestSimple_labelsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestSimple_labelsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestSimple_labels(), 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 *PullRequestSimple_labels) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The color property +// returns a *string when successful +func (m *PullRequestSimple_labels) GetColor()(*string) { + return m.color +} +// GetDefaultEscaped gets the default property value. The default property +// returns a *bool when successful +func (m *PullRequestSimple_labels) GetDefaultEscaped()(*bool) { + return m.defaultEscaped +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *PullRequestSimple_labels) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestSimple_labels) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(val) + } + return nil + } + res["default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultEscaped(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequestSimple_labels) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PullRequestSimple_labels) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequestSimple_labels) GetNodeId()(*string) { + return m.node_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequestSimple_labels) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequestSimple_labels) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("default", m.GetDefaultEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequestSimple_labels) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The color property +func (m *PullRequestSimple_labels) SetColor(value *string)() { + m.color = value +} +// SetDefaultEscaped sets the default property value. The default property +func (m *PullRequestSimple_labels) SetDefaultEscaped(value *bool)() { + m.defaultEscaped = value +} +// SetDescription sets the description property value. The description property +func (m *PullRequestSimple_labels) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. The id property +func (m *PullRequestSimple_labels) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *PullRequestSimple_labels) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequestSimple_labels) SetNodeId(value *string)() { + m.node_id = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequestSimple_labels) SetUrl(value *string)() { + m.url = value +} +type PullRequestSimple_labelsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetDefaultEscaped()(*bool) + GetDescription()(*string) + GetId()(*int64) + GetName()(*string) + GetNodeId()(*string) + GetUrl()(*string) + SetColor(value *string)() + SetDefaultEscaped(value *bool)() + SetDescription(value *string)() + SetId(value *int64)() + SetName(value *string)() + SetNodeId(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_state.go new file mode 100644 index 000000000..135ef8ccb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_state.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// State of this Pull Request. Either `open` or `closed`. +type PullRequest_state int + +const ( + OPEN_PULLREQUEST_STATE PullRequest_state = iota + CLOSED_PULLREQUEST_STATE +) + +func (i PullRequest_state) String() string { + return []string{"open", "closed"}[i] +} +func ParsePullRequest_state(v string) (any, error) { + result := OPEN_PULLREQUEST_STATE + switch v { + case "open": + result = OPEN_PULLREQUEST_STATE + case "closed": + result = CLOSED_PULLREQUEST_STATE + default: + return 0, errors.New("Unknown PullRequest_state value: " + v) + } + return &result, nil +} +func SerializePullRequest_state(values []PullRequest_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PullRequest_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_webhook.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_webhook.go new file mode 100644 index 000000000..15965dd47 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_webhook.go @@ -0,0 +1,275 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestWebhook struct { + PullRequest + // Whether to allow auto-merge for pull requests. + allow_auto_merge *bool + // Whether to allow updating the pull request's branch. + allow_update_branch *bool + // Whether to delete head branches when pull requests are merged. + delete_branch_on_merge *bool + // The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. + merge_commit_message *PullRequestWebhook_merge_commit_message + // The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., "Merge pull request #123 from branch-name"). + merge_commit_title *PullRequestWebhook_merge_commit_title + // The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. + squash_merge_commit_message *PullRequestWebhook_squash_merge_commit_message + // The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + squash_merge_commit_title *PullRequestWebhook_squash_merge_commit_title + // Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead.** + use_squash_pr_title_as_default *bool +} +// NewPullRequestWebhook instantiates a new PullRequestWebhook and sets the default values. +func NewPullRequestWebhook()(*PullRequestWebhook) { + m := &PullRequestWebhook{ + PullRequest: *NewPullRequest(), + } + return m +} +// CreatePullRequestWebhookFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestWebhookFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestWebhook(), nil +} +// GetAllowAutoMerge gets the allow_auto_merge property value. Whether to allow auto-merge for pull requests. +// returns a *bool when successful +func (m *PullRequestWebhook) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowUpdateBranch gets the allow_update_branch property value. Whether to allow updating the pull request's branch. +// returns a *bool when successful +func (m *PullRequestWebhook) GetAllowUpdateBranch()(*bool) { + return m.allow_update_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged. +// returns a *bool when successful +func (m *PullRequestWebhook) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestWebhook) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := m.PullRequest.GetFieldDeserializers() + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_update_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowUpdateBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePullRequestWebhook_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitMessage(val.(*PullRequestWebhook_merge_commit_message)) + } + return nil + } + res["merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePullRequestWebhook_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitTitle(val.(*PullRequestWebhook_merge_commit_title)) + } + return nil + } + res["squash_merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePullRequestWebhook_squash_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitMessage(val.(*PullRequestWebhook_squash_merge_commit_message)) + } + return nil + } + res["squash_merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePullRequestWebhook_squash_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitTitle(val.(*PullRequestWebhook_squash_merge_commit_title)) + } + return nil + } + res["use_squash_pr_title_as_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseSquashPrTitleAsDefault(val) + } + return nil + } + return res +} +// GetMergeCommitMessage gets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +// returns a *PullRequestWebhook_merge_commit_message when successful +func (m *PullRequestWebhook) GetMergeCommitMessage()(*PullRequestWebhook_merge_commit_message) { + return m.merge_commit_message +} +// GetMergeCommitTitle gets the merge_commit_title property value. The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., "Merge pull request #123 from branch-name"). +// returns a *PullRequestWebhook_merge_commit_title when successful +func (m *PullRequestWebhook) GetMergeCommitTitle()(*PullRequestWebhook_merge_commit_title) { + return m.merge_commit_title +} +// GetSquashMergeCommitMessage gets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +// returns a *PullRequestWebhook_squash_merge_commit_message when successful +func (m *PullRequestWebhook) GetSquashMergeCommitMessage()(*PullRequestWebhook_squash_merge_commit_message) { + return m.squash_merge_commit_message +} +// GetSquashMergeCommitTitle gets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +// returns a *PullRequestWebhook_squash_merge_commit_title when successful +func (m *PullRequestWebhook) GetSquashMergeCommitTitle()(*PullRequestWebhook_squash_merge_commit_title) { + return m.squash_merge_commit_title +} +// GetUseSquashPrTitleAsDefault gets the use_squash_pr_title_as_default property value. Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead.** +// returns a *bool when successful +func (m *PullRequestWebhook) GetUseSquashPrTitleAsDefault()(*bool) { + return m.use_squash_pr_title_as_default +} +// Serialize serializes information the current object +func (m *PullRequestWebhook) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + err := m.PullRequest.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err = writer.WriteBoolValue("allow_update_branch", m.GetAllowUpdateBranch()) + if err != nil { + return err + } + } + { + err = writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + if m.GetMergeCommitMessage() != nil { + cast := (*m.GetMergeCommitMessage()).String() + err = writer.WriteStringValue("merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetMergeCommitTitle() != nil { + cast := (*m.GetMergeCommitTitle()).String() + err = writer.WriteStringValue("merge_commit_title", &cast) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitMessage() != nil { + cast := (*m.GetSquashMergeCommitMessage()).String() + err = writer.WriteStringValue("squash_merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitTitle() != nil { + cast := (*m.GetSquashMergeCommitTitle()).String() + err = writer.WriteStringValue("squash_merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err = writer.WriteBoolValue("use_squash_pr_title_as_default", m.GetUseSquashPrTitleAsDefault()) + if err != nil { + return err + } + } + return nil +} +// SetAllowAutoMerge sets the allow_auto_merge property value. Whether to allow auto-merge for pull requests. +func (m *PullRequestWebhook) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowUpdateBranch sets the allow_update_branch property value. Whether to allow updating the pull request's branch. +func (m *PullRequestWebhook) SetAllowUpdateBranch(value *bool)() { + m.allow_update_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged. +func (m *PullRequestWebhook) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetMergeCommitMessage sets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +func (m *PullRequestWebhook) SetMergeCommitMessage(value *PullRequestWebhook_merge_commit_message)() { + m.merge_commit_message = value +} +// SetMergeCommitTitle sets the merge_commit_title property value. The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., "Merge pull request #123 from branch-name"). +func (m *PullRequestWebhook) SetMergeCommitTitle(value *PullRequestWebhook_merge_commit_title)() { + m.merge_commit_title = value +} +// SetSquashMergeCommitMessage sets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +func (m *PullRequestWebhook) SetSquashMergeCommitMessage(value *PullRequestWebhook_squash_merge_commit_message)() { + m.squash_merge_commit_message = value +} +// SetSquashMergeCommitTitle sets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +func (m *PullRequestWebhook) SetSquashMergeCommitTitle(value *PullRequestWebhook_squash_merge_commit_title)() { + m.squash_merge_commit_title = value +} +// SetUseSquashPrTitleAsDefault sets the use_squash_pr_title_as_default property value. Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead.** +func (m *PullRequestWebhook) SetUseSquashPrTitleAsDefault(value *bool)() { + m.use_squash_pr_title_as_default = value +} +type PullRequestWebhookable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + PullRequestable + GetAllowAutoMerge()(*bool) + GetAllowUpdateBranch()(*bool) + GetDeleteBranchOnMerge()(*bool) + GetMergeCommitMessage()(*PullRequestWebhook_merge_commit_message) + GetMergeCommitTitle()(*PullRequestWebhook_merge_commit_title) + GetSquashMergeCommitMessage()(*PullRequestWebhook_squash_merge_commit_message) + GetSquashMergeCommitTitle()(*PullRequestWebhook_squash_merge_commit_title) + GetUseSquashPrTitleAsDefault()(*bool) + SetAllowAutoMerge(value *bool)() + SetAllowUpdateBranch(value *bool)() + SetDeleteBranchOnMerge(value *bool)() + SetMergeCommitMessage(value *PullRequestWebhook_merge_commit_message)() + SetMergeCommitTitle(value *PullRequestWebhook_merge_commit_title)() + SetSquashMergeCommitMessage(value *PullRequestWebhook_squash_merge_commit_message)() + SetSquashMergeCommitTitle(value *PullRequestWebhook_squash_merge_commit_title)() + SetUseSquashPrTitleAsDefault(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_webhook_merge_commit_message.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_webhook_merge_commit_message.go new file mode 100644 index 000000000..a34f50531 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_webhook_merge_commit_message.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +type PullRequestWebhook_merge_commit_message int + +const ( + PR_BODY_PULLREQUESTWEBHOOK_MERGE_COMMIT_MESSAGE PullRequestWebhook_merge_commit_message = iota + PR_TITLE_PULLREQUESTWEBHOOK_MERGE_COMMIT_MESSAGE + BLANK_PULLREQUESTWEBHOOK_MERGE_COMMIT_MESSAGE +) + +func (i PullRequestWebhook_merge_commit_message) String() string { + return []string{"PR_BODY", "PR_TITLE", "BLANK"}[i] +} +func ParsePullRequestWebhook_merge_commit_message(v string) (any, error) { + result := PR_BODY_PULLREQUESTWEBHOOK_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_PULLREQUESTWEBHOOK_MERGE_COMMIT_MESSAGE + case "PR_TITLE": + result = PR_TITLE_PULLREQUESTWEBHOOK_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_PULLREQUESTWEBHOOK_MERGE_COMMIT_MESSAGE + default: + return 0, errors.New("Unknown PullRequestWebhook_merge_commit_message value: " + v) + } + return &result, nil +} +func SerializePullRequestWebhook_merge_commit_message(values []PullRequestWebhook_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PullRequestWebhook_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_webhook_merge_commit_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_webhook_merge_commit_title.go new file mode 100644 index 000000000..7a6601233 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_webhook_merge_commit_title.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., "Merge pull request #123 from branch-name"). +type PullRequestWebhook_merge_commit_title int + +const ( + PR_TITLE_PULLREQUESTWEBHOOK_MERGE_COMMIT_TITLE PullRequestWebhook_merge_commit_title = iota + MERGE_MESSAGE_PULLREQUESTWEBHOOK_MERGE_COMMIT_TITLE +) + +func (i PullRequestWebhook_merge_commit_title) String() string { + return []string{"PR_TITLE", "MERGE_MESSAGE"}[i] +} +func ParsePullRequestWebhook_merge_commit_title(v string) (any, error) { + result := PR_TITLE_PULLREQUESTWEBHOOK_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_PULLREQUESTWEBHOOK_MERGE_COMMIT_TITLE + case "MERGE_MESSAGE": + result = MERGE_MESSAGE_PULLREQUESTWEBHOOK_MERGE_COMMIT_TITLE + default: + return 0, errors.New("Unknown PullRequestWebhook_merge_commit_title value: " + v) + } + return &result, nil +} +func SerializePullRequestWebhook_merge_commit_title(values []PullRequestWebhook_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PullRequestWebhook_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_webhook_squash_merge_commit_message.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_webhook_squash_merge_commit_message.go new file mode 100644 index 000000000..45003c9f1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_webhook_squash_merge_commit_message.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +type PullRequestWebhook_squash_merge_commit_message int + +const ( + PR_BODY_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_MESSAGE PullRequestWebhook_squash_merge_commit_message = iota + COMMIT_MESSAGES_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_MESSAGE + BLANK_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_MESSAGE +) + +func (i PullRequestWebhook_squash_merge_commit_message) String() string { + return []string{"PR_BODY", "COMMIT_MESSAGES", "BLANK"}[i] +} +func ParsePullRequestWebhook_squash_merge_commit_message(v string) (any, error) { + result := PR_BODY_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_MESSAGE + case "COMMIT_MESSAGES": + result = COMMIT_MESSAGES_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_MESSAGE + default: + return 0, errors.New("Unknown PullRequestWebhook_squash_merge_commit_message value: " + v) + } + return &result, nil +} +func SerializePullRequestWebhook_squash_merge_commit_message(values []PullRequestWebhook_squash_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PullRequestWebhook_squash_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_webhook_squash_merge_commit_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_webhook_squash_merge_commit_title.go new file mode 100644 index 000000000..6247b099a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/pull_request_webhook_squash_merge_commit_title.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +type PullRequestWebhook_squash_merge_commit_title int + +const ( + PR_TITLE_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_TITLE PullRequestWebhook_squash_merge_commit_title = iota + COMMIT_OR_PR_TITLE_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_TITLE +) + +func (i PullRequestWebhook_squash_merge_commit_title) String() string { + return []string{"PR_TITLE", "COMMIT_OR_PR_TITLE"}[i] +} +func ParsePullRequestWebhook_squash_merge_commit_title(v string) (any, error) { + result := PR_TITLE_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_TITLE + case "COMMIT_OR_PR_TITLE": + result = COMMIT_OR_PR_TITLE_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_TITLE + default: + return 0, errors.New("Unknown PullRequestWebhook_squash_merge_commit_title value: " + v) + } + return &result, nil +} +func SerializePullRequestWebhook_squash_merge_commit_title(values []PullRequestWebhook_squash_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PullRequestWebhook_squash_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/rate_limit.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/rate_limit.go new file mode 100644 index 000000000..36cbe712f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/rate_limit.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RateLimit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The limit property + limit *int32 + // The remaining property + remaining *int32 + // The reset property + reset *int32 + // The used property + used *int32 +} +// NewRateLimit instantiates a new RateLimit and sets the default values. +func NewRateLimit()(*RateLimit) { + m := &RateLimit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRateLimitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRateLimitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRateLimit(), 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 *RateLimit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RateLimit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["limit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLimit(val) + } + return nil + } + res["remaining"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRemaining(val) + } + return nil + } + res["reset"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetReset(val) + } + return nil + } + res["used"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUsed(val) + } + return nil + } + return res +} +// GetLimit gets the limit property value. The limit property +// returns a *int32 when successful +func (m *RateLimit) GetLimit()(*int32) { + return m.limit +} +// GetRemaining gets the remaining property value. The remaining property +// returns a *int32 when successful +func (m *RateLimit) GetRemaining()(*int32) { + return m.remaining +} +// GetReset gets the reset property value. The reset property +// returns a *int32 when successful +func (m *RateLimit) GetReset()(*int32) { + return m.reset +} +// GetUsed gets the used property value. The used property +// returns a *int32 when successful +func (m *RateLimit) GetUsed()(*int32) { + return m.used +} +// Serialize serializes information the current object +func (m *RateLimit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("limit", m.GetLimit()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("remaining", m.GetRemaining()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("reset", m.GetReset()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("used", m.GetUsed()) + 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 *RateLimit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLimit sets the limit property value. The limit property +func (m *RateLimit) SetLimit(value *int32)() { + m.limit = value +} +// SetRemaining sets the remaining property value. The remaining property +func (m *RateLimit) SetRemaining(value *int32)() { + m.remaining = value +} +// SetReset sets the reset property value. The reset property +func (m *RateLimit) SetReset(value *int32)() { + m.reset = value +} +// SetUsed sets the used property value. The used property +func (m *RateLimit) SetUsed(value *int32)() { + m.used = value +} +type RateLimitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLimit()(*int32) + GetRemaining()(*int32) + GetReset()(*int32) + GetUsed()(*int32) + SetLimit(value *int32)() + SetRemaining(value *int32)() + SetReset(value *int32)() + SetUsed(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/rate_limit_overview.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/rate_limit_overview.go new file mode 100644 index 000000000..edb978cfd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/rate_limit_overview.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RateLimitOverview rate Limit Overview +type RateLimitOverview struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The rate property + rate RateLimitable + // The resources property + resources RateLimitOverview_resourcesable +} +// NewRateLimitOverview instantiates a new RateLimitOverview and sets the default values. +func NewRateLimitOverview()(*RateLimitOverview) { + m := &RateLimitOverview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRateLimitOverviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRateLimitOverviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRateLimitOverview(), 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 *RateLimitOverview) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RateLimitOverview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["rate"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRate(val.(RateLimitable)) + } + return nil + } + res["resources"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitOverview_resourcesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetResources(val.(RateLimitOverview_resourcesable)) + } + return nil + } + return res +} +// GetRate gets the rate property value. The rate property +// returns a RateLimitable when successful +func (m *RateLimitOverview) GetRate()(RateLimitable) { + return m.rate +} +// GetResources gets the resources property value. The resources property +// returns a RateLimitOverview_resourcesable when successful +func (m *RateLimitOverview) GetResources()(RateLimitOverview_resourcesable) { + return m.resources +} +// Serialize serializes information the current object +func (m *RateLimitOverview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("rate", m.GetRate()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("resources", m.GetResources()) + 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 *RateLimitOverview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRate sets the rate property value. The rate property +func (m *RateLimitOverview) SetRate(value RateLimitable)() { + m.rate = value +} +// SetResources sets the resources property value. The resources property +func (m *RateLimitOverview) SetResources(value RateLimitOverview_resourcesable)() { + m.resources = value +} +type RateLimitOverviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRate()(RateLimitable) + GetResources()(RateLimitOverview_resourcesable) + SetRate(value RateLimitable)() + SetResources(value RateLimitOverview_resourcesable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/rate_limit_overview_resources.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/rate_limit_overview_resources.go new file mode 100644 index 000000000..71805c3ac --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/rate_limit_overview_resources.go @@ -0,0 +1,341 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RateLimitOverview_resources struct { + // The actions_runner_registration property + actions_runner_registration RateLimitable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code_scanning_upload property + code_scanning_upload RateLimitable + // The code_search property + code_search RateLimitable + // The core property + core RateLimitable + // The dependency_snapshots property + dependency_snapshots RateLimitable + // The graphql property + graphql RateLimitable + // The integration_manifest property + integration_manifest RateLimitable + // The scim property + scim RateLimitable + // The search property + search RateLimitable + // The source_import property + source_import RateLimitable +} +// NewRateLimitOverview_resources instantiates a new RateLimitOverview_resources and sets the default values. +func NewRateLimitOverview_resources()(*RateLimitOverview_resources) { + m := &RateLimitOverview_resources{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRateLimitOverview_resourcesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRateLimitOverview_resourcesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRateLimitOverview_resources(), nil +} +// GetActionsRunnerRegistration gets the actions_runner_registration property value. The actions_runner_registration property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetActionsRunnerRegistration()(RateLimitable) { + return m.actions_runner_registration +} +// 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 *RateLimitOverview_resources) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCodeScanningUpload gets the code_scanning_upload property value. The code_scanning_upload property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetCodeScanningUpload()(RateLimitable) { + return m.code_scanning_upload +} +// GetCodeSearch gets the code_search property value. The code_search property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetCodeSearch()(RateLimitable) { + return m.code_search +} +// GetCore gets the core property value. The core property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetCore()(RateLimitable) { + return m.core +} +// GetDependencySnapshots gets the dependency_snapshots property value. The dependency_snapshots property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetDependencySnapshots()(RateLimitable) { + return m.dependency_snapshots +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RateLimitOverview_resources) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actions_runner_registration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActionsRunnerRegistration(val.(RateLimitable)) + } + return nil + } + res["code_scanning_upload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCodeScanningUpload(val.(RateLimitable)) + } + return nil + } + res["code_search"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCodeSearch(val.(RateLimitable)) + } + return nil + } + res["core"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCore(val.(RateLimitable)) + } + return nil + } + res["dependency_snapshots"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDependencySnapshots(val.(RateLimitable)) + } + return nil + } + res["graphql"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetGraphql(val.(RateLimitable)) + } + return nil + } + res["integration_manifest"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIntegrationManifest(val.(RateLimitable)) + } + return nil + } + res["scim"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetScim(val.(RateLimitable)) + } + return nil + } + res["search"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSearch(val.(RateLimitable)) + } + return nil + } + res["source_import"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSourceImport(val.(RateLimitable)) + } + return nil + } + return res +} +// GetGraphql gets the graphql property value. The graphql property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetGraphql()(RateLimitable) { + return m.graphql +} +// GetIntegrationManifest gets the integration_manifest property value. The integration_manifest property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetIntegrationManifest()(RateLimitable) { + return m.integration_manifest +} +// GetScim gets the scim property value. The scim property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetScim()(RateLimitable) { + return m.scim +} +// GetSearch gets the search property value. The search property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetSearch()(RateLimitable) { + return m.search +} +// GetSourceImport gets the source_import property value. The source_import property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetSourceImport()(RateLimitable) { + return m.source_import +} +// Serialize serializes information the current object +func (m *RateLimitOverview_resources) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actions_runner_registration", m.GetActionsRunnerRegistration()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("code_scanning_upload", m.GetCodeScanningUpload()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("code_search", m.GetCodeSearch()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("core", m.GetCore()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("dependency_snapshots", m.GetDependencySnapshots()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("graphql", m.GetGraphql()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("integration_manifest", m.GetIntegrationManifest()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("scim", m.GetScim()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("search", m.GetSearch()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("source_import", m.GetSourceImport()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActionsRunnerRegistration sets the actions_runner_registration property value. The actions_runner_registration property +func (m *RateLimitOverview_resources) SetActionsRunnerRegistration(value RateLimitable)() { + m.actions_runner_registration = value +} +// 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 *RateLimitOverview_resources) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCodeScanningUpload sets the code_scanning_upload property value. The code_scanning_upload property +func (m *RateLimitOverview_resources) SetCodeScanningUpload(value RateLimitable)() { + m.code_scanning_upload = value +} +// SetCodeSearch sets the code_search property value. The code_search property +func (m *RateLimitOverview_resources) SetCodeSearch(value RateLimitable)() { + m.code_search = value +} +// SetCore sets the core property value. The core property +func (m *RateLimitOverview_resources) SetCore(value RateLimitable)() { + m.core = value +} +// SetDependencySnapshots sets the dependency_snapshots property value. The dependency_snapshots property +func (m *RateLimitOverview_resources) SetDependencySnapshots(value RateLimitable)() { + m.dependency_snapshots = value +} +// SetGraphql sets the graphql property value. The graphql property +func (m *RateLimitOverview_resources) SetGraphql(value RateLimitable)() { + m.graphql = value +} +// SetIntegrationManifest sets the integration_manifest property value. The integration_manifest property +func (m *RateLimitOverview_resources) SetIntegrationManifest(value RateLimitable)() { + m.integration_manifest = value +} +// SetScim sets the scim property value. The scim property +func (m *RateLimitOverview_resources) SetScim(value RateLimitable)() { + m.scim = value +} +// SetSearch sets the search property value. The search property +func (m *RateLimitOverview_resources) SetSearch(value RateLimitable)() { + m.search = value +} +// SetSourceImport sets the source_import property value. The source_import property +func (m *RateLimitOverview_resources) SetSourceImport(value RateLimitable)() { + m.source_import = value +} +type RateLimitOverview_resourcesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActionsRunnerRegistration()(RateLimitable) + GetCodeScanningUpload()(RateLimitable) + GetCodeSearch()(RateLimitable) + GetCore()(RateLimitable) + GetDependencySnapshots()(RateLimitable) + GetGraphql()(RateLimitable) + GetIntegrationManifest()(RateLimitable) + GetScim()(RateLimitable) + GetSearch()(RateLimitable) + GetSourceImport()(RateLimitable) + SetActionsRunnerRegistration(value RateLimitable)() + SetCodeScanningUpload(value RateLimitable)() + SetCodeSearch(value RateLimitable)() + SetCore(value RateLimitable)() + SetDependencySnapshots(value RateLimitable)() + SetGraphql(value RateLimitable)() + SetIntegrationManifest(value RateLimitable)() + SetScim(value RateLimitable)() + SetSearch(value RateLimitable)() + SetSourceImport(value RateLimitable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/reaction.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/reaction.go new file mode 100644 index 000000000..058d43837 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/reaction.go @@ -0,0 +1,199 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Reaction reactions to conversations provide a way to help people express their feelings more simply and effectively. +type Reaction struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The reaction to use + content *Reaction_content + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The id property + id *int32 + // The node_id property + node_id *string + // A GitHub user. + user NullableSimpleUserable +} +// NewReaction instantiates a new Reaction and sets the default values. +func NewReaction()(*Reaction) { + m := &Reaction{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReactionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReactionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReaction(), 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 *Reaction) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContent gets the content property value. The reaction to use +// returns a *Reaction_content when successful +func (m *Reaction) GetContent()(*Reaction_content) { + return m.content +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Reaction) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Reaction) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseReaction_content) + if err != nil { + return err + } + if val != nil { + m.SetContent(val.(*Reaction_content)) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Reaction) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Reaction) GetNodeId()(*string) { + return m.node_id +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Reaction) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *Reaction) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContent() != nil { + cast := (*m.GetContent()).String() + err := writer.WriteStringValue("content", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *Reaction) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContent sets the content property value. The reaction to use +func (m *Reaction) SetContent(value *Reaction_content)() { + m.content = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Reaction) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *Reaction) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Reaction) SetNodeId(value *string)() { + m.node_id = value +} +// SetUser sets the user property value. A GitHub user. +func (m *Reaction) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type Reactionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContent()(*Reaction_content) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int32) + GetNodeId()(*string) + GetUser()(NullableSimpleUserable) + SetContent(value *Reaction_content)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int32)() + SetNodeId(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/reaction_content.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/reaction_content.go new file mode 100644 index 000000000..070a556ac --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/reaction_content.go @@ -0,0 +1,55 @@ +package models +import ( + "errors" +) +// The reaction to use +type Reaction_content int + +const ( + PLUS_1_REACTION_CONTENT Reaction_content = iota + MINUS_1_REACTION_CONTENT + LAUGH_REACTION_CONTENT + CONFUSED_REACTION_CONTENT + HEART_REACTION_CONTENT + HOORAY_REACTION_CONTENT + ROCKET_REACTION_CONTENT + EYES_REACTION_CONTENT +) + +func (i Reaction_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReaction_content(v string) (any, error) { + result := PLUS_1_REACTION_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTION_CONTENT + case "-1": + result = MINUS_1_REACTION_CONTENT + case "laugh": + result = LAUGH_REACTION_CONTENT + case "confused": + result = CONFUSED_REACTION_CONTENT + case "heart": + result = HEART_REACTION_CONTENT + case "hooray": + result = HOORAY_REACTION_CONTENT + case "rocket": + result = ROCKET_REACTION_CONTENT + case "eyes": + result = EYES_REACTION_CONTENT + default: + return 0, errors.New("Unknown Reaction_content value: " + v) + } + return &result, nil +} +func SerializeReaction_content(values []Reaction_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Reaction_content) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/reaction_rollup.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/reaction_rollup.go new file mode 100644 index 000000000..9b51070e2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/reaction_rollup.go @@ -0,0 +1,341 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ReactionRollup struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The confused property + confused *int32 + // The eyes property + eyes *int32 + // The heart property + heart *int32 + // The hooray property + hooray *int32 + // The laugh property + laugh *int32 + // The minus_1 property + minus_1 *int32 + // The plus_1 property + plus_1 *int32 + // The rocket property + rocket *int32 + // The total_count property + total_count *int32 + // The url property + url *string +} +// NewReactionRollup instantiates a new ReactionRollup and sets the default values. +func NewReactionRollup()(*ReactionRollup) { + m := &ReactionRollup{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReactionRollupFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReactionRollupFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReactionRollup(), 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 *ReactionRollup) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfused gets the confused property value. The confused property +// returns a *int32 when successful +func (m *ReactionRollup) GetConfused()(*int32) { + return m.confused +} +// GetEyes gets the eyes property value. The eyes property +// returns a *int32 when successful +func (m *ReactionRollup) GetEyes()(*int32) { + return m.eyes +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReactionRollup) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["confused"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetConfused(val) + } + return nil + } + res["eyes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetEyes(val) + } + return nil + } + res["heart"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetHeart(val) + } + return nil + } + res["hooray"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetHooray(val) + } + return nil + } + res["laugh"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLaugh(val) + } + return nil + } + res["-1"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMinus1(val) + } + return nil + } + res["+1"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPlus1(val) + } + return nil + } + res["rocket"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRocket(val) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHeart gets the heart property value. The heart property +// returns a *int32 when successful +func (m *ReactionRollup) GetHeart()(*int32) { + return m.heart +} +// GetHooray gets the hooray property value. The hooray property +// returns a *int32 when successful +func (m *ReactionRollup) GetHooray()(*int32) { + return m.hooray +} +// GetLaugh gets the laugh property value. The laugh property +// returns a *int32 when successful +func (m *ReactionRollup) GetLaugh()(*int32) { + return m.laugh +} +// GetMinus1 gets the -1 property value. The minus_1 property +// returns a *int32 when successful +func (m *ReactionRollup) GetMinus1()(*int32) { + return m.minus_1 +} +// GetPlus1 gets the +1 property value. The plus_1 property +// returns a *int32 when successful +func (m *ReactionRollup) GetPlus1()(*int32) { + return m.plus_1 +} +// GetRocket gets the rocket property value. The rocket property +// returns a *int32 when successful +func (m *ReactionRollup) GetRocket()(*int32) { + return m.rocket +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ReactionRollup) GetTotalCount()(*int32) { + return m.total_count +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ReactionRollup) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ReactionRollup) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("confused", m.GetConfused()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("eyes", m.GetEyes()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("heart", m.GetHeart()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("hooray", m.GetHooray()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("laugh", m.GetLaugh()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("-1", m.GetMinus1()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("+1", m.GetPlus1()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("rocket", m.GetRocket()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ReactionRollup) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfused sets the confused property value. The confused property +func (m *ReactionRollup) SetConfused(value *int32)() { + m.confused = value +} +// SetEyes sets the eyes property value. The eyes property +func (m *ReactionRollup) SetEyes(value *int32)() { + m.eyes = value +} +// SetHeart sets the heart property value. The heart property +func (m *ReactionRollup) SetHeart(value *int32)() { + m.heart = value +} +// SetHooray sets the hooray property value. The hooray property +func (m *ReactionRollup) SetHooray(value *int32)() { + m.hooray = value +} +// SetLaugh sets the laugh property value. The laugh property +func (m *ReactionRollup) SetLaugh(value *int32)() { + m.laugh = value +} +// SetMinus1 sets the -1 property value. The minus_1 property +func (m *ReactionRollup) SetMinus1(value *int32)() { + m.minus_1 = value +} +// SetPlus1 sets the +1 property value. The plus_1 property +func (m *ReactionRollup) SetPlus1(value *int32)() { + m.plus_1 = value +} +// SetRocket sets the rocket property value. The rocket property +func (m *ReactionRollup) SetRocket(value *int32)() { + m.rocket = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ReactionRollup) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetUrl sets the url property value. The url property +func (m *ReactionRollup) SetUrl(value *string)() { + m.url = value +} +type ReactionRollupable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetConfused()(*int32) + GetEyes()(*int32) + GetHeart()(*int32) + GetHooray()(*int32) + GetLaugh()(*int32) + GetMinus1()(*int32) + GetPlus1()(*int32) + GetRocket()(*int32) + GetTotalCount()(*int32) + GetUrl()(*string) + SetConfused(value *int32)() + SetEyes(value *int32)() + SetHeart(value *int32)() + SetHooray(value *int32)() + SetLaugh(value *int32)() + SetMinus1(value *int32)() + SetPlus1(value *int32)() + SetRocket(value *int32)() + SetTotalCount(value *int32)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/referenced_workflow.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/referenced_workflow.go new file mode 100644 index 000000000..7b758338d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/referenced_workflow.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ReferencedWorkflow a workflow referenced/reused by the initial caller workflow +type ReferencedWorkflow struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The path property + path *string + // The ref property + ref *string + // The sha property + sha *string +} +// NewReferencedWorkflow instantiates a new ReferencedWorkflow and sets the default values. +func NewReferencedWorkflow()(*ReferencedWorkflow) { + m := &ReferencedWorkflow{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReferencedWorkflowFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReferencedWorkflowFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReferencedWorkflow(), 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 *ReferencedWorkflow) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReferencedWorkflow) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *ReferencedWorkflow) GetPath()(*string) { + return m.path +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *ReferencedWorkflow) GetRef()(*string) { + return m.ref +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *ReferencedWorkflow) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *ReferencedWorkflow) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *ReferencedWorkflow) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPath sets the path property value. The path property +func (m *ReferencedWorkflow) SetPath(value *string)() { + m.path = value +} +// SetRef sets the ref property value. The ref property +func (m *ReferencedWorkflow) SetRef(value *string)() { + m.ref = value +} +// SetSha sets the sha property value. The sha property +func (m *ReferencedWorkflow) SetSha(value *string)() { + m.sha = value +} +type ReferencedWorkflowable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPath()(*string) + GetRef()(*string) + GetSha()(*string) + SetPath(value *string)() + SetRef(value *string)() + SetSha(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/referrer_traffic.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/referrer_traffic.go new file mode 100644 index 000000000..a463ab471 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/referrer_traffic.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ReferrerTraffic referrer Traffic +type ReferrerTraffic struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The count property + count *int32 + // The referrer property + referrer *string + // The uniques property + uniques *int32 +} +// NewReferrerTraffic instantiates a new ReferrerTraffic and sets the default values. +func NewReferrerTraffic()(*ReferrerTraffic) { + m := &ReferrerTraffic{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReferrerTrafficFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReferrerTrafficFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReferrerTraffic(), 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 *ReferrerTraffic) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCount gets the count property value. The count property +// returns a *int32 when successful +func (m *ReferrerTraffic) GetCount()(*int32) { + return m.count +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReferrerTraffic) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCount(val) + } + return nil + } + res["referrer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReferrer(val) + } + return nil + } + res["uniques"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUniques(val) + } + return nil + } + return res +} +// GetReferrer gets the referrer property value. The referrer property +// returns a *string when successful +func (m *ReferrerTraffic) GetReferrer()(*string) { + return m.referrer +} +// GetUniques gets the uniques property value. The uniques property +// returns a *int32 when successful +func (m *ReferrerTraffic) GetUniques()(*int32) { + return m.uniques +} +// Serialize serializes information the current object +func (m *ReferrerTraffic) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("count", m.GetCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("referrer", m.GetReferrer()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("uniques", m.GetUniques()) + 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 *ReferrerTraffic) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCount sets the count property value. The count property +func (m *ReferrerTraffic) SetCount(value *int32)() { + m.count = value +} +// SetReferrer sets the referrer property value. The referrer property +func (m *ReferrerTraffic) SetReferrer(value *string)() { + m.referrer = value +} +// SetUniques sets the uniques property value. The uniques property +func (m *ReferrerTraffic) SetUniques(value *int32)() { + m.uniques = value +} +type ReferrerTrafficable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCount()(*int32) + GetReferrer()(*string) + GetUniques()(*int32) + SetCount(value *int32)() + SetReferrer(value *string)() + SetUniques(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/release.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/release.go new file mode 100644 index 000000000..5f945d700 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/release.go @@ -0,0 +1,732 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Release a release. +type Release struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The assets property + assets []ReleaseAssetable + // The assets_url property + assets_url *string + // A GitHub user. + author SimpleUserable + // The body property + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The URL of the release discussion. + discussion_url *string + // true to create a draft (unpublished) release, false to create a published one. + draft *bool + // The html_url property + html_url *string + // The id property + id *int32 + // The mentions_count property + mentions_count *int32 + // The name property + name *string + // The node_id property + node_id *string + // Whether to identify the release as a prerelease or a full release. + prerelease *bool + // The published_at property + published_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The reactions property + reactions ReactionRollupable + // The name of the tag. + tag_name *string + // The tarball_url property + tarball_url *string + // Specifies the commitish value that determines where the Git tag is created from. + target_commitish *string + // The upload_url property + upload_url *string + // The url property + url *string + // The zipball_url property + zipball_url *string +} +// NewRelease instantiates a new Release and sets the default values. +func NewRelease()(*Release) { + m := &Release{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReleaseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReleaseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRelease(), 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 *Release) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssets gets the assets property value. The assets property +// returns a []ReleaseAssetable when successful +func (m *Release) GetAssets()([]ReleaseAssetable) { + return m.assets +} +// GetAssetsUrl gets the assets_url property value. The assets_url property +// returns a *string when successful +func (m *Release) GetAssetsUrl()(*string) { + return m.assets_url +} +// GetAuthor gets the author property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *Release) GetAuthor()(SimpleUserable) { + return m.author +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *Release) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *Release) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *Release) GetBodyText()(*string) { + return m.body_text +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Release) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDiscussionUrl gets the discussion_url property value. The URL of the release discussion. +// returns a *string when successful +func (m *Release) GetDiscussionUrl()(*string) { + return m.discussion_url +} +// GetDraft gets the draft property value. true to create a draft (unpublished) release, false to create a published one. +// returns a *bool when successful +func (m *Release) GetDraft()(*bool) { + return m.draft +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Release) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["assets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateReleaseAssetFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ReleaseAssetable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ReleaseAssetable) + } + } + m.SetAssets(res) + } + return nil + } + res["assets_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssetsUrl(val) + } + return nil + } + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(SimpleUserable)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["discussion_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiscussionUrl(val) + } + return nil + } + res["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["mentions_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMentionsCount(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["prerelease"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrerelease(val) + } + return nil + } + res["published_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPublishedAt(val) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["tag_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagName(val) + } + return nil + } + res["tarball_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTarballUrl(val) + } + return nil + } + res["target_commitish"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetCommitish(val) + } + return nil + } + res["upload_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUploadUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["zipball_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetZipballUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Release) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Release) GetId()(*int32) { + return m.id +} +// GetMentionsCount gets the mentions_count property value. The mentions_count property +// returns a *int32 when successful +func (m *Release) GetMentionsCount()(*int32) { + return m.mentions_count +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *Release) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Release) GetNodeId()(*string) { + return m.node_id +} +// GetPrerelease gets the prerelease property value. Whether to identify the release as a prerelease or a full release. +// returns a *bool when successful +func (m *Release) GetPrerelease()(*bool) { + return m.prerelease +} +// GetPublishedAt gets the published_at property value. The published_at property +// returns a *Time when successful +func (m *Release) GetPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.published_at +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *Release) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetTagName gets the tag_name property value. The name of the tag. +// returns a *string when successful +func (m *Release) GetTagName()(*string) { + return m.tag_name +} +// GetTarballUrl gets the tarball_url property value. The tarball_url property +// returns a *string when successful +func (m *Release) GetTarballUrl()(*string) { + return m.tarball_url +} +// GetTargetCommitish gets the target_commitish property value. Specifies the commitish value that determines where the Git tag is created from. +// returns a *string when successful +func (m *Release) GetTargetCommitish()(*string) { + return m.target_commitish +} +// GetUploadUrl gets the upload_url property value. The upload_url property +// returns a *string when successful +func (m *Release) GetUploadUrl()(*string) { + return m.upload_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Release) GetUrl()(*string) { + return m.url +} +// GetZipballUrl gets the zipball_url property value. The zipball_url property +// returns a *string when successful +func (m *Release) GetZipballUrl()(*string) { + return m.zipball_url +} +// Serialize serializes information the current object +func (m *Release) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAssets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAssets())) + for i, v := range m.GetAssets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("assets", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assets_url", m.GetAssetsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("discussion_url", m.GetDiscussionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("mentions_count", m.GetMentionsCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("prerelease", m.GetPrerelease()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("published_at", m.GetPublishedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tag_name", m.GetTagName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tarball_url", m.GetTarballUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_commitish", m.GetTargetCommitish()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("upload_url", m.GetUploadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("zipball_url", m.GetZipballUrl()) + 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 *Release) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssets sets the assets property value. The assets property +func (m *Release) SetAssets(value []ReleaseAssetable)() { + m.assets = value +} +// SetAssetsUrl sets the assets_url property value. The assets_url property +func (m *Release) SetAssetsUrl(value *string)() { + m.assets_url = value +} +// SetAuthor sets the author property value. A GitHub user. +func (m *Release) SetAuthor(value SimpleUserable)() { + m.author = value +} +// SetBody sets the body property value. The body property +func (m *Release) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *Release) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *Release) SetBodyText(value *string)() { + m.body_text = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Release) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDiscussionUrl sets the discussion_url property value. The URL of the release discussion. +func (m *Release) SetDiscussionUrl(value *string)() { + m.discussion_url = value +} +// SetDraft sets the draft property value. true to create a draft (unpublished) release, false to create a published one. +func (m *Release) SetDraft(value *bool)() { + m.draft = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Release) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Release) SetId(value *int32)() { + m.id = value +} +// SetMentionsCount sets the mentions_count property value. The mentions_count property +func (m *Release) SetMentionsCount(value *int32)() { + m.mentions_count = value +} +// SetName sets the name property value. The name property +func (m *Release) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Release) SetNodeId(value *string)() { + m.node_id = value +} +// SetPrerelease sets the prerelease property value. Whether to identify the release as a prerelease or a full release. +func (m *Release) SetPrerelease(value *bool)() { + m.prerelease = value +} +// SetPublishedAt sets the published_at property value. The published_at property +func (m *Release) SetPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.published_at = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *Release) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetTagName sets the tag_name property value. The name of the tag. +func (m *Release) SetTagName(value *string)() { + m.tag_name = value +} +// SetTarballUrl sets the tarball_url property value. The tarball_url property +func (m *Release) SetTarballUrl(value *string)() { + m.tarball_url = value +} +// SetTargetCommitish sets the target_commitish property value. Specifies the commitish value that determines where the Git tag is created from. +func (m *Release) SetTargetCommitish(value *string)() { + m.target_commitish = value +} +// SetUploadUrl sets the upload_url property value. The upload_url property +func (m *Release) SetUploadUrl(value *string)() { + m.upload_url = value +} +// SetUrl sets the url property value. The url property +func (m *Release) SetUrl(value *string)() { + m.url = value +} +// SetZipballUrl sets the zipball_url property value. The zipball_url property +func (m *Release) SetZipballUrl(value *string)() { + m.zipball_url = value +} +type Releaseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssets()([]ReleaseAssetable) + GetAssetsUrl()(*string) + GetAuthor()(SimpleUserable) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDiscussionUrl()(*string) + GetDraft()(*bool) + GetHtmlUrl()(*string) + GetId()(*int32) + GetMentionsCount()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetPrerelease()(*bool) + GetPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReactions()(ReactionRollupable) + GetTagName()(*string) + GetTarballUrl()(*string) + GetTargetCommitish()(*string) + GetUploadUrl()(*string) + GetUrl()(*string) + GetZipballUrl()(*string) + SetAssets(value []ReleaseAssetable)() + SetAssetsUrl(value *string)() + SetAuthor(value SimpleUserable)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDiscussionUrl(value *string)() + SetDraft(value *bool)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetMentionsCount(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetPrerelease(value *bool)() + SetPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReactions(value ReactionRollupable)() + SetTagName(value *string)() + SetTarballUrl(value *string)() + SetTargetCommitish(value *string)() + SetUploadUrl(value *string)() + SetUrl(value *string)() + SetZipballUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/release_asset.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/release_asset.go new file mode 100644 index 000000000..019e884ea --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/release_asset.go @@ -0,0 +1,431 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ReleaseAsset data related to a release. +type ReleaseAsset struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The browser_download_url property + browser_download_url *string + // The content_type property + content_type *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The download_count property + download_count *int32 + // The id property + id *int32 + // The label property + label *string + // The file name of the asset. + name *string + // The node_id property + node_id *string + // The size property + size *int32 + // State of the release asset. + state *ReleaseAsset_state + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + uploader NullableSimpleUserable + // The url property + url *string +} +// NewReleaseAsset instantiates a new ReleaseAsset and sets the default values. +func NewReleaseAsset()(*ReleaseAsset) { + m := &ReleaseAsset{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReleaseAssetFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReleaseAssetFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReleaseAsset(), 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 *ReleaseAsset) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBrowserDownloadUrl gets the browser_download_url property value. The browser_download_url property +// returns a *string when successful +func (m *ReleaseAsset) GetBrowserDownloadUrl()(*string) { + return m.browser_download_url +} +// GetContentType gets the content_type property value. The content_type property +// returns a *string when successful +func (m *ReleaseAsset) GetContentType()(*string) { + return m.content_type +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *ReleaseAsset) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDownloadCount gets the download_count property value. The download_count property +// returns a *int32 when successful +func (m *ReleaseAsset) GetDownloadCount()(*int32) { + return m.download_count +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReleaseAsset) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["browser_download_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBrowserDownloadUrl(val) + } + return nil + } + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["download_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDownloadCount(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabel(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseReleaseAsset_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*ReleaseAsset_state)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["uploader"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUploader(val.(NullableSimpleUserable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *ReleaseAsset) GetId()(*int32) { + return m.id +} +// GetLabel gets the label property value. The label property +// returns a *string when successful +func (m *ReleaseAsset) GetLabel()(*string) { + return m.label +} +// GetName gets the name property value. The file name of the asset. +// returns a *string when successful +func (m *ReleaseAsset) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *ReleaseAsset) GetNodeId()(*string) { + return m.node_id +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *ReleaseAsset) GetSize()(*int32) { + return m.size +} +// GetState gets the state property value. State of the release asset. +// returns a *ReleaseAsset_state when successful +func (m *ReleaseAsset) GetState()(*ReleaseAsset_state) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *ReleaseAsset) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUploader gets the uploader property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *ReleaseAsset) GetUploader()(NullableSimpleUserable) { + return m.uploader +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ReleaseAsset) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ReleaseAsset) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("browser_download_url", m.GetBrowserDownloadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("download_count", m.GetDownloadCount()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("uploader", m.GetUploader()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ReleaseAsset) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBrowserDownloadUrl sets the browser_download_url property value. The browser_download_url property +func (m *ReleaseAsset) SetBrowserDownloadUrl(value *string)() { + m.browser_download_url = value +} +// SetContentType sets the content_type property value. The content_type property +func (m *ReleaseAsset) SetContentType(value *string)() { + m.content_type = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ReleaseAsset) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDownloadCount sets the download_count property value. The download_count property +func (m *ReleaseAsset) SetDownloadCount(value *int32)() { + m.download_count = value +} +// SetId sets the id property value. The id property +func (m *ReleaseAsset) SetId(value *int32)() { + m.id = value +} +// SetLabel sets the label property value. The label property +func (m *ReleaseAsset) SetLabel(value *string)() { + m.label = value +} +// SetName sets the name property value. The file name of the asset. +func (m *ReleaseAsset) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *ReleaseAsset) SetNodeId(value *string)() { + m.node_id = value +} +// SetSize sets the size property value. The size property +func (m *ReleaseAsset) SetSize(value *int32)() { + m.size = value +} +// SetState sets the state property value. State of the release asset. +func (m *ReleaseAsset) SetState(value *ReleaseAsset_state)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *ReleaseAsset) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUploader sets the uploader property value. A GitHub user. +func (m *ReleaseAsset) SetUploader(value NullableSimpleUserable)() { + m.uploader = value +} +// SetUrl sets the url property value. The url property +func (m *ReleaseAsset) SetUrl(value *string)() { + m.url = value +} +type ReleaseAssetable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBrowserDownloadUrl()(*string) + GetContentType()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDownloadCount()(*int32) + GetId()(*int32) + GetLabel()(*string) + GetName()(*string) + GetNodeId()(*string) + GetSize()(*int32) + GetState()(*ReleaseAsset_state) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUploader()(NullableSimpleUserable) + GetUrl()(*string) + SetBrowserDownloadUrl(value *string)() + SetContentType(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDownloadCount(value *int32)() + SetId(value *int32)() + SetLabel(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetSize(value *int32)() + SetState(value *ReleaseAsset_state)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUploader(value NullableSimpleUserable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/release_asset_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/release_asset_state.go new file mode 100644 index 000000000..49e5417a3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/release_asset_state.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// State of the release asset. +type ReleaseAsset_state int + +const ( + UPLOADED_RELEASEASSET_STATE ReleaseAsset_state = iota + OPEN_RELEASEASSET_STATE +) + +func (i ReleaseAsset_state) String() string { + return []string{"uploaded", "open"}[i] +} +func ParseReleaseAsset_state(v string) (any, error) { + result := UPLOADED_RELEASEASSET_STATE + switch v { + case "uploaded": + result = UPLOADED_RELEASEASSET_STATE + case "open": + result = OPEN_RELEASEASSET_STATE + default: + return 0, errors.New("Unknown ReleaseAsset_state value: " + v) + } + return &result, nil +} +func SerializeReleaseAsset_state(values []ReleaseAsset_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReleaseAsset_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/release_notes_content.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/release_notes_content.go new file mode 100644 index 000000000..30f4b092d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/release_notes_content.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ReleaseNotesContent generated name and body describing a release +type ReleaseNotesContent struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The generated body describing the contents of the release supporting markdown formatting + body *string + // The generated name of the release + name *string +} +// NewReleaseNotesContent instantiates a new ReleaseNotesContent and sets the default values. +func NewReleaseNotesContent()(*ReleaseNotesContent) { + m := &ReleaseNotesContent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReleaseNotesContentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReleaseNotesContentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReleaseNotesContent(), 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 *ReleaseNotesContent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The generated body describing the contents of the release supporting markdown formatting +// returns a *string when successful +func (m *ReleaseNotesContent) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReleaseNotesContent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The generated name of the release +// returns a *string when successful +func (m *ReleaseNotesContent) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ReleaseNotesContent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ReleaseNotesContent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The generated body describing the contents of the release supporting markdown formatting +func (m *ReleaseNotesContent) SetBody(value *string)() { + m.body = value +} +// SetName sets the name property value. The generated name of the release +func (m *ReleaseNotesContent) SetName(value *string)() { + m.name = value +} +type ReleaseNotesContentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetName()(*string) + SetBody(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/removed_from_project_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/removed_from_project_issue_event.go new file mode 100644 index 000000000..a88a6240f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/removed_from_project_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RemovedFromProjectIssueEvent removed from Project Issue Event +type RemovedFromProjectIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The project_card property + project_card RemovedFromProjectIssueEvent_project_cardable + // The url property + url *string +} +// NewRemovedFromProjectIssueEvent instantiates a new RemovedFromProjectIssueEvent and sets the default values. +func NewRemovedFromProjectIssueEvent()(*RemovedFromProjectIssueEvent) { + m := &RemovedFromProjectIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRemovedFromProjectIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRemovedFromProjectIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRemovedFromProjectIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *RemovedFromProjectIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *RemovedFromProjectIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RemovedFromProjectIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["project_card"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRemovedFromProjectIssueEvent_project_cardFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProjectCard(val.(RemovedFromProjectIssueEvent_project_cardable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *RemovedFromProjectIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *RemovedFromProjectIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetProjectCard gets the project_card property value. The project_card property +// returns a RemovedFromProjectIssueEvent_project_cardable when successful +func (m *RemovedFromProjectIssueEvent) GetProjectCard()(RemovedFromProjectIssueEvent_project_cardable) { + return m.project_card +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *RemovedFromProjectIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("project_card", m.GetProjectCard()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *RemovedFromProjectIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *RemovedFromProjectIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *RemovedFromProjectIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *RemovedFromProjectIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *RemovedFromProjectIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *RemovedFromProjectIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *RemovedFromProjectIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *RemovedFromProjectIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *RemovedFromProjectIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetProjectCard sets the project_card property value. The project_card property +func (m *RemovedFromProjectIssueEvent) SetProjectCard(value RemovedFromProjectIssueEvent_project_cardable)() { + m.project_card = value +} +// SetUrl sets the url property value. The url property +func (m *RemovedFromProjectIssueEvent) SetUrl(value *string)() { + m.url = value +} +type RemovedFromProjectIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetProjectCard()(RemovedFromProjectIssueEvent_project_cardable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetProjectCard(value RemovedFromProjectIssueEvent_project_cardable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/removed_from_project_issue_event_project_card.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/removed_from_project_issue_event_project_card.go new file mode 100644 index 000000000..23745ae17 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/removed_from_project_issue_event_project_card.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RemovedFromProjectIssueEvent_project_card struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The column_name property + column_name *string + // The id property + id *int32 + // The previous_column_name property + previous_column_name *string + // The project_id property + project_id *int32 + // The project_url property + project_url *string + // The url property + url *string +} +// NewRemovedFromProjectIssueEvent_project_card instantiates a new RemovedFromProjectIssueEvent_project_card and sets the default values. +func NewRemovedFromProjectIssueEvent_project_card()(*RemovedFromProjectIssueEvent_project_card) { + m := &RemovedFromProjectIssueEvent_project_card{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRemovedFromProjectIssueEvent_project_cardFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRemovedFromProjectIssueEvent_project_cardFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRemovedFromProjectIssueEvent_project_card(), 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 *RemovedFromProjectIssueEvent_project_card) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColumnName gets the column_name property value. The column_name property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent_project_card) GetColumnName()(*string) { + return m.column_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RemovedFromProjectIssueEvent_project_card) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnName(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["previous_column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviousColumnName(val) + } + return nil + } + res["project_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetProjectId(val) + } + return nil + } + res["project_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProjectUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *RemovedFromProjectIssueEvent_project_card) GetId()(*int32) { + return m.id +} +// GetPreviousColumnName gets the previous_column_name property value. The previous_column_name property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent_project_card) GetPreviousColumnName()(*string) { + return m.previous_column_name +} +// GetProjectId gets the project_id property value. The project_id property +// returns a *int32 when successful +func (m *RemovedFromProjectIssueEvent_project_card) GetProjectId()(*int32) { + return m.project_id +} +// GetProjectUrl gets the project_url property value. The project_url property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent_project_card) GetProjectUrl()(*string) { + return m.project_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent_project_card) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *RemovedFromProjectIssueEvent_project_card) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("column_name", m.GetColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("previous_column_name", m.GetPreviousColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("project_id", m.GetProjectId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("project_url", m.GetProjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *RemovedFromProjectIssueEvent_project_card) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColumnName sets the column_name property value. The column_name property +func (m *RemovedFromProjectIssueEvent_project_card) SetColumnName(value *string)() { + m.column_name = value +} +// SetId sets the id property value. The id property +func (m *RemovedFromProjectIssueEvent_project_card) SetId(value *int32)() { + m.id = value +} +// SetPreviousColumnName sets the previous_column_name property value. The previous_column_name property +func (m *RemovedFromProjectIssueEvent_project_card) SetPreviousColumnName(value *string)() { + m.previous_column_name = value +} +// SetProjectId sets the project_id property value. The project_id property +func (m *RemovedFromProjectIssueEvent_project_card) SetProjectId(value *int32)() { + m.project_id = value +} +// SetProjectUrl sets the project_url property value. The project_url property +func (m *RemovedFromProjectIssueEvent_project_card) SetProjectUrl(value *string)() { + m.project_url = value +} +// SetUrl sets the url property value. The url property +func (m *RemovedFromProjectIssueEvent_project_card) SetUrl(value *string)() { + m.url = value +} +type RemovedFromProjectIssueEvent_project_cardable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColumnName()(*string) + GetId()(*int32) + GetPreviousColumnName()(*string) + GetProjectId()(*int32) + GetProjectUrl()(*string) + GetUrl()(*string) + SetColumnName(value *string)() + SetId(value *int32)() + SetPreviousColumnName(value *string)() + SetProjectId(value *int32)() + SetProjectUrl(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/renamed_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/renamed_issue_event.go new file mode 100644 index 000000000..fe0c701ca --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/renamed_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RenamedIssueEvent renamed Issue Event +type RenamedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The rename property + rename RenamedIssueEvent_renameable + // The url property + url *string +} +// NewRenamedIssueEvent instantiates a new RenamedIssueEvent and sets the default values. +func NewRenamedIssueEvent()(*RenamedIssueEvent) { + m := &RenamedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRenamedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRenamedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRenamedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *RenamedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *RenamedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *RenamedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *RenamedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *RenamedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *RenamedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RenamedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["rename"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRenamedIssueEvent_renameFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRename(val.(RenamedIssueEvent_renameable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *RenamedIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *RenamedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *RenamedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetRename gets the rename property value. The rename property +// returns a RenamedIssueEvent_renameable when successful +func (m *RenamedIssueEvent) GetRename()(RenamedIssueEvent_renameable) { + return m.rename +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *RenamedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *RenamedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("rename", m.GetRename()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *RenamedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *RenamedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *RenamedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *RenamedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *RenamedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *RenamedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *RenamedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *RenamedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *RenamedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetRename sets the rename property value. The rename property +func (m *RenamedIssueEvent) SetRename(value RenamedIssueEvent_renameable)() { + m.rename = value +} +// SetUrl sets the url property value. The url property +func (m *RenamedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type RenamedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetRename()(RenamedIssueEvent_renameable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetRename(value RenamedIssueEvent_renameable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/renamed_issue_event_rename.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/renamed_issue_event_rename.go new file mode 100644 index 000000000..8eee09cda --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/renamed_issue_event_rename.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RenamedIssueEvent_rename struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The from property + from *string + // The to property + to *string +} +// NewRenamedIssueEvent_rename instantiates a new RenamedIssueEvent_rename and sets the default values. +func NewRenamedIssueEvent_rename()(*RenamedIssueEvent_rename) { + m := &RenamedIssueEvent_rename{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRenamedIssueEvent_renameFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRenamedIssueEvent_renameFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRenamedIssueEvent_rename(), 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 *RenamedIssueEvent_rename) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RenamedIssueEvent_rename) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["from"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFrom(val) + } + return nil + } + res["to"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTo(val) + } + return nil + } + return res +} +// GetFrom gets the from property value. The from property +// returns a *string when successful +func (m *RenamedIssueEvent_rename) GetFrom()(*string) { + return m.from +} +// GetTo gets the to property value. The to property +// returns a *string when successful +func (m *RenamedIssueEvent_rename) GetTo()(*string) { + return m.to +} +// Serialize serializes information the current object +func (m *RenamedIssueEvent_rename) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("from", m.GetFrom()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("to", m.GetTo()) + 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 *RenamedIssueEvent_rename) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFrom sets the from property value. The from property +func (m *RenamedIssueEvent_rename) SetFrom(value *string)() { + m.from = value +} +// SetTo sets the to property value. The to property +func (m *RenamedIssueEvent_rename) SetTo(value *string)() { + m.to = value +} +type RenamedIssueEvent_renameable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFrom()(*string) + GetTo()(*string) + SetFrom(value *string)() + SetTo(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repo_codespaces_secret.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repo_codespaces_secret.go new file mode 100644 index 000000000..336b94e1c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repo_codespaces_secret.go @@ -0,0 +1,140 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepoCodespacesSecret set repository secrets for GitHub Codespaces. +type RepoCodespacesSecret struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the secret. + name *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewRepoCodespacesSecret instantiates a new RepoCodespacesSecret and sets the default values. +func NewRepoCodespacesSecret()(*RepoCodespacesSecret) { + m := &RepoCodespacesSecret{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepoCodespacesSecretFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepoCodespacesSecretFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepoCodespacesSecret(), 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 *RepoCodespacesSecret) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *RepoCodespacesSecret) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepoCodespacesSecret) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the secret. +// returns a *string when successful +func (m *RepoCodespacesSecret) GetName()(*string) { + return m.name +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *RepoCodespacesSecret) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *RepoCodespacesSecret) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + 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 *RepoCodespacesSecret) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *RepoCodespacesSecret) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetName sets the name property value. The name of the secret. +func (m *RepoCodespacesSecret) SetName(value *string)() { + m.name = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *RepoCodespacesSecret) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type RepoCodespacesSecretable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repo_search_result_item.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repo_search_result_item.go new file mode 100644 index 000000000..607659016 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repo_search_result_item.go @@ -0,0 +1,2652 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepoSearchResultItem repo Search Result Item +type RepoSearchResultItem struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The allow_auto_merge property + allow_auto_merge *bool + // The allow_forking property + allow_forking *bool + // The allow_merge_commit property + allow_merge_commit *bool + // The allow_rebase_merge property + allow_rebase_merge *bool + // The allow_squash_merge property + allow_squash_merge *bool + // The archive_url property + archive_url *string + // The archived property + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default_branch property + default_branch *string + // The delete_branch_on_merge property + delete_branch_on_merge *bool + // The deployments_url property + deployments_url *string + // The description property + description *string + // Returns whether or not this repository disabled. + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // The has_discussions property + has_discussions *bool + // The has_downloads property + has_downloads *bool + // The has_issues property + has_issues *bool + // The has_pages property + has_pages *bool + // The has_projects property + has_projects *bool + // The has_wiki property + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The is_template property + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // License Simple + license NullableLicenseSimpleable + // The master_branch property + master_branch *string + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name property + name *string + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // A GitHub user. + owner NullableSimpleUserable + // The permissions property + permissions RepoSearchResultItem_permissionsable + // The private property + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The score property + score *float64 + // The size property + size *int32 + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The statuses_url property + statuses_url *string + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The text_matches property + text_matches []Repositoriesable + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The repository visibility: public, private, or internal. + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // The web_commit_signoff_required property + web_commit_signoff_required *bool +} +// NewRepoSearchResultItem instantiates a new RepoSearchResultItem and sets the default values. +func NewRepoSearchResultItem()(*RepoSearchResultItem) { + m := &RepoSearchResultItem{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepoSearchResultItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepoSearchResultItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepoSearchResultItem(), 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 *RepoSearchResultItem) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. The allow_auto_merge property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowForking gets the allow_forking property value. The allow_forking property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. The allow_merge_commit property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. The allow_rebase_merge property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. The allow_squash_merge property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetArchived gets the archived property value. The archived property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *RepoSearchResultItem) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default_branch property +// returns a *string when successful +func (m *RepoSearchResultItem) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. The delete_branch_on_merge property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *RepoSearchResultItem) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. Returns whether or not this repository disabled. +// returns a *bool when successful +func (m *RepoSearchResultItem) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepoSearchResultItem) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableLicenseSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(NullableLicenseSimpleable)) + } + return nil + } + res["master_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMasterBranch(val) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(NullableSimpleUserable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepoSearchResultItem_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(RepoSearchResultItem_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["text_matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoriesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Repositoriesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Repositoriesable) + } + } + m.SetTextMatches(res) + } + return nil + } + res["topics"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *RepoSearchResultItem) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDiscussions gets the has_discussions property value. The has_discussions property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. The has_downloads property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. The has_issues property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. The has_projects property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. The has_wiki property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *RepoSearchResultItem) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetId()(*int32) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. The is_template property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *RepoSearchResultItem) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. License Simple +// returns a NullableLicenseSimpleable when successful +func (m *RepoSearchResultItem) GetLicense()(NullableLicenseSimpleable) { + return m.license +} +// GetMasterBranch gets the master_branch property value. The master_branch property +// returns a *string when successful +func (m *RepoSearchResultItem) GetMasterBranch()(*string) { + return m.master_branch +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *RepoSearchResultItem) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *RepoSearchResultItem) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *RepoSearchResultItem) GetOwner()(NullableSimpleUserable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a RepoSearchResultItem_permissionsable when successful +func (m *RepoSearchResultItem) GetPermissions()(RepoSearchResultItem_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. The private property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *RepoSearchResultItem) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetScore gets the score property value. The score property +// returns a *float64 when successful +func (m *RepoSearchResultItem) GetScore()(*float64) { + return m.score +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetSize()(*int32) { + return m.size +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *RepoSearchResultItem) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTextMatches gets the text_matches property value. The text_matches property +// returns a []Repositoriesable when successful +func (m *RepoSearchResultItem) GetTextMatches()([]Repositoriesable) { + return m.text_matches +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *RepoSearchResultItem) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *RepoSearchResultItem) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetUrl()(*string) { + return m.url +} +// GetVisibility gets the visibility property value. The repository visibility: public, private, or internal. +// returns a *string when successful +func (m *RepoSearchResultItem) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. The web_commit_signoff_required property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *RepoSearchResultItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("master_branch", m.GetMasterBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("score", m.GetScore()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTextMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTextMatches())) + for i, v := range m.GetTextMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("text_matches", cast) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *RepoSearchResultItem) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. The allow_auto_merge property +func (m *RepoSearchResultItem) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowForking sets the allow_forking property value. The allow_forking property +func (m *RepoSearchResultItem) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. The allow_merge_commit property +func (m *RepoSearchResultItem) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. The allow_rebase_merge property +func (m *RepoSearchResultItem) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. The allow_squash_merge property +func (m *RepoSearchResultItem) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetArchived sets the archived property value. The archived property +func (m *RepoSearchResultItem) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *RepoSearchResultItem) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *RepoSearchResultItem) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *RepoSearchResultItem) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *RepoSearchResultItem) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *RepoSearchResultItem) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *RepoSearchResultItem) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *RepoSearchResultItem) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *RepoSearchResultItem) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *RepoSearchResultItem) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *RepoSearchResultItem) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *RepoSearchResultItem) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *RepoSearchResultItem) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default_branch property +func (m *RepoSearchResultItem) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. The delete_branch_on_merge property +func (m *RepoSearchResultItem) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *RepoSearchResultItem) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *RepoSearchResultItem) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. Returns whether or not this repository disabled. +func (m *RepoSearchResultItem) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *RepoSearchResultItem) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *RepoSearchResultItem) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *RepoSearchResultItem) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *RepoSearchResultItem) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *RepoSearchResultItem) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *RepoSearchResultItem) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *RepoSearchResultItem) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *RepoSearchResultItem) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *RepoSearchResultItem) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *RepoSearchResultItem) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *RepoSearchResultItem) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDiscussions sets the has_discussions property value. The has_discussions property +func (m *RepoSearchResultItem) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. The has_downloads property +func (m *RepoSearchResultItem) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. The has_issues property +func (m *RepoSearchResultItem) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *RepoSearchResultItem) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. The has_projects property +func (m *RepoSearchResultItem) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. The has_wiki property +func (m *RepoSearchResultItem) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *RepoSearchResultItem) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *RepoSearchResultItem) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *RepoSearchResultItem) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *RepoSearchResultItem) SetId(value *int32)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *RepoSearchResultItem) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *RepoSearchResultItem) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *RepoSearchResultItem) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. The is_template property +func (m *RepoSearchResultItem) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *RepoSearchResultItem) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *RepoSearchResultItem) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *RepoSearchResultItem) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *RepoSearchResultItem) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. License Simple +func (m *RepoSearchResultItem) SetLicense(value NullableLicenseSimpleable)() { + m.license = value +} +// SetMasterBranch sets the master_branch property value. The master_branch property +func (m *RepoSearchResultItem) SetMasterBranch(value *string)() { + m.master_branch = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *RepoSearchResultItem) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *RepoSearchResultItem) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *RepoSearchResultItem) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name property +func (m *RepoSearchResultItem) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *RepoSearchResultItem) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *RepoSearchResultItem) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *RepoSearchResultItem) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *RepoSearchResultItem) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *RepoSearchResultItem) SetOwner(value NullableSimpleUserable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *RepoSearchResultItem) SetPermissions(value RepoSearchResultItem_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. The private property +func (m *RepoSearchResultItem) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *RepoSearchResultItem) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *RepoSearchResultItem) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *RepoSearchResultItem) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetScore sets the score property value. The score property +func (m *RepoSearchResultItem) SetScore(value *float64)() { + m.score = value +} +// SetSize sets the size property value. The size property +func (m *RepoSearchResultItem) SetSize(value *int32)() { + m.size = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *RepoSearchResultItem) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *RepoSearchResultItem) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *RepoSearchResultItem) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *RepoSearchResultItem) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *RepoSearchResultItem) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *RepoSearchResultItem) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *RepoSearchResultItem) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *RepoSearchResultItem) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *RepoSearchResultItem) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *RepoSearchResultItem) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTextMatches sets the text_matches property value. The text_matches property +func (m *RepoSearchResultItem) SetTextMatches(value []Repositoriesable)() { + m.text_matches = value +} +// SetTopics sets the topics property value. The topics property +func (m *RepoSearchResultItem) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *RepoSearchResultItem) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *RepoSearchResultItem) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *RepoSearchResultItem) SetUrl(value *string)() { + m.url = value +} +// SetVisibility sets the visibility property value. The repository visibility: public, private, or internal. +func (m *RepoSearchResultItem) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *RepoSearchResultItem) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *RepoSearchResultItem) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. The web_commit_signoff_required property +func (m *RepoSearchResultItem) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type RepoSearchResultItemable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(NullableLicenseSimpleable) + GetMasterBranch()(*string) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOwner()(NullableSimpleUserable) + GetPermissions()(RepoSearchResultItem_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetScore()(*float64) + GetSize()(*int32) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTextMatches()([]Repositoriesable) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowAutoMerge(value *bool)() + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value NullableLicenseSimpleable)() + SetMasterBranch(value *string)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOwner(value NullableSimpleUserable)() + SetPermissions(value RepoSearchResultItem_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetScore(value *float64)() + SetSize(value *int32)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTextMatches(value []Repositoriesable)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repo_search_result_item_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repo_search_result_item_permissions.go new file mode 100644 index 000000000..100580e1a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repo_search_result_item_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepoSearchResultItem_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewRepoSearchResultItem_permissions instantiates a new RepoSearchResultItem_permissions and sets the default values. +func NewRepoSearchResultItem_permissions()(*RepoSearchResultItem_permissions) { + m := &RepoSearchResultItem_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepoSearchResultItem_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepoSearchResultItem_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepoSearchResultItem_permissions(), 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 *RepoSearchResultItem_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *RepoSearchResultItem_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepoSearchResultItem_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *RepoSearchResultItem_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *RepoSearchResultItem_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *RepoSearchResultItem_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *RepoSearchResultItem_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *RepoSearchResultItem_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *RepoSearchResultItem_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *RepoSearchResultItem_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *RepoSearchResultItem_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *RepoSearchResultItem_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *RepoSearchResultItem_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *RepoSearchResultItem_permissions) SetTriage(value *bool)() { + m.triage = value +} +type RepoSearchResultItem_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repositories.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repositories.go new file mode 100644 index 000000000..74af2a428 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repositories.go @@ -0,0 +1,208 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Repositories struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The fragment property + fragment *string + // The matches property + matches []Repositories_matchesable + // The object_type property + object_type *string + // The object_url property + object_url *string + // The property property + property *string +} +// NewRepositories instantiates a new Repositories and sets the default values. +func NewRepositories()(*Repositories) { + m := &Repositories{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoriesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoriesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositories(), 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 *Repositories) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Repositories) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["fragment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFragment(val) + } + return nil + } + res["matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositories_matchesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Repositories_matchesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Repositories_matchesable) + } + } + m.SetMatches(res) + } + return nil + } + res["object_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectType(val) + } + return nil + } + res["object_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectUrl(val) + } + return nil + } + res["property"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProperty(val) + } + return nil + } + return res +} +// GetFragment gets the fragment property value. The fragment property +// returns a *string when successful +func (m *Repositories) GetFragment()(*string) { + return m.fragment +} +// GetMatches gets the matches property value. The matches property +// returns a []Repositories_matchesable when successful +func (m *Repositories) GetMatches()([]Repositories_matchesable) { + return m.matches +} +// GetObjectType gets the object_type property value. The object_type property +// returns a *string when successful +func (m *Repositories) GetObjectType()(*string) { + return m.object_type +} +// GetObjectUrl gets the object_url property value. The object_url property +// returns a *string when successful +func (m *Repositories) GetObjectUrl()(*string) { + return m.object_url +} +// GetProperty gets the property property value. The property property +// returns a *string when successful +func (m *Repositories) GetProperty()(*string) { + return m.property +} +// Serialize serializes information the current object +func (m *Repositories) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("fragment", m.GetFragment()) + if err != nil { + return err + } + } + if m.GetMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMatches())) + for i, v := range m.GetMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_type", m.GetObjectType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_url", m.GetObjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("property", m.GetProperty()) + 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 *Repositories) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFragment sets the fragment property value. The fragment property +func (m *Repositories) SetFragment(value *string)() { + m.fragment = value +} +// SetMatches sets the matches property value. The matches property +func (m *Repositories) SetMatches(value []Repositories_matchesable)() { + m.matches = value +} +// SetObjectType sets the object_type property value. The object_type property +func (m *Repositories) SetObjectType(value *string)() { + m.object_type = value +} +// SetObjectUrl sets the object_url property value. The object_url property +func (m *Repositories) SetObjectUrl(value *string)() { + m.object_url = value +} +// SetProperty sets the property property value. The property property +func (m *Repositories) SetProperty(value *string)() { + m.property = value +} +type Repositoriesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFragment()(*string) + GetMatches()([]Repositories_matchesable) + GetObjectType()(*string) + GetObjectUrl()(*string) + GetProperty()(*string) + SetFragment(value *string)() + SetMatches(value []Repositories_matchesable)() + SetObjectType(value *string)() + SetObjectUrl(value *string)() + SetProperty(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repositories503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repositories503_error.go new file mode 100644 index 000000000..20d33b202 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repositories503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Repositories503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewRepositories503Error instantiates a new Repositories503Error and sets the default values. +func NewRepositories503Error()(*Repositories503Error) { + m := &Repositories503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositories503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositories503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositories503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Repositories503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Repositories503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Repositories503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Repositories503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Repositories503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Repositories503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Repositories503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *Repositories503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Repositories503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Repositories503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Repositories503Error) SetMessage(value *string)() { + m.message = value +} +type Repositories503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repositories_matches.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repositories_matches.go new file mode 100644 index 000000000..edcfdb174 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repositories_matches.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Repositories_matches struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The indices property + indices []int32 + // The text property + text *string +} +// NewRepositories_matches instantiates a new Repositories_matches and sets the default values. +func NewRepositories_matches()(*Repositories_matches) { + m := &Repositories_matches{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositories_matchesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositories_matchesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositories_matches(), 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 *Repositories_matches) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Repositories_matches) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["indices"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetIndices(res) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetIndices gets the indices property value. The indices property +// returns a []int32 when successful +func (m *Repositories_matches) GetIndices()([]int32) { + return m.indices +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *Repositories_matches) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *Repositories_matches) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIndices() != nil { + err := writer.WriteCollectionOfInt32Values("indices", m.GetIndices()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + 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 *Repositories_matches) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIndices sets the indices property value. The indices property +func (m *Repositories_matches) SetIndices(value []int32)() { + m.indices = value +} +// SetText sets the text property value. The text property +func (m *Repositories_matches) SetText(value *string)() { + m.text = value +} +type Repositories_matchesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIndices()([]int32) + GetText()(*string) + SetIndices(value []int32)() + SetText(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository.go new file mode 100644 index 000000000..2f854ab7e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository.go @@ -0,0 +1,2826 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Repository a repository on GitHub. +type Repository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether to allow Auto-merge to be used on pull requests. + allow_auto_merge *bool + // Whether to allow forking this repo + allow_forking *bool + // Whether to allow merge commits for pull requests. + allow_merge_commit *bool + // Whether to allow rebase merges for pull requests. + allow_rebase_merge *bool + // Whether to allow squash merges for pull requests. + allow_squash_merge *bool + // Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. + allow_update_branch *bool + // Whether anonymous git access is enabled for this repository + anonymous_access_enabled *bool + // The archive_url property + archive_url *string + // Whether the repository is archived. + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default branch of the repository. + default_branch *string + // Whether to delete head branches when pull requests are merged + delete_branch_on_merge *bool + // The deployments_url property + deployments_url *string + // The description property + description *string + // Returns whether or not this repository disabled. + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // Whether discussions are enabled. + has_discussions *bool + // Whether downloads are enabled. + // Deprecated: + has_downloads *bool + // Whether issues are enabled. + has_issues *bool + // The has_pages property + has_pages *bool + // Whether projects are enabled. + has_projects *bool + // Whether the wiki is enabled. + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // Unique identifier of the repository + id *int64 + // Whether this repository acts as a template that can be used to generate new repositories. + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // License Simple + license NullableLicenseSimpleable + // The master_branch property + master_branch *string + // The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. + merge_commit_message *Repository_merge_commit_message + // The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + merge_commit_title *Repository_merge_commit_title + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name of the repository. + name *string + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // A GitHub user. + owner SimpleUserable + // The permissions property + permissions Repository_permissionsable + // Whether the repository is private or public. + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + size *int32 + // The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. + squash_merge_commit_message *Repository_squash_merge_commit_message + // The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + squash_merge_commit_title *Repository_squash_merge_commit_title + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The starred_at property + starred_at *string + // The statuses_url property + statuses_url *string + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + // Deprecated: + use_squash_pr_title_as_default *bool + // The repository visibility: public, private, or internal. + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // Whether to require contributors to sign off on web-based commits + web_commit_signoff_required *bool +} +// NewRepository instantiates a new Repository and sets the default values. +func NewRepository()(*Repository) { + m := &Repository{ + } + m.SetAdditionalData(make(map[string]any)) + visibilityValue := "public" + m.SetVisibility(&visibilityValue) + return m +} +// CreateRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepository(), 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 *Repository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. Whether to allow Auto-merge to be used on pull requests. +// returns a *bool when successful +func (m *Repository) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowForking gets the allow_forking property value. Whether to allow forking this repo +// returns a *bool when successful +func (m *Repository) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. Whether to allow merge commits for pull requests. +// returns a *bool when successful +func (m *Repository) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. Whether to allow rebase merges for pull requests. +// returns a *bool when successful +func (m *Repository) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. Whether to allow squash merges for pull requests. +// returns a *bool when successful +func (m *Repository) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetAllowUpdateBranch gets the allow_update_branch property value. Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. +// returns a *bool when successful +func (m *Repository) GetAllowUpdateBranch()(*bool) { + return m.allow_update_branch +} +// GetAnonymousAccessEnabled gets the anonymous_access_enabled property value. Whether anonymous git access is enabled for this repository +// returns a *bool when successful +func (m *Repository) GetAnonymousAccessEnabled()(*bool) { + return m.anonymous_access_enabled +} +// GetArchived gets the archived property value. Whether the repository is archived. +// returns a *bool when successful +func (m *Repository) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *Repository) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *Repository) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *Repository) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *Repository) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *Repository) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *Repository) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *Repository) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *Repository) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *Repository) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *Repository) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *Repository) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Repository) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default branch of the repository. +// returns a *string when successful +func (m *Repository) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged +// returns a *bool when successful +func (m *Repository) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *Repository) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *Repository) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. Returns whether or not this repository disabled. +// returns a *bool when successful +func (m *Repository) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *Repository) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *Repository) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Repository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["allow_update_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowUpdateBranch(val) + } + return nil + } + res["anonymous_access_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAnonymousAccessEnabled(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableLicenseSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(NullableLicenseSimpleable)) + } + return nil + } + res["master_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMasterBranch(val) + } + return nil + } + res["merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepository_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitMessage(val.(*Repository_merge_commit_message)) + } + return nil + } + res["merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepository_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitTitle(val.(*Repository_merge_commit_title)) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepository_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(Repository_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["squash_merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepository_squash_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitMessage(val.(*Repository_squash_merge_commit_message)) + } + return nil + } + res["squash_merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepository_squash_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitTitle(val.(*Repository_squash_merge_commit_title)) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["starred_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredAt(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["topics"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["use_squash_pr_title_as_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseSquashPrTitleAsDefault(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *Repository) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *Repository) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *Repository) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *Repository) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *Repository) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *Repository) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *Repository) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *Repository) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *Repository) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDiscussions gets the has_discussions property value. Whether discussions are enabled. +// returns a *bool when successful +func (m *Repository) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. Whether downloads are enabled. +// Deprecated: +// returns a *bool when successful +func (m *Repository) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. Whether issues are enabled. +// returns a *bool when successful +func (m *Repository) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *Repository) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. Whether projects are enabled. +// returns a *bool when successful +func (m *Repository) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. Whether the wiki is enabled. +// returns a *bool when successful +func (m *Repository) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *Repository) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *Repository) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Repository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the repository +// returns a *int64 when successful +func (m *Repository) GetId()(*int64) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *Repository) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *Repository) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *Repository) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. Whether this repository acts as a template that can be used to generate new repositories. +// returns a *bool when successful +func (m *Repository) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *Repository) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *Repository) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *Repository) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *Repository) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. License Simple +// returns a NullableLicenseSimpleable when successful +func (m *Repository) GetLicense()(NullableLicenseSimpleable) { + return m.license +} +// GetMasterBranch gets the master_branch property value. The master_branch property +// returns a *string when successful +func (m *Repository) GetMasterBranch()(*string) { + return m.master_branch +} +// GetMergeCommitMessage gets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +// returns a *Repository_merge_commit_message when successful +func (m *Repository) GetMergeCommitMessage()(*Repository_merge_commit_message) { + return m.merge_commit_message +} +// GetMergeCommitTitle gets the merge_commit_title property value. The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +// returns a *Repository_merge_commit_title when successful +func (m *Repository) GetMergeCommitTitle()(*Repository_merge_commit_title) { + return m.merge_commit_title +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *Repository) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *Repository) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *Repository) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name of the repository. +// returns a *string when successful +func (m *Repository) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Repository) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *Repository) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *Repository) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *Repository) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *Repository) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a Repository_permissionsable when successful +func (m *Repository) GetPermissions()(Repository_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. Whether the repository is private or public. +// returns a *bool when successful +func (m *Repository) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *Repository) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *Repository) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *Repository) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetSize gets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +// returns a *int32 when successful +func (m *Repository) GetSize()(*int32) { + return m.size +} +// GetSquashMergeCommitMessage gets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +// returns a *Repository_squash_merge_commit_message when successful +func (m *Repository) GetSquashMergeCommitMessage()(*Repository_squash_merge_commit_message) { + return m.squash_merge_commit_message +} +// GetSquashMergeCommitTitle gets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +// returns a *Repository_squash_merge_commit_title when successful +func (m *Repository) GetSquashMergeCommitTitle()(*Repository_squash_merge_commit_title) { + return m.squash_merge_commit_title +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *Repository) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *Repository) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *Repository) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStarredAt gets the starred_at property value. The starred_at property +// returns a *string when successful +func (m *Repository) GetStarredAt()(*string) { + return m.starred_at +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *Repository) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *Repository) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *Repository) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *Repository) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *Repository) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *Repository) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *Repository) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *Repository) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *Repository) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Repository) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Repository) GetUrl()(*string) { + return m.url +} +// GetUseSquashPrTitleAsDefault gets the use_squash_pr_title_as_default property value. Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +// returns a *bool when successful +func (m *Repository) GetUseSquashPrTitleAsDefault()(*bool) { + return m.use_squash_pr_title_as_default +} +// GetVisibility gets the visibility property value. The repository visibility: public, private, or internal. +// returns a *string when successful +func (m *Repository) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *Repository) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *Repository) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. Whether to require contributors to sign off on web-based commits +// returns a *bool when successful +func (m *Repository) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *Repository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_update_branch", m.GetAllowUpdateBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("anonymous_access_enabled", m.GetAnonymousAccessEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("master_branch", m.GetMasterBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + if m.GetMergeCommitMessage() != nil { + cast := (*m.GetMergeCommitMessage()).String() + err := writer.WriteStringValue("merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetMergeCommitTitle() != nil { + cast := (*m.GetMergeCommitTitle()).String() + err := writer.WriteStringValue("merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitMessage() != nil { + cast := (*m.GetSquashMergeCommitMessage()).String() + err := writer.WriteStringValue("squash_merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitTitle() != nil { + cast := (*m.GetSquashMergeCommitTitle()).String() + err := writer.WriteStringValue("squash_merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_at", m.GetStarredAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_squash_pr_title_as_default", m.GetUseSquashPrTitleAsDefault()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *Repository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. Whether to allow Auto-merge to be used on pull requests. +func (m *Repository) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowForking sets the allow_forking property value. Whether to allow forking this repo +func (m *Repository) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. Whether to allow merge commits for pull requests. +func (m *Repository) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. Whether to allow rebase merges for pull requests. +func (m *Repository) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. Whether to allow squash merges for pull requests. +func (m *Repository) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetAllowUpdateBranch sets the allow_update_branch property value. Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. +func (m *Repository) SetAllowUpdateBranch(value *bool)() { + m.allow_update_branch = value +} +// SetAnonymousAccessEnabled sets the anonymous_access_enabled property value. Whether anonymous git access is enabled for this repository +func (m *Repository) SetAnonymousAccessEnabled(value *bool)() { + m.anonymous_access_enabled = value +} +// SetArchived sets the archived property value. Whether the repository is archived. +func (m *Repository) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *Repository) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *Repository) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *Repository) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *Repository) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *Repository) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *Repository) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *Repository) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *Repository) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *Repository) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *Repository) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *Repository) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Repository) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default branch of the repository. +func (m *Repository) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged +func (m *Repository) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *Repository) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *Repository) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. Returns whether or not this repository disabled. +func (m *Repository) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *Repository) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *Repository) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *Repository) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *Repository) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *Repository) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *Repository) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *Repository) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *Repository) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *Repository) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *Repository) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *Repository) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDiscussions sets the has_discussions property value. Whether discussions are enabled. +func (m *Repository) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. Whether downloads are enabled. +// Deprecated: +func (m *Repository) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. Whether issues are enabled. +func (m *Repository) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *Repository) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. Whether projects are enabled. +func (m *Repository) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. Whether the wiki is enabled. +func (m *Repository) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *Repository) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *Repository) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Repository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the repository +func (m *Repository) SetId(value *int64)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *Repository) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *Repository) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *Repository) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. Whether this repository acts as a template that can be used to generate new repositories. +func (m *Repository) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *Repository) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *Repository) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *Repository) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *Repository) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. License Simple +func (m *Repository) SetLicense(value NullableLicenseSimpleable)() { + m.license = value +} +// SetMasterBranch sets the master_branch property value. The master_branch property +func (m *Repository) SetMasterBranch(value *string)() { + m.master_branch = value +} +// SetMergeCommitMessage sets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +func (m *Repository) SetMergeCommitMessage(value *Repository_merge_commit_message)() { + m.merge_commit_message = value +} +// SetMergeCommitTitle sets the merge_commit_title property value. The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +func (m *Repository) SetMergeCommitTitle(value *Repository_merge_commit_title)() { + m.merge_commit_title = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *Repository) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *Repository) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *Repository) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name of the repository. +func (m *Repository) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Repository) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *Repository) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *Repository) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *Repository) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *Repository) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *Repository) SetPermissions(value Repository_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. Whether the repository is private or public. +func (m *Repository) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *Repository) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *Repository) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *Repository) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetSize sets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +func (m *Repository) SetSize(value *int32)() { + m.size = value +} +// SetSquashMergeCommitMessage sets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +func (m *Repository) SetSquashMergeCommitMessage(value *Repository_squash_merge_commit_message)() { + m.squash_merge_commit_message = value +} +// SetSquashMergeCommitTitle sets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +func (m *Repository) SetSquashMergeCommitTitle(value *Repository_squash_merge_commit_title)() { + m.squash_merge_commit_title = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *Repository) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *Repository) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *Repository) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStarredAt sets the starred_at property value. The starred_at property +func (m *Repository) SetStarredAt(value *string)() { + m.starred_at = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *Repository) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *Repository) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *Repository) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *Repository) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *Repository) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *Repository) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *Repository) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTopics sets the topics property value. The topics property +func (m *Repository) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *Repository) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Repository) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Repository) SetUrl(value *string)() { + m.url = value +} +// SetUseSquashPrTitleAsDefault sets the use_squash_pr_title_as_default property value. Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +func (m *Repository) SetUseSquashPrTitleAsDefault(value *bool)() { + m.use_squash_pr_title_as_default = value +} +// SetVisibility sets the visibility property value. The repository visibility: public, private, or internal. +func (m *Repository) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *Repository) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *Repository) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. Whether to require contributors to sign off on web-based commits +func (m *Repository) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type Repositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetAllowUpdateBranch()(*bool) + GetAnonymousAccessEnabled()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(NullableLicenseSimpleable) + GetMasterBranch()(*string) + GetMergeCommitMessage()(*Repository_merge_commit_message) + GetMergeCommitTitle()(*Repository_merge_commit_title) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOwner()(SimpleUserable) + GetPermissions()(Repository_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetSize()(*int32) + GetSquashMergeCommitMessage()(*Repository_squash_merge_commit_message) + GetSquashMergeCommitTitle()(*Repository_squash_merge_commit_title) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStarredAt()(*string) + GetStatusesUrl()(*string) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUseSquashPrTitleAsDefault()(*bool) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowAutoMerge(value *bool)() + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetAllowUpdateBranch(value *bool)() + SetAnonymousAccessEnabled(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value NullableLicenseSimpleable)() + SetMasterBranch(value *string)() + SetMergeCommitMessage(value *Repository_merge_commit_message)() + SetMergeCommitTitle(value *Repository_merge_commit_title)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOwner(value SimpleUserable)() + SetPermissions(value Repository_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetSize(value *int32)() + SetSquashMergeCommitMessage(value *Repository_squash_merge_commit_message)() + SetSquashMergeCommitTitle(value *Repository_squash_merge_commit_title)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStarredAt(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUseSquashPrTitleAsDefault(value *bool)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory.go new file mode 100644 index 000000000..5332040df --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory.go @@ -0,0 +1,772 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryAdvisory a repository security advisory. +type RepositoryAdvisory struct { + // The author of the advisory. + author SimpleUserable + // The date and time of when the advisory was closed, in ISO 8601 format. + closed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A list of teams that collaborate on the advisory. + collaborating_teams []Teamable + // A list of users that collaborate on the advisory. + collaborating_users []SimpleUserable + // The date and time of when the advisory was created, in ISO 8601 format. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The credits property + credits []RepositoryAdvisory_creditsable + // The credits_detailed property + credits_detailed []RepositoryAdvisoryCreditable + // The Common Vulnerabilities and Exposures (CVE) ID. + cve_id *string + // The cvss property + cvss RepositoryAdvisory_cvssable + // A list of only the CWE IDs. + cwe_ids []string + // The cwes property + cwes []RepositoryAdvisory_cwesable + // A detailed description of what the advisory entails. + description *string + // The GitHub Security Advisory ID. + ghsa_id *string + // The URL for the advisory. + html_url *string + // The identifiers property + identifiers []RepositoryAdvisory_identifiersable + // A temporary private fork of the advisory's repository for collaborating on a fix. + private_fork SimpleRepositoryable + // The date and time of when the advisory was published, in ISO 8601 format. + published_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The publisher of the advisory. + publisher SimpleUserable + // The severity of the advisory. + severity *RepositoryAdvisory_severity + // The state of the advisory. + state *RepositoryAdvisory_state + // The submission property + submission RepositoryAdvisory_submissionable + // A short summary of the advisory. + summary *string + // The date and time of when the advisory was last updated, in ISO 8601 format. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The API URL for the advisory. + url *string + // The vulnerabilities property + vulnerabilities []RepositoryAdvisoryVulnerabilityable + // The date and time of when the advisory was withdrawn, in ISO 8601 format. + withdrawn_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewRepositoryAdvisory instantiates a new RepositoryAdvisory and sets the default values. +func NewRepositoryAdvisory()(*RepositoryAdvisory) { + m := &RepositoryAdvisory{ + } + return m +} +// CreateRepositoryAdvisoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAdvisoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryAdvisory(), nil +} +// GetAuthor gets the author property value. The author of the advisory. +// returns a SimpleUserable when successful +func (m *RepositoryAdvisory) GetAuthor()(SimpleUserable) { + return m.author +} +// GetClosedAt gets the closed_at property value. The date and time of when the advisory was closed, in ISO 8601 format. +// returns a *Time when successful +func (m *RepositoryAdvisory) GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.closed_at +} +// GetCollaboratingTeams gets the collaborating_teams property value. A list of teams that collaborate on the advisory. +// returns a []Teamable when successful +func (m *RepositoryAdvisory) GetCollaboratingTeams()([]Teamable) { + return m.collaborating_teams +} +// GetCollaboratingUsers gets the collaborating_users property value. A list of users that collaborate on the advisory. +// returns a []SimpleUserable when successful +func (m *RepositoryAdvisory) GetCollaboratingUsers()([]SimpleUserable) { + return m.collaborating_users +} +// GetCreatedAt gets the created_at property value. The date and time of when the advisory was created, in ISO 8601 format. +// returns a *Time when successful +func (m *RepositoryAdvisory) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCredits gets the credits property value. The credits property +// returns a []RepositoryAdvisory_creditsable when successful +func (m *RepositoryAdvisory) GetCredits()([]RepositoryAdvisory_creditsable) { + return m.credits +} +// GetCreditsDetailed gets the credits_detailed property value. The credits_detailed property +// returns a []RepositoryAdvisoryCreditable when successful +func (m *RepositoryAdvisory) GetCreditsDetailed()([]RepositoryAdvisoryCreditable) { + return m.credits_detailed +} +// GetCveId gets the cve_id property value. The Common Vulnerabilities and Exposures (CVE) ID. +// returns a *string when successful +func (m *RepositoryAdvisory) GetCveId()(*string) { + return m.cve_id +} +// GetCvss gets the cvss property value. The cvss property +// returns a RepositoryAdvisory_cvssable when successful +func (m *RepositoryAdvisory) GetCvss()(RepositoryAdvisory_cvssable) { + return m.cvss +} +// GetCweIds gets the cwe_ids property value. A list of only the CWE IDs. +// returns a []string when successful +func (m *RepositoryAdvisory) GetCweIds()([]string) { + return m.cwe_ids +} +// GetCwes gets the cwes property value. The cwes property +// returns a []RepositoryAdvisory_cwesable when successful +func (m *RepositoryAdvisory) GetCwes()([]RepositoryAdvisory_cwesable) { + return m.cwes +} +// GetDescription gets the description property value. A detailed description of what the advisory entails. +// returns a *string when successful +func (m *RepositoryAdvisory) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryAdvisory) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(SimpleUserable)) + } + return nil + } + res["closed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetClosedAt(val) + } + return nil + } + res["collaborating_teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Teamable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Teamable) + } + } + m.SetCollaboratingTeams(res) + } + return nil + } + res["collaborating_users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetCollaboratingUsers(res) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["credits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryAdvisory_creditsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryAdvisory_creditsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryAdvisory_creditsable) + } + } + m.SetCredits(res) + } + return nil + } + res["credits_detailed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryAdvisoryCreditFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryAdvisoryCreditable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryAdvisoryCreditable) + } + } + m.SetCreditsDetailed(res) + } + return nil + } + res["cve_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCveId(val) + } + return nil + } + res["cvss"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryAdvisory_cvssFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCvss(val.(RepositoryAdvisory_cvssable)) + } + return nil + } + res["cwe_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetCweIds(res) + } + return nil + } + res["cwes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryAdvisory_cwesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryAdvisory_cwesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryAdvisory_cwesable) + } + } + m.SetCwes(res) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["ghsa_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGhsaId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["identifiers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryAdvisory_identifiersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryAdvisory_identifiersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryAdvisory_identifiersable) + } + } + m.SetIdentifiers(res) + } + return nil + } + res["private_fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPrivateFork(val.(SimpleRepositoryable)) + } + return nil + } + res["published_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPublishedAt(val) + } + return nil + } + res["publisher"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPublisher(val.(SimpleUserable)) + } + return nil + } + res["severity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryAdvisory_severity) + if err != nil { + return err + } + if val != nil { + m.SetSeverity(val.(*RepositoryAdvisory_severity)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryAdvisory_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*RepositoryAdvisory_state)) + } + return nil + } + res["submission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryAdvisory_submissionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSubmission(val.(RepositoryAdvisory_submissionable)) + } + return nil + } + res["summary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSummary(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["vulnerabilities"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryAdvisoryVulnerabilityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryAdvisoryVulnerabilityable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryAdvisoryVulnerabilityable) + } + } + m.SetVulnerabilities(res) + } + return nil + } + res["withdrawn_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetWithdrawnAt(val) + } + return nil + } + return res +} +// GetGhsaId gets the ghsa_id property value. The GitHub Security Advisory ID. +// returns a *string when successful +func (m *RepositoryAdvisory) GetGhsaId()(*string) { + return m.ghsa_id +} +// GetHtmlUrl gets the html_url property value. The URL for the advisory. +// returns a *string when successful +func (m *RepositoryAdvisory) GetHtmlUrl()(*string) { + return m.html_url +} +// GetIdentifiers gets the identifiers property value. The identifiers property +// returns a []RepositoryAdvisory_identifiersable when successful +func (m *RepositoryAdvisory) GetIdentifiers()([]RepositoryAdvisory_identifiersable) { + return m.identifiers +} +// GetPrivateFork gets the private_fork property value. A temporary private fork of the advisory's repository for collaborating on a fix. +// returns a SimpleRepositoryable when successful +func (m *RepositoryAdvisory) GetPrivateFork()(SimpleRepositoryable) { + return m.private_fork +} +// GetPublishedAt gets the published_at property value. The date and time of when the advisory was published, in ISO 8601 format. +// returns a *Time when successful +func (m *RepositoryAdvisory) GetPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.published_at +} +// GetPublisher gets the publisher property value. The publisher of the advisory. +// returns a SimpleUserable when successful +func (m *RepositoryAdvisory) GetPublisher()(SimpleUserable) { + return m.publisher +} +// GetSeverity gets the severity property value. The severity of the advisory. +// returns a *RepositoryAdvisory_severity when successful +func (m *RepositoryAdvisory) GetSeverity()(*RepositoryAdvisory_severity) { + return m.severity +} +// GetState gets the state property value. The state of the advisory. +// returns a *RepositoryAdvisory_state when successful +func (m *RepositoryAdvisory) GetState()(*RepositoryAdvisory_state) { + return m.state +} +// GetSubmission gets the submission property value. The submission property +// returns a RepositoryAdvisory_submissionable when successful +func (m *RepositoryAdvisory) GetSubmission()(RepositoryAdvisory_submissionable) { + return m.submission +} +// GetSummary gets the summary property value. A short summary of the advisory. +// returns a *string when successful +func (m *RepositoryAdvisory) GetSummary()(*string) { + return m.summary +} +// GetUpdatedAt gets the updated_at property value. The date and time of when the advisory was last updated, in ISO 8601 format. +// returns a *Time when successful +func (m *RepositoryAdvisory) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The API URL for the advisory. +// returns a *string when successful +func (m *RepositoryAdvisory) GetUrl()(*string) { + return m.url +} +// GetVulnerabilities gets the vulnerabilities property value. The vulnerabilities property +// returns a []RepositoryAdvisoryVulnerabilityable when successful +func (m *RepositoryAdvisory) GetVulnerabilities()([]RepositoryAdvisoryVulnerabilityable) { + return m.vulnerabilities +} +// GetWithdrawnAt gets the withdrawn_at property value. The date and time of when the advisory was withdrawn, in ISO 8601 format. +// returns a *Time when successful +func (m *RepositoryAdvisory) GetWithdrawnAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.withdrawn_at +} +// Serialize serializes information the current object +func (m *RepositoryAdvisory) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCollaboratingTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCollaboratingTeams())) + for i, v := range m.GetCollaboratingTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("collaborating_teams", cast) + if err != nil { + return err + } + } + if m.GetCollaboratingUsers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCollaboratingUsers())) + for i, v := range m.GetCollaboratingUsers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("collaborating_users", cast) + if err != nil { + return err + } + } + if m.GetCredits() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCredits())) + for i, v := range m.GetCredits() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("credits", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("cve_id", m.GetCveId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("cvss", m.GetCvss()) + if err != nil { + return err + } + } + if m.GetCweIds() != nil { + err := writer.WriteCollectionOfStringValues("cwe_ids", m.GetCweIds()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + if m.GetSeverity() != nil { + cast := (*m.GetSeverity()).String() + err := writer.WriteStringValue("severity", &cast) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("summary", m.GetSummary()) + if err != nil { + return err + } + } + if m.GetVulnerabilities() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVulnerabilities())) + for i, v := range m.GetVulnerabilities() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("vulnerabilities", cast) + if err != nil { + return err + } + } + return nil +} +// SetAuthor sets the author property value. The author of the advisory. +func (m *RepositoryAdvisory) SetAuthor(value SimpleUserable)() { + m.author = value +} +// SetClosedAt sets the closed_at property value. The date and time of when the advisory was closed, in ISO 8601 format. +func (m *RepositoryAdvisory) SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.closed_at = value +} +// SetCollaboratingTeams sets the collaborating_teams property value. A list of teams that collaborate on the advisory. +func (m *RepositoryAdvisory) SetCollaboratingTeams(value []Teamable)() { + m.collaborating_teams = value +} +// SetCollaboratingUsers sets the collaborating_users property value. A list of users that collaborate on the advisory. +func (m *RepositoryAdvisory) SetCollaboratingUsers(value []SimpleUserable)() { + m.collaborating_users = value +} +// SetCreatedAt sets the created_at property value. The date and time of when the advisory was created, in ISO 8601 format. +func (m *RepositoryAdvisory) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCredits sets the credits property value. The credits property +func (m *RepositoryAdvisory) SetCredits(value []RepositoryAdvisory_creditsable)() { + m.credits = value +} +// SetCreditsDetailed sets the credits_detailed property value. The credits_detailed property +func (m *RepositoryAdvisory) SetCreditsDetailed(value []RepositoryAdvisoryCreditable)() { + m.credits_detailed = value +} +// SetCveId sets the cve_id property value. The Common Vulnerabilities and Exposures (CVE) ID. +func (m *RepositoryAdvisory) SetCveId(value *string)() { + m.cve_id = value +} +// SetCvss sets the cvss property value. The cvss property +func (m *RepositoryAdvisory) SetCvss(value RepositoryAdvisory_cvssable)() { + m.cvss = value +} +// SetCweIds sets the cwe_ids property value. A list of only the CWE IDs. +func (m *RepositoryAdvisory) SetCweIds(value []string)() { + m.cwe_ids = value +} +// SetCwes sets the cwes property value. The cwes property +func (m *RepositoryAdvisory) SetCwes(value []RepositoryAdvisory_cwesable)() { + m.cwes = value +} +// SetDescription sets the description property value. A detailed description of what the advisory entails. +func (m *RepositoryAdvisory) SetDescription(value *string)() { + m.description = value +} +// SetGhsaId sets the ghsa_id property value. The GitHub Security Advisory ID. +func (m *RepositoryAdvisory) SetGhsaId(value *string)() { + m.ghsa_id = value +} +// SetHtmlUrl sets the html_url property value. The URL for the advisory. +func (m *RepositoryAdvisory) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetIdentifiers sets the identifiers property value. The identifiers property +func (m *RepositoryAdvisory) SetIdentifiers(value []RepositoryAdvisory_identifiersable)() { + m.identifiers = value +} +// SetPrivateFork sets the private_fork property value. A temporary private fork of the advisory's repository for collaborating on a fix. +func (m *RepositoryAdvisory) SetPrivateFork(value SimpleRepositoryable)() { + m.private_fork = value +} +// SetPublishedAt sets the published_at property value. The date and time of when the advisory was published, in ISO 8601 format. +func (m *RepositoryAdvisory) SetPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.published_at = value +} +// SetPublisher sets the publisher property value. The publisher of the advisory. +func (m *RepositoryAdvisory) SetPublisher(value SimpleUserable)() { + m.publisher = value +} +// SetSeverity sets the severity property value. The severity of the advisory. +func (m *RepositoryAdvisory) SetSeverity(value *RepositoryAdvisory_severity)() { + m.severity = value +} +// SetState sets the state property value. The state of the advisory. +func (m *RepositoryAdvisory) SetState(value *RepositoryAdvisory_state)() { + m.state = value +} +// SetSubmission sets the submission property value. The submission property +func (m *RepositoryAdvisory) SetSubmission(value RepositoryAdvisory_submissionable)() { + m.submission = value +} +// SetSummary sets the summary property value. A short summary of the advisory. +func (m *RepositoryAdvisory) SetSummary(value *string)() { + m.summary = value +} +// SetUpdatedAt sets the updated_at property value. The date and time of when the advisory was last updated, in ISO 8601 format. +func (m *RepositoryAdvisory) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The API URL for the advisory. +func (m *RepositoryAdvisory) SetUrl(value *string)() { + m.url = value +} +// SetVulnerabilities sets the vulnerabilities property value. The vulnerabilities property +func (m *RepositoryAdvisory) SetVulnerabilities(value []RepositoryAdvisoryVulnerabilityable)() { + m.vulnerabilities = value +} +// SetWithdrawnAt sets the withdrawn_at property value. The date and time of when the advisory was withdrawn, in ISO 8601 format. +func (m *RepositoryAdvisory) SetWithdrawnAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.withdrawn_at = value +} +type RepositoryAdvisoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(SimpleUserable) + GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCollaboratingTeams()([]Teamable) + GetCollaboratingUsers()([]SimpleUserable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCredits()([]RepositoryAdvisory_creditsable) + GetCreditsDetailed()([]RepositoryAdvisoryCreditable) + GetCveId()(*string) + GetCvss()(RepositoryAdvisory_cvssable) + GetCweIds()([]string) + GetCwes()([]RepositoryAdvisory_cwesable) + GetDescription()(*string) + GetGhsaId()(*string) + GetHtmlUrl()(*string) + GetIdentifiers()([]RepositoryAdvisory_identifiersable) + GetPrivateFork()(SimpleRepositoryable) + GetPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetPublisher()(SimpleUserable) + GetSeverity()(*RepositoryAdvisory_severity) + GetState()(*RepositoryAdvisory_state) + GetSubmission()(RepositoryAdvisory_submissionable) + GetSummary()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetVulnerabilities()([]RepositoryAdvisoryVulnerabilityable) + GetWithdrawnAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetAuthor(value SimpleUserable)() + SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCollaboratingTeams(value []Teamable)() + SetCollaboratingUsers(value []SimpleUserable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCredits(value []RepositoryAdvisory_creditsable)() + SetCreditsDetailed(value []RepositoryAdvisoryCreditable)() + SetCveId(value *string)() + SetCvss(value RepositoryAdvisory_cvssable)() + SetCweIds(value []string)() + SetCwes(value []RepositoryAdvisory_cwesable)() + SetDescription(value *string)() + SetGhsaId(value *string)() + SetHtmlUrl(value *string)() + SetIdentifiers(value []RepositoryAdvisory_identifiersable)() + SetPrivateFork(value SimpleRepositoryable)() + SetPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetPublisher(value SimpleUserable)() + SetSeverity(value *RepositoryAdvisory_severity)() + SetState(value *RepositoryAdvisory_state)() + SetSubmission(value RepositoryAdvisory_submissionable)() + SetSummary(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetVulnerabilities(value []RepositoryAdvisoryVulnerabilityable)() + SetWithdrawnAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_create.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_create.go new file mode 100644 index 000000000..b2a83b81b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_create.go @@ -0,0 +1,324 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryAdvisoryCreate struct { + // A list of users receiving credit for their participation in the security advisory. + credits []RepositoryAdvisoryCreate_creditsable + // The Common Vulnerabilities and Exposures (CVE) ID. + cve_id *string + // The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`. + cvss_vector_string *string + // A list of Common Weakness Enumeration (CWE) IDs. + cwe_ids []string + // A detailed description of what the advisory impacts. + description *string + // The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. + severity *RepositoryAdvisoryCreate_severity + // Whether to create a temporary private fork of the repository to collaborate on a fix. + start_private_fork *bool + // A short summary of the advisory. + summary *string + // A product affected by the vulnerability detailed in a repository security advisory. + vulnerabilities []RepositoryAdvisoryCreate_vulnerabilitiesable +} +// NewRepositoryAdvisoryCreate instantiates a new RepositoryAdvisoryCreate and sets the default values. +func NewRepositoryAdvisoryCreate()(*RepositoryAdvisoryCreate) { + m := &RepositoryAdvisoryCreate{ + } + return m +} +// CreateRepositoryAdvisoryCreateFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAdvisoryCreateFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryAdvisoryCreate(), nil +} +// GetCredits gets the credits property value. A list of users receiving credit for their participation in the security advisory. +// returns a []RepositoryAdvisoryCreate_creditsable when successful +func (m *RepositoryAdvisoryCreate) GetCredits()([]RepositoryAdvisoryCreate_creditsable) { + return m.credits +} +// GetCveId gets the cve_id property value. The Common Vulnerabilities and Exposures (CVE) ID. +// returns a *string when successful +func (m *RepositoryAdvisoryCreate) GetCveId()(*string) { + return m.cve_id +} +// GetCvssVectorString gets the cvss_vector_string property value. The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`. +// returns a *string when successful +func (m *RepositoryAdvisoryCreate) GetCvssVectorString()(*string) { + return m.cvss_vector_string +} +// GetCweIds gets the cwe_ids property value. A list of Common Weakness Enumeration (CWE) IDs. +// returns a []string when successful +func (m *RepositoryAdvisoryCreate) GetCweIds()([]string) { + return m.cwe_ids +} +// GetDescription gets the description property value. A detailed description of what the advisory impacts. +// returns a *string when successful +func (m *RepositoryAdvisoryCreate) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryAdvisoryCreate) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["credits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryAdvisoryCreate_creditsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryAdvisoryCreate_creditsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryAdvisoryCreate_creditsable) + } + } + m.SetCredits(res) + } + return nil + } + res["cve_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCveId(val) + } + return nil + } + res["cvss_vector_string"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCvssVectorString(val) + } + return nil + } + res["cwe_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetCweIds(res) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["severity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryAdvisoryCreate_severity) + if err != nil { + return err + } + if val != nil { + m.SetSeverity(val.(*RepositoryAdvisoryCreate_severity)) + } + return nil + } + res["start_private_fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetStartPrivateFork(val) + } + return nil + } + res["summary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSummary(val) + } + return nil + } + res["vulnerabilities"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryAdvisoryCreate_vulnerabilitiesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryAdvisoryCreate_vulnerabilitiesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryAdvisoryCreate_vulnerabilitiesable) + } + } + m.SetVulnerabilities(res) + } + return nil + } + return res +} +// GetSeverity gets the severity property value. The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. +// returns a *RepositoryAdvisoryCreate_severity when successful +func (m *RepositoryAdvisoryCreate) GetSeverity()(*RepositoryAdvisoryCreate_severity) { + return m.severity +} +// GetStartPrivateFork gets the start_private_fork property value. Whether to create a temporary private fork of the repository to collaborate on a fix. +// returns a *bool when successful +func (m *RepositoryAdvisoryCreate) GetStartPrivateFork()(*bool) { + return m.start_private_fork +} +// GetSummary gets the summary property value. A short summary of the advisory. +// returns a *string when successful +func (m *RepositoryAdvisoryCreate) GetSummary()(*string) { + return m.summary +} +// GetVulnerabilities gets the vulnerabilities property value. A product affected by the vulnerability detailed in a repository security advisory. +// returns a []RepositoryAdvisoryCreate_vulnerabilitiesable when successful +func (m *RepositoryAdvisoryCreate) GetVulnerabilities()([]RepositoryAdvisoryCreate_vulnerabilitiesable) { + return m.vulnerabilities +} +// Serialize serializes information the current object +func (m *RepositoryAdvisoryCreate) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCredits() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCredits())) + for i, v := range m.GetCredits() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("credits", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("cve_id", m.GetCveId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("cvss_vector_string", m.GetCvssVectorString()) + if err != nil { + return err + } + } + if m.GetCweIds() != nil { + err := writer.WriteCollectionOfStringValues("cwe_ids", m.GetCweIds()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + if m.GetSeverity() != nil { + cast := (*m.GetSeverity()).String() + err := writer.WriteStringValue("severity", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("start_private_fork", m.GetStartPrivateFork()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("summary", m.GetSummary()) + if err != nil { + return err + } + } + if m.GetVulnerabilities() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVulnerabilities())) + for i, v := range m.GetVulnerabilities() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("vulnerabilities", cast) + if err != nil { + return err + } + } + return nil +} +// SetCredits sets the credits property value. A list of users receiving credit for their participation in the security advisory. +func (m *RepositoryAdvisoryCreate) SetCredits(value []RepositoryAdvisoryCreate_creditsable)() { + m.credits = value +} +// SetCveId sets the cve_id property value. The Common Vulnerabilities and Exposures (CVE) ID. +func (m *RepositoryAdvisoryCreate) SetCveId(value *string)() { + m.cve_id = value +} +// SetCvssVectorString sets the cvss_vector_string property value. The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`. +func (m *RepositoryAdvisoryCreate) SetCvssVectorString(value *string)() { + m.cvss_vector_string = value +} +// SetCweIds sets the cwe_ids property value. A list of Common Weakness Enumeration (CWE) IDs. +func (m *RepositoryAdvisoryCreate) SetCweIds(value []string)() { + m.cwe_ids = value +} +// SetDescription sets the description property value. A detailed description of what the advisory impacts. +func (m *RepositoryAdvisoryCreate) SetDescription(value *string)() { + m.description = value +} +// SetSeverity sets the severity property value. The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. +func (m *RepositoryAdvisoryCreate) SetSeverity(value *RepositoryAdvisoryCreate_severity)() { + m.severity = value +} +// SetStartPrivateFork sets the start_private_fork property value. Whether to create a temporary private fork of the repository to collaborate on a fix. +func (m *RepositoryAdvisoryCreate) SetStartPrivateFork(value *bool)() { + m.start_private_fork = value +} +// SetSummary sets the summary property value. A short summary of the advisory. +func (m *RepositoryAdvisoryCreate) SetSummary(value *string)() { + m.summary = value +} +// SetVulnerabilities sets the vulnerabilities property value. A product affected by the vulnerability detailed in a repository security advisory. +func (m *RepositoryAdvisoryCreate) SetVulnerabilities(value []RepositoryAdvisoryCreate_vulnerabilitiesable)() { + m.vulnerabilities = value +} +type RepositoryAdvisoryCreateable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCredits()([]RepositoryAdvisoryCreate_creditsable) + GetCveId()(*string) + GetCvssVectorString()(*string) + GetCweIds()([]string) + GetDescription()(*string) + GetSeverity()(*RepositoryAdvisoryCreate_severity) + GetStartPrivateFork()(*bool) + GetSummary()(*string) + GetVulnerabilities()([]RepositoryAdvisoryCreate_vulnerabilitiesable) + SetCredits(value []RepositoryAdvisoryCreate_creditsable)() + SetCveId(value *string)() + SetCvssVectorString(value *string)() + SetCweIds(value []string)() + SetDescription(value *string)() + SetSeverity(value *RepositoryAdvisoryCreate_severity)() + SetStartPrivateFork(value *bool)() + SetSummary(value *string)() + SetVulnerabilities(value []RepositoryAdvisoryCreate_vulnerabilitiesable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_create_credits.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_create_credits.go new file mode 100644 index 000000000..fc4920ee9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_create_credits.go @@ -0,0 +1,91 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryAdvisoryCreate_credits struct { + // The username of the user credited. + login *string + // The type of credit the user is receiving. + typeEscaped *SecurityAdvisoryCreditTypes +} +// NewRepositoryAdvisoryCreate_credits instantiates a new RepositoryAdvisoryCreate_credits and sets the default values. +func NewRepositoryAdvisoryCreate_credits()(*RepositoryAdvisoryCreate_credits) { + m := &RepositoryAdvisoryCreate_credits{ + } + return m +} +// CreateRepositoryAdvisoryCreate_creditsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAdvisoryCreate_creditsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryAdvisoryCreate_credits(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryAdvisoryCreate_credits) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAdvisoryCreditTypes) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*SecurityAdvisoryCreditTypes)) + } + return nil + } + return res +} +// GetLogin gets the login property value. The username of the user credited. +// returns a *string when successful +func (m *RepositoryAdvisoryCreate_credits) GetLogin()(*string) { + return m.login +} +// GetTypeEscaped gets the type property value. The type of credit the user is receiving. +// returns a *SecurityAdvisoryCreditTypes when successful +func (m *RepositoryAdvisoryCreate_credits) GetTypeEscaped()(*SecurityAdvisoryCreditTypes) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryAdvisoryCreate_credits) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + return nil +} +// SetLogin sets the login property value. The username of the user credited. +func (m *RepositoryAdvisoryCreate_credits) SetLogin(value *string)() { + m.login = value +} +// SetTypeEscaped sets the type property value. The type of credit the user is receiving. +func (m *RepositoryAdvisoryCreate_credits) SetTypeEscaped(value *SecurityAdvisoryCreditTypes)() { + m.typeEscaped = value +} +type RepositoryAdvisoryCreate_creditsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLogin()(*string) + GetTypeEscaped()(*SecurityAdvisoryCreditTypes) + SetLogin(value *string)() + SetTypeEscaped(value *SecurityAdvisoryCreditTypes)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_create_severity.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_create_severity.go new file mode 100644 index 000000000..e6c6a6329 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_create_severity.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. +type RepositoryAdvisoryCreate_severity int + +const ( + CRITICAL_REPOSITORYADVISORYCREATE_SEVERITY RepositoryAdvisoryCreate_severity = iota + HIGH_REPOSITORYADVISORYCREATE_SEVERITY + MEDIUM_REPOSITORYADVISORYCREATE_SEVERITY + LOW_REPOSITORYADVISORYCREATE_SEVERITY +) + +func (i RepositoryAdvisoryCreate_severity) String() string { + return []string{"critical", "high", "medium", "low"}[i] +} +func ParseRepositoryAdvisoryCreate_severity(v string) (any, error) { + result := CRITICAL_REPOSITORYADVISORYCREATE_SEVERITY + switch v { + case "critical": + result = CRITICAL_REPOSITORYADVISORYCREATE_SEVERITY + case "high": + result = HIGH_REPOSITORYADVISORYCREATE_SEVERITY + case "medium": + result = MEDIUM_REPOSITORYADVISORYCREATE_SEVERITY + case "low": + result = LOW_REPOSITORYADVISORYCREATE_SEVERITY + default: + return 0, errors.New("Unknown RepositoryAdvisoryCreate_severity value: " + v) + } + return &result, nil +} +func SerializeRepositoryAdvisoryCreate_severity(values []RepositoryAdvisoryCreate_severity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryAdvisoryCreate_severity) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_create_vulnerabilities.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_create_vulnerabilities.go new file mode 100644 index 000000000..50ebf6595 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_create_vulnerabilities.go @@ -0,0 +1,154 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryAdvisoryCreate_vulnerabilities struct { + // The name of the package affected by the vulnerability. + packageEscaped RepositoryAdvisoryCreate_vulnerabilities_packageable + // The package version(s) that resolve the vulnerability. + patched_versions *string + // The functions in the package that are affected. + vulnerable_functions []string + // The range of the package versions affected by the vulnerability. + vulnerable_version_range *string +} +// NewRepositoryAdvisoryCreate_vulnerabilities instantiates a new RepositoryAdvisoryCreate_vulnerabilities and sets the default values. +func NewRepositoryAdvisoryCreate_vulnerabilities()(*RepositoryAdvisoryCreate_vulnerabilities) { + m := &RepositoryAdvisoryCreate_vulnerabilities{ + } + return m +} +// CreateRepositoryAdvisoryCreate_vulnerabilitiesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAdvisoryCreate_vulnerabilitiesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryAdvisoryCreate_vulnerabilities(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryAdvisoryCreate_vulnerabilities) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["package"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryAdvisoryCreate_vulnerabilities_packageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPackageEscaped(val.(RepositoryAdvisoryCreate_vulnerabilities_packageable)) + } + return nil + } + res["patched_versions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatchedVersions(val) + } + return nil + } + res["vulnerable_functions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetVulnerableFunctions(res) + } + return nil + } + res["vulnerable_version_range"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVulnerableVersionRange(val) + } + return nil + } + return res +} +// GetPackageEscaped gets the package property value. The name of the package affected by the vulnerability. +// returns a RepositoryAdvisoryCreate_vulnerabilities_packageable when successful +func (m *RepositoryAdvisoryCreate_vulnerabilities) GetPackageEscaped()(RepositoryAdvisoryCreate_vulnerabilities_packageable) { + return m.packageEscaped +} +// GetPatchedVersions gets the patched_versions property value. The package version(s) that resolve the vulnerability. +// returns a *string when successful +func (m *RepositoryAdvisoryCreate_vulnerabilities) GetPatchedVersions()(*string) { + return m.patched_versions +} +// GetVulnerableFunctions gets the vulnerable_functions property value. The functions in the package that are affected. +// returns a []string when successful +func (m *RepositoryAdvisoryCreate_vulnerabilities) GetVulnerableFunctions()([]string) { + return m.vulnerable_functions +} +// GetVulnerableVersionRange gets the vulnerable_version_range property value. The range of the package versions affected by the vulnerability. +// returns a *string when successful +func (m *RepositoryAdvisoryCreate_vulnerabilities) GetVulnerableVersionRange()(*string) { + return m.vulnerable_version_range +} +// Serialize serializes information the current object +func (m *RepositoryAdvisoryCreate_vulnerabilities) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("package", m.GetPackageEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patched_versions", m.GetPatchedVersions()) + if err != nil { + return err + } + } + if m.GetVulnerableFunctions() != nil { + err := writer.WriteCollectionOfStringValues("vulnerable_functions", m.GetVulnerableFunctions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("vulnerable_version_range", m.GetVulnerableVersionRange()) + if err != nil { + return err + } + } + return nil +} +// SetPackageEscaped sets the package property value. The name of the package affected by the vulnerability. +func (m *RepositoryAdvisoryCreate_vulnerabilities) SetPackageEscaped(value RepositoryAdvisoryCreate_vulnerabilities_packageable)() { + m.packageEscaped = value +} +// SetPatchedVersions sets the patched_versions property value. The package version(s) that resolve the vulnerability. +func (m *RepositoryAdvisoryCreate_vulnerabilities) SetPatchedVersions(value *string)() { + m.patched_versions = value +} +// SetVulnerableFunctions sets the vulnerable_functions property value. The functions in the package that are affected. +func (m *RepositoryAdvisoryCreate_vulnerabilities) SetVulnerableFunctions(value []string)() { + m.vulnerable_functions = value +} +// SetVulnerableVersionRange sets the vulnerable_version_range property value. The range of the package versions affected by the vulnerability. +func (m *RepositoryAdvisoryCreate_vulnerabilities) SetVulnerableVersionRange(value *string)() { + m.vulnerable_version_range = value +} +type RepositoryAdvisoryCreate_vulnerabilitiesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPackageEscaped()(RepositoryAdvisoryCreate_vulnerabilities_packageable) + GetPatchedVersions()(*string) + GetVulnerableFunctions()([]string) + GetVulnerableVersionRange()(*string) + SetPackageEscaped(value RepositoryAdvisoryCreate_vulnerabilities_packageable)() + SetPatchedVersions(value *string)() + SetVulnerableFunctions(value []string)() + SetVulnerableVersionRange(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_create_vulnerabilities_package.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_create_vulnerabilities_package.go new file mode 100644 index 000000000..2b71ccfe1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_create_vulnerabilities_package.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryAdvisoryCreate_vulnerabilities_package the name of the package affected by the vulnerability. +type RepositoryAdvisoryCreate_vulnerabilities_package struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The package's language or package management ecosystem. + ecosystem *SecurityAdvisoryEcosystems + // The unique package name within its ecosystem. + name *string +} +// NewRepositoryAdvisoryCreate_vulnerabilities_package instantiates a new RepositoryAdvisoryCreate_vulnerabilities_package and sets the default values. +func NewRepositoryAdvisoryCreate_vulnerabilities_package()(*RepositoryAdvisoryCreate_vulnerabilities_package) { + m := &RepositoryAdvisoryCreate_vulnerabilities_package{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryAdvisoryCreate_vulnerabilities_packageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAdvisoryCreate_vulnerabilities_packageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryAdvisoryCreate_vulnerabilities_package(), 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 *RepositoryAdvisoryCreate_vulnerabilities_package) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEcosystem gets the ecosystem property value. The package's language or package management ecosystem. +// returns a *SecurityAdvisoryEcosystems when successful +func (m *RepositoryAdvisoryCreate_vulnerabilities_package) GetEcosystem()(*SecurityAdvisoryEcosystems) { + return m.ecosystem +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryAdvisoryCreate_vulnerabilities_package) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ecosystem"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAdvisoryEcosystems) + if err != nil { + return err + } + if val != nil { + m.SetEcosystem(val.(*SecurityAdvisoryEcosystems)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The unique package name within its ecosystem. +// returns a *string when successful +func (m *RepositoryAdvisoryCreate_vulnerabilities_package) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *RepositoryAdvisoryCreate_vulnerabilities_package) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEcosystem() != nil { + cast := (*m.GetEcosystem()).String() + err := writer.WriteStringValue("ecosystem", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *RepositoryAdvisoryCreate_vulnerabilities_package) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEcosystem sets the ecosystem property value. The package's language or package management ecosystem. +func (m *RepositoryAdvisoryCreate_vulnerabilities_package) SetEcosystem(value *SecurityAdvisoryEcosystems)() { + m.ecosystem = value +} +// SetName sets the name property value. The unique package name within its ecosystem. +func (m *RepositoryAdvisoryCreate_vulnerabilities_package) SetName(value *string)() { + m.name = value +} +type RepositoryAdvisoryCreate_vulnerabilities_packageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEcosystem()(*SecurityAdvisoryEcosystems) + GetName()(*string) + SetEcosystem(value *SecurityAdvisoryEcosystems)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_credit.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_credit.go new file mode 100644 index 000000000..7cfb237b6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_credit.go @@ -0,0 +1,122 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryAdvisoryCredit a credit given to a user for a repository security advisory. +type RepositoryAdvisoryCredit struct { + // The state of the user's acceptance of the credit. + state *RepositoryAdvisoryCredit_state + // The type of credit the user is receiving. + typeEscaped *SecurityAdvisoryCreditTypes + // A GitHub user. + user SimpleUserable +} +// NewRepositoryAdvisoryCredit instantiates a new RepositoryAdvisoryCredit and sets the default values. +func NewRepositoryAdvisoryCredit()(*RepositoryAdvisoryCredit) { + m := &RepositoryAdvisoryCredit{ + } + return m +} +// CreateRepositoryAdvisoryCreditFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAdvisoryCreditFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryAdvisoryCredit(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryAdvisoryCredit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryAdvisoryCredit_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*RepositoryAdvisoryCredit_state)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAdvisoryCreditTypes) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*SecurityAdvisoryCreditTypes)) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(SimpleUserable)) + } + return nil + } + return res +} +// GetState gets the state property value. The state of the user's acceptance of the credit. +// returns a *RepositoryAdvisoryCredit_state when successful +func (m *RepositoryAdvisoryCredit) GetState()(*RepositoryAdvisoryCredit_state) { + return m.state +} +// GetTypeEscaped gets the type property value. The type of credit the user is receiving. +// returns a *SecurityAdvisoryCreditTypes when successful +func (m *RepositoryAdvisoryCredit) GetTypeEscaped()(*SecurityAdvisoryCreditTypes) { + return m.typeEscaped +} +// GetUser gets the user property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *RepositoryAdvisoryCredit) GetUser()(SimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *RepositoryAdvisoryCredit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + return nil +} +// SetState sets the state property value. The state of the user's acceptance of the credit. +func (m *RepositoryAdvisoryCredit) SetState(value *RepositoryAdvisoryCredit_state)() { + m.state = value +} +// SetTypeEscaped sets the type property value. The type of credit the user is receiving. +func (m *RepositoryAdvisoryCredit) SetTypeEscaped(value *SecurityAdvisoryCreditTypes)() { + m.typeEscaped = value +} +// SetUser sets the user property value. A GitHub user. +func (m *RepositoryAdvisoryCredit) SetUser(value SimpleUserable)() { + m.user = value +} +type RepositoryAdvisoryCreditable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetState()(*RepositoryAdvisoryCredit_state) + GetTypeEscaped()(*SecurityAdvisoryCreditTypes) + GetUser()(SimpleUserable) + SetState(value *RepositoryAdvisoryCredit_state)() + SetTypeEscaped(value *SecurityAdvisoryCreditTypes)() + SetUser(value SimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_credit_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_credit_state.go new file mode 100644 index 000000000..00b230fe5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_credit_state.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The state of the user's acceptance of the credit. +type RepositoryAdvisoryCredit_state int + +const ( + ACCEPTED_REPOSITORYADVISORYCREDIT_STATE RepositoryAdvisoryCredit_state = iota + DECLINED_REPOSITORYADVISORYCREDIT_STATE + PENDING_REPOSITORYADVISORYCREDIT_STATE +) + +func (i RepositoryAdvisoryCredit_state) String() string { + return []string{"accepted", "declined", "pending"}[i] +} +func ParseRepositoryAdvisoryCredit_state(v string) (any, error) { + result := ACCEPTED_REPOSITORYADVISORYCREDIT_STATE + switch v { + case "accepted": + result = ACCEPTED_REPOSITORYADVISORYCREDIT_STATE + case "declined": + result = DECLINED_REPOSITORYADVISORYCREDIT_STATE + case "pending": + result = PENDING_REPOSITORYADVISORYCREDIT_STATE + default: + return 0, errors.New("Unknown RepositoryAdvisoryCredit_state value: " + v) + } + return &result, nil +} +func SerializeRepositoryAdvisoryCredit_state(values []RepositoryAdvisoryCredit_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryAdvisoryCredit_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_credits.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_credits.go new file mode 100644 index 000000000..ea681020d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_credits.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryAdvisory_credits struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The username of the user credited. + login *string + // The type of credit the user is receiving. + typeEscaped *SecurityAdvisoryCreditTypes +} +// NewRepositoryAdvisory_credits instantiates a new RepositoryAdvisory_credits and sets the default values. +func NewRepositoryAdvisory_credits()(*RepositoryAdvisory_credits) { + m := &RepositoryAdvisory_credits{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryAdvisory_creditsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAdvisory_creditsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryAdvisory_credits(), 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 *RepositoryAdvisory_credits) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryAdvisory_credits) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAdvisoryCreditTypes) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*SecurityAdvisoryCreditTypes)) + } + return nil + } + return res +} +// GetLogin gets the login property value. The username of the user credited. +// returns a *string when successful +func (m *RepositoryAdvisory_credits) GetLogin()(*string) { + return m.login +} +// GetTypeEscaped gets the type property value. The type of credit the user is receiving. +// returns a *SecurityAdvisoryCreditTypes when successful +func (m *RepositoryAdvisory_credits) GetTypeEscaped()(*SecurityAdvisoryCreditTypes) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryAdvisory_credits) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryAdvisory_credits) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLogin sets the login property value. The username of the user credited. +func (m *RepositoryAdvisory_credits) SetLogin(value *string)() { + m.login = value +} +// SetTypeEscaped sets the type property value. The type of credit the user is receiving. +func (m *RepositoryAdvisory_credits) SetTypeEscaped(value *SecurityAdvisoryCreditTypes)() { + m.typeEscaped = value +} +type RepositoryAdvisory_creditsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLogin()(*string) + GetTypeEscaped()(*SecurityAdvisoryCreditTypes) + SetLogin(value *string)() + SetTypeEscaped(value *SecurityAdvisoryCreditTypes)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_cvss.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_cvss.go new file mode 100644 index 000000000..2eba683de --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_cvss.go @@ -0,0 +1,103 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryAdvisory_cvss struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The CVSS score. + score *float64 + // The CVSS vector. + vector_string *string +} +// NewRepositoryAdvisory_cvss instantiates a new RepositoryAdvisory_cvss and sets the default values. +func NewRepositoryAdvisory_cvss()(*RepositoryAdvisory_cvss) { + m := &RepositoryAdvisory_cvss{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryAdvisory_cvssFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAdvisory_cvssFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryAdvisory_cvss(), 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 *RepositoryAdvisory_cvss) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryAdvisory_cvss) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["vector_string"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVectorString(val) + } + return nil + } + return res +} +// GetScore gets the score property value. The CVSS score. +// returns a *float64 when successful +func (m *RepositoryAdvisory_cvss) GetScore()(*float64) { + return m.score +} +// GetVectorString gets the vector_string property value. The CVSS vector. +// returns a *string when successful +func (m *RepositoryAdvisory_cvss) GetVectorString()(*string) { + return m.vector_string +} +// Serialize serializes information the current object +func (m *RepositoryAdvisory_cvss) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("vector_string", m.GetVectorString()) + 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 *RepositoryAdvisory_cvss) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetScore sets the score property value. The CVSS score. +func (m *RepositoryAdvisory_cvss) SetScore(value *float64)() { + m.score = value +} +// SetVectorString sets the vector_string property value. The CVSS vector. +func (m *RepositoryAdvisory_cvss) SetVectorString(value *string)() { + m.vector_string = value +} +type RepositoryAdvisory_cvssable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetScore()(*float64) + GetVectorString()(*string) + SetScore(value *float64)() + SetVectorString(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_cwes.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_cwes.go new file mode 100644 index 000000000..e1b0f2aac --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_cwes.go @@ -0,0 +1,103 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryAdvisory_cwes struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The Common Weakness Enumeration (CWE) identifier. + cwe_id *string + // The name of the CWE. + name *string +} +// NewRepositoryAdvisory_cwes instantiates a new RepositoryAdvisory_cwes and sets the default values. +func NewRepositoryAdvisory_cwes()(*RepositoryAdvisory_cwes) { + m := &RepositoryAdvisory_cwes{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryAdvisory_cwesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAdvisory_cwesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryAdvisory_cwes(), 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 *RepositoryAdvisory_cwes) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCweId gets the cwe_id property value. The Common Weakness Enumeration (CWE) identifier. +// returns a *string when successful +func (m *RepositoryAdvisory_cwes) GetCweId()(*string) { + return m.cwe_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryAdvisory_cwes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cwe_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCweId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the CWE. +// returns a *string when successful +func (m *RepositoryAdvisory_cwes) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *RepositoryAdvisory_cwes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("cwe_id", m.GetCweId()) + 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 *RepositoryAdvisory_cwes) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCweId sets the cwe_id property value. The Common Weakness Enumeration (CWE) identifier. +func (m *RepositoryAdvisory_cwes) SetCweId(value *string)() { + m.cwe_id = value +} +// SetName sets the name property value. The name of the CWE. +func (m *RepositoryAdvisory_cwes) SetName(value *string)() { + m.name = value +} +type RepositoryAdvisory_cwesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCweId()(*string) + GetName()(*string) + SetCweId(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_identifiers.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_identifiers.go new file mode 100644 index 000000000..ab3b3b353 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_identifiers.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryAdvisory_identifiers struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The type of identifier. + typeEscaped *RepositoryAdvisory_identifiers_type + // The identifier value. + value *string +} +// NewRepositoryAdvisory_identifiers instantiates a new RepositoryAdvisory_identifiers and sets the default values. +func NewRepositoryAdvisory_identifiers()(*RepositoryAdvisory_identifiers) { + m := &RepositoryAdvisory_identifiers{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryAdvisory_identifiersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAdvisory_identifiersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryAdvisory_identifiers(), 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 *RepositoryAdvisory_identifiers) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryAdvisory_identifiers) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryAdvisory_identifiers_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryAdvisory_identifiers_type)) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The type of identifier. +// returns a *RepositoryAdvisory_identifiers_type when successful +func (m *RepositoryAdvisory_identifiers) GetTypeEscaped()(*RepositoryAdvisory_identifiers_type) { + return m.typeEscaped +} +// GetValue gets the value property value. The identifier value. +// returns a *string when successful +func (m *RepositoryAdvisory_identifiers) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *RepositoryAdvisory_identifiers) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryAdvisory_identifiers) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTypeEscaped sets the type property value. The type of identifier. +func (m *RepositoryAdvisory_identifiers) SetTypeEscaped(value *RepositoryAdvisory_identifiers_type)() { + m.typeEscaped = value +} +// SetValue sets the value property value. The identifier value. +func (m *RepositoryAdvisory_identifiers) SetValue(value *string)() { + m.value = value +} +type RepositoryAdvisory_identifiersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTypeEscaped()(*RepositoryAdvisory_identifiers_type) + GetValue()(*string) + SetTypeEscaped(value *RepositoryAdvisory_identifiers_type)() + SetValue(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_identifiers_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_identifiers_type.go new file mode 100644 index 000000000..1cfd6f027 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_identifiers_type.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The type of identifier. +type RepositoryAdvisory_identifiers_type int + +const ( + CVE_REPOSITORYADVISORY_IDENTIFIERS_TYPE RepositoryAdvisory_identifiers_type = iota + GHSA_REPOSITORYADVISORY_IDENTIFIERS_TYPE +) + +func (i RepositoryAdvisory_identifiers_type) String() string { + return []string{"CVE", "GHSA"}[i] +} +func ParseRepositoryAdvisory_identifiers_type(v string) (any, error) { + result := CVE_REPOSITORYADVISORY_IDENTIFIERS_TYPE + switch v { + case "CVE": + result = CVE_REPOSITORYADVISORY_IDENTIFIERS_TYPE + case "GHSA": + result = GHSA_REPOSITORYADVISORY_IDENTIFIERS_TYPE + default: + return 0, errors.New("Unknown RepositoryAdvisory_identifiers_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryAdvisory_identifiers_type(values []RepositoryAdvisory_identifiers_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryAdvisory_identifiers_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_severity.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_severity.go new file mode 100644 index 000000000..c9a8cf05c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_severity.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The severity of the advisory. +type RepositoryAdvisory_severity int + +const ( + CRITICAL_REPOSITORYADVISORY_SEVERITY RepositoryAdvisory_severity = iota + HIGH_REPOSITORYADVISORY_SEVERITY + MEDIUM_REPOSITORYADVISORY_SEVERITY + LOW_REPOSITORYADVISORY_SEVERITY +) + +func (i RepositoryAdvisory_severity) String() string { + return []string{"critical", "high", "medium", "low"}[i] +} +func ParseRepositoryAdvisory_severity(v string) (any, error) { + result := CRITICAL_REPOSITORYADVISORY_SEVERITY + switch v { + case "critical": + result = CRITICAL_REPOSITORYADVISORY_SEVERITY + case "high": + result = HIGH_REPOSITORYADVISORY_SEVERITY + case "medium": + result = MEDIUM_REPOSITORYADVISORY_SEVERITY + case "low": + result = LOW_REPOSITORYADVISORY_SEVERITY + default: + return 0, errors.New("Unknown RepositoryAdvisory_severity value: " + v) + } + return &result, nil +} +func SerializeRepositoryAdvisory_severity(values []RepositoryAdvisory_severity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryAdvisory_severity) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_state.go new file mode 100644 index 000000000..ba4949751 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_state.go @@ -0,0 +1,46 @@ +package models +import ( + "errors" +) +// The state of the advisory. +type RepositoryAdvisory_state int + +const ( + PUBLISHED_REPOSITORYADVISORY_STATE RepositoryAdvisory_state = iota + CLOSED_REPOSITORYADVISORY_STATE + WITHDRAWN_REPOSITORYADVISORY_STATE + DRAFT_REPOSITORYADVISORY_STATE + TRIAGE_REPOSITORYADVISORY_STATE +) + +func (i RepositoryAdvisory_state) String() string { + return []string{"published", "closed", "withdrawn", "draft", "triage"}[i] +} +func ParseRepositoryAdvisory_state(v string) (any, error) { + result := PUBLISHED_REPOSITORYADVISORY_STATE + switch v { + case "published": + result = PUBLISHED_REPOSITORYADVISORY_STATE + case "closed": + result = CLOSED_REPOSITORYADVISORY_STATE + case "withdrawn": + result = WITHDRAWN_REPOSITORYADVISORY_STATE + case "draft": + result = DRAFT_REPOSITORYADVISORY_STATE + case "triage": + result = TRIAGE_REPOSITORYADVISORY_STATE + default: + return 0, errors.New("Unknown RepositoryAdvisory_state value: " + v) + } + return &result, nil +} +func SerializeRepositoryAdvisory_state(values []RepositoryAdvisory_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryAdvisory_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_submission.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_submission.go new file mode 100644 index 000000000..784b6d6a0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_submission.go @@ -0,0 +1,74 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryAdvisory_submission struct { + // Whether a private vulnerability report was accepted by the repository's administrators. + accepted *bool + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewRepositoryAdvisory_submission instantiates a new RepositoryAdvisory_submission and sets the default values. +func NewRepositoryAdvisory_submission()(*RepositoryAdvisory_submission) { + m := &RepositoryAdvisory_submission{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryAdvisory_submissionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAdvisory_submissionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryAdvisory_submission(), nil +} +// GetAccepted gets the accepted property value. Whether a private vulnerability report was accepted by the repository's administrators. +// returns a *bool when successful +func (m *RepositoryAdvisory_submission) GetAccepted()(*bool) { + return m.accepted +} +// 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 *RepositoryAdvisory_submission) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryAdvisory_submission) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["accepted"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAccepted(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *RepositoryAdvisory_submission) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccepted sets the accepted property value. Whether a private vulnerability report was accepted by the repository's administrators. +func (m *RepositoryAdvisory_submission) SetAccepted(value *bool)() { + m.accepted = value +} +// 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 *RepositoryAdvisory_submission) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type RepositoryAdvisory_submissionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccepted()(*bool) + SetAccepted(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update.go new file mode 100644 index 000000000..f027ee50d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update.go @@ -0,0 +1,395 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryAdvisoryUpdate struct { + // A list of team slugs which have been granted write access to the advisory. + collaborating_teams []string + // A list of usernames who have been granted write access to the advisory. + collaborating_users []string + // A list of users receiving credit for their participation in the security advisory. + credits []RepositoryAdvisoryUpdate_creditsable + // The Common Vulnerabilities and Exposures (CVE) ID. + cve_id *string + // The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`. + cvss_vector_string *string + // A list of Common Weakness Enumeration (CWE) IDs. + cwe_ids []string + // A detailed description of what the advisory impacts. + description *string + // The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. + severity *RepositoryAdvisoryUpdate_severity + // The state of the advisory. + state *RepositoryAdvisoryUpdate_state + // A short summary of the advisory. + summary *string + // A product affected by the vulnerability detailed in a repository security advisory. + vulnerabilities []RepositoryAdvisoryUpdate_vulnerabilitiesable +} +// NewRepositoryAdvisoryUpdate instantiates a new RepositoryAdvisoryUpdate and sets the default values. +func NewRepositoryAdvisoryUpdate()(*RepositoryAdvisoryUpdate) { + m := &RepositoryAdvisoryUpdate{ + } + return m +} +// CreateRepositoryAdvisoryUpdateFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAdvisoryUpdateFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryAdvisoryUpdate(), nil +} +// GetCollaboratingTeams gets the collaborating_teams property value. A list of team slugs which have been granted write access to the advisory. +// returns a []string when successful +func (m *RepositoryAdvisoryUpdate) GetCollaboratingTeams()([]string) { + return m.collaborating_teams +} +// GetCollaboratingUsers gets the collaborating_users property value. A list of usernames who have been granted write access to the advisory. +// returns a []string when successful +func (m *RepositoryAdvisoryUpdate) GetCollaboratingUsers()([]string) { + return m.collaborating_users +} +// GetCredits gets the credits property value. A list of users receiving credit for their participation in the security advisory. +// returns a []RepositoryAdvisoryUpdate_creditsable when successful +func (m *RepositoryAdvisoryUpdate) GetCredits()([]RepositoryAdvisoryUpdate_creditsable) { + return m.credits +} +// GetCveId gets the cve_id property value. The Common Vulnerabilities and Exposures (CVE) ID. +// returns a *string when successful +func (m *RepositoryAdvisoryUpdate) GetCveId()(*string) { + return m.cve_id +} +// GetCvssVectorString gets the cvss_vector_string property value. The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`. +// returns a *string when successful +func (m *RepositoryAdvisoryUpdate) GetCvssVectorString()(*string) { + return m.cvss_vector_string +} +// GetCweIds gets the cwe_ids property value. A list of Common Weakness Enumeration (CWE) IDs. +// returns a []string when successful +func (m *RepositoryAdvisoryUpdate) GetCweIds()([]string) { + return m.cwe_ids +} +// GetDescription gets the description property value. A detailed description of what the advisory impacts. +// returns a *string when successful +func (m *RepositoryAdvisoryUpdate) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryAdvisoryUpdate) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["collaborating_teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetCollaboratingTeams(res) + } + return nil + } + res["collaborating_users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetCollaboratingUsers(res) + } + return nil + } + res["credits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryAdvisoryUpdate_creditsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryAdvisoryUpdate_creditsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryAdvisoryUpdate_creditsable) + } + } + m.SetCredits(res) + } + return nil + } + res["cve_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCveId(val) + } + return nil + } + res["cvss_vector_string"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCvssVectorString(val) + } + return nil + } + res["cwe_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetCweIds(res) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["severity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryAdvisoryUpdate_severity) + if err != nil { + return err + } + if val != nil { + m.SetSeverity(val.(*RepositoryAdvisoryUpdate_severity)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryAdvisoryUpdate_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*RepositoryAdvisoryUpdate_state)) + } + return nil + } + res["summary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSummary(val) + } + return nil + } + res["vulnerabilities"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryAdvisoryUpdate_vulnerabilitiesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryAdvisoryUpdate_vulnerabilitiesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryAdvisoryUpdate_vulnerabilitiesable) + } + } + m.SetVulnerabilities(res) + } + return nil + } + return res +} +// GetSeverity gets the severity property value. The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. +// returns a *RepositoryAdvisoryUpdate_severity when successful +func (m *RepositoryAdvisoryUpdate) GetSeverity()(*RepositoryAdvisoryUpdate_severity) { + return m.severity +} +// GetState gets the state property value. The state of the advisory. +// returns a *RepositoryAdvisoryUpdate_state when successful +func (m *RepositoryAdvisoryUpdate) GetState()(*RepositoryAdvisoryUpdate_state) { + return m.state +} +// GetSummary gets the summary property value. A short summary of the advisory. +// returns a *string when successful +func (m *RepositoryAdvisoryUpdate) GetSummary()(*string) { + return m.summary +} +// GetVulnerabilities gets the vulnerabilities property value. A product affected by the vulnerability detailed in a repository security advisory. +// returns a []RepositoryAdvisoryUpdate_vulnerabilitiesable when successful +func (m *RepositoryAdvisoryUpdate) GetVulnerabilities()([]RepositoryAdvisoryUpdate_vulnerabilitiesable) { + return m.vulnerabilities +} +// Serialize serializes information the current object +func (m *RepositoryAdvisoryUpdate) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCollaboratingTeams() != nil { + err := writer.WriteCollectionOfStringValues("collaborating_teams", m.GetCollaboratingTeams()) + if err != nil { + return err + } + } + if m.GetCollaboratingUsers() != nil { + err := writer.WriteCollectionOfStringValues("collaborating_users", m.GetCollaboratingUsers()) + if err != nil { + return err + } + } + if m.GetCredits() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCredits())) + for i, v := range m.GetCredits() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("credits", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("cve_id", m.GetCveId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("cvss_vector_string", m.GetCvssVectorString()) + if err != nil { + return err + } + } + if m.GetCweIds() != nil { + err := writer.WriteCollectionOfStringValues("cwe_ids", m.GetCweIds()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + if m.GetSeverity() != nil { + cast := (*m.GetSeverity()).String() + err := writer.WriteStringValue("severity", &cast) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("summary", m.GetSummary()) + if err != nil { + return err + } + } + if m.GetVulnerabilities() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVulnerabilities())) + for i, v := range m.GetVulnerabilities() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("vulnerabilities", cast) + if err != nil { + return err + } + } + return nil +} +// SetCollaboratingTeams sets the collaborating_teams property value. A list of team slugs which have been granted write access to the advisory. +func (m *RepositoryAdvisoryUpdate) SetCollaboratingTeams(value []string)() { + m.collaborating_teams = value +} +// SetCollaboratingUsers sets the collaborating_users property value. A list of usernames who have been granted write access to the advisory. +func (m *RepositoryAdvisoryUpdate) SetCollaboratingUsers(value []string)() { + m.collaborating_users = value +} +// SetCredits sets the credits property value. A list of users receiving credit for their participation in the security advisory. +func (m *RepositoryAdvisoryUpdate) SetCredits(value []RepositoryAdvisoryUpdate_creditsable)() { + m.credits = value +} +// SetCveId sets the cve_id property value. The Common Vulnerabilities and Exposures (CVE) ID. +func (m *RepositoryAdvisoryUpdate) SetCveId(value *string)() { + m.cve_id = value +} +// SetCvssVectorString sets the cvss_vector_string property value. The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`. +func (m *RepositoryAdvisoryUpdate) SetCvssVectorString(value *string)() { + m.cvss_vector_string = value +} +// SetCweIds sets the cwe_ids property value. A list of Common Weakness Enumeration (CWE) IDs. +func (m *RepositoryAdvisoryUpdate) SetCweIds(value []string)() { + m.cwe_ids = value +} +// SetDescription sets the description property value. A detailed description of what the advisory impacts. +func (m *RepositoryAdvisoryUpdate) SetDescription(value *string)() { + m.description = value +} +// SetSeverity sets the severity property value. The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. +func (m *RepositoryAdvisoryUpdate) SetSeverity(value *RepositoryAdvisoryUpdate_severity)() { + m.severity = value +} +// SetState sets the state property value. The state of the advisory. +func (m *RepositoryAdvisoryUpdate) SetState(value *RepositoryAdvisoryUpdate_state)() { + m.state = value +} +// SetSummary sets the summary property value. A short summary of the advisory. +func (m *RepositoryAdvisoryUpdate) SetSummary(value *string)() { + m.summary = value +} +// SetVulnerabilities sets the vulnerabilities property value. A product affected by the vulnerability detailed in a repository security advisory. +func (m *RepositoryAdvisoryUpdate) SetVulnerabilities(value []RepositoryAdvisoryUpdate_vulnerabilitiesable)() { + m.vulnerabilities = value +} +type RepositoryAdvisoryUpdateable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCollaboratingTeams()([]string) + GetCollaboratingUsers()([]string) + GetCredits()([]RepositoryAdvisoryUpdate_creditsable) + GetCveId()(*string) + GetCvssVectorString()(*string) + GetCweIds()([]string) + GetDescription()(*string) + GetSeverity()(*RepositoryAdvisoryUpdate_severity) + GetState()(*RepositoryAdvisoryUpdate_state) + GetSummary()(*string) + GetVulnerabilities()([]RepositoryAdvisoryUpdate_vulnerabilitiesable) + SetCollaboratingTeams(value []string)() + SetCollaboratingUsers(value []string)() + SetCredits(value []RepositoryAdvisoryUpdate_creditsable)() + SetCveId(value *string)() + SetCvssVectorString(value *string)() + SetCweIds(value []string)() + SetDescription(value *string)() + SetSeverity(value *RepositoryAdvisoryUpdate_severity)() + SetState(value *RepositoryAdvisoryUpdate_state)() + SetSummary(value *string)() + SetVulnerabilities(value []RepositoryAdvisoryUpdate_vulnerabilitiesable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update_credits.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update_credits.go new file mode 100644 index 000000000..316dcb368 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update_credits.go @@ -0,0 +1,91 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryAdvisoryUpdate_credits struct { + // The username of the user credited. + login *string + // The type of credit the user is receiving. + typeEscaped *SecurityAdvisoryCreditTypes +} +// NewRepositoryAdvisoryUpdate_credits instantiates a new RepositoryAdvisoryUpdate_credits and sets the default values. +func NewRepositoryAdvisoryUpdate_credits()(*RepositoryAdvisoryUpdate_credits) { + m := &RepositoryAdvisoryUpdate_credits{ + } + return m +} +// CreateRepositoryAdvisoryUpdate_creditsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAdvisoryUpdate_creditsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryAdvisoryUpdate_credits(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryAdvisoryUpdate_credits) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAdvisoryCreditTypes) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*SecurityAdvisoryCreditTypes)) + } + return nil + } + return res +} +// GetLogin gets the login property value. The username of the user credited. +// returns a *string when successful +func (m *RepositoryAdvisoryUpdate_credits) GetLogin()(*string) { + return m.login +} +// GetTypeEscaped gets the type property value. The type of credit the user is receiving. +// returns a *SecurityAdvisoryCreditTypes when successful +func (m *RepositoryAdvisoryUpdate_credits) GetTypeEscaped()(*SecurityAdvisoryCreditTypes) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryAdvisoryUpdate_credits) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + return nil +} +// SetLogin sets the login property value. The username of the user credited. +func (m *RepositoryAdvisoryUpdate_credits) SetLogin(value *string)() { + m.login = value +} +// SetTypeEscaped sets the type property value. The type of credit the user is receiving. +func (m *RepositoryAdvisoryUpdate_credits) SetTypeEscaped(value *SecurityAdvisoryCreditTypes)() { + m.typeEscaped = value +} +type RepositoryAdvisoryUpdate_creditsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLogin()(*string) + GetTypeEscaped()(*SecurityAdvisoryCreditTypes) + SetLogin(value *string)() + SetTypeEscaped(value *SecurityAdvisoryCreditTypes)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update_severity.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update_severity.go new file mode 100644 index 000000000..1ce74d41e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update_severity.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. +type RepositoryAdvisoryUpdate_severity int + +const ( + CRITICAL_REPOSITORYADVISORYUPDATE_SEVERITY RepositoryAdvisoryUpdate_severity = iota + HIGH_REPOSITORYADVISORYUPDATE_SEVERITY + MEDIUM_REPOSITORYADVISORYUPDATE_SEVERITY + LOW_REPOSITORYADVISORYUPDATE_SEVERITY +) + +func (i RepositoryAdvisoryUpdate_severity) String() string { + return []string{"critical", "high", "medium", "low"}[i] +} +func ParseRepositoryAdvisoryUpdate_severity(v string) (any, error) { + result := CRITICAL_REPOSITORYADVISORYUPDATE_SEVERITY + switch v { + case "critical": + result = CRITICAL_REPOSITORYADVISORYUPDATE_SEVERITY + case "high": + result = HIGH_REPOSITORYADVISORYUPDATE_SEVERITY + case "medium": + result = MEDIUM_REPOSITORYADVISORYUPDATE_SEVERITY + case "low": + result = LOW_REPOSITORYADVISORYUPDATE_SEVERITY + default: + return 0, errors.New("Unknown RepositoryAdvisoryUpdate_severity value: " + v) + } + return &result, nil +} +func SerializeRepositoryAdvisoryUpdate_severity(values []RepositoryAdvisoryUpdate_severity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryAdvisoryUpdate_severity) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update_state.go new file mode 100644 index 000000000..7b4f1e80c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update_state.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The state of the advisory. +type RepositoryAdvisoryUpdate_state int + +const ( + PUBLISHED_REPOSITORYADVISORYUPDATE_STATE RepositoryAdvisoryUpdate_state = iota + CLOSED_REPOSITORYADVISORYUPDATE_STATE + DRAFT_REPOSITORYADVISORYUPDATE_STATE +) + +func (i RepositoryAdvisoryUpdate_state) String() string { + return []string{"published", "closed", "draft"}[i] +} +func ParseRepositoryAdvisoryUpdate_state(v string) (any, error) { + result := PUBLISHED_REPOSITORYADVISORYUPDATE_STATE + switch v { + case "published": + result = PUBLISHED_REPOSITORYADVISORYUPDATE_STATE + case "closed": + result = CLOSED_REPOSITORYADVISORYUPDATE_STATE + case "draft": + result = DRAFT_REPOSITORYADVISORYUPDATE_STATE + default: + return 0, errors.New("Unknown RepositoryAdvisoryUpdate_state value: " + v) + } + return &result, nil +} +func SerializeRepositoryAdvisoryUpdate_state(values []RepositoryAdvisoryUpdate_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryAdvisoryUpdate_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update_vulnerabilities.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update_vulnerabilities.go new file mode 100644 index 000000000..7bc11784f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update_vulnerabilities.go @@ -0,0 +1,154 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryAdvisoryUpdate_vulnerabilities struct { + // The name of the package affected by the vulnerability. + packageEscaped RepositoryAdvisoryUpdate_vulnerabilities_packageable + // The package version(s) that resolve the vulnerability. + patched_versions *string + // The functions in the package that are affected. + vulnerable_functions []string + // The range of the package versions affected by the vulnerability. + vulnerable_version_range *string +} +// NewRepositoryAdvisoryUpdate_vulnerabilities instantiates a new RepositoryAdvisoryUpdate_vulnerabilities and sets the default values. +func NewRepositoryAdvisoryUpdate_vulnerabilities()(*RepositoryAdvisoryUpdate_vulnerabilities) { + m := &RepositoryAdvisoryUpdate_vulnerabilities{ + } + return m +} +// CreateRepositoryAdvisoryUpdate_vulnerabilitiesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAdvisoryUpdate_vulnerabilitiesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryAdvisoryUpdate_vulnerabilities(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryAdvisoryUpdate_vulnerabilities) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["package"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryAdvisoryUpdate_vulnerabilities_packageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPackageEscaped(val.(RepositoryAdvisoryUpdate_vulnerabilities_packageable)) + } + return nil + } + res["patched_versions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatchedVersions(val) + } + return nil + } + res["vulnerable_functions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetVulnerableFunctions(res) + } + return nil + } + res["vulnerable_version_range"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVulnerableVersionRange(val) + } + return nil + } + return res +} +// GetPackageEscaped gets the package property value. The name of the package affected by the vulnerability. +// returns a RepositoryAdvisoryUpdate_vulnerabilities_packageable when successful +func (m *RepositoryAdvisoryUpdate_vulnerabilities) GetPackageEscaped()(RepositoryAdvisoryUpdate_vulnerabilities_packageable) { + return m.packageEscaped +} +// GetPatchedVersions gets the patched_versions property value. The package version(s) that resolve the vulnerability. +// returns a *string when successful +func (m *RepositoryAdvisoryUpdate_vulnerabilities) GetPatchedVersions()(*string) { + return m.patched_versions +} +// GetVulnerableFunctions gets the vulnerable_functions property value. The functions in the package that are affected. +// returns a []string when successful +func (m *RepositoryAdvisoryUpdate_vulnerabilities) GetVulnerableFunctions()([]string) { + return m.vulnerable_functions +} +// GetVulnerableVersionRange gets the vulnerable_version_range property value. The range of the package versions affected by the vulnerability. +// returns a *string when successful +func (m *RepositoryAdvisoryUpdate_vulnerabilities) GetVulnerableVersionRange()(*string) { + return m.vulnerable_version_range +} +// Serialize serializes information the current object +func (m *RepositoryAdvisoryUpdate_vulnerabilities) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("package", m.GetPackageEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patched_versions", m.GetPatchedVersions()) + if err != nil { + return err + } + } + if m.GetVulnerableFunctions() != nil { + err := writer.WriteCollectionOfStringValues("vulnerable_functions", m.GetVulnerableFunctions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("vulnerable_version_range", m.GetVulnerableVersionRange()) + if err != nil { + return err + } + } + return nil +} +// SetPackageEscaped sets the package property value. The name of the package affected by the vulnerability. +func (m *RepositoryAdvisoryUpdate_vulnerabilities) SetPackageEscaped(value RepositoryAdvisoryUpdate_vulnerabilities_packageable)() { + m.packageEscaped = value +} +// SetPatchedVersions sets the patched_versions property value. The package version(s) that resolve the vulnerability. +func (m *RepositoryAdvisoryUpdate_vulnerabilities) SetPatchedVersions(value *string)() { + m.patched_versions = value +} +// SetVulnerableFunctions sets the vulnerable_functions property value. The functions in the package that are affected. +func (m *RepositoryAdvisoryUpdate_vulnerabilities) SetVulnerableFunctions(value []string)() { + m.vulnerable_functions = value +} +// SetVulnerableVersionRange sets the vulnerable_version_range property value. The range of the package versions affected by the vulnerability. +func (m *RepositoryAdvisoryUpdate_vulnerabilities) SetVulnerableVersionRange(value *string)() { + m.vulnerable_version_range = value +} +type RepositoryAdvisoryUpdate_vulnerabilitiesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPackageEscaped()(RepositoryAdvisoryUpdate_vulnerabilities_packageable) + GetPatchedVersions()(*string) + GetVulnerableFunctions()([]string) + GetVulnerableVersionRange()(*string) + SetPackageEscaped(value RepositoryAdvisoryUpdate_vulnerabilities_packageable)() + SetPatchedVersions(value *string)() + SetVulnerableFunctions(value []string)() + SetVulnerableVersionRange(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update_vulnerabilities_package.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update_vulnerabilities_package.go new file mode 100644 index 000000000..017867bc2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_update_vulnerabilities_package.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryAdvisoryUpdate_vulnerabilities_package the name of the package affected by the vulnerability. +type RepositoryAdvisoryUpdate_vulnerabilities_package struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The package's language or package management ecosystem. + ecosystem *SecurityAdvisoryEcosystems + // The unique package name within its ecosystem. + name *string +} +// NewRepositoryAdvisoryUpdate_vulnerabilities_package instantiates a new RepositoryAdvisoryUpdate_vulnerabilities_package and sets the default values. +func NewRepositoryAdvisoryUpdate_vulnerabilities_package()(*RepositoryAdvisoryUpdate_vulnerabilities_package) { + m := &RepositoryAdvisoryUpdate_vulnerabilities_package{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryAdvisoryUpdate_vulnerabilities_packageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAdvisoryUpdate_vulnerabilities_packageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryAdvisoryUpdate_vulnerabilities_package(), 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 *RepositoryAdvisoryUpdate_vulnerabilities_package) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEcosystem gets the ecosystem property value. The package's language or package management ecosystem. +// returns a *SecurityAdvisoryEcosystems when successful +func (m *RepositoryAdvisoryUpdate_vulnerabilities_package) GetEcosystem()(*SecurityAdvisoryEcosystems) { + return m.ecosystem +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryAdvisoryUpdate_vulnerabilities_package) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ecosystem"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAdvisoryEcosystems) + if err != nil { + return err + } + if val != nil { + m.SetEcosystem(val.(*SecurityAdvisoryEcosystems)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The unique package name within its ecosystem. +// returns a *string when successful +func (m *RepositoryAdvisoryUpdate_vulnerabilities_package) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *RepositoryAdvisoryUpdate_vulnerabilities_package) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEcosystem() != nil { + cast := (*m.GetEcosystem()).String() + err := writer.WriteStringValue("ecosystem", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *RepositoryAdvisoryUpdate_vulnerabilities_package) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEcosystem sets the ecosystem property value. The package's language or package management ecosystem. +func (m *RepositoryAdvisoryUpdate_vulnerabilities_package) SetEcosystem(value *SecurityAdvisoryEcosystems)() { + m.ecosystem = value +} +// SetName sets the name property value. The unique package name within its ecosystem. +func (m *RepositoryAdvisoryUpdate_vulnerabilities_package) SetName(value *string)() { + m.name = value +} +type RepositoryAdvisoryUpdate_vulnerabilities_packageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEcosystem()(*SecurityAdvisoryEcosystems) + GetName()(*string) + SetEcosystem(value *SecurityAdvisoryEcosystems)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_vulnerability.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_vulnerability.go new file mode 100644 index 000000000..a97322d8a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_vulnerability.go @@ -0,0 +1,155 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryAdvisoryVulnerability a product affected by the vulnerability detailed in a repository security advisory. +type RepositoryAdvisoryVulnerability struct { + // The name of the package affected by the vulnerability. + packageEscaped RepositoryAdvisoryVulnerability_packageable + // The package version(s) that resolve the vulnerability. + patched_versions *string + // The functions in the package that are affected. + vulnerable_functions []string + // The range of the package versions affected by the vulnerability. + vulnerable_version_range *string +} +// NewRepositoryAdvisoryVulnerability instantiates a new RepositoryAdvisoryVulnerability and sets the default values. +func NewRepositoryAdvisoryVulnerability()(*RepositoryAdvisoryVulnerability) { + m := &RepositoryAdvisoryVulnerability{ + } + return m +} +// CreateRepositoryAdvisoryVulnerabilityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAdvisoryVulnerabilityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryAdvisoryVulnerability(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryAdvisoryVulnerability) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["package"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryAdvisoryVulnerability_packageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPackageEscaped(val.(RepositoryAdvisoryVulnerability_packageable)) + } + return nil + } + res["patched_versions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatchedVersions(val) + } + return nil + } + res["vulnerable_functions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetVulnerableFunctions(res) + } + return nil + } + res["vulnerable_version_range"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVulnerableVersionRange(val) + } + return nil + } + return res +} +// GetPackageEscaped gets the package property value. The name of the package affected by the vulnerability. +// returns a RepositoryAdvisoryVulnerability_packageable when successful +func (m *RepositoryAdvisoryVulnerability) GetPackageEscaped()(RepositoryAdvisoryVulnerability_packageable) { + return m.packageEscaped +} +// GetPatchedVersions gets the patched_versions property value. The package version(s) that resolve the vulnerability. +// returns a *string when successful +func (m *RepositoryAdvisoryVulnerability) GetPatchedVersions()(*string) { + return m.patched_versions +} +// GetVulnerableFunctions gets the vulnerable_functions property value. The functions in the package that are affected. +// returns a []string when successful +func (m *RepositoryAdvisoryVulnerability) GetVulnerableFunctions()([]string) { + return m.vulnerable_functions +} +// GetVulnerableVersionRange gets the vulnerable_version_range property value. The range of the package versions affected by the vulnerability. +// returns a *string when successful +func (m *RepositoryAdvisoryVulnerability) GetVulnerableVersionRange()(*string) { + return m.vulnerable_version_range +} +// Serialize serializes information the current object +func (m *RepositoryAdvisoryVulnerability) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("package", m.GetPackageEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patched_versions", m.GetPatchedVersions()) + if err != nil { + return err + } + } + if m.GetVulnerableFunctions() != nil { + err := writer.WriteCollectionOfStringValues("vulnerable_functions", m.GetVulnerableFunctions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("vulnerable_version_range", m.GetVulnerableVersionRange()) + if err != nil { + return err + } + } + return nil +} +// SetPackageEscaped sets the package property value. The name of the package affected by the vulnerability. +func (m *RepositoryAdvisoryVulnerability) SetPackageEscaped(value RepositoryAdvisoryVulnerability_packageable)() { + m.packageEscaped = value +} +// SetPatchedVersions sets the patched_versions property value. The package version(s) that resolve the vulnerability. +func (m *RepositoryAdvisoryVulnerability) SetPatchedVersions(value *string)() { + m.patched_versions = value +} +// SetVulnerableFunctions sets the vulnerable_functions property value. The functions in the package that are affected. +func (m *RepositoryAdvisoryVulnerability) SetVulnerableFunctions(value []string)() { + m.vulnerable_functions = value +} +// SetVulnerableVersionRange sets the vulnerable_version_range property value. The range of the package versions affected by the vulnerability. +func (m *RepositoryAdvisoryVulnerability) SetVulnerableVersionRange(value *string)() { + m.vulnerable_version_range = value +} +type RepositoryAdvisoryVulnerabilityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPackageEscaped()(RepositoryAdvisoryVulnerability_packageable) + GetPatchedVersions()(*string) + GetVulnerableFunctions()([]string) + GetVulnerableVersionRange()(*string) + SetPackageEscaped(value RepositoryAdvisoryVulnerability_packageable)() + SetPatchedVersions(value *string)() + SetVulnerableFunctions(value []string)() + SetVulnerableVersionRange(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_vulnerability_package.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_vulnerability_package.go new file mode 100644 index 000000000..86fae5b68 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_advisory_vulnerability_package.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryAdvisoryVulnerability_package the name of the package affected by the vulnerability. +type RepositoryAdvisoryVulnerability_package struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The package's language or package management ecosystem. + ecosystem *SecurityAdvisoryEcosystems + // The unique package name within its ecosystem. + name *string +} +// NewRepositoryAdvisoryVulnerability_package instantiates a new RepositoryAdvisoryVulnerability_package and sets the default values. +func NewRepositoryAdvisoryVulnerability_package()(*RepositoryAdvisoryVulnerability_package) { + m := &RepositoryAdvisoryVulnerability_package{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryAdvisoryVulnerability_packageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAdvisoryVulnerability_packageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryAdvisoryVulnerability_package(), 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 *RepositoryAdvisoryVulnerability_package) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEcosystem gets the ecosystem property value. The package's language or package management ecosystem. +// returns a *SecurityAdvisoryEcosystems when successful +func (m *RepositoryAdvisoryVulnerability_package) GetEcosystem()(*SecurityAdvisoryEcosystems) { + return m.ecosystem +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryAdvisoryVulnerability_package) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ecosystem"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAdvisoryEcosystems) + if err != nil { + return err + } + if val != nil { + m.SetEcosystem(val.(*SecurityAdvisoryEcosystems)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The unique package name within its ecosystem. +// returns a *string when successful +func (m *RepositoryAdvisoryVulnerability_package) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *RepositoryAdvisoryVulnerability_package) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEcosystem() != nil { + cast := (*m.GetEcosystem()).String() + err := writer.WriteStringValue("ecosystem", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *RepositoryAdvisoryVulnerability_package) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEcosystem sets the ecosystem property value. The package's language or package management ecosystem. +func (m *RepositoryAdvisoryVulnerability_package) SetEcosystem(value *SecurityAdvisoryEcosystems)() { + m.ecosystem = value +} +// SetName sets the name property value. The unique package name within its ecosystem. +func (m *RepositoryAdvisoryVulnerability_package) SetName(value *string)() { + m.name = value +} +type RepositoryAdvisoryVulnerability_packageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEcosystem()(*SecurityAdvisoryEcosystems) + GetName()(*string) + SetEcosystem(value *SecurityAdvisoryEcosystems)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_collaborator_permission.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_collaborator_permission.go new file mode 100644 index 000000000..59df30811 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_collaborator_permission.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryCollaboratorPermission repository Collaborator Permission +type RepositoryCollaboratorPermission struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The permission property + permission *string + // The role_name property + role_name *string + // Collaborator + user NullableCollaboratorable +} +// NewRepositoryCollaboratorPermission instantiates a new RepositoryCollaboratorPermission and sets the default values. +func NewRepositoryCollaboratorPermission()(*RepositoryCollaboratorPermission) { + m := &RepositoryCollaboratorPermission{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryCollaboratorPermissionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryCollaboratorPermissionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryCollaboratorPermission(), 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 *RepositoryCollaboratorPermission) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryCollaboratorPermission) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + res["role_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRoleName(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableCollaboratorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableCollaboratorable)) + } + return nil + } + return res +} +// GetPermission gets the permission property value. The permission property +// returns a *string when successful +func (m *RepositoryCollaboratorPermission) GetPermission()(*string) { + return m.permission +} +// GetRoleName gets the role_name property value. The role_name property +// returns a *string when successful +func (m *RepositoryCollaboratorPermission) GetRoleName()(*string) { + return m.role_name +} +// GetUser gets the user property value. Collaborator +// returns a NullableCollaboratorable when successful +func (m *RepositoryCollaboratorPermission) GetUser()(NullableCollaboratorable) { + return m.user +} +// Serialize serializes information the current object +func (m *RepositoryCollaboratorPermission) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("permission", m.GetPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("role_name", m.GetRoleName()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *RepositoryCollaboratorPermission) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPermission sets the permission property value. The permission property +func (m *RepositoryCollaboratorPermission) SetPermission(value *string)() { + m.permission = value +} +// SetRoleName sets the role_name property value. The role_name property +func (m *RepositoryCollaboratorPermission) SetRoleName(value *string)() { + m.role_name = value +} +// SetUser sets the user property value. Collaborator +func (m *RepositoryCollaboratorPermission) SetUser(value NullableCollaboratorable)() { + m.user = value +} +type RepositoryCollaboratorPermissionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPermission()(*string) + GetRoleName()(*string) + GetUser()(NullableCollaboratorable) + SetPermission(value *string)() + SetRoleName(value *string)() + SetUser(value NullableCollaboratorable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_invitation.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_invitation.go new file mode 100644 index 000000000..e286ea8c8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_invitation.go @@ -0,0 +1,344 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryInvitation repository invitations let you manage who you collaborate with. +type RepositoryInvitation struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Whether or not the invitation has expired + expired *bool + // The html_url property + html_url *string + // Unique identifier of the repository invitation. + id *int64 + // A GitHub user. + invitee NullableSimpleUserable + // A GitHub user. + inviter NullableSimpleUserable + // The node_id property + node_id *string + // The permission associated with the invitation. + permissions *RepositoryInvitation_permissions + // Minimal Repository + repository MinimalRepositoryable + // URL for the repository invitation + url *string +} +// NewRepositoryInvitation instantiates a new RepositoryInvitation and sets the default values. +func NewRepositoryInvitation()(*RepositoryInvitation) { + m := &RepositoryInvitation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryInvitationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryInvitationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryInvitation(), 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 *RepositoryInvitation) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *RepositoryInvitation) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetExpired gets the expired property value. Whether or not the invitation has expired +// returns a *bool when successful +func (m *RepositoryInvitation) GetExpired()(*bool) { + return m.expired +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryInvitation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["expired"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExpired(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["invitee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInvitee(val.(NullableSimpleUserable)) + } + return nil + } + res["inviter"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInviter(val.(NullableSimpleUserable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryInvitation_permissions) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(*RepositoryInvitation_permissions)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(MinimalRepositoryable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *RepositoryInvitation) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the repository invitation. +// returns a *int64 when successful +func (m *RepositoryInvitation) GetId()(*int64) { + return m.id +} +// GetInvitee gets the invitee property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *RepositoryInvitation) GetInvitee()(NullableSimpleUserable) { + return m.invitee +} +// GetInviter gets the inviter property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *RepositoryInvitation) GetInviter()(NullableSimpleUserable) { + return m.inviter +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *RepositoryInvitation) GetNodeId()(*string) { + return m.node_id +} +// GetPermissions gets the permissions property value. The permission associated with the invitation. +// returns a *RepositoryInvitation_permissions when successful +func (m *RepositoryInvitation) GetPermissions()(*RepositoryInvitation_permissions) { + return m.permissions +} +// GetRepository gets the repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *RepositoryInvitation) GetRepository()(MinimalRepositoryable) { + return m.repository +} +// GetUrl gets the url property value. URL for the repository invitation +// returns a *string when successful +func (m *RepositoryInvitation) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *RepositoryInvitation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("expired", m.GetExpired()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("invitee", m.GetInvitee()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("inviter", m.GetInviter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetPermissions() != nil { + cast := (*m.GetPermissions()).String() + err := writer.WriteStringValue("permissions", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *RepositoryInvitation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *RepositoryInvitation) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetExpired sets the expired property value. Whether or not the invitation has expired +func (m *RepositoryInvitation) SetExpired(value *bool)() { + m.expired = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *RepositoryInvitation) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the repository invitation. +func (m *RepositoryInvitation) SetId(value *int64)() { + m.id = value +} +// SetInvitee sets the invitee property value. A GitHub user. +func (m *RepositoryInvitation) SetInvitee(value NullableSimpleUserable)() { + m.invitee = value +} +// SetInviter sets the inviter property value. A GitHub user. +func (m *RepositoryInvitation) SetInviter(value NullableSimpleUserable)() { + m.inviter = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *RepositoryInvitation) SetNodeId(value *string)() { + m.node_id = value +} +// SetPermissions sets the permissions property value. The permission associated with the invitation. +func (m *RepositoryInvitation) SetPermissions(value *RepositoryInvitation_permissions)() { + m.permissions = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *RepositoryInvitation) SetRepository(value MinimalRepositoryable)() { + m.repository = value +} +// SetUrl sets the url property value. URL for the repository invitation +func (m *RepositoryInvitation) SetUrl(value *string)() { + m.url = value +} +type RepositoryInvitationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetExpired()(*bool) + GetHtmlUrl()(*string) + GetId()(*int64) + GetInvitee()(NullableSimpleUserable) + GetInviter()(NullableSimpleUserable) + GetNodeId()(*string) + GetPermissions()(*RepositoryInvitation_permissions) + GetRepository()(MinimalRepositoryable) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetExpired(value *bool)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetInvitee(value NullableSimpleUserable)() + SetInviter(value NullableSimpleUserable)() + SetNodeId(value *string)() + SetPermissions(value *RepositoryInvitation_permissions)() + SetRepository(value MinimalRepositoryable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_invitation_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_invitation_permissions.go new file mode 100644 index 000000000..832511358 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_invitation_permissions.go @@ -0,0 +1,46 @@ +package models +import ( + "errors" +) +// The permission associated with the invitation. +type RepositoryInvitation_permissions int + +const ( + READ_REPOSITORYINVITATION_PERMISSIONS RepositoryInvitation_permissions = iota + WRITE_REPOSITORYINVITATION_PERMISSIONS + ADMIN_REPOSITORYINVITATION_PERMISSIONS + TRIAGE_REPOSITORYINVITATION_PERMISSIONS + MAINTAIN_REPOSITORYINVITATION_PERMISSIONS +) + +func (i RepositoryInvitation_permissions) String() string { + return []string{"read", "write", "admin", "triage", "maintain"}[i] +} +func ParseRepositoryInvitation_permissions(v string) (any, error) { + result := READ_REPOSITORYINVITATION_PERMISSIONS + switch v { + case "read": + result = READ_REPOSITORYINVITATION_PERMISSIONS + case "write": + result = WRITE_REPOSITORYINVITATION_PERMISSIONS + case "admin": + result = ADMIN_REPOSITORYINVITATION_PERMISSIONS + case "triage": + result = TRIAGE_REPOSITORYINVITATION_PERMISSIONS + case "maintain": + result = MAINTAIN_REPOSITORYINVITATION_PERMISSIONS + default: + return 0, errors.New("Unknown RepositoryInvitation_permissions value: " + v) + } + return &result, nil +} +func SerializeRepositoryInvitation_permissions(values []RepositoryInvitation_permissions) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryInvitation_permissions) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_merge_commit_message.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_merge_commit_message.go new file mode 100644 index 000000000..784511946 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_merge_commit_message.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +type Repository_merge_commit_message int + +const ( + PR_BODY_REPOSITORY_MERGE_COMMIT_MESSAGE Repository_merge_commit_message = iota + PR_TITLE_REPOSITORY_MERGE_COMMIT_MESSAGE + BLANK_REPOSITORY_MERGE_COMMIT_MESSAGE +) + +func (i Repository_merge_commit_message) String() string { + return []string{"PR_BODY", "PR_TITLE", "BLANK"}[i] +} +func ParseRepository_merge_commit_message(v string) (any, error) { + result := PR_BODY_REPOSITORY_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_REPOSITORY_MERGE_COMMIT_MESSAGE + case "PR_TITLE": + result = PR_TITLE_REPOSITORY_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_REPOSITORY_MERGE_COMMIT_MESSAGE + default: + return 0, errors.New("Unknown Repository_merge_commit_message value: " + v) + } + return &result, nil +} +func SerializeRepository_merge_commit_message(values []Repository_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Repository_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_merge_commit_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_merge_commit_title.go new file mode 100644 index 000000000..a1816e679 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_merge_commit_title.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +type Repository_merge_commit_title int + +const ( + PR_TITLE_REPOSITORY_MERGE_COMMIT_TITLE Repository_merge_commit_title = iota + MERGE_MESSAGE_REPOSITORY_MERGE_COMMIT_TITLE +) + +func (i Repository_merge_commit_title) String() string { + return []string{"PR_TITLE", "MERGE_MESSAGE"}[i] +} +func ParseRepository_merge_commit_title(v string) (any, error) { + result := PR_TITLE_REPOSITORY_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_REPOSITORY_MERGE_COMMIT_TITLE + case "MERGE_MESSAGE": + result = MERGE_MESSAGE_REPOSITORY_MERGE_COMMIT_TITLE + default: + return 0, errors.New("Unknown Repository_merge_commit_title value: " + v) + } + return &result, nil +} +func SerializeRepository_merge_commit_title(values []Repository_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Repository_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_permissions.go new file mode 100644 index 000000000..453eab617 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Repository_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewRepository_permissions instantiates a new Repository_permissions and sets the default values. +func NewRepository_permissions()(*Repository_permissions) { + m := &Repository_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepository_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepository_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepository_permissions(), 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 *Repository_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *Repository_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Repository_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *Repository_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *Repository_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *Repository_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *Repository_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *Repository_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *Repository_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *Repository_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *Repository_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *Repository_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *Repository_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *Repository_permissions) SetTriage(value *bool)() { + m.triage = value +} +type Repository_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule.go new file mode 100644 index 000000000..64a538bab --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule.go @@ -0,0 +1,1853 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRule composed type wrapper for classes File_extension_restrictionable, File_path_restrictionable, Max_file_path_lengthable, Max_file_sizeable, RepositoryRuleBranchNamePatternable, RepositoryRuleCodeScanningable, RepositoryRuleCommitAuthorEmailPatternable, RepositoryRuleCommitMessagePatternable, RepositoryRuleCommitterEmailPatternable, RepositoryRuleCreationable, RepositoryRuleDeletionable, RepositoryRuleNonFastForwardable, RepositoryRulePullRequestable, RepositoryRuleRequiredDeploymentsable, RepositoryRuleRequiredLinearHistoryable, RepositoryRuleRequiredSignaturesable, RepositoryRuleRequiredStatusChecksable, RepositoryRuleTagNamePatternable, RepositoryRuleUpdateable, RepositoryRuleWorkflowsable +type RepositoryRule struct { + // Composed type representation for type File_extension_restrictionable + file_extension_restriction File_extension_restrictionable + // Composed type representation for type File_path_restrictionable + file_path_restriction File_path_restrictionable + // Composed type representation for type Max_file_path_lengthable + max_file_path_length Max_file_path_lengthable + // Composed type representation for type Max_file_sizeable + max_file_size Max_file_sizeable + // Composed type representation for type RepositoryRuleBranchNamePatternable + repositoryRuleBranchNamePattern RepositoryRuleBranchNamePatternable + // Composed type representation for type RepositoryRuleCodeScanningable + repositoryRuleCodeScanning RepositoryRuleCodeScanningable + // Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable + repositoryRuleCommitAuthorEmailPattern RepositoryRuleCommitAuthorEmailPatternable + // Composed type representation for type RepositoryRuleCommitMessagePatternable + repositoryRuleCommitMessagePattern RepositoryRuleCommitMessagePatternable + // Composed type representation for type RepositoryRuleCommitterEmailPatternable + repositoryRuleCommitterEmailPattern RepositoryRuleCommitterEmailPatternable + // Composed type representation for type RepositoryRuleCreationable + repositoryRuleCreation RepositoryRuleCreationable + // Composed type representation for type RepositoryRuleDeletionable + repositoryRuleDeletion RepositoryRuleDeletionable + // Composed type representation for type File_extension_restrictionable + repositoryRuleFile_extension_restriction File_extension_restrictionable + // Composed type representation for type File_extension_restrictionable + repositoryRuleFile_extension_restriction0 File_extension_restrictionable + // Composed type representation for type File_extension_restrictionable + repositoryRuleFile_extension_restriction1 File_extension_restrictionable + // Composed type representation for type File_extension_restrictionable + repositoryRuleFile_extension_restriction2 File_extension_restrictionable + // Composed type representation for type File_path_restrictionable + repositoryRuleFile_path_restriction File_path_restrictionable + // Composed type representation for type File_path_restrictionable + repositoryRuleFile_path_restriction0 File_path_restrictionable + // Composed type representation for type File_path_restrictionable + repositoryRuleFile_path_restriction1 File_path_restrictionable + // Composed type representation for type File_path_restrictionable + repositoryRuleFile_path_restriction2 File_path_restrictionable + // Composed type representation for type Max_file_path_lengthable + repositoryRuleMax_file_path_length Max_file_path_lengthable + // Composed type representation for type Max_file_path_lengthable + repositoryRuleMax_file_path_length0 Max_file_path_lengthable + // Composed type representation for type Max_file_path_lengthable + repositoryRuleMax_file_path_length1 Max_file_path_lengthable + // Composed type representation for type Max_file_path_lengthable + repositoryRuleMax_file_path_length2 Max_file_path_lengthable + // Composed type representation for type Max_file_sizeable + repositoryRuleMax_file_size Max_file_sizeable + // Composed type representation for type Max_file_sizeable + repositoryRuleMax_file_size0 Max_file_sizeable + // Composed type representation for type Max_file_sizeable + repositoryRuleMax_file_size1 Max_file_sizeable + // Composed type representation for type Max_file_sizeable + repositoryRuleMax_file_size2 Max_file_sizeable + // Composed type representation for type RepositoryRuleNonFastForwardable + repositoryRuleNonFastForward RepositoryRuleNonFastForwardable + // Composed type representation for type RepositoryRulePullRequestable + repositoryRulePullRequest RepositoryRulePullRequestable + // Composed type representation for type RepositoryRuleBranchNamePatternable + repositoryRuleRepositoryRuleBranchNamePattern RepositoryRuleBranchNamePatternable + // Composed type representation for type RepositoryRuleBranchNamePatternable + repositoryRuleRepositoryRuleBranchNamePattern0 RepositoryRuleBranchNamePatternable + // Composed type representation for type RepositoryRuleBranchNamePatternable + repositoryRuleRepositoryRuleBranchNamePattern1 RepositoryRuleBranchNamePatternable + // Composed type representation for type RepositoryRuleBranchNamePatternable + repositoryRuleRepositoryRuleBranchNamePattern2 RepositoryRuleBranchNamePatternable + // Composed type representation for type RepositoryRuleCodeScanningable + repositoryRuleRepositoryRuleCodeScanning RepositoryRuleCodeScanningable + // Composed type representation for type RepositoryRuleCodeScanningable + repositoryRuleRepositoryRuleCodeScanning0 RepositoryRuleCodeScanningable + // Composed type representation for type RepositoryRuleCodeScanningable + repositoryRuleRepositoryRuleCodeScanning1 RepositoryRuleCodeScanningable + // Composed type representation for type RepositoryRuleCodeScanningable + repositoryRuleRepositoryRuleCodeScanning2 RepositoryRuleCodeScanningable + // Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable + repositoryRuleRepositoryRuleCommitAuthorEmailPattern RepositoryRuleCommitAuthorEmailPatternable + // Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable + repositoryRuleRepositoryRuleCommitAuthorEmailPattern0 RepositoryRuleCommitAuthorEmailPatternable + // Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable + repositoryRuleRepositoryRuleCommitAuthorEmailPattern1 RepositoryRuleCommitAuthorEmailPatternable + // Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable + repositoryRuleRepositoryRuleCommitAuthorEmailPattern2 RepositoryRuleCommitAuthorEmailPatternable + // Composed type representation for type RepositoryRuleCommitMessagePatternable + repositoryRuleRepositoryRuleCommitMessagePattern RepositoryRuleCommitMessagePatternable + // Composed type representation for type RepositoryRuleCommitMessagePatternable + repositoryRuleRepositoryRuleCommitMessagePattern0 RepositoryRuleCommitMessagePatternable + // Composed type representation for type RepositoryRuleCommitMessagePatternable + repositoryRuleRepositoryRuleCommitMessagePattern1 RepositoryRuleCommitMessagePatternable + // Composed type representation for type RepositoryRuleCommitMessagePatternable + repositoryRuleRepositoryRuleCommitMessagePattern2 RepositoryRuleCommitMessagePatternable + // Composed type representation for type RepositoryRuleCommitterEmailPatternable + repositoryRuleRepositoryRuleCommitterEmailPattern RepositoryRuleCommitterEmailPatternable + // Composed type representation for type RepositoryRuleCommitterEmailPatternable + repositoryRuleRepositoryRuleCommitterEmailPattern0 RepositoryRuleCommitterEmailPatternable + // Composed type representation for type RepositoryRuleCommitterEmailPatternable + repositoryRuleRepositoryRuleCommitterEmailPattern1 RepositoryRuleCommitterEmailPatternable + // Composed type representation for type RepositoryRuleCommitterEmailPatternable + repositoryRuleRepositoryRuleCommitterEmailPattern2 RepositoryRuleCommitterEmailPatternable + // Composed type representation for type RepositoryRuleCreationable + repositoryRuleRepositoryRuleCreation RepositoryRuleCreationable + // Composed type representation for type RepositoryRuleCreationable + repositoryRuleRepositoryRuleCreation0 RepositoryRuleCreationable + // Composed type representation for type RepositoryRuleCreationable + repositoryRuleRepositoryRuleCreation1 RepositoryRuleCreationable + // Composed type representation for type RepositoryRuleCreationable + repositoryRuleRepositoryRuleCreation2 RepositoryRuleCreationable + // Composed type representation for type RepositoryRuleDeletionable + repositoryRuleRepositoryRuleDeletion RepositoryRuleDeletionable + // Composed type representation for type RepositoryRuleDeletionable + repositoryRuleRepositoryRuleDeletion0 RepositoryRuleDeletionable + // Composed type representation for type RepositoryRuleDeletionable + repositoryRuleRepositoryRuleDeletion1 RepositoryRuleDeletionable + // Composed type representation for type RepositoryRuleDeletionable + repositoryRuleRepositoryRuleDeletion2 RepositoryRuleDeletionable + // Composed type representation for type RepositoryRuleNonFastForwardable + repositoryRuleRepositoryRuleNonFastForward RepositoryRuleNonFastForwardable + // Composed type representation for type RepositoryRuleNonFastForwardable + repositoryRuleRepositoryRuleNonFastForward0 RepositoryRuleNonFastForwardable + // Composed type representation for type RepositoryRuleNonFastForwardable + repositoryRuleRepositoryRuleNonFastForward1 RepositoryRuleNonFastForwardable + // Composed type representation for type RepositoryRuleNonFastForwardable + repositoryRuleRepositoryRuleNonFastForward2 RepositoryRuleNonFastForwardable + // Composed type representation for type RepositoryRulePullRequestable + repositoryRuleRepositoryRulePullRequest RepositoryRulePullRequestable + // Composed type representation for type RepositoryRulePullRequestable + repositoryRuleRepositoryRulePullRequest0 RepositoryRulePullRequestable + // Composed type representation for type RepositoryRulePullRequestable + repositoryRuleRepositoryRulePullRequest1 RepositoryRulePullRequestable + // Composed type representation for type RepositoryRulePullRequestable + repositoryRuleRepositoryRulePullRequest2 RepositoryRulePullRequestable + // Composed type representation for type RepositoryRuleRequiredDeploymentsable + repositoryRuleRepositoryRuleRequiredDeployments RepositoryRuleRequiredDeploymentsable + // Composed type representation for type RepositoryRuleRequiredDeploymentsable + repositoryRuleRepositoryRuleRequiredDeployments0 RepositoryRuleRequiredDeploymentsable + // Composed type representation for type RepositoryRuleRequiredDeploymentsable + repositoryRuleRepositoryRuleRequiredDeployments1 RepositoryRuleRequiredDeploymentsable + // Composed type representation for type RepositoryRuleRequiredDeploymentsable + repositoryRuleRepositoryRuleRequiredDeployments2 RepositoryRuleRequiredDeploymentsable + // Composed type representation for type RepositoryRuleRequiredLinearHistoryable + repositoryRuleRepositoryRuleRequiredLinearHistory RepositoryRuleRequiredLinearHistoryable + // Composed type representation for type RepositoryRuleRequiredLinearHistoryable + repositoryRuleRepositoryRuleRequiredLinearHistory0 RepositoryRuleRequiredLinearHistoryable + // Composed type representation for type RepositoryRuleRequiredLinearHistoryable + repositoryRuleRepositoryRuleRequiredLinearHistory1 RepositoryRuleRequiredLinearHistoryable + // Composed type representation for type RepositoryRuleRequiredLinearHistoryable + repositoryRuleRepositoryRuleRequiredLinearHistory2 RepositoryRuleRequiredLinearHistoryable + // Composed type representation for type RepositoryRuleRequiredSignaturesable + repositoryRuleRepositoryRuleRequiredSignatures RepositoryRuleRequiredSignaturesable + // Composed type representation for type RepositoryRuleRequiredSignaturesable + repositoryRuleRepositoryRuleRequiredSignatures0 RepositoryRuleRequiredSignaturesable + // Composed type representation for type RepositoryRuleRequiredSignaturesable + repositoryRuleRepositoryRuleRequiredSignatures1 RepositoryRuleRequiredSignaturesable + // Composed type representation for type RepositoryRuleRequiredSignaturesable + repositoryRuleRepositoryRuleRequiredSignatures2 RepositoryRuleRequiredSignaturesable + // Composed type representation for type RepositoryRuleRequiredStatusChecksable + repositoryRuleRepositoryRuleRequiredStatusChecks RepositoryRuleRequiredStatusChecksable + // Composed type representation for type RepositoryRuleRequiredStatusChecksable + repositoryRuleRepositoryRuleRequiredStatusChecks0 RepositoryRuleRequiredStatusChecksable + // Composed type representation for type RepositoryRuleRequiredStatusChecksable + repositoryRuleRepositoryRuleRequiredStatusChecks1 RepositoryRuleRequiredStatusChecksable + // Composed type representation for type RepositoryRuleRequiredStatusChecksable + repositoryRuleRepositoryRuleRequiredStatusChecks2 RepositoryRuleRequiredStatusChecksable + // Composed type representation for type RepositoryRuleTagNamePatternable + repositoryRuleRepositoryRuleTagNamePattern RepositoryRuleTagNamePatternable + // Composed type representation for type RepositoryRuleTagNamePatternable + repositoryRuleRepositoryRuleTagNamePattern0 RepositoryRuleTagNamePatternable + // Composed type representation for type RepositoryRuleTagNamePatternable + repositoryRuleRepositoryRuleTagNamePattern1 RepositoryRuleTagNamePatternable + // Composed type representation for type RepositoryRuleTagNamePatternable + repositoryRuleRepositoryRuleTagNamePattern2 RepositoryRuleTagNamePatternable + // Composed type representation for type RepositoryRuleUpdateable + repositoryRuleRepositoryRuleUpdate RepositoryRuleUpdateable + // Composed type representation for type RepositoryRuleUpdateable + repositoryRuleRepositoryRuleUpdate0 RepositoryRuleUpdateable + // Composed type representation for type RepositoryRuleUpdateable + repositoryRuleRepositoryRuleUpdate1 RepositoryRuleUpdateable + // Composed type representation for type RepositoryRuleUpdateable + repositoryRuleRepositoryRuleUpdate2 RepositoryRuleUpdateable + // Composed type representation for type RepositoryRuleWorkflowsable + repositoryRuleRepositoryRuleWorkflows RepositoryRuleWorkflowsable + // Composed type representation for type RepositoryRuleWorkflowsable + repositoryRuleRepositoryRuleWorkflows0 RepositoryRuleWorkflowsable + // Composed type representation for type RepositoryRuleWorkflowsable + repositoryRuleRepositoryRuleWorkflows1 RepositoryRuleWorkflowsable + // Composed type representation for type RepositoryRuleWorkflowsable + repositoryRuleRepositoryRuleWorkflows2 RepositoryRuleWorkflowsable + // Composed type representation for type RepositoryRuleRequiredDeploymentsable + repositoryRuleRequiredDeployments RepositoryRuleRequiredDeploymentsable + // Composed type representation for type RepositoryRuleRequiredLinearHistoryable + repositoryRuleRequiredLinearHistory RepositoryRuleRequiredLinearHistoryable + // Composed type representation for type RepositoryRuleRequiredSignaturesable + repositoryRuleRequiredSignatures RepositoryRuleRequiredSignaturesable + // Composed type representation for type RepositoryRuleRequiredStatusChecksable + repositoryRuleRequiredStatusChecks RepositoryRuleRequiredStatusChecksable + // Composed type representation for type RepositoryRuleTagNamePatternable + repositoryRuleTagNamePattern RepositoryRuleTagNamePatternable + // Composed type representation for type RepositoryRuleUpdateable + repositoryRuleUpdate RepositoryRuleUpdateable + // Composed type representation for type RepositoryRuleWorkflowsable + repositoryRuleWorkflows RepositoryRuleWorkflowsable +} +// NewRepositoryRule instantiates a new RepositoryRule and sets the default values. +func NewRepositoryRule()(*RepositoryRule) { + m := &RepositoryRule{ + } + return m +} +// CreateRepositoryRuleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewRepositoryRule() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRule) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetFileExtensionRestriction gets the file_extension_restriction property value. Composed type representation for type File_extension_restrictionable +// returns a File_extension_restrictionable when successful +func (m *RepositoryRule) GetFileExtensionRestriction()(File_extension_restrictionable) { + return m.file_extension_restriction +} +// GetFilePathRestriction gets the file_path_restriction property value. Composed type representation for type File_path_restrictionable +// returns a File_path_restrictionable when successful +func (m *RepositoryRule) GetFilePathRestriction()(File_path_restrictionable) { + return m.file_path_restriction +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *RepositoryRule) GetIsComposedType()(bool) { + return true +} +// GetMaxFilePathLength gets the max_file_path_length property value. Composed type representation for type Max_file_path_lengthable +// returns a Max_file_path_lengthable when successful +func (m *RepositoryRule) GetMaxFilePathLength()(Max_file_path_lengthable) { + return m.max_file_path_length +} +// GetMaxFileSize gets the max_file_size property value. Composed type representation for type Max_file_sizeable +// returns a Max_file_sizeable when successful +func (m *RepositoryRule) GetMaxFileSize()(Max_file_sizeable) { + return m.max_file_size +} +// GetRepositoryRuleBranchNamePattern gets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +// returns a RepositoryRuleBranchNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleBranchNamePattern()(RepositoryRuleBranchNamePatternable) { + return m.repositoryRuleBranchNamePattern +} +// GetRepositoryRuleCodeScanning gets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +// returns a RepositoryRuleCodeScanningable when successful +func (m *RepositoryRule) GetRepositoryRuleCodeScanning()(RepositoryRuleCodeScanningable) { + return m.repositoryRuleCodeScanning +} +// GetRepositoryRuleCommitAuthorEmailPattern gets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +// returns a RepositoryRuleCommitAuthorEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleCommitAuthorEmailPattern()(RepositoryRuleCommitAuthorEmailPatternable) { + return m.repositoryRuleCommitAuthorEmailPattern +} +// GetRepositoryRuleCommitMessagePattern gets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +// returns a RepositoryRuleCommitMessagePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleCommitMessagePattern()(RepositoryRuleCommitMessagePatternable) { + return m.repositoryRuleCommitMessagePattern +} +// GetRepositoryRuleCommitterEmailPattern gets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +// returns a RepositoryRuleCommitterEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleCommitterEmailPattern()(RepositoryRuleCommitterEmailPatternable) { + return m.repositoryRuleCommitterEmailPattern +} +// GetRepositoryRuleCreation gets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +// returns a RepositoryRuleCreationable when successful +func (m *RepositoryRule) GetRepositoryRuleCreation()(RepositoryRuleCreationable) { + return m.repositoryRuleCreation +} +// GetRepositoryRuleDeletion gets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +// returns a RepositoryRuleDeletionable when successful +func (m *RepositoryRule) GetRepositoryRuleDeletion()(RepositoryRuleDeletionable) { + return m.repositoryRuleDeletion +} +// GetRepositoryRuleFileExtensionRestriction gets the file_extension_restriction property value. Composed type representation for type File_extension_restrictionable +// returns a File_extension_restrictionable when successful +func (m *RepositoryRule) GetRepositoryRuleFileExtensionRestriction()(File_extension_restrictionable) { + return m.repositoryRuleFile_extension_restriction +} +// GetRepositoryRuleFileExtensionRestriction0 gets the file_extension_restriction property value. Composed type representation for type File_extension_restrictionable +// returns a File_extension_restrictionable when successful +func (m *RepositoryRule) GetRepositoryRuleFileExtensionRestriction0()(File_extension_restrictionable) { + return m.repositoryRuleFile_extension_restriction0 +} +// GetRepositoryRuleFileExtensionRestriction1 gets the file_extension_restriction property value. Composed type representation for type File_extension_restrictionable +// returns a File_extension_restrictionable when successful +func (m *RepositoryRule) GetRepositoryRuleFileExtensionRestriction1()(File_extension_restrictionable) { + return m.repositoryRuleFile_extension_restriction1 +} +// GetRepositoryRuleFileExtensionRestriction2 gets the file_extension_restriction property value. Composed type representation for type File_extension_restrictionable +// returns a File_extension_restrictionable when successful +func (m *RepositoryRule) GetRepositoryRuleFileExtensionRestriction2()(File_extension_restrictionable) { + return m.repositoryRuleFile_extension_restriction2 +} +// GetRepositoryRuleFilePathRestriction gets the file_path_restriction property value. Composed type representation for type File_path_restrictionable +// returns a File_path_restrictionable when successful +func (m *RepositoryRule) GetRepositoryRuleFilePathRestriction()(File_path_restrictionable) { + return m.repositoryRuleFile_path_restriction +} +// GetRepositoryRuleFilePathRestriction0 gets the file_path_restriction property value. Composed type representation for type File_path_restrictionable +// returns a File_path_restrictionable when successful +func (m *RepositoryRule) GetRepositoryRuleFilePathRestriction0()(File_path_restrictionable) { + return m.repositoryRuleFile_path_restriction0 +} +// GetRepositoryRuleFilePathRestriction1 gets the file_path_restriction property value. Composed type representation for type File_path_restrictionable +// returns a File_path_restrictionable when successful +func (m *RepositoryRule) GetRepositoryRuleFilePathRestriction1()(File_path_restrictionable) { + return m.repositoryRuleFile_path_restriction1 +} +// GetRepositoryRuleFilePathRestriction2 gets the file_path_restriction property value. Composed type representation for type File_path_restrictionable +// returns a File_path_restrictionable when successful +func (m *RepositoryRule) GetRepositoryRuleFilePathRestriction2()(File_path_restrictionable) { + return m.repositoryRuleFile_path_restriction2 +} +// GetRepositoryRuleMaxFilePathLength gets the max_file_path_length property value. Composed type representation for type Max_file_path_lengthable +// returns a Max_file_path_lengthable when successful +func (m *RepositoryRule) GetRepositoryRuleMaxFilePathLength()(Max_file_path_lengthable) { + return m.repositoryRuleMax_file_path_length +} +// GetRepositoryRuleMaxFilePathLength0 gets the max_file_path_length property value. Composed type representation for type Max_file_path_lengthable +// returns a Max_file_path_lengthable when successful +func (m *RepositoryRule) GetRepositoryRuleMaxFilePathLength0()(Max_file_path_lengthable) { + return m.repositoryRuleMax_file_path_length0 +} +// GetRepositoryRuleMaxFilePathLength1 gets the max_file_path_length property value. Composed type representation for type Max_file_path_lengthable +// returns a Max_file_path_lengthable when successful +func (m *RepositoryRule) GetRepositoryRuleMaxFilePathLength1()(Max_file_path_lengthable) { + return m.repositoryRuleMax_file_path_length1 +} +// GetRepositoryRuleMaxFilePathLength2 gets the max_file_path_length property value. Composed type representation for type Max_file_path_lengthable +// returns a Max_file_path_lengthable when successful +func (m *RepositoryRule) GetRepositoryRuleMaxFilePathLength2()(Max_file_path_lengthable) { + return m.repositoryRuleMax_file_path_length2 +} +// GetRepositoryRuleMaxFileSize gets the max_file_size property value. Composed type representation for type Max_file_sizeable +// returns a Max_file_sizeable when successful +func (m *RepositoryRule) GetRepositoryRuleMaxFileSize()(Max_file_sizeable) { + return m.repositoryRuleMax_file_size +} +// GetRepositoryRuleMaxFileSize0 gets the max_file_size property value. Composed type representation for type Max_file_sizeable +// returns a Max_file_sizeable when successful +func (m *RepositoryRule) GetRepositoryRuleMaxFileSize0()(Max_file_sizeable) { + return m.repositoryRuleMax_file_size0 +} +// GetRepositoryRuleMaxFileSize1 gets the max_file_size property value. Composed type representation for type Max_file_sizeable +// returns a Max_file_sizeable when successful +func (m *RepositoryRule) GetRepositoryRuleMaxFileSize1()(Max_file_sizeable) { + return m.repositoryRuleMax_file_size1 +} +// GetRepositoryRuleMaxFileSize2 gets the max_file_size property value. Composed type representation for type Max_file_sizeable +// returns a Max_file_sizeable when successful +func (m *RepositoryRule) GetRepositoryRuleMaxFileSize2()(Max_file_sizeable) { + return m.repositoryRuleMax_file_size2 +} +// GetRepositoryRuleNonFastForward gets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +// returns a RepositoryRuleNonFastForwardable when successful +func (m *RepositoryRule) GetRepositoryRuleNonFastForward()(RepositoryRuleNonFastForwardable) { + return m.repositoryRuleNonFastForward +} +// GetRepositoryRulePullRequest gets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +// returns a RepositoryRulePullRequestable when successful +func (m *RepositoryRule) GetRepositoryRulePullRequest()(RepositoryRulePullRequestable) { + return m.repositoryRulePullRequest +} +// GetRepositoryRuleRepositoryRuleBranchNamePattern gets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +// returns a RepositoryRuleBranchNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleBranchNamePattern()(RepositoryRuleBranchNamePatternable) { + return m.repositoryRuleRepositoryRuleBranchNamePattern +} +// GetRepositoryRuleRepositoryRuleBranchNamePattern0 gets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +// returns a RepositoryRuleBranchNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleBranchNamePattern0()(RepositoryRuleBranchNamePatternable) { + return m.repositoryRuleRepositoryRuleBranchNamePattern0 +} +// GetRepositoryRuleRepositoryRuleBranchNamePattern1 gets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +// returns a RepositoryRuleBranchNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleBranchNamePattern1()(RepositoryRuleBranchNamePatternable) { + return m.repositoryRuleRepositoryRuleBranchNamePattern1 +} +// GetRepositoryRuleRepositoryRuleBranchNamePattern2 gets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +// returns a RepositoryRuleBranchNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleBranchNamePattern2()(RepositoryRuleBranchNamePatternable) { + return m.repositoryRuleRepositoryRuleBranchNamePattern2 +} +// GetRepositoryRuleRepositoryRuleCodeScanning gets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +// returns a RepositoryRuleCodeScanningable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCodeScanning()(RepositoryRuleCodeScanningable) { + return m.repositoryRuleRepositoryRuleCodeScanning +} +// GetRepositoryRuleRepositoryRuleCodeScanning0 gets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +// returns a RepositoryRuleCodeScanningable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCodeScanning0()(RepositoryRuleCodeScanningable) { + return m.repositoryRuleRepositoryRuleCodeScanning0 +} +// GetRepositoryRuleRepositoryRuleCodeScanning1 gets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +// returns a RepositoryRuleCodeScanningable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCodeScanning1()(RepositoryRuleCodeScanningable) { + return m.repositoryRuleRepositoryRuleCodeScanning1 +} +// GetRepositoryRuleRepositoryRuleCodeScanning2 gets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +// returns a RepositoryRuleCodeScanningable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCodeScanning2()(RepositoryRuleCodeScanningable) { + return m.repositoryRuleRepositoryRuleCodeScanning2 +} +// GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern gets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +// returns a RepositoryRuleCommitAuthorEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern()(RepositoryRuleCommitAuthorEmailPatternable) { + return m.repositoryRuleRepositoryRuleCommitAuthorEmailPattern +} +// GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern0 gets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +// returns a RepositoryRuleCommitAuthorEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern0()(RepositoryRuleCommitAuthorEmailPatternable) { + return m.repositoryRuleRepositoryRuleCommitAuthorEmailPattern0 +} +// GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern1 gets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +// returns a RepositoryRuleCommitAuthorEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern1()(RepositoryRuleCommitAuthorEmailPatternable) { + return m.repositoryRuleRepositoryRuleCommitAuthorEmailPattern1 +} +// GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern2 gets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +// returns a RepositoryRuleCommitAuthorEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern2()(RepositoryRuleCommitAuthorEmailPatternable) { + return m.repositoryRuleRepositoryRuleCommitAuthorEmailPattern2 +} +// GetRepositoryRuleRepositoryRuleCommitMessagePattern gets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +// returns a RepositoryRuleCommitMessagePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitMessagePattern()(RepositoryRuleCommitMessagePatternable) { + return m.repositoryRuleRepositoryRuleCommitMessagePattern +} +// GetRepositoryRuleRepositoryRuleCommitMessagePattern0 gets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +// returns a RepositoryRuleCommitMessagePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitMessagePattern0()(RepositoryRuleCommitMessagePatternable) { + return m.repositoryRuleRepositoryRuleCommitMessagePattern0 +} +// GetRepositoryRuleRepositoryRuleCommitMessagePattern1 gets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +// returns a RepositoryRuleCommitMessagePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitMessagePattern1()(RepositoryRuleCommitMessagePatternable) { + return m.repositoryRuleRepositoryRuleCommitMessagePattern1 +} +// GetRepositoryRuleRepositoryRuleCommitMessagePattern2 gets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +// returns a RepositoryRuleCommitMessagePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitMessagePattern2()(RepositoryRuleCommitMessagePatternable) { + return m.repositoryRuleRepositoryRuleCommitMessagePattern2 +} +// GetRepositoryRuleRepositoryRuleCommitterEmailPattern gets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +// returns a RepositoryRuleCommitterEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitterEmailPattern()(RepositoryRuleCommitterEmailPatternable) { + return m.repositoryRuleRepositoryRuleCommitterEmailPattern +} +// GetRepositoryRuleRepositoryRuleCommitterEmailPattern0 gets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +// returns a RepositoryRuleCommitterEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitterEmailPattern0()(RepositoryRuleCommitterEmailPatternable) { + return m.repositoryRuleRepositoryRuleCommitterEmailPattern0 +} +// GetRepositoryRuleRepositoryRuleCommitterEmailPattern1 gets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +// returns a RepositoryRuleCommitterEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitterEmailPattern1()(RepositoryRuleCommitterEmailPatternable) { + return m.repositoryRuleRepositoryRuleCommitterEmailPattern1 +} +// GetRepositoryRuleRepositoryRuleCommitterEmailPattern2 gets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +// returns a RepositoryRuleCommitterEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitterEmailPattern2()(RepositoryRuleCommitterEmailPatternable) { + return m.repositoryRuleRepositoryRuleCommitterEmailPattern2 +} +// GetRepositoryRuleRepositoryRuleCreation gets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +// returns a RepositoryRuleCreationable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCreation()(RepositoryRuleCreationable) { + return m.repositoryRuleRepositoryRuleCreation +} +// GetRepositoryRuleRepositoryRuleCreation0 gets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +// returns a RepositoryRuleCreationable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCreation0()(RepositoryRuleCreationable) { + return m.repositoryRuleRepositoryRuleCreation0 +} +// GetRepositoryRuleRepositoryRuleCreation1 gets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +// returns a RepositoryRuleCreationable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCreation1()(RepositoryRuleCreationable) { + return m.repositoryRuleRepositoryRuleCreation1 +} +// GetRepositoryRuleRepositoryRuleCreation2 gets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +// returns a RepositoryRuleCreationable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCreation2()(RepositoryRuleCreationable) { + return m.repositoryRuleRepositoryRuleCreation2 +} +// GetRepositoryRuleRepositoryRuleDeletion gets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +// returns a RepositoryRuleDeletionable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleDeletion()(RepositoryRuleDeletionable) { + return m.repositoryRuleRepositoryRuleDeletion +} +// GetRepositoryRuleRepositoryRuleDeletion0 gets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +// returns a RepositoryRuleDeletionable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleDeletion0()(RepositoryRuleDeletionable) { + return m.repositoryRuleRepositoryRuleDeletion0 +} +// GetRepositoryRuleRepositoryRuleDeletion1 gets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +// returns a RepositoryRuleDeletionable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleDeletion1()(RepositoryRuleDeletionable) { + return m.repositoryRuleRepositoryRuleDeletion1 +} +// GetRepositoryRuleRepositoryRuleDeletion2 gets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +// returns a RepositoryRuleDeletionable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleDeletion2()(RepositoryRuleDeletionable) { + return m.repositoryRuleRepositoryRuleDeletion2 +} +// GetRepositoryRuleRepositoryRuleNonFastForward gets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +// returns a RepositoryRuleNonFastForwardable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleNonFastForward()(RepositoryRuleNonFastForwardable) { + return m.repositoryRuleRepositoryRuleNonFastForward +} +// GetRepositoryRuleRepositoryRuleNonFastForward0 gets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +// returns a RepositoryRuleNonFastForwardable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleNonFastForward0()(RepositoryRuleNonFastForwardable) { + return m.repositoryRuleRepositoryRuleNonFastForward0 +} +// GetRepositoryRuleRepositoryRuleNonFastForward1 gets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +// returns a RepositoryRuleNonFastForwardable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleNonFastForward1()(RepositoryRuleNonFastForwardable) { + return m.repositoryRuleRepositoryRuleNonFastForward1 +} +// GetRepositoryRuleRepositoryRuleNonFastForward2 gets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +// returns a RepositoryRuleNonFastForwardable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleNonFastForward2()(RepositoryRuleNonFastForwardable) { + return m.repositoryRuleRepositoryRuleNonFastForward2 +} +// GetRepositoryRuleRepositoryRulePullRequest gets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +// returns a RepositoryRulePullRequestable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRulePullRequest()(RepositoryRulePullRequestable) { + return m.repositoryRuleRepositoryRulePullRequest +} +// GetRepositoryRuleRepositoryRulePullRequest0 gets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +// returns a RepositoryRulePullRequestable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRulePullRequest0()(RepositoryRulePullRequestable) { + return m.repositoryRuleRepositoryRulePullRequest0 +} +// GetRepositoryRuleRepositoryRulePullRequest1 gets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +// returns a RepositoryRulePullRequestable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRulePullRequest1()(RepositoryRulePullRequestable) { + return m.repositoryRuleRepositoryRulePullRequest1 +} +// GetRepositoryRuleRepositoryRulePullRequest2 gets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +// returns a RepositoryRulePullRequestable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRulePullRequest2()(RepositoryRulePullRequestable) { + return m.repositoryRuleRepositoryRulePullRequest2 +} +// GetRepositoryRuleRepositoryRuleRequiredDeployments gets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +// returns a RepositoryRuleRequiredDeploymentsable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredDeployments()(RepositoryRuleRequiredDeploymentsable) { + return m.repositoryRuleRepositoryRuleRequiredDeployments +} +// GetRepositoryRuleRepositoryRuleRequiredDeployments0 gets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +// returns a RepositoryRuleRequiredDeploymentsable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredDeployments0()(RepositoryRuleRequiredDeploymentsable) { + return m.repositoryRuleRepositoryRuleRequiredDeployments0 +} +// GetRepositoryRuleRepositoryRuleRequiredDeployments1 gets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +// returns a RepositoryRuleRequiredDeploymentsable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredDeployments1()(RepositoryRuleRequiredDeploymentsable) { + return m.repositoryRuleRepositoryRuleRequiredDeployments1 +} +// GetRepositoryRuleRepositoryRuleRequiredDeployments2 gets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +// returns a RepositoryRuleRequiredDeploymentsable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredDeployments2()(RepositoryRuleRequiredDeploymentsable) { + return m.repositoryRuleRepositoryRuleRequiredDeployments2 +} +// GetRepositoryRuleRepositoryRuleRequiredLinearHistory gets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +// returns a RepositoryRuleRequiredLinearHistoryable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredLinearHistory()(RepositoryRuleRequiredLinearHistoryable) { + return m.repositoryRuleRepositoryRuleRequiredLinearHistory +} +// GetRepositoryRuleRepositoryRuleRequiredLinearHistory0 gets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +// returns a RepositoryRuleRequiredLinearHistoryable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredLinearHistory0()(RepositoryRuleRequiredLinearHistoryable) { + return m.repositoryRuleRepositoryRuleRequiredLinearHistory0 +} +// GetRepositoryRuleRepositoryRuleRequiredLinearHistory1 gets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +// returns a RepositoryRuleRequiredLinearHistoryable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredLinearHistory1()(RepositoryRuleRequiredLinearHistoryable) { + return m.repositoryRuleRepositoryRuleRequiredLinearHistory1 +} +// GetRepositoryRuleRepositoryRuleRequiredLinearHistory2 gets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +// returns a RepositoryRuleRequiredLinearHistoryable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredLinearHistory2()(RepositoryRuleRequiredLinearHistoryable) { + return m.repositoryRuleRepositoryRuleRequiredLinearHistory2 +} +// GetRepositoryRuleRepositoryRuleRequiredSignatures gets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +// returns a RepositoryRuleRequiredSignaturesable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredSignatures()(RepositoryRuleRequiredSignaturesable) { + return m.repositoryRuleRepositoryRuleRequiredSignatures +} +// GetRepositoryRuleRepositoryRuleRequiredSignatures0 gets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +// returns a RepositoryRuleRequiredSignaturesable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredSignatures0()(RepositoryRuleRequiredSignaturesable) { + return m.repositoryRuleRepositoryRuleRequiredSignatures0 +} +// GetRepositoryRuleRepositoryRuleRequiredSignatures1 gets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +// returns a RepositoryRuleRequiredSignaturesable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredSignatures1()(RepositoryRuleRequiredSignaturesable) { + return m.repositoryRuleRepositoryRuleRequiredSignatures1 +} +// GetRepositoryRuleRepositoryRuleRequiredSignatures2 gets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +// returns a RepositoryRuleRequiredSignaturesable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredSignatures2()(RepositoryRuleRequiredSignaturesable) { + return m.repositoryRuleRepositoryRuleRequiredSignatures2 +} +// GetRepositoryRuleRepositoryRuleRequiredStatusChecks gets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +// returns a RepositoryRuleRequiredStatusChecksable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredStatusChecks()(RepositoryRuleRequiredStatusChecksable) { + return m.repositoryRuleRepositoryRuleRequiredStatusChecks +} +// GetRepositoryRuleRepositoryRuleRequiredStatusChecks0 gets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +// returns a RepositoryRuleRequiredStatusChecksable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredStatusChecks0()(RepositoryRuleRequiredStatusChecksable) { + return m.repositoryRuleRepositoryRuleRequiredStatusChecks0 +} +// GetRepositoryRuleRepositoryRuleRequiredStatusChecks1 gets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +// returns a RepositoryRuleRequiredStatusChecksable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredStatusChecks1()(RepositoryRuleRequiredStatusChecksable) { + return m.repositoryRuleRepositoryRuleRequiredStatusChecks1 +} +// GetRepositoryRuleRepositoryRuleRequiredStatusChecks2 gets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +// returns a RepositoryRuleRequiredStatusChecksable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredStatusChecks2()(RepositoryRuleRequiredStatusChecksable) { + return m.repositoryRuleRepositoryRuleRequiredStatusChecks2 +} +// GetRepositoryRuleRepositoryRuleTagNamePattern gets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +// returns a RepositoryRuleTagNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleTagNamePattern()(RepositoryRuleTagNamePatternable) { + return m.repositoryRuleRepositoryRuleTagNamePattern +} +// GetRepositoryRuleRepositoryRuleTagNamePattern0 gets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +// returns a RepositoryRuleTagNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleTagNamePattern0()(RepositoryRuleTagNamePatternable) { + return m.repositoryRuleRepositoryRuleTagNamePattern0 +} +// GetRepositoryRuleRepositoryRuleTagNamePattern1 gets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +// returns a RepositoryRuleTagNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleTagNamePattern1()(RepositoryRuleTagNamePatternable) { + return m.repositoryRuleRepositoryRuleTagNamePattern1 +} +// GetRepositoryRuleRepositoryRuleTagNamePattern2 gets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +// returns a RepositoryRuleTagNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleTagNamePattern2()(RepositoryRuleTagNamePatternable) { + return m.repositoryRuleRepositoryRuleTagNamePattern2 +} +// GetRepositoryRuleRepositoryRuleUpdate gets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +// returns a RepositoryRuleUpdateable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleUpdate()(RepositoryRuleUpdateable) { + return m.repositoryRuleRepositoryRuleUpdate +} +// GetRepositoryRuleRepositoryRuleUpdate0 gets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +// returns a RepositoryRuleUpdateable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleUpdate0()(RepositoryRuleUpdateable) { + return m.repositoryRuleRepositoryRuleUpdate0 +} +// GetRepositoryRuleRepositoryRuleUpdate1 gets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +// returns a RepositoryRuleUpdateable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleUpdate1()(RepositoryRuleUpdateable) { + return m.repositoryRuleRepositoryRuleUpdate1 +} +// GetRepositoryRuleRepositoryRuleUpdate2 gets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +// returns a RepositoryRuleUpdateable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleUpdate2()(RepositoryRuleUpdateable) { + return m.repositoryRuleRepositoryRuleUpdate2 +} +// GetRepositoryRuleRepositoryRuleWorkflows gets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +// returns a RepositoryRuleWorkflowsable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleWorkflows()(RepositoryRuleWorkflowsable) { + return m.repositoryRuleRepositoryRuleWorkflows +} +// GetRepositoryRuleRepositoryRuleWorkflows0 gets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +// returns a RepositoryRuleWorkflowsable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleWorkflows0()(RepositoryRuleWorkflowsable) { + return m.repositoryRuleRepositoryRuleWorkflows0 +} +// GetRepositoryRuleRepositoryRuleWorkflows1 gets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +// returns a RepositoryRuleWorkflowsable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleWorkflows1()(RepositoryRuleWorkflowsable) { + return m.repositoryRuleRepositoryRuleWorkflows1 +} +// GetRepositoryRuleRepositoryRuleWorkflows2 gets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +// returns a RepositoryRuleWorkflowsable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleWorkflows2()(RepositoryRuleWorkflowsable) { + return m.repositoryRuleRepositoryRuleWorkflows2 +} +// GetRepositoryRuleRequiredDeployments gets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +// returns a RepositoryRuleRequiredDeploymentsable when successful +func (m *RepositoryRule) GetRepositoryRuleRequiredDeployments()(RepositoryRuleRequiredDeploymentsable) { + return m.repositoryRuleRequiredDeployments +} +// GetRepositoryRuleRequiredLinearHistory gets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +// returns a RepositoryRuleRequiredLinearHistoryable when successful +func (m *RepositoryRule) GetRepositoryRuleRequiredLinearHistory()(RepositoryRuleRequiredLinearHistoryable) { + return m.repositoryRuleRequiredLinearHistory +} +// GetRepositoryRuleRequiredSignatures gets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +// returns a RepositoryRuleRequiredSignaturesable when successful +func (m *RepositoryRule) GetRepositoryRuleRequiredSignatures()(RepositoryRuleRequiredSignaturesable) { + return m.repositoryRuleRequiredSignatures +} +// GetRepositoryRuleRequiredStatusChecks gets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +// returns a RepositoryRuleRequiredStatusChecksable when successful +func (m *RepositoryRule) GetRepositoryRuleRequiredStatusChecks()(RepositoryRuleRequiredStatusChecksable) { + return m.repositoryRuleRequiredStatusChecks +} +// GetRepositoryRuleTagNamePattern gets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +// returns a RepositoryRuleTagNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleTagNamePattern()(RepositoryRuleTagNamePatternable) { + return m.repositoryRuleTagNamePattern +} +// GetRepositoryRuleUpdate gets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +// returns a RepositoryRuleUpdateable when successful +func (m *RepositoryRule) GetRepositoryRuleUpdate()(RepositoryRuleUpdateable) { + return m.repositoryRuleUpdate +} +// GetRepositoryRuleWorkflows gets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +// returns a RepositoryRuleWorkflowsable when successful +func (m *RepositoryRule) GetRepositoryRuleWorkflows()(RepositoryRuleWorkflowsable) { + return m.repositoryRuleWorkflows +} +// Serialize serializes information the current object +func (m *RepositoryRule) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetFileExtensionRestriction() != nil { + err := writer.WriteObjectValue("", m.GetFileExtensionRestriction()) + if err != nil { + return err + } + } else if m.GetFilePathRestriction() != nil { + err := writer.WriteObjectValue("", m.GetFilePathRestriction()) + if err != nil { + return err + } + } else if m.GetMaxFilePathLength() != nil { + err := writer.WriteObjectValue("", m.GetMaxFilePathLength()) + if err != nil { + return err + } + } else if m.GetMaxFileSize() != nil { + err := writer.WriteObjectValue("", m.GetMaxFileSize()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleBranchNamePattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleBranchNamePattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleCodeScanning() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleCodeScanning()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleCommitAuthorEmailPattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleCommitAuthorEmailPattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleCommitMessagePattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleCommitMessagePattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleCommitterEmailPattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleCommitterEmailPattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleCreation() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleCreation()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleDeletion() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleDeletion()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleFileExtensionRestriction() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleFileExtensionRestriction()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleFileExtensionRestriction0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleFileExtensionRestriction0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleFileExtensionRestriction1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleFileExtensionRestriction1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleFileExtensionRestriction2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleFileExtensionRestriction2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleFilePathRestriction() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleFilePathRestriction()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleFilePathRestriction0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleFilePathRestriction0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleFilePathRestriction1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleFilePathRestriction1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleFilePathRestriction2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleFilePathRestriction2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleMaxFilePathLength() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleMaxFilePathLength()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleMaxFilePathLength0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleMaxFilePathLength0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleMaxFilePathLength1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleMaxFilePathLength1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleMaxFilePathLength2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleMaxFilePathLength2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleMaxFileSize() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleMaxFileSize()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleMaxFileSize0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleMaxFileSize0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleMaxFileSize1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleMaxFileSize1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleMaxFileSize2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleMaxFileSize2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleNonFastForward() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleNonFastForward()) + if err != nil { + return err + } + } else if m.GetRepositoryRulePullRequest() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRulePullRequest()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleBranchNamePattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleBranchNamePattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleBranchNamePattern0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleBranchNamePattern0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleBranchNamePattern1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleBranchNamePattern1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleBranchNamePattern2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleBranchNamePattern2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCodeScanning() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCodeScanning()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCodeScanning0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCodeScanning0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCodeScanning1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCodeScanning1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCodeScanning2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCodeScanning2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitMessagePattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitMessagePattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitMessagePattern0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitMessagePattern0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitMessagePattern1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitMessagePattern1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitMessagePattern2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitMessagePattern2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitterEmailPattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitterEmailPattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitterEmailPattern0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitterEmailPattern0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitterEmailPattern1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitterEmailPattern1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitterEmailPattern2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitterEmailPattern2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCreation() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCreation()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCreation0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCreation0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCreation1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCreation1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCreation2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCreation2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleDeletion() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleDeletion()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleDeletion0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleDeletion0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleDeletion1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleDeletion1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleDeletion2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleDeletion2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleNonFastForward() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleNonFastForward()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleNonFastForward0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleNonFastForward0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleNonFastForward1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleNonFastForward1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleNonFastForward2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleNonFastForward2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRulePullRequest() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRulePullRequest()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRulePullRequest0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRulePullRequest0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRulePullRequest1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRulePullRequest1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRulePullRequest2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRulePullRequest2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredDeployments() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredDeployments()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredDeployments0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredDeployments0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredDeployments1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredDeployments1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredDeployments2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredDeployments2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredLinearHistory() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredLinearHistory()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredLinearHistory0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredLinearHistory0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredLinearHistory1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredLinearHistory1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredLinearHistory2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredLinearHistory2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredSignatures() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredSignatures()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredSignatures0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredSignatures0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredSignatures1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredSignatures1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredSignatures2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredSignatures2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredStatusChecks() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredStatusChecks()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredStatusChecks0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredStatusChecks0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredStatusChecks1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredStatusChecks1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredStatusChecks2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredStatusChecks2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleTagNamePattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleTagNamePattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleTagNamePattern0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleTagNamePattern0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleTagNamePattern1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleTagNamePattern1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleTagNamePattern2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleTagNamePattern2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleUpdate() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleUpdate()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleUpdate0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleUpdate0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleUpdate1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleUpdate1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleUpdate2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleUpdate2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleWorkflows() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleWorkflows()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleWorkflows0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleWorkflows0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleWorkflows1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleWorkflows1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleWorkflows2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleWorkflows2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRequiredDeployments() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRequiredDeployments()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRequiredLinearHistory() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRequiredLinearHistory()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRequiredSignatures() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRequiredSignatures()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRequiredStatusChecks() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRequiredStatusChecks()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleTagNamePattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleTagNamePattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleUpdate() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleUpdate()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleWorkflows() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleWorkflows()) + if err != nil { + return err + } + } + return nil +} +// SetFileExtensionRestriction sets the file_extension_restriction property value. Composed type representation for type File_extension_restrictionable +func (m *RepositoryRule) SetFileExtensionRestriction(value File_extension_restrictionable)() { + m.file_extension_restriction = value +} +// SetFilePathRestriction sets the file_path_restriction property value. Composed type representation for type File_path_restrictionable +func (m *RepositoryRule) SetFilePathRestriction(value File_path_restrictionable)() { + m.file_path_restriction = value +} +// SetMaxFilePathLength sets the max_file_path_length property value. Composed type representation for type Max_file_path_lengthable +func (m *RepositoryRule) SetMaxFilePathLength(value Max_file_path_lengthable)() { + m.max_file_path_length = value +} +// SetMaxFileSize sets the max_file_size property value. Composed type representation for type Max_file_sizeable +func (m *RepositoryRule) SetMaxFileSize(value Max_file_sizeable)() { + m.max_file_size = value +} +// SetRepositoryRuleBranchNamePattern sets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +func (m *RepositoryRule) SetRepositoryRuleBranchNamePattern(value RepositoryRuleBranchNamePatternable)() { + m.repositoryRuleBranchNamePattern = value +} +// SetRepositoryRuleCodeScanning sets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +func (m *RepositoryRule) SetRepositoryRuleCodeScanning(value RepositoryRuleCodeScanningable)() { + m.repositoryRuleCodeScanning = value +} +// SetRepositoryRuleCommitAuthorEmailPattern sets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleCommitAuthorEmailPattern(value RepositoryRuleCommitAuthorEmailPatternable)() { + m.repositoryRuleCommitAuthorEmailPattern = value +} +// SetRepositoryRuleCommitMessagePattern sets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +func (m *RepositoryRule) SetRepositoryRuleCommitMessagePattern(value RepositoryRuleCommitMessagePatternable)() { + m.repositoryRuleCommitMessagePattern = value +} +// SetRepositoryRuleCommitterEmailPattern sets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleCommitterEmailPattern(value RepositoryRuleCommitterEmailPatternable)() { + m.repositoryRuleCommitterEmailPattern = value +} +// SetRepositoryRuleCreation sets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +func (m *RepositoryRule) SetRepositoryRuleCreation(value RepositoryRuleCreationable)() { + m.repositoryRuleCreation = value +} +// SetRepositoryRuleDeletion sets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +func (m *RepositoryRule) SetRepositoryRuleDeletion(value RepositoryRuleDeletionable)() { + m.repositoryRuleDeletion = value +} +// SetRepositoryRuleFileExtensionRestriction sets the file_extension_restriction property value. Composed type representation for type File_extension_restrictionable +func (m *RepositoryRule) SetRepositoryRuleFileExtensionRestriction(value File_extension_restrictionable)() { + m.repositoryRuleFile_extension_restriction = value +} +// SetRepositoryRuleFileExtensionRestriction0 sets the file_extension_restriction property value. Composed type representation for type File_extension_restrictionable +func (m *RepositoryRule) SetRepositoryRuleFileExtensionRestriction0(value File_extension_restrictionable)() { + m.repositoryRuleFile_extension_restriction0 = value +} +// SetRepositoryRuleFileExtensionRestriction1 sets the file_extension_restriction property value. Composed type representation for type File_extension_restrictionable +func (m *RepositoryRule) SetRepositoryRuleFileExtensionRestriction1(value File_extension_restrictionable)() { + m.repositoryRuleFile_extension_restriction1 = value +} +// SetRepositoryRuleFileExtensionRestriction2 sets the file_extension_restriction property value. Composed type representation for type File_extension_restrictionable +func (m *RepositoryRule) SetRepositoryRuleFileExtensionRestriction2(value File_extension_restrictionable)() { + m.repositoryRuleFile_extension_restriction2 = value +} +// SetRepositoryRuleFilePathRestriction sets the file_path_restriction property value. Composed type representation for type File_path_restrictionable +func (m *RepositoryRule) SetRepositoryRuleFilePathRestriction(value File_path_restrictionable)() { + m.repositoryRuleFile_path_restriction = value +} +// SetRepositoryRuleFilePathRestriction0 sets the file_path_restriction property value. Composed type representation for type File_path_restrictionable +func (m *RepositoryRule) SetRepositoryRuleFilePathRestriction0(value File_path_restrictionable)() { + m.repositoryRuleFile_path_restriction0 = value +} +// SetRepositoryRuleFilePathRestriction1 sets the file_path_restriction property value. Composed type representation for type File_path_restrictionable +func (m *RepositoryRule) SetRepositoryRuleFilePathRestriction1(value File_path_restrictionable)() { + m.repositoryRuleFile_path_restriction1 = value +} +// SetRepositoryRuleFilePathRestriction2 sets the file_path_restriction property value. Composed type representation for type File_path_restrictionable +func (m *RepositoryRule) SetRepositoryRuleFilePathRestriction2(value File_path_restrictionable)() { + m.repositoryRuleFile_path_restriction2 = value +} +// SetRepositoryRuleMaxFilePathLength sets the max_file_path_length property value. Composed type representation for type Max_file_path_lengthable +func (m *RepositoryRule) SetRepositoryRuleMaxFilePathLength(value Max_file_path_lengthable)() { + m.repositoryRuleMax_file_path_length = value +} +// SetRepositoryRuleMaxFilePathLength0 sets the max_file_path_length property value. Composed type representation for type Max_file_path_lengthable +func (m *RepositoryRule) SetRepositoryRuleMaxFilePathLength0(value Max_file_path_lengthable)() { + m.repositoryRuleMax_file_path_length0 = value +} +// SetRepositoryRuleMaxFilePathLength1 sets the max_file_path_length property value. Composed type representation for type Max_file_path_lengthable +func (m *RepositoryRule) SetRepositoryRuleMaxFilePathLength1(value Max_file_path_lengthable)() { + m.repositoryRuleMax_file_path_length1 = value +} +// SetRepositoryRuleMaxFilePathLength2 sets the max_file_path_length property value. Composed type representation for type Max_file_path_lengthable +func (m *RepositoryRule) SetRepositoryRuleMaxFilePathLength2(value Max_file_path_lengthable)() { + m.repositoryRuleMax_file_path_length2 = value +} +// SetRepositoryRuleMaxFileSize sets the max_file_size property value. Composed type representation for type Max_file_sizeable +func (m *RepositoryRule) SetRepositoryRuleMaxFileSize(value Max_file_sizeable)() { + m.repositoryRuleMax_file_size = value +} +// SetRepositoryRuleMaxFileSize0 sets the max_file_size property value. Composed type representation for type Max_file_sizeable +func (m *RepositoryRule) SetRepositoryRuleMaxFileSize0(value Max_file_sizeable)() { + m.repositoryRuleMax_file_size0 = value +} +// SetRepositoryRuleMaxFileSize1 sets the max_file_size property value. Composed type representation for type Max_file_sizeable +func (m *RepositoryRule) SetRepositoryRuleMaxFileSize1(value Max_file_sizeable)() { + m.repositoryRuleMax_file_size1 = value +} +// SetRepositoryRuleMaxFileSize2 sets the max_file_size property value. Composed type representation for type Max_file_sizeable +func (m *RepositoryRule) SetRepositoryRuleMaxFileSize2(value Max_file_sizeable)() { + m.repositoryRuleMax_file_size2 = value +} +// SetRepositoryRuleNonFastForward sets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +func (m *RepositoryRule) SetRepositoryRuleNonFastForward(value RepositoryRuleNonFastForwardable)() { + m.repositoryRuleNonFastForward = value +} +// SetRepositoryRulePullRequest sets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +func (m *RepositoryRule) SetRepositoryRulePullRequest(value RepositoryRulePullRequestable)() { + m.repositoryRulePullRequest = value +} +// SetRepositoryRuleRepositoryRuleBranchNamePattern sets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleBranchNamePattern(value RepositoryRuleBranchNamePatternable)() { + m.repositoryRuleRepositoryRuleBranchNamePattern = value +} +// SetRepositoryRuleRepositoryRuleBranchNamePattern0 sets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleBranchNamePattern0(value RepositoryRuleBranchNamePatternable)() { + m.repositoryRuleRepositoryRuleBranchNamePattern0 = value +} +// SetRepositoryRuleRepositoryRuleBranchNamePattern1 sets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleBranchNamePattern1(value RepositoryRuleBranchNamePatternable)() { + m.repositoryRuleRepositoryRuleBranchNamePattern1 = value +} +// SetRepositoryRuleRepositoryRuleBranchNamePattern2 sets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleBranchNamePattern2(value RepositoryRuleBranchNamePatternable)() { + m.repositoryRuleRepositoryRuleBranchNamePattern2 = value +} +// SetRepositoryRuleRepositoryRuleCodeScanning sets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCodeScanning(value RepositoryRuleCodeScanningable)() { + m.repositoryRuleRepositoryRuleCodeScanning = value +} +// SetRepositoryRuleRepositoryRuleCodeScanning0 sets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCodeScanning0(value RepositoryRuleCodeScanningable)() { + m.repositoryRuleRepositoryRuleCodeScanning0 = value +} +// SetRepositoryRuleRepositoryRuleCodeScanning1 sets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCodeScanning1(value RepositoryRuleCodeScanningable)() { + m.repositoryRuleRepositoryRuleCodeScanning1 = value +} +// SetRepositoryRuleRepositoryRuleCodeScanning2 sets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCodeScanning2(value RepositoryRuleCodeScanningable)() { + m.repositoryRuleRepositoryRuleCodeScanning2 = value +} +// SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern sets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern(value RepositoryRuleCommitAuthorEmailPatternable)() { + m.repositoryRuleRepositoryRuleCommitAuthorEmailPattern = value +} +// SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern0 sets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern0(value RepositoryRuleCommitAuthorEmailPatternable)() { + m.repositoryRuleRepositoryRuleCommitAuthorEmailPattern0 = value +} +// SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern1 sets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern1(value RepositoryRuleCommitAuthorEmailPatternable)() { + m.repositoryRuleRepositoryRuleCommitAuthorEmailPattern1 = value +} +// SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern2 sets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern2(value RepositoryRuleCommitAuthorEmailPatternable)() { + m.repositoryRuleRepositoryRuleCommitAuthorEmailPattern2 = value +} +// SetRepositoryRuleRepositoryRuleCommitMessagePattern sets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitMessagePattern(value RepositoryRuleCommitMessagePatternable)() { + m.repositoryRuleRepositoryRuleCommitMessagePattern = value +} +// SetRepositoryRuleRepositoryRuleCommitMessagePattern0 sets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitMessagePattern0(value RepositoryRuleCommitMessagePatternable)() { + m.repositoryRuleRepositoryRuleCommitMessagePattern0 = value +} +// SetRepositoryRuleRepositoryRuleCommitMessagePattern1 sets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitMessagePattern1(value RepositoryRuleCommitMessagePatternable)() { + m.repositoryRuleRepositoryRuleCommitMessagePattern1 = value +} +// SetRepositoryRuleRepositoryRuleCommitMessagePattern2 sets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitMessagePattern2(value RepositoryRuleCommitMessagePatternable)() { + m.repositoryRuleRepositoryRuleCommitMessagePattern2 = value +} +// SetRepositoryRuleRepositoryRuleCommitterEmailPattern sets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitterEmailPattern(value RepositoryRuleCommitterEmailPatternable)() { + m.repositoryRuleRepositoryRuleCommitterEmailPattern = value +} +// SetRepositoryRuleRepositoryRuleCommitterEmailPattern0 sets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitterEmailPattern0(value RepositoryRuleCommitterEmailPatternable)() { + m.repositoryRuleRepositoryRuleCommitterEmailPattern0 = value +} +// SetRepositoryRuleRepositoryRuleCommitterEmailPattern1 sets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitterEmailPattern1(value RepositoryRuleCommitterEmailPatternable)() { + m.repositoryRuleRepositoryRuleCommitterEmailPattern1 = value +} +// SetRepositoryRuleRepositoryRuleCommitterEmailPattern2 sets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitterEmailPattern2(value RepositoryRuleCommitterEmailPatternable)() { + m.repositoryRuleRepositoryRuleCommitterEmailPattern2 = value +} +// SetRepositoryRuleRepositoryRuleCreation sets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCreation(value RepositoryRuleCreationable)() { + m.repositoryRuleRepositoryRuleCreation = value +} +// SetRepositoryRuleRepositoryRuleCreation0 sets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCreation0(value RepositoryRuleCreationable)() { + m.repositoryRuleRepositoryRuleCreation0 = value +} +// SetRepositoryRuleRepositoryRuleCreation1 sets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCreation1(value RepositoryRuleCreationable)() { + m.repositoryRuleRepositoryRuleCreation1 = value +} +// SetRepositoryRuleRepositoryRuleCreation2 sets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCreation2(value RepositoryRuleCreationable)() { + m.repositoryRuleRepositoryRuleCreation2 = value +} +// SetRepositoryRuleRepositoryRuleDeletion sets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleDeletion(value RepositoryRuleDeletionable)() { + m.repositoryRuleRepositoryRuleDeletion = value +} +// SetRepositoryRuleRepositoryRuleDeletion0 sets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleDeletion0(value RepositoryRuleDeletionable)() { + m.repositoryRuleRepositoryRuleDeletion0 = value +} +// SetRepositoryRuleRepositoryRuleDeletion1 sets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleDeletion1(value RepositoryRuleDeletionable)() { + m.repositoryRuleRepositoryRuleDeletion1 = value +} +// SetRepositoryRuleRepositoryRuleDeletion2 sets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleDeletion2(value RepositoryRuleDeletionable)() { + m.repositoryRuleRepositoryRuleDeletion2 = value +} +// SetRepositoryRuleRepositoryRuleNonFastForward sets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleNonFastForward(value RepositoryRuleNonFastForwardable)() { + m.repositoryRuleRepositoryRuleNonFastForward = value +} +// SetRepositoryRuleRepositoryRuleNonFastForward0 sets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleNonFastForward0(value RepositoryRuleNonFastForwardable)() { + m.repositoryRuleRepositoryRuleNonFastForward0 = value +} +// SetRepositoryRuleRepositoryRuleNonFastForward1 sets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleNonFastForward1(value RepositoryRuleNonFastForwardable)() { + m.repositoryRuleRepositoryRuleNonFastForward1 = value +} +// SetRepositoryRuleRepositoryRuleNonFastForward2 sets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleNonFastForward2(value RepositoryRuleNonFastForwardable)() { + m.repositoryRuleRepositoryRuleNonFastForward2 = value +} +// SetRepositoryRuleRepositoryRulePullRequest sets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRulePullRequest(value RepositoryRulePullRequestable)() { + m.repositoryRuleRepositoryRulePullRequest = value +} +// SetRepositoryRuleRepositoryRulePullRequest0 sets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRulePullRequest0(value RepositoryRulePullRequestable)() { + m.repositoryRuleRepositoryRulePullRequest0 = value +} +// SetRepositoryRuleRepositoryRulePullRequest1 sets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRulePullRequest1(value RepositoryRulePullRequestable)() { + m.repositoryRuleRepositoryRulePullRequest1 = value +} +// SetRepositoryRuleRepositoryRulePullRequest2 sets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRulePullRequest2(value RepositoryRulePullRequestable)() { + m.repositoryRuleRepositoryRulePullRequest2 = value +} +// SetRepositoryRuleRepositoryRuleRequiredDeployments sets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredDeployments(value RepositoryRuleRequiredDeploymentsable)() { + m.repositoryRuleRepositoryRuleRequiredDeployments = value +} +// SetRepositoryRuleRepositoryRuleRequiredDeployments0 sets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredDeployments0(value RepositoryRuleRequiredDeploymentsable)() { + m.repositoryRuleRepositoryRuleRequiredDeployments0 = value +} +// SetRepositoryRuleRepositoryRuleRequiredDeployments1 sets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredDeployments1(value RepositoryRuleRequiredDeploymentsable)() { + m.repositoryRuleRepositoryRuleRequiredDeployments1 = value +} +// SetRepositoryRuleRepositoryRuleRequiredDeployments2 sets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredDeployments2(value RepositoryRuleRequiredDeploymentsable)() { + m.repositoryRuleRepositoryRuleRequiredDeployments2 = value +} +// SetRepositoryRuleRepositoryRuleRequiredLinearHistory sets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredLinearHistory(value RepositoryRuleRequiredLinearHistoryable)() { + m.repositoryRuleRepositoryRuleRequiredLinearHistory = value +} +// SetRepositoryRuleRepositoryRuleRequiredLinearHistory0 sets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredLinearHistory0(value RepositoryRuleRequiredLinearHistoryable)() { + m.repositoryRuleRepositoryRuleRequiredLinearHistory0 = value +} +// SetRepositoryRuleRepositoryRuleRequiredLinearHistory1 sets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredLinearHistory1(value RepositoryRuleRequiredLinearHistoryable)() { + m.repositoryRuleRepositoryRuleRequiredLinearHistory1 = value +} +// SetRepositoryRuleRepositoryRuleRequiredLinearHistory2 sets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredLinearHistory2(value RepositoryRuleRequiredLinearHistoryable)() { + m.repositoryRuleRepositoryRuleRequiredLinearHistory2 = value +} +// SetRepositoryRuleRepositoryRuleRequiredSignatures sets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredSignatures(value RepositoryRuleRequiredSignaturesable)() { + m.repositoryRuleRepositoryRuleRequiredSignatures = value +} +// SetRepositoryRuleRepositoryRuleRequiredSignatures0 sets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredSignatures0(value RepositoryRuleRequiredSignaturesable)() { + m.repositoryRuleRepositoryRuleRequiredSignatures0 = value +} +// SetRepositoryRuleRepositoryRuleRequiredSignatures1 sets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredSignatures1(value RepositoryRuleRequiredSignaturesable)() { + m.repositoryRuleRepositoryRuleRequiredSignatures1 = value +} +// SetRepositoryRuleRepositoryRuleRequiredSignatures2 sets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredSignatures2(value RepositoryRuleRequiredSignaturesable)() { + m.repositoryRuleRepositoryRuleRequiredSignatures2 = value +} +// SetRepositoryRuleRepositoryRuleRequiredStatusChecks sets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredStatusChecks(value RepositoryRuleRequiredStatusChecksable)() { + m.repositoryRuleRepositoryRuleRequiredStatusChecks = value +} +// SetRepositoryRuleRepositoryRuleRequiredStatusChecks0 sets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredStatusChecks0(value RepositoryRuleRequiredStatusChecksable)() { + m.repositoryRuleRepositoryRuleRequiredStatusChecks0 = value +} +// SetRepositoryRuleRepositoryRuleRequiredStatusChecks1 sets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredStatusChecks1(value RepositoryRuleRequiredStatusChecksable)() { + m.repositoryRuleRepositoryRuleRequiredStatusChecks1 = value +} +// SetRepositoryRuleRepositoryRuleRequiredStatusChecks2 sets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredStatusChecks2(value RepositoryRuleRequiredStatusChecksable)() { + m.repositoryRuleRepositoryRuleRequiredStatusChecks2 = value +} +// SetRepositoryRuleRepositoryRuleTagNamePattern sets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleTagNamePattern(value RepositoryRuleTagNamePatternable)() { + m.repositoryRuleRepositoryRuleTagNamePattern = value +} +// SetRepositoryRuleRepositoryRuleTagNamePattern0 sets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleTagNamePattern0(value RepositoryRuleTagNamePatternable)() { + m.repositoryRuleRepositoryRuleTagNamePattern0 = value +} +// SetRepositoryRuleRepositoryRuleTagNamePattern1 sets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleTagNamePattern1(value RepositoryRuleTagNamePatternable)() { + m.repositoryRuleRepositoryRuleTagNamePattern1 = value +} +// SetRepositoryRuleRepositoryRuleTagNamePattern2 sets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleTagNamePattern2(value RepositoryRuleTagNamePatternable)() { + m.repositoryRuleRepositoryRuleTagNamePattern2 = value +} +// SetRepositoryRuleRepositoryRuleUpdate sets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleUpdate(value RepositoryRuleUpdateable)() { + m.repositoryRuleRepositoryRuleUpdate = value +} +// SetRepositoryRuleRepositoryRuleUpdate0 sets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleUpdate0(value RepositoryRuleUpdateable)() { + m.repositoryRuleRepositoryRuleUpdate0 = value +} +// SetRepositoryRuleRepositoryRuleUpdate1 sets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleUpdate1(value RepositoryRuleUpdateable)() { + m.repositoryRuleRepositoryRuleUpdate1 = value +} +// SetRepositoryRuleRepositoryRuleUpdate2 sets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleUpdate2(value RepositoryRuleUpdateable)() { + m.repositoryRuleRepositoryRuleUpdate2 = value +} +// SetRepositoryRuleRepositoryRuleWorkflows sets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleWorkflows(value RepositoryRuleWorkflowsable)() { + m.repositoryRuleRepositoryRuleWorkflows = value +} +// SetRepositoryRuleRepositoryRuleWorkflows0 sets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleWorkflows0(value RepositoryRuleWorkflowsable)() { + m.repositoryRuleRepositoryRuleWorkflows0 = value +} +// SetRepositoryRuleRepositoryRuleWorkflows1 sets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleWorkflows1(value RepositoryRuleWorkflowsable)() { + m.repositoryRuleRepositoryRuleWorkflows1 = value +} +// SetRepositoryRuleRepositoryRuleWorkflows2 sets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleWorkflows2(value RepositoryRuleWorkflowsable)() { + m.repositoryRuleRepositoryRuleWorkflows2 = value +} +// SetRepositoryRuleRequiredDeployments sets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +func (m *RepositoryRule) SetRepositoryRuleRequiredDeployments(value RepositoryRuleRequiredDeploymentsable)() { + m.repositoryRuleRequiredDeployments = value +} +// SetRepositoryRuleRequiredLinearHistory sets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +func (m *RepositoryRule) SetRepositoryRuleRequiredLinearHistory(value RepositoryRuleRequiredLinearHistoryable)() { + m.repositoryRuleRequiredLinearHistory = value +} +// SetRepositoryRuleRequiredSignatures sets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +func (m *RepositoryRule) SetRepositoryRuleRequiredSignatures(value RepositoryRuleRequiredSignaturesable)() { + m.repositoryRuleRequiredSignatures = value +} +// SetRepositoryRuleRequiredStatusChecks sets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +func (m *RepositoryRule) SetRepositoryRuleRequiredStatusChecks(value RepositoryRuleRequiredStatusChecksable)() { + m.repositoryRuleRequiredStatusChecks = value +} +// SetRepositoryRuleTagNamePattern sets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +func (m *RepositoryRule) SetRepositoryRuleTagNamePattern(value RepositoryRuleTagNamePatternable)() { + m.repositoryRuleTagNamePattern = value +} +// SetRepositoryRuleUpdate sets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +func (m *RepositoryRule) SetRepositoryRuleUpdate(value RepositoryRuleUpdateable)() { + m.repositoryRuleUpdate = value +} +// SetRepositoryRuleWorkflows sets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +func (m *RepositoryRule) SetRepositoryRuleWorkflows(value RepositoryRuleWorkflowsable)() { + m.repositoryRuleWorkflows = value +} +type RepositoryRuleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFileExtensionRestriction()(File_extension_restrictionable) + GetFilePathRestriction()(File_path_restrictionable) + GetMaxFilePathLength()(Max_file_path_lengthable) + GetMaxFileSize()(Max_file_sizeable) + GetRepositoryRuleBranchNamePattern()(RepositoryRuleBranchNamePatternable) + GetRepositoryRuleCodeScanning()(RepositoryRuleCodeScanningable) + GetRepositoryRuleCommitAuthorEmailPattern()(RepositoryRuleCommitAuthorEmailPatternable) + GetRepositoryRuleCommitMessagePattern()(RepositoryRuleCommitMessagePatternable) + GetRepositoryRuleCommitterEmailPattern()(RepositoryRuleCommitterEmailPatternable) + GetRepositoryRuleCreation()(RepositoryRuleCreationable) + GetRepositoryRuleDeletion()(RepositoryRuleDeletionable) + GetRepositoryRuleFileExtensionRestriction()(File_extension_restrictionable) + GetRepositoryRuleFileExtensionRestriction0()(File_extension_restrictionable) + GetRepositoryRuleFileExtensionRestriction1()(File_extension_restrictionable) + GetRepositoryRuleFileExtensionRestriction2()(File_extension_restrictionable) + GetRepositoryRuleFilePathRestriction()(File_path_restrictionable) + GetRepositoryRuleFilePathRestriction0()(File_path_restrictionable) + GetRepositoryRuleFilePathRestriction1()(File_path_restrictionable) + GetRepositoryRuleFilePathRestriction2()(File_path_restrictionable) + GetRepositoryRuleMaxFilePathLength()(Max_file_path_lengthable) + GetRepositoryRuleMaxFilePathLength0()(Max_file_path_lengthable) + GetRepositoryRuleMaxFilePathLength1()(Max_file_path_lengthable) + GetRepositoryRuleMaxFilePathLength2()(Max_file_path_lengthable) + GetRepositoryRuleMaxFileSize()(Max_file_sizeable) + GetRepositoryRuleMaxFileSize0()(Max_file_sizeable) + GetRepositoryRuleMaxFileSize1()(Max_file_sizeable) + GetRepositoryRuleMaxFileSize2()(Max_file_sizeable) + GetRepositoryRuleNonFastForward()(RepositoryRuleNonFastForwardable) + GetRepositoryRulePullRequest()(RepositoryRulePullRequestable) + GetRepositoryRuleRepositoryRuleBranchNamePattern()(RepositoryRuleBranchNamePatternable) + GetRepositoryRuleRepositoryRuleBranchNamePattern0()(RepositoryRuleBranchNamePatternable) + GetRepositoryRuleRepositoryRuleBranchNamePattern1()(RepositoryRuleBranchNamePatternable) + GetRepositoryRuleRepositoryRuleBranchNamePattern2()(RepositoryRuleBranchNamePatternable) + GetRepositoryRuleRepositoryRuleCodeScanning()(RepositoryRuleCodeScanningable) + GetRepositoryRuleRepositoryRuleCodeScanning0()(RepositoryRuleCodeScanningable) + GetRepositoryRuleRepositoryRuleCodeScanning1()(RepositoryRuleCodeScanningable) + GetRepositoryRuleRepositoryRuleCodeScanning2()(RepositoryRuleCodeScanningable) + GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern()(RepositoryRuleCommitAuthorEmailPatternable) + GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern0()(RepositoryRuleCommitAuthorEmailPatternable) + GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern1()(RepositoryRuleCommitAuthorEmailPatternable) + GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern2()(RepositoryRuleCommitAuthorEmailPatternable) + GetRepositoryRuleRepositoryRuleCommitMessagePattern()(RepositoryRuleCommitMessagePatternable) + GetRepositoryRuleRepositoryRuleCommitMessagePattern0()(RepositoryRuleCommitMessagePatternable) + GetRepositoryRuleRepositoryRuleCommitMessagePattern1()(RepositoryRuleCommitMessagePatternable) + GetRepositoryRuleRepositoryRuleCommitMessagePattern2()(RepositoryRuleCommitMessagePatternable) + GetRepositoryRuleRepositoryRuleCommitterEmailPattern()(RepositoryRuleCommitterEmailPatternable) + GetRepositoryRuleRepositoryRuleCommitterEmailPattern0()(RepositoryRuleCommitterEmailPatternable) + GetRepositoryRuleRepositoryRuleCommitterEmailPattern1()(RepositoryRuleCommitterEmailPatternable) + GetRepositoryRuleRepositoryRuleCommitterEmailPattern2()(RepositoryRuleCommitterEmailPatternable) + GetRepositoryRuleRepositoryRuleCreation()(RepositoryRuleCreationable) + GetRepositoryRuleRepositoryRuleCreation0()(RepositoryRuleCreationable) + GetRepositoryRuleRepositoryRuleCreation1()(RepositoryRuleCreationable) + GetRepositoryRuleRepositoryRuleCreation2()(RepositoryRuleCreationable) + GetRepositoryRuleRepositoryRuleDeletion()(RepositoryRuleDeletionable) + GetRepositoryRuleRepositoryRuleDeletion0()(RepositoryRuleDeletionable) + GetRepositoryRuleRepositoryRuleDeletion1()(RepositoryRuleDeletionable) + GetRepositoryRuleRepositoryRuleDeletion2()(RepositoryRuleDeletionable) + GetRepositoryRuleRepositoryRuleNonFastForward()(RepositoryRuleNonFastForwardable) + GetRepositoryRuleRepositoryRuleNonFastForward0()(RepositoryRuleNonFastForwardable) + GetRepositoryRuleRepositoryRuleNonFastForward1()(RepositoryRuleNonFastForwardable) + GetRepositoryRuleRepositoryRuleNonFastForward2()(RepositoryRuleNonFastForwardable) + GetRepositoryRuleRepositoryRulePullRequest()(RepositoryRulePullRequestable) + GetRepositoryRuleRepositoryRulePullRequest0()(RepositoryRulePullRequestable) + GetRepositoryRuleRepositoryRulePullRequest1()(RepositoryRulePullRequestable) + GetRepositoryRuleRepositoryRulePullRequest2()(RepositoryRulePullRequestable) + GetRepositoryRuleRepositoryRuleRequiredDeployments()(RepositoryRuleRequiredDeploymentsable) + GetRepositoryRuleRepositoryRuleRequiredDeployments0()(RepositoryRuleRequiredDeploymentsable) + GetRepositoryRuleRepositoryRuleRequiredDeployments1()(RepositoryRuleRequiredDeploymentsable) + GetRepositoryRuleRepositoryRuleRequiredDeployments2()(RepositoryRuleRequiredDeploymentsable) + GetRepositoryRuleRepositoryRuleRequiredLinearHistory()(RepositoryRuleRequiredLinearHistoryable) + GetRepositoryRuleRepositoryRuleRequiredLinearHistory0()(RepositoryRuleRequiredLinearHistoryable) + GetRepositoryRuleRepositoryRuleRequiredLinearHistory1()(RepositoryRuleRequiredLinearHistoryable) + GetRepositoryRuleRepositoryRuleRequiredLinearHistory2()(RepositoryRuleRequiredLinearHistoryable) + GetRepositoryRuleRepositoryRuleRequiredSignatures()(RepositoryRuleRequiredSignaturesable) + GetRepositoryRuleRepositoryRuleRequiredSignatures0()(RepositoryRuleRequiredSignaturesable) + GetRepositoryRuleRepositoryRuleRequiredSignatures1()(RepositoryRuleRequiredSignaturesable) + GetRepositoryRuleRepositoryRuleRequiredSignatures2()(RepositoryRuleRequiredSignaturesable) + GetRepositoryRuleRepositoryRuleRequiredStatusChecks()(RepositoryRuleRequiredStatusChecksable) + GetRepositoryRuleRepositoryRuleRequiredStatusChecks0()(RepositoryRuleRequiredStatusChecksable) + GetRepositoryRuleRepositoryRuleRequiredStatusChecks1()(RepositoryRuleRequiredStatusChecksable) + GetRepositoryRuleRepositoryRuleRequiredStatusChecks2()(RepositoryRuleRequiredStatusChecksable) + GetRepositoryRuleRepositoryRuleTagNamePattern()(RepositoryRuleTagNamePatternable) + GetRepositoryRuleRepositoryRuleTagNamePattern0()(RepositoryRuleTagNamePatternable) + GetRepositoryRuleRepositoryRuleTagNamePattern1()(RepositoryRuleTagNamePatternable) + GetRepositoryRuleRepositoryRuleTagNamePattern2()(RepositoryRuleTagNamePatternable) + GetRepositoryRuleRepositoryRuleUpdate()(RepositoryRuleUpdateable) + GetRepositoryRuleRepositoryRuleUpdate0()(RepositoryRuleUpdateable) + GetRepositoryRuleRepositoryRuleUpdate1()(RepositoryRuleUpdateable) + GetRepositoryRuleRepositoryRuleUpdate2()(RepositoryRuleUpdateable) + GetRepositoryRuleRepositoryRuleWorkflows()(RepositoryRuleWorkflowsable) + GetRepositoryRuleRepositoryRuleWorkflows0()(RepositoryRuleWorkflowsable) + GetRepositoryRuleRepositoryRuleWorkflows1()(RepositoryRuleWorkflowsable) + GetRepositoryRuleRepositoryRuleWorkflows2()(RepositoryRuleWorkflowsable) + GetRepositoryRuleRequiredDeployments()(RepositoryRuleRequiredDeploymentsable) + GetRepositoryRuleRequiredLinearHistory()(RepositoryRuleRequiredLinearHistoryable) + GetRepositoryRuleRequiredSignatures()(RepositoryRuleRequiredSignaturesable) + GetRepositoryRuleRequiredStatusChecks()(RepositoryRuleRequiredStatusChecksable) + GetRepositoryRuleTagNamePattern()(RepositoryRuleTagNamePatternable) + GetRepositoryRuleUpdate()(RepositoryRuleUpdateable) + GetRepositoryRuleWorkflows()(RepositoryRuleWorkflowsable) + SetFileExtensionRestriction(value File_extension_restrictionable)() + SetFilePathRestriction(value File_path_restrictionable)() + SetMaxFilePathLength(value Max_file_path_lengthable)() + SetMaxFileSize(value Max_file_sizeable)() + SetRepositoryRuleBranchNamePattern(value RepositoryRuleBranchNamePatternable)() + SetRepositoryRuleCodeScanning(value RepositoryRuleCodeScanningable)() + SetRepositoryRuleCommitAuthorEmailPattern(value RepositoryRuleCommitAuthorEmailPatternable)() + SetRepositoryRuleCommitMessagePattern(value RepositoryRuleCommitMessagePatternable)() + SetRepositoryRuleCommitterEmailPattern(value RepositoryRuleCommitterEmailPatternable)() + SetRepositoryRuleCreation(value RepositoryRuleCreationable)() + SetRepositoryRuleDeletion(value RepositoryRuleDeletionable)() + SetRepositoryRuleFileExtensionRestriction(value File_extension_restrictionable)() + SetRepositoryRuleFileExtensionRestriction0(value File_extension_restrictionable)() + SetRepositoryRuleFileExtensionRestriction1(value File_extension_restrictionable)() + SetRepositoryRuleFileExtensionRestriction2(value File_extension_restrictionable)() + SetRepositoryRuleFilePathRestriction(value File_path_restrictionable)() + SetRepositoryRuleFilePathRestriction0(value File_path_restrictionable)() + SetRepositoryRuleFilePathRestriction1(value File_path_restrictionable)() + SetRepositoryRuleFilePathRestriction2(value File_path_restrictionable)() + SetRepositoryRuleMaxFilePathLength(value Max_file_path_lengthable)() + SetRepositoryRuleMaxFilePathLength0(value Max_file_path_lengthable)() + SetRepositoryRuleMaxFilePathLength1(value Max_file_path_lengthable)() + SetRepositoryRuleMaxFilePathLength2(value Max_file_path_lengthable)() + SetRepositoryRuleMaxFileSize(value Max_file_sizeable)() + SetRepositoryRuleMaxFileSize0(value Max_file_sizeable)() + SetRepositoryRuleMaxFileSize1(value Max_file_sizeable)() + SetRepositoryRuleMaxFileSize2(value Max_file_sizeable)() + SetRepositoryRuleNonFastForward(value RepositoryRuleNonFastForwardable)() + SetRepositoryRulePullRequest(value RepositoryRulePullRequestable)() + SetRepositoryRuleRepositoryRuleBranchNamePattern(value RepositoryRuleBranchNamePatternable)() + SetRepositoryRuleRepositoryRuleBranchNamePattern0(value RepositoryRuleBranchNamePatternable)() + SetRepositoryRuleRepositoryRuleBranchNamePattern1(value RepositoryRuleBranchNamePatternable)() + SetRepositoryRuleRepositoryRuleBranchNamePattern2(value RepositoryRuleBranchNamePatternable)() + SetRepositoryRuleRepositoryRuleCodeScanning(value RepositoryRuleCodeScanningable)() + SetRepositoryRuleRepositoryRuleCodeScanning0(value RepositoryRuleCodeScanningable)() + SetRepositoryRuleRepositoryRuleCodeScanning1(value RepositoryRuleCodeScanningable)() + SetRepositoryRuleRepositoryRuleCodeScanning2(value RepositoryRuleCodeScanningable)() + SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern(value RepositoryRuleCommitAuthorEmailPatternable)() + SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern0(value RepositoryRuleCommitAuthorEmailPatternable)() + SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern1(value RepositoryRuleCommitAuthorEmailPatternable)() + SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern2(value RepositoryRuleCommitAuthorEmailPatternable)() + SetRepositoryRuleRepositoryRuleCommitMessagePattern(value RepositoryRuleCommitMessagePatternable)() + SetRepositoryRuleRepositoryRuleCommitMessagePattern0(value RepositoryRuleCommitMessagePatternable)() + SetRepositoryRuleRepositoryRuleCommitMessagePattern1(value RepositoryRuleCommitMessagePatternable)() + SetRepositoryRuleRepositoryRuleCommitMessagePattern2(value RepositoryRuleCommitMessagePatternable)() + SetRepositoryRuleRepositoryRuleCommitterEmailPattern(value RepositoryRuleCommitterEmailPatternable)() + SetRepositoryRuleRepositoryRuleCommitterEmailPattern0(value RepositoryRuleCommitterEmailPatternable)() + SetRepositoryRuleRepositoryRuleCommitterEmailPattern1(value RepositoryRuleCommitterEmailPatternable)() + SetRepositoryRuleRepositoryRuleCommitterEmailPattern2(value RepositoryRuleCommitterEmailPatternable)() + SetRepositoryRuleRepositoryRuleCreation(value RepositoryRuleCreationable)() + SetRepositoryRuleRepositoryRuleCreation0(value RepositoryRuleCreationable)() + SetRepositoryRuleRepositoryRuleCreation1(value RepositoryRuleCreationable)() + SetRepositoryRuleRepositoryRuleCreation2(value RepositoryRuleCreationable)() + SetRepositoryRuleRepositoryRuleDeletion(value RepositoryRuleDeletionable)() + SetRepositoryRuleRepositoryRuleDeletion0(value RepositoryRuleDeletionable)() + SetRepositoryRuleRepositoryRuleDeletion1(value RepositoryRuleDeletionable)() + SetRepositoryRuleRepositoryRuleDeletion2(value RepositoryRuleDeletionable)() + SetRepositoryRuleRepositoryRuleNonFastForward(value RepositoryRuleNonFastForwardable)() + SetRepositoryRuleRepositoryRuleNonFastForward0(value RepositoryRuleNonFastForwardable)() + SetRepositoryRuleRepositoryRuleNonFastForward1(value RepositoryRuleNonFastForwardable)() + SetRepositoryRuleRepositoryRuleNonFastForward2(value RepositoryRuleNonFastForwardable)() + SetRepositoryRuleRepositoryRulePullRequest(value RepositoryRulePullRequestable)() + SetRepositoryRuleRepositoryRulePullRequest0(value RepositoryRulePullRequestable)() + SetRepositoryRuleRepositoryRulePullRequest1(value RepositoryRulePullRequestable)() + SetRepositoryRuleRepositoryRulePullRequest2(value RepositoryRulePullRequestable)() + SetRepositoryRuleRepositoryRuleRequiredDeployments(value RepositoryRuleRequiredDeploymentsable)() + SetRepositoryRuleRepositoryRuleRequiredDeployments0(value RepositoryRuleRequiredDeploymentsable)() + SetRepositoryRuleRepositoryRuleRequiredDeployments1(value RepositoryRuleRequiredDeploymentsable)() + SetRepositoryRuleRepositoryRuleRequiredDeployments2(value RepositoryRuleRequiredDeploymentsable)() + SetRepositoryRuleRepositoryRuleRequiredLinearHistory(value RepositoryRuleRequiredLinearHistoryable)() + SetRepositoryRuleRepositoryRuleRequiredLinearHistory0(value RepositoryRuleRequiredLinearHistoryable)() + SetRepositoryRuleRepositoryRuleRequiredLinearHistory1(value RepositoryRuleRequiredLinearHistoryable)() + SetRepositoryRuleRepositoryRuleRequiredLinearHistory2(value RepositoryRuleRequiredLinearHistoryable)() + SetRepositoryRuleRepositoryRuleRequiredSignatures(value RepositoryRuleRequiredSignaturesable)() + SetRepositoryRuleRepositoryRuleRequiredSignatures0(value RepositoryRuleRequiredSignaturesable)() + SetRepositoryRuleRepositoryRuleRequiredSignatures1(value RepositoryRuleRequiredSignaturesable)() + SetRepositoryRuleRepositoryRuleRequiredSignatures2(value RepositoryRuleRequiredSignaturesable)() + SetRepositoryRuleRepositoryRuleRequiredStatusChecks(value RepositoryRuleRequiredStatusChecksable)() + SetRepositoryRuleRepositoryRuleRequiredStatusChecks0(value RepositoryRuleRequiredStatusChecksable)() + SetRepositoryRuleRepositoryRuleRequiredStatusChecks1(value RepositoryRuleRequiredStatusChecksable)() + SetRepositoryRuleRepositoryRuleRequiredStatusChecks2(value RepositoryRuleRequiredStatusChecksable)() + SetRepositoryRuleRepositoryRuleTagNamePattern(value RepositoryRuleTagNamePatternable)() + SetRepositoryRuleRepositoryRuleTagNamePattern0(value RepositoryRuleTagNamePatternable)() + SetRepositoryRuleRepositoryRuleTagNamePattern1(value RepositoryRuleTagNamePatternable)() + SetRepositoryRuleRepositoryRuleTagNamePattern2(value RepositoryRuleTagNamePatternable)() + SetRepositoryRuleRepositoryRuleUpdate(value RepositoryRuleUpdateable)() + SetRepositoryRuleRepositoryRuleUpdate0(value RepositoryRuleUpdateable)() + SetRepositoryRuleRepositoryRuleUpdate1(value RepositoryRuleUpdateable)() + SetRepositoryRuleRepositoryRuleUpdate2(value RepositoryRuleUpdateable)() + SetRepositoryRuleRepositoryRuleWorkflows(value RepositoryRuleWorkflowsable)() + SetRepositoryRuleRepositoryRuleWorkflows0(value RepositoryRuleWorkflowsable)() + SetRepositoryRuleRepositoryRuleWorkflows1(value RepositoryRuleWorkflowsable)() + SetRepositoryRuleRepositoryRuleWorkflows2(value RepositoryRuleWorkflowsable)() + SetRepositoryRuleRequiredDeployments(value RepositoryRuleRequiredDeploymentsable)() + SetRepositoryRuleRequiredLinearHistory(value RepositoryRuleRequiredLinearHistoryable)() + SetRepositoryRuleRequiredSignatures(value RepositoryRuleRequiredSignaturesable)() + SetRepositoryRuleRequiredStatusChecks(value RepositoryRuleRequiredStatusChecksable)() + SetRepositoryRuleTagNamePattern(value RepositoryRuleTagNamePatternable)() + SetRepositoryRuleUpdate(value RepositoryRuleUpdateable)() + SetRepositoryRuleWorkflows(value RepositoryRuleWorkflowsable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_branch_name_pattern.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_branch_name_pattern.go new file mode 100644 index 000000000..20ca9fa58 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_branch_name_pattern.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleBranchNamePattern parameters to be used for the branch_name_pattern rule +type RepositoryRuleBranchNamePattern struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters RepositoryRuleBranchNamePattern_parametersable + // The type property + typeEscaped *RepositoryRuleBranchNamePattern_type +} +// NewRepositoryRuleBranchNamePattern instantiates a new RepositoryRuleBranchNamePattern and sets the default values. +func NewRepositoryRuleBranchNamePattern()(*RepositoryRuleBranchNamePattern) { + m := &RepositoryRuleBranchNamePattern{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleBranchNamePatternFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleBranchNamePatternFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleBranchNamePattern(), 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 *RepositoryRuleBranchNamePattern) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleBranchNamePattern) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleBranchNamePattern_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleBranchNamePattern_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleBranchNamePattern_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleBranchNamePattern_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleBranchNamePattern_parametersable when successful +func (m *RepositoryRuleBranchNamePattern) GetParameters()(RepositoryRuleBranchNamePattern_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleBranchNamePattern_type when successful +func (m *RepositoryRuleBranchNamePattern) GetTypeEscaped()(*RepositoryRuleBranchNamePattern_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleBranchNamePattern) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleBranchNamePattern) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleBranchNamePattern) SetParameters(value RepositoryRuleBranchNamePattern_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleBranchNamePattern) SetTypeEscaped(value *RepositoryRuleBranchNamePattern_type)() { + m.typeEscaped = value +} +type RepositoryRuleBranchNamePatternable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleBranchNamePattern_parametersable) + GetTypeEscaped()(*RepositoryRuleBranchNamePattern_type) + SetParameters(value RepositoryRuleBranchNamePattern_parametersable)() + SetTypeEscaped(value *RepositoryRuleBranchNamePattern_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_branch_name_pattern_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_branch_name_pattern_parameters.go new file mode 100644 index 000000000..498b7fec5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_branch_name_pattern_parameters.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleBranchNamePattern_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How this rule will appear to users. + name *string + // If true, the rule will fail if the pattern matches. + negate *bool + // The operator to use for matching. + operator *RepositoryRuleBranchNamePattern_parameters_operator + // The pattern to match with. + pattern *string +} +// NewRepositoryRuleBranchNamePattern_parameters instantiates a new RepositoryRuleBranchNamePattern_parameters and sets the default values. +func NewRepositoryRuleBranchNamePattern_parameters()(*RepositoryRuleBranchNamePattern_parameters) { + m := &RepositoryRuleBranchNamePattern_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleBranchNamePattern_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleBranchNamePattern_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleBranchNamePattern_parameters(), 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 *RepositoryRuleBranchNamePattern_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleBranchNamePattern_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["negate"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetNegate(val) + } + return nil + } + res["operator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleBranchNamePattern_parameters_operator) + if err != nil { + return err + } + if val != nil { + m.SetOperator(val.(*RepositoryRuleBranchNamePattern_parameters_operator)) + } + return nil + } + res["pattern"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPattern(val) + } + return nil + } + return res +} +// GetName gets the name property value. How this rule will appear to users. +// returns a *string when successful +func (m *RepositoryRuleBranchNamePattern_parameters) GetName()(*string) { + return m.name +} +// GetNegate gets the negate property value. If true, the rule will fail if the pattern matches. +// returns a *bool when successful +func (m *RepositoryRuleBranchNamePattern_parameters) GetNegate()(*bool) { + return m.negate +} +// GetOperator gets the operator property value. The operator to use for matching. +// returns a *RepositoryRuleBranchNamePattern_parameters_operator when successful +func (m *RepositoryRuleBranchNamePattern_parameters) GetOperator()(*RepositoryRuleBranchNamePattern_parameters_operator) { + return m.operator +} +// GetPattern gets the pattern property value. The pattern to match with. +// returns a *string when successful +func (m *RepositoryRuleBranchNamePattern_parameters) GetPattern()(*string) { + return m.pattern +} +// Serialize serializes information the current object +func (m *RepositoryRuleBranchNamePattern_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("negate", m.GetNegate()) + if err != nil { + return err + } + } + if m.GetOperator() != nil { + cast := (*m.GetOperator()).String() + err := writer.WriteStringValue("operator", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pattern", m.GetPattern()) + 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 *RepositoryRuleBranchNamePattern_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. How this rule will appear to users. +func (m *RepositoryRuleBranchNamePattern_parameters) SetName(value *string)() { + m.name = value +} +// SetNegate sets the negate property value. If true, the rule will fail if the pattern matches. +func (m *RepositoryRuleBranchNamePattern_parameters) SetNegate(value *bool)() { + m.negate = value +} +// SetOperator sets the operator property value. The operator to use for matching. +func (m *RepositoryRuleBranchNamePattern_parameters) SetOperator(value *RepositoryRuleBranchNamePattern_parameters_operator)() { + m.operator = value +} +// SetPattern sets the pattern property value. The pattern to match with. +func (m *RepositoryRuleBranchNamePattern_parameters) SetPattern(value *string)() { + m.pattern = value +} +type RepositoryRuleBranchNamePattern_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetNegate()(*bool) + GetOperator()(*RepositoryRuleBranchNamePattern_parameters_operator) + GetPattern()(*string) + SetName(value *string)() + SetNegate(value *bool)() + SetOperator(value *RepositoryRuleBranchNamePattern_parameters_operator)() + SetPattern(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_branch_name_pattern_parameters_operator.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_branch_name_pattern_parameters_operator.go new file mode 100644 index 000000000..d192b7067 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_branch_name_pattern_parameters_operator.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The operator to use for matching. +type RepositoryRuleBranchNamePattern_parameters_operator int + +const ( + STARTS_WITH_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR RepositoryRuleBranchNamePattern_parameters_operator = iota + ENDS_WITH_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR + CONTAINS_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR + REGEX_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR +) + +func (i RepositoryRuleBranchNamePattern_parameters_operator) String() string { + return []string{"starts_with", "ends_with", "contains", "regex"}[i] +} +func ParseRepositoryRuleBranchNamePattern_parameters_operator(v string) (any, error) { + result := STARTS_WITH_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR + switch v { + case "starts_with": + result = STARTS_WITH_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR + case "ends_with": + result = ENDS_WITH_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR + case "contains": + result = CONTAINS_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR + case "regex": + result = REGEX_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR + default: + return 0, errors.New("Unknown RepositoryRuleBranchNamePattern_parameters_operator value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleBranchNamePattern_parameters_operator(values []RepositoryRuleBranchNamePattern_parameters_operator) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleBranchNamePattern_parameters_operator) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_branch_name_pattern_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_branch_name_pattern_type.go new file mode 100644 index 000000000..0fce8bf16 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_branch_name_pattern_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type RepositoryRuleBranchNamePattern_type int + +const ( + BRANCH_NAME_PATTERN_REPOSITORYRULEBRANCHNAMEPATTERN_TYPE RepositoryRuleBranchNamePattern_type = iota +) + +func (i RepositoryRuleBranchNamePattern_type) String() string { + return []string{"branch_name_pattern"}[i] +} +func ParseRepositoryRuleBranchNamePattern_type(v string) (any, error) { + result := BRANCH_NAME_PATTERN_REPOSITORYRULEBRANCHNAMEPATTERN_TYPE + switch v { + case "branch_name_pattern": + result = BRANCH_NAME_PATTERN_REPOSITORYRULEBRANCHNAMEPATTERN_TYPE + default: + return 0, errors.New("Unknown RepositoryRuleBranchNamePattern_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleBranchNamePattern_type(values []RepositoryRuleBranchNamePattern_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleBranchNamePattern_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_code_scanning.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_code_scanning.go new file mode 100644 index 000000000..c2bce2d48 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_code_scanning.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleCodeScanning choose which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. +type RepositoryRuleCodeScanning struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters RepositoryRuleCodeScanning_parametersable + // The type property + typeEscaped *RepositoryRuleCodeScanning_type +} +// NewRepositoryRuleCodeScanning instantiates a new RepositoryRuleCodeScanning and sets the default values. +func NewRepositoryRuleCodeScanning()(*RepositoryRuleCodeScanning) { + m := &RepositoryRuleCodeScanning{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCodeScanningFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCodeScanningFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCodeScanning(), 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 *RepositoryRuleCodeScanning) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleCodeScanning) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleCodeScanning_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleCodeScanning_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleCodeScanning_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleCodeScanning_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleCodeScanning_parametersable when successful +func (m *RepositoryRuleCodeScanning) GetParameters()(RepositoryRuleCodeScanning_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleCodeScanning_type when successful +func (m *RepositoryRuleCodeScanning) GetTypeEscaped()(*RepositoryRuleCodeScanning_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleCodeScanning) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleCodeScanning) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleCodeScanning) SetParameters(value RepositoryRuleCodeScanning_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleCodeScanning) SetTypeEscaped(value *RepositoryRuleCodeScanning_type)() { + m.typeEscaped = value +} +type RepositoryRuleCodeScanningable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleCodeScanning_parametersable) + GetTypeEscaped()(*RepositoryRuleCodeScanning_type) + SetParameters(value RepositoryRuleCodeScanning_parametersable)() + SetTypeEscaped(value *RepositoryRuleCodeScanning_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_code_scanning_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_code_scanning_parameters.go new file mode 100644 index 000000000..f43a87650 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_code_scanning_parameters.go @@ -0,0 +1,92 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleCodeScanning_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Tools that must provide code scanning results for this rule to pass. + code_scanning_tools []RepositoryRuleParamsCodeScanningToolable +} +// NewRepositoryRuleCodeScanning_parameters instantiates a new RepositoryRuleCodeScanning_parameters and sets the default values. +func NewRepositoryRuleCodeScanning_parameters()(*RepositoryRuleCodeScanning_parameters) { + m := &RepositoryRuleCodeScanning_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCodeScanning_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCodeScanning_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCodeScanning_parameters(), 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 *RepositoryRuleCodeScanning_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCodeScanningTools gets the code_scanning_tools property value. Tools that must provide code scanning results for this rule to pass. +// returns a []RepositoryRuleParamsCodeScanningToolable when successful +func (m *RepositoryRuleCodeScanning_parameters) GetCodeScanningTools()([]RepositoryRuleParamsCodeScanningToolable) { + return m.code_scanning_tools +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleCodeScanning_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code_scanning_tools"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryRuleParamsCodeScanningToolFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryRuleParamsCodeScanningToolable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryRuleParamsCodeScanningToolable) + } + } + m.SetCodeScanningTools(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *RepositoryRuleCodeScanning_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCodeScanningTools() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCodeScanningTools())) + for i, v := range m.GetCodeScanningTools() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("code_scanning_tools", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleCodeScanning_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCodeScanningTools sets the code_scanning_tools property value. Tools that must provide code scanning results for this rule to pass. +func (m *RepositoryRuleCodeScanning_parameters) SetCodeScanningTools(value []RepositoryRuleParamsCodeScanningToolable)() { + m.code_scanning_tools = value +} +type RepositoryRuleCodeScanning_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCodeScanningTools()([]RepositoryRuleParamsCodeScanningToolable) + SetCodeScanningTools(value []RepositoryRuleParamsCodeScanningToolable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_code_scanning_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_code_scanning_type.go new file mode 100644 index 000000000..47648a5c8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_code_scanning_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type RepositoryRuleCodeScanning_type int + +const ( + CODE_SCANNING_REPOSITORYRULECODESCANNING_TYPE RepositoryRuleCodeScanning_type = iota +) + +func (i RepositoryRuleCodeScanning_type) String() string { + return []string{"code_scanning"}[i] +} +func ParseRepositoryRuleCodeScanning_type(v string) (any, error) { + result := CODE_SCANNING_REPOSITORYRULECODESCANNING_TYPE + switch v { + case "code_scanning": + result = CODE_SCANNING_REPOSITORYRULECODESCANNING_TYPE + default: + return 0, errors.New("Unknown RepositoryRuleCodeScanning_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleCodeScanning_type(values []RepositoryRuleCodeScanning_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleCodeScanning_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_author_email_pattern.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_author_email_pattern.go new file mode 100644 index 000000000..5d0729e9d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_author_email_pattern.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleCommitAuthorEmailPattern parameters to be used for the commit_author_email_pattern rule +type RepositoryRuleCommitAuthorEmailPattern struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters RepositoryRuleCommitAuthorEmailPattern_parametersable + // The type property + typeEscaped *RepositoryRuleCommitAuthorEmailPattern_type +} +// NewRepositoryRuleCommitAuthorEmailPattern instantiates a new RepositoryRuleCommitAuthorEmailPattern and sets the default values. +func NewRepositoryRuleCommitAuthorEmailPattern()(*RepositoryRuleCommitAuthorEmailPattern) { + m := &RepositoryRuleCommitAuthorEmailPattern{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCommitAuthorEmailPatternFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCommitAuthorEmailPatternFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCommitAuthorEmailPattern(), 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 *RepositoryRuleCommitAuthorEmailPattern) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleCommitAuthorEmailPattern) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleCommitAuthorEmailPattern_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleCommitAuthorEmailPattern_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleCommitAuthorEmailPattern_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleCommitAuthorEmailPattern_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleCommitAuthorEmailPattern_parametersable when successful +func (m *RepositoryRuleCommitAuthorEmailPattern) GetParameters()(RepositoryRuleCommitAuthorEmailPattern_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleCommitAuthorEmailPattern_type when successful +func (m *RepositoryRuleCommitAuthorEmailPattern) GetTypeEscaped()(*RepositoryRuleCommitAuthorEmailPattern_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleCommitAuthorEmailPattern) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleCommitAuthorEmailPattern) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleCommitAuthorEmailPattern) SetParameters(value RepositoryRuleCommitAuthorEmailPattern_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleCommitAuthorEmailPattern) SetTypeEscaped(value *RepositoryRuleCommitAuthorEmailPattern_type)() { + m.typeEscaped = value +} +type RepositoryRuleCommitAuthorEmailPatternable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleCommitAuthorEmailPattern_parametersable) + GetTypeEscaped()(*RepositoryRuleCommitAuthorEmailPattern_type) + SetParameters(value RepositoryRuleCommitAuthorEmailPattern_parametersable)() + SetTypeEscaped(value *RepositoryRuleCommitAuthorEmailPattern_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_author_email_pattern_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_author_email_pattern_parameters.go new file mode 100644 index 000000000..5787db7bf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_author_email_pattern_parameters.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleCommitAuthorEmailPattern_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How this rule will appear to users. + name *string + // If true, the rule will fail if the pattern matches. + negate *bool + // The operator to use for matching. + operator *RepositoryRuleCommitAuthorEmailPattern_parameters_operator + // The pattern to match with. + pattern *string +} +// NewRepositoryRuleCommitAuthorEmailPattern_parameters instantiates a new RepositoryRuleCommitAuthorEmailPattern_parameters and sets the default values. +func NewRepositoryRuleCommitAuthorEmailPattern_parameters()(*RepositoryRuleCommitAuthorEmailPattern_parameters) { + m := &RepositoryRuleCommitAuthorEmailPattern_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCommitAuthorEmailPattern_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCommitAuthorEmailPattern_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCommitAuthorEmailPattern_parameters(), 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 *RepositoryRuleCommitAuthorEmailPattern_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["negate"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetNegate(val) + } + return nil + } + res["operator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleCommitAuthorEmailPattern_parameters_operator) + if err != nil { + return err + } + if val != nil { + m.SetOperator(val.(*RepositoryRuleCommitAuthorEmailPattern_parameters_operator)) + } + return nil + } + res["pattern"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPattern(val) + } + return nil + } + return res +} +// GetName gets the name property value. How this rule will appear to users. +// returns a *string when successful +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) GetName()(*string) { + return m.name +} +// GetNegate gets the negate property value. If true, the rule will fail if the pattern matches. +// returns a *bool when successful +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) GetNegate()(*bool) { + return m.negate +} +// GetOperator gets the operator property value. The operator to use for matching. +// returns a *RepositoryRuleCommitAuthorEmailPattern_parameters_operator when successful +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) GetOperator()(*RepositoryRuleCommitAuthorEmailPattern_parameters_operator) { + return m.operator +} +// GetPattern gets the pattern property value. The pattern to match with. +// returns a *string when successful +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) GetPattern()(*string) { + return m.pattern +} +// Serialize serializes information the current object +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("negate", m.GetNegate()) + if err != nil { + return err + } + } + if m.GetOperator() != nil { + cast := (*m.GetOperator()).String() + err := writer.WriteStringValue("operator", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pattern", m.GetPattern()) + 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 *RepositoryRuleCommitAuthorEmailPattern_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. How this rule will appear to users. +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) SetName(value *string)() { + m.name = value +} +// SetNegate sets the negate property value. If true, the rule will fail if the pattern matches. +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) SetNegate(value *bool)() { + m.negate = value +} +// SetOperator sets the operator property value. The operator to use for matching. +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) SetOperator(value *RepositoryRuleCommitAuthorEmailPattern_parameters_operator)() { + m.operator = value +} +// SetPattern sets the pattern property value. The pattern to match with. +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) SetPattern(value *string)() { + m.pattern = value +} +type RepositoryRuleCommitAuthorEmailPattern_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetNegate()(*bool) + GetOperator()(*RepositoryRuleCommitAuthorEmailPattern_parameters_operator) + GetPattern()(*string) + SetName(value *string)() + SetNegate(value *bool)() + SetOperator(value *RepositoryRuleCommitAuthorEmailPattern_parameters_operator)() + SetPattern(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_author_email_pattern_parameters_operator.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_author_email_pattern_parameters_operator.go new file mode 100644 index 000000000..85c4203fb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_author_email_pattern_parameters_operator.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The operator to use for matching. +type RepositoryRuleCommitAuthorEmailPattern_parameters_operator int + +const ( + STARTS_WITH_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR RepositoryRuleCommitAuthorEmailPattern_parameters_operator = iota + ENDS_WITH_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR + CONTAINS_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR + REGEX_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR +) + +func (i RepositoryRuleCommitAuthorEmailPattern_parameters_operator) String() string { + return []string{"starts_with", "ends_with", "contains", "regex"}[i] +} +func ParseRepositoryRuleCommitAuthorEmailPattern_parameters_operator(v string) (any, error) { + result := STARTS_WITH_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR + switch v { + case "starts_with": + result = STARTS_WITH_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR + case "ends_with": + result = ENDS_WITH_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR + case "contains": + result = CONTAINS_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR + case "regex": + result = REGEX_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR + default: + return 0, errors.New("Unknown RepositoryRuleCommitAuthorEmailPattern_parameters_operator value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleCommitAuthorEmailPattern_parameters_operator(values []RepositoryRuleCommitAuthorEmailPattern_parameters_operator) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleCommitAuthorEmailPattern_parameters_operator) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_author_email_pattern_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_author_email_pattern_type.go new file mode 100644 index 000000000..1be3b2e8c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_author_email_pattern_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type RepositoryRuleCommitAuthorEmailPattern_type int + +const ( + COMMIT_AUTHOR_EMAIL_PATTERN_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_TYPE RepositoryRuleCommitAuthorEmailPattern_type = iota +) + +func (i RepositoryRuleCommitAuthorEmailPattern_type) String() string { + return []string{"commit_author_email_pattern"}[i] +} +func ParseRepositoryRuleCommitAuthorEmailPattern_type(v string) (any, error) { + result := COMMIT_AUTHOR_EMAIL_PATTERN_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_TYPE + switch v { + case "commit_author_email_pattern": + result = COMMIT_AUTHOR_EMAIL_PATTERN_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_TYPE + default: + return 0, errors.New("Unknown RepositoryRuleCommitAuthorEmailPattern_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleCommitAuthorEmailPattern_type(values []RepositoryRuleCommitAuthorEmailPattern_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleCommitAuthorEmailPattern_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_message_pattern.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_message_pattern.go new file mode 100644 index 000000000..da8d458b9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_message_pattern.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleCommitMessagePattern parameters to be used for the commit_message_pattern rule +type RepositoryRuleCommitMessagePattern struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters RepositoryRuleCommitMessagePattern_parametersable + // The type property + typeEscaped *RepositoryRuleCommitMessagePattern_type +} +// NewRepositoryRuleCommitMessagePattern instantiates a new RepositoryRuleCommitMessagePattern and sets the default values. +func NewRepositoryRuleCommitMessagePattern()(*RepositoryRuleCommitMessagePattern) { + m := &RepositoryRuleCommitMessagePattern{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCommitMessagePatternFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCommitMessagePatternFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCommitMessagePattern(), 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 *RepositoryRuleCommitMessagePattern) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleCommitMessagePattern) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleCommitMessagePattern_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleCommitMessagePattern_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleCommitMessagePattern_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleCommitMessagePattern_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleCommitMessagePattern_parametersable when successful +func (m *RepositoryRuleCommitMessagePattern) GetParameters()(RepositoryRuleCommitMessagePattern_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleCommitMessagePattern_type when successful +func (m *RepositoryRuleCommitMessagePattern) GetTypeEscaped()(*RepositoryRuleCommitMessagePattern_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleCommitMessagePattern) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleCommitMessagePattern) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleCommitMessagePattern) SetParameters(value RepositoryRuleCommitMessagePattern_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleCommitMessagePattern) SetTypeEscaped(value *RepositoryRuleCommitMessagePattern_type)() { + m.typeEscaped = value +} +type RepositoryRuleCommitMessagePatternable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleCommitMessagePattern_parametersable) + GetTypeEscaped()(*RepositoryRuleCommitMessagePattern_type) + SetParameters(value RepositoryRuleCommitMessagePattern_parametersable)() + SetTypeEscaped(value *RepositoryRuleCommitMessagePattern_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_message_pattern_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_message_pattern_parameters.go new file mode 100644 index 000000000..5dfeb80f2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_message_pattern_parameters.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleCommitMessagePattern_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How this rule will appear to users. + name *string + // If true, the rule will fail if the pattern matches. + negate *bool + // The operator to use for matching. + operator *RepositoryRuleCommitMessagePattern_parameters_operator + // The pattern to match with. + pattern *string +} +// NewRepositoryRuleCommitMessagePattern_parameters instantiates a new RepositoryRuleCommitMessagePattern_parameters and sets the default values. +func NewRepositoryRuleCommitMessagePattern_parameters()(*RepositoryRuleCommitMessagePattern_parameters) { + m := &RepositoryRuleCommitMessagePattern_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCommitMessagePattern_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCommitMessagePattern_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCommitMessagePattern_parameters(), 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 *RepositoryRuleCommitMessagePattern_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleCommitMessagePattern_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["negate"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetNegate(val) + } + return nil + } + res["operator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleCommitMessagePattern_parameters_operator) + if err != nil { + return err + } + if val != nil { + m.SetOperator(val.(*RepositoryRuleCommitMessagePattern_parameters_operator)) + } + return nil + } + res["pattern"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPattern(val) + } + return nil + } + return res +} +// GetName gets the name property value. How this rule will appear to users. +// returns a *string when successful +func (m *RepositoryRuleCommitMessagePattern_parameters) GetName()(*string) { + return m.name +} +// GetNegate gets the negate property value. If true, the rule will fail if the pattern matches. +// returns a *bool when successful +func (m *RepositoryRuleCommitMessagePattern_parameters) GetNegate()(*bool) { + return m.negate +} +// GetOperator gets the operator property value. The operator to use for matching. +// returns a *RepositoryRuleCommitMessagePattern_parameters_operator when successful +func (m *RepositoryRuleCommitMessagePattern_parameters) GetOperator()(*RepositoryRuleCommitMessagePattern_parameters_operator) { + return m.operator +} +// GetPattern gets the pattern property value. The pattern to match with. +// returns a *string when successful +func (m *RepositoryRuleCommitMessagePattern_parameters) GetPattern()(*string) { + return m.pattern +} +// Serialize serializes information the current object +func (m *RepositoryRuleCommitMessagePattern_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("negate", m.GetNegate()) + if err != nil { + return err + } + } + if m.GetOperator() != nil { + cast := (*m.GetOperator()).String() + err := writer.WriteStringValue("operator", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pattern", m.GetPattern()) + 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 *RepositoryRuleCommitMessagePattern_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. How this rule will appear to users. +func (m *RepositoryRuleCommitMessagePattern_parameters) SetName(value *string)() { + m.name = value +} +// SetNegate sets the negate property value. If true, the rule will fail if the pattern matches. +func (m *RepositoryRuleCommitMessagePattern_parameters) SetNegate(value *bool)() { + m.negate = value +} +// SetOperator sets the operator property value. The operator to use for matching. +func (m *RepositoryRuleCommitMessagePattern_parameters) SetOperator(value *RepositoryRuleCommitMessagePattern_parameters_operator)() { + m.operator = value +} +// SetPattern sets the pattern property value. The pattern to match with. +func (m *RepositoryRuleCommitMessagePattern_parameters) SetPattern(value *string)() { + m.pattern = value +} +type RepositoryRuleCommitMessagePattern_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetNegate()(*bool) + GetOperator()(*RepositoryRuleCommitMessagePattern_parameters_operator) + GetPattern()(*string) + SetName(value *string)() + SetNegate(value *bool)() + SetOperator(value *RepositoryRuleCommitMessagePattern_parameters_operator)() + SetPattern(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_message_pattern_parameters_operator.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_message_pattern_parameters_operator.go new file mode 100644 index 000000000..e310dd2c8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_message_pattern_parameters_operator.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The operator to use for matching. +type RepositoryRuleCommitMessagePattern_parameters_operator int + +const ( + STARTS_WITH_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR RepositoryRuleCommitMessagePattern_parameters_operator = iota + ENDS_WITH_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR + CONTAINS_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR + REGEX_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR +) + +func (i RepositoryRuleCommitMessagePattern_parameters_operator) String() string { + return []string{"starts_with", "ends_with", "contains", "regex"}[i] +} +func ParseRepositoryRuleCommitMessagePattern_parameters_operator(v string) (any, error) { + result := STARTS_WITH_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR + switch v { + case "starts_with": + result = STARTS_WITH_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR + case "ends_with": + result = ENDS_WITH_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR + case "contains": + result = CONTAINS_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR + case "regex": + result = REGEX_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR + default: + return 0, errors.New("Unknown RepositoryRuleCommitMessagePattern_parameters_operator value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleCommitMessagePattern_parameters_operator(values []RepositoryRuleCommitMessagePattern_parameters_operator) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleCommitMessagePattern_parameters_operator) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_message_pattern_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_message_pattern_type.go new file mode 100644 index 000000000..8282213a5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_commit_message_pattern_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type RepositoryRuleCommitMessagePattern_type int + +const ( + COMMIT_MESSAGE_PATTERN_REPOSITORYRULECOMMITMESSAGEPATTERN_TYPE RepositoryRuleCommitMessagePattern_type = iota +) + +func (i RepositoryRuleCommitMessagePattern_type) String() string { + return []string{"commit_message_pattern"}[i] +} +func ParseRepositoryRuleCommitMessagePattern_type(v string) (any, error) { + result := COMMIT_MESSAGE_PATTERN_REPOSITORYRULECOMMITMESSAGEPATTERN_TYPE + switch v { + case "commit_message_pattern": + result = COMMIT_MESSAGE_PATTERN_REPOSITORYRULECOMMITMESSAGEPATTERN_TYPE + default: + return 0, errors.New("Unknown RepositoryRuleCommitMessagePattern_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleCommitMessagePattern_type(values []RepositoryRuleCommitMessagePattern_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleCommitMessagePattern_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_committer_email_pattern.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_committer_email_pattern.go new file mode 100644 index 000000000..940cda699 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_committer_email_pattern.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleCommitterEmailPattern parameters to be used for the committer_email_pattern rule +type RepositoryRuleCommitterEmailPattern struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters RepositoryRuleCommitterEmailPattern_parametersable + // The type property + typeEscaped *RepositoryRuleCommitterEmailPattern_type +} +// NewRepositoryRuleCommitterEmailPattern instantiates a new RepositoryRuleCommitterEmailPattern and sets the default values. +func NewRepositoryRuleCommitterEmailPattern()(*RepositoryRuleCommitterEmailPattern) { + m := &RepositoryRuleCommitterEmailPattern{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCommitterEmailPatternFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCommitterEmailPatternFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCommitterEmailPattern(), 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 *RepositoryRuleCommitterEmailPattern) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleCommitterEmailPattern) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleCommitterEmailPattern_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleCommitterEmailPattern_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleCommitterEmailPattern_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleCommitterEmailPattern_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleCommitterEmailPattern_parametersable when successful +func (m *RepositoryRuleCommitterEmailPattern) GetParameters()(RepositoryRuleCommitterEmailPattern_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleCommitterEmailPattern_type when successful +func (m *RepositoryRuleCommitterEmailPattern) GetTypeEscaped()(*RepositoryRuleCommitterEmailPattern_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleCommitterEmailPattern) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleCommitterEmailPattern) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleCommitterEmailPattern) SetParameters(value RepositoryRuleCommitterEmailPattern_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleCommitterEmailPattern) SetTypeEscaped(value *RepositoryRuleCommitterEmailPattern_type)() { + m.typeEscaped = value +} +type RepositoryRuleCommitterEmailPatternable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleCommitterEmailPattern_parametersable) + GetTypeEscaped()(*RepositoryRuleCommitterEmailPattern_type) + SetParameters(value RepositoryRuleCommitterEmailPattern_parametersable)() + SetTypeEscaped(value *RepositoryRuleCommitterEmailPattern_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_committer_email_pattern_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_committer_email_pattern_parameters.go new file mode 100644 index 000000000..59befb884 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_committer_email_pattern_parameters.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleCommitterEmailPattern_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How this rule will appear to users. + name *string + // If true, the rule will fail if the pattern matches. + negate *bool + // The operator to use for matching. + operator *RepositoryRuleCommitterEmailPattern_parameters_operator + // The pattern to match with. + pattern *string +} +// NewRepositoryRuleCommitterEmailPattern_parameters instantiates a new RepositoryRuleCommitterEmailPattern_parameters and sets the default values. +func NewRepositoryRuleCommitterEmailPattern_parameters()(*RepositoryRuleCommitterEmailPattern_parameters) { + m := &RepositoryRuleCommitterEmailPattern_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCommitterEmailPattern_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCommitterEmailPattern_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCommitterEmailPattern_parameters(), 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 *RepositoryRuleCommitterEmailPattern_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleCommitterEmailPattern_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["negate"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetNegate(val) + } + return nil + } + res["operator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleCommitterEmailPattern_parameters_operator) + if err != nil { + return err + } + if val != nil { + m.SetOperator(val.(*RepositoryRuleCommitterEmailPattern_parameters_operator)) + } + return nil + } + res["pattern"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPattern(val) + } + return nil + } + return res +} +// GetName gets the name property value. How this rule will appear to users. +// returns a *string when successful +func (m *RepositoryRuleCommitterEmailPattern_parameters) GetName()(*string) { + return m.name +} +// GetNegate gets the negate property value. If true, the rule will fail if the pattern matches. +// returns a *bool when successful +func (m *RepositoryRuleCommitterEmailPattern_parameters) GetNegate()(*bool) { + return m.negate +} +// GetOperator gets the operator property value. The operator to use for matching. +// returns a *RepositoryRuleCommitterEmailPattern_parameters_operator when successful +func (m *RepositoryRuleCommitterEmailPattern_parameters) GetOperator()(*RepositoryRuleCommitterEmailPattern_parameters_operator) { + return m.operator +} +// GetPattern gets the pattern property value. The pattern to match with. +// returns a *string when successful +func (m *RepositoryRuleCommitterEmailPattern_parameters) GetPattern()(*string) { + return m.pattern +} +// Serialize serializes information the current object +func (m *RepositoryRuleCommitterEmailPattern_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("negate", m.GetNegate()) + if err != nil { + return err + } + } + if m.GetOperator() != nil { + cast := (*m.GetOperator()).String() + err := writer.WriteStringValue("operator", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pattern", m.GetPattern()) + 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 *RepositoryRuleCommitterEmailPattern_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. How this rule will appear to users. +func (m *RepositoryRuleCommitterEmailPattern_parameters) SetName(value *string)() { + m.name = value +} +// SetNegate sets the negate property value. If true, the rule will fail if the pattern matches. +func (m *RepositoryRuleCommitterEmailPattern_parameters) SetNegate(value *bool)() { + m.negate = value +} +// SetOperator sets the operator property value. The operator to use for matching. +func (m *RepositoryRuleCommitterEmailPattern_parameters) SetOperator(value *RepositoryRuleCommitterEmailPattern_parameters_operator)() { + m.operator = value +} +// SetPattern sets the pattern property value. The pattern to match with. +func (m *RepositoryRuleCommitterEmailPattern_parameters) SetPattern(value *string)() { + m.pattern = value +} +type RepositoryRuleCommitterEmailPattern_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetNegate()(*bool) + GetOperator()(*RepositoryRuleCommitterEmailPattern_parameters_operator) + GetPattern()(*string) + SetName(value *string)() + SetNegate(value *bool)() + SetOperator(value *RepositoryRuleCommitterEmailPattern_parameters_operator)() + SetPattern(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_committer_email_pattern_parameters_operator.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_committer_email_pattern_parameters_operator.go new file mode 100644 index 000000000..a722fafb9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_committer_email_pattern_parameters_operator.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The operator to use for matching. +type RepositoryRuleCommitterEmailPattern_parameters_operator int + +const ( + STARTS_WITH_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR RepositoryRuleCommitterEmailPattern_parameters_operator = iota + ENDS_WITH_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR + CONTAINS_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR + REGEX_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR +) + +func (i RepositoryRuleCommitterEmailPattern_parameters_operator) String() string { + return []string{"starts_with", "ends_with", "contains", "regex"}[i] +} +func ParseRepositoryRuleCommitterEmailPattern_parameters_operator(v string) (any, error) { + result := STARTS_WITH_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR + switch v { + case "starts_with": + result = STARTS_WITH_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR + case "ends_with": + result = ENDS_WITH_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR + case "contains": + result = CONTAINS_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR + case "regex": + result = REGEX_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR + default: + return 0, errors.New("Unknown RepositoryRuleCommitterEmailPattern_parameters_operator value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleCommitterEmailPattern_parameters_operator(values []RepositoryRuleCommitterEmailPattern_parameters_operator) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleCommitterEmailPattern_parameters_operator) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_committer_email_pattern_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_committer_email_pattern_type.go new file mode 100644 index 000000000..13b748829 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_committer_email_pattern_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type RepositoryRuleCommitterEmailPattern_type int + +const ( + COMMITTER_EMAIL_PATTERN_REPOSITORYRULECOMMITTEREMAILPATTERN_TYPE RepositoryRuleCommitterEmailPattern_type = iota +) + +func (i RepositoryRuleCommitterEmailPattern_type) String() string { + return []string{"committer_email_pattern"}[i] +} +func ParseRepositoryRuleCommitterEmailPattern_type(v string) (any, error) { + result := COMMITTER_EMAIL_PATTERN_REPOSITORYRULECOMMITTEREMAILPATTERN_TYPE + switch v { + case "committer_email_pattern": + result = COMMITTER_EMAIL_PATTERN_REPOSITORYRULECOMMITTEREMAILPATTERN_TYPE + default: + return 0, errors.New("Unknown RepositoryRuleCommitterEmailPattern_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleCommitterEmailPattern_type(values []RepositoryRuleCommitterEmailPattern_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleCommitterEmailPattern_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_creation.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_creation.go new file mode 100644 index 000000000..049390154 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_creation.go @@ -0,0 +1,82 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleCreation only allow users with bypass permission to create matching refs. +type RepositoryRuleCreation struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The type property + typeEscaped *RepositoryRuleCreation_type +} +// NewRepositoryRuleCreation instantiates a new RepositoryRuleCreation and sets the default values. +func NewRepositoryRuleCreation()(*RepositoryRuleCreation) { + m := &RepositoryRuleCreation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCreationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCreationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCreation(), 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 *RepositoryRuleCreation) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleCreation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleCreation_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleCreation_type)) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleCreation_type when successful +func (m *RepositoryRuleCreation) GetTypeEscaped()(*RepositoryRuleCreation_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleCreation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleCreation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleCreation) SetTypeEscaped(value *RepositoryRuleCreation_type)() { + m.typeEscaped = value +} +type RepositoryRuleCreationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTypeEscaped()(*RepositoryRuleCreation_type) + SetTypeEscaped(value *RepositoryRuleCreation_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_creation_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_creation_type.go new file mode 100644 index 000000000..830e8d045 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_creation_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type RepositoryRuleCreation_type int + +const ( + CREATION_REPOSITORYRULECREATION_TYPE RepositoryRuleCreation_type = iota +) + +func (i RepositoryRuleCreation_type) String() string { + return []string{"creation"}[i] +} +func ParseRepositoryRuleCreation_type(v string) (any, error) { + result := CREATION_REPOSITORYRULECREATION_TYPE + switch v { + case "creation": + result = CREATION_REPOSITORYRULECREATION_TYPE + default: + return 0, errors.New("Unknown RepositoryRuleCreation_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleCreation_type(values []RepositoryRuleCreation_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleCreation_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_deletion.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_deletion.go new file mode 100644 index 000000000..2fcc1e64d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_deletion.go @@ -0,0 +1,82 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleDeletion only allow users with bypass permissions to delete matching refs. +type RepositoryRuleDeletion struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The type property + typeEscaped *RepositoryRuleDeletion_type +} +// NewRepositoryRuleDeletion instantiates a new RepositoryRuleDeletion and sets the default values. +func NewRepositoryRuleDeletion()(*RepositoryRuleDeletion) { + m := &RepositoryRuleDeletion{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleDeletionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleDeletionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleDeletion(), 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 *RepositoryRuleDeletion) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleDeletion) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleDeletion_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleDeletion_type)) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleDeletion_type when successful +func (m *RepositoryRuleDeletion) GetTypeEscaped()(*RepositoryRuleDeletion_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleDeletion) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleDeletion) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleDeletion) SetTypeEscaped(value *RepositoryRuleDeletion_type)() { + m.typeEscaped = value +} +type RepositoryRuleDeletionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTypeEscaped()(*RepositoryRuleDeletion_type) + SetTypeEscaped(value *RepositoryRuleDeletion_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_deletion_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_deletion_type.go new file mode 100644 index 000000000..77cb2c701 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_deletion_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type RepositoryRuleDeletion_type int + +const ( + DELETION_REPOSITORYRULEDELETION_TYPE RepositoryRuleDeletion_type = iota +) + +func (i RepositoryRuleDeletion_type) String() string { + return []string{"deletion"}[i] +} +func ParseRepositoryRuleDeletion_type(v string) (any, error) { + result := DELETION_REPOSITORYRULEDELETION_TYPE + switch v { + case "deletion": + result = DELETION_REPOSITORYRULEDELETION_TYPE + default: + return 0, errors.New("Unknown RepositoryRuleDeletion_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleDeletion_type(values []RepositoryRuleDeletion_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleDeletion_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_detailed.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_detailed.go new file mode 100644 index 000000000..30252c322 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_detailed.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleDetailed a repository rule with ruleset details. +type RepositoryRuleDetailed struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewRepositoryRuleDetailed instantiates a new RepositoryRuleDetailed and sets the default values. +func NewRepositoryRuleDetailed()(*RepositoryRuleDetailed) { + m := &RepositoryRuleDetailed{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleDetailedFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleDetailedFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleDetailed(), 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 *RepositoryRuleDetailed) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleDetailed) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *RepositoryRuleDetailed) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *RepositoryRuleDetailed) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type RepositoryRuleDetailedable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_enforcement.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_enforcement.go new file mode 100644 index 000000000..c3c885674 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_enforcement.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). +type RepositoryRuleEnforcement int + +const ( + DISABLED_REPOSITORYRULEENFORCEMENT RepositoryRuleEnforcement = iota + ACTIVE_REPOSITORYRULEENFORCEMENT + EVALUATE_REPOSITORYRULEENFORCEMENT +) + +func (i RepositoryRuleEnforcement) String() string { + return []string{"disabled", "active", "evaluate"}[i] +} +func ParseRepositoryRuleEnforcement(v string) (any, error) { + result := DISABLED_REPOSITORYRULEENFORCEMENT + switch v { + case "disabled": + result = DISABLED_REPOSITORYRULEENFORCEMENT + case "active": + result = ACTIVE_REPOSITORYRULEENFORCEMENT + case "evaluate": + result = EVALUATE_REPOSITORYRULEENFORCEMENT + default: + return 0, errors.New("Unknown RepositoryRuleEnforcement value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleEnforcement(values []RepositoryRuleEnforcement) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleEnforcement) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member1.go new file mode 100644 index 000000000..4977bf226 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member1.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleMember1 note: file_path_restriction is in beta and subject to change.Prevent commits that include changes in specified file paths from being pushed to the commit graph. +type RepositoryRuleMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters RepositoryRuleMember1_parametersable + // The type property + typeEscaped *RepositoryRuleMember1_type +} +// NewRepositoryRuleMember1 instantiates a new RepositoryRuleMember1 and sets the default values. +func NewRepositoryRuleMember1()(*RepositoryRuleMember1) { + m := &RepositoryRuleMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleMember1(), 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 *RepositoryRuleMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleMember1_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleMember1_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleMember1_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleMember1_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleMember1_parametersable when successful +func (m *RepositoryRuleMember1) GetParameters()(RepositoryRuleMember1_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleMember1_type when successful +func (m *RepositoryRuleMember1) GetTypeEscaped()(*RepositoryRuleMember1_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleMember1) SetParameters(value RepositoryRuleMember1_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleMember1) SetTypeEscaped(value *RepositoryRuleMember1_type)() { + m.typeEscaped = value +} +type RepositoryRuleMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleMember1_parametersable) + GetTypeEscaped()(*RepositoryRuleMember1_type) + SetParameters(value RepositoryRuleMember1_parametersable)() + SetTypeEscaped(value *RepositoryRuleMember1_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member1_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member1_parameters.go new file mode 100644 index 000000000..c65c28d8d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member1_parameters.go @@ -0,0 +1,86 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleMember1_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The file paths that are restricted from being pushed to the commit graph. + restricted_file_paths []string +} +// NewRepositoryRuleMember1_parameters instantiates a new RepositoryRuleMember1_parameters and sets the default values. +func NewRepositoryRuleMember1_parameters()(*RepositoryRuleMember1_parameters) { + m := &RepositoryRuleMember1_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleMember1_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleMember1_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleMember1_parameters(), 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 *RepositoryRuleMember1_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleMember1_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["restricted_file_paths"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRestrictedFilePaths(res) + } + return nil + } + return res +} +// GetRestrictedFilePaths gets the restricted_file_paths property value. The file paths that are restricted from being pushed to the commit graph. +// returns a []string when successful +func (m *RepositoryRuleMember1_parameters) GetRestrictedFilePaths()([]string) { + return m.restricted_file_paths +} +// Serialize serializes information the current object +func (m *RepositoryRuleMember1_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRestrictedFilePaths() != nil { + err := writer.WriteCollectionOfStringValues("restricted_file_paths", m.GetRestrictedFilePaths()) + 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 *RepositoryRuleMember1_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRestrictedFilePaths sets the restricted_file_paths property value. The file paths that are restricted from being pushed to the commit graph. +func (m *RepositoryRuleMember1_parameters) SetRestrictedFilePaths(value []string)() { + m.restricted_file_paths = value +} +type RepositoryRuleMember1_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRestrictedFilePaths()([]string) + SetRestrictedFilePaths(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member1_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member1_type.go new file mode 100644 index 000000000..039bd412d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member1_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleMember1_type int + +const ( + FILE_PATH_RESTRICTION_REPOSITORYRULEMEMBER1_TYPE RepositoryRuleMember1_type = iota +) + +func (i RepositoryRuleMember1_type) String() string { + return []string{"file_path_restriction"}[i] +} +func ParseRepositoryRuleMember1_type(v string) (any, error) { + result := FILE_PATH_RESTRICTION_REPOSITORYRULEMEMBER1_TYPE + switch v { + case "file_path_restriction": + result = FILE_PATH_RESTRICTION_REPOSITORYRULEMEMBER1_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleMember1_type(values []RepositoryRuleMember1_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleMember1_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member2.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member2.go new file mode 100644 index 000000000..111eaa5c8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member2.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleMember2 note: max_file_path_length is in beta and subject to change.Prevent commits that include file paths that exceed a specified character limit from being pushed to the commit graph. +type RepositoryRuleMember2 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters RepositoryRuleMember2_parametersable + // The type property + typeEscaped *RepositoryRuleMember2_type +} +// NewRepositoryRuleMember2 instantiates a new RepositoryRuleMember2 and sets the default values. +func NewRepositoryRuleMember2()(*RepositoryRuleMember2) { + m := &RepositoryRuleMember2{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleMember2FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleMember2FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleMember2(), 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 *RepositoryRuleMember2) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleMember2) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleMember2_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleMember2_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleMember2_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleMember2_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleMember2_parametersable when successful +func (m *RepositoryRuleMember2) GetParameters()(RepositoryRuleMember2_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleMember2_type when successful +func (m *RepositoryRuleMember2) GetTypeEscaped()(*RepositoryRuleMember2_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleMember2) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleMember2) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleMember2) SetParameters(value RepositoryRuleMember2_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleMember2) SetTypeEscaped(value *RepositoryRuleMember2_type)() { + m.typeEscaped = value +} +type RepositoryRuleMember2able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleMember2_parametersable) + GetTypeEscaped()(*RepositoryRuleMember2_type) + SetParameters(value RepositoryRuleMember2_parametersable)() + SetTypeEscaped(value *RepositoryRuleMember2_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member2_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member2_parameters.go new file mode 100644 index 000000000..5eb04c8d6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member2_parameters.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleMember2_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The maximum amount of characters allowed in file paths + max_file_path_length *int32 +} +// NewRepositoryRuleMember2_parameters instantiates a new RepositoryRuleMember2_parameters and sets the default values. +func NewRepositoryRuleMember2_parameters()(*RepositoryRuleMember2_parameters) { + m := &RepositoryRuleMember2_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleMember2_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleMember2_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleMember2_parameters(), 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 *RepositoryRuleMember2_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleMember2_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["max_file_path_length"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMaxFilePathLength(val) + } + return nil + } + return res +} +// GetMaxFilePathLength gets the max_file_path_length property value. The maximum amount of characters allowed in file paths +// returns a *int32 when successful +func (m *RepositoryRuleMember2_parameters) GetMaxFilePathLength()(*int32) { + return m.max_file_path_length +} +// Serialize serializes information the current object +func (m *RepositoryRuleMember2_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("max_file_path_length", m.GetMaxFilePathLength()) + 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 *RepositoryRuleMember2_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMaxFilePathLength sets the max_file_path_length property value. The maximum amount of characters allowed in file paths +func (m *RepositoryRuleMember2_parameters) SetMaxFilePathLength(value *int32)() { + m.max_file_path_length = value +} +type RepositoryRuleMember2_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMaxFilePathLength()(*int32) + SetMaxFilePathLength(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member2_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member2_type.go new file mode 100644 index 000000000..5d7aa03f8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member2_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleMember2_type int + +const ( + MAX_FILE_PATH_LENGTH_REPOSITORYRULEMEMBER2_TYPE RepositoryRuleMember2_type = iota +) + +func (i RepositoryRuleMember2_type) String() string { + return []string{"max_file_path_length"}[i] +} +func ParseRepositoryRuleMember2_type(v string) (any, error) { + result := MAX_FILE_PATH_LENGTH_REPOSITORYRULEMEMBER2_TYPE + switch v { + case "max_file_path_length": + result = MAX_FILE_PATH_LENGTH_REPOSITORYRULEMEMBER2_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleMember2_type(values []RepositoryRuleMember2_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleMember2_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member3.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member3.go new file mode 100644 index 000000000..f6405b2ac --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member3.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleMember3 note: file_extension_restriction is in beta and subject to change.Prevent commits that include files with specified file extensions from being pushed to the commit graph. +type RepositoryRuleMember3 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters RepositoryRuleMember3_parametersable + // The type property + typeEscaped *RepositoryRuleMember3_type +} +// NewRepositoryRuleMember3 instantiates a new RepositoryRuleMember3 and sets the default values. +func NewRepositoryRuleMember3()(*RepositoryRuleMember3) { + m := &RepositoryRuleMember3{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleMember3FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleMember3FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleMember3(), 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 *RepositoryRuleMember3) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleMember3) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleMember3_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleMember3_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleMember3_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleMember3_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleMember3_parametersable when successful +func (m *RepositoryRuleMember3) GetParameters()(RepositoryRuleMember3_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleMember3_type when successful +func (m *RepositoryRuleMember3) GetTypeEscaped()(*RepositoryRuleMember3_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleMember3) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleMember3) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleMember3) SetParameters(value RepositoryRuleMember3_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleMember3) SetTypeEscaped(value *RepositoryRuleMember3_type)() { + m.typeEscaped = value +} +type RepositoryRuleMember3able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleMember3_parametersable) + GetTypeEscaped()(*RepositoryRuleMember3_type) + SetParameters(value RepositoryRuleMember3_parametersable)() + SetTypeEscaped(value *RepositoryRuleMember3_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member3_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member3_parameters.go new file mode 100644 index 000000000..79ff508b0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member3_parameters.go @@ -0,0 +1,86 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleMember3_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The file extensions that are restricted from being pushed to the commit graph. + restricted_file_extensions []string +} +// NewRepositoryRuleMember3_parameters instantiates a new RepositoryRuleMember3_parameters and sets the default values. +func NewRepositoryRuleMember3_parameters()(*RepositoryRuleMember3_parameters) { + m := &RepositoryRuleMember3_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleMember3_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleMember3_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleMember3_parameters(), 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 *RepositoryRuleMember3_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleMember3_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["restricted_file_extensions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRestrictedFileExtensions(res) + } + return nil + } + return res +} +// GetRestrictedFileExtensions gets the restricted_file_extensions property value. The file extensions that are restricted from being pushed to the commit graph. +// returns a []string when successful +func (m *RepositoryRuleMember3_parameters) GetRestrictedFileExtensions()([]string) { + return m.restricted_file_extensions +} +// Serialize serializes information the current object +func (m *RepositoryRuleMember3_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRestrictedFileExtensions() != nil { + err := writer.WriteCollectionOfStringValues("restricted_file_extensions", m.GetRestrictedFileExtensions()) + 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 *RepositoryRuleMember3_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRestrictedFileExtensions sets the restricted_file_extensions property value. The file extensions that are restricted from being pushed to the commit graph. +func (m *RepositoryRuleMember3_parameters) SetRestrictedFileExtensions(value []string)() { + m.restricted_file_extensions = value +} +type RepositoryRuleMember3_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRestrictedFileExtensions()([]string) + SetRestrictedFileExtensions(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member3_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member3_type.go new file mode 100644 index 000000000..bc575cc37 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member3_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleMember3_type int + +const ( + FILE_EXTENSION_RESTRICTION_REPOSITORYRULEMEMBER3_TYPE RepositoryRuleMember3_type = iota +) + +func (i RepositoryRuleMember3_type) String() string { + return []string{"file_extension_restriction"}[i] +} +func ParseRepositoryRuleMember3_type(v string) (any, error) { + result := FILE_EXTENSION_RESTRICTION_REPOSITORYRULEMEMBER3_TYPE + switch v { + case "file_extension_restriction": + result = FILE_EXTENSION_RESTRICTION_REPOSITORYRULEMEMBER3_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleMember3_type(values []RepositoryRuleMember3_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleMember3_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member4.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member4.go new file mode 100644 index 000000000..4f3a79222 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member4.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleMember4 note: max_file_size is in beta and subject to change.Prevent commits that exceed a specified file size limit from being pushed to the commit. +type RepositoryRuleMember4 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters RepositoryRuleMember4_parametersable + // The type property + typeEscaped *RepositoryRuleMember4_type +} +// NewRepositoryRuleMember4 instantiates a new RepositoryRuleMember4 and sets the default values. +func NewRepositoryRuleMember4()(*RepositoryRuleMember4) { + m := &RepositoryRuleMember4{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleMember4FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleMember4FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleMember4(), 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 *RepositoryRuleMember4) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleMember4) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleMember4_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleMember4_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleMember4_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleMember4_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleMember4_parametersable when successful +func (m *RepositoryRuleMember4) GetParameters()(RepositoryRuleMember4_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleMember4_type when successful +func (m *RepositoryRuleMember4) GetTypeEscaped()(*RepositoryRuleMember4_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleMember4) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleMember4) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleMember4) SetParameters(value RepositoryRuleMember4_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleMember4) SetTypeEscaped(value *RepositoryRuleMember4_type)() { + m.typeEscaped = value +} +type RepositoryRuleMember4able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleMember4_parametersable) + GetTypeEscaped()(*RepositoryRuleMember4_type) + SetParameters(value RepositoryRuleMember4_parametersable)() + SetTypeEscaped(value *RepositoryRuleMember4_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member4_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member4_parameters.go new file mode 100644 index 000000000..d61d97e9b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member4_parameters.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleMember4_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The maximum file size allowed in megabytes. This limit does not apply to Git Large File Storage (Git LFS). + max_file_size *int32 +} +// NewRepositoryRuleMember4_parameters instantiates a new RepositoryRuleMember4_parameters and sets the default values. +func NewRepositoryRuleMember4_parameters()(*RepositoryRuleMember4_parameters) { + m := &RepositoryRuleMember4_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleMember4_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleMember4_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleMember4_parameters(), 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 *RepositoryRuleMember4_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleMember4_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["max_file_size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMaxFileSize(val) + } + return nil + } + return res +} +// GetMaxFileSize gets the max_file_size property value. The maximum file size allowed in megabytes. This limit does not apply to Git Large File Storage (Git LFS). +// returns a *int32 when successful +func (m *RepositoryRuleMember4_parameters) GetMaxFileSize()(*int32) { + return m.max_file_size +} +// Serialize serializes information the current object +func (m *RepositoryRuleMember4_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("max_file_size", m.GetMaxFileSize()) + 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 *RepositoryRuleMember4_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMaxFileSize sets the max_file_size property value. The maximum file size allowed in megabytes. This limit does not apply to Git Large File Storage (Git LFS). +func (m *RepositoryRuleMember4_parameters) SetMaxFileSize(value *int32)() { + m.max_file_size = value +} +type RepositoryRuleMember4_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMaxFileSize()(*int32) + SetMaxFileSize(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member4_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member4_type.go new file mode 100644 index 000000000..54d4b5297 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_member4_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleMember4_type int + +const ( + MAX_FILE_SIZE_REPOSITORYRULEMEMBER4_TYPE RepositoryRuleMember4_type = iota +) + +func (i RepositoryRuleMember4_type) String() string { + return []string{"max_file_size"}[i] +} +func ParseRepositoryRuleMember4_type(v string) (any, error) { + result := MAX_FILE_SIZE_REPOSITORYRULEMEMBER4_TYPE + switch v { + case "max_file_size": + result = MAX_FILE_SIZE_REPOSITORYRULEMEMBER4_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleMember4_type(values []RepositoryRuleMember4_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleMember4_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_non_fast_forward.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_non_fast_forward.go new file mode 100644 index 000000000..ca1a992c6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_non_fast_forward.go @@ -0,0 +1,82 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleNonFastForward prevent users with push access from force pushing to refs. +type RepositoryRuleNonFastForward struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The type property + typeEscaped *RepositoryRuleNonFastForward_type +} +// NewRepositoryRuleNonFastForward instantiates a new RepositoryRuleNonFastForward and sets the default values. +func NewRepositoryRuleNonFastForward()(*RepositoryRuleNonFastForward) { + m := &RepositoryRuleNonFastForward{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleNonFastForwardFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleNonFastForwardFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleNonFastForward(), 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 *RepositoryRuleNonFastForward) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleNonFastForward) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleNonFastForward_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleNonFastForward_type)) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleNonFastForward_type when successful +func (m *RepositoryRuleNonFastForward) GetTypeEscaped()(*RepositoryRuleNonFastForward_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleNonFastForward) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleNonFastForward) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleNonFastForward) SetTypeEscaped(value *RepositoryRuleNonFastForward_type)() { + m.typeEscaped = value +} +type RepositoryRuleNonFastForwardable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTypeEscaped()(*RepositoryRuleNonFastForward_type) + SetTypeEscaped(value *RepositoryRuleNonFastForward_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_non_fast_forward_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_non_fast_forward_type.go new file mode 100644 index 000000000..5a1b21a0b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_non_fast_forward_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type RepositoryRuleNonFastForward_type int + +const ( + NON_FAST_FORWARD_REPOSITORYRULENONFASTFORWARD_TYPE RepositoryRuleNonFastForward_type = iota +) + +func (i RepositoryRuleNonFastForward_type) String() string { + return []string{"non_fast_forward"}[i] +} +func ParseRepositoryRuleNonFastForward_type(v string) (any, error) { + result := NON_FAST_FORWARD_REPOSITORYRULENONFASTFORWARD_TYPE + switch v { + case "non_fast_forward": + result = NON_FAST_FORWARD_REPOSITORYRULENONFASTFORWARD_TYPE + default: + return 0, errors.New("Unknown RepositoryRuleNonFastForward_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleNonFastForward_type(values []RepositoryRuleNonFastForward_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleNonFastForward_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_params_code_scanning_tool.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_params_code_scanning_tool.go new file mode 100644 index 000000000..e22d8d283 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_params_code_scanning_tool.go @@ -0,0 +1,141 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleParamsCodeScanningTool a tool that must provide code scanning results for this rule to pass. +type RepositoryRuleParamsCodeScanningTool struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." + alerts_threshold *RepositoryRuleParamsCodeScanningTool_alerts_threshold + // The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." + security_alerts_threshold *RepositoryRuleParamsCodeScanningTool_security_alerts_threshold + // The name of a code scanning tool + tool *string +} +// NewRepositoryRuleParamsCodeScanningTool instantiates a new RepositoryRuleParamsCodeScanningTool and sets the default values. +func NewRepositoryRuleParamsCodeScanningTool()(*RepositoryRuleParamsCodeScanningTool) { + m := &RepositoryRuleParamsCodeScanningTool{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleParamsCodeScanningToolFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleParamsCodeScanningToolFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleParamsCodeScanningTool(), 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 *RepositoryRuleParamsCodeScanningTool) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAlertsThreshold gets the alerts_threshold property value. The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." +// returns a *RepositoryRuleParamsCodeScanningTool_alerts_threshold when successful +func (m *RepositoryRuleParamsCodeScanningTool) GetAlertsThreshold()(*RepositoryRuleParamsCodeScanningTool_alerts_threshold) { + return m.alerts_threshold +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleParamsCodeScanningTool) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["alerts_threshold"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleParamsCodeScanningTool_alerts_threshold) + if err != nil { + return err + } + if val != nil { + m.SetAlertsThreshold(val.(*RepositoryRuleParamsCodeScanningTool_alerts_threshold)) + } + return nil + } + res["security_alerts_threshold"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleParamsCodeScanningTool_security_alerts_threshold) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAlertsThreshold(val.(*RepositoryRuleParamsCodeScanningTool_security_alerts_threshold)) + } + return nil + } + res["tool"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTool(val) + } + return nil + } + return res +} +// GetSecurityAlertsThreshold gets the security_alerts_threshold property value. The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." +// returns a *RepositoryRuleParamsCodeScanningTool_security_alerts_threshold when successful +func (m *RepositoryRuleParamsCodeScanningTool) GetSecurityAlertsThreshold()(*RepositoryRuleParamsCodeScanningTool_security_alerts_threshold) { + return m.security_alerts_threshold +} +// GetTool gets the tool property value. The name of a code scanning tool +// returns a *string when successful +func (m *RepositoryRuleParamsCodeScanningTool) GetTool()(*string) { + return m.tool +} +// Serialize serializes information the current object +func (m *RepositoryRuleParamsCodeScanningTool) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAlertsThreshold() != nil { + cast := (*m.GetAlertsThreshold()).String() + err := writer.WriteStringValue("alerts_threshold", &cast) + if err != nil { + return err + } + } + if m.GetSecurityAlertsThreshold() != nil { + cast := (*m.GetSecurityAlertsThreshold()).String() + err := writer.WriteStringValue("security_alerts_threshold", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tool", m.GetTool()) + 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 *RepositoryRuleParamsCodeScanningTool) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAlertsThreshold sets the alerts_threshold property value. The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." +func (m *RepositoryRuleParamsCodeScanningTool) SetAlertsThreshold(value *RepositoryRuleParamsCodeScanningTool_alerts_threshold)() { + m.alerts_threshold = value +} +// SetSecurityAlertsThreshold sets the security_alerts_threshold property value. The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." +func (m *RepositoryRuleParamsCodeScanningTool) SetSecurityAlertsThreshold(value *RepositoryRuleParamsCodeScanningTool_security_alerts_threshold)() { + m.security_alerts_threshold = value +} +// SetTool sets the tool property value. The name of a code scanning tool +func (m *RepositoryRuleParamsCodeScanningTool) SetTool(value *string)() { + m.tool = value +} +type RepositoryRuleParamsCodeScanningToolable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAlertsThreshold()(*RepositoryRuleParamsCodeScanningTool_alerts_threshold) + GetSecurityAlertsThreshold()(*RepositoryRuleParamsCodeScanningTool_security_alerts_threshold) + GetTool()(*string) + SetAlertsThreshold(value *RepositoryRuleParamsCodeScanningTool_alerts_threshold)() + SetSecurityAlertsThreshold(value *RepositoryRuleParamsCodeScanningTool_security_alerts_threshold)() + SetTool(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_params_code_scanning_tool_alerts_threshold.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_params_code_scanning_tool_alerts_threshold.go new file mode 100644 index 000000000..58efbb9ba --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_params_code_scanning_tool_alerts_threshold.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." +type RepositoryRuleParamsCodeScanningTool_alerts_threshold int + +const ( + NONE_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD RepositoryRuleParamsCodeScanningTool_alerts_threshold = iota + ERRORS_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD + ERRORS_AND_WARNINGS_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD + ALL_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD +) + +func (i RepositoryRuleParamsCodeScanningTool_alerts_threshold) String() string { + return []string{"none", "errors", "errors_and_warnings", "all"}[i] +} +func ParseRepositoryRuleParamsCodeScanningTool_alerts_threshold(v string) (any, error) { + result := NONE_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD + switch v { + case "none": + result = NONE_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD + case "errors": + result = ERRORS_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD + case "errors_and_warnings": + result = ERRORS_AND_WARNINGS_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD + case "all": + result = ALL_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD + default: + return 0, errors.New("Unknown RepositoryRuleParamsCodeScanningTool_alerts_threshold value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleParamsCodeScanningTool_alerts_threshold(values []RepositoryRuleParamsCodeScanningTool_alerts_threshold) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleParamsCodeScanningTool_alerts_threshold) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_params_code_scanning_tool_security_alerts_threshold.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_params_code_scanning_tool_security_alerts_threshold.go new file mode 100644 index 000000000..5611aa627 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_params_code_scanning_tool_security_alerts_threshold.go @@ -0,0 +1,46 @@ +package models +import ( + "errors" +) +// The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." +type RepositoryRuleParamsCodeScanningTool_security_alerts_threshold int + +const ( + NONE_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD RepositoryRuleParamsCodeScanningTool_security_alerts_threshold = iota + CRITICAL_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + HIGH_OR_HIGHER_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + MEDIUM_OR_HIGHER_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + ALL_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD +) + +func (i RepositoryRuleParamsCodeScanningTool_security_alerts_threshold) String() string { + return []string{"none", "critical", "high_or_higher", "medium_or_higher", "all"}[i] +} +func ParseRepositoryRuleParamsCodeScanningTool_security_alerts_threshold(v string) (any, error) { + result := NONE_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + switch v { + case "none": + result = NONE_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + case "critical": + result = CRITICAL_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + case "high_or_higher": + result = HIGH_OR_HIGHER_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + case "medium_or_higher": + result = MEDIUM_OR_HIGHER_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + case "all": + result = ALL_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + default: + return 0, errors.New("Unknown RepositoryRuleParamsCodeScanningTool_security_alerts_threshold value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleParamsCodeScanningTool_security_alerts_threshold(values []RepositoryRuleParamsCodeScanningTool_security_alerts_threshold) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleParamsCodeScanningTool_security_alerts_threshold) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_params_status_check_configuration.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_params_status_check_configuration.go new file mode 100644 index 000000000..06a851d55 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_params_status_check_configuration.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleParamsStatusCheckConfiguration required status check +type RepositoryRuleParamsStatusCheckConfiguration struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The status check context name that must be present on the commit. + context *string + // The optional integration ID that this status check must originate from. + integration_id *int32 +} +// NewRepositoryRuleParamsStatusCheckConfiguration instantiates a new RepositoryRuleParamsStatusCheckConfiguration and sets the default values. +func NewRepositoryRuleParamsStatusCheckConfiguration()(*RepositoryRuleParamsStatusCheckConfiguration) { + m := &RepositoryRuleParamsStatusCheckConfiguration{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleParamsStatusCheckConfigurationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleParamsStatusCheckConfigurationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleParamsStatusCheckConfiguration(), 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 *RepositoryRuleParamsStatusCheckConfiguration) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContext gets the context property value. The status check context name that must be present on the commit. +// returns a *string when successful +func (m *RepositoryRuleParamsStatusCheckConfiguration) GetContext()(*string) { + return m.context +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleParamsStatusCheckConfiguration) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + return nil + } + res["integration_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetIntegrationId(val) + } + return nil + } + return res +} +// GetIntegrationId gets the integration_id property value. The optional integration ID that this status check must originate from. +// returns a *int32 when successful +func (m *RepositoryRuleParamsStatusCheckConfiguration) GetIntegrationId()(*int32) { + return m.integration_id +} +// Serialize serializes information the current object +func (m *RepositoryRuleParamsStatusCheckConfiguration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("context", m.GetContext()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("integration_id", m.GetIntegrationId()) + 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 *RepositoryRuleParamsStatusCheckConfiguration) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContext sets the context property value. The status check context name that must be present on the commit. +func (m *RepositoryRuleParamsStatusCheckConfiguration) SetContext(value *string)() { + m.context = value +} +// SetIntegrationId sets the integration_id property value. The optional integration ID that this status check must originate from. +func (m *RepositoryRuleParamsStatusCheckConfiguration) SetIntegrationId(value *int32)() { + m.integration_id = value +} +type RepositoryRuleParamsStatusCheckConfigurationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContext()(*string) + GetIntegrationId()(*int32) + SetContext(value *string)() + SetIntegrationId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_params_workflow_file_reference.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_params_workflow_file_reference.go new file mode 100644 index 000000000..860f40eeb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_params_workflow_file_reference.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleParamsWorkflowFileReference a workflow that must run for this rule to pass +type RepositoryRuleParamsWorkflowFileReference struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The path to the workflow file + path *string + // The ref (branch or tag) of the workflow file to use + ref *string + // The ID of the repository where the workflow is defined + repository_id *int32 + // The commit SHA of the workflow file to use + sha *string +} +// NewRepositoryRuleParamsWorkflowFileReference instantiates a new RepositoryRuleParamsWorkflowFileReference and sets the default values. +func NewRepositoryRuleParamsWorkflowFileReference()(*RepositoryRuleParamsWorkflowFileReference) { + m := &RepositoryRuleParamsWorkflowFileReference{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleParamsWorkflowFileReferenceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleParamsWorkflowFileReferenceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleParamsWorkflowFileReference(), 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 *RepositoryRuleParamsWorkflowFileReference) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleParamsWorkflowFileReference) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetPath gets the path property value. The path to the workflow file +// returns a *string when successful +func (m *RepositoryRuleParamsWorkflowFileReference) GetPath()(*string) { + return m.path +} +// GetRef gets the ref property value. The ref (branch or tag) of the workflow file to use +// returns a *string when successful +func (m *RepositoryRuleParamsWorkflowFileReference) GetRef()(*string) { + return m.ref +} +// GetRepositoryId gets the repository_id property value. The ID of the repository where the workflow is defined +// returns a *int32 when successful +func (m *RepositoryRuleParamsWorkflowFileReference) GetRepositoryId()(*int32) { + return m.repository_id +} +// GetSha gets the sha property value. The commit SHA of the workflow file to use +// returns a *string when successful +func (m *RepositoryRuleParamsWorkflowFileReference) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *RepositoryRuleParamsWorkflowFileReference) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *RepositoryRuleParamsWorkflowFileReference) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPath sets the path property value. The path to the workflow file +func (m *RepositoryRuleParamsWorkflowFileReference) SetPath(value *string)() { + m.path = value +} +// SetRef sets the ref property value. The ref (branch or tag) of the workflow file to use +func (m *RepositoryRuleParamsWorkflowFileReference) SetRef(value *string)() { + m.ref = value +} +// SetRepositoryId sets the repository_id property value. The ID of the repository where the workflow is defined +func (m *RepositoryRuleParamsWorkflowFileReference) SetRepositoryId(value *int32)() { + m.repository_id = value +} +// SetSha sets the sha property value. The commit SHA of the workflow file to use +func (m *RepositoryRuleParamsWorkflowFileReference) SetSha(value *string)() { + m.sha = value +} +type RepositoryRuleParamsWorkflowFileReferenceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPath()(*string) + GetRef()(*string) + GetRepositoryId()(*int32) + GetSha()(*string) + SetPath(value *string)() + SetRef(value *string)() + SetRepositoryId(value *int32)() + SetSha(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_pull_request.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_pull_request.go new file mode 100644 index 000000000..9c2029745 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_pull_request.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRulePullRequest require all commits be made to a non-target branch and submitted via a pull request before they can be merged. +type RepositoryRulePullRequest struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters RepositoryRulePullRequest_parametersable + // The type property + typeEscaped *RepositoryRulePullRequest_type +} +// NewRepositoryRulePullRequest instantiates a new RepositoryRulePullRequest and sets the default values. +func NewRepositoryRulePullRequest()(*RepositoryRulePullRequest) { + m := &RepositoryRulePullRequest{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRulePullRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRulePullRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRulePullRequest(), 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 *RepositoryRulePullRequest) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRulePullRequest) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRulePullRequest_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRulePullRequest_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRulePullRequest_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRulePullRequest_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRulePullRequest_parametersable when successful +func (m *RepositoryRulePullRequest) GetParameters()(RepositoryRulePullRequest_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRulePullRequest_type when successful +func (m *RepositoryRulePullRequest) GetTypeEscaped()(*RepositoryRulePullRequest_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRulePullRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRulePullRequest) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRulePullRequest) SetParameters(value RepositoryRulePullRequest_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRulePullRequest) SetTypeEscaped(value *RepositoryRulePullRequest_type)() { + m.typeEscaped = value +} +type RepositoryRulePullRequestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRulePullRequest_parametersable) + GetTypeEscaped()(*RepositoryRulePullRequest_type) + SetParameters(value RepositoryRulePullRequest_parametersable)() + SetTypeEscaped(value *RepositoryRulePullRequest_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_pull_request_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_pull_request_parameters.go new file mode 100644 index 000000000..97253253e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_pull_request_parameters.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRulePullRequest_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // New, reviewable commits pushed will dismiss previous pull request review approvals. + dismiss_stale_reviews_on_push *bool + // Require an approving review in pull requests that modify files that have a designated code owner. + require_code_owner_review *bool + // Whether the most recent reviewable push must be approved by someone other than the person who pushed it. + require_last_push_approval *bool + // The number of approving reviews that are required before a pull request can be merged. + required_approving_review_count *int32 + // All conversations on code must be resolved before a pull request can be merged. + required_review_thread_resolution *bool +} +// NewRepositoryRulePullRequest_parameters instantiates a new RepositoryRulePullRequest_parameters and sets the default values. +func NewRepositoryRulePullRequest_parameters()(*RepositoryRulePullRequest_parameters) { + m := &RepositoryRulePullRequest_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRulePullRequest_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRulePullRequest_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRulePullRequest_parameters(), 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 *RepositoryRulePullRequest_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDismissStaleReviewsOnPush gets the dismiss_stale_reviews_on_push property value. New, reviewable commits pushed will dismiss previous pull request review approvals. +// returns a *bool when successful +func (m *RepositoryRulePullRequest_parameters) GetDismissStaleReviewsOnPush()(*bool) { + return m.dismiss_stale_reviews_on_push +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRulePullRequest_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["dismiss_stale_reviews_on_push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissStaleReviewsOnPush(val) + } + return nil + } + res["require_code_owner_review"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireCodeOwnerReview(val) + } + return nil + } + res["require_last_push_approval"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireLastPushApproval(val) + } + return nil + } + res["required_approving_review_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRequiredApprovingReviewCount(val) + } + return nil + } + res["required_review_thread_resolution"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequiredReviewThreadResolution(val) + } + return nil + } + return res +} +// GetRequireCodeOwnerReview gets the require_code_owner_review property value. Require an approving review in pull requests that modify files that have a designated code owner. +// returns a *bool when successful +func (m *RepositoryRulePullRequest_parameters) GetRequireCodeOwnerReview()(*bool) { + return m.require_code_owner_review +} +// GetRequiredApprovingReviewCount gets the required_approving_review_count property value. The number of approving reviews that are required before a pull request can be merged. +// returns a *int32 when successful +func (m *RepositoryRulePullRequest_parameters) GetRequiredApprovingReviewCount()(*int32) { + return m.required_approving_review_count +} +// GetRequiredReviewThreadResolution gets the required_review_thread_resolution property value. All conversations on code must be resolved before a pull request can be merged. +// returns a *bool when successful +func (m *RepositoryRulePullRequest_parameters) GetRequiredReviewThreadResolution()(*bool) { + return m.required_review_thread_resolution +} +// GetRequireLastPushApproval gets the require_last_push_approval property value. Whether the most recent reviewable push must be approved by someone other than the person who pushed it. +// returns a *bool when successful +func (m *RepositoryRulePullRequest_parameters) GetRequireLastPushApproval()(*bool) { + return m.require_last_push_approval +} +// Serialize serializes information the current object +func (m *RepositoryRulePullRequest_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("dismiss_stale_reviews_on_push", m.GetDismissStaleReviewsOnPush()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("required_approving_review_count", m.GetRequiredApprovingReviewCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("required_review_thread_resolution", m.GetRequiredReviewThreadResolution()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_code_owner_review", m.GetRequireCodeOwnerReview()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_last_push_approval", m.GetRequireLastPushApproval()) + 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 *RepositoryRulePullRequest_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDismissStaleReviewsOnPush sets the dismiss_stale_reviews_on_push property value. New, reviewable commits pushed will dismiss previous pull request review approvals. +func (m *RepositoryRulePullRequest_parameters) SetDismissStaleReviewsOnPush(value *bool)() { + m.dismiss_stale_reviews_on_push = value +} +// SetRequireCodeOwnerReview sets the require_code_owner_review property value. Require an approving review in pull requests that modify files that have a designated code owner. +func (m *RepositoryRulePullRequest_parameters) SetRequireCodeOwnerReview(value *bool)() { + m.require_code_owner_review = value +} +// SetRequiredApprovingReviewCount sets the required_approving_review_count property value. The number of approving reviews that are required before a pull request can be merged. +func (m *RepositoryRulePullRequest_parameters) SetRequiredApprovingReviewCount(value *int32)() { + m.required_approving_review_count = value +} +// SetRequiredReviewThreadResolution sets the required_review_thread_resolution property value. All conversations on code must be resolved before a pull request can be merged. +func (m *RepositoryRulePullRequest_parameters) SetRequiredReviewThreadResolution(value *bool)() { + m.required_review_thread_resolution = value +} +// SetRequireLastPushApproval sets the require_last_push_approval property value. Whether the most recent reviewable push must be approved by someone other than the person who pushed it. +func (m *RepositoryRulePullRequest_parameters) SetRequireLastPushApproval(value *bool)() { + m.require_last_push_approval = value +} +type RepositoryRulePullRequest_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDismissStaleReviewsOnPush()(*bool) + GetRequireCodeOwnerReview()(*bool) + GetRequiredApprovingReviewCount()(*int32) + GetRequiredReviewThreadResolution()(*bool) + GetRequireLastPushApproval()(*bool) + SetDismissStaleReviewsOnPush(value *bool)() + SetRequireCodeOwnerReview(value *bool)() + SetRequiredApprovingReviewCount(value *int32)() + SetRequiredReviewThreadResolution(value *bool)() + SetRequireLastPushApproval(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_pull_request_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_pull_request_type.go new file mode 100644 index 000000000..976be58c1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_pull_request_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type RepositoryRulePullRequest_type int + +const ( + PULL_REQUEST_REPOSITORYRULEPULLREQUEST_TYPE RepositoryRulePullRequest_type = iota +) + +func (i RepositoryRulePullRequest_type) String() string { + return []string{"pull_request"}[i] +} +func ParseRepositoryRulePullRequest_type(v string) (any, error) { + result := PULL_REQUEST_REPOSITORYRULEPULLREQUEST_TYPE + switch v { + case "pull_request": + result = PULL_REQUEST_REPOSITORYRULEPULLREQUEST_TYPE + default: + return 0, errors.New("Unknown RepositoryRulePullRequest_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRulePullRequest_type(values []RepositoryRulePullRequest_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRulePullRequest_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_deployments.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_deployments.go new file mode 100644 index 000000000..63d62d96e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_deployments.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleRequiredDeployments choose which environments must be successfully deployed to before refs can be pushed into a ref that matches this rule. +type RepositoryRuleRequiredDeployments struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters RepositoryRuleRequiredDeployments_parametersable + // The type property + typeEscaped *RepositoryRuleRequiredDeployments_type +} +// NewRepositoryRuleRequiredDeployments instantiates a new RepositoryRuleRequiredDeployments and sets the default values. +func NewRepositoryRuleRequiredDeployments()(*RepositoryRuleRequiredDeployments) { + m := &RepositoryRuleRequiredDeployments{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleRequiredDeploymentsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleRequiredDeploymentsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleRequiredDeployments(), 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 *RepositoryRuleRequiredDeployments) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleRequiredDeployments) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleRequiredDeployments_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleRequiredDeployments_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleRequiredDeployments_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleRequiredDeployments_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleRequiredDeployments_parametersable when successful +func (m *RepositoryRuleRequiredDeployments) GetParameters()(RepositoryRuleRequiredDeployments_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleRequiredDeployments_type when successful +func (m *RepositoryRuleRequiredDeployments) GetTypeEscaped()(*RepositoryRuleRequiredDeployments_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleRequiredDeployments) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleRequiredDeployments) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleRequiredDeployments) SetParameters(value RepositoryRuleRequiredDeployments_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleRequiredDeployments) SetTypeEscaped(value *RepositoryRuleRequiredDeployments_type)() { + m.typeEscaped = value +} +type RepositoryRuleRequiredDeploymentsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleRequiredDeployments_parametersable) + GetTypeEscaped()(*RepositoryRuleRequiredDeployments_type) + SetParameters(value RepositoryRuleRequiredDeployments_parametersable)() + SetTypeEscaped(value *RepositoryRuleRequiredDeployments_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_deployments_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_deployments_parameters.go new file mode 100644 index 000000000..956dd9a13 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_deployments_parameters.go @@ -0,0 +1,86 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleRequiredDeployments_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The environments that must be successfully deployed to before branches can be merged. + required_deployment_environments []string +} +// NewRepositoryRuleRequiredDeployments_parameters instantiates a new RepositoryRuleRequiredDeployments_parameters and sets the default values. +func NewRepositoryRuleRequiredDeployments_parameters()(*RepositoryRuleRequiredDeployments_parameters) { + m := &RepositoryRuleRequiredDeployments_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleRequiredDeployments_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleRequiredDeployments_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleRequiredDeployments_parameters(), 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 *RepositoryRuleRequiredDeployments_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleRequiredDeployments_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["required_deployment_environments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRequiredDeploymentEnvironments(res) + } + return nil + } + return res +} +// GetRequiredDeploymentEnvironments gets the required_deployment_environments property value. The environments that must be successfully deployed to before branches can be merged. +// returns a []string when successful +func (m *RepositoryRuleRequiredDeployments_parameters) GetRequiredDeploymentEnvironments()([]string) { + return m.required_deployment_environments +} +// Serialize serializes information the current object +func (m *RepositoryRuleRequiredDeployments_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRequiredDeploymentEnvironments() != nil { + err := writer.WriteCollectionOfStringValues("required_deployment_environments", m.GetRequiredDeploymentEnvironments()) + 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 *RepositoryRuleRequiredDeployments_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRequiredDeploymentEnvironments sets the required_deployment_environments property value. The environments that must be successfully deployed to before branches can be merged. +func (m *RepositoryRuleRequiredDeployments_parameters) SetRequiredDeploymentEnvironments(value []string)() { + m.required_deployment_environments = value +} +type RepositoryRuleRequiredDeployments_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRequiredDeploymentEnvironments()([]string) + SetRequiredDeploymentEnvironments(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_deployments_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_deployments_type.go new file mode 100644 index 000000000..cafa5e921 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_deployments_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type RepositoryRuleRequiredDeployments_type int + +const ( + REQUIRED_DEPLOYMENTS_REPOSITORYRULEREQUIREDDEPLOYMENTS_TYPE RepositoryRuleRequiredDeployments_type = iota +) + +func (i RepositoryRuleRequiredDeployments_type) String() string { + return []string{"required_deployments"}[i] +} +func ParseRepositoryRuleRequiredDeployments_type(v string) (any, error) { + result := REQUIRED_DEPLOYMENTS_REPOSITORYRULEREQUIREDDEPLOYMENTS_TYPE + switch v { + case "required_deployments": + result = REQUIRED_DEPLOYMENTS_REPOSITORYRULEREQUIREDDEPLOYMENTS_TYPE + default: + return 0, errors.New("Unknown RepositoryRuleRequiredDeployments_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleRequiredDeployments_type(values []RepositoryRuleRequiredDeployments_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleRequiredDeployments_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_linear_history.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_linear_history.go new file mode 100644 index 000000000..1e6334ade --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_linear_history.go @@ -0,0 +1,82 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleRequiredLinearHistory prevent merge commits from being pushed to matching refs. +type RepositoryRuleRequiredLinearHistory struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The type property + typeEscaped *RepositoryRuleRequiredLinearHistory_type +} +// NewRepositoryRuleRequiredLinearHistory instantiates a new RepositoryRuleRequiredLinearHistory and sets the default values. +func NewRepositoryRuleRequiredLinearHistory()(*RepositoryRuleRequiredLinearHistory) { + m := &RepositoryRuleRequiredLinearHistory{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleRequiredLinearHistoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleRequiredLinearHistoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleRequiredLinearHistory(), 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 *RepositoryRuleRequiredLinearHistory) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleRequiredLinearHistory) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleRequiredLinearHistory_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleRequiredLinearHistory_type)) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleRequiredLinearHistory_type when successful +func (m *RepositoryRuleRequiredLinearHistory) GetTypeEscaped()(*RepositoryRuleRequiredLinearHistory_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleRequiredLinearHistory) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleRequiredLinearHistory) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleRequiredLinearHistory) SetTypeEscaped(value *RepositoryRuleRequiredLinearHistory_type)() { + m.typeEscaped = value +} +type RepositoryRuleRequiredLinearHistoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTypeEscaped()(*RepositoryRuleRequiredLinearHistory_type) + SetTypeEscaped(value *RepositoryRuleRequiredLinearHistory_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_linear_history_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_linear_history_type.go new file mode 100644 index 000000000..ad62a7009 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_linear_history_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type RepositoryRuleRequiredLinearHistory_type int + +const ( + REQUIRED_LINEAR_HISTORY_REPOSITORYRULEREQUIREDLINEARHISTORY_TYPE RepositoryRuleRequiredLinearHistory_type = iota +) + +func (i RepositoryRuleRequiredLinearHistory_type) String() string { + return []string{"required_linear_history"}[i] +} +func ParseRepositoryRuleRequiredLinearHistory_type(v string) (any, error) { + result := REQUIRED_LINEAR_HISTORY_REPOSITORYRULEREQUIREDLINEARHISTORY_TYPE + switch v { + case "required_linear_history": + result = REQUIRED_LINEAR_HISTORY_REPOSITORYRULEREQUIREDLINEARHISTORY_TYPE + default: + return 0, errors.New("Unknown RepositoryRuleRequiredLinearHistory_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleRequiredLinearHistory_type(values []RepositoryRuleRequiredLinearHistory_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleRequiredLinearHistory_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_signatures.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_signatures.go new file mode 100644 index 000000000..3d0504825 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_signatures.go @@ -0,0 +1,82 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleRequiredSignatures commits pushed to matching refs must have verified signatures. +type RepositoryRuleRequiredSignatures struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The type property + typeEscaped *RepositoryRuleRequiredSignatures_type +} +// NewRepositoryRuleRequiredSignatures instantiates a new RepositoryRuleRequiredSignatures and sets the default values. +func NewRepositoryRuleRequiredSignatures()(*RepositoryRuleRequiredSignatures) { + m := &RepositoryRuleRequiredSignatures{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleRequiredSignaturesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleRequiredSignaturesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleRequiredSignatures(), 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 *RepositoryRuleRequiredSignatures) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleRequiredSignatures) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleRequiredSignatures_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleRequiredSignatures_type)) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleRequiredSignatures_type when successful +func (m *RepositoryRuleRequiredSignatures) GetTypeEscaped()(*RepositoryRuleRequiredSignatures_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleRequiredSignatures) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleRequiredSignatures) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleRequiredSignatures) SetTypeEscaped(value *RepositoryRuleRequiredSignatures_type)() { + m.typeEscaped = value +} +type RepositoryRuleRequiredSignaturesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTypeEscaped()(*RepositoryRuleRequiredSignatures_type) + SetTypeEscaped(value *RepositoryRuleRequiredSignatures_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_signatures_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_signatures_type.go new file mode 100644 index 000000000..2064b67e5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_signatures_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type RepositoryRuleRequiredSignatures_type int + +const ( + REQUIRED_SIGNATURES_REPOSITORYRULEREQUIREDSIGNATURES_TYPE RepositoryRuleRequiredSignatures_type = iota +) + +func (i RepositoryRuleRequiredSignatures_type) String() string { + return []string{"required_signatures"}[i] +} +func ParseRepositoryRuleRequiredSignatures_type(v string) (any, error) { + result := REQUIRED_SIGNATURES_REPOSITORYRULEREQUIREDSIGNATURES_TYPE + switch v { + case "required_signatures": + result = REQUIRED_SIGNATURES_REPOSITORYRULEREQUIREDSIGNATURES_TYPE + default: + return 0, errors.New("Unknown RepositoryRuleRequiredSignatures_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleRequiredSignatures_type(values []RepositoryRuleRequiredSignatures_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleRequiredSignatures_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_status_checks.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_status_checks.go new file mode 100644 index 000000000..ab4cfe703 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_status_checks.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleRequiredStatusChecks choose which status checks must pass before the ref is updated. When enabled, commits must first be pushed to another ref where the checks pass. +type RepositoryRuleRequiredStatusChecks struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters RepositoryRuleRequiredStatusChecks_parametersable + // The type property + typeEscaped *RepositoryRuleRequiredStatusChecks_type +} +// NewRepositoryRuleRequiredStatusChecks instantiates a new RepositoryRuleRequiredStatusChecks and sets the default values. +func NewRepositoryRuleRequiredStatusChecks()(*RepositoryRuleRequiredStatusChecks) { + m := &RepositoryRuleRequiredStatusChecks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleRequiredStatusChecksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleRequiredStatusChecksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleRequiredStatusChecks(), 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 *RepositoryRuleRequiredStatusChecks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleRequiredStatusChecks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleRequiredStatusChecks_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleRequiredStatusChecks_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleRequiredStatusChecks_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleRequiredStatusChecks_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleRequiredStatusChecks_parametersable when successful +func (m *RepositoryRuleRequiredStatusChecks) GetParameters()(RepositoryRuleRequiredStatusChecks_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleRequiredStatusChecks_type when successful +func (m *RepositoryRuleRequiredStatusChecks) GetTypeEscaped()(*RepositoryRuleRequiredStatusChecks_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleRequiredStatusChecks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleRequiredStatusChecks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleRequiredStatusChecks) SetParameters(value RepositoryRuleRequiredStatusChecks_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleRequiredStatusChecks) SetTypeEscaped(value *RepositoryRuleRequiredStatusChecks_type)() { + m.typeEscaped = value +} +type RepositoryRuleRequiredStatusChecksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleRequiredStatusChecks_parametersable) + GetTypeEscaped()(*RepositoryRuleRequiredStatusChecks_type) + SetParameters(value RepositoryRuleRequiredStatusChecks_parametersable)() + SetTypeEscaped(value *RepositoryRuleRequiredStatusChecks_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_status_checks_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_status_checks_parameters.go new file mode 100644 index 000000000..5187b3d2b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_status_checks_parameters.go @@ -0,0 +1,121 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleRequiredStatusChecks_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Status checks that are required. + required_status_checks []RepositoryRuleParamsStatusCheckConfigurationable + // Whether pull requests targeting a matching branch must be tested with the latest code. This setting will not take effect unless at least one status check is enabled. + strict_required_status_checks_policy *bool +} +// NewRepositoryRuleRequiredStatusChecks_parameters instantiates a new RepositoryRuleRequiredStatusChecks_parameters and sets the default values. +func NewRepositoryRuleRequiredStatusChecks_parameters()(*RepositoryRuleRequiredStatusChecks_parameters) { + m := &RepositoryRuleRequiredStatusChecks_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleRequiredStatusChecks_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleRequiredStatusChecks_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleRequiredStatusChecks_parameters(), 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 *RepositoryRuleRequiredStatusChecks_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleRequiredStatusChecks_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["required_status_checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryRuleParamsStatusCheckConfigurationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryRuleParamsStatusCheckConfigurationable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryRuleParamsStatusCheckConfigurationable) + } + } + m.SetRequiredStatusChecks(res) + } + return nil + } + res["strict_required_status_checks_policy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetStrictRequiredStatusChecksPolicy(val) + } + return nil + } + return res +} +// GetRequiredStatusChecks gets the required_status_checks property value. Status checks that are required. +// returns a []RepositoryRuleParamsStatusCheckConfigurationable when successful +func (m *RepositoryRuleRequiredStatusChecks_parameters) GetRequiredStatusChecks()([]RepositoryRuleParamsStatusCheckConfigurationable) { + return m.required_status_checks +} +// GetStrictRequiredStatusChecksPolicy gets the strict_required_status_checks_policy property value. Whether pull requests targeting a matching branch must be tested with the latest code. This setting will not take effect unless at least one status check is enabled. +// returns a *bool when successful +func (m *RepositoryRuleRequiredStatusChecks_parameters) GetStrictRequiredStatusChecksPolicy()(*bool) { + return m.strict_required_status_checks_policy +} +// Serialize serializes information the current object +func (m *RepositoryRuleRequiredStatusChecks_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRequiredStatusChecks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRequiredStatusChecks())) + for i, v := range m.GetRequiredStatusChecks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("required_status_checks", cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("strict_required_status_checks_policy", m.GetStrictRequiredStatusChecksPolicy()) + 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 *RepositoryRuleRequiredStatusChecks_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRequiredStatusChecks sets the required_status_checks property value. Status checks that are required. +func (m *RepositoryRuleRequiredStatusChecks_parameters) SetRequiredStatusChecks(value []RepositoryRuleParamsStatusCheckConfigurationable)() { + m.required_status_checks = value +} +// SetStrictRequiredStatusChecksPolicy sets the strict_required_status_checks_policy property value. Whether pull requests targeting a matching branch must be tested with the latest code. This setting will not take effect unless at least one status check is enabled. +func (m *RepositoryRuleRequiredStatusChecks_parameters) SetStrictRequiredStatusChecksPolicy(value *bool)() { + m.strict_required_status_checks_policy = value +} +type RepositoryRuleRequiredStatusChecks_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRequiredStatusChecks()([]RepositoryRuleParamsStatusCheckConfigurationable) + GetStrictRequiredStatusChecksPolicy()(*bool) + SetRequiredStatusChecks(value []RepositoryRuleParamsStatusCheckConfigurationable)() + SetStrictRequiredStatusChecksPolicy(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_status_checks_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_status_checks_type.go new file mode 100644 index 000000000..001208ffa --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_required_status_checks_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type RepositoryRuleRequiredStatusChecks_type int + +const ( + REQUIRED_STATUS_CHECKS_REPOSITORYRULEREQUIREDSTATUSCHECKS_TYPE RepositoryRuleRequiredStatusChecks_type = iota +) + +func (i RepositoryRuleRequiredStatusChecks_type) String() string { + return []string{"required_status_checks"}[i] +} +func ParseRepositoryRuleRequiredStatusChecks_type(v string) (any, error) { + result := REQUIRED_STATUS_CHECKS_REPOSITORYRULEREQUIREDSTATUSCHECKS_TYPE + switch v { + case "required_status_checks": + result = REQUIRED_STATUS_CHECKS_REPOSITORYRULEREQUIREDSTATUSCHECKS_TYPE + default: + return 0, errors.New("Unknown RepositoryRuleRequiredStatusChecks_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleRequiredStatusChecks_type(values []RepositoryRuleRequiredStatusChecks_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleRequiredStatusChecks_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_tag_name_pattern.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_tag_name_pattern.go new file mode 100644 index 000000000..da8d71e16 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_tag_name_pattern.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleTagNamePattern parameters to be used for the tag_name_pattern rule +type RepositoryRuleTagNamePattern struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters RepositoryRuleTagNamePattern_parametersable + // The type property + typeEscaped *RepositoryRuleTagNamePattern_type +} +// NewRepositoryRuleTagNamePattern instantiates a new RepositoryRuleTagNamePattern and sets the default values. +func NewRepositoryRuleTagNamePattern()(*RepositoryRuleTagNamePattern) { + m := &RepositoryRuleTagNamePattern{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleTagNamePatternFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleTagNamePatternFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleTagNamePattern(), 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 *RepositoryRuleTagNamePattern) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleTagNamePattern) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleTagNamePattern_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleTagNamePattern_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleTagNamePattern_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleTagNamePattern_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleTagNamePattern_parametersable when successful +func (m *RepositoryRuleTagNamePattern) GetParameters()(RepositoryRuleTagNamePattern_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleTagNamePattern_type when successful +func (m *RepositoryRuleTagNamePattern) GetTypeEscaped()(*RepositoryRuleTagNamePattern_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleTagNamePattern) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleTagNamePattern) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleTagNamePattern) SetParameters(value RepositoryRuleTagNamePattern_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleTagNamePattern) SetTypeEscaped(value *RepositoryRuleTagNamePattern_type)() { + m.typeEscaped = value +} +type RepositoryRuleTagNamePatternable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleTagNamePattern_parametersable) + GetTypeEscaped()(*RepositoryRuleTagNamePattern_type) + SetParameters(value RepositoryRuleTagNamePattern_parametersable)() + SetTypeEscaped(value *RepositoryRuleTagNamePattern_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_tag_name_pattern_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_tag_name_pattern_parameters.go new file mode 100644 index 000000000..4420e9ca7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_tag_name_pattern_parameters.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleTagNamePattern_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How this rule will appear to users. + name *string + // If true, the rule will fail if the pattern matches. + negate *bool + // The operator to use for matching. + operator *RepositoryRuleTagNamePattern_parameters_operator + // The pattern to match with. + pattern *string +} +// NewRepositoryRuleTagNamePattern_parameters instantiates a new RepositoryRuleTagNamePattern_parameters and sets the default values. +func NewRepositoryRuleTagNamePattern_parameters()(*RepositoryRuleTagNamePattern_parameters) { + m := &RepositoryRuleTagNamePattern_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleTagNamePattern_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleTagNamePattern_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleTagNamePattern_parameters(), 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 *RepositoryRuleTagNamePattern_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleTagNamePattern_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["negate"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetNegate(val) + } + return nil + } + res["operator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleTagNamePattern_parameters_operator) + if err != nil { + return err + } + if val != nil { + m.SetOperator(val.(*RepositoryRuleTagNamePattern_parameters_operator)) + } + return nil + } + res["pattern"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPattern(val) + } + return nil + } + return res +} +// GetName gets the name property value. How this rule will appear to users. +// returns a *string when successful +func (m *RepositoryRuleTagNamePattern_parameters) GetName()(*string) { + return m.name +} +// GetNegate gets the negate property value. If true, the rule will fail if the pattern matches. +// returns a *bool when successful +func (m *RepositoryRuleTagNamePattern_parameters) GetNegate()(*bool) { + return m.negate +} +// GetOperator gets the operator property value. The operator to use for matching. +// returns a *RepositoryRuleTagNamePattern_parameters_operator when successful +func (m *RepositoryRuleTagNamePattern_parameters) GetOperator()(*RepositoryRuleTagNamePattern_parameters_operator) { + return m.operator +} +// GetPattern gets the pattern property value. The pattern to match with. +// returns a *string when successful +func (m *RepositoryRuleTagNamePattern_parameters) GetPattern()(*string) { + return m.pattern +} +// Serialize serializes information the current object +func (m *RepositoryRuleTagNamePattern_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("negate", m.GetNegate()) + if err != nil { + return err + } + } + if m.GetOperator() != nil { + cast := (*m.GetOperator()).String() + err := writer.WriteStringValue("operator", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pattern", m.GetPattern()) + 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 *RepositoryRuleTagNamePattern_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. How this rule will appear to users. +func (m *RepositoryRuleTagNamePattern_parameters) SetName(value *string)() { + m.name = value +} +// SetNegate sets the negate property value. If true, the rule will fail if the pattern matches. +func (m *RepositoryRuleTagNamePattern_parameters) SetNegate(value *bool)() { + m.negate = value +} +// SetOperator sets the operator property value. The operator to use for matching. +func (m *RepositoryRuleTagNamePattern_parameters) SetOperator(value *RepositoryRuleTagNamePattern_parameters_operator)() { + m.operator = value +} +// SetPattern sets the pattern property value. The pattern to match with. +func (m *RepositoryRuleTagNamePattern_parameters) SetPattern(value *string)() { + m.pattern = value +} +type RepositoryRuleTagNamePattern_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetNegate()(*bool) + GetOperator()(*RepositoryRuleTagNamePattern_parameters_operator) + GetPattern()(*string) + SetName(value *string)() + SetNegate(value *bool)() + SetOperator(value *RepositoryRuleTagNamePattern_parameters_operator)() + SetPattern(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_tag_name_pattern_parameters_operator.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_tag_name_pattern_parameters_operator.go new file mode 100644 index 000000000..f35fb515d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_tag_name_pattern_parameters_operator.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The operator to use for matching. +type RepositoryRuleTagNamePattern_parameters_operator int + +const ( + STARTS_WITH_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR RepositoryRuleTagNamePattern_parameters_operator = iota + ENDS_WITH_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR + CONTAINS_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR + REGEX_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR +) + +func (i RepositoryRuleTagNamePattern_parameters_operator) String() string { + return []string{"starts_with", "ends_with", "contains", "regex"}[i] +} +func ParseRepositoryRuleTagNamePattern_parameters_operator(v string) (any, error) { + result := STARTS_WITH_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR + switch v { + case "starts_with": + result = STARTS_WITH_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR + case "ends_with": + result = ENDS_WITH_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR + case "contains": + result = CONTAINS_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR + case "regex": + result = REGEX_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR + default: + return 0, errors.New("Unknown RepositoryRuleTagNamePattern_parameters_operator value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleTagNamePattern_parameters_operator(values []RepositoryRuleTagNamePattern_parameters_operator) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleTagNamePattern_parameters_operator) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_tag_name_pattern_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_tag_name_pattern_type.go new file mode 100644 index 000000000..b435eb0f4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_tag_name_pattern_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type RepositoryRuleTagNamePattern_type int + +const ( + TAG_NAME_PATTERN_REPOSITORYRULETAGNAMEPATTERN_TYPE RepositoryRuleTagNamePattern_type = iota +) + +func (i RepositoryRuleTagNamePattern_type) String() string { + return []string{"tag_name_pattern"}[i] +} +func ParseRepositoryRuleTagNamePattern_type(v string) (any, error) { + result := TAG_NAME_PATTERN_REPOSITORYRULETAGNAMEPATTERN_TYPE + switch v { + case "tag_name_pattern": + result = TAG_NAME_PATTERN_REPOSITORYRULETAGNAMEPATTERN_TYPE + default: + return 0, errors.New("Unknown RepositoryRuleTagNamePattern_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleTagNamePattern_type(values []RepositoryRuleTagNamePattern_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleTagNamePattern_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_update.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_update.go new file mode 100644 index 000000000..f23ced239 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_update.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleUpdate only allow users with bypass permission to update matching refs. +type RepositoryRuleUpdate struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters RepositoryRuleUpdate_parametersable + // The type property + typeEscaped *RepositoryRuleUpdate_type +} +// NewRepositoryRuleUpdate instantiates a new RepositoryRuleUpdate and sets the default values. +func NewRepositoryRuleUpdate()(*RepositoryRuleUpdate) { + m := &RepositoryRuleUpdate{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleUpdateFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleUpdateFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleUpdate(), 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 *RepositoryRuleUpdate) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleUpdate) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleUpdate_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleUpdate_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleUpdate_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleUpdate_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleUpdate_parametersable when successful +func (m *RepositoryRuleUpdate) GetParameters()(RepositoryRuleUpdate_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleUpdate_type when successful +func (m *RepositoryRuleUpdate) GetTypeEscaped()(*RepositoryRuleUpdate_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleUpdate) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleUpdate) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleUpdate) SetParameters(value RepositoryRuleUpdate_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleUpdate) SetTypeEscaped(value *RepositoryRuleUpdate_type)() { + m.typeEscaped = value +} +type RepositoryRuleUpdateable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleUpdate_parametersable) + GetTypeEscaped()(*RepositoryRuleUpdate_type) + SetParameters(value RepositoryRuleUpdate_parametersable)() + SetTypeEscaped(value *RepositoryRuleUpdate_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_update_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_update_parameters.go new file mode 100644 index 000000000..b6ef2d1d3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_update_parameters.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleUpdate_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Branch can pull changes from its upstream repository + update_allows_fetch_and_merge *bool +} +// NewRepositoryRuleUpdate_parameters instantiates a new RepositoryRuleUpdate_parameters and sets the default values. +func NewRepositoryRuleUpdate_parameters()(*RepositoryRuleUpdate_parameters) { + m := &RepositoryRuleUpdate_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleUpdate_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleUpdate_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleUpdate_parameters(), 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 *RepositoryRuleUpdate_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleUpdate_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["update_allows_fetch_and_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdateAllowsFetchAndMerge(val) + } + return nil + } + return res +} +// GetUpdateAllowsFetchAndMerge gets the update_allows_fetch_and_merge property value. Branch can pull changes from its upstream repository +// returns a *bool when successful +func (m *RepositoryRuleUpdate_parameters) GetUpdateAllowsFetchAndMerge()(*bool) { + return m.update_allows_fetch_and_merge +} +// Serialize serializes information the current object +func (m *RepositoryRuleUpdate_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("update_allows_fetch_and_merge", m.GetUpdateAllowsFetchAndMerge()) + 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 *RepositoryRuleUpdate_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetUpdateAllowsFetchAndMerge sets the update_allows_fetch_and_merge property value. Branch can pull changes from its upstream repository +func (m *RepositoryRuleUpdate_parameters) SetUpdateAllowsFetchAndMerge(value *bool)() { + m.update_allows_fetch_and_merge = value +} +type RepositoryRuleUpdate_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetUpdateAllowsFetchAndMerge()(*bool) + SetUpdateAllowsFetchAndMerge(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_update_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_update_type.go new file mode 100644 index 000000000..0867f5239 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_update_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type RepositoryRuleUpdate_type int + +const ( + UPDATE_REPOSITORYRULEUPDATE_TYPE RepositoryRuleUpdate_type = iota +) + +func (i RepositoryRuleUpdate_type) String() string { + return []string{"update"}[i] +} +func ParseRepositoryRuleUpdate_type(v string) (any, error) { + result := UPDATE_REPOSITORYRULEUPDATE_TYPE + switch v { + case "update": + result = UPDATE_REPOSITORYRULEUPDATE_TYPE + default: + return 0, errors.New("Unknown RepositoryRuleUpdate_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleUpdate_type(values []RepositoryRuleUpdate_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleUpdate_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_workflows.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_workflows.go new file mode 100644 index 000000000..eee7ba64e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_workflows.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleWorkflows require all changes made to a targeted branch to pass the specified workflows before they can be merged. +type RepositoryRuleWorkflows struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The parameters property + parameters RepositoryRuleWorkflows_parametersable + // The type property + typeEscaped *RepositoryRuleWorkflows_type +} +// NewRepositoryRuleWorkflows instantiates a new RepositoryRuleWorkflows and sets the default values. +func NewRepositoryRuleWorkflows()(*RepositoryRuleWorkflows) { + m := &RepositoryRuleWorkflows{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleWorkflowsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleWorkflowsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleWorkflows(), 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 *RepositoryRuleWorkflows) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleWorkflows) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleWorkflows_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleWorkflows_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleWorkflows_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleWorkflows_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleWorkflows_parametersable when successful +func (m *RepositoryRuleWorkflows) GetParameters()(RepositoryRuleWorkflows_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleWorkflows_type when successful +func (m *RepositoryRuleWorkflows) GetTypeEscaped()(*RepositoryRuleWorkflows_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleWorkflows) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleWorkflows) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleWorkflows) SetParameters(value RepositoryRuleWorkflows_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleWorkflows) SetTypeEscaped(value *RepositoryRuleWorkflows_type)() { + m.typeEscaped = value +} +type RepositoryRuleWorkflowsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleWorkflows_parametersable) + GetTypeEscaped()(*RepositoryRuleWorkflows_type) + SetParameters(value RepositoryRuleWorkflows_parametersable)() + SetTypeEscaped(value *RepositoryRuleWorkflows_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_workflows_parameters.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_workflows_parameters.go new file mode 100644 index 000000000..0bbd8f897 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_workflows_parameters.go @@ -0,0 +1,92 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleWorkflows_parameters struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Workflows that must pass for this rule to pass. + workflows []RepositoryRuleParamsWorkflowFileReferenceable +} +// NewRepositoryRuleWorkflows_parameters instantiates a new RepositoryRuleWorkflows_parameters and sets the default values. +func NewRepositoryRuleWorkflows_parameters()(*RepositoryRuleWorkflows_parameters) { + m := &RepositoryRuleWorkflows_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleWorkflows_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleWorkflows_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleWorkflows_parameters(), 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 *RepositoryRuleWorkflows_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleWorkflows_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["workflows"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryRuleParamsWorkflowFileReferenceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryRuleParamsWorkflowFileReferenceable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryRuleParamsWorkflowFileReferenceable) + } + } + m.SetWorkflows(res) + } + return nil + } + return res +} +// GetWorkflows gets the workflows property value. Workflows that must pass for this rule to pass. +// returns a []RepositoryRuleParamsWorkflowFileReferenceable when successful +func (m *RepositoryRuleWorkflows_parameters) GetWorkflows()([]RepositoryRuleParamsWorkflowFileReferenceable) { + return m.workflows +} +// Serialize serializes information the current object +func (m *RepositoryRuleWorkflows_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetWorkflows() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetWorkflows())) + for i, v := range m.GetWorkflows() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("workflows", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryRuleWorkflows_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetWorkflows sets the workflows property value. Workflows that must pass for this rule to pass. +func (m *RepositoryRuleWorkflows_parameters) SetWorkflows(value []RepositoryRuleParamsWorkflowFileReferenceable)() { + m.workflows = value +} +type RepositoryRuleWorkflows_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetWorkflows()([]RepositoryRuleParamsWorkflowFileReferenceable) + SetWorkflows(value []RepositoryRuleParamsWorkflowFileReferenceable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_workflows_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_workflows_type.go new file mode 100644 index 000000000..776cb3ede --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_rule_workflows_type.go @@ -0,0 +1,33 @@ +package models +import ( + "errors" +) +type RepositoryRuleWorkflows_type int + +const ( + WORKFLOWS_REPOSITORYRULEWORKFLOWS_TYPE RepositoryRuleWorkflows_type = iota +) + +func (i RepositoryRuleWorkflows_type) String() string { + return []string{"workflows"}[i] +} +func ParseRepositoryRuleWorkflows_type(v string) (any, error) { + result := WORKFLOWS_REPOSITORYRULEWORKFLOWS_TYPE + switch v { + case "workflows": + result = WORKFLOWS_REPOSITORYRULEWORKFLOWS_TYPE + default: + return 0, errors.New("Unknown RepositoryRuleWorkflows_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleWorkflows_type(values []RepositoryRuleWorkflows_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleWorkflows_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset.go new file mode 100644 index 000000000..5aa2b3296 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset.go @@ -0,0 +1,573 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleset a set of rules to apply when specified conditions are met. +type RepositoryRuleset struct { + // The _links property + _links RepositoryRuleset__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The actors that can bypass the rules in this ruleset + bypass_actors []RepositoryRulesetBypassActorable + // The conditions property + conditions RepositoryRuleset_RepositoryRuleset_conditionsable + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The bypass type of the user making the API request for this ruleset. This field is only returned whenquerying the repository-level endpoint. + current_user_can_bypass *RepositoryRuleset_current_user_can_bypass + // The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). + enforcement *RepositoryRuleEnforcement + // The ID of the ruleset + id *int32 + // The name of the ruleset + name *string + // The node_id property + node_id *string + // The rules property + rules []RepositoryRuleable + // The name of the source + source *string + // The type of the source of the ruleset + source_type *RepositoryRuleset_source_type + // The target of the ruleset**Note**: The `push` target is in beta and is subject to change. + target *RepositoryRuleset_target + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// RepositoryRuleset_RepositoryRuleset_conditions composed type wrapper for classes OrgRulesetConditionsable, RepositoryRulesetConditionsable +type RepositoryRuleset_RepositoryRuleset_conditions struct { + // Composed type representation for type OrgRulesetConditionsable + orgRulesetConditions OrgRulesetConditionsable + // Composed type representation for type RepositoryRulesetConditionsable + repositoryRulesetConditions RepositoryRulesetConditionsable +} +// NewRepositoryRuleset_RepositoryRuleset_conditions instantiates a new RepositoryRuleset_RepositoryRuleset_conditions and sets the default values. +func NewRepositoryRuleset_RepositoryRuleset_conditions()(*RepositoryRuleset_RepositoryRuleset_conditions) { + m := &RepositoryRuleset_RepositoryRuleset_conditions{ + } + return m +} +// CreateRepositoryRuleset_RepositoryRuleset_conditionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleset_RepositoryRuleset_conditionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewRepositoryRuleset_RepositoryRuleset_conditions() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateOrgRulesetConditionsFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(OrgRulesetConditionsable); ok { + result.SetOrgRulesetConditions(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateRepositoryRulesetConditionsFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(RepositoryRulesetConditionsable); ok { + result.SetRepositoryRulesetConditions(cast) + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleset_RepositoryRuleset_conditions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *RepositoryRuleset_RepositoryRuleset_conditions) GetIsComposedType()(bool) { + return true +} +// GetOrgRulesetConditions gets the orgRulesetConditions property value. Composed type representation for type OrgRulesetConditionsable +// returns a OrgRulesetConditionsable when successful +func (m *RepositoryRuleset_RepositoryRuleset_conditions) GetOrgRulesetConditions()(OrgRulesetConditionsable) { + return m.orgRulesetConditions +} +// GetRepositoryRulesetConditions gets the repositoryRulesetConditions property value. Composed type representation for type RepositoryRulesetConditionsable +// returns a RepositoryRulesetConditionsable when successful +func (m *RepositoryRuleset_RepositoryRuleset_conditions) GetRepositoryRulesetConditions()(RepositoryRulesetConditionsable) { + return m.repositoryRulesetConditions +} +// Serialize serializes information the current object +func (m *RepositoryRuleset_RepositoryRuleset_conditions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetOrgRulesetConditions() != nil { + err := writer.WriteObjectValue("", m.GetOrgRulesetConditions()) + if err != nil { + return err + } + } else if m.GetRepositoryRulesetConditions() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRulesetConditions()) + if err != nil { + return err + } + } + return nil +} +// SetOrgRulesetConditions sets the orgRulesetConditions property value. Composed type representation for type OrgRulesetConditionsable +func (m *RepositoryRuleset_RepositoryRuleset_conditions) SetOrgRulesetConditions(value OrgRulesetConditionsable)() { + m.orgRulesetConditions = value +} +// SetRepositoryRulesetConditions sets the repositoryRulesetConditions property value. Composed type representation for type RepositoryRulesetConditionsable +func (m *RepositoryRuleset_RepositoryRuleset_conditions) SetRepositoryRulesetConditions(value RepositoryRulesetConditionsable)() { + m.repositoryRulesetConditions = value +} +type RepositoryRuleset_RepositoryRuleset_conditionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetOrgRulesetConditions()(OrgRulesetConditionsable) + GetRepositoryRulesetConditions()(RepositoryRulesetConditionsable) + SetOrgRulesetConditions(value OrgRulesetConditionsable)() + SetRepositoryRulesetConditions(value RepositoryRulesetConditionsable)() +} +// NewRepositoryRuleset instantiates a new RepositoryRuleset and sets the default values. +func NewRepositoryRuleset()(*RepositoryRuleset) { + m := &RepositoryRuleset{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRulesetFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRulesetFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleset(), 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 *RepositoryRuleset) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassActors gets the bypass_actors property value. The actors that can bypass the rules in this ruleset +// returns a []RepositoryRulesetBypassActorable when successful +func (m *RepositoryRuleset) GetBypassActors()([]RepositoryRulesetBypassActorable) { + return m.bypass_actors +} +// GetConditions gets the conditions property value. The conditions property +// returns a RepositoryRuleset_RepositoryRuleset_conditionsable when successful +func (m *RepositoryRuleset) GetConditions()(RepositoryRuleset_RepositoryRuleset_conditionsable) { + return m.conditions +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *RepositoryRuleset) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCurrentUserCanBypass gets the current_user_can_bypass property value. The bypass type of the user making the API request for this ruleset. This field is only returned whenquerying the repository-level endpoint. +// returns a *RepositoryRuleset_current_user_can_bypass when successful +func (m *RepositoryRuleset) GetCurrentUserCanBypass()(*RepositoryRuleset_current_user_can_bypass) { + return m.current_user_can_bypass +} +// GetEnforcement gets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). +// returns a *RepositoryRuleEnforcement when successful +func (m *RepositoryRuleset) GetEnforcement()(*RepositoryRuleEnforcement) { + return m.enforcement +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleset) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleset__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(RepositoryRuleset__linksable)) + } + return nil + } + res["bypass_actors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryRulesetBypassActorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryRulesetBypassActorable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryRulesetBypassActorable) + } + } + m.SetBypassActors(res) + } + return nil + } + res["conditions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleset_RepositoryRuleset_conditionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConditions(val.(RepositoryRuleset_RepositoryRuleset_conditionsable)) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["current_user_can_bypass"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleset_current_user_can_bypass) + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserCanBypass(val.(*RepositoryRuleset_current_user_can_bypass)) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleEnforcement) + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val.(*RepositoryRuleEnforcement)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["rules"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryRuleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryRuleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryRuleable) + } + } + m.SetRules(res) + } + return nil + } + res["source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSource(val) + } + return nil + } + res["source_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleset_source_type) + if err != nil { + return err + } + if val != nil { + m.SetSourceType(val.(*RepositoryRuleset_source_type)) + } + return nil + } + res["target"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleset_target) + if err != nil { + return err + } + if val != nil { + m.SetTarget(val.(*RepositoryRuleset_target)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetId gets the id property value. The ID of the ruleset +// returns a *int32 when successful +func (m *RepositoryRuleset) GetId()(*int32) { + return m.id +} +// GetLinks gets the _links property value. The _links property +// returns a RepositoryRuleset__linksable when successful +func (m *RepositoryRuleset) GetLinks()(RepositoryRuleset__linksable) { + return m._links +} +// GetName gets the name property value. The name of the ruleset +// returns a *string when successful +func (m *RepositoryRuleset) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *RepositoryRuleset) GetNodeId()(*string) { + return m.node_id +} +// GetRules gets the rules property value. The rules property +// returns a []RepositoryRuleable when successful +func (m *RepositoryRuleset) GetRules()([]RepositoryRuleable) { + return m.rules +} +// GetSource gets the source property value. The name of the source +// returns a *string when successful +func (m *RepositoryRuleset) GetSource()(*string) { + return m.source +} +// GetSourceType gets the source_type property value. The type of the source of the ruleset +// returns a *RepositoryRuleset_source_type when successful +func (m *RepositoryRuleset) GetSourceType()(*RepositoryRuleset_source_type) { + return m.source_type +} +// GetTarget gets the target property value. The target of the ruleset**Note**: The `push` target is in beta and is subject to change. +// returns a *RepositoryRuleset_target when successful +func (m *RepositoryRuleset) GetTarget()(*RepositoryRuleset_target) { + return m.target +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *RepositoryRuleset) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *RepositoryRuleset) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBypassActors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetBypassActors())) + for i, v := range m.GetBypassActors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("bypass_actors", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("conditions", m.GetConditions()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + if m.GetCurrentUserCanBypass() != nil { + cast := (*m.GetCurrentUserCanBypass()).String() + err := writer.WriteStringValue("current_user_can_bypass", &cast) + if err != nil { + return err + } + } + if m.GetEnforcement() != nil { + cast := (*m.GetEnforcement()).String() + err := writer.WriteStringValue("enforcement", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetRules() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRules())) + for i, v := range m.GetRules() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("rules", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("source", m.GetSource()) + if err != nil { + return err + } + } + if m.GetSourceType() != nil { + cast := (*m.GetSourceType()).String() + err := writer.WriteStringValue("source_type", &cast) + if err != nil { + return err + } + } + if m.GetTarget() != nil { + cast := (*m.GetTarget()).String() + err := writer.WriteStringValue("target", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *RepositoryRuleset) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassActors sets the bypass_actors property value. The actors that can bypass the rules in this ruleset +func (m *RepositoryRuleset) SetBypassActors(value []RepositoryRulesetBypassActorable)() { + m.bypass_actors = value +} +// SetConditions sets the conditions property value. The conditions property +func (m *RepositoryRuleset) SetConditions(value RepositoryRuleset_RepositoryRuleset_conditionsable)() { + m.conditions = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *RepositoryRuleset) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCurrentUserCanBypass sets the current_user_can_bypass property value. The bypass type of the user making the API request for this ruleset. This field is only returned whenquerying the repository-level endpoint. +func (m *RepositoryRuleset) SetCurrentUserCanBypass(value *RepositoryRuleset_current_user_can_bypass)() { + m.current_user_can_bypass = value +} +// SetEnforcement sets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). +func (m *RepositoryRuleset) SetEnforcement(value *RepositoryRuleEnforcement)() { + m.enforcement = value +} +// SetId sets the id property value. The ID of the ruleset +func (m *RepositoryRuleset) SetId(value *int32)() { + m.id = value +} +// SetLinks sets the _links property value. The _links property +func (m *RepositoryRuleset) SetLinks(value RepositoryRuleset__linksable)() { + m._links = value +} +// SetName sets the name property value. The name of the ruleset +func (m *RepositoryRuleset) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *RepositoryRuleset) SetNodeId(value *string)() { + m.node_id = value +} +// SetRules sets the rules property value. The rules property +func (m *RepositoryRuleset) SetRules(value []RepositoryRuleable)() { + m.rules = value +} +// SetSource sets the source property value. The name of the source +func (m *RepositoryRuleset) SetSource(value *string)() { + m.source = value +} +// SetSourceType sets the source_type property value. The type of the source of the ruleset +func (m *RepositoryRuleset) SetSourceType(value *RepositoryRuleset_source_type)() { + m.source_type = value +} +// SetTarget sets the target property value. The target of the ruleset**Note**: The `push` target is in beta and is subject to change. +func (m *RepositoryRuleset) SetTarget(value *RepositoryRuleset_target)() { + m.target = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *RepositoryRuleset) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type RepositoryRulesetable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassActors()([]RepositoryRulesetBypassActorable) + GetConditions()(RepositoryRuleset_RepositoryRuleset_conditionsable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCurrentUserCanBypass()(*RepositoryRuleset_current_user_can_bypass) + GetEnforcement()(*RepositoryRuleEnforcement) + GetId()(*int32) + GetLinks()(RepositoryRuleset__linksable) + GetName()(*string) + GetNodeId()(*string) + GetRules()([]RepositoryRuleable) + GetSource()(*string) + GetSourceType()(*RepositoryRuleset_source_type) + GetTarget()(*RepositoryRuleset_target) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetBypassActors(value []RepositoryRulesetBypassActorable)() + SetConditions(value RepositoryRuleset_RepositoryRuleset_conditionsable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCurrentUserCanBypass(value *RepositoryRuleset_current_user_can_bypass)() + SetEnforcement(value *RepositoryRuleEnforcement)() + SetId(value *int32)() + SetLinks(value RepositoryRuleset__linksable)() + SetName(value *string)() + SetNodeId(value *string)() + SetRules(value []RepositoryRuleable)() + SetSource(value *string)() + SetSourceType(value *RepositoryRuleset_source_type)() + SetTarget(value *RepositoryRuleset_target)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset__links.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset__links.go new file mode 100644 index 000000000..aa5b4ce8a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset__links.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleset__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html property + html RepositoryRuleset__links_htmlable + // The self property + self RepositoryRuleset__links_selfable +} +// NewRepositoryRuleset__links instantiates a new RepositoryRuleset__links and sets the default values. +func NewRepositoryRuleset__links()(*RepositoryRuleset__links) { + m := &RepositoryRuleset__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleset__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleset__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleset__links(), 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 *RepositoryRuleset__links) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleset__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleset__links_htmlFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHtml(val.(RepositoryRuleset__links_htmlable)) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleset__links_selfFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSelf(val.(RepositoryRuleset__links_selfable)) + } + return nil + } + return res +} +// GetHtml gets the html property value. The html property +// returns a RepositoryRuleset__links_htmlable when successful +func (m *RepositoryRuleset__links) GetHtml()(RepositoryRuleset__links_htmlable) { + return m.html +} +// GetSelf gets the self property value. The self property +// returns a RepositoryRuleset__links_selfable when successful +func (m *RepositoryRuleset__links) GetSelf()(RepositoryRuleset__links_selfable) { + return m.self +} +// Serialize serializes information the current object +func (m *RepositoryRuleset__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("self", m.GetSelf()) + 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 *RepositoryRuleset__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtml sets the html property value. The html property +func (m *RepositoryRuleset__links) SetHtml(value RepositoryRuleset__links_htmlable)() { + m.html = value +} +// SetSelf sets the self property value. The self property +func (m *RepositoryRuleset__links) SetSelf(value RepositoryRuleset__links_selfable)() { + m.self = value +} +type RepositoryRuleset__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtml()(RepositoryRuleset__links_htmlable) + GetSelf()(RepositoryRuleset__links_selfable) + SetHtml(value RepositoryRuleset__links_htmlable)() + SetSelf(value RepositoryRuleset__links_selfable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset__links_html.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset__links_html.go new file mode 100644 index 000000000..478469fd2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset__links_html.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleset__links_html struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html URL of the ruleset + href *string +} +// NewRepositoryRuleset__links_html instantiates a new RepositoryRuleset__links_html and sets the default values. +func NewRepositoryRuleset__links_html()(*RepositoryRuleset__links_html) { + m := &RepositoryRuleset__links_html{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleset__links_htmlFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleset__links_htmlFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleset__links_html(), 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 *RepositoryRuleset__links_html) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleset__links_html) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The html URL of the ruleset +// returns a *string when successful +func (m *RepositoryRuleset__links_html) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *RepositoryRuleset__links_html) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *RepositoryRuleset__links_html) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The html URL of the ruleset +func (m *RepositoryRuleset__links_html) SetHref(value *string)() { + m.href = value +} +type RepositoryRuleset__links_htmlable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset__links_self.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset__links_self.go new file mode 100644 index 000000000..692b860f6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset__links_self.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleset__links_self struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The URL of the ruleset + href *string +} +// NewRepositoryRuleset__links_self instantiates a new RepositoryRuleset__links_self and sets the default values. +func NewRepositoryRuleset__links_self()(*RepositoryRuleset__links_self) { + m := &RepositoryRuleset__links_self{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleset__links_selfFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleset__links_selfFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleset__links_self(), 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 *RepositoryRuleset__links_self) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleset__links_self) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The URL of the ruleset +// returns a *string when successful +func (m *RepositoryRuleset__links_self) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *RepositoryRuleset__links_self) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *RepositoryRuleset__links_self) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The URL of the ruleset +func (m *RepositoryRuleset__links_self) SetHref(value *string)() { + m.href = value +} +type RepositoryRuleset__links_selfable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_bypass_actor.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_bypass_actor.go new file mode 100644 index 000000000..9f383c462 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_bypass_actor.go @@ -0,0 +1,141 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRulesetBypassActor an actor that can bypass rules in a ruleset +type RepositoryRulesetBypassActor struct { + // The ID of the actor that can bypass a ruleset. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. + actor_id *int32 + // The type of actor that can bypass a ruleset. + actor_type *RepositoryRulesetBypassActor_actor_type + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. + bypass_mode *RepositoryRulesetBypassActor_bypass_mode +} +// NewRepositoryRulesetBypassActor instantiates a new RepositoryRulesetBypassActor and sets the default values. +func NewRepositoryRulesetBypassActor()(*RepositoryRulesetBypassActor) { + m := &RepositoryRulesetBypassActor{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRulesetBypassActorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRulesetBypassActorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRulesetBypassActor(), nil +} +// GetActorId gets the actor_id property value. The ID of the actor that can bypass a ruleset. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. +// returns a *int32 when successful +func (m *RepositoryRulesetBypassActor) GetActorId()(*int32) { + return m.actor_id +} +// GetActorType gets the actor_type property value. The type of actor that can bypass a ruleset. +// returns a *RepositoryRulesetBypassActor_actor_type when successful +func (m *RepositoryRulesetBypassActor) GetActorType()(*RepositoryRulesetBypassActor_actor_type) { + return m.actor_type +} +// 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 *RepositoryRulesetBypassActor) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassMode gets the bypass_mode property value. When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. +// returns a *RepositoryRulesetBypassActor_bypass_mode when successful +func (m *RepositoryRulesetBypassActor) GetBypassMode()(*RepositoryRulesetBypassActor_bypass_mode) { + return m.bypass_mode +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRulesetBypassActor) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetActorId(val) + } + return nil + } + res["actor_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRulesetBypassActor_actor_type) + if err != nil { + return err + } + if val != nil { + m.SetActorType(val.(*RepositoryRulesetBypassActor_actor_type)) + } + return nil + } + res["bypass_mode"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRulesetBypassActor_bypass_mode) + if err != nil { + return err + } + if val != nil { + m.SetBypassMode(val.(*RepositoryRulesetBypassActor_bypass_mode)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *RepositoryRulesetBypassActor) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("actor_id", m.GetActorId()) + if err != nil { + return err + } + } + if m.GetActorType() != nil { + cast := (*m.GetActorType()).String() + err := writer.WriteStringValue("actor_type", &cast) + if err != nil { + return err + } + } + if m.GetBypassMode() != nil { + cast := (*m.GetBypassMode()).String() + err := writer.WriteStringValue("bypass_mode", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActorId sets the actor_id property value. The ID of the actor that can bypass a ruleset. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. +func (m *RepositoryRulesetBypassActor) SetActorId(value *int32)() { + m.actor_id = value +} +// SetActorType sets the actor_type property value. The type of actor that can bypass a ruleset. +func (m *RepositoryRulesetBypassActor) SetActorType(value *RepositoryRulesetBypassActor_actor_type)() { + m.actor_type = value +} +// 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 *RepositoryRulesetBypassActor) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassMode sets the bypass_mode property value. When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. +func (m *RepositoryRulesetBypassActor) SetBypassMode(value *RepositoryRulesetBypassActor_bypass_mode)() { + m.bypass_mode = value +} +type RepositoryRulesetBypassActorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActorId()(*int32) + GetActorType()(*RepositoryRulesetBypassActor_actor_type) + GetBypassMode()(*RepositoryRulesetBypassActor_bypass_mode) + SetActorId(value *int32)() + SetActorType(value *RepositoryRulesetBypassActor_actor_type)() + SetBypassMode(value *RepositoryRulesetBypassActor_bypass_mode)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_bypass_actor_actor_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_bypass_actor_actor_type.go new file mode 100644 index 000000000..e6b3f6023 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_bypass_actor_actor_type.go @@ -0,0 +1,46 @@ +package models +import ( + "errors" +) +// The type of actor that can bypass a ruleset. +type RepositoryRulesetBypassActor_actor_type int + +const ( + INTEGRATION_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE RepositoryRulesetBypassActor_actor_type = iota + ORGANIZATIONADMIN_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + REPOSITORYROLE_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + TEAM_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + DEPLOYKEY_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE +) + +func (i RepositoryRulesetBypassActor_actor_type) String() string { + return []string{"Integration", "OrganizationAdmin", "RepositoryRole", "Team", "DeployKey"}[i] +} +func ParseRepositoryRulesetBypassActor_actor_type(v string) (any, error) { + result := INTEGRATION_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + switch v { + case "Integration": + result = INTEGRATION_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + case "OrganizationAdmin": + result = ORGANIZATIONADMIN_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + case "RepositoryRole": + result = REPOSITORYROLE_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + case "Team": + result = TEAM_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + case "DeployKey": + result = DEPLOYKEY_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + default: + return 0, errors.New("Unknown RepositoryRulesetBypassActor_actor_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRulesetBypassActor_actor_type(values []RepositoryRulesetBypassActor_actor_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRulesetBypassActor_actor_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_bypass_actor_bypass_mode.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_bypass_actor_bypass_mode.go new file mode 100644 index 000000000..93484ad44 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_bypass_actor_bypass_mode.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. +type RepositoryRulesetBypassActor_bypass_mode int + +const ( + ALWAYS_REPOSITORYRULESETBYPASSACTOR_BYPASS_MODE RepositoryRulesetBypassActor_bypass_mode = iota + PULL_REQUEST_REPOSITORYRULESETBYPASSACTOR_BYPASS_MODE +) + +func (i RepositoryRulesetBypassActor_bypass_mode) String() string { + return []string{"always", "pull_request"}[i] +} +func ParseRepositoryRulesetBypassActor_bypass_mode(v string) (any, error) { + result := ALWAYS_REPOSITORYRULESETBYPASSACTOR_BYPASS_MODE + switch v { + case "always": + result = ALWAYS_REPOSITORYRULESETBYPASSACTOR_BYPASS_MODE + case "pull_request": + result = PULL_REQUEST_REPOSITORYRULESETBYPASSACTOR_BYPASS_MODE + default: + return 0, errors.New("Unknown RepositoryRulesetBypassActor_bypass_mode value: " + v) + } + return &result, nil +} +func SerializeRepositoryRulesetBypassActor_bypass_mode(values []RepositoryRulesetBypassActor_bypass_mode) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRulesetBypassActor_bypass_mode) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_conditions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_conditions.go new file mode 100644 index 000000000..1b422421b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_conditions.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRulesetConditions parameters for a repository ruleset ref name condition +type RepositoryRulesetConditions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The ref_name property + ref_name RepositoryRulesetConditions_ref_nameable +} +// NewRepositoryRulesetConditions instantiates a new RepositoryRulesetConditions and sets the default values. +func NewRepositoryRulesetConditions()(*RepositoryRulesetConditions) { + m := &RepositoryRulesetConditions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRulesetConditionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRulesetConditionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRulesetConditions(), 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 *RepositoryRulesetConditions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRulesetConditions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ref_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRulesetConditions_ref_nameFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRefName(val.(RepositoryRulesetConditions_ref_nameable)) + } + return nil + } + return res +} +// GetRefName gets the ref_name property value. The ref_name property +// returns a RepositoryRulesetConditions_ref_nameable when successful +func (m *RepositoryRulesetConditions) GetRefName()(RepositoryRulesetConditions_ref_nameable) { + return m.ref_name +} +// Serialize serializes information the current object +func (m *RepositoryRulesetConditions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("ref_name", m.GetRefName()) + 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 *RepositoryRulesetConditions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRefName sets the ref_name property value. The ref_name property +func (m *RepositoryRulesetConditions) SetRefName(value RepositoryRulesetConditions_ref_nameable)() { + m.ref_name = value +} +type RepositoryRulesetConditionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRefName()(RepositoryRulesetConditions_ref_nameable) + SetRefName(value RepositoryRulesetConditions_ref_nameable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_conditions_for_repository_i_ds.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_conditions_for_repository_i_ds.go new file mode 100644 index 000000000..c67247fbd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_conditions_for_repository_i_ds.go @@ -0,0 +1,39 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRulesetConditionsForRepositoryIDs conditions to target repositories by id and refs by name +type RepositoryRulesetConditionsForRepositoryIDs struct { + RepositoryRulesetConditions +} +// NewRepositoryRulesetConditionsForRepositoryIDs instantiates a new RepositoryRulesetConditionsForRepositoryIDs and sets the default values. +func NewRepositoryRulesetConditionsForRepositoryIDs()(*RepositoryRulesetConditionsForRepositoryIDs) { + m := &RepositoryRulesetConditionsForRepositoryIDs{ + RepositoryRulesetConditions: *NewRepositoryRulesetConditions(), + } + return m +} +// CreateRepositoryRulesetConditionsForRepositoryIDsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateRepositoryRulesetConditionsForRepositoryIDsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRulesetConditionsForRepositoryIDs(), nil +} +// GetFieldDeserializers the deserialization information for the current model +func (m *RepositoryRulesetConditionsForRepositoryIDs) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := m.RepositoryRulesetConditions.GetFieldDeserializers() + return res +} +// Serialize serializes information the current object +func (m *RepositoryRulesetConditionsForRepositoryIDs) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + err := m.RepositoryRulesetConditions.Serialize(writer) + if err != nil { + return err + } + return nil +} +// RepositoryRulesetConditionsForRepositoryIDsable +type RepositoryRulesetConditionsForRepositoryIDsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + RepositoryRulesetConditionsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_conditions_for_repository_names.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_conditions_for_repository_names.go new file mode 100644 index 000000000..ecd7e3b15 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_conditions_for_repository_names.go @@ -0,0 +1,39 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRulesetConditionsForRepositoryNames conditions to target repositories by name and refs by name +type RepositoryRulesetConditionsForRepositoryNames struct { + RepositoryRulesetConditions +} +// NewRepositoryRulesetConditionsForRepositoryNames instantiates a new RepositoryRulesetConditionsForRepositoryNames and sets the default values. +func NewRepositoryRulesetConditionsForRepositoryNames()(*RepositoryRulesetConditionsForRepositoryNames) { + m := &RepositoryRulesetConditionsForRepositoryNames{ + RepositoryRulesetConditions: *NewRepositoryRulesetConditions(), + } + return m +} +// CreateRepositoryRulesetConditionsForRepositoryNamesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateRepositoryRulesetConditionsForRepositoryNamesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRulesetConditionsForRepositoryNames(), nil +} +// GetFieldDeserializers the deserialization information for the current model +func (m *RepositoryRulesetConditionsForRepositoryNames) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := m.RepositoryRulesetConditions.GetFieldDeserializers() + return res +} +// Serialize serializes information the current object +func (m *RepositoryRulesetConditionsForRepositoryNames) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + err := m.RepositoryRulesetConditions.Serialize(writer) + if err != nil { + return err + } + return nil +} +// RepositoryRulesetConditionsForRepositoryNamesable +type RepositoryRulesetConditionsForRepositoryNamesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + RepositoryRulesetConditionsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_conditions_ref_name.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_conditions_ref_name.go new file mode 100644 index 000000000..93efdde7e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_conditions_ref_name.go @@ -0,0 +1,121 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRulesetConditions_ref_name struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Array of ref names or patterns to exclude. The condition will not pass if any of these patterns match. + exclude []string + // Array of ref names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~DEFAULT_BRANCH` to include the default branch or `~ALL` to include all branches. + include []string +} +// NewRepositoryRulesetConditions_ref_name instantiates a new RepositoryRulesetConditions_ref_name and sets the default values. +func NewRepositoryRulesetConditions_ref_name()(*RepositoryRulesetConditions_ref_name) { + m := &RepositoryRulesetConditions_ref_name{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRulesetConditions_ref_nameFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRulesetConditions_ref_nameFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRulesetConditions_ref_name(), 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 *RepositoryRulesetConditions_ref_name) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetExclude gets the exclude property value. Array of ref names or patterns to exclude. The condition will not pass if any of these patterns match. +// returns a []string when successful +func (m *RepositoryRulesetConditions_ref_name) GetExclude()([]string) { + return m.exclude +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRulesetConditions_ref_name) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["exclude"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetExclude(res) + } + return nil + } + res["include"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetInclude(res) + } + return nil + } + return res +} +// GetInclude gets the include property value. Array of ref names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~DEFAULT_BRANCH` to include the default branch or `~ALL` to include all branches. +// returns a []string when successful +func (m *RepositoryRulesetConditions_ref_name) GetInclude()([]string) { + return m.include +} +// Serialize serializes information the current object +func (m *RepositoryRulesetConditions_ref_name) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetExclude() != nil { + err := writer.WriteCollectionOfStringValues("exclude", m.GetExclude()) + if err != nil { + return err + } + } + if m.GetInclude() != nil { + err := writer.WriteCollectionOfStringValues("include", m.GetInclude()) + 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 *RepositoryRulesetConditions_ref_name) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetExclude sets the exclude property value. Array of ref names or patterns to exclude. The condition will not pass if any of these patterns match. +func (m *RepositoryRulesetConditions_ref_name) SetExclude(value []string)() { + m.exclude = value +} +// SetInclude sets the include property value. Array of ref names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~DEFAULT_BRANCH` to include the default branch or `~ALL` to include all branches. +func (m *RepositoryRulesetConditions_ref_name) SetInclude(value []string)() { + m.include = value +} +type RepositoryRulesetConditions_ref_nameable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetExclude()([]string) + GetInclude()([]string) + SetExclude(value []string)() + SetInclude(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_current_user_can_bypass.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_current_user_can_bypass.go new file mode 100644 index 000000000..e3ed3cc9d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_current_user_can_bypass.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The bypass type of the user making the API request for this ruleset. This field is only returned whenquerying the repository-level endpoint. +type RepositoryRuleset_current_user_can_bypass int + +const ( + ALWAYS_REPOSITORYRULESET_CURRENT_USER_CAN_BYPASS RepositoryRuleset_current_user_can_bypass = iota + PULL_REQUESTS_ONLY_REPOSITORYRULESET_CURRENT_USER_CAN_BYPASS + NEVER_REPOSITORYRULESET_CURRENT_USER_CAN_BYPASS +) + +func (i RepositoryRuleset_current_user_can_bypass) String() string { + return []string{"always", "pull_requests_only", "never"}[i] +} +func ParseRepositoryRuleset_current_user_can_bypass(v string) (any, error) { + result := ALWAYS_REPOSITORYRULESET_CURRENT_USER_CAN_BYPASS + switch v { + case "always": + result = ALWAYS_REPOSITORYRULESET_CURRENT_USER_CAN_BYPASS + case "pull_requests_only": + result = PULL_REQUESTS_ONLY_REPOSITORYRULESET_CURRENT_USER_CAN_BYPASS + case "never": + result = NEVER_REPOSITORYRULESET_CURRENT_USER_CAN_BYPASS + default: + return 0, errors.New("Unknown RepositoryRuleset_current_user_can_bypass value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleset_current_user_can_bypass(values []RepositoryRuleset_current_user_can_bypass) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleset_current_user_can_bypass) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_source_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_source_type.go new file mode 100644 index 000000000..2334e3a80 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_source_type.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The type of the source of the ruleset +type RepositoryRuleset_source_type int + +const ( + REPOSITORY_REPOSITORYRULESET_SOURCE_TYPE RepositoryRuleset_source_type = iota + ORGANIZATION_REPOSITORYRULESET_SOURCE_TYPE +) + +func (i RepositoryRuleset_source_type) String() string { + return []string{"Repository", "Organization"}[i] +} +func ParseRepositoryRuleset_source_type(v string) (any, error) { + result := REPOSITORY_REPOSITORYRULESET_SOURCE_TYPE + switch v { + case "Repository": + result = REPOSITORY_REPOSITORYRULESET_SOURCE_TYPE + case "Organization": + result = ORGANIZATION_REPOSITORYRULESET_SOURCE_TYPE + default: + return 0, errors.New("Unknown RepositoryRuleset_source_type value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleset_source_type(values []RepositoryRuleset_source_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleset_source_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_target.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_target.go new file mode 100644 index 000000000..682eb98b6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_ruleset_target.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The target of the ruleset**Note**: The `push` target is in beta and is subject to change. +type RepositoryRuleset_target int + +const ( + BRANCH_REPOSITORYRULESET_TARGET RepositoryRuleset_target = iota + TAG_REPOSITORYRULESET_TARGET + PUSH_REPOSITORYRULESET_TARGET +) + +func (i RepositoryRuleset_target) String() string { + return []string{"branch", "tag", "push"}[i] +} +func ParseRepositoryRuleset_target(v string) (any, error) { + result := BRANCH_REPOSITORYRULESET_TARGET + switch v { + case "branch": + result = BRANCH_REPOSITORYRULESET_TARGET + case "tag": + result = TAG_REPOSITORYRULESET_TARGET + case "push": + result = PUSH_REPOSITORYRULESET_TARGET + default: + return 0, errors.New("Unknown RepositoryRuleset_target value: " + v) + } + return &result, nil +} +func SerializeRepositoryRuleset_target(values []RepositoryRuleset_target) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleset_target) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_squash_merge_commit_message.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_squash_merge_commit_message.go new file mode 100644 index 000000000..e3b0aa9fb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_squash_merge_commit_message.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +type Repository_squash_merge_commit_message int + +const ( + PR_BODY_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE Repository_squash_merge_commit_message = iota + COMMIT_MESSAGES_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + BLANK_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE +) + +func (i Repository_squash_merge_commit_message) String() string { + return []string{"PR_BODY", "COMMIT_MESSAGES", "BLANK"}[i] +} +func ParseRepository_squash_merge_commit_message(v string) (any, error) { + result := PR_BODY_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + case "COMMIT_MESSAGES": + result = COMMIT_MESSAGES_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + default: + return 0, errors.New("Unknown Repository_squash_merge_commit_message value: " + v) + } + return &result, nil +} +func SerializeRepository_squash_merge_commit_message(values []Repository_squash_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Repository_squash_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_squash_merge_commit_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_squash_merge_commit_title.go new file mode 100644 index 000000000..c01b3d317 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_squash_merge_commit_title.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +type Repository_squash_merge_commit_title int + +const ( + PR_TITLE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE Repository_squash_merge_commit_title = iota + COMMIT_OR_PR_TITLE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE +) + +func (i Repository_squash_merge_commit_title) String() string { + return []string{"PR_TITLE", "COMMIT_OR_PR_TITLE"}[i] +} +func ParseRepository_squash_merge_commit_title(v string) (any, error) { + result := PR_TITLE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE + case "COMMIT_OR_PR_TITLE": + result = COMMIT_OR_PR_TITLE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE + default: + return 0, errors.New("Unknown Repository_squash_merge_commit_title value: " + v) + } + return &result, nil +} +func SerializeRepository_squash_merge_commit_title(values []Repository_squash_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Repository_squash_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_subscription.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_subscription.go new file mode 100644 index 000000000..da6873424 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_subscription.go @@ -0,0 +1,227 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositorySubscription repository invitations let you manage who you collaborate with. +type RepositorySubscription struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Determines if all notifications should be blocked from this repository. + ignored *bool + // The reason property + reason *string + // The repository_url property + repository_url *string + // Determines if notifications should be received from this repository. + subscribed *bool + // The url property + url *string +} +// NewRepositorySubscription instantiates a new RepositorySubscription and sets the default values. +func NewRepositorySubscription()(*RepositorySubscription) { + m := &RepositorySubscription{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositorySubscriptionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositorySubscriptionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositorySubscription(), 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 *RepositorySubscription) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *RepositorySubscription) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositorySubscription) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["ignored"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIgnored(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["subscribed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribed(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetIgnored gets the ignored property value. Determines if all notifications should be blocked from this repository. +// returns a *bool when successful +func (m *RepositorySubscription) GetIgnored()(*bool) { + return m.ignored +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *RepositorySubscription) GetReason()(*string) { + return m.reason +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *RepositorySubscription) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetSubscribed gets the subscribed property value. Determines if notifications should be received from this repository. +// returns a *bool when successful +func (m *RepositorySubscription) GetSubscribed()(*bool) { + return m.subscribed +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *RepositorySubscription) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *RepositorySubscription) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("ignored", m.GetIgnored()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("subscribed", m.GetSubscribed()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *RepositorySubscription) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *RepositorySubscription) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetIgnored sets the ignored property value. Determines if all notifications should be blocked from this repository. +func (m *RepositorySubscription) SetIgnored(value *bool)() { + m.ignored = value +} +// SetReason sets the reason property value. The reason property +func (m *RepositorySubscription) SetReason(value *string)() { + m.reason = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *RepositorySubscription) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetSubscribed sets the subscribed property value. Determines if notifications should be received from this repository. +func (m *RepositorySubscription) SetSubscribed(value *bool)() { + m.subscribed = value +} +// SetUrl sets the url property value. The url property +func (m *RepositorySubscription) SetUrl(value *string)() { + m.url = value +} +type RepositorySubscriptionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetIgnored()(*bool) + GetReason()(*string) + GetRepositoryUrl()(*string) + GetSubscribed()(*bool) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetIgnored(value *bool)() + SetReason(value *string)() + SetRepositoryUrl(value *string)() + SetSubscribed(value *bool)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository.go new file mode 100644 index 000000000..05735eae2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository.go @@ -0,0 +1,2496 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Repository_template_repository +type Repository_template_repository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The allow_auto_merge property + allow_auto_merge *bool + // The allow_merge_commit property + allow_merge_commit *bool + // The allow_rebase_merge property + allow_rebase_merge *bool + // The allow_squash_merge property + allow_squash_merge *bool + // The allow_update_branch property + allow_update_branch *bool + // The archive_url property + archive_url *string + // The archived property + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *string + // The default_branch property + default_branch *string + // The delete_branch_on_merge property + delete_branch_on_merge *bool + // The deployments_url property + deployments_url *string + // The description property + description *string + // The disabled property + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // The has_downloads property + has_downloads *bool + // The has_issues property + has_issues *bool + // The has_pages property + has_pages *bool + // The has_projects property + has_projects *bool + // The has_wiki property + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The is_template property + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. + merge_commit_message *Repository_template_repository_merge_commit_message + // The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + merge_commit_title *Repository_template_repository_merge_commit_title + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name property + name *string + // The network_count property + network_count *int32 + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues_count property + open_issues_count *int32 + // The owner property + owner Repository_template_repository_ownerable + // The permissions property + permissions Repository_template_repository_permissionsable + // The private property + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *string + // The releases_url property + releases_url *string + // The size property + size *int32 + // The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. + squash_merge_commit_message *Repository_template_repository_squash_merge_commit_message + // The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + squash_merge_commit_title *Repository_template_repository_squash_merge_commit_title + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The statuses_url property + statuses_url *string + // The subscribers_count property + subscribers_count *int32 + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *string + // The url property + url *string + // The use_squash_pr_title_as_default property + use_squash_pr_title_as_default *bool + // The visibility property + visibility *string + // The watchers_count property + watchers_count *int32 +} +// NewRepository_template_repository instantiates a new repository_template_repository and sets the default values. +func NewRepository_template_repository()(*Repository_template_repository) { + m := &Repository_template_repository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepository_template_repositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateRepository_template_repositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepository_template_repository(), 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. +func (m *Repository_template_repository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. The allow_auto_merge property +func (m *Repository_template_repository) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowMergeCommit gets the allow_merge_commit property value. The allow_merge_commit property +func (m *Repository_template_repository) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. The allow_rebase_merge property +func (m *Repository_template_repository) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. The allow_squash_merge property +func (m *Repository_template_repository) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetAllowUpdateBranch gets the allow_update_branch property value. The allow_update_branch property +func (m *Repository_template_repository) GetAllowUpdateBranch()(*bool) { + return m.allow_update_branch +} +// GetArchived gets the archived property value. The archived property +func (m *Repository_template_repository) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +func (m *Repository_template_repository) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +func (m *Repository_template_repository) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +func (m *Repository_template_repository) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +func (m *Repository_template_repository) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +func (m *Repository_template_repository) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +func (m *Repository_template_repository) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +func (m *Repository_template_repository) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +func (m *Repository_template_repository) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +func (m *Repository_template_repository) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +func (m *Repository_template_repository) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +func (m *Repository_template_repository) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +func (m *Repository_template_repository) GetCreatedAt()(*string) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default_branch property +func (m *Repository_template_repository) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. The delete_branch_on_merge property +func (m *Repository_template_repository) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +func (m *Repository_template_repository) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +func (m *Repository_template_repository) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. The disabled property +func (m *Repository_template_repository) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +func (m *Repository_template_repository) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +func (m *Repository_template_repository) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +func (m *Repository_template_repository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["allow_update_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowUpdateBranch(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepository_template_repository_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitMessage(val.(*Repository_template_repository_merge_commit_message)) + } + return nil + } + res["merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepository_template_repository_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitTitle(val.(*Repository_template_repository_merge_commit_title)) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["network_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNetworkCount(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepository_template_repository_ownerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(Repository_template_repository_ownerable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepository_template_repository_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(Repository_template_repository_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["squash_merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepository_template_repository_squash_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitMessage(val.(*Repository_template_repository_squash_merge_commit_message)) + } + return nil + } + res["squash_merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepository_template_repository_squash_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitTitle(val.(*Repository_template_repository_squash_merge_commit_title)) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersCount(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["topics"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["use_squash_pr_title_as_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseSquashPrTitleAsDefault(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +func (m *Repository_template_repository) GetFork()(*bool) { + return m.fork +} +// GetForksCount gets the forks_count property value. The forks_count property +func (m *Repository_template_repository) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +func (m *Repository_template_repository) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +func (m *Repository_template_repository) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +func (m *Repository_template_repository) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +func (m *Repository_template_repository) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +func (m *Repository_template_repository) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +func (m *Repository_template_repository) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDownloads gets the has_downloads property value. The has_downloads property +func (m *Repository_template_repository) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. The has_issues property +func (m *Repository_template_repository) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +func (m *Repository_template_repository) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. The has_projects property +func (m *Repository_template_repository) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. The has_wiki property +func (m *Repository_template_repository) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +func (m *Repository_template_repository) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +func (m *Repository_template_repository) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +func (m *Repository_template_repository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +func (m *Repository_template_repository) GetId()(*int32) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +func (m *Repository_template_repository) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +func (m *Repository_template_repository) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +func (m *Repository_template_repository) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. The is_template property +func (m *Repository_template_repository) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +func (m *Repository_template_repository) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +func (m *Repository_template_repository) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +func (m *Repository_template_repository) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +func (m *Repository_template_repository) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetMergeCommitMessage gets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +func (m *Repository_template_repository) GetMergeCommitMessage()(*Repository_template_repository_merge_commit_message) { + return m.merge_commit_message +} +// GetMergeCommitTitle gets the merge_commit_title property value. The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +func (m *Repository_template_repository) GetMergeCommitTitle()(*Repository_template_repository_merge_commit_title) { + return m.merge_commit_title +} +// GetMergesUrl gets the merges_url property value. The merges_url property +func (m *Repository_template_repository) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +func (m *Repository_template_repository) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +func (m *Repository_template_repository) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name property +func (m *Repository_template_repository) GetName()(*string) { + return m.name +} +// GetNetworkCount gets the network_count property value. The network_count property +func (m *Repository_template_repository) GetNetworkCount()(*int32) { + return m.network_count +} +// GetNodeId gets the node_id property value. The node_id property +func (m *Repository_template_repository) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +func (m *Repository_template_repository) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +func (m *Repository_template_repository) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. The owner property +func (m *Repository_template_repository) GetOwner()(Repository_template_repository_ownerable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +func (m *Repository_template_repository) GetPermissions()(Repository_template_repository_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. The private property +func (m *Repository_template_repository) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +func (m *Repository_template_repository) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +func (m *Repository_template_repository) GetPushedAt()(*string) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +func (m *Repository_template_repository) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetSize gets the size property value. The size property +func (m *Repository_template_repository) GetSize()(*int32) { + return m.size +} +// GetSquashMergeCommitMessage gets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +func (m *Repository_template_repository) GetSquashMergeCommitMessage()(*Repository_template_repository_squash_merge_commit_message) { + return m.squash_merge_commit_message +} +// GetSquashMergeCommitTitle gets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +func (m *Repository_template_repository) GetSquashMergeCommitTitle()(*Repository_template_repository_squash_merge_commit_title) { + return m.squash_merge_commit_title +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +func (m *Repository_template_repository) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +func (m *Repository_template_repository) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +func (m *Repository_template_repository) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +func (m *Repository_template_repository) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersCount gets the subscribers_count property value. The subscribers_count property +func (m *Repository_template_repository) GetSubscribersCount()(*int32) { + return m.subscribers_count +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +func (m *Repository_template_repository) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +func (m *Repository_template_repository) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +func (m *Repository_template_repository) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +func (m *Repository_template_repository) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +func (m *Repository_template_repository) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +func (m *Repository_template_repository) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTopics gets the topics property value. The topics property +func (m *Repository_template_repository) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +func (m *Repository_template_repository) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +func (m *Repository_template_repository) GetUpdatedAt()(*string) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +func (m *Repository_template_repository) GetUrl()(*string) { + return m.url +} +// GetUseSquashPrTitleAsDefault gets the use_squash_pr_title_as_default property value. The use_squash_pr_title_as_default property +func (m *Repository_template_repository) GetUseSquashPrTitleAsDefault()(*bool) { + return m.use_squash_pr_title_as_default +} +// GetVisibility gets the visibility property value. The visibility property +func (m *Repository_template_repository) GetVisibility()(*string) { + return m.visibility +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +func (m *Repository_template_repository) GetWatchersCount()(*int32) { + return m.watchers_count +} +// Serialize serializes information the current object +func (m *Repository_template_repository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_update_branch", m.GetAllowUpdateBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + if m.GetMergeCommitMessage() != nil { + cast := (*m.GetMergeCommitMessage()).String() + err := writer.WriteStringValue("merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetMergeCommitTitle() != nil { + cast := (*m.GetMergeCommitTitle()).String() + err := writer.WriteStringValue("merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("network_count", m.GetNetworkCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitMessage() != nil { + cast := (*m.GetSquashMergeCommitMessage()).String() + err := writer.WriteStringValue("squash_merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitTitle() != nil { + cast := (*m.GetSquashMergeCommitTitle()).String() + err := writer.WriteStringValue("squash_merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("subscribers_count", m.GetSubscribersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_squash_pr_title_as_default", m.GetUseSquashPrTitleAsDefault()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + 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 *Repository_template_repository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. The allow_auto_merge property +func (m *Repository_template_repository) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. The allow_merge_commit property +func (m *Repository_template_repository) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. The allow_rebase_merge property +func (m *Repository_template_repository) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. The allow_squash_merge property +func (m *Repository_template_repository) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetAllowUpdateBranch sets the allow_update_branch property value. The allow_update_branch property +func (m *Repository_template_repository) SetAllowUpdateBranch(value *bool)() { + m.allow_update_branch = value +} +// SetArchived sets the archived property value. The archived property +func (m *Repository_template_repository) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *Repository_template_repository) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *Repository_template_repository) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *Repository_template_repository) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *Repository_template_repository) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *Repository_template_repository) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *Repository_template_repository) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *Repository_template_repository) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *Repository_template_repository) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *Repository_template_repository) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *Repository_template_repository) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *Repository_template_repository) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Repository_template_repository) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default_branch property +func (m *Repository_template_repository) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. The delete_branch_on_merge property +func (m *Repository_template_repository) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *Repository_template_repository) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *Repository_template_repository) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. The disabled property +func (m *Repository_template_repository) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *Repository_template_repository) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *Repository_template_repository) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *Repository_template_repository) SetFork(value *bool)() { + m.fork = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *Repository_template_repository) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *Repository_template_repository) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *Repository_template_repository) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *Repository_template_repository) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *Repository_template_repository) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *Repository_template_repository) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *Repository_template_repository) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDownloads sets the has_downloads property value. The has_downloads property +func (m *Repository_template_repository) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. The has_issues property +func (m *Repository_template_repository) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *Repository_template_repository) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. The has_projects property +func (m *Repository_template_repository) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. The has_wiki property +func (m *Repository_template_repository) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *Repository_template_repository) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *Repository_template_repository) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Repository_template_repository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Repository_template_repository) SetId(value *int32)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *Repository_template_repository) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *Repository_template_repository) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *Repository_template_repository) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. The is_template property +func (m *Repository_template_repository) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *Repository_template_repository) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *Repository_template_repository) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *Repository_template_repository) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *Repository_template_repository) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetMergeCommitMessage sets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +func (m *Repository_template_repository) SetMergeCommitMessage(value *Repository_template_repository_merge_commit_message)() { + m.merge_commit_message = value +} +// SetMergeCommitTitle sets the merge_commit_title property value. The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +func (m *Repository_template_repository) SetMergeCommitTitle(value *Repository_template_repository_merge_commit_title)() { + m.merge_commit_title = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *Repository_template_repository) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *Repository_template_repository) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *Repository_template_repository) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name property +func (m *Repository_template_repository) SetName(value *string)() { + m.name = value +} +// SetNetworkCount sets the network_count property value. The network_count property +func (m *Repository_template_repository) SetNetworkCount(value *int32)() { + m.network_count = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Repository_template_repository) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *Repository_template_repository) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *Repository_template_repository) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. The owner property +func (m *Repository_template_repository) SetOwner(value Repository_template_repository_ownerable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *Repository_template_repository) SetPermissions(value Repository_template_repository_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. The private property +func (m *Repository_template_repository) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *Repository_template_repository) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *Repository_template_repository) SetPushedAt(value *string)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *Repository_template_repository) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetSize sets the size property value. The size property +func (m *Repository_template_repository) SetSize(value *int32)() { + m.size = value +} +// SetSquashMergeCommitMessage sets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +func (m *Repository_template_repository) SetSquashMergeCommitMessage(value *Repository_template_repository_squash_merge_commit_message)() { + m.squash_merge_commit_message = value +} +// SetSquashMergeCommitTitle sets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +func (m *Repository_template_repository) SetSquashMergeCommitTitle(value *Repository_template_repository_squash_merge_commit_title)() { + m.squash_merge_commit_title = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *Repository_template_repository) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *Repository_template_repository) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *Repository_template_repository) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *Repository_template_repository) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersCount sets the subscribers_count property value. The subscribers_count property +func (m *Repository_template_repository) SetSubscribersCount(value *int32)() { + m.subscribers_count = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *Repository_template_repository) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *Repository_template_repository) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *Repository_template_repository) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *Repository_template_repository) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *Repository_template_repository) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *Repository_template_repository) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTopics sets the topics property value. The topics property +func (m *Repository_template_repository) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *Repository_template_repository) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Repository_template_repository) SetUpdatedAt(value *string)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Repository_template_repository) SetUrl(value *string)() { + m.url = value +} +// SetUseSquashPrTitleAsDefault sets the use_squash_pr_title_as_default property value. The use_squash_pr_title_as_default property +func (m *Repository_template_repository) SetUseSquashPrTitleAsDefault(value *bool)() { + m.use_squash_pr_title_as_default = value +} +// SetVisibility sets the visibility property value. The visibility property +func (m *Repository_template_repository) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *Repository_template_repository) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// Repository_template_repositoryable +type Repository_template_repositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetAllowUpdateBranch()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*string) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetMergeCommitMessage()(*Repository_template_repository_merge_commit_message) + GetMergeCommitTitle()(*Repository_template_repository_merge_commit_title) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNetworkCount()(*int32) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssuesCount()(*int32) + GetOwner()(Repository_template_repository_ownerable) + GetPermissions()(Repository_template_repository_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*string) + GetReleasesUrl()(*string) + GetSize()(*int32) + GetSquashMergeCommitMessage()(*Repository_template_repository_squash_merge_commit_message) + GetSquashMergeCommitTitle()(*Repository_template_repository_squash_merge_commit_title) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersCount()(*int32) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*string) + GetUrl()(*string) + GetUseSquashPrTitleAsDefault()(*bool) + GetVisibility()(*string) + GetWatchersCount()(*int32) + SetAllowAutoMerge(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetAllowUpdateBranch(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *string)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetMergeCommitMessage(value *Repository_template_repository_merge_commit_message)() + SetMergeCommitTitle(value *Repository_template_repository_merge_commit_title)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNetworkCount(value *int32)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssuesCount(value *int32)() + SetOwner(value Repository_template_repository_ownerable)() + SetPermissions(value Repository_template_repository_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *string)() + SetReleasesUrl(value *string)() + SetSize(value *int32)() + SetSquashMergeCommitMessage(value *Repository_template_repository_squash_merge_commit_message)() + SetSquashMergeCommitTitle(value *Repository_template_repository_squash_merge_commit_title)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersCount(value *int32)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *string)() + SetUrl(value *string)() + SetUseSquashPrTitleAsDefault(value *bool)() + SetVisibility(value *string)() + SetWatchersCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_merge_commit_message.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_merge_commit_message.go new file mode 100644 index 000000000..ca435b70c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_merge_commit_message.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +type Repository_template_repository_merge_commit_message int + +const ( + PR_BODY_REPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_MESSAGE Repository_template_repository_merge_commit_message = iota + PR_TITLE_REPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_MESSAGE + BLANK_REPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_MESSAGE +) + +func (i Repository_template_repository_merge_commit_message) String() string { + return []string{"PR_BODY", "PR_TITLE", "BLANK"}[i] +} +func ParseRepository_template_repository_merge_commit_message(v string) (any, error) { + result := PR_BODY_REPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_REPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_MESSAGE + case "PR_TITLE": + result = PR_TITLE_REPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_REPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_MESSAGE + default: + return 0, errors.New("Unknown Repository_template_repository_merge_commit_message value: " + v) + } + return &result, nil +} +func SerializeRepository_template_repository_merge_commit_message(values []Repository_template_repository_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Repository_template_repository_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_merge_commit_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_merge_commit_title.go new file mode 100644 index 000000000..9c872f42b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_merge_commit_title.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +type Repository_template_repository_merge_commit_title int + +const ( + PR_TITLE_REPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_TITLE Repository_template_repository_merge_commit_title = iota + MERGE_MESSAGE_REPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_TITLE +) + +func (i Repository_template_repository_merge_commit_title) String() string { + return []string{"PR_TITLE", "MERGE_MESSAGE"}[i] +} +func ParseRepository_template_repository_merge_commit_title(v string) (any, error) { + result := PR_TITLE_REPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_REPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_TITLE + case "MERGE_MESSAGE": + result = MERGE_MESSAGE_REPOSITORY_TEMPLATE_REPOSITORY_MERGE_COMMIT_TITLE + default: + return 0, errors.New("Unknown Repository_template_repository_merge_commit_title value: " + v) + } + return &result, nil +} +func SerializeRepository_template_repository_merge_commit_title(values []Repository_template_repository_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Repository_template_repository_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_owner.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_owner.go new file mode 100644 index 000000000..6d95d759f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_owner.go @@ -0,0 +1,554 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Repository_template_repository_owner +type Repository_template_repository_owner struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int32 + // The login property + login *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewRepository_template_repository_owner instantiates a new repository_template_repository_owner and sets the default values. +func NewRepository_template_repository_owner()(*Repository_template_repository_owner) { + m := &Repository_template_repository_owner{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepository_template_repository_ownerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateRepository_template_repository_ownerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepository_template_repository_owner(), 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. +func (m *Repository_template_repository_owner) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +func (m *Repository_template_repository_owner) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEventsUrl gets the events_url property value. The events_url property +func (m *Repository_template_repository_owner) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +func (m *Repository_template_repository_owner) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +func (m *Repository_template_repository_owner) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +func (m *Repository_template_repository_owner) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +func (m *Repository_template_repository_owner) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +func (m *Repository_template_repository_owner) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +func (m *Repository_template_repository_owner) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +func (m *Repository_template_repository_owner) GetId()(*int32) { + return m.id +} +// GetLogin gets the login property value. The login property +func (m *Repository_template_repository_owner) GetLogin()(*string) { + return m.login +} +// GetNodeId gets the node_id property value. The node_id property +func (m *Repository_template_repository_owner) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +func (m *Repository_template_repository_owner) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +func (m *Repository_template_repository_owner) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +func (m *Repository_template_repository_owner) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +func (m *Repository_template_repository_owner) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +func (m *Repository_template_repository_owner) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +func (m *Repository_template_repository_owner) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +func (m *Repository_template_repository_owner) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +func (m *Repository_template_repository_owner) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Repository_template_repository_owner) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Repository_template_repository_owner) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *Repository_template_repository_owner) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *Repository_template_repository_owner) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *Repository_template_repository_owner) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *Repository_template_repository_owner) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *Repository_template_repository_owner) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *Repository_template_repository_owner) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Repository_template_repository_owner) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Repository_template_repository_owner) SetId(value *int32)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *Repository_template_repository_owner) SetLogin(value *string)() { + m.login = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Repository_template_repository_owner) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *Repository_template_repository_owner) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *Repository_template_repository_owner) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *Repository_template_repository_owner) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *Repository_template_repository_owner) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *Repository_template_repository_owner) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *Repository_template_repository_owner) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Repository_template_repository_owner) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *Repository_template_repository_owner) SetUrl(value *string)() { + m.url = value +} +// Repository_template_repository_ownerable +type Repository_template_repository_ownerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLogin()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLogin(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_permissions.go new file mode 100644 index 000000000..a48053552 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_permissions.go @@ -0,0 +1,190 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Repository_template_repository_permissions +type Repository_template_repository_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewRepository_template_repository_permissions instantiates a new repository_template_repository_permissions and sets the default values. +func NewRepository_template_repository_permissions()(*Repository_template_repository_permissions) { + m := &Repository_template_repository_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepository_template_repository_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateRepository_template_repository_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepository_template_repository_permissions(), 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. +func (m *Repository_template_repository_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +func (m *Repository_template_repository_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +func (m *Repository_template_repository_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +func (m *Repository_template_repository_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +func (m *Repository_template_repository_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +func (m *Repository_template_repository_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +func (m *Repository_template_repository_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *Repository_template_repository_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *Repository_template_repository_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *Repository_template_repository_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *Repository_template_repository_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *Repository_template_repository_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *Repository_template_repository_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *Repository_template_repository_permissions) SetTriage(value *bool)() { + m.triage = value +} +// Repository_template_repository_permissionsable +type Repository_template_repository_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_squash_merge_commit_message.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_squash_merge_commit_message.go new file mode 100644 index 000000000..a9bcec8e6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_squash_merge_commit_message.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +type Repository_template_repository_squash_merge_commit_message int + +const ( + PR_BODY_REPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE Repository_template_repository_squash_merge_commit_message = iota + COMMIT_MESSAGES_REPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + BLANK_REPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE +) + +func (i Repository_template_repository_squash_merge_commit_message) String() string { + return []string{"PR_BODY", "COMMIT_MESSAGES", "BLANK"}[i] +} +func ParseRepository_template_repository_squash_merge_commit_message(v string) (any, error) { + result := PR_BODY_REPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_REPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + case "COMMIT_MESSAGES": + result = COMMIT_MESSAGES_REPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_REPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + default: + return 0, errors.New("Unknown Repository_template_repository_squash_merge_commit_message value: " + v) + } + return &result, nil +} +func SerializeRepository_template_repository_squash_merge_commit_message(values []Repository_template_repository_squash_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Repository_template_repository_squash_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_squash_merge_commit_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_squash_merge_commit_title.go new file mode 100644 index 000000000..8a2a6b9f9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/repository_template_repository_squash_merge_commit_title.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +type Repository_template_repository_squash_merge_commit_title int + +const ( + PR_TITLE_REPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE Repository_template_repository_squash_merge_commit_title = iota + COMMIT_OR_PR_TITLE_REPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE +) + +func (i Repository_template_repository_squash_merge_commit_title) String() string { + return []string{"PR_TITLE", "COMMIT_OR_PR_TITLE"}[i] +} +func ParseRepository_template_repository_squash_merge_commit_title(v string) (any, error) { + result := PR_TITLE_REPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_REPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE + case "COMMIT_OR_PR_TITLE": + result = COMMIT_OR_PR_TITLE_REPOSITORY_TEMPLATE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE + default: + return 0, errors.New("Unknown Repository_template_repository_squash_merge_commit_title value: " + v) + } + return &result, nil +} +func SerializeRepository_template_repository_squash_merge_commit_title(values []Repository_template_repository_squash_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Repository_template_repository_squash_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/review_comment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_comment.go new file mode 100644 index 000000000..f9e40b4fc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_comment.go @@ -0,0 +1,872 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ReviewComment legacy Review Comment +type ReviewComment struct { + // The _links property + _links ReviewComment__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How the author is associated with the repository. + author_association *AuthorAssociation + // The body property + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // The commit_id property + commit_id *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The diff_hunk property + diff_hunk *string + // The html_url property + html_url *string + // The id property + id *int64 + // The in_reply_to_id property + in_reply_to_id *int32 + // The line of the blob to which the comment applies. The last line of the range for a multi-line comment + line *int32 + // The node_id property + node_id *string + // The original_commit_id property + original_commit_id *string + // The original line of the blob to which the comment applies. The last line of the range for a multi-line comment + original_line *int32 + // The original_position property + original_position *int32 + // The original first line of the range for a multi-line comment. + original_start_line *int32 + // The path property + path *string + // The position property + position *int32 + // The pull_request_review_id property + pull_request_review_id *int64 + // The pull_request_url property + pull_request_url *string + // The reactions property + reactions ReactionRollupable + // The side of the first line of the range for a multi-line comment. + side *ReviewComment_side + // The first line of the range for a multi-line comment. + start_line *int32 + // The side of the first line of the range for a multi-line comment. + start_side *ReviewComment_start_side + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewReviewComment instantiates a new ReviewComment and sets the default values. +func NewReviewComment()(*ReviewComment) { + m := &ReviewComment{ + } + m.SetAdditionalData(make(map[string]any)) + sideValue := RIGHT_REVIEWCOMMENT_SIDE + m.SetSide(&sideValue) + start_sideValue := RIGHT_REVIEWCOMMENT_START_SIDE + m.SetStartSide(&start_sideValue) + return m +} +// CreateReviewCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReviewCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReviewComment(), 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 *ReviewComment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *ReviewComment) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *ReviewComment) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *ReviewComment) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *ReviewComment) GetBodyText()(*string) { + return m.body_text +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *ReviewComment) GetCommitId()(*string) { + return m.commit_id +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *ReviewComment) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDiffHunk gets the diff_hunk property value. The diff_hunk property +// returns a *string when successful +func (m *ReviewComment) GetDiffHunk()(*string) { + return m.diff_hunk +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReviewComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReviewComment__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(ReviewComment__linksable)) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["diff_hunk"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiffHunk(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["in_reply_to_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetInReplyToId(val) + } + return nil + } + res["line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLine(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["original_commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOriginalCommitId(val) + } + return nil + } + res["original_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOriginalLine(val) + } + return nil + } + res["original_position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOriginalPosition(val) + } + return nil + } + res["original_start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOriginalStartLine(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["position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPosition(val) + } + return nil + } + res["pull_request_review_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestReviewId(val) + } + return nil + } + res["pull_request_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestUrl(val) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["side"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseReviewComment_side) + if err != nil { + return err + } + if val != nil { + m.SetSide(val.(*ReviewComment_side)) + } + return nil + } + res["start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartLine(val) + } + return nil + } + res["start_side"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseReviewComment_start_side) + if err != nil { + return err + } + if val != nil { + m.SetStartSide(val.(*ReviewComment_start_side)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *ReviewComment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *ReviewComment) GetId()(*int64) { + return m.id +} +// GetInReplyToId gets the in_reply_to_id property value. The in_reply_to_id property +// returns a *int32 when successful +func (m *ReviewComment) GetInReplyToId()(*int32) { + return m.in_reply_to_id +} +// GetLine gets the line property value. The line of the blob to which the comment applies. The last line of the range for a multi-line comment +// returns a *int32 when successful +func (m *ReviewComment) GetLine()(*int32) { + return m.line +} +// GetLinks gets the _links property value. The _links property +// returns a ReviewComment__linksable when successful +func (m *ReviewComment) GetLinks()(ReviewComment__linksable) { + return m._links +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *ReviewComment) GetNodeId()(*string) { + return m.node_id +} +// GetOriginalCommitId gets the original_commit_id property value. The original_commit_id property +// returns a *string when successful +func (m *ReviewComment) GetOriginalCommitId()(*string) { + return m.original_commit_id +} +// GetOriginalLine gets the original_line property value. The original line of the blob to which the comment applies. The last line of the range for a multi-line comment +// returns a *int32 when successful +func (m *ReviewComment) GetOriginalLine()(*int32) { + return m.original_line +} +// GetOriginalPosition gets the original_position property value. The original_position property +// returns a *int32 when successful +func (m *ReviewComment) GetOriginalPosition()(*int32) { + return m.original_position +} +// GetOriginalStartLine gets the original_start_line property value. The original first line of the range for a multi-line comment. +// returns a *int32 when successful +func (m *ReviewComment) GetOriginalStartLine()(*int32) { + return m.original_start_line +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *ReviewComment) GetPath()(*string) { + return m.path +} +// GetPosition gets the position property value. The position property +// returns a *int32 when successful +func (m *ReviewComment) GetPosition()(*int32) { + return m.position +} +// GetPullRequestReviewId gets the pull_request_review_id property value. The pull_request_review_id property +// returns a *int64 when successful +func (m *ReviewComment) GetPullRequestReviewId()(*int64) { + return m.pull_request_review_id +} +// GetPullRequestUrl gets the pull_request_url property value. The pull_request_url property +// returns a *string when successful +func (m *ReviewComment) GetPullRequestUrl()(*string) { + return m.pull_request_url +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *ReviewComment) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetSide gets the side property value. The side of the first line of the range for a multi-line comment. +// returns a *ReviewComment_side when successful +func (m *ReviewComment) GetSide()(*ReviewComment_side) { + return m.side +} +// GetStartLine gets the start_line property value. The first line of the range for a multi-line comment. +// returns a *int32 when successful +func (m *ReviewComment) GetStartLine()(*int32) { + return m.start_line +} +// GetStartSide gets the start_side property value. The side of the first line of the range for a multi-line comment. +// returns a *ReviewComment_start_side when successful +func (m *ReviewComment) GetStartSide()(*ReviewComment_start_side) { + return m.start_side +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *ReviewComment) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ReviewComment) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *ReviewComment) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *ReviewComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("diff_hunk", m.GetDiffHunk()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("in_reply_to_id", m.GetInReplyToId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("line", m.GetLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("original_commit_id", m.GetOriginalCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("original_line", m.GetOriginalLine()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("original_position", m.GetOriginalPosition()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("original_start_line", m.GetOriginalStartLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("position", m.GetPosition()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("pull_request_review_id", m.GetPullRequestReviewId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pull_request_url", m.GetPullRequestUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + if m.GetSide() != nil { + cast := (*m.GetSide()).String() + err := writer.WriteStringValue("side", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("start_line", m.GetStartLine()) + if err != nil { + return err + } + } + if m.GetStartSide() != nil { + cast := (*m.GetStartSide()).String() + err := writer.WriteStringValue("start_side", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *ReviewComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *ReviewComment) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. The body property +func (m *ReviewComment) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *ReviewComment) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *ReviewComment) SetBodyText(value *string)() { + m.body_text = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *ReviewComment) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ReviewComment) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDiffHunk sets the diff_hunk property value. The diff_hunk property +func (m *ReviewComment) SetDiffHunk(value *string)() { + m.diff_hunk = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *ReviewComment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *ReviewComment) SetId(value *int64)() { + m.id = value +} +// SetInReplyToId sets the in_reply_to_id property value. The in_reply_to_id property +func (m *ReviewComment) SetInReplyToId(value *int32)() { + m.in_reply_to_id = value +} +// SetLine sets the line property value. The line of the blob to which the comment applies. The last line of the range for a multi-line comment +func (m *ReviewComment) SetLine(value *int32)() { + m.line = value +} +// SetLinks sets the _links property value. The _links property +func (m *ReviewComment) SetLinks(value ReviewComment__linksable)() { + m._links = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *ReviewComment) SetNodeId(value *string)() { + m.node_id = value +} +// SetOriginalCommitId sets the original_commit_id property value. The original_commit_id property +func (m *ReviewComment) SetOriginalCommitId(value *string)() { + m.original_commit_id = value +} +// SetOriginalLine sets the original_line property value. The original line of the blob to which the comment applies. The last line of the range for a multi-line comment +func (m *ReviewComment) SetOriginalLine(value *int32)() { + m.original_line = value +} +// SetOriginalPosition sets the original_position property value. The original_position property +func (m *ReviewComment) SetOriginalPosition(value *int32)() { + m.original_position = value +} +// SetOriginalStartLine sets the original_start_line property value. The original first line of the range for a multi-line comment. +func (m *ReviewComment) SetOriginalStartLine(value *int32)() { + m.original_start_line = value +} +// SetPath sets the path property value. The path property +func (m *ReviewComment) SetPath(value *string)() { + m.path = value +} +// SetPosition sets the position property value. The position property +func (m *ReviewComment) SetPosition(value *int32)() { + m.position = value +} +// SetPullRequestReviewId sets the pull_request_review_id property value. The pull_request_review_id property +func (m *ReviewComment) SetPullRequestReviewId(value *int64)() { + m.pull_request_review_id = value +} +// SetPullRequestUrl sets the pull_request_url property value. The pull_request_url property +func (m *ReviewComment) SetPullRequestUrl(value *string)() { + m.pull_request_url = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *ReviewComment) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetSide sets the side property value. The side of the first line of the range for a multi-line comment. +func (m *ReviewComment) SetSide(value *ReviewComment_side)() { + m.side = value +} +// SetStartLine sets the start_line property value. The first line of the range for a multi-line comment. +func (m *ReviewComment) SetStartLine(value *int32)() { + m.start_line = value +} +// SetStartSide sets the start_side property value. The side of the first line of the range for a multi-line comment. +func (m *ReviewComment) SetStartSide(value *ReviewComment_start_side)() { + m.start_side = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *ReviewComment) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *ReviewComment) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *ReviewComment) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type ReviewCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetCommitId()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDiffHunk()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetInReplyToId()(*int32) + GetLine()(*int32) + GetLinks()(ReviewComment__linksable) + GetNodeId()(*string) + GetOriginalCommitId()(*string) + GetOriginalLine()(*int32) + GetOriginalPosition()(*int32) + GetOriginalStartLine()(*int32) + GetPath()(*string) + GetPosition()(*int32) + GetPullRequestReviewId()(*int64) + GetPullRequestUrl()(*string) + GetReactions()(ReactionRollupable) + GetSide()(*ReviewComment_side) + GetStartLine()(*int32) + GetStartSide()(*ReviewComment_start_side) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetCommitId(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDiffHunk(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetInReplyToId(value *int32)() + SetLine(value *int32)() + SetLinks(value ReviewComment__linksable)() + SetNodeId(value *string)() + SetOriginalCommitId(value *string)() + SetOriginalLine(value *int32)() + SetOriginalPosition(value *int32)() + SetOriginalStartLine(value *int32)() + SetPath(value *string)() + SetPosition(value *int32)() + SetPullRequestReviewId(value *int64)() + SetPullRequestUrl(value *string)() + SetReactions(value ReactionRollupable)() + SetSide(value *ReviewComment_side)() + SetStartLine(value *int32)() + SetStartSide(value *ReviewComment_start_side)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/review_comment__links.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_comment__links.go new file mode 100644 index 000000000..ed64eb2da --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_comment__links.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ReviewComment__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Hypermedia Link + html Linkable + // Hypermedia Link + pull_request Linkable + // Hypermedia Link + self Linkable +} +// NewReviewComment__links instantiates a new ReviewComment__links and sets the default values. +func NewReviewComment__links()(*ReviewComment__links) { + m := &ReviewComment__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReviewComment__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReviewComment__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReviewComment__links(), 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 *ReviewComment__links) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReviewComment__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHtml(val.(Linkable)) + } + return nil + } + res["pull_request"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPullRequest(val.(Linkable)) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSelf(val.(Linkable)) + } + return nil + } + return res +} +// GetHtml gets the html property value. Hypermedia Link +// returns a Linkable when successful +func (m *ReviewComment__links) GetHtml()(Linkable) { + return m.html +} +// GetPullRequest gets the pull_request property value. Hypermedia Link +// returns a Linkable when successful +func (m *ReviewComment__links) GetPullRequest()(Linkable) { + return m.pull_request +} +// GetSelf gets the self property value. Hypermedia Link +// returns a Linkable when successful +func (m *ReviewComment__links) GetSelf()(Linkable) { + return m.self +} +// Serialize serializes information the current object +func (m *ReviewComment__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pull_request", m.GetPullRequest()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("self", m.GetSelf()) + 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 *ReviewComment__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtml sets the html property value. Hypermedia Link +func (m *ReviewComment__links) SetHtml(value Linkable)() { + m.html = value +} +// SetPullRequest sets the pull_request property value. Hypermedia Link +func (m *ReviewComment__links) SetPullRequest(value Linkable)() { + m.pull_request = value +} +// SetSelf sets the self property value. Hypermedia Link +func (m *ReviewComment__links) SetSelf(value Linkable)() { + m.self = value +} +type ReviewComment__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtml()(Linkable) + GetPullRequest()(Linkable) + GetSelf()(Linkable) + SetHtml(value Linkable)() + SetPullRequest(value Linkable)() + SetSelf(value Linkable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/review_comment_side.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_comment_side.go new file mode 100644 index 000000000..b1e51ea6d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_comment_side.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The side of the first line of the range for a multi-line comment. +type ReviewComment_side int + +const ( + LEFT_REVIEWCOMMENT_SIDE ReviewComment_side = iota + RIGHT_REVIEWCOMMENT_SIDE +) + +func (i ReviewComment_side) String() string { + return []string{"LEFT", "RIGHT"}[i] +} +func ParseReviewComment_side(v string) (any, error) { + result := LEFT_REVIEWCOMMENT_SIDE + switch v { + case "LEFT": + result = LEFT_REVIEWCOMMENT_SIDE + case "RIGHT": + result = RIGHT_REVIEWCOMMENT_SIDE + default: + return 0, errors.New("Unknown ReviewComment_side value: " + v) + } + return &result, nil +} +func SerializeReviewComment_side(values []ReviewComment_side) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReviewComment_side) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/review_comment_start_side.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_comment_start_side.go new file mode 100644 index 000000000..394c4a676 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_comment_start_side.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The side of the first line of the range for a multi-line comment. +type ReviewComment_start_side int + +const ( + LEFT_REVIEWCOMMENT_START_SIDE ReviewComment_start_side = iota + RIGHT_REVIEWCOMMENT_START_SIDE +) + +func (i ReviewComment_start_side) String() string { + return []string{"LEFT", "RIGHT"}[i] +} +func ParseReviewComment_start_side(v string) (any, error) { + result := LEFT_REVIEWCOMMENT_START_SIDE + switch v { + case "LEFT": + result = LEFT_REVIEWCOMMENT_START_SIDE + case "RIGHT": + result = RIGHT_REVIEWCOMMENT_START_SIDE + default: + return 0, errors.New("Unknown ReviewComment_start_side value: " + v) + } + return &result, nil +} +func SerializeReviewComment_start_side(values []ReviewComment_start_side) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReviewComment_start_side) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/review_custom_gates_comment_required.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_custom_gates_comment_required.go new file mode 100644 index 000000000..fe7a3343d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_custom_gates_comment_required.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ReviewCustomGatesCommentRequired struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Comment associated with the pending deployment protection rule. **Required when state is not provided.** + comment *string + // The name of the environment to approve or reject. + environment_name *string +} +// NewReviewCustomGatesCommentRequired instantiates a new ReviewCustomGatesCommentRequired and sets the default values. +func NewReviewCustomGatesCommentRequired()(*ReviewCustomGatesCommentRequired) { + m := &ReviewCustomGatesCommentRequired{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReviewCustomGatesCommentRequiredFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReviewCustomGatesCommentRequiredFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReviewCustomGatesCommentRequired(), 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 *ReviewCustomGatesCommentRequired) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComment gets the comment property value. Comment associated with the pending deployment protection rule. **Required when state is not provided.** +// returns a *string when successful +func (m *ReviewCustomGatesCommentRequired) GetComment()(*string) { + return m.comment +} +// GetEnvironmentName gets the environment_name property value. The name of the environment to approve or reject. +// returns a *string when successful +func (m *ReviewCustomGatesCommentRequired) GetEnvironmentName()(*string) { + return m.environment_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReviewCustomGatesCommentRequired) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetComment(val) + } + return nil + } + res["environment_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironmentName(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ReviewCustomGatesCommentRequired) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("comment", m.GetComment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment_name", m.GetEnvironmentName()) + 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 *ReviewCustomGatesCommentRequired) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComment sets the comment property value. Comment associated with the pending deployment protection rule. **Required when state is not provided.** +func (m *ReviewCustomGatesCommentRequired) SetComment(value *string)() { + m.comment = value +} +// SetEnvironmentName sets the environment_name property value. The name of the environment to approve or reject. +func (m *ReviewCustomGatesCommentRequired) SetEnvironmentName(value *string)() { + m.environment_name = value +} +type ReviewCustomGatesCommentRequiredable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComment()(*string) + GetEnvironmentName()(*string) + SetComment(value *string)() + SetEnvironmentName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/review_custom_gates_state_required.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_custom_gates_state_required.go new file mode 100644 index 000000000..1cd04c17a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_custom_gates_state_required.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ReviewCustomGatesStateRequired struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Optional comment to include with the review. + comment *string + // The name of the environment to approve or reject. + environment_name *string + // Whether to approve or reject deployment to the specified environments. + state *ReviewCustomGatesStateRequired_state +} +// NewReviewCustomGatesStateRequired instantiates a new ReviewCustomGatesStateRequired and sets the default values. +func NewReviewCustomGatesStateRequired()(*ReviewCustomGatesStateRequired) { + m := &ReviewCustomGatesStateRequired{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReviewCustomGatesStateRequiredFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReviewCustomGatesStateRequiredFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReviewCustomGatesStateRequired(), 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 *ReviewCustomGatesStateRequired) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComment gets the comment property value. Optional comment to include with the review. +// returns a *string when successful +func (m *ReviewCustomGatesStateRequired) GetComment()(*string) { + return m.comment +} +// GetEnvironmentName gets the environment_name property value. The name of the environment to approve or reject. +// returns a *string when successful +func (m *ReviewCustomGatesStateRequired) GetEnvironmentName()(*string) { + return m.environment_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReviewCustomGatesStateRequired) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetComment(val) + } + return nil + } + res["environment_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironmentName(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseReviewCustomGatesStateRequired_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*ReviewCustomGatesStateRequired_state)) + } + return nil + } + return res +} +// GetState gets the state property value. Whether to approve or reject deployment to the specified environments. +// returns a *ReviewCustomGatesStateRequired_state when successful +func (m *ReviewCustomGatesStateRequired) GetState()(*ReviewCustomGatesStateRequired_state) { + return m.state +} +// Serialize serializes information the current object +func (m *ReviewCustomGatesStateRequired) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("comment", m.GetComment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment_name", m.GetEnvironmentName()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ReviewCustomGatesStateRequired) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComment sets the comment property value. Optional comment to include with the review. +func (m *ReviewCustomGatesStateRequired) SetComment(value *string)() { + m.comment = value +} +// SetEnvironmentName sets the environment_name property value. The name of the environment to approve or reject. +func (m *ReviewCustomGatesStateRequired) SetEnvironmentName(value *string)() { + m.environment_name = value +} +// SetState sets the state property value. Whether to approve or reject deployment to the specified environments. +func (m *ReviewCustomGatesStateRequired) SetState(value *ReviewCustomGatesStateRequired_state)() { + m.state = value +} +type ReviewCustomGatesStateRequiredable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComment()(*string) + GetEnvironmentName()(*string) + GetState()(*ReviewCustomGatesStateRequired_state) + SetComment(value *string)() + SetEnvironmentName(value *string)() + SetState(value *ReviewCustomGatesStateRequired_state)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/review_custom_gates_state_required_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_custom_gates_state_required_state.go new file mode 100644 index 000000000..efe458a90 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_custom_gates_state_required_state.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// Whether to approve or reject deployment to the specified environments. +type ReviewCustomGatesStateRequired_state int + +const ( + APPROVED_REVIEWCUSTOMGATESSTATEREQUIRED_STATE ReviewCustomGatesStateRequired_state = iota + REJECTED_REVIEWCUSTOMGATESSTATEREQUIRED_STATE +) + +func (i ReviewCustomGatesStateRequired_state) String() string { + return []string{"approved", "rejected"}[i] +} +func ParseReviewCustomGatesStateRequired_state(v string) (any, error) { + result := APPROVED_REVIEWCUSTOMGATESSTATEREQUIRED_STATE + switch v { + case "approved": + result = APPROVED_REVIEWCUSTOMGATESSTATEREQUIRED_STATE + case "rejected": + result = REJECTED_REVIEWCUSTOMGATESSTATEREQUIRED_STATE + default: + return 0, errors.New("Unknown ReviewCustomGatesStateRequired_state value: " + v) + } + return &result, nil +} +func SerializeReviewCustomGatesStateRequired_state(values []ReviewCustomGatesStateRequired_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReviewCustomGatesStateRequired_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/review_dismissed_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_dismissed_issue_event.go new file mode 100644 index 000000000..668bd74b0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_dismissed_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ReviewDismissedIssueEvent review Dismissed Issue Event +type ReviewDismissedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The dismissed_review property + dismissed_review ReviewDismissedIssueEvent_dismissed_reviewable + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewReviewDismissedIssueEvent instantiates a new ReviewDismissedIssueEvent and sets the default values. +func NewReviewDismissedIssueEvent()(*ReviewDismissedIssueEvent) { + m := &ReviewDismissedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReviewDismissedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReviewDismissedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReviewDismissedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *ReviewDismissedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *ReviewDismissedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetDismissedReview gets the dismissed_review property value. The dismissed_review property +// returns a ReviewDismissedIssueEvent_dismissed_reviewable when successful +func (m *ReviewDismissedIssueEvent) GetDismissedReview()(ReviewDismissedIssueEvent_dismissed_reviewable) { + return m.dismissed_review +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReviewDismissedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["dismissed_review"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReviewDismissedIssueEvent_dismissed_reviewFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissedReview(val.(ReviewDismissedIssueEvent_dismissed_reviewable)) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *ReviewDismissedIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *ReviewDismissedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ReviewDismissedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("dismissed_review", m.GetDismissedReview()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *ReviewDismissedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *ReviewDismissedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *ReviewDismissedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *ReviewDismissedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ReviewDismissedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetDismissedReview sets the dismissed_review property value. The dismissed_review property +func (m *ReviewDismissedIssueEvent) SetDismissedReview(value ReviewDismissedIssueEvent_dismissed_reviewable)() { + m.dismissed_review = value +} +// SetEvent sets the event property value. The event property +func (m *ReviewDismissedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *ReviewDismissedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *ReviewDismissedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *ReviewDismissedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *ReviewDismissedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type ReviewDismissedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetDismissedReview()(ReviewDismissedIssueEvent_dismissed_reviewable) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetDismissedReview(value ReviewDismissedIssueEvent_dismissed_reviewable)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/review_dismissed_issue_event_dismissed_review.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_dismissed_issue_event_dismissed_review.go new file mode 100644 index 000000000..564400707 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_dismissed_issue_event_dismissed_review.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ReviewDismissedIssueEvent_dismissed_review struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The dismissal_commit_id property + dismissal_commit_id *string + // The dismissal_message property + dismissal_message *string + // The review_id property + review_id *int32 + // The state property + state *string +} +// NewReviewDismissedIssueEvent_dismissed_review instantiates a new ReviewDismissedIssueEvent_dismissed_review and sets the default values. +func NewReviewDismissedIssueEvent_dismissed_review()(*ReviewDismissedIssueEvent_dismissed_review) { + m := &ReviewDismissedIssueEvent_dismissed_review{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReviewDismissedIssueEvent_dismissed_reviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReviewDismissedIssueEvent_dismissed_reviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReviewDismissedIssueEvent_dismissed_review(), 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 *ReviewDismissedIssueEvent_dismissed_review) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDismissalCommitId gets the dismissal_commit_id property value. The dismissal_commit_id property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent_dismissed_review) GetDismissalCommitId()(*string) { + return m.dismissal_commit_id +} +// GetDismissalMessage gets the dismissal_message property value. The dismissal_message property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent_dismissed_review) GetDismissalMessage()(*string) { + return m.dismissal_message +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReviewDismissedIssueEvent_dismissed_review) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["dismissal_commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissalCommitId(val) + } + return nil + } + res["dismissal_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissalMessage(val) + } + return nil + } + res["review_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetReviewId(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + return res +} +// GetReviewId gets the review_id property value. The review_id property +// returns a *int32 when successful +func (m *ReviewDismissedIssueEvent_dismissed_review) GetReviewId()(*int32) { + return m.review_id +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent_dismissed_review) GetState()(*string) { + return m.state +} +// Serialize serializes information the current object +func (m *ReviewDismissedIssueEvent_dismissed_review) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("dismissal_commit_id", m.GetDismissalCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("dismissal_message", m.GetDismissalMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("review_id", m.GetReviewId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + 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 *ReviewDismissedIssueEvent_dismissed_review) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDismissalCommitId sets the dismissal_commit_id property value. The dismissal_commit_id property +func (m *ReviewDismissedIssueEvent_dismissed_review) SetDismissalCommitId(value *string)() { + m.dismissal_commit_id = value +} +// SetDismissalMessage sets the dismissal_message property value. The dismissal_message property +func (m *ReviewDismissedIssueEvent_dismissed_review) SetDismissalMessage(value *string)() { + m.dismissal_message = value +} +// SetReviewId sets the review_id property value. The review_id property +func (m *ReviewDismissedIssueEvent_dismissed_review) SetReviewId(value *int32)() { + m.review_id = value +} +// SetState sets the state property value. The state property +func (m *ReviewDismissedIssueEvent_dismissed_review) SetState(value *string)() { + m.state = value +} +type ReviewDismissedIssueEvent_dismissed_reviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDismissalCommitId()(*string) + GetDismissalMessage()(*string) + GetReviewId()(*int32) + GetState()(*string) + SetDismissalCommitId(value *string)() + SetDismissalMessage(value *string)() + SetReviewId(value *int32)() + SetState(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/review_request_removed_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_request_removed_issue_event.go new file mode 100644 index 000000000..9aca40a8c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_request_removed_issue_event.go @@ -0,0 +1,400 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ReviewRequestRemovedIssueEvent review Request Removed Issue Event +type ReviewRequestRemovedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // A GitHub user. + requested_reviewer SimpleUserable + // Groups of organization members that gives permissions on specified repositories. + requested_team Teamable + // A GitHub user. + review_requester SimpleUserable + // The url property + url *string +} +// NewReviewRequestRemovedIssueEvent instantiates a new ReviewRequestRemovedIssueEvent and sets the default values. +func NewReviewRequestRemovedIssueEvent()(*ReviewRequestRemovedIssueEvent) { + m := &ReviewRequestRemovedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReviewRequestRemovedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReviewRequestRemovedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReviewRequestRemovedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *ReviewRequestRemovedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *ReviewRequestRemovedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *ReviewRequestRemovedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *ReviewRequestRemovedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *ReviewRequestRemovedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *ReviewRequestRemovedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReviewRequestRemovedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["requested_reviewer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequestedReviewer(val.(SimpleUserable)) + } + return nil + } + res["requested_team"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequestedTeam(val.(Teamable)) + } + return nil + } + res["review_requester"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewRequester(val.(SimpleUserable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *ReviewRequestRemovedIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *ReviewRequestRemovedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *ReviewRequestRemovedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetRequestedReviewer gets the requested_reviewer property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *ReviewRequestRemovedIssueEvent) GetRequestedReviewer()(SimpleUserable) { + return m.requested_reviewer +} +// GetRequestedTeam gets the requested_team property value. Groups of organization members that gives permissions on specified repositories. +// returns a Teamable when successful +func (m *ReviewRequestRemovedIssueEvent) GetRequestedTeam()(Teamable) { + return m.requested_team +} +// GetReviewRequester gets the review_requester property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *ReviewRequestRemovedIssueEvent) GetReviewRequester()(SimpleUserable) { + return m.review_requester +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ReviewRequestRemovedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ReviewRequestRemovedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("requested_reviewer", m.GetRequestedReviewer()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("requested_team", m.GetRequestedTeam()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("review_requester", m.GetReviewRequester()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *ReviewRequestRemovedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *ReviewRequestRemovedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *ReviewRequestRemovedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *ReviewRequestRemovedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ReviewRequestRemovedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *ReviewRequestRemovedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *ReviewRequestRemovedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *ReviewRequestRemovedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *ReviewRequestRemovedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetRequestedReviewer sets the requested_reviewer property value. A GitHub user. +func (m *ReviewRequestRemovedIssueEvent) SetRequestedReviewer(value SimpleUserable)() { + m.requested_reviewer = value +} +// SetRequestedTeam sets the requested_team property value. Groups of organization members that gives permissions on specified repositories. +func (m *ReviewRequestRemovedIssueEvent) SetRequestedTeam(value Teamable)() { + m.requested_team = value +} +// SetReviewRequester sets the review_requester property value. A GitHub user. +func (m *ReviewRequestRemovedIssueEvent) SetReviewRequester(value SimpleUserable)() { + m.review_requester = value +} +// SetUrl sets the url property value. The url property +func (m *ReviewRequestRemovedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type ReviewRequestRemovedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetRequestedReviewer()(SimpleUserable) + GetRequestedTeam()(Teamable) + GetReviewRequester()(SimpleUserable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetRequestedReviewer(value SimpleUserable)() + SetRequestedTeam(value Teamable)() + SetReviewRequester(value SimpleUserable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/review_requested_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_requested_issue_event.go new file mode 100644 index 000000000..b35cf9ccb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/review_requested_issue_event.go @@ -0,0 +1,400 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ReviewRequestedIssueEvent review Requested Issue Event +type ReviewRequestedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // A GitHub user. + requested_reviewer SimpleUserable + // Groups of organization members that gives permissions on specified repositories. + requested_team Teamable + // A GitHub user. + review_requester SimpleUserable + // The url property + url *string +} +// NewReviewRequestedIssueEvent instantiates a new ReviewRequestedIssueEvent and sets the default values. +func NewReviewRequestedIssueEvent()(*ReviewRequestedIssueEvent) { + m := &ReviewRequestedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReviewRequestedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReviewRequestedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReviewRequestedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *ReviewRequestedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *ReviewRequestedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *ReviewRequestedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *ReviewRequestedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *ReviewRequestedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *ReviewRequestedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReviewRequestedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["requested_reviewer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequestedReviewer(val.(SimpleUserable)) + } + return nil + } + res["requested_team"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequestedTeam(val.(Teamable)) + } + return nil + } + res["review_requester"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewRequester(val.(SimpleUserable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *ReviewRequestedIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *ReviewRequestedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *ReviewRequestedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetRequestedReviewer gets the requested_reviewer property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *ReviewRequestedIssueEvent) GetRequestedReviewer()(SimpleUserable) { + return m.requested_reviewer +} +// GetRequestedTeam gets the requested_team property value. Groups of organization members that gives permissions on specified repositories. +// returns a Teamable when successful +func (m *ReviewRequestedIssueEvent) GetRequestedTeam()(Teamable) { + return m.requested_team +} +// GetReviewRequester gets the review_requester property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *ReviewRequestedIssueEvent) GetReviewRequester()(SimpleUserable) { + return m.review_requester +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ReviewRequestedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ReviewRequestedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("requested_reviewer", m.GetRequestedReviewer()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("requested_team", m.GetRequestedTeam()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("review_requester", m.GetReviewRequester()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *ReviewRequestedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *ReviewRequestedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *ReviewRequestedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *ReviewRequestedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ReviewRequestedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *ReviewRequestedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *ReviewRequestedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *ReviewRequestedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *ReviewRequestedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetRequestedReviewer sets the requested_reviewer property value. A GitHub user. +func (m *ReviewRequestedIssueEvent) SetRequestedReviewer(value SimpleUserable)() { + m.requested_reviewer = value +} +// SetRequestedTeam sets the requested_team property value. Groups of organization members that gives permissions on specified repositories. +func (m *ReviewRequestedIssueEvent) SetRequestedTeam(value Teamable)() { + m.requested_team = value +} +// SetReviewRequester sets the review_requester property value. A GitHub user. +func (m *ReviewRequestedIssueEvent) SetReviewRequester(value SimpleUserable)() { + m.review_requester = value +} +// SetUrl sets the url property value. The url property +func (m *ReviewRequestedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type ReviewRequestedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetRequestedReviewer()(SimpleUserable) + GetRequestedTeam()(Teamable) + GetReviewRequester()(SimpleUserable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetRequestedReviewer(value SimpleUserable)() + SetRequestedTeam(value Teamable)() + SetReviewRequester(value SimpleUserable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/root.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/root.go new file mode 100644 index 000000000..6f3279349 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/root.go @@ -0,0 +1,1011 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Root struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The authorizations_url property + authorizations_url *string + // The code_search_url property + code_search_url *string + // The commit_search_url property + commit_search_url *string + // The current_user_authorizations_html_url property + current_user_authorizations_html_url *string + // The current_user_repositories_url property + current_user_repositories_url *string + // The current_user_url property + current_user_url *string + // The emails_url property + emails_url *string + // The emojis_url property + emojis_url *string + // The events_url property + events_url *string + // The feeds_url property + feeds_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The hub_url property + // Deprecated: + hub_url *string + // The issue_search_url property + issue_search_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The label_search_url property + label_search_url *string + // The notifications_url property + notifications_url *string + // The organization_repositories_url property + organization_repositories_url *string + // The organization_teams_url property + organization_teams_url *string + // The organization_url property + organization_url *string + // The public_gists_url property + public_gists_url *string + // The rate_limit_url property + rate_limit_url *string + // The repository_search_url property + repository_search_url *string + // The repository_url property + repository_url *string + // The starred_gists_url property + starred_gists_url *string + // The starred_url property + starred_url *string + // The topic_search_url property + topic_search_url *string + // The user_organizations_url property + user_organizations_url *string + // The user_repositories_url property + user_repositories_url *string + // The user_search_url property + user_search_url *string + // The user_url property + user_url *string +} +// NewRoot instantiates a new Root and sets the default values. +func NewRoot()(*Root) { + m := &Root{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRootFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRootFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRoot(), 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 *Root) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorizationsUrl gets the authorizations_url property value. The authorizations_url property +// returns a *string when successful +func (m *Root) GetAuthorizationsUrl()(*string) { + return m.authorizations_url +} +// GetCodeSearchUrl gets the code_search_url property value. The code_search_url property +// returns a *string when successful +func (m *Root) GetCodeSearchUrl()(*string) { + return m.code_search_url +} +// GetCommitSearchUrl gets the commit_search_url property value. The commit_search_url property +// returns a *string when successful +func (m *Root) GetCommitSearchUrl()(*string) { + return m.commit_search_url +} +// GetCurrentUserAuthorizationsHtmlUrl gets the current_user_authorizations_html_url property value. The current_user_authorizations_html_url property +// returns a *string when successful +func (m *Root) GetCurrentUserAuthorizationsHtmlUrl()(*string) { + return m.current_user_authorizations_html_url +} +// GetCurrentUserRepositoriesUrl gets the current_user_repositories_url property value. The current_user_repositories_url property +// returns a *string when successful +func (m *Root) GetCurrentUserRepositoriesUrl()(*string) { + return m.current_user_repositories_url +} +// GetCurrentUserUrl gets the current_user_url property value. The current_user_url property +// returns a *string when successful +func (m *Root) GetCurrentUserUrl()(*string) { + return m.current_user_url +} +// GetEmailsUrl gets the emails_url property value. The emails_url property +// returns a *string when successful +func (m *Root) GetEmailsUrl()(*string) { + return m.emails_url +} +// GetEmojisUrl gets the emojis_url property value. The emojis_url property +// returns a *string when successful +func (m *Root) GetEmojisUrl()(*string) { + return m.emojis_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *Root) GetEventsUrl()(*string) { + return m.events_url +} +// GetFeedsUrl gets the feeds_url property value. The feeds_url property +// returns a *string when successful +func (m *Root) GetFeedsUrl()(*string) { + return m.feeds_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Root) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["authorizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAuthorizationsUrl(val) + } + return nil + } + res["code_search_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCodeSearchUrl(val) + } + return nil + } + res["commit_search_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitSearchUrl(val) + } + return nil + } + res["current_user_authorizations_html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserAuthorizationsHtmlUrl(val) + } + return nil + } + res["current_user_repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserRepositoriesUrl(val) + } + return nil + } + res["current_user_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserUrl(val) + } + return nil + } + res["emails_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmailsUrl(val) + } + return nil + } + res["emojis_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmojisUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["feeds_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFeedsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["hub_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHubUrl(val) + } + return nil + } + res["issue_search_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueSearchUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["label_search_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelSearchUrl(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["organization_repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationRepositoriesUrl(val) + } + return nil + } + res["organization_teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationTeamsUrl(val) + } + return nil + } + res["organization_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationUrl(val) + } + return nil + } + res["public_gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicGistsUrl(val) + } + return nil + } + res["rate_limit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRateLimitUrl(val) + } + return nil + } + res["repository_search_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositorySearchUrl(val) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["starred_gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredGistsUrl(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["topic_search_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTopicSearchUrl(val) + } + return nil + } + res["user_organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUserOrganizationsUrl(val) + } + return nil + } + res["user_repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUserRepositoriesUrl(val) + } + return nil + } + res["user_search_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUserSearchUrl(val) + } + return nil + } + res["user_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUserUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *Root) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *Root) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +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 +} +// GetIssueSearchUrl gets the issue_search_url property value. The issue_search_url property +// returns a *string when successful +func (m *Root) GetIssueSearchUrl()(*string) { + return m.issue_search_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *Root) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *Root) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelSearchUrl gets the label_search_url property value. The label_search_url property +// returns a *string when successful +func (m *Root) GetLabelSearchUrl()(*string) { + return m.label_search_url +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *Root) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOrganizationRepositoriesUrl gets the organization_repositories_url property value. The organization_repositories_url property +// returns a *string when successful +func (m *Root) GetOrganizationRepositoriesUrl()(*string) { + return m.organization_repositories_url +} +// GetOrganizationTeamsUrl gets the organization_teams_url property value. The organization_teams_url property +// returns a *string when successful +func (m *Root) GetOrganizationTeamsUrl()(*string) { + return m.organization_teams_url +} +// GetOrganizationUrl gets the organization_url property value. The organization_url property +// returns a *string when successful +func (m *Root) GetOrganizationUrl()(*string) { + return m.organization_url +} +// GetPublicGistsUrl gets the public_gists_url property value. The public_gists_url property +// returns a *string when successful +func (m *Root) GetPublicGistsUrl()(*string) { + return m.public_gists_url +} +// GetRateLimitUrl gets the rate_limit_url property value. The rate_limit_url property +// returns a *string when successful +func (m *Root) GetRateLimitUrl()(*string) { + return m.rate_limit_url +} +// GetRepositorySearchUrl gets the repository_search_url property value. The repository_search_url property +// returns a *string when successful +func (m *Root) GetRepositorySearchUrl()(*string) { + return m.repository_search_url +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *Root) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetStarredGistsUrl gets the starred_gists_url property value. The starred_gists_url property +// returns a *string when successful +func (m *Root) GetStarredGistsUrl()(*string) { + return m.starred_gists_url +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *Root) GetStarredUrl()(*string) { + return m.starred_url +} +// GetTopicSearchUrl gets the topic_search_url property value. The topic_search_url property +// returns a *string when successful +func (m *Root) GetTopicSearchUrl()(*string) { + return m.topic_search_url +} +// GetUserOrganizationsUrl gets the user_organizations_url property value. The user_organizations_url property +// returns a *string when successful +func (m *Root) GetUserOrganizationsUrl()(*string) { + return m.user_organizations_url +} +// GetUserRepositoriesUrl gets the user_repositories_url property value. The user_repositories_url property +// returns a *string when successful +func (m *Root) GetUserRepositoriesUrl()(*string) { + return m.user_repositories_url +} +// GetUserSearchUrl gets the user_search_url property value. The user_search_url property +// returns a *string when successful +func (m *Root) GetUserSearchUrl()(*string) { + return m.user_search_url +} +// GetUserUrl gets the user_url property value. The user_url property +// returns a *string when successful +func (m *Root) GetUserUrl()(*string) { + return m.user_url +} +// Serialize serializes information the current object +func (m *Root) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("authorizations_url", m.GetAuthorizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("code_search_url", m.GetCodeSearchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_search_url", m.GetCommitSearchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("current_user_authorizations_html_url", m.GetCurrentUserAuthorizationsHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("current_user_repositories_url", m.GetCurrentUserRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("current_user_url", m.GetCurrentUserUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("emails_url", m.GetEmailsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("emojis_url", m.GetEmojisUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("feeds_url", m.GetFeedsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hub_url", m.GetHubUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_search_url", m.GetIssueSearchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("label_search_url", m.GetLabelSearchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization_repositories_url", m.GetOrganizationRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization_teams_url", m.GetOrganizationTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization_url", m.GetOrganizationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("public_gists_url", m.GetPublicGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("rate_limit_url", m.GetRateLimitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_search_url", m.GetRepositorySearchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_gists_url", m.GetStarredGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("topic_search_url", m.GetTopicSearchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user_organizations_url", m.GetUserOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user_repositories_url", m.GetUserRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user_search_url", m.GetUserSearchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user_url", m.GetUserUrl()) + 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 *Root) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorizationsUrl sets the authorizations_url property value. The authorizations_url property +func (m *Root) SetAuthorizationsUrl(value *string)() { + m.authorizations_url = value +} +// SetCodeSearchUrl sets the code_search_url property value. The code_search_url property +func (m *Root) SetCodeSearchUrl(value *string)() { + m.code_search_url = value +} +// SetCommitSearchUrl sets the commit_search_url property value. The commit_search_url property +func (m *Root) SetCommitSearchUrl(value *string)() { + m.commit_search_url = value +} +// SetCurrentUserAuthorizationsHtmlUrl sets the current_user_authorizations_html_url property value. The current_user_authorizations_html_url property +func (m *Root) SetCurrentUserAuthorizationsHtmlUrl(value *string)() { + m.current_user_authorizations_html_url = value +} +// SetCurrentUserRepositoriesUrl sets the current_user_repositories_url property value. The current_user_repositories_url property +func (m *Root) SetCurrentUserRepositoriesUrl(value *string)() { + m.current_user_repositories_url = value +} +// SetCurrentUserUrl sets the current_user_url property value. The current_user_url property +func (m *Root) SetCurrentUserUrl(value *string)() { + m.current_user_url = value +} +// SetEmailsUrl sets the emails_url property value. The emails_url property +func (m *Root) SetEmailsUrl(value *string)() { + m.emails_url = value +} +// SetEmojisUrl sets the emojis_url property value. The emojis_url property +func (m *Root) SetEmojisUrl(value *string)() { + m.emojis_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *Root) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFeedsUrl sets the feeds_url property value. The feeds_url property +func (m *Root) SetFeedsUrl(value *string)() { + m.feeds_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *Root) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *Root) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +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 +} +// SetIssueSearchUrl sets the issue_search_url property value. The issue_search_url property +func (m *Root) SetIssueSearchUrl(value *string)() { + m.issue_search_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *Root) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *Root) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelSearchUrl sets the label_search_url property value. The label_search_url property +func (m *Root) SetLabelSearchUrl(value *string)() { + m.label_search_url = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *Root) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOrganizationRepositoriesUrl sets the organization_repositories_url property value. The organization_repositories_url property +func (m *Root) SetOrganizationRepositoriesUrl(value *string)() { + m.organization_repositories_url = value +} +// SetOrganizationTeamsUrl sets the organization_teams_url property value. The organization_teams_url property +func (m *Root) SetOrganizationTeamsUrl(value *string)() { + m.organization_teams_url = value +} +// SetOrganizationUrl sets the organization_url property value. The organization_url property +func (m *Root) SetOrganizationUrl(value *string)() { + m.organization_url = value +} +// SetPublicGistsUrl sets the public_gists_url property value. The public_gists_url property +func (m *Root) SetPublicGistsUrl(value *string)() { + m.public_gists_url = value +} +// SetRateLimitUrl sets the rate_limit_url property value. The rate_limit_url property +func (m *Root) SetRateLimitUrl(value *string)() { + m.rate_limit_url = value +} +// SetRepositorySearchUrl sets the repository_search_url property value. The repository_search_url property +func (m *Root) SetRepositorySearchUrl(value *string)() { + m.repository_search_url = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *Root) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetStarredGistsUrl sets the starred_gists_url property value. The starred_gists_url property +func (m *Root) SetStarredGistsUrl(value *string)() { + m.starred_gists_url = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *Root) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetTopicSearchUrl sets the topic_search_url property value. The topic_search_url property +func (m *Root) SetTopicSearchUrl(value *string)() { + m.topic_search_url = value +} +// SetUserOrganizationsUrl sets the user_organizations_url property value. The user_organizations_url property +func (m *Root) SetUserOrganizationsUrl(value *string)() { + m.user_organizations_url = value +} +// SetUserRepositoriesUrl sets the user_repositories_url property value. The user_repositories_url property +func (m *Root) SetUserRepositoriesUrl(value *string)() { + m.user_repositories_url = value +} +// SetUserSearchUrl sets the user_search_url property value. The user_search_url property +func (m *Root) SetUserSearchUrl(value *string)() { + m.user_search_url = value +} +// SetUserUrl sets the user_url property value. The user_url property +func (m *Root) SetUserUrl(value *string)() { + m.user_url = value +} +type Rootable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorizationsUrl()(*string) + GetCodeSearchUrl()(*string) + GetCommitSearchUrl()(*string) + GetCurrentUserAuthorizationsHtmlUrl()(*string) + GetCurrentUserRepositoriesUrl()(*string) + GetCurrentUserUrl()(*string) + GetEmailsUrl()(*string) + GetEmojisUrl()(*string) + GetEventsUrl()(*string) + GetFeedsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetHubUrl()(*string) + GetIssueSearchUrl()(*string) + GetIssuesUrl()(*string) + GetKeysUrl()(*string) + GetLabelSearchUrl()(*string) + GetNotificationsUrl()(*string) + GetOrganizationRepositoriesUrl()(*string) + GetOrganizationTeamsUrl()(*string) + GetOrganizationUrl()(*string) + GetPublicGistsUrl()(*string) + GetRateLimitUrl()(*string) + GetRepositorySearchUrl()(*string) + GetRepositoryUrl()(*string) + GetStarredGistsUrl()(*string) + GetStarredUrl()(*string) + GetTopicSearchUrl()(*string) + GetUserOrganizationsUrl()(*string) + GetUserRepositoriesUrl()(*string) + GetUserSearchUrl()(*string) + GetUserUrl()(*string) + SetAuthorizationsUrl(value *string)() + SetCodeSearchUrl(value *string)() + SetCommitSearchUrl(value *string)() + SetCurrentUserAuthorizationsHtmlUrl(value *string)() + SetCurrentUserRepositoriesUrl(value *string)() + SetCurrentUserUrl(value *string)() + SetEmailsUrl(value *string)() + SetEmojisUrl(value *string)() + SetEventsUrl(value *string)() + SetFeedsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetHubUrl(value *string)() + SetIssueSearchUrl(value *string)() + SetIssuesUrl(value *string)() + SetKeysUrl(value *string)() + SetLabelSearchUrl(value *string)() + SetNotificationsUrl(value *string)() + SetOrganizationRepositoriesUrl(value *string)() + SetOrganizationTeamsUrl(value *string)() + SetOrganizationUrl(value *string)() + SetPublicGistsUrl(value *string)() + SetRateLimitUrl(value *string)() + SetRepositorySearchUrl(value *string)() + SetRepositoryUrl(value *string)() + SetStarredGistsUrl(value *string)() + SetStarredUrl(value *string)() + SetTopicSearchUrl(value *string)() + SetUserOrganizationsUrl(value *string)() + SetUserRepositoriesUrl(value *string)() + SetUserSearchUrl(value *string)() + SetUserUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite.go new file mode 100644 index 000000000..eadb5c816 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite.go @@ -0,0 +1,415 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RuleSuite response +type RuleSuite struct { + // The number that identifies the user. + actor_id *int32 + // The handle for the GitHub user account. + actor_name *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The last commit sha in the push evaluation. + after_sha *string + // The first commit sha before the push evaluation. + before_sha *string + // The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. + evaluation_result *RuleSuite_evaluation_result + // The unique identifier of the rule insight. + id *int32 + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The ref name that the evaluation ran on. + ref *string + // The ID of the repository associated with the rule evaluation. + repository_id *int32 + // The name of the repository without the `.git` extension. + repository_name *string + // The result of the rule evaluations for rules with the `active` enforcement status. + result *RuleSuite_result + // Details on the evaluated rules. + rule_evaluations []RuleSuite_rule_evaluationsable +} +// NewRuleSuite instantiates a new RuleSuite and sets the default values. +func NewRuleSuite()(*RuleSuite) { + m := &RuleSuite{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRuleSuiteFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRuleSuiteFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRuleSuite(), nil +} +// GetActorId gets the actor_id property value. The number that identifies the user. +// returns a *int32 when successful +func (m *RuleSuite) GetActorId()(*int32) { + return m.actor_id +} +// GetActorName gets the actor_name property value. The handle for the GitHub user account. +// returns a *string when successful +func (m *RuleSuite) GetActorName()(*string) { + return m.actor_name +} +// 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 *RuleSuite) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAfterSha gets the after_sha property value. The last commit sha in the push evaluation. +// returns a *string when successful +func (m *RuleSuite) GetAfterSha()(*string) { + return m.after_sha +} +// GetBeforeSha gets the before_sha property value. The first commit sha before the push evaluation. +// returns a *string when successful +func (m *RuleSuite) GetBeforeSha()(*string) { + return m.before_sha +} +// GetEvaluationResult gets the evaluation_result property value. The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. +// returns a *RuleSuite_evaluation_result when successful +func (m *RuleSuite) GetEvaluationResult()(*RuleSuite_evaluation_result) { + return m.evaluation_result +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RuleSuite) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetActorId(val) + } + return nil + } + res["actor_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetActorName(val) + } + return nil + } + res["after_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAfterSha(val) + } + return nil + } + res["before_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBeforeSha(val) + } + return nil + } + res["evaluation_result"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRuleSuite_evaluation_result) + if err != nil { + return err + } + if val != nil { + m.SetEvaluationResult(val.(*RuleSuite_evaluation_result)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + res["repository_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryName(val) + } + return nil + } + res["result"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRuleSuite_result) + if err != nil { + return err + } + if val != nil { + m.SetResult(val.(*RuleSuite_result)) + } + return nil + } + res["rule_evaluations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRuleSuite_rule_evaluationsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RuleSuite_rule_evaluationsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RuleSuite_rule_evaluationsable) + } + } + m.SetRuleEvaluations(res) + } + return nil + } + return res +} +// GetId gets the id property value. The unique identifier of the rule insight. +// returns a *int32 when successful +func (m *RuleSuite) GetId()(*int32) { + return m.id +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *RuleSuite) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetRef gets the ref property value. The ref name that the evaluation ran on. +// returns a *string when successful +func (m *RuleSuite) GetRef()(*string) { + return m.ref +} +// GetRepositoryId gets the repository_id property value. The ID of the repository associated with the rule evaluation. +// returns a *int32 when successful +func (m *RuleSuite) GetRepositoryId()(*int32) { + return m.repository_id +} +// GetRepositoryName gets the repository_name property value. The name of the repository without the `.git` extension. +// returns a *string when successful +func (m *RuleSuite) GetRepositoryName()(*string) { + return m.repository_name +} +// GetResult gets the result property value. The result of the rule evaluations for rules with the `active` enforcement status. +// returns a *RuleSuite_result when successful +func (m *RuleSuite) GetResult()(*RuleSuite_result) { + return m.result +} +// GetRuleEvaluations gets the rule_evaluations property value. Details on the evaluated rules. +// returns a []RuleSuite_rule_evaluationsable when successful +func (m *RuleSuite) GetRuleEvaluations()([]RuleSuite_rule_evaluationsable) { + return m.rule_evaluations +} +// Serialize serializes information the current object +func (m *RuleSuite) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("actor_id", m.GetActorId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("actor_name", m.GetActorName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("after_sha", m.GetAfterSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("before_sha", m.GetBeforeSha()) + if err != nil { + return err + } + } + if m.GetEvaluationResult() != nil { + cast := (*m.GetEvaluationResult()).String() + err := writer.WriteStringValue("evaluation_result", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_name", m.GetRepositoryName()) + if err != nil { + return err + } + } + if m.GetResult() != nil { + cast := (*m.GetResult()).String() + err := writer.WriteStringValue("result", &cast) + if err != nil { + return err + } + } + if m.GetRuleEvaluations() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRuleEvaluations())) + for i, v := range m.GetRuleEvaluations() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("rule_evaluations", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActorId sets the actor_id property value. The number that identifies the user. +func (m *RuleSuite) SetActorId(value *int32)() { + m.actor_id = value +} +// SetActorName sets the actor_name property value. The handle for the GitHub user account. +func (m *RuleSuite) SetActorName(value *string)() { + m.actor_name = value +} +// 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 *RuleSuite) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAfterSha sets the after_sha property value. The last commit sha in the push evaluation. +func (m *RuleSuite) SetAfterSha(value *string)() { + m.after_sha = value +} +// SetBeforeSha sets the before_sha property value. The first commit sha before the push evaluation. +func (m *RuleSuite) SetBeforeSha(value *string)() { + m.before_sha = value +} +// SetEvaluationResult sets the evaluation_result property value. The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. +func (m *RuleSuite) SetEvaluationResult(value *RuleSuite_evaluation_result)() { + m.evaluation_result = value +} +// SetId sets the id property value. The unique identifier of the rule insight. +func (m *RuleSuite) SetId(value *int32)() { + m.id = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *RuleSuite) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetRef sets the ref property value. The ref name that the evaluation ran on. +func (m *RuleSuite) SetRef(value *string)() { + m.ref = value +} +// SetRepositoryId sets the repository_id property value. The ID of the repository associated with the rule evaluation. +func (m *RuleSuite) SetRepositoryId(value *int32)() { + m.repository_id = value +} +// SetRepositoryName sets the repository_name property value. The name of the repository without the `.git` extension. +func (m *RuleSuite) SetRepositoryName(value *string)() { + m.repository_name = value +} +// SetResult sets the result property value. The result of the rule evaluations for rules with the `active` enforcement status. +func (m *RuleSuite) SetResult(value *RuleSuite_result)() { + m.result = value +} +// SetRuleEvaluations sets the rule_evaluations property value. Details on the evaluated rules. +func (m *RuleSuite) SetRuleEvaluations(value []RuleSuite_rule_evaluationsable)() { + m.rule_evaluations = value +} +type RuleSuiteable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActorId()(*int32) + GetActorName()(*string) + GetAfterSha()(*string) + GetBeforeSha()(*string) + GetEvaluationResult()(*RuleSuite_evaluation_result) + GetId()(*int32) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetRef()(*string) + GetRepositoryId()(*int32) + GetRepositoryName()(*string) + GetResult()(*RuleSuite_result) + GetRuleEvaluations()([]RuleSuite_rule_evaluationsable) + SetActorId(value *int32)() + SetActorName(value *string)() + SetAfterSha(value *string)() + SetBeforeSha(value *string)() + SetEvaluationResult(value *RuleSuite_evaluation_result)() + SetId(value *int32)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetRef(value *string)() + SetRepositoryId(value *int32)() + SetRepositoryName(value *string)() + SetResult(value *RuleSuite_result)() + SetRuleEvaluations(value []RuleSuite_rule_evaluationsable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_evaluation_result.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_evaluation_result.go new file mode 100644 index 000000000..bdea671e9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_evaluation_result.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. +type RuleSuite_evaluation_result int + +const ( + PASS_RULESUITE_EVALUATION_RESULT RuleSuite_evaluation_result = iota + FAIL_RULESUITE_EVALUATION_RESULT +) + +func (i RuleSuite_evaluation_result) String() string { + return []string{"pass", "fail"}[i] +} +func ParseRuleSuite_evaluation_result(v string) (any, error) { + result := PASS_RULESUITE_EVALUATION_RESULT + switch v { + case "pass": + result = PASS_RULESUITE_EVALUATION_RESULT + case "fail": + result = FAIL_RULESUITE_EVALUATION_RESULT + default: + return 0, errors.New("Unknown RuleSuite_evaluation_result value: " + v) + } + return &result, nil +} +func SerializeRuleSuite_evaluation_result(values []RuleSuite_evaluation_result) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RuleSuite_evaluation_result) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_result.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_result.go new file mode 100644 index 000000000..276cc0bbf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_result.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The result of the rule evaluations for rules with the `active` enforcement status. +type RuleSuite_result int + +const ( + PASS_RULESUITE_RESULT RuleSuite_result = iota + FAIL_RULESUITE_RESULT + BYPASS_RULESUITE_RESULT +) + +func (i RuleSuite_result) String() string { + return []string{"pass", "fail", "bypass"}[i] +} +func ParseRuleSuite_result(v string) (any, error) { + result := PASS_RULESUITE_RESULT + switch v { + case "pass": + result = PASS_RULESUITE_RESULT + case "fail": + result = FAIL_RULESUITE_RESULT + case "bypass": + result = BYPASS_RULESUITE_RESULT + default: + return 0, errors.New("Unknown RuleSuite_result value: " + v) + } + return &result, nil +} +func SerializeRuleSuite_result(values []RuleSuite_result) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RuleSuite_result) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_rule_evaluations.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_rule_evaluations.go new file mode 100644 index 000000000..5485f1c25 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_rule_evaluations.go @@ -0,0 +1,198 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RuleSuite_rule_evaluations struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Any associated details with the rule evaluation. + details *string + // The enforcement level of this rule source. + enforcement *RuleSuite_rule_evaluations_enforcement + // The result of the evaluation of the individual rule. + result *RuleSuite_rule_evaluations_result + // The rule_source property + rule_source RuleSuite_rule_evaluations_rule_sourceable + // The type of rule. + rule_type *string +} +// NewRuleSuite_rule_evaluations instantiates a new RuleSuite_rule_evaluations and sets the default values. +func NewRuleSuite_rule_evaluations()(*RuleSuite_rule_evaluations) { + m := &RuleSuite_rule_evaluations{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRuleSuite_rule_evaluationsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRuleSuite_rule_evaluationsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRuleSuite_rule_evaluations(), 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 *RuleSuite_rule_evaluations) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDetails gets the details property value. Any associated details with the rule evaluation. +// returns a *string when successful +func (m *RuleSuite_rule_evaluations) GetDetails()(*string) { + return m.details +} +// GetEnforcement gets the enforcement property value. The enforcement level of this rule source. +// returns a *RuleSuite_rule_evaluations_enforcement when successful +func (m *RuleSuite_rule_evaluations) GetEnforcement()(*RuleSuite_rule_evaluations_enforcement) { + return m.enforcement +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RuleSuite_rule_evaluations) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["details"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDetails(val) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRuleSuite_rule_evaluations_enforcement) + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val.(*RuleSuite_rule_evaluations_enforcement)) + } + return nil + } + res["result"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRuleSuite_rule_evaluations_result) + if err != nil { + return err + } + if val != nil { + m.SetResult(val.(*RuleSuite_rule_evaluations_result)) + } + return nil + } + res["rule_source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRuleSuite_rule_evaluations_rule_sourceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRuleSource(val.(RuleSuite_rule_evaluations_rule_sourceable)) + } + return nil + } + res["rule_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRuleType(val) + } + return nil + } + return res +} +// GetResult gets the result property value. The result of the evaluation of the individual rule. +// returns a *RuleSuite_rule_evaluations_result when successful +func (m *RuleSuite_rule_evaluations) GetResult()(*RuleSuite_rule_evaluations_result) { + return m.result +} +// GetRuleSource gets the rule_source property value. The rule_source property +// returns a RuleSuite_rule_evaluations_rule_sourceable when successful +func (m *RuleSuite_rule_evaluations) GetRuleSource()(RuleSuite_rule_evaluations_rule_sourceable) { + return m.rule_source +} +// GetRuleType gets the rule_type property value. The type of rule. +// returns a *string when successful +func (m *RuleSuite_rule_evaluations) GetRuleType()(*string) { + return m.rule_type +} +// Serialize serializes information the current object +func (m *RuleSuite_rule_evaluations) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("details", m.GetDetails()) + if err != nil { + return err + } + } + if m.GetEnforcement() != nil { + cast := (*m.GetEnforcement()).String() + err := writer.WriteStringValue("enforcement", &cast) + if err != nil { + return err + } + } + if m.GetResult() != nil { + cast := (*m.GetResult()).String() + err := writer.WriteStringValue("result", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("rule_source", m.GetRuleSource()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("rule_type", m.GetRuleType()) + 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 *RuleSuite_rule_evaluations) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDetails sets the details property value. Any associated details with the rule evaluation. +func (m *RuleSuite_rule_evaluations) SetDetails(value *string)() { + m.details = value +} +// SetEnforcement sets the enforcement property value. The enforcement level of this rule source. +func (m *RuleSuite_rule_evaluations) SetEnforcement(value *RuleSuite_rule_evaluations_enforcement)() { + m.enforcement = value +} +// SetResult sets the result property value. The result of the evaluation of the individual rule. +func (m *RuleSuite_rule_evaluations) SetResult(value *RuleSuite_rule_evaluations_result)() { + m.result = value +} +// SetRuleSource sets the rule_source property value. The rule_source property +func (m *RuleSuite_rule_evaluations) SetRuleSource(value RuleSuite_rule_evaluations_rule_sourceable)() { + m.rule_source = value +} +// SetRuleType sets the rule_type property value. The type of rule. +func (m *RuleSuite_rule_evaluations) SetRuleType(value *string)() { + m.rule_type = value +} +type RuleSuite_rule_evaluationsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDetails()(*string) + GetEnforcement()(*RuleSuite_rule_evaluations_enforcement) + GetResult()(*RuleSuite_rule_evaluations_result) + GetRuleSource()(RuleSuite_rule_evaluations_rule_sourceable) + GetRuleType()(*string) + SetDetails(value *string)() + SetEnforcement(value *RuleSuite_rule_evaluations_enforcement)() + SetResult(value *RuleSuite_rule_evaluations_result)() + SetRuleSource(value RuleSuite_rule_evaluations_rule_sourceable)() + SetRuleType(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_rule_evaluations_enforcement.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_rule_evaluations_enforcement.go new file mode 100644 index 000000000..3b1b54bf5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_rule_evaluations_enforcement.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The enforcement level of this rule source. +type RuleSuite_rule_evaluations_enforcement int + +const ( + ACTIVE_RULESUITE_RULE_EVALUATIONS_ENFORCEMENT RuleSuite_rule_evaluations_enforcement = iota + EVALUATE_RULESUITE_RULE_EVALUATIONS_ENFORCEMENT + DELETEDRULESET_RULESUITE_RULE_EVALUATIONS_ENFORCEMENT +) + +func (i RuleSuite_rule_evaluations_enforcement) String() string { + return []string{"active", "evaluate", "deleted ruleset"}[i] +} +func ParseRuleSuite_rule_evaluations_enforcement(v string) (any, error) { + result := ACTIVE_RULESUITE_RULE_EVALUATIONS_ENFORCEMENT + switch v { + case "active": + result = ACTIVE_RULESUITE_RULE_EVALUATIONS_ENFORCEMENT + case "evaluate": + result = EVALUATE_RULESUITE_RULE_EVALUATIONS_ENFORCEMENT + case "deleted ruleset": + result = DELETEDRULESET_RULESUITE_RULE_EVALUATIONS_ENFORCEMENT + default: + return 0, errors.New("Unknown RuleSuite_rule_evaluations_enforcement value: " + v) + } + return &result, nil +} +func SerializeRuleSuite_rule_evaluations_enforcement(values []RuleSuite_rule_evaluations_enforcement) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RuleSuite_rule_evaluations_enforcement) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_rule_evaluations_result.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_rule_evaluations_result.go new file mode 100644 index 000000000..b93259e08 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_rule_evaluations_result.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The result of the evaluation of the individual rule. +type RuleSuite_rule_evaluations_result int + +const ( + PASS_RULESUITE_RULE_EVALUATIONS_RESULT RuleSuite_rule_evaluations_result = iota + FAIL_RULESUITE_RULE_EVALUATIONS_RESULT +) + +func (i RuleSuite_rule_evaluations_result) String() string { + return []string{"pass", "fail"}[i] +} +func ParseRuleSuite_rule_evaluations_result(v string) (any, error) { + result := PASS_RULESUITE_RULE_EVALUATIONS_RESULT + switch v { + case "pass": + result = PASS_RULESUITE_RULE_EVALUATIONS_RESULT + case "fail": + result = FAIL_RULESUITE_RULE_EVALUATIONS_RESULT + default: + return 0, errors.New("Unknown RuleSuite_rule_evaluations_result value: " + v) + } + return &result, nil +} +func SerializeRuleSuite_rule_evaluations_result(values []RuleSuite_rule_evaluations_result) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RuleSuite_rule_evaluations_result) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_rule_evaluations_rule_source.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_rule_evaluations_rule_source.go new file mode 100644 index 000000000..f287a1b56 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suite_rule_evaluations_rule_source.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RuleSuite_rule_evaluations_rule_source struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The ID of the rule source. + id *int32 + // The name of the rule source. + name *string + // The type of rule source. + typeEscaped *string +} +// NewRuleSuite_rule_evaluations_rule_source instantiates a new RuleSuite_rule_evaluations_rule_source and sets the default values. +func NewRuleSuite_rule_evaluations_rule_source()(*RuleSuite_rule_evaluations_rule_source) { + m := &RuleSuite_rule_evaluations_rule_source{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRuleSuite_rule_evaluations_rule_sourceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRuleSuite_rule_evaluations_rule_sourceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRuleSuite_rule_evaluations_rule_source(), 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 *RuleSuite_rule_evaluations_rule_source) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RuleSuite_rule_evaluations_rule_source) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + return res +} +// GetId gets the id property value. The ID of the rule source. +// returns a *int32 when successful +func (m *RuleSuite_rule_evaluations_rule_source) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name of the rule source. +// returns a *string when successful +func (m *RuleSuite_rule_evaluations_rule_source) GetName()(*string) { + return m.name +} +// GetTypeEscaped gets the type property value. The type of rule source. +// returns a *string when successful +func (m *RuleSuite_rule_evaluations_rule_source) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RuleSuite_rule_evaluations_rule_source) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + 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 *RuleSuite_rule_evaluations_rule_source) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The ID of the rule source. +func (m *RuleSuite_rule_evaluations_rule_source) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name of the rule source. +func (m *RuleSuite_rule_evaluations_rule_source) SetName(value *string)() { + m.name = value +} +// SetTypeEscaped sets the type property value. The type of rule source. +func (m *RuleSuite_rule_evaluations_rule_source) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +type RuleSuite_rule_evaluations_rule_sourceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetName()(*string) + GetTypeEscaped()(*string) + SetId(value *int32)() + SetName(value *string)() + SetTypeEscaped(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suites.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suites.go new file mode 100644 index 000000000..9e67b8a43 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suites.go @@ -0,0 +1,373 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RuleSuites struct { + // The number that identifies the user. + actor_id *int32 + // The handle for the GitHub user account. + actor_name *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The last commit sha in the push evaluation. + after_sha *string + // The first commit sha before the push evaluation. + before_sha *string + // The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. + evaluation_result *RuleSuites_evaluation_result + // The unique identifier of the rule insight. + id *int32 + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The ref name that the evaluation ran on. + ref *string + // The ID of the repository associated with the rule evaluation. + repository_id *int32 + // The name of the repository without the `.git` extension. + repository_name *string + // The result of the rule evaluations for rules with the `active` enforcement status. + result *RuleSuites_result +} +// NewRuleSuites instantiates a new RuleSuites and sets the default values. +func NewRuleSuites()(*RuleSuites) { + m := &RuleSuites{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRuleSuitesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRuleSuitesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRuleSuites(), nil +} +// GetActorId gets the actor_id property value. The number that identifies the user. +// returns a *int32 when successful +func (m *RuleSuites) GetActorId()(*int32) { + return m.actor_id +} +// GetActorName gets the actor_name property value. The handle for the GitHub user account. +// returns a *string when successful +func (m *RuleSuites) GetActorName()(*string) { + return m.actor_name +} +// 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 *RuleSuites) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAfterSha gets the after_sha property value. The last commit sha in the push evaluation. +// returns a *string when successful +func (m *RuleSuites) GetAfterSha()(*string) { + return m.after_sha +} +// GetBeforeSha gets the before_sha property value. The first commit sha before the push evaluation. +// returns a *string when successful +func (m *RuleSuites) GetBeforeSha()(*string) { + return m.before_sha +} +// GetEvaluationResult gets the evaluation_result property value. The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. +// returns a *RuleSuites_evaluation_result when successful +func (m *RuleSuites) GetEvaluationResult()(*RuleSuites_evaluation_result) { + return m.evaluation_result +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RuleSuites) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetActorId(val) + } + return nil + } + res["actor_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetActorName(val) + } + return nil + } + res["after_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAfterSha(val) + } + return nil + } + res["before_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBeforeSha(val) + } + return nil + } + res["evaluation_result"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRuleSuites_evaluation_result) + if err != nil { + return err + } + if val != nil { + m.SetEvaluationResult(val.(*RuleSuites_evaluation_result)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + res["repository_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryName(val) + } + return nil + } + res["result"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRuleSuites_result) + if err != nil { + return err + } + if val != nil { + m.SetResult(val.(*RuleSuites_result)) + } + return nil + } + return res +} +// GetId gets the id property value. The unique identifier of the rule insight. +// returns a *int32 when successful +func (m *RuleSuites) GetId()(*int32) { + return m.id +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *RuleSuites) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetRef gets the ref property value. The ref name that the evaluation ran on. +// returns a *string when successful +func (m *RuleSuites) GetRef()(*string) { + return m.ref +} +// GetRepositoryId gets the repository_id property value. The ID of the repository associated with the rule evaluation. +// returns a *int32 when successful +func (m *RuleSuites) GetRepositoryId()(*int32) { + return m.repository_id +} +// GetRepositoryName gets the repository_name property value. The name of the repository without the `.git` extension. +// returns a *string when successful +func (m *RuleSuites) GetRepositoryName()(*string) { + return m.repository_name +} +// GetResult gets the result property value. The result of the rule evaluations for rules with the `active` enforcement status. +// returns a *RuleSuites_result when successful +func (m *RuleSuites) GetResult()(*RuleSuites_result) { + return m.result +} +// Serialize serializes information the current object +func (m *RuleSuites) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("actor_id", m.GetActorId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("actor_name", m.GetActorName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("after_sha", m.GetAfterSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("before_sha", m.GetBeforeSha()) + if err != nil { + return err + } + } + if m.GetEvaluationResult() != nil { + cast := (*m.GetEvaluationResult()).String() + err := writer.WriteStringValue("evaluation_result", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_name", m.GetRepositoryName()) + if err != nil { + return err + } + } + if m.GetResult() != nil { + cast := (*m.GetResult()).String() + err := writer.WriteStringValue("result", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActorId sets the actor_id property value. The number that identifies the user. +func (m *RuleSuites) SetActorId(value *int32)() { + m.actor_id = value +} +// SetActorName sets the actor_name property value. The handle for the GitHub user account. +func (m *RuleSuites) SetActorName(value *string)() { + m.actor_name = value +} +// 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 *RuleSuites) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAfterSha sets the after_sha property value. The last commit sha in the push evaluation. +func (m *RuleSuites) SetAfterSha(value *string)() { + m.after_sha = value +} +// SetBeforeSha sets the before_sha property value. The first commit sha before the push evaluation. +func (m *RuleSuites) SetBeforeSha(value *string)() { + m.before_sha = value +} +// SetEvaluationResult sets the evaluation_result property value. The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. +func (m *RuleSuites) SetEvaluationResult(value *RuleSuites_evaluation_result)() { + m.evaluation_result = value +} +// SetId sets the id property value. The unique identifier of the rule insight. +func (m *RuleSuites) SetId(value *int32)() { + m.id = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *RuleSuites) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetRef sets the ref property value. The ref name that the evaluation ran on. +func (m *RuleSuites) SetRef(value *string)() { + m.ref = value +} +// SetRepositoryId sets the repository_id property value. The ID of the repository associated with the rule evaluation. +func (m *RuleSuites) SetRepositoryId(value *int32)() { + m.repository_id = value +} +// SetRepositoryName sets the repository_name property value. The name of the repository without the `.git` extension. +func (m *RuleSuites) SetRepositoryName(value *string)() { + m.repository_name = value +} +// SetResult sets the result property value. The result of the rule evaluations for rules with the `active` enforcement status. +func (m *RuleSuites) SetResult(value *RuleSuites_result)() { + m.result = value +} +type RuleSuitesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActorId()(*int32) + GetActorName()(*string) + GetAfterSha()(*string) + GetBeforeSha()(*string) + GetEvaluationResult()(*RuleSuites_evaluation_result) + GetId()(*int32) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetRef()(*string) + GetRepositoryId()(*int32) + GetRepositoryName()(*string) + GetResult()(*RuleSuites_result) + SetActorId(value *int32)() + SetActorName(value *string)() + SetAfterSha(value *string)() + SetBeforeSha(value *string)() + SetEvaluationResult(value *RuleSuites_evaluation_result)() + SetId(value *int32)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetRef(value *string)() + SetRepositoryId(value *int32)() + SetRepositoryName(value *string)() + SetResult(value *RuleSuites_result)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suites_evaluation_result.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suites_evaluation_result.go new file mode 100644 index 000000000..36ca145a5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suites_evaluation_result.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. +type RuleSuites_evaluation_result int + +const ( + PASS_RULESUITES_EVALUATION_RESULT RuleSuites_evaluation_result = iota + FAIL_RULESUITES_EVALUATION_RESULT +) + +func (i RuleSuites_evaluation_result) String() string { + return []string{"pass", "fail"}[i] +} +func ParseRuleSuites_evaluation_result(v string) (any, error) { + result := PASS_RULESUITES_EVALUATION_RESULT + switch v { + case "pass": + result = PASS_RULESUITES_EVALUATION_RESULT + case "fail": + result = FAIL_RULESUITES_EVALUATION_RESULT + default: + return 0, errors.New("Unknown RuleSuites_evaluation_result value: " + v) + } + return &result, nil +} +func SerializeRuleSuites_evaluation_result(values []RuleSuites_evaluation_result) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RuleSuites_evaluation_result) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suites_result.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suites_result.go new file mode 100644 index 000000000..2de4355a8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/rule_suites_result.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The result of the rule evaluations for rules with the `active` enforcement status. +type RuleSuites_result int + +const ( + PASS_RULESUITES_RESULT RuleSuites_result = iota + FAIL_RULESUITES_RESULT + BYPASS_RULESUITES_RESULT +) + +func (i RuleSuites_result) String() string { + return []string{"pass", "fail", "bypass"}[i] +} +func ParseRuleSuites_result(v string) (any, error) { + result := PASS_RULESUITES_RESULT + switch v { + case "pass": + result = PASS_RULESUITES_RESULT + case "fail": + result = FAIL_RULESUITES_RESULT + case "bypass": + result = BYPASS_RULESUITES_RESULT + default: + return 0, errors.New("Unknown RuleSuites_result value: " + v) + } + return &result, nil +} +func SerializeRuleSuites_result(values []RuleSuites_result) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RuleSuites_result) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/runner.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/runner.go new file mode 100644 index 000000000..09ce496e0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/runner.go @@ -0,0 +1,267 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Runner a self hosted runner +type Runner struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The busy property + busy *bool + // The id of the runner. + id *int32 + // The labels property + labels []RunnerLabelable + // The name of the runner. + name *string + // The Operating System of the runner. + os *string + // The id of the runner group. + runner_group_id *int32 + // The status of the runner. + status *string +} +// NewRunner instantiates a new Runner and sets the default values. +func NewRunner()(*Runner) { + m := &Runner{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRunnerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRunnerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRunner(), 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 *Runner) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBusy gets the busy property value. The busy property +// returns a *bool when successful +func (m *Runner) GetBusy()(*bool) { + return m.busy +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Runner) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["busy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetBusy(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RunnerLabelable) + } + } + m.SetLabels(res) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["os"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOs(val) + } + return nil + } + res["runner_group_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunnerGroupId(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id of the runner. +// returns a *int32 when successful +func (m *Runner) GetId()(*int32) { + return m.id +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *Runner) GetLabels()([]RunnerLabelable) { + return m.labels +} +// GetName gets the name property value. The name of the runner. +// returns a *string when successful +func (m *Runner) GetName()(*string) { + return m.name +} +// GetOs gets the os property value. The Operating System of the runner. +// returns a *string when successful +func (m *Runner) GetOs()(*string) { + return m.os +} +// GetRunnerGroupId gets the runner_group_id property value. The id of the runner group. +// returns a *int32 when successful +func (m *Runner) GetRunnerGroupId()(*int32) { + return m.runner_group_id +} +// GetStatus gets the status property value. The status of the runner. +// returns a *string when successful +func (m *Runner) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *Runner) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("busy", m.GetBusy()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("os", m.GetOs()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("runner_group_id", m.GetRunnerGroupId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *Runner) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBusy sets the busy property value. The busy property +func (m *Runner) SetBusy(value *bool)() { + m.busy = value +} +// SetId sets the id property value. The id of the runner. +func (m *Runner) SetId(value *int32)() { + m.id = value +} +// SetLabels sets the labels property value. The labels property +func (m *Runner) SetLabels(value []RunnerLabelable)() { + m.labels = value +} +// SetName sets the name property value. The name of the runner. +func (m *Runner) SetName(value *string)() { + m.name = value +} +// SetOs sets the os property value. The Operating System of the runner. +func (m *Runner) SetOs(value *string)() { + m.os = value +} +// SetRunnerGroupId sets the runner_group_id property value. The id of the runner group. +func (m *Runner) SetRunnerGroupId(value *int32)() { + m.runner_group_id = value +} +// SetStatus sets the status property value. The status of the runner. +func (m *Runner) SetStatus(value *string)() { + m.status = value +} +type Runnerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBusy()(*bool) + GetId()(*int32) + GetLabels()([]RunnerLabelable) + GetName()(*string) + GetOs()(*string) + GetRunnerGroupId()(*int32) + GetStatus()(*string) + SetBusy(value *bool)() + SetId(value *int32)() + SetLabels(value []RunnerLabelable)() + SetName(value *string)() + SetOs(value *string)() + SetRunnerGroupId(value *int32)() + SetStatus(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/runner_application.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/runner_application.go new file mode 100644 index 000000000..b46e5c608 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/runner_application.go @@ -0,0 +1,226 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RunnerApplication runner Application +type RunnerApplication struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The architecture property + architecture *string + // The download_url property + download_url *string + // The filename property + filename *string + // The os property + os *string + // The sha256_checksum property + sha256_checksum *string + // A short lived bearer token used to download the runner, if needed. + temp_download_token *string +} +// NewRunnerApplication instantiates a new RunnerApplication and sets the default values. +func NewRunnerApplication()(*RunnerApplication) { + m := &RunnerApplication{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRunnerApplicationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRunnerApplicationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRunnerApplication(), 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 *RunnerApplication) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArchitecture gets the architecture property value. The architecture property +// returns a *string when successful +func (m *RunnerApplication) GetArchitecture()(*string) { + return m.architecture +} +// GetDownloadUrl gets the download_url property value. The download_url property +// returns a *string when successful +func (m *RunnerApplication) GetDownloadUrl()(*string) { + return m.download_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RunnerApplication) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["architecture"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchitecture(val) + } + return nil + } + res["download_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadUrl(val) + } + return nil + } + res["filename"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFilename(val) + } + return nil + } + res["os"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOs(val) + } + return nil + } + res["sha256_checksum"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha256Checksum(val) + } + return nil + } + res["temp_download_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempDownloadToken(val) + } + return nil + } + return res +} +// GetFilename gets the filename property value. The filename property +// returns a *string when successful +func (m *RunnerApplication) GetFilename()(*string) { + return m.filename +} +// GetOs gets the os property value. The os property +// returns a *string when successful +func (m *RunnerApplication) GetOs()(*string) { + return m.os +} +// GetSha256Checksum gets the sha256_checksum property value. The sha256_checksum property +// returns a *string when successful +func (m *RunnerApplication) GetSha256Checksum()(*string) { + return m.sha256_checksum +} +// GetTempDownloadToken gets the temp_download_token property value. A short lived bearer token used to download the runner, if needed. +// returns a *string when successful +func (m *RunnerApplication) GetTempDownloadToken()(*string) { + return m.temp_download_token +} +// Serialize serializes information the current object +func (m *RunnerApplication) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("architecture", m.GetArchitecture()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("download_url", m.GetDownloadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("filename", m.GetFilename()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("os", m.GetOs()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha256_checksum", m.GetSha256Checksum()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_download_token", m.GetTempDownloadToken()) + 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 *RunnerApplication) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArchitecture sets the architecture property value. The architecture property +func (m *RunnerApplication) SetArchitecture(value *string)() { + m.architecture = value +} +// SetDownloadUrl sets the download_url property value. The download_url property +func (m *RunnerApplication) SetDownloadUrl(value *string)() { + m.download_url = value +} +// SetFilename sets the filename property value. The filename property +func (m *RunnerApplication) SetFilename(value *string)() { + m.filename = value +} +// SetOs sets the os property value. The os property +func (m *RunnerApplication) SetOs(value *string)() { + m.os = value +} +// SetSha256Checksum sets the sha256_checksum property value. The sha256_checksum property +func (m *RunnerApplication) SetSha256Checksum(value *string)() { + m.sha256_checksum = value +} +// SetTempDownloadToken sets the temp_download_token property value. A short lived bearer token used to download the runner, if needed. +func (m *RunnerApplication) SetTempDownloadToken(value *string)() { + m.temp_download_token = value +} +type RunnerApplicationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArchitecture()(*string) + GetDownloadUrl()(*string) + GetFilename()(*string) + GetOs()(*string) + GetSha256Checksum()(*string) + GetTempDownloadToken()(*string) + SetArchitecture(value *string)() + SetDownloadUrl(value *string)() + SetFilename(value *string)() + SetOs(value *string)() + SetSha256Checksum(value *string)() + SetTempDownloadToken(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/runner_label.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/runner_label.go new file mode 100644 index 000000000..f26890cdf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/runner_label.go @@ -0,0 +1,140 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RunnerLabel a label for a self hosted runner +type RunnerLabel struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Unique identifier of the label. + id *int32 + // Name of the label. + name *string + // The type of label. Read-only labels are applied automatically when the runner is configured. + typeEscaped *RunnerLabel_type +} +// NewRunnerLabel instantiates a new RunnerLabel and sets the default values. +func NewRunnerLabel()(*RunnerLabel) { + m := &RunnerLabel{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRunnerLabelFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRunnerLabelFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRunnerLabel(), 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 *RunnerLabel) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RunnerLabel) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRunnerLabel_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RunnerLabel_type)) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the label. +// returns a *int32 when successful +func (m *RunnerLabel) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. Name of the label. +// returns a *string when successful +func (m *RunnerLabel) GetName()(*string) { + return m.name +} +// GetTypeEscaped gets the type property value. The type of label. Read-only labels are applied automatically when the runner is configured. +// returns a *RunnerLabel_type when successful +func (m *RunnerLabel) GetTypeEscaped()(*RunnerLabel_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RunnerLabel) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RunnerLabel) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. Unique identifier of the label. +func (m *RunnerLabel) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. Name of the label. +func (m *RunnerLabel) SetName(value *string)() { + m.name = value +} +// SetTypeEscaped sets the type property value. The type of label. Read-only labels are applied automatically when the runner is configured. +func (m *RunnerLabel) SetTypeEscaped(value *RunnerLabel_type)() { + m.typeEscaped = value +} +type RunnerLabelable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetName()(*string) + GetTypeEscaped()(*RunnerLabel_type) + SetId(value *int32)() + SetName(value *string)() + SetTypeEscaped(value *RunnerLabel_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/runner_label_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/runner_label_type.go new file mode 100644 index 000000000..2c93d19b2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/runner_label_type.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The type of label. Read-only labels are applied automatically when the runner is configured. +type RunnerLabel_type int + +const ( + READONLY_RUNNERLABEL_TYPE RunnerLabel_type = iota + CUSTOM_RUNNERLABEL_TYPE +) + +func (i RunnerLabel_type) String() string { + return []string{"read-only", "custom"}[i] +} +func ParseRunnerLabel_type(v string) (any, error) { + result := READONLY_RUNNERLABEL_TYPE + switch v { + case "read-only": + result = READONLY_RUNNERLABEL_TYPE + case "custom": + result = CUSTOM_RUNNERLABEL_TYPE + default: + return 0, errors.New("Unknown RunnerLabel_type value: " + v) + } + return &result, nil +} +func SerializeRunnerLabel_type(values []RunnerLabel_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RunnerLabel_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_alert.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_alert.go new file mode 100644 index 000000000..9d60fcb32 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_alert.go @@ -0,0 +1,547 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SecretScanningAlert struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The GitHub URL of the alert resource. + html_url *string + // The REST API URL of the code locations for this alert. + locations_url *string + // The security alert number. + number *int32 + // Whether push protection was bypassed for the detected secret. + push_protection_bypassed *bool + // The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + push_protection_bypassed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + push_protection_bypassed_by NullableSimpleUserable + // **Required when the `state` is `resolved`.** The reason for resolving the alert. + resolution *SecretScanningAlertResolution + // An optional comment to resolve an alert. + resolution_comment *string + // The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + resolved_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + resolved_by NullableSimpleUserable + // The secret that was detected. + secret *string + // The type of secret that secret scanning detected. + secret_type *string + // User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Secret scanning patterns](https://docs.github.com/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)." + secret_type_display_name *string + // Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. + state *SecretScanningAlertState + // The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The REST API URL of the alert resource. + url *string + // The token status as of the latest validity check. + validity *SecretScanningAlert_validity +} +// NewSecretScanningAlert instantiates a new SecretScanningAlert and sets the default values. +func NewSecretScanningAlert()(*SecretScanningAlert) { + m := &SecretScanningAlert{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningAlertFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningAlertFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningAlert(), 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 *SecretScanningAlert) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *SecretScanningAlert) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningAlert) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["locations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocationsUrl(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["push_protection_bypassed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPushProtectionBypassed(val) + } + return nil + } + res["push_protection_bypassed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushProtectionBypassedAt(val) + } + return nil + } + res["push_protection_bypassed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPushProtectionBypassedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["resolution"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecretScanningAlertResolution) + if err != nil { + return err + } + if val != nil { + m.SetResolution(val.(*SecretScanningAlertResolution)) + } + return nil + } + res["resolution_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResolutionComment(val) + } + return nil + } + res["resolved_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetResolvedAt(val) + } + return nil + } + res["resolved_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetResolvedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["secret_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretType(val) + } + return nil + } + res["secret_type_display_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretTypeDisplayName(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecretScanningAlertState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*SecretScanningAlertState)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["validity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecretScanningAlert_validity) + if err != nil { + return err + } + if val != nil { + m.SetValidity(val.(*SecretScanningAlert_validity)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The GitHub URL of the alert resource. +// returns a *string when successful +func (m *SecretScanningAlert) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLocationsUrl gets the locations_url property value. The REST API URL of the code locations for this alert. +// returns a *string when successful +func (m *SecretScanningAlert) GetLocationsUrl()(*string) { + return m.locations_url +} +// GetNumber gets the number property value. The security alert number. +// returns a *int32 when successful +func (m *SecretScanningAlert) GetNumber()(*int32) { + return m.number +} +// GetPushProtectionBypassed gets the push_protection_bypassed property value. Whether push protection was bypassed for the detected secret. +// returns a *bool when successful +func (m *SecretScanningAlert) GetPushProtectionBypassed()(*bool) { + return m.push_protection_bypassed +} +// GetPushProtectionBypassedAt gets the push_protection_bypassed_at property value. The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *SecretScanningAlert) GetPushProtectionBypassedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.push_protection_bypassed_at +} +// GetPushProtectionBypassedBy gets the push_protection_bypassed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *SecretScanningAlert) GetPushProtectionBypassedBy()(NullableSimpleUserable) { + return m.push_protection_bypassed_by +} +// GetResolution gets the resolution property value. **Required when the `state` is `resolved`.** The reason for resolving the alert. +// returns a *SecretScanningAlertResolution when successful +func (m *SecretScanningAlert) GetResolution()(*SecretScanningAlertResolution) { + return m.resolution +} +// GetResolutionComment gets the resolution_comment property value. An optional comment to resolve an alert. +// returns a *string when successful +func (m *SecretScanningAlert) GetResolutionComment()(*string) { + return m.resolution_comment +} +// GetResolvedAt gets the resolved_at property value. The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *SecretScanningAlert) GetResolvedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.resolved_at +} +// GetResolvedBy gets the resolved_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *SecretScanningAlert) GetResolvedBy()(NullableSimpleUserable) { + return m.resolved_by +} +// GetSecret gets the secret property value. The secret that was detected. +// returns a *string when successful +func (m *SecretScanningAlert) GetSecret()(*string) { + return m.secret +} +// GetSecretType gets the secret_type property value. The type of secret that secret scanning detected. +// returns a *string when successful +func (m *SecretScanningAlert) GetSecretType()(*string) { + return m.secret_type +} +// GetSecretTypeDisplayName gets the secret_type_display_name property value. User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Secret scanning patterns](https://docs.github.com/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)." +// returns a *string when successful +func (m *SecretScanningAlert) GetSecretTypeDisplayName()(*string) { + return m.secret_type_display_name +} +// GetState gets the state property value. Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. +// returns a *SecretScanningAlertState when successful +func (m *SecretScanningAlert) GetState()(*SecretScanningAlertState) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *SecretScanningAlert) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The REST API URL of the alert resource. +// returns a *string when successful +func (m *SecretScanningAlert) GetUrl()(*string) { + return m.url +} +// GetValidity gets the validity property value. The token status as of the latest validity check. +// returns a *SecretScanningAlert_validity when successful +func (m *SecretScanningAlert) GetValidity()(*SecretScanningAlert_validity) { + return m.validity +} +// Serialize serializes information the current object +func (m *SecretScanningAlert) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("locations_url", m.GetLocationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push_protection_bypassed", m.GetPushProtectionBypassed()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("push_protection_bypassed_at", m.GetPushProtectionBypassedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("push_protection_bypassed_by", m.GetPushProtectionBypassedBy()) + if err != nil { + return err + } + } + if m.GetResolution() != nil { + cast := (*m.GetResolution()).String() + err := writer.WriteStringValue("resolution", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("resolution_comment", m.GetResolutionComment()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("resolved_at", m.GetResolvedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("resolved_by", m.GetResolvedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret_type", m.GetSecretType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret_type_display_name", m.GetSecretTypeDisplayName()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + if m.GetValidity() != nil { + cast := (*m.GetValidity()).String() + err := writer.WriteStringValue("validity", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *SecretScanningAlert) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *SecretScanningAlert) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The GitHub URL of the alert resource. +func (m *SecretScanningAlert) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLocationsUrl sets the locations_url property value. The REST API URL of the code locations for this alert. +func (m *SecretScanningAlert) SetLocationsUrl(value *string)() { + m.locations_url = value +} +// SetNumber sets the number property value. The security alert number. +func (m *SecretScanningAlert) SetNumber(value *int32)() { + m.number = value +} +// SetPushProtectionBypassed sets the push_protection_bypassed property value. Whether push protection was bypassed for the detected secret. +func (m *SecretScanningAlert) SetPushProtectionBypassed(value *bool)() { + m.push_protection_bypassed = value +} +// SetPushProtectionBypassedAt sets the push_protection_bypassed_at property value. The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *SecretScanningAlert) SetPushProtectionBypassedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.push_protection_bypassed_at = value +} +// SetPushProtectionBypassedBy sets the push_protection_bypassed_by property value. A GitHub user. +func (m *SecretScanningAlert) SetPushProtectionBypassedBy(value NullableSimpleUserable)() { + m.push_protection_bypassed_by = value +} +// SetResolution sets the resolution property value. **Required when the `state` is `resolved`.** The reason for resolving the alert. +func (m *SecretScanningAlert) SetResolution(value *SecretScanningAlertResolution)() { + m.resolution = value +} +// SetResolutionComment sets the resolution_comment property value. An optional comment to resolve an alert. +func (m *SecretScanningAlert) SetResolutionComment(value *string)() { + m.resolution_comment = value +} +// SetResolvedAt sets the resolved_at property value. The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *SecretScanningAlert) SetResolvedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.resolved_at = value +} +// SetResolvedBy sets the resolved_by property value. A GitHub user. +func (m *SecretScanningAlert) SetResolvedBy(value NullableSimpleUserable)() { + m.resolved_by = value +} +// SetSecret sets the secret property value. The secret that was detected. +func (m *SecretScanningAlert) SetSecret(value *string)() { + m.secret = value +} +// SetSecretType sets the secret_type property value. The type of secret that secret scanning detected. +func (m *SecretScanningAlert) SetSecretType(value *string)() { + m.secret_type = value +} +// SetSecretTypeDisplayName sets the secret_type_display_name property value. User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Secret scanning patterns](https://docs.github.com/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)." +func (m *SecretScanningAlert) SetSecretTypeDisplayName(value *string)() { + m.secret_type_display_name = value +} +// SetState sets the state property value. Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. +func (m *SecretScanningAlert) SetState(value *SecretScanningAlertState)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *SecretScanningAlert) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The REST API URL of the alert resource. +func (m *SecretScanningAlert) SetUrl(value *string)() { + m.url = value +} +// SetValidity sets the validity property value. The token status as of the latest validity check. +func (m *SecretScanningAlert) SetValidity(value *SecretScanningAlert_validity)() { + m.validity = value +} +type SecretScanningAlertable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetLocationsUrl()(*string) + GetNumber()(*int32) + GetPushProtectionBypassed()(*bool) + GetPushProtectionBypassedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetPushProtectionBypassedBy()(NullableSimpleUserable) + GetResolution()(*SecretScanningAlertResolution) + GetResolutionComment()(*string) + GetResolvedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetResolvedBy()(NullableSimpleUserable) + GetSecret()(*string) + GetSecretType()(*string) + GetSecretTypeDisplayName()(*string) + GetState()(*SecretScanningAlertState) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetValidity()(*SecretScanningAlert_validity) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetLocationsUrl(value *string)() + SetNumber(value *int32)() + SetPushProtectionBypassed(value *bool)() + SetPushProtectionBypassedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetPushProtectionBypassedBy(value NullableSimpleUserable)() + SetResolution(value *SecretScanningAlertResolution)() + SetResolutionComment(value *string)() + SetResolvedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetResolvedBy(value NullableSimpleUserable)() + SetSecret(value *string)() + SetSecretType(value *string)() + SetSecretTypeDisplayName(value *string)() + SetState(value *SecretScanningAlertState)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetValidity(value *SecretScanningAlert_validity)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_alert503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_alert503_error.go new file mode 100644 index 000000000..5eb9722f2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_alert503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SecretScanningAlert503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewSecretScanningAlert503Error instantiates a new SecretScanningAlert503Error and sets the default values. +func NewSecretScanningAlert503Error()(*SecretScanningAlert503Error) { + m := &SecretScanningAlert503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningAlert503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningAlert503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningAlert503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *SecretScanningAlert503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *SecretScanningAlert503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *SecretScanningAlert503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *SecretScanningAlert503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningAlert503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *SecretScanningAlert503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *SecretScanningAlert503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *SecretScanningAlert503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *SecretScanningAlert503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *SecretScanningAlert503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *SecretScanningAlert503Error) SetMessage(value *string)() { + m.message = value +} +type SecretScanningAlert503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_alert_resolution.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_alert_resolution.go new file mode 100644 index 000000000..f6f615bf4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_alert_resolution.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// **Required when the `state` is `resolved`.** The reason for resolving the alert. +type SecretScanningAlertResolution int + +const ( + FALSE_POSITIVE_SECRETSCANNINGALERTRESOLUTION SecretScanningAlertResolution = iota + WONT_FIX_SECRETSCANNINGALERTRESOLUTION + REVOKED_SECRETSCANNINGALERTRESOLUTION + USED_IN_TESTS_SECRETSCANNINGALERTRESOLUTION +) + +func (i SecretScanningAlertResolution) String() string { + return []string{"false_positive", "wont_fix", "revoked", "used_in_tests"}[i] +} +func ParseSecretScanningAlertResolution(v string) (any, error) { + result := FALSE_POSITIVE_SECRETSCANNINGALERTRESOLUTION + switch v { + case "false_positive": + result = FALSE_POSITIVE_SECRETSCANNINGALERTRESOLUTION + case "wont_fix": + result = WONT_FIX_SECRETSCANNINGALERTRESOLUTION + case "revoked": + result = REVOKED_SECRETSCANNINGALERTRESOLUTION + case "used_in_tests": + result = USED_IN_TESTS_SECRETSCANNINGALERTRESOLUTION + default: + return 0, errors.New("Unknown SecretScanningAlertResolution value: " + v) + } + return &result, nil +} +func SerializeSecretScanningAlertResolution(values []SecretScanningAlertResolution) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecretScanningAlertResolution) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_alert_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_alert_state.go new file mode 100644 index 000000000..647a08909 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_alert_state.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. +type SecretScanningAlertState int + +const ( + OPEN_SECRETSCANNINGALERTSTATE SecretScanningAlertState = iota + RESOLVED_SECRETSCANNINGALERTSTATE +) + +func (i SecretScanningAlertState) String() string { + return []string{"open", "resolved"}[i] +} +func ParseSecretScanningAlertState(v string) (any, error) { + result := OPEN_SECRETSCANNINGALERTSTATE + switch v { + case "open": + result = OPEN_SECRETSCANNINGALERTSTATE + case "resolved": + result = RESOLVED_SECRETSCANNINGALERTSTATE + default: + return 0, errors.New("Unknown SecretScanningAlertState value: " + v) + } + return &result, nil +} +func SerializeSecretScanningAlertState(values []SecretScanningAlertState) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecretScanningAlertState) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_alert_validity.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_alert_validity.go new file mode 100644 index 000000000..d7cd11181 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_alert_validity.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The token status as of the latest validity check. +type SecretScanningAlert_validity int + +const ( + ACTIVE_SECRETSCANNINGALERT_VALIDITY SecretScanningAlert_validity = iota + INACTIVE_SECRETSCANNINGALERT_VALIDITY + UNKNOWN_SECRETSCANNINGALERT_VALIDITY +) + +func (i SecretScanningAlert_validity) String() string { + return []string{"active", "inactive", "unknown"}[i] +} +func ParseSecretScanningAlert_validity(v string) (any, error) { + result := ACTIVE_SECRETSCANNINGALERT_VALIDITY + switch v { + case "active": + result = ACTIVE_SECRETSCANNINGALERT_VALIDITY + case "inactive": + result = INACTIVE_SECRETSCANNINGALERT_VALIDITY + case "unknown": + result = UNKNOWN_SECRETSCANNINGALERT_VALIDITY + default: + return 0, errors.New("Unknown SecretScanningAlert_validity value: " + v) + } + return &result, nil +} +func SerializeSecretScanningAlert_validity(values []SecretScanningAlert_validity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecretScanningAlert_validity) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location.go new file mode 100644 index 000000000..bc5f454a0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location.go @@ -0,0 +1,391 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SecretScanningLocation struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The details property + details SecretScanningLocation_SecretScanningLocation_detailsable + // 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, SecretScanningLocationWikiCommitable +type SecretScanningLocation_SecretScanningLocation_details struct { + // Composed type representation for type SecretScanningLocationCommitable + secretScanningLocationCommit SecretScanningLocationCommitable + // Composed type representation for type SecretScanningLocationDiscussionBodyable + secretScanningLocationDiscussionBody SecretScanningLocationDiscussionBodyable + // Composed type representation for type SecretScanningLocationDiscussionCommentable + secretScanningLocationDiscussionComment SecretScanningLocationDiscussionCommentable + // Composed type representation for type SecretScanningLocationDiscussionTitleable + secretScanningLocationDiscussionTitle SecretScanningLocationDiscussionTitleable + // Composed type representation for type SecretScanningLocationIssueBodyable + secretScanningLocationIssueBody SecretScanningLocationIssueBodyable + // Composed type representation for type SecretScanningLocationIssueCommentable + secretScanningLocationIssueComment SecretScanningLocationIssueCommentable + // Composed type representation for type SecretScanningLocationIssueTitleable + secretScanningLocationIssueTitle SecretScanningLocationIssueTitleable + // Composed type representation for type SecretScanningLocationPullRequestBodyable + secretScanningLocationPullRequestBody SecretScanningLocationPullRequestBodyable + // Composed type representation for type SecretScanningLocationPullRequestCommentable + secretScanningLocationPullRequestComment SecretScanningLocationPullRequestCommentable + // Composed type representation for type SecretScanningLocationPullRequestReviewable + secretScanningLocationPullRequestReview SecretScanningLocationPullRequestReviewable + // Composed type representation for type SecretScanningLocationPullRequestReviewCommentable + 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) { + m := &SecretScanningLocation_SecretScanningLocation_details{ + } + return m +} +// CreateSecretScanningLocation_SecretScanningLocation_detailsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocation_SecretScanningLocation_detailsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewSecretScanningLocation_SecretScanningLocation_details() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetIsComposedType()(bool) { + return true +} +// GetSecretScanningLocationCommit gets the secretScanningLocationCommit property value. Composed type representation for type SecretScanningLocationCommitable +// returns a SecretScanningLocationCommitable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationCommit()(SecretScanningLocationCommitable) { + return m.secretScanningLocationCommit +} +// GetSecretScanningLocationDiscussionBody gets the secretScanningLocationDiscussionBody property value. Composed type representation for type SecretScanningLocationDiscussionBodyable +// returns a SecretScanningLocationDiscussionBodyable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationDiscussionBody()(SecretScanningLocationDiscussionBodyable) { + return m.secretScanningLocationDiscussionBody +} +// GetSecretScanningLocationDiscussionComment gets the secretScanningLocationDiscussionComment property value. Composed type representation for type SecretScanningLocationDiscussionCommentable +// returns a SecretScanningLocationDiscussionCommentable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationDiscussionComment()(SecretScanningLocationDiscussionCommentable) { + return m.secretScanningLocationDiscussionComment +} +// GetSecretScanningLocationDiscussionTitle gets the secretScanningLocationDiscussionTitle property value. Composed type representation for type SecretScanningLocationDiscussionTitleable +// returns a SecretScanningLocationDiscussionTitleable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationDiscussionTitle()(SecretScanningLocationDiscussionTitleable) { + return m.secretScanningLocationDiscussionTitle +} +// GetSecretScanningLocationIssueBody gets the secretScanningLocationIssueBody property value. Composed type representation for type SecretScanningLocationIssueBodyable +// returns a SecretScanningLocationIssueBodyable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationIssueBody()(SecretScanningLocationIssueBodyable) { + return m.secretScanningLocationIssueBody +} +// GetSecretScanningLocationIssueComment gets the secretScanningLocationIssueComment property value. Composed type representation for type SecretScanningLocationIssueCommentable +// returns a SecretScanningLocationIssueCommentable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationIssueComment()(SecretScanningLocationIssueCommentable) { + return m.secretScanningLocationIssueComment +} +// GetSecretScanningLocationIssueTitle gets the secretScanningLocationIssueTitle property value. Composed type representation for type SecretScanningLocationIssueTitleable +// returns a SecretScanningLocationIssueTitleable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationIssueTitle()(SecretScanningLocationIssueTitleable) { + return m.secretScanningLocationIssueTitle +} +// GetSecretScanningLocationPullRequestBody gets the secretScanningLocationPullRequestBody property value. Composed type representation for type SecretScanningLocationPullRequestBodyable +// returns a SecretScanningLocationPullRequestBodyable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationPullRequestBody()(SecretScanningLocationPullRequestBodyable) { + return m.secretScanningLocationPullRequestBody +} +// GetSecretScanningLocationPullRequestComment gets the secretScanningLocationPullRequestComment property value. Composed type representation for type SecretScanningLocationPullRequestCommentable +// returns a SecretScanningLocationPullRequestCommentable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationPullRequestComment()(SecretScanningLocationPullRequestCommentable) { + return m.secretScanningLocationPullRequestComment +} +// GetSecretScanningLocationPullRequestReview gets the secretScanningLocationPullRequestReview property value. Composed type representation for type SecretScanningLocationPullRequestReviewable +// returns a SecretScanningLocationPullRequestReviewable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationPullRequestReview()(SecretScanningLocationPullRequestReviewable) { + return m.secretScanningLocationPullRequestReview +} +// GetSecretScanningLocationPullRequestReviewComment gets the secretScanningLocationPullRequestReviewComment property value. Composed type representation for type SecretScanningLocationPullRequestReviewCommentable +// returns a SecretScanningLocationPullRequestReviewCommentable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationPullRequestReviewComment()(SecretScanningLocationPullRequestReviewCommentable) { + return m.secretScanningLocationPullRequestReviewComment +} +// GetSecretScanningLocationPullRequestTitle gets the secretScanningLocationPullRequestTitle property value. Composed type representation for type SecretScanningLocationPullRequestTitleable +// returns a SecretScanningLocationPullRequestTitleable when successful +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 { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationCommit()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationDiscussionBody() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationDiscussionBody()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationDiscussionComment() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationDiscussionComment()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationDiscussionTitle() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationDiscussionTitle()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationIssueBody() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationIssueBody()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationIssueComment() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationIssueComment()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationIssueTitle() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationIssueTitle()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationPullRequestBody() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationPullRequestBody()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationPullRequestComment() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationPullRequestComment()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationPullRequestReview() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationPullRequestReview()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationPullRequestReviewComment() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationPullRequestReviewComment()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationPullRequestTitle() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationPullRequestTitle()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationWikiCommit() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationWikiCommit()) + if err != nil { + return err + } + } + return nil +} +// SetSecretScanningLocationCommit sets the secretScanningLocationCommit property value. Composed type representation for type SecretScanningLocationCommitable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationCommit(value SecretScanningLocationCommitable)() { + m.secretScanningLocationCommit = value +} +// SetSecretScanningLocationDiscussionBody sets the secretScanningLocationDiscussionBody property value. Composed type representation for type SecretScanningLocationDiscussionBodyable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationDiscussionBody(value SecretScanningLocationDiscussionBodyable)() { + m.secretScanningLocationDiscussionBody = value +} +// SetSecretScanningLocationDiscussionComment sets the secretScanningLocationDiscussionComment property value. Composed type representation for type SecretScanningLocationDiscussionCommentable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationDiscussionComment(value SecretScanningLocationDiscussionCommentable)() { + m.secretScanningLocationDiscussionComment = value +} +// SetSecretScanningLocationDiscussionTitle sets the secretScanningLocationDiscussionTitle property value. Composed type representation for type SecretScanningLocationDiscussionTitleable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationDiscussionTitle(value SecretScanningLocationDiscussionTitleable)() { + m.secretScanningLocationDiscussionTitle = value +} +// SetSecretScanningLocationIssueBody sets the secretScanningLocationIssueBody property value. Composed type representation for type SecretScanningLocationIssueBodyable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationIssueBody(value SecretScanningLocationIssueBodyable)() { + m.secretScanningLocationIssueBody = value +} +// SetSecretScanningLocationIssueComment sets the secretScanningLocationIssueComment property value. Composed type representation for type SecretScanningLocationIssueCommentable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationIssueComment(value SecretScanningLocationIssueCommentable)() { + m.secretScanningLocationIssueComment = value +} +// SetSecretScanningLocationIssueTitle sets the secretScanningLocationIssueTitle property value. Composed type representation for type SecretScanningLocationIssueTitleable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationIssueTitle(value SecretScanningLocationIssueTitleable)() { + m.secretScanningLocationIssueTitle = value +} +// SetSecretScanningLocationPullRequestBody sets the secretScanningLocationPullRequestBody property value. Composed type representation for type SecretScanningLocationPullRequestBodyable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationPullRequestBody(value SecretScanningLocationPullRequestBodyable)() { + m.secretScanningLocationPullRequestBody = value +} +// SetSecretScanningLocationPullRequestComment sets the secretScanningLocationPullRequestComment property value. Composed type representation for type SecretScanningLocationPullRequestCommentable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationPullRequestComment(value SecretScanningLocationPullRequestCommentable)() { + m.secretScanningLocationPullRequestComment = value +} +// SetSecretScanningLocationPullRequestReview sets the secretScanningLocationPullRequestReview property value. Composed type representation for type SecretScanningLocationPullRequestReviewable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationPullRequestReview(value SecretScanningLocationPullRequestReviewable)() { + m.secretScanningLocationPullRequestReview = value +} +// SetSecretScanningLocationPullRequestReviewComment sets the secretScanningLocationPullRequestReviewComment property value. Composed type representation for type SecretScanningLocationPullRequestReviewCommentable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationPullRequestReviewComment(value SecretScanningLocationPullRequestReviewCommentable)() { + m.secretScanningLocationPullRequestReviewComment = value +} +// SetSecretScanningLocationPullRequestTitle sets the secretScanningLocationPullRequestTitle property value. Composed type representation for type SecretScanningLocationPullRequestTitleable +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) + GetSecretScanningLocationDiscussionBody()(SecretScanningLocationDiscussionBodyable) + GetSecretScanningLocationDiscussionComment()(SecretScanningLocationDiscussionCommentable) + GetSecretScanningLocationDiscussionTitle()(SecretScanningLocationDiscussionTitleable) + GetSecretScanningLocationIssueBody()(SecretScanningLocationIssueBodyable) + GetSecretScanningLocationIssueComment()(SecretScanningLocationIssueCommentable) + GetSecretScanningLocationIssueTitle()(SecretScanningLocationIssueTitleable) + GetSecretScanningLocationPullRequestBody()(SecretScanningLocationPullRequestBodyable) + GetSecretScanningLocationPullRequestComment()(SecretScanningLocationPullRequestCommentable) + GetSecretScanningLocationPullRequestReview()(SecretScanningLocationPullRequestReviewable) + GetSecretScanningLocationPullRequestReviewComment()(SecretScanningLocationPullRequestReviewCommentable) + GetSecretScanningLocationPullRequestTitle()(SecretScanningLocationPullRequestTitleable) + GetSecretScanningLocationWikiCommit()(SecretScanningLocationWikiCommitable) + SetSecretScanningLocationCommit(value SecretScanningLocationCommitable)() + SetSecretScanningLocationDiscussionBody(value SecretScanningLocationDiscussionBodyable)() + SetSecretScanningLocationDiscussionComment(value SecretScanningLocationDiscussionCommentable)() + SetSecretScanningLocationDiscussionTitle(value SecretScanningLocationDiscussionTitleable)() + SetSecretScanningLocationIssueBody(value SecretScanningLocationIssueBodyable)() + SetSecretScanningLocationIssueComment(value SecretScanningLocationIssueCommentable)() + SetSecretScanningLocationIssueTitle(value SecretScanningLocationIssueTitleable)() + SetSecretScanningLocationPullRequestBody(value SecretScanningLocationPullRequestBodyable)() + SetSecretScanningLocationPullRequestComment(value SecretScanningLocationPullRequestCommentable)() + 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) { + m := &SecretScanningLocation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocation(), 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 *SecretScanningLocation) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDetails gets the details property value. The details property +// returns a SecretScanningLocation_SecretScanningLocation_detailsable when successful +func (m *SecretScanningLocation) GetDetails()(SecretScanningLocation_SecretScanningLocation_detailsable) { + return m.details +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["details"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSecretScanningLocation_SecretScanningLocation_detailsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDetails(val.(SecretScanningLocation_SecretScanningLocation_detailsable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecretScanningLocation_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*SecretScanningLocation_type)) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. 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. +// returns a *SecretScanningLocation_type when successful +func (m *SecretScanningLocation) GetTypeEscaped()(*SecretScanningLocation_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *SecretScanningLocation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("details", m.GetDetails()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *SecretScanningLocation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDetails sets the details property value. The details property +func (m *SecretScanningLocation) SetDetails(value SecretScanningLocation_SecretScanningLocation_detailsable)() { + m.details = value +} +// SetTypeEscaped sets the type property value. 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. +func (m *SecretScanningLocation) SetTypeEscaped(value *SecretScanningLocation_type)() { + m.typeEscaped = value +} +type SecretScanningLocationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDetails()(SecretScanningLocation_SecretScanningLocation_detailsable) + GetTypeEscaped()(*SecretScanningLocation_type) + SetDetails(value SecretScanningLocation_SecretScanningLocation_detailsable)() + SetTypeEscaped(value *SecretScanningLocation_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_commit.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_commit.go new file mode 100644 index 000000000..0b0cc7bb9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_commit.go @@ -0,0 +1,313 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationCommit represents a 'commit' secret scanning location type. This location type shows that a secret was detected inside a commit to a repository. +type SecretScanningLocationCommit 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 + // The API URL to get the associated blob resource + blob_url *string + // SHA-1 hash ID of the associated commit + commit_sha *string + // The API URL to get the associated commit resource + commit_url *string + // The column at which the secret ends within the end line when the file is interpreted as 8BIT ASCII + end_column *float64 + // Line number at which the secret ends in the file + end_line *float64 + // The file path in the repository + path *string + // The column at which the secret starts within the start line when the file is interpreted as 8BIT ASCII + start_column *float64 + // Line number at which the secret starts in the file + start_line *float64 +} +// NewSecretScanningLocationCommit instantiates a new SecretScanningLocationCommit and sets the default values. +func NewSecretScanningLocationCommit()(*SecretScanningLocationCommit) { + m := &SecretScanningLocationCommit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationCommitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationCommitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationCommit(), 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 *SecretScanningLocationCommit) 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 *SecretScanningLocationCommit) GetBlobSha()(*string) { + return m.blob_sha +} +// GetBlobUrl gets the blob_url property value. The API URL to get the associated blob resource +// returns a *string when successful +func (m *SecretScanningLocationCommit) GetBlobUrl()(*string) { + return m.blob_url +} +// GetCommitSha gets the commit_sha property value. SHA-1 hash ID of the associated commit +// returns a *string when successful +func (m *SecretScanningLocationCommit) GetCommitSha()(*string) { + return m.commit_sha +} +// GetCommitUrl gets the commit_url property value. The API URL to get the associated commit resource +// returns a *string when successful +func (m *SecretScanningLocationCommit) 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 8BIT ASCII +// returns a *float64 when successful +func (m *SecretScanningLocationCommit) 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 *SecretScanningLocationCommit) 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 *SecretScanningLocationCommit) 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["blob_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobUrl(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["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 +} +// GetPath gets the path property value. The file path in the repository +// returns a *string when successful +func (m *SecretScanningLocationCommit) 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 8BIT ASCII +// returns a *float64 when successful +func (m *SecretScanningLocationCommit) 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 *SecretScanningLocationCommit) GetStartLine()(*float64) { + return m.start_line +} +// Serialize serializes information the current object +func (m *SecretScanningLocationCommit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("blob_sha", m.GetBlobSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blob_url", m.GetBlobUrl()) + 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("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 *SecretScanningLocationCommit) 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 *SecretScanningLocationCommit) SetBlobSha(value *string)() { + m.blob_sha = value +} +// SetBlobUrl sets the blob_url property value. The API URL to get the associated blob resource +func (m *SecretScanningLocationCommit) SetBlobUrl(value *string)() { + m.blob_url = value +} +// SetCommitSha sets the commit_sha property value. SHA-1 hash ID of the associated commit +func (m *SecretScanningLocationCommit) SetCommitSha(value *string)() { + m.commit_sha = value +} +// SetCommitUrl sets the commit_url property value. The API URL to get the associated commit resource +func (m *SecretScanningLocationCommit) 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 8BIT ASCII +func (m *SecretScanningLocationCommit) 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 *SecretScanningLocationCommit) SetEndLine(value *float64)() { + m.end_line = value +} +// SetPath sets the path property value. The file path in the repository +func (m *SecretScanningLocationCommit) 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 8BIT ASCII +func (m *SecretScanningLocationCommit) 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 *SecretScanningLocationCommit) SetStartLine(value *float64)() { + m.start_line = value +} +type SecretScanningLocationCommitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBlobSha()(*string) + GetBlobUrl()(*string) + GetCommitSha()(*string) + GetCommitUrl()(*string) + GetEndColumn()(*float64) + GetEndLine()(*float64) + GetPath()(*string) + GetStartColumn()(*float64) + GetStartLine()(*float64) + SetBlobSha(value *string)() + SetBlobUrl(value *string)() + SetCommitSha(value *string)() + SetCommitUrl(value *string)() + SetEndColumn(value *float64)() + SetEndLine(value *float64)() + SetPath(value *string)() + SetStartColumn(value *float64)() + SetStartLine(value *float64)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_discussion_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_discussion_body.go new file mode 100644 index 000000000..66ddae50c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_discussion_body.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationDiscussionBody represents a 'discussion_body' secret scanning location type. This location type shows that a secret was detected in the body of a discussion. +type SecretScanningLocationDiscussionBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The URL to the discussion where the secret was detected. + discussion_body_url *string +} +// NewSecretScanningLocationDiscussionBody instantiates a new SecretScanningLocationDiscussionBody and sets the default values. +func NewSecretScanningLocationDiscussionBody()(*SecretScanningLocationDiscussionBody) { + m := &SecretScanningLocationDiscussionBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationDiscussionBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationDiscussionBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationDiscussionBody(), 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 *SecretScanningLocationDiscussionBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDiscussionBodyUrl gets the discussion_body_url property value. The URL to the discussion where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationDiscussionBody) GetDiscussionBodyUrl()(*string) { + return m.discussion_body_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocationDiscussionBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["discussion_body_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiscussionBodyUrl(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *SecretScanningLocationDiscussionBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("discussion_body_url", m.GetDiscussionBodyUrl()) + 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 *SecretScanningLocationDiscussionBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDiscussionBodyUrl sets the discussion_body_url property value. The URL to the discussion where the secret was detected. +func (m *SecretScanningLocationDiscussionBody) SetDiscussionBodyUrl(value *string)() { + m.discussion_body_url = value +} +type SecretScanningLocationDiscussionBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDiscussionBodyUrl()(*string) + SetDiscussionBodyUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_discussion_comment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_discussion_comment.go new file mode 100644 index 000000000..cfe8f97ca --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_discussion_comment.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationDiscussionComment represents a 'discussion_comment' secret scanning location type. This location type shows that a secret was detected in a comment on a discussion. +type SecretScanningLocationDiscussionComment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The API URL to get the discussion comment where the secret was detected. + discussion_comment_url *string +} +// NewSecretScanningLocationDiscussionComment instantiates a new SecretScanningLocationDiscussionComment and sets the default values. +func NewSecretScanningLocationDiscussionComment()(*SecretScanningLocationDiscussionComment) { + m := &SecretScanningLocationDiscussionComment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationDiscussionCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationDiscussionCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationDiscussionComment(), 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 *SecretScanningLocationDiscussionComment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDiscussionCommentUrl gets the discussion_comment_url property value. The API URL to get the discussion comment where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationDiscussionComment) GetDiscussionCommentUrl()(*string) { + return m.discussion_comment_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocationDiscussionComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["discussion_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiscussionCommentUrl(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *SecretScanningLocationDiscussionComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("discussion_comment_url", m.GetDiscussionCommentUrl()) + 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 *SecretScanningLocationDiscussionComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDiscussionCommentUrl sets the discussion_comment_url property value. The API URL to get the discussion comment where the secret was detected. +func (m *SecretScanningLocationDiscussionComment) SetDiscussionCommentUrl(value *string)() { + m.discussion_comment_url = value +} +type SecretScanningLocationDiscussionCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDiscussionCommentUrl()(*string) + SetDiscussionCommentUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_discussion_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_discussion_title.go new file mode 100644 index 000000000..cd63d068c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_discussion_title.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationDiscussionTitle represents a 'discussion_title' secret scanning location type. This location type shows that a secret was detected in the title of a discussion. +type SecretScanningLocationDiscussionTitle struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The URL to the discussion where the secret was detected. + discussion_title_url *string +} +// NewSecretScanningLocationDiscussionTitle instantiates a new SecretScanningLocationDiscussionTitle and sets the default values. +func NewSecretScanningLocationDiscussionTitle()(*SecretScanningLocationDiscussionTitle) { + m := &SecretScanningLocationDiscussionTitle{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationDiscussionTitleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationDiscussionTitleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationDiscussionTitle(), 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 *SecretScanningLocationDiscussionTitle) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDiscussionTitleUrl gets the discussion_title_url property value. The URL to the discussion where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationDiscussionTitle) GetDiscussionTitleUrl()(*string) { + return m.discussion_title_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocationDiscussionTitle) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["discussion_title_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiscussionTitleUrl(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *SecretScanningLocationDiscussionTitle) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("discussion_title_url", m.GetDiscussionTitleUrl()) + 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 *SecretScanningLocationDiscussionTitle) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDiscussionTitleUrl sets the discussion_title_url property value. The URL to the discussion where the secret was detected. +func (m *SecretScanningLocationDiscussionTitle) SetDiscussionTitleUrl(value *string)() { + m.discussion_title_url = value +} +type SecretScanningLocationDiscussionTitleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDiscussionTitleUrl()(*string) + SetDiscussionTitleUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_issue_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_issue_body.go new file mode 100644 index 000000000..799875213 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_issue_body.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationIssueBody represents an 'issue_body' secret scanning location type. This location type shows that a secret was detected in the body of an issue. +type SecretScanningLocationIssueBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The API URL to get the issue where the secret was detected. + issue_body_url *string +} +// NewSecretScanningLocationIssueBody instantiates a new SecretScanningLocationIssueBody and sets the default values. +func NewSecretScanningLocationIssueBody()(*SecretScanningLocationIssueBody) { + m := &SecretScanningLocationIssueBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationIssueBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationIssueBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationIssueBody(), 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 *SecretScanningLocationIssueBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocationIssueBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["issue_body_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueBodyUrl(val) + } + return nil + } + return res +} +// GetIssueBodyUrl gets the issue_body_url property value. The API URL to get the issue where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationIssueBody) GetIssueBodyUrl()(*string) { + return m.issue_body_url +} +// Serialize serializes information the current object +func (m *SecretScanningLocationIssueBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("issue_body_url", m.GetIssueBodyUrl()) + 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 *SecretScanningLocationIssueBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIssueBodyUrl sets the issue_body_url property value. The API URL to get the issue where the secret was detected. +func (m *SecretScanningLocationIssueBody) SetIssueBodyUrl(value *string)() { + m.issue_body_url = value +} +type SecretScanningLocationIssueBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIssueBodyUrl()(*string) + SetIssueBodyUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_issue_comment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_issue_comment.go new file mode 100644 index 000000000..5d4c73e9b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_issue_comment.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationIssueComment represents an 'issue_comment' secret scanning location type. This location type shows that a secret was detected in a comment on an issue. +type SecretScanningLocationIssueComment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The API URL to get the issue comment where the secret was detected. + issue_comment_url *string +} +// NewSecretScanningLocationIssueComment instantiates a new SecretScanningLocationIssueComment and sets the default values. +func NewSecretScanningLocationIssueComment()(*SecretScanningLocationIssueComment) { + m := &SecretScanningLocationIssueComment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationIssueCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationIssueCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationIssueComment(), 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 *SecretScanningLocationIssueComment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocationIssueComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + return res +} +// GetIssueCommentUrl gets the issue_comment_url property value. The API URL to get the issue comment where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationIssueComment) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// Serialize serializes information the current object +func (m *SecretScanningLocationIssueComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + 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 *SecretScanningLocationIssueComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The API URL to get the issue comment where the secret was detected. +func (m *SecretScanningLocationIssueComment) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +type SecretScanningLocationIssueCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIssueCommentUrl()(*string) + SetIssueCommentUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_issue_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_issue_title.go new file mode 100644 index 000000000..a0eef7c50 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_issue_title.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationIssueTitle represents an 'issue_title' secret scanning location type. This location type shows that a secret was detected in the title of an issue. +type SecretScanningLocationIssueTitle struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The API URL to get the issue where the secret was detected. + issue_title_url *string +} +// NewSecretScanningLocationIssueTitle instantiates a new SecretScanningLocationIssueTitle and sets the default values. +func NewSecretScanningLocationIssueTitle()(*SecretScanningLocationIssueTitle) { + m := &SecretScanningLocationIssueTitle{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationIssueTitleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationIssueTitleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationIssueTitle(), 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 *SecretScanningLocationIssueTitle) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocationIssueTitle) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["issue_title_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueTitleUrl(val) + } + return nil + } + return res +} +// GetIssueTitleUrl gets the issue_title_url property value. The API URL to get the issue where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationIssueTitle) GetIssueTitleUrl()(*string) { + return m.issue_title_url +} +// Serialize serializes information the current object +func (m *SecretScanningLocationIssueTitle) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("issue_title_url", m.GetIssueTitleUrl()) + 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 *SecretScanningLocationIssueTitle) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIssueTitleUrl sets the issue_title_url property value. The API URL to get the issue where the secret was detected. +func (m *SecretScanningLocationIssueTitle) SetIssueTitleUrl(value *string)() { + m.issue_title_url = value +} +type SecretScanningLocationIssueTitleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIssueTitleUrl()(*string) + SetIssueTitleUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_pull_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_pull_request_body.go new file mode 100644 index 000000000..3ca6cfe6f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_pull_request_body.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationPullRequestBody represents a 'pull_request_body' secret scanning location type. This location type shows that a secret was detected in the body of a pull request. +type SecretScanningLocationPullRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The API URL to get the pull request where the secret was detected. + pull_request_body_url *string +} +// NewSecretScanningLocationPullRequestBody instantiates a new SecretScanningLocationPullRequestBody and sets the default values. +func NewSecretScanningLocationPullRequestBody()(*SecretScanningLocationPullRequestBody) { + m := &SecretScanningLocationPullRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationPullRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationPullRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationPullRequestBody(), 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 *SecretScanningLocationPullRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocationPullRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["pull_request_body_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestBodyUrl(val) + } + return nil + } + return res +} +// GetPullRequestBodyUrl gets the pull_request_body_url property value. The API URL to get the pull request where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationPullRequestBody) GetPullRequestBodyUrl()(*string) { + return m.pull_request_body_url +} +// Serialize serializes information the current object +func (m *SecretScanningLocationPullRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("pull_request_body_url", m.GetPullRequestBodyUrl()) + 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 *SecretScanningLocationPullRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPullRequestBodyUrl sets the pull_request_body_url property value. The API URL to get the pull request where the secret was detected. +func (m *SecretScanningLocationPullRequestBody) SetPullRequestBodyUrl(value *string)() { + m.pull_request_body_url = value +} +type SecretScanningLocationPullRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPullRequestBodyUrl()(*string) + SetPullRequestBodyUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_pull_request_comment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_pull_request_comment.go new file mode 100644 index 000000000..a11440a99 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_pull_request_comment.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationPullRequestComment represents a 'pull_request_comment' secret scanning location type. This location type shows that a secret was detected in a comment on a pull request. +type SecretScanningLocationPullRequestComment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The API URL to get the pull request comment where the secret was detected. + pull_request_comment_url *string +} +// NewSecretScanningLocationPullRequestComment instantiates a new SecretScanningLocationPullRequestComment and sets the default values. +func NewSecretScanningLocationPullRequestComment()(*SecretScanningLocationPullRequestComment) { + m := &SecretScanningLocationPullRequestComment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationPullRequestCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationPullRequestCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationPullRequestComment(), 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 *SecretScanningLocationPullRequestComment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocationPullRequestComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["pull_request_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestCommentUrl(val) + } + return nil + } + return res +} +// GetPullRequestCommentUrl gets the pull_request_comment_url property value. The API URL to get the pull request comment where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationPullRequestComment) GetPullRequestCommentUrl()(*string) { + return m.pull_request_comment_url +} +// Serialize serializes information the current object +func (m *SecretScanningLocationPullRequestComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("pull_request_comment_url", m.GetPullRequestCommentUrl()) + 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 *SecretScanningLocationPullRequestComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPullRequestCommentUrl sets the pull_request_comment_url property value. The API URL to get the pull request comment where the secret was detected. +func (m *SecretScanningLocationPullRequestComment) SetPullRequestCommentUrl(value *string)() { + m.pull_request_comment_url = value +} +type SecretScanningLocationPullRequestCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPullRequestCommentUrl()(*string) + SetPullRequestCommentUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_pull_request_review.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_pull_request_review.go new file mode 100644 index 000000000..89d63890f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_pull_request_review.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationPullRequestReview represents a 'pull_request_review' secret scanning location type. This location type shows that a secret was detected in a review on a pull request. +type SecretScanningLocationPullRequestReview struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The API URL to get the pull request review where the secret was detected. + pull_request_review_url *string +} +// NewSecretScanningLocationPullRequestReview instantiates a new SecretScanningLocationPullRequestReview and sets the default values. +func NewSecretScanningLocationPullRequestReview()(*SecretScanningLocationPullRequestReview) { + m := &SecretScanningLocationPullRequestReview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationPullRequestReviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationPullRequestReviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationPullRequestReview(), 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 *SecretScanningLocationPullRequestReview) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocationPullRequestReview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["pull_request_review_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestReviewUrl(val) + } + return nil + } + return res +} +// GetPullRequestReviewUrl gets the pull_request_review_url property value. The API URL to get the pull request review where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationPullRequestReview) GetPullRequestReviewUrl()(*string) { + return m.pull_request_review_url +} +// Serialize serializes information the current object +func (m *SecretScanningLocationPullRequestReview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("pull_request_review_url", m.GetPullRequestReviewUrl()) + 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 *SecretScanningLocationPullRequestReview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPullRequestReviewUrl sets the pull_request_review_url property value. The API URL to get the pull request review where the secret was detected. +func (m *SecretScanningLocationPullRequestReview) SetPullRequestReviewUrl(value *string)() { + m.pull_request_review_url = value +} +type SecretScanningLocationPullRequestReviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPullRequestReviewUrl()(*string) + SetPullRequestReviewUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_pull_request_review_comment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_pull_request_review_comment.go new file mode 100644 index 000000000..8a11d0d99 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_pull_request_review_comment.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationPullRequestReviewComment represents a 'pull_request_review_comment' secret scanning location type. This location type shows that a secret was detected in a review comment on a pull request. +type SecretScanningLocationPullRequestReviewComment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The API URL to get the pull request review comment where the secret was detected. + pull_request_review_comment_url *string +} +// NewSecretScanningLocationPullRequestReviewComment instantiates a new SecretScanningLocationPullRequestReviewComment and sets the default values. +func NewSecretScanningLocationPullRequestReviewComment()(*SecretScanningLocationPullRequestReviewComment) { + m := &SecretScanningLocationPullRequestReviewComment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationPullRequestReviewCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationPullRequestReviewCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationPullRequestReviewComment(), 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 *SecretScanningLocationPullRequestReviewComment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocationPullRequestReviewComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["pull_request_review_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestReviewCommentUrl(val) + } + return nil + } + return res +} +// GetPullRequestReviewCommentUrl gets the pull_request_review_comment_url property value. The API URL to get the pull request review comment where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationPullRequestReviewComment) GetPullRequestReviewCommentUrl()(*string) { + return m.pull_request_review_comment_url +} +// Serialize serializes information the current object +func (m *SecretScanningLocationPullRequestReviewComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("pull_request_review_comment_url", m.GetPullRequestReviewCommentUrl()) + 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 *SecretScanningLocationPullRequestReviewComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPullRequestReviewCommentUrl sets the pull_request_review_comment_url property value. The API URL to get the pull request review comment where the secret was detected. +func (m *SecretScanningLocationPullRequestReviewComment) SetPullRequestReviewCommentUrl(value *string)() { + m.pull_request_review_comment_url = value +} +type SecretScanningLocationPullRequestReviewCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPullRequestReviewCommentUrl()(*string) + SetPullRequestReviewCommentUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_pull_request_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_pull_request_title.go new file mode 100644 index 000000000..e5c8d82c2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_pull_request_title.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationPullRequestTitle represents a 'pull_request_title' secret scanning location type. This location type shows that a secret was detected in the title of a pull request. +type SecretScanningLocationPullRequestTitle struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The API URL to get the pull request where the secret was detected. + pull_request_title_url *string +} +// NewSecretScanningLocationPullRequestTitle instantiates a new SecretScanningLocationPullRequestTitle and sets the default values. +func NewSecretScanningLocationPullRequestTitle()(*SecretScanningLocationPullRequestTitle) { + m := &SecretScanningLocationPullRequestTitle{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationPullRequestTitleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationPullRequestTitleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationPullRequestTitle(), 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 *SecretScanningLocationPullRequestTitle) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocationPullRequestTitle) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["pull_request_title_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestTitleUrl(val) + } + return nil + } + return res +} +// GetPullRequestTitleUrl gets the pull_request_title_url property value. The API URL to get the pull request where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationPullRequestTitle) GetPullRequestTitleUrl()(*string) { + return m.pull_request_title_url +} +// Serialize serializes information the current object +func (m *SecretScanningLocationPullRequestTitle) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("pull_request_title_url", m.GetPullRequestTitleUrl()) + 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 *SecretScanningLocationPullRequestTitle) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPullRequestTitleUrl sets the pull_request_title_url property value. The API URL to get the pull request where the secret was detected. +func (m *SecretScanningLocationPullRequestTitle) SetPullRequestTitleUrl(value *string)() { + m.pull_request_title_url = value +} +type SecretScanningLocationPullRequestTitleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPullRequestTitleUrl()(*string) + SetPullRequestTitleUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_type.go new file mode 100644 index 000000000..f5ba61cd8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_type.go @@ -0,0 +1,70 @@ +package models +import ( + "errors" +) +// 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. +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 + DISCUSSION_TITLE_SECRETSCANNINGLOCATION_TYPE + DISCUSSION_BODY_SECRETSCANNINGLOCATION_TYPE + DISCUSSION_COMMENT_SECRETSCANNINGLOCATION_TYPE + PULL_REQUEST_TITLE_SECRETSCANNINGLOCATION_TYPE + PULL_REQUEST_BODY_SECRETSCANNINGLOCATION_TYPE + PULL_REQUEST_COMMENT_SECRETSCANNINGLOCATION_TYPE + PULL_REQUEST_REVIEW_SECRETSCANNINGLOCATION_TYPE + PULL_REQUEST_REVIEW_COMMENT_SECRETSCANNINGLOCATION_TYPE +) + +func (i SecretScanningLocation_type) String() string { + 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": + result = ISSUE_BODY_SECRETSCANNINGLOCATION_TYPE + case "issue_comment": + result = ISSUE_COMMENT_SECRETSCANNINGLOCATION_TYPE + case "discussion_title": + result = DISCUSSION_TITLE_SECRETSCANNINGLOCATION_TYPE + case "discussion_body": + result = DISCUSSION_BODY_SECRETSCANNINGLOCATION_TYPE + case "discussion_comment": + result = DISCUSSION_COMMENT_SECRETSCANNINGLOCATION_TYPE + case "pull_request_title": + result = PULL_REQUEST_TITLE_SECRETSCANNINGLOCATION_TYPE + case "pull_request_body": + result = PULL_REQUEST_BODY_SECRETSCANNINGLOCATION_TYPE + case "pull_request_comment": + result = PULL_REQUEST_COMMENT_SECRETSCANNINGLOCATION_TYPE + case "pull_request_review": + result = PULL_REQUEST_REVIEW_SECRETSCANNINGLOCATION_TYPE + case "pull_request_review_comment": + result = PULL_REQUEST_REVIEW_COMMENT_SECRETSCANNINGLOCATION_TYPE + default: + return 0, errors.New("Unknown SecretScanningLocation_type value: " + v) + } + return &result, nil +} +func SerializeSecretScanningLocation_type(values []SecretScanningLocation_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecretScanningLocation_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_wiki_commit.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/secret_scanning_location_wiki_commit.go new file mode 100644 index 000000000..14032fbf1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/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/vendor/github.com/octokit/go-sdk/pkg/github/models/security_advisory_credit_types.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_advisory_credit_types.go new file mode 100644 index 000000000..fca2756c8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_advisory_credit_types.go @@ -0,0 +1,61 @@ +package models +import ( + "errors" +) +// The type of credit the user is receiving. +type SecurityAdvisoryCreditTypes int + +const ( + ANALYST_SECURITYADVISORYCREDITTYPES SecurityAdvisoryCreditTypes = iota + FINDER_SECURITYADVISORYCREDITTYPES + REPORTER_SECURITYADVISORYCREDITTYPES + COORDINATOR_SECURITYADVISORYCREDITTYPES + REMEDIATION_DEVELOPER_SECURITYADVISORYCREDITTYPES + REMEDIATION_REVIEWER_SECURITYADVISORYCREDITTYPES + REMEDIATION_VERIFIER_SECURITYADVISORYCREDITTYPES + TOOL_SECURITYADVISORYCREDITTYPES + SPONSOR_SECURITYADVISORYCREDITTYPES + OTHER_SECURITYADVISORYCREDITTYPES +) + +func (i SecurityAdvisoryCreditTypes) String() string { + return []string{"analyst", "finder", "reporter", "coordinator", "remediation_developer", "remediation_reviewer", "remediation_verifier", "tool", "sponsor", "other"}[i] +} +func ParseSecurityAdvisoryCreditTypes(v string) (any, error) { + result := ANALYST_SECURITYADVISORYCREDITTYPES + switch v { + case "analyst": + result = ANALYST_SECURITYADVISORYCREDITTYPES + case "finder": + result = FINDER_SECURITYADVISORYCREDITTYPES + case "reporter": + result = REPORTER_SECURITYADVISORYCREDITTYPES + case "coordinator": + result = COORDINATOR_SECURITYADVISORYCREDITTYPES + case "remediation_developer": + result = REMEDIATION_DEVELOPER_SECURITYADVISORYCREDITTYPES + case "remediation_reviewer": + result = REMEDIATION_REVIEWER_SECURITYADVISORYCREDITTYPES + case "remediation_verifier": + result = REMEDIATION_VERIFIER_SECURITYADVISORYCREDITTYPES + case "tool": + result = TOOL_SECURITYADVISORYCREDITTYPES + case "sponsor": + result = SPONSOR_SECURITYADVISORYCREDITTYPES + case "other": + result = OTHER_SECURITYADVISORYCREDITTYPES + default: + return 0, errors.New("Unknown SecurityAdvisoryCreditTypes value: " + v) + } + return &result, nil +} +func SerializeSecurityAdvisoryCreditTypes(values []SecurityAdvisoryCreditTypes) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecurityAdvisoryCreditTypes) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/security_advisory_ecosystems.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_advisory_ecosystems.go new file mode 100644 index 000000000..d22ab7bd1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_advisory_ecosystems.go @@ -0,0 +1,70 @@ +package models +import ( + "errors" +) +// The package's language or package management ecosystem. +type SecurityAdvisoryEcosystems int + +const ( + RUBYGEMS_SECURITYADVISORYECOSYSTEMS SecurityAdvisoryEcosystems = iota + NPM_SECURITYADVISORYECOSYSTEMS + PIP_SECURITYADVISORYECOSYSTEMS + MAVEN_SECURITYADVISORYECOSYSTEMS + NUGET_SECURITYADVISORYECOSYSTEMS + COMPOSER_SECURITYADVISORYECOSYSTEMS + GO_SECURITYADVISORYECOSYSTEMS + RUST_SECURITYADVISORYECOSYSTEMS + ERLANG_SECURITYADVISORYECOSYSTEMS + ACTIONS_SECURITYADVISORYECOSYSTEMS + PUB_SECURITYADVISORYECOSYSTEMS + OTHER_SECURITYADVISORYECOSYSTEMS + SWIFT_SECURITYADVISORYECOSYSTEMS +) + +func (i SecurityAdvisoryEcosystems) String() string { + return []string{"rubygems", "npm", "pip", "maven", "nuget", "composer", "go", "rust", "erlang", "actions", "pub", "other", "swift"}[i] +} +func ParseSecurityAdvisoryEcosystems(v string) (any, error) { + result := RUBYGEMS_SECURITYADVISORYECOSYSTEMS + switch v { + case "rubygems": + result = RUBYGEMS_SECURITYADVISORYECOSYSTEMS + case "npm": + result = NPM_SECURITYADVISORYECOSYSTEMS + case "pip": + result = PIP_SECURITYADVISORYECOSYSTEMS + case "maven": + result = MAVEN_SECURITYADVISORYECOSYSTEMS + case "nuget": + result = NUGET_SECURITYADVISORYECOSYSTEMS + case "composer": + result = COMPOSER_SECURITYADVISORYECOSYSTEMS + case "go": + result = GO_SECURITYADVISORYECOSYSTEMS + case "rust": + result = RUST_SECURITYADVISORYECOSYSTEMS + case "erlang": + result = ERLANG_SECURITYADVISORYECOSYSTEMS + case "actions": + result = ACTIONS_SECURITYADVISORYECOSYSTEMS + case "pub": + result = PUB_SECURITYADVISORYECOSYSTEMS + case "other": + result = OTHER_SECURITYADVISORYECOSYSTEMS + case "swift": + result = SWIFT_SECURITYADVISORYECOSYSTEMS + default: + return 0, errors.New("Unknown SecurityAdvisoryEcosystems value: " + v) + } + return &result, nil +} +func SerializeSecurityAdvisoryEcosystems(values []SecurityAdvisoryEcosystems) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecurityAdvisoryEcosystems) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis.go new file mode 100644 index 000000000..d6bb1ec19 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SecurityAndAnalysis struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The advanced_security property + advanced_security SecurityAndAnalysis_advanced_securityable + // Enable or disable Dependabot security updates for the repository. + dependabot_security_updates SecurityAndAnalysis_dependabot_security_updatesable + // The secret_scanning property + secret_scanning SecurityAndAnalysis_secret_scanningable + // The secret_scanning_push_protection property + secret_scanning_push_protection SecurityAndAnalysis_secret_scanning_push_protectionable +} +// NewSecurityAndAnalysis instantiates a new SecurityAndAnalysis and sets the default values. +func NewSecurityAndAnalysis()(*SecurityAndAnalysis) { + m := &SecurityAndAnalysis{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecurityAndAnalysisFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecurityAndAnalysisFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecurityAndAnalysis(), 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 *SecurityAndAnalysis) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvancedSecurity gets the advanced_security property value. The advanced_security property +// returns a SecurityAndAnalysis_advanced_securityable when successful +func (m *SecurityAndAnalysis) GetAdvancedSecurity()(SecurityAndAnalysis_advanced_securityable) { + return m.advanced_security +} +// GetDependabotSecurityUpdates gets the dependabot_security_updates property value. Enable or disable Dependabot security updates for the repository. +// returns a SecurityAndAnalysis_dependabot_security_updatesable when successful +func (m *SecurityAndAnalysis) GetDependabotSecurityUpdates()(SecurityAndAnalysis_dependabot_security_updatesable) { + return m.dependabot_security_updates +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecurityAndAnalysis) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["advanced_security"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSecurityAndAnalysis_advanced_securityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurity(val.(SecurityAndAnalysis_advanced_securityable)) + } + return nil + } + res["dependabot_security_updates"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSecurityAndAnalysis_dependabot_security_updatesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDependabotSecurityUpdates(val.(SecurityAndAnalysis_dependabot_security_updatesable)) + } + return nil + } + res["secret_scanning"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSecurityAndAnalysis_secret_scanningFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecretScanning(val.(SecurityAndAnalysis_secret_scanningable)) + } + return nil + } + res["secret_scanning_push_protection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSecurityAndAnalysis_secret_scanning_push_protectionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtection(val.(SecurityAndAnalysis_secret_scanning_push_protectionable)) + } + return nil + } + return res +} +// GetSecretScanning gets the secret_scanning property value. The secret_scanning property +// returns a SecurityAndAnalysis_secret_scanningable when successful +func (m *SecurityAndAnalysis) GetSecretScanning()(SecurityAndAnalysis_secret_scanningable) { + return m.secret_scanning +} +// GetSecretScanningPushProtection gets the secret_scanning_push_protection property value. The secret_scanning_push_protection property +// returns a SecurityAndAnalysis_secret_scanning_push_protectionable when successful +func (m *SecurityAndAnalysis) GetSecretScanningPushProtection()(SecurityAndAnalysis_secret_scanning_push_protectionable) { + return m.secret_scanning_push_protection +} +// Serialize serializes information the current object +func (m *SecurityAndAnalysis) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("advanced_security", m.GetAdvancedSecurity()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("dependabot_security_updates", m.GetDependabotSecurityUpdates()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("secret_scanning", m.GetSecretScanning()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("secret_scanning_push_protection", m.GetSecretScanningPushProtection()) + 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 *SecurityAndAnalysis) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvancedSecurity sets the advanced_security property value. The advanced_security property +func (m *SecurityAndAnalysis) SetAdvancedSecurity(value SecurityAndAnalysis_advanced_securityable)() { + m.advanced_security = value +} +// SetDependabotSecurityUpdates sets the dependabot_security_updates property value. Enable or disable Dependabot security updates for the repository. +func (m *SecurityAndAnalysis) SetDependabotSecurityUpdates(value SecurityAndAnalysis_dependabot_security_updatesable)() { + m.dependabot_security_updates = value +} +// SetSecretScanning sets the secret_scanning property value. The secret_scanning property +func (m *SecurityAndAnalysis) SetSecretScanning(value SecurityAndAnalysis_secret_scanningable)() { + m.secret_scanning = value +} +// SetSecretScanningPushProtection sets the secret_scanning_push_protection property value. The secret_scanning_push_protection property +func (m *SecurityAndAnalysis) SetSecretScanningPushProtection(value SecurityAndAnalysis_secret_scanning_push_protectionable)() { + m.secret_scanning_push_protection = value +} +type SecurityAndAnalysisable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdvancedSecurity()(SecurityAndAnalysis_advanced_securityable) + GetDependabotSecurityUpdates()(SecurityAndAnalysis_dependabot_security_updatesable) + GetSecretScanning()(SecurityAndAnalysis_secret_scanningable) + GetSecretScanningPushProtection()(SecurityAndAnalysis_secret_scanning_push_protectionable) + SetAdvancedSecurity(value SecurityAndAnalysis_advanced_securityable)() + SetDependabotSecurityUpdates(value SecurityAndAnalysis_dependabot_security_updatesable)() + SetSecretScanning(value SecurityAndAnalysis_secret_scanningable)() + SetSecretScanningPushProtection(value SecurityAndAnalysis_secret_scanning_push_protectionable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_advanced_security.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_advanced_security.go new file mode 100644 index 000000000..11e63c9f0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_advanced_security.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SecurityAndAnalysis_advanced_security struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The status property + status *SecurityAndAnalysis_advanced_security_status +} +// NewSecurityAndAnalysis_advanced_security instantiates a new SecurityAndAnalysis_advanced_security and sets the default values. +func NewSecurityAndAnalysis_advanced_security()(*SecurityAndAnalysis_advanced_security) { + m := &SecurityAndAnalysis_advanced_security{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecurityAndAnalysis_advanced_securityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecurityAndAnalysis_advanced_securityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecurityAndAnalysis_advanced_security(), 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 *SecurityAndAnalysis_advanced_security) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecurityAndAnalysis_advanced_security) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAndAnalysis_advanced_security_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*SecurityAndAnalysis_advanced_security_status)) + } + return nil + } + return res +} +// GetStatus gets the status property value. The status property +// returns a *SecurityAndAnalysis_advanced_security_status when successful +func (m *SecurityAndAnalysis_advanced_security) GetStatus()(*SecurityAndAnalysis_advanced_security_status) { + return m.status +} +// Serialize serializes information the current object +func (m *SecurityAndAnalysis_advanced_security) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err := writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *SecurityAndAnalysis_advanced_security) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. The status property +func (m *SecurityAndAnalysis_advanced_security) SetStatus(value *SecurityAndAnalysis_advanced_security_status)() { + m.status = value +} +type SecurityAndAnalysis_advanced_securityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*SecurityAndAnalysis_advanced_security_status) + SetStatus(value *SecurityAndAnalysis_advanced_security_status)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_advanced_security_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_advanced_security_status.go new file mode 100644 index 000000000..2063e015f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_advanced_security_status.go @@ -0,0 +1,36 @@ +package models +import ( + "errors" +) +type SecurityAndAnalysis_advanced_security_status int + +const ( + ENABLED_SECURITYANDANALYSIS_ADVANCED_SECURITY_STATUS SecurityAndAnalysis_advanced_security_status = iota + DISABLED_SECURITYANDANALYSIS_ADVANCED_SECURITY_STATUS +) + +func (i SecurityAndAnalysis_advanced_security_status) String() string { + return []string{"enabled", "disabled"}[i] +} +func ParseSecurityAndAnalysis_advanced_security_status(v string) (any, error) { + result := ENABLED_SECURITYANDANALYSIS_ADVANCED_SECURITY_STATUS + switch v { + case "enabled": + result = ENABLED_SECURITYANDANALYSIS_ADVANCED_SECURITY_STATUS + case "disabled": + result = DISABLED_SECURITYANDANALYSIS_ADVANCED_SECURITY_STATUS + default: + return 0, errors.New("Unknown SecurityAndAnalysis_advanced_security_status value: " + v) + } + return &result, nil +} +func SerializeSecurityAndAnalysis_advanced_security_status(values []SecurityAndAnalysis_advanced_security_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecurityAndAnalysis_advanced_security_status) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_dependabot_security_updates.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_dependabot_security_updates.go new file mode 100644 index 000000000..d8c844820 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_dependabot_security_updates.go @@ -0,0 +1,82 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecurityAndAnalysis_dependabot_security_updates enable or disable Dependabot security updates for the repository. +type SecurityAndAnalysis_dependabot_security_updates struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The enablement status of Dependabot security updates for the repository. + status *SecurityAndAnalysis_dependabot_security_updates_status +} +// NewSecurityAndAnalysis_dependabot_security_updates instantiates a new SecurityAndAnalysis_dependabot_security_updates and sets the default values. +func NewSecurityAndAnalysis_dependabot_security_updates()(*SecurityAndAnalysis_dependabot_security_updates) { + m := &SecurityAndAnalysis_dependabot_security_updates{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecurityAndAnalysis_dependabot_security_updatesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecurityAndAnalysis_dependabot_security_updatesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecurityAndAnalysis_dependabot_security_updates(), 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 *SecurityAndAnalysis_dependabot_security_updates) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecurityAndAnalysis_dependabot_security_updates) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAndAnalysis_dependabot_security_updates_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*SecurityAndAnalysis_dependabot_security_updates_status)) + } + return nil + } + return res +} +// GetStatus gets the status property value. The enablement status of Dependabot security updates for the repository. +// returns a *SecurityAndAnalysis_dependabot_security_updates_status when successful +func (m *SecurityAndAnalysis_dependabot_security_updates) GetStatus()(*SecurityAndAnalysis_dependabot_security_updates_status) { + return m.status +} +// Serialize serializes information the current object +func (m *SecurityAndAnalysis_dependabot_security_updates) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err := writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *SecurityAndAnalysis_dependabot_security_updates) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. The enablement status of Dependabot security updates for the repository. +func (m *SecurityAndAnalysis_dependabot_security_updates) SetStatus(value *SecurityAndAnalysis_dependabot_security_updates_status)() { + m.status = value +} +type SecurityAndAnalysis_dependabot_security_updatesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*SecurityAndAnalysis_dependabot_security_updates_status) + SetStatus(value *SecurityAndAnalysis_dependabot_security_updates_status)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_dependabot_security_updates_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_dependabot_security_updates_status.go new file mode 100644 index 000000000..906d4c8b6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_dependabot_security_updates_status.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The enablement status of Dependabot security updates for the repository. +type SecurityAndAnalysis_dependabot_security_updates_status int + +const ( + ENABLED_SECURITYANDANALYSIS_DEPENDABOT_SECURITY_UPDATES_STATUS SecurityAndAnalysis_dependabot_security_updates_status = iota + DISABLED_SECURITYANDANALYSIS_DEPENDABOT_SECURITY_UPDATES_STATUS +) + +func (i SecurityAndAnalysis_dependabot_security_updates_status) String() string { + return []string{"enabled", "disabled"}[i] +} +func ParseSecurityAndAnalysis_dependabot_security_updates_status(v string) (any, error) { + result := ENABLED_SECURITYANDANALYSIS_DEPENDABOT_SECURITY_UPDATES_STATUS + switch v { + case "enabled": + result = ENABLED_SECURITYANDANALYSIS_DEPENDABOT_SECURITY_UPDATES_STATUS + case "disabled": + result = DISABLED_SECURITYANDANALYSIS_DEPENDABOT_SECURITY_UPDATES_STATUS + default: + return 0, errors.New("Unknown SecurityAndAnalysis_dependabot_security_updates_status value: " + v) + } + return &result, nil +} +func SerializeSecurityAndAnalysis_dependabot_security_updates_status(values []SecurityAndAnalysis_dependabot_security_updates_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecurityAndAnalysis_dependabot_security_updates_status) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_secret_scanning.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_secret_scanning.go new file mode 100644 index 000000000..27a4fa5bd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_secret_scanning.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SecurityAndAnalysis_secret_scanning struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The status property + status *SecurityAndAnalysis_secret_scanning_status +} +// NewSecurityAndAnalysis_secret_scanning instantiates a new SecurityAndAnalysis_secret_scanning and sets the default values. +func NewSecurityAndAnalysis_secret_scanning()(*SecurityAndAnalysis_secret_scanning) { + m := &SecurityAndAnalysis_secret_scanning{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecurityAndAnalysis_secret_scanningFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecurityAndAnalysis_secret_scanningFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecurityAndAnalysis_secret_scanning(), 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 *SecurityAndAnalysis_secret_scanning) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecurityAndAnalysis_secret_scanning) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAndAnalysis_secret_scanning_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*SecurityAndAnalysis_secret_scanning_status)) + } + return nil + } + return res +} +// GetStatus gets the status property value. The status property +// returns a *SecurityAndAnalysis_secret_scanning_status when successful +func (m *SecurityAndAnalysis_secret_scanning) GetStatus()(*SecurityAndAnalysis_secret_scanning_status) { + return m.status +} +// Serialize serializes information the current object +func (m *SecurityAndAnalysis_secret_scanning) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err := writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *SecurityAndAnalysis_secret_scanning) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. The status property +func (m *SecurityAndAnalysis_secret_scanning) SetStatus(value *SecurityAndAnalysis_secret_scanning_status)() { + m.status = value +} +type SecurityAndAnalysis_secret_scanningable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*SecurityAndAnalysis_secret_scanning_status) + SetStatus(value *SecurityAndAnalysis_secret_scanning_status)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_secret_scanning_push_protection.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_secret_scanning_push_protection.go new file mode 100644 index 000000000..97a7db07e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_secret_scanning_push_protection.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SecurityAndAnalysis_secret_scanning_push_protection struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The status property + status *SecurityAndAnalysis_secret_scanning_push_protection_status +} +// NewSecurityAndAnalysis_secret_scanning_push_protection instantiates a new SecurityAndAnalysis_secret_scanning_push_protection and sets the default values. +func NewSecurityAndAnalysis_secret_scanning_push_protection()(*SecurityAndAnalysis_secret_scanning_push_protection) { + m := &SecurityAndAnalysis_secret_scanning_push_protection{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecurityAndAnalysis_secret_scanning_push_protectionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecurityAndAnalysis_secret_scanning_push_protectionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecurityAndAnalysis_secret_scanning_push_protection(), 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 *SecurityAndAnalysis_secret_scanning_push_protection) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecurityAndAnalysis_secret_scanning_push_protection) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAndAnalysis_secret_scanning_push_protection_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*SecurityAndAnalysis_secret_scanning_push_protection_status)) + } + return nil + } + return res +} +// GetStatus gets the status property value. The status property +// returns a *SecurityAndAnalysis_secret_scanning_push_protection_status when successful +func (m *SecurityAndAnalysis_secret_scanning_push_protection) GetStatus()(*SecurityAndAnalysis_secret_scanning_push_protection_status) { + return m.status +} +// Serialize serializes information the current object +func (m *SecurityAndAnalysis_secret_scanning_push_protection) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err := writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *SecurityAndAnalysis_secret_scanning_push_protection) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. The status property +func (m *SecurityAndAnalysis_secret_scanning_push_protection) SetStatus(value *SecurityAndAnalysis_secret_scanning_push_protection_status)() { + m.status = value +} +type SecurityAndAnalysis_secret_scanning_push_protectionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*SecurityAndAnalysis_secret_scanning_push_protection_status) + SetStatus(value *SecurityAndAnalysis_secret_scanning_push_protection_status)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_secret_scanning_push_protection_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_secret_scanning_push_protection_status.go new file mode 100644 index 000000000..985ae0b2b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_secret_scanning_push_protection_status.go @@ -0,0 +1,36 @@ +package models +import ( + "errors" +) +type SecurityAndAnalysis_secret_scanning_push_protection_status int + +const ( + ENABLED_SECURITYANDANALYSIS_SECRET_SCANNING_PUSH_PROTECTION_STATUS SecurityAndAnalysis_secret_scanning_push_protection_status = iota + DISABLED_SECURITYANDANALYSIS_SECRET_SCANNING_PUSH_PROTECTION_STATUS +) + +func (i SecurityAndAnalysis_secret_scanning_push_protection_status) String() string { + return []string{"enabled", "disabled"}[i] +} +func ParseSecurityAndAnalysis_secret_scanning_push_protection_status(v string) (any, error) { + result := ENABLED_SECURITYANDANALYSIS_SECRET_SCANNING_PUSH_PROTECTION_STATUS + switch v { + case "enabled": + result = ENABLED_SECURITYANDANALYSIS_SECRET_SCANNING_PUSH_PROTECTION_STATUS + case "disabled": + result = DISABLED_SECURITYANDANALYSIS_SECRET_SCANNING_PUSH_PROTECTION_STATUS + default: + return 0, errors.New("Unknown SecurityAndAnalysis_secret_scanning_push_protection_status value: " + v) + } + return &result, nil +} +func SerializeSecurityAndAnalysis_secret_scanning_push_protection_status(values []SecurityAndAnalysis_secret_scanning_push_protection_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecurityAndAnalysis_secret_scanning_push_protection_status) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_secret_scanning_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_secret_scanning_status.go new file mode 100644 index 000000000..59118e7d8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/security_and_analysis_secret_scanning_status.go @@ -0,0 +1,36 @@ +package models +import ( + "errors" +) +type SecurityAndAnalysis_secret_scanning_status int + +const ( + ENABLED_SECURITYANDANALYSIS_SECRET_SCANNING_STATUS SecurityAndAnalysis_secret_scanning_status = iota + DISABLED_SECURITYANDANALYSIS_SECRET_SCANNING_STATUS +) + +func (i SecurityAndAnalysis_secret_scanning_status) String() string { + return []string{"enabled", "disabled"}[i] +} +func ParseSecurityAndAnalysis_secret_scanning_status(v string) (any, error) { + result := ENABLED_SECURITYANDANALYSIS_SECRET_SCANNING_STATUS + switch v { + case "enabled": + result = ENABLED_SECURITYANDANALYSIS_SECRET_SCANNING_STATUS + case "disabled": + result = DISABLED_SECURITYANDANALYSIS_SECRET_SCANNING_STATUS + default: + return 0, errors.New("Unknown SecurityAndAnalysis_secret_scanning_status value: " + v) + } + return &result, nil +} +func SerializeSecurityAndAnalysis_secret_scanning_status(values []SecurityAndAnalysis_secret_scanning_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecurityAndAnalysis_secret_scanning_status) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/selected_actions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/selected_actions.go new file mode 100644 index 000000000..6fd3fceed --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/selected_actions.go @@ -0,0 +1,144 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SelectedActions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization. + github_owned_allowed *bool + // Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`.**Note**: The `patterns_allowed` setting only applies to public repositories. + patterns_allowed []string + // Whether actions from GitHub Marketplace verified creators are allowed. Set to `true` to allow all actions by GitHub Marketplace verified creators. + verified_allowed *bool +} +// NewSelectedActions instantiates a new SelectedActions and sets the default values. +func NewSelectedActions()(*SelectedActions) { + m := &SelectedActions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSelectedActionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSelectedActionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSelectedActions(), 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 *SelectedActions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SelectedActions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["github_owned_allowed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetGithubOwnedAllowed(val) + } + return nil + } + res["patterns_allowed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetPatternsAllowed(res) + } + return nil + } + res["verified_allowed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerifiedAllowed(val) + } + return nil + } + return res +} +// GetGithubOwnedAllowed gets the github_owned_allowed property value. Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization. +// returns a *bool when successful +func (m *SelectedActions) GetGithubOwnedAllowed()(*bool) { + return m.github_owned_allowed +} +// GetPatternsAllowed gets the patterns_allowed property value. Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`.**Note**: The `patterns_allowed` setting only applies to public repositories. +// returns a []string when successful +func (m *SelectedActions) GetPatternsAllowed()([]string) { + return m.patterns_allowed +} +// GetVerifiedAllowed gets the verified_allowed property value. Whether actions from GitHub Marketplace verified creators are allowed. Set to `true` to allow all actions by GitHub Marketplace verified creators. +// returns a *bool when successful +func (m *SelectedActions) GetVerifiedAllowed()(*bool) { + return m.verified_allowed +} +// Serialize serializes information the current object +func (m *SelectedActions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("github_owned_allowed", m.GetGithubOwnedAllowed()) + if err != nil { + return err + } + } + if m.GetPatternsAllowed() != nil { + err := writer.WriteCollectionOfStringValues("patterns_allowed", m.GetPatternsAllowed()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified_allowed", m.GetVerifiedAllowed()) + 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 *SelectedActions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGithubOwnedAllowed sets the github_owned_allowed property value. Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization. +func (m *SelectedActions) SetGithubOwnedAllowed(value *bool)() { + m.github_owned_allowed = value +} +// SetPatternsAllowed sets the patterns_allowed property value. Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`.**Note**: The `patterns_allowed` setting only applies to public repositories. +func (m *SelectedActions) SetPatternsAllowed(value []string)() { + m.patterns_allowed = value +} +// SetVerifiedAllowed sets the verified_allowed property value. Whether actions from GitHub Marketplace verified creators are allowed. Set to `true` to allow all actions by GitHub Marketplace verified creators. +func (m *SelectedActions) SetVerifiedAllowed(value *bool)() { + m.verified_allowed = value +} +type SelectedActionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGithubOwnedAllowed()(*bool) + GetPatternsAllowed()([]string) + GetVerifiedAllowed()(*bool) + SetGithubOwnedAllowed(value *bool)() + SetPatternsAllowed(value []string)() + SetVerifiedAllowed(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/short_blob.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/short_blob.go new file mode 100644 index 000000000..56966b1c0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/short_blob.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ShortBlob short Blob +type ShortBlob struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The sha property + sha *string + // The url property + url *string +} +// NewShortBlob instantiates a new ShortBlob and sets the default values. +func NewShortBlob()(*ShortBlob) { + m := &ShortBlob{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateShortBlobFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateShortBlobFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewShortBlob(), 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 *ShortBlob) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ShortBlob) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *ShortBlob) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ShortBlob) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ShortBlob) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ShortBlob) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *ShortBlob) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *ShortBlob) SetUrl(value *string)() { + m.url = value +} +type ShortBlobable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/short_branch.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/short_branch.go new file mode 100644 index 000000000..b60d28695 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/short_branch.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ShortBranch short Branch +type ShortBranch struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit property + commit ShortBranch_commitable + // The name property + name *string + // The protected property + protected *bool + // Branch Protection + protection BranchProtectionable + // The protection_url property + protection_url *string +} +// NewShortBranch instantiates a new ShortBranch and sets the default values. +func NewShortBranch()(*ShortBranch) { + m := &ShortBranch{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateShortBranchFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateShortBranchFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewShortBranch(), 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 *ShortBranch) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommit gets the commit property value. The commit property +// returns a ShortBranch_commitable when successful +func (m *ShortBranch) GetCommit()(ShortBranch_commitable) { + return m.commit +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ShortBranch) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateShortBranch_commitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommit(val.(ShortBranch_commitable)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["protected"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetProtected(val) + } + return nil + } + res["protection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtectionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProtection(val.(BranchProtectionable)) + } + return nil + } + res["protection_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProtectionUrl(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *ShortBranch) GetName()(*string) { + return m.name +} +// GetProtected gets the protected property value. The protected property +// returns a *bool when successful +func (m *ShortBranch) GetProtected()(*bool) { + return m.protected +} +// GetProtection gets the protection property value. Branch Protection +// returns a BranchProtectionable when successful +func (m *ShortBranch) GetProtection()(BranchProtectionable) { + return m.protection +} +// GetProtectionUrl gets the protection_url property value. The protection_url property +// returns a *string when successful +func (m *ShortBranch) GetProtectionUrl()(*string) { + return m.protection_url +} +// Serialize serializes information the current object +func (m *ShortBranch) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("commit", m.GetCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("protected", m.GetProtected()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("protection", m.GetProtection()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("protection_url", m.GetProtectionUrl()) + 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 *ShortBranch) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommit sets the commit property value. The commit property +func (m *ShortBranch) SetCommit(value ShortBranch_commitable)() { + m.commit = value +} +// SetName sets the name property value. The name property +func (m *ShortBranch) SetName(value *string)() { + m.name = value +} +// SetProtected sets the protected property value. The protected property +func (m *ShortBranch) SetProtected(value *bool)() { + m.protected = value +} +// SetProtection sets the protection property value. Branch Protection +func (m *ShortBranch) SetProtection(value BranchProtectionable)() { + m.protection = value +} +// SetProtectionUrl sets the protection_url property value. The protection_url property +func (m *ShortBranch) SetProtectionUrl(value *string)() { + m.protection_url = value +} +type ShortBranchable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommit()(ShortBranch_commitable) + GetName()(*string) + GetProtected()(*bool) + GetProtection()(BranchProtectionable) + GetProtectionUrl()(*string) + SetCommit(value ShortBranch_commitable)() + SetName(value *string)() + SetProtected(value *bool)() + SetProtection(value BranchProtectionable)() + SetProtectionUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/short_branch_commit.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/short_branch_commit.go new file mode 100644 index 000000000..292c4adf6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/short_branch_commit.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ShortBranch_commit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The sha property + sha *string + // The url property + url *string +} +// NewShortBranch_commit instantiates a new ShortBranch_commit and sets the default values. +func NewShortBranch_commit()(*ShortBranch_commit) { + m := &ShortBranch_commit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateShortBranch_commitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateShortBranch_commitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewShortBranch_commit(), 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 *ShortBranch_commit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ShortBranch_commit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *ShortBranch_commit) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ShortBranch_commit) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ShortBranch_commit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ShortBranch_commit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *ShortBranch_commit) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *ShortBranch_commit) SetUrl(value *string)() { + m.url = value +} +type ShortBranch_commitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0.go new file mode 100644 index 000000000..45c6d51fa --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SigstoreBundle0 sigstore Bundle v0.1 +type SigstoreBundle0 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The dsseEnvelope property + dsseEnvelope SigstoreBundle0_dsseEnvelopeable + // The mediaType property + mediaType *string + // The verificationMaterial property + verificationMaterial SigstoreBundle0_verificationMaterialable +} +// NewSigstoreBundle0 instantiates a new SigstoreBundle0 and sets the default values. +func NewSigstoreBundle0()(*SigstoreBundle0) { + m := &SigstoreBundle0{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSigstoreBundle0FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSigstoreBundle0FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSigstoreBundle0(), 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 *SigstoreBundle0) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDsseEnvelope gets the dsseEnvelope property value. The dsseEnvelope property +// returns a SigstoreBundle0_dsseEnvelopeable when successful +func (m *SigstoreBundle0) GetDsseEnvelope()(SigstoreBundle0_dsseEnvelopeable) { + return m.dsseEnvelope +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SigstoreBundle0) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["dsseEnvelope"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSigstoreBundle0_dsseEnvelopeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDsseEnvelope(val.(SigstoreBundle0_dsseEnvelopeable)) + } + return nil + } + res["mediaType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMediaType(val) + } + return nil + } + res["verificationMaterial"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSigstoreBundle0_verificationMaterialFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerificationMaterial(val.(SigstoreBundle0_verificationMaterialable)) + } + return nil + } + return res +} +// GetMediaType gets the mediaType property value. The mediaType property +// returns a *string when successful +func (m *SigstoreBundle0) GetMediaType()(*string) { + return m.mediaType +} +// GetVerificationMaterial gets the verificationMaterial property value. The verificationMaterial property +// returns a SigstoreBundle0_verificationMaterialable when successful +func (m *SigstoreBundle0) GetVerificationMaterial()(SigstoreBundle0_verificationMaterialable) { + return m.verificationMaterial +} +// Serialize serializes information the current object +func (m *SigstoreBundle0) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("dsseEnvelope", m.GetDsseEnvelope()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mediaType", m.GetMediaType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("verificationMaterial", m.GetVerificationMaterial()) + 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 *SigstoreBundle0) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDsseEnvelope sets the dsseEnvelope property value. The dsseEnvelope property +func (m *SigstoreBundle0) SetDsseEnvelope(value SigstoreBundle0_dsseEnvelopeable)() { + m.dsseEnvelope = value +} +// SetMediaType sets the mediaType property value. The mediaType property +func (m *SigstoreBundle0) SetMediaType(value *string)() { + m.mediaType = value +} +// SetVerificationMaterial sets the verificationMaterial property value. The verificationMaterial property +func (m *SigstoreBundle0) SetVerificationMaterial(value SigstoreBundle0_verificationMaterialable)() { + m.verificationMaterial = value +} +type SigstoreBundle0able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDsseEnvelope()(SigstoreBundle0_dsseEnvelopeable) + GetMediaType()(*string) + GetVerificationMaterial()(SigstoreBundle0_verificationMaterialable) + SetDsseEnvelope(value SigstoreBundle0_dsseEnvelopeable)() + SetMediaType(value *string)() + SetVerificationMaterial(value SigstoreBundle0_verificationMaterialable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_dsse_envelope.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_dsse_envelope.go new file mode 100644 index 000000000..dbfa43c9f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_dsse_envelope.go @@ -0,0 +1,150 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SigstoreBundle0_dsseEnvelope struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The payload property + payload *string + // The payloadType property + payloadType *string + // The signatures property + signatures []SigstoreBundle0_dsseEnvelope_signaturesable +} +// NewSigstoreBundle0_dsseEnvelope instantiates a new SigstoreBundle0_dsseEnvelope and sets the default values. +func NewSigstoreBundle0_dsseEnvelope()(*SigstoreBundle0_dsseEnvelope) { + m := &SigstoreBundle0_dsseEnvelope{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSigstoreBundle0_dsseEnvelopeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSigstoreBundle0_dsseEnvelopeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSigstoreBundle0_dsseEnvelope(), 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 *SigstoreBundle0_dsseEnvelope) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SigstoreBundle0_dsseEnvelope) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPayload(val) + } + return nil + } + res["payloadType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPayloadType(val) + } + return nil + } + res["signatures"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSigstoreBundle0_dsseEnvelope_signaturesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SigstoreBundle0_dsseEnvelope_signaturesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SigstoreBundle0_dsseEnvelope_signaturesable) + } + } + m.SetSignatures(res) + } + return nil + } + return res +} +// GetPayload gets the payload property value. The payload property +// returns a *string when successful +func (m *SigstoreBundle0_dsseEnvelope) GetPayload()(*string) { + return m.payload +} +// GetPayloadType gets the payloadType property value. The payloadType property +// returns a *string when successful +func (m *SigstoreBundle0_dsseEnvelope) GetPayloadType()(*string) { + return m.payloadType +} +// GetSignatures gets the signatures property value. The signatures property +// returns a []SigstoreBundle0_dsseEnvelope_signaturesable when successful +func (m *SigstoreBundle0_dsseEnvelope) GetSignatures()([]SigstoreBundle0_dsseEnvelope_signaturesable) { + return m.signatures +} +// Serialize serializes information the current object +func (m *SigstoreBundle0_dsseEnvelope) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("payload", m.GetPayload()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("payloadType", m.GetPayloadType()) + if err != nil { + return err + } + } + if m.GetSignatures() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSignatures())) + for i, v := range m.GetSignatures() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("signatures", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *SigstoreBundle0_dsseEnvelope) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPayload sets the payload property value. The payload property +func (m *SigstoreBundle0_dsseEnvelope) SetPayload(value *string)() { + m.payload = value +} +// SetPayloadType sets the payloadType property value. The payloadType property +func (m *SigstoreBundle0_dsseEnvelope) SetPayloadType(value *string)() { + m.payloadType = value +} +// SetSignatures sets the signatures property value. The signatures property +func (m *SigstoreBundle0_dsseEnvelope) SetSignatures(value []SigstoreBundle0_dsseEnvelope_signaturesable)() { + m.signatures = value +} +type SigstoreBundle0_dsseEnvelopeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPayload()(*string) + GetPayloadType()(*string) + GetSignatures()([]SigstoreBundle0_dsseEnvelope_signaturesable) + SetPayload(value *string)() + SetPayloadType(value *string)() + SetSignatures(value []SigstoreBundle0_dsseEnvelope_signaturesable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_dsse_envelope_signatures.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_dsse_envelope_signatures.go new file mode 100644 index 000000000..92c1cf2d0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_dsse_envelope_signatures.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SigstoreBundle0_dsseEnvelope_signatures struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The keyid property + keyid *string + // The sig property + sig *string +} +// NewSigstoreBundle0_dsseEnvelope_signatures instantiates a new SigstoreBundle0_dsseEnvelope_signatures and sets the default values. +func NewSigstoreBundle0_dsseEnvelope_signatures()(*SigstoreBundle0_dsseEnvelope_signatures) { + m := &SigstoreBundle0_dsseEnvelope_signatures{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSigstoreBundle0_dsseEnvelope_signaturesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSigstoreBundle0_dsseEnvelope_signaturesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSigstoreBundle0_dsseEnvelope_signatures(), 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 *SigstoreBundle0_dsseEnvelope_signatures) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SigstoreBundle0_dsseEnvelope_signatures) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["keyid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyid(val) + } + return nil + } + res["sig"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSig(val) + } + return nil + } + return res +} +// GetKeyid gets the keyid property value. The keyid property +// returns a *string when successful +func (m *SigstoreBundle0_dsseEnvelope_signatures) GetKeyid()(*string) { + return m.keyid +} +// GetSig gets the sig property value. The sig property +// returns a *string when successful +func (m *SigstoreBundle0_dsseEnvelope_signatures) GetSig()(*string) { + return m.sig +} +// Serialize serializes information the current object +func (m *SigstoreBundle0_dsseEnvelope_signatures) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("keyid", m.GetKeyid()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sig", m.GetSig()) + 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 *SigstoreBundle0_dsseEnvelope_signatures) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKeyid sets the keyid property value. The keyid property +func (m *SigstoreBundle0_dsseEnvelope_signatures) SetKeyid(value *string)() { + m.keyid = value +} +// SetSig sets the sig property value. The sig property +func (m *SigstoreBundle0_dsseEnvelope_signatures) SetSig(value *string)() { + m.sig = value +} +type SigstoreBundle0_dsseEnvelope_signaturesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKeyid()(*string) + GetSig()(*string) + SetKeyid(value *string)() + SetSig(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material.go new file mode 100644 index 000000000..a80a42657 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material.go @@ -0,0 +1,150 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SigstoreBundle0_verificationMaterial struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The timestampVerificationData property + timestampVerificationData *string + // The tlogEntries property + tlogEntries []SigstoreBundle0_verificationMaterial_tlogEntriesable + // The x509CertificateChain property + x509CertificateChain SigstoreBundle0_verificationMaterial_x509CertificateChainable +} +// NewSigstoreBundle0_verificationMaterial instantiates a new SigstoreBundle0_verificationMaterial and sets the default values. +func NewSigstoreBundle0_verificationMaterial()(*SigstoreBundle0_verificationMaterial) { + m := &SigstoreBundle0_verificationMaterial{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSigstoreBundle0_verificationMaterialFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSigstoreBundle0_verificationMaterialFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSigstoreBundle0_verificationMaterial(), 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 *SigstoreBundle0_verificationMaterial) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SigstoreBundle0_verificationMaterial) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["timestampVerificationData"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTimestampVerificationData(val) + } + return nil + } + res["tlogEntries"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSigstoreBundle0_verificationMaterial_tlogEntriesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SigstoreBundle0_verificationMaterial_tlogEntriesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SigstoreBundle0_verificationMaterial_tlogEntriesable) + } + } + m.SetTlogEntries(res) + } + return nil + } + res["x509CertificateChain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSigstoreBundle0_verificationMaterial_x509CertificateChainFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetX509CertificateChain(val.(SigstoreBundle0_verificationMaterial_x509CertificateChainable)) + } + return nil + } + return res +} +// GetTimestampVerificationData gets the timestampVerificationData property value. The timestampVerificationData property +// returns a *string when successful +func (m *SigstoreBundle0_verificationMaterial) GetTimestampVerificationData()(*string) { + return m.timestampVerificationData +} +// GetTlogEntries gets the tlogEntries property value. The tlogEntries property +// returns a []SigstoreBundle0_verificationMaterial_tlogEntriesable when successful +func (m *SigstoreBundle0_verificationMaterial) GetTlogEntries()([]SigstoreBundle0_verificationMaterial_tlogEntriesable) { + return m.tlogEntries +} +// GetX509CertificateChain gets the x509CertificateChain property value. The x509CertificateChain property +// returns a SigstoreBundle0_verificationMaterial_x509CertificateChainable when successful +func (m *SigstoreBundle0_verificationMaterial) GetX509CertificateChain()(SigstoreBundle0_verificationMaterial_x509CertificateChainable) { + return m.x509CertificateChain +} +// Serialize serializes information the current object +func (m *SigstoreBundle0_verificationMaterial) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("timestampVerificationData", m.GetTimestampVerificationData()) + if err != nil { + return err + } + } + if m.GetTlogEntries() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTlogEntries())) + for i, v := range m.GetTlogEntries() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("tlogEntries", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("x509CertificateChain", m.GetX509CertificateChain()) + 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 *SigstoreBundle0_verificationMaterial) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTimestampVerificationData sets the timestampVerificationData property value. The timestampVerificationData property +func (m *SigstoreBundle0_verificationMaterial) SetTimestampVerificationData(value *string)() { + m.timestampVerificationData = value +} +// SetTlogEntries sets the tlogEntries property value. The tlogEntries property +func (m *SigstoreBundle0_verificationMaterial) SetTlogEntries(value []SigstoreBundle0_verificationMaterial_tlogEntriesable)() { + m.tlogEntries = value +} +// SetX509CertificateChain sets the x509CertificateChain property value. The x509CertificateChain property +func (m *SigstoreBundle0_verificationMaterial) SetX509CertificateChain(value SigstoreBundle0_verificationMaterial_x509CertificateChainable)() { + m.x509CertificateChain = value +} +type SigstoreBundle0_verificationMaterialable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTimestampVerificationData()(*string) + GetTlogEntries()([]SigstoreBundle0_verificationMaterial_tlogEntriesable) + GetX509CertificateChain()(SigstoreBundle0_verificationMaterial_x509CertificateChainable) + SetTimestampVerificationData(value *string)() + SetTlogEntries(value []SigstoreBundle0_verificationMaterial_tlogEntriesable)() + SetX509CertificateChain(value SigstoreBundle0_verificationMaterial_x509CertificateChainable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_tlog_entries.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_tlog_entries.go new file mode 100644 index 000000000..c406172d7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_tlog_entries.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SigstoreBundle0_verificationMaterial_tlogEntries struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The canonicalizedBody property + canonicalizedBody *string + // The inclusionPromise property + inclusionPromise SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromiseable + // The inclusionProof property + inclusionProof *string + // The integratedTime property + integratedTime *string + // The kindVersion property + kindVersion SigstoreBundle0_verificationMaterial_tlogEntries_kindVersionable + // The logId property + logId SigstoreBundle0_verificationMaterial_tlogEntries_logIdable + // The logIndex property + logIndex *string +} +// NewSigstoreBundle0_verificationMaterial_tlogEntries instantiates a new SigstoreBundle0_verificationMaterial_tlogEntries and sets the default values. +func NewSigstoreBundle0_verificationMaterial_tlogEntries()(*SigstoreBundle0_verificationMaterial_tlogEntries) { + m := &SigstoreBundle0_verificationMaterial_tlogEntries{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSigstoreBundle0_verificationMaterial_tlogEntriesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSigstoreBundle0_verificationMaterial_tlogEntriesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSigstoreBundle0_verificationMaterial_tlogEntries(), 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 *SigstoreBundle0_verificationMaterial_tlogEntries) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCanonicalizedBody gets the canonicalizedBody property value. The canonicalizedBody property +// returns a *string when successful +func (m *SigstoreBundle0_verificationMaterial_tlogEntries) GetCanonicalizedBody()(*string) { + return m.canonicalizedBody +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SigstoreBundle0_verificationMaterial_tlogEntries) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["canonicalizedBody"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCanonicalizedBody(val) + } + return nil + } + res["inclusionPromise"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromiseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInclusionPromise(val.(SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromiseable)) + } + return nil + } + res["inclusionProof"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInclusionProof(val) + } + return nil + } + res["integratedTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIntegratedTime(val) + } + return nil + } + res["kindVersion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSigstoreBundle0_verificationMaterial_tlogEntries_kindVersionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetKindVersion(val.(SigstoreBundle0_verificationMaterial_tlogEntries_kindVersionable)) + } + return nil + } + res["logId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSigstoreBundle0_verificationMaterial_tlogEntries_logIdFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLogId(val.(SigstoreBundle0_verificationMaterial_tlogEntries_logIdable)) + } + return nil + } + res["logIndex"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogIndex(val) + } + return nil + } + return res +} +// GetInclusionPromise gets the inclusionPromise property value. The inclusionPromise property +// returns a SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromiseable when successful +func (m *SigstoreBundle0_verificationMaterial_tlogEntries) GetInclusionPromise()(SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromiseable) { + return m.inclusionPromise +} +// GetInclusionProof gets the inclusionProof property value. The inclusionProof property +// returns a *string when successful +func (m *SigstoreBundle0_verificationMaterial_tlogEntries) GetInclusionProof()(*string) { + return m.inclusionProof +} +// GetIntegratedTime gets the integratedTime property value. The integratedTime property +// returns a *string when successful +func (m *SigstoreBundle0_verificationMaterial_tlogEntries) GetIntegratedTime()(*string) { + return m.integratedTime +} +// GetKindVersion gets the kindVersion property value. The kindVersion property +// returns a SigstoreBundle0_verificationMaterial_tlogEntries_kindVersionable when successful +func (m *SigstoreBundle0_verificationMaterial_tlogEntries) GetKindVersion()(SigstoreBundle0_verificationMaterial_tlogEntries_kindVersionable) { + return m.kindVersion +} +// GetLogId gets the logId property value. The logId property +// returns a SigstoreBundle0_verificationMaterial_tlogEntries_logIdable when successful +func (m *SigstoreBundle0_verificationMaterial_tlogEntries) GetLogId()(SigstoreBundle0_verificationMaterial_tlogEntries_logIdable) { + return m.logId +} +// GetLogIndex gets the logIndex property value. The logIndex property +// returns a *string when successful +func (m *SigstoreBundle0_verificationMaterial_tlogEntries) GetLogIndex()(*string) { + return m.logIndex +} +// Serialize serializes information the current object +func (m *SigstoreBundle0_verificationMaterial_tlogEntries) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("canonicalizedBody", m.GetCanonicalizedBody()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("inclusionPromise", m.GetInclusionPromise()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("inclusionProof", m.GetInclusionProof()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("integratedTime", m.GetIntegratedTime()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("kindVersion", m.GetKindVersion()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("logId", m.GetLogId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("logIndex", m.GetLogIndex()) + 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 *SigstoreBundle0_verificationMaterial_tlogEntries) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCanonicalizedBody sets the canonicalizedBody property value. The canonicalizedBody property +func (m *SigstoreBundle0_verificationMaterial_tlogEntries) SetCanonicalizedBody(value *string)() { + m.canonicalizedBody = value +} +// SetInclusionPromise sets the inclusionPromise property value. The inclusionPromise property +func (m *SigstoreBundle0_verificationMaterial_tlogEntries) SetInclusionPromise(value SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromiseable)() { + m.inclusionPromise = value +} +// SetInclusionProof sets the inclusionProof property value. The inclusionProof property +func (m *SigstoreBundle0_verificationMaterial_tlogEntries) SetInclusionProof(value *string)() { + m.inclusionProof = value +} +// SetIntegratedTime sets the integratedTime property value. The integratedTime property +func (m *SigstoreBundle0_verificationMaterial_tlogEntries) SetIntegratedTime(value *string)() { + m.integratedTime = value +} +// SetKindVersion sets the kindVersion property value. The kindVersion property +func (m *SigstoreBundle0_verificationMaterial_tlogEntries) SetKindVersion(value SigstoreBundle0_verificationMaterial_tlogEntries_kindVersionable)() { + m.kindVersion = value +} +// SetLogId sets the logId property value. The logId property +func (m *SigstoreBundle0_verificationMaterial_tlogEntries) SetLogId(value SigstoreBundle0_verificationMaterial_tlogEntries_logIdable)() { + m.logId = value +} +// SetLogIndex sets the logIndex property value. The logIndex property +func (m *SigstoreBundle0_verificationMaterial_tlogEntries) SetLogIndex(value *string)() { + m.logIndex = value +} +type SigstoreBundle0_verificationMaterial_tlogEntriesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCanonicalizedBody()(*string) + GetInclusionPromise()(SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromiseable) + GetInclusionProof()(*string) + GetIntegratedTime()(*string) + GetKindVersion()(SigstoreBundle0_verificationMaterial_tlogEntries_kindVersionable) + GetLogId()(SigstoreBundle0_verificationMaterial_tlogEntries_logIdable) + GetLogIndex()(*string) + SetCanonicalizedBody(value *string)() + SetInclusionPromise(value SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromiseable)() + SetInclusionProof(value *string)() + SetIntegratedTime(value *string)() + SetKindVersion(value SigstoreBundle0_verificationMaterial_tlogEntries_kindVersionable)() + SetLogId(value SigstoreBundle0_verificationMaterial_tlogEntries_logIdable)() + SetLogIndex(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_tlog_entries_inclusion_promise.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_tlog_entries_inclusion_promise.go new file mode 100644 index 000000000..f10a0221c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_tlog_entries_inclusion_promise.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromise struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The signedEntryTimestamp property + signedEntryTimestamp *string +} +// NewSigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromise instantiates a new SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromise and sets the default values. +func NewSigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromise()(*SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromise) { + m := &SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromise{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromiseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromiseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromise(), 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 *SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromise) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromise) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["signedEntryTimestamp"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSignedEntryTimestamp(val) + } + return nil + } + return res +} +// GetSignedEntryTimestamp gets the signedEntryTimestamp property value. The signedEntryTimestamp property +// returns a *string when successful +func (m *SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromise) GetSignedEntryTimestamp()(*string) { + return m.signedEntryTimestamp +} +// Serialize serializes information the current object +func (m *SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromise) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("signedEntryTimestamp", m.GetSignedEntryTimestamp()) + 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 *SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromise) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSignedEntryTimestamp sets the signedEntryTimestamp property value. The signedEntryTimestamp property +func (m *SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromise) SetSignedEntryTimestamp(value *string)() { + m.signedEntryTimestamp = value +} +type SigstoreBundle0_verificationMaterial_tlogEntries_inclusionPromiseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSignedEntryTimestamp()(*string) + SetSignedEntryTimestamp(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_tlog_entries_kind_version.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_tlog_entries_kind_version.go new file mode 100644 index 000000000..9715e6a94 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_tlog_entries_kind_version.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SigstoreBundle0_verificationMaterial_tlogEntries_kindVersion struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The kind property + kind *string + // The version property + version *string +} +// NewSigstoreBundle0_verificationMaterial_tlogEntries_kindVersion instantiates a new SigstoreBundle0_verificationMaterial_tlogEntries_kindVersion and sets the default values. +func NewSigstoreBundle0_verificationMaterial_tlogEntries_kindVersion()(*SigstoreBundle0_verificationMaterial_tlogEntries_kindVersion) { + m := &SigstoreBundle0_verificationMaterial_tlogEntries_kindVersion{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSigstoreBundle0_verificationMaterial_tlogEntries_kindVersionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSigstoreBundle0_verificationMaterial_tlogEntries_kindVersionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSigstoreBundle0_verificationMaterial_tlogEntries_kindVersion(), 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 *SigstoreBundle0_verificationMaterial_tlogEntries_kindVersion) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SigstoreBundle0_verificationMaterial_tlogEntries_kindVersion) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["kind"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKind(val) + } + return nil + } + res["version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + return res +} +// GetKind gets the kind property value. The kind property +// returns a *string when successful +func (m *SigstoreBundle0_verificationMaterial_tlogEntries_kindVersion) GetKind()(*string) { + return m.kind +} +// GetVersion gets the version property value. The version property +// returns a *string when successful +func (m *SigstoreBundle0_verificationMaterial_tlogEntries_kindVersion) GetVersion()(*string) { + return m.version +} +// Serialize serializes information the current object +func (m *SigstoreBundle0_verificationMaterial_tlogEntries_kindVersion) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("kind", m.GetKind()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("version", m.GetVersion()) + 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 *SigstoreBundle0_verificationMaterial_tlogEntries_kindVersion) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKind sets the kind property value. The kind property +func (m *SigstoreBundle0_verificationMaterial_tlogEntries_kindVersion) SetKind(value *string)() { + m.kind = value +} +// SetVersion sets the version property value. The version property +func (m *SigstoreBundle0_verificationMaterial_tlogEntries_kindVersion) SetVersion(value *string)() { + m.version = value +} +type SigstoreBundle0_verificationMaterial_tlogEntries_kindVersionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKind()(*string) + GetVersion()(*string) + SetKind(value *string)() + SetVersion(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_tlog_entries_log_id.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_tlog_entries_log_id.go new file mode 100644 index 000000000..a7884c68d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_tlog_entries_log_id.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SigstoreBundle0_verificationMaterial_tlogEntries_logId struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The keyId property + keyId *string +} +// NewSigstoreBundle0_verificationMaterial_tlogEntries_logId instantiates a new SigstoreBundle0_verificationMaterial_tlogEntries_logId and sets the default values. +func NewSigstoreBundle0_verificationMaterial_tlogEntries_logId()(*SigstoreBundle0_verificationMaterial_tlogEntries_logId) { + m := &SigstoreBundle0_verificationMaterial_tlogEntries_logId{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSigstoreBundle0_verificationMaterial_tlogEntries_logIdFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSigstoreBundle0_verificationMaterial_tlogEntries_logIdFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSigstoreBundle0_verificationMaterial_tlogEntries_logId(), 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 *SigstoreBundle0_verificationMaterial_tlogEntries_logId) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SigstoreBundle0_verificationMaterial_tlogEntries_logId) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["keyId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + return res +} +// GetKeyId gets the keyId property value. The keyId property +// returns a *string when successful +func (m *SigstoreBundle0_verificationMaterial_tlogEntries_logId) GetKeyId()(*string) { + return m.keyId +} +// Serialize serializes information the current object +func (m *SigstoreBundle0_verificationMaterial_tlogEntries_logId) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("keyId", m.GetKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *SigstoreBundle0_verificationMaterial_tlogEntries_logId) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKeyId sets the keyId property value. The keyId property +func (m *SigstoreBundle0_verificationMaterial_tlogEntries_logId) SetKeyId(value *string)() { + m.keyId = value +} +type SigstoreBundle0_verificationMaterial_tlogEntries_logIdable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKeyId()(*string) + SetKeyId(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_x509_certificate_chain.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_x509_certificate_chain.go new file mode 100644 index 000000000..37447097f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_x509_certificate_chain.go @@ -0,0 +1,92 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SigstoreBundle0_verificationMaterial_x509CertificateChain struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The certificates property + certificates []SigstoreBundle0_verificationMaterial_x509CertificateChain_certificatesable +} +// NewSigstoreBundle0_verificationMaterial_x509CertificateChain instantiates a new SigstoreBundle0_verificationMaterial_x509CertificateChain and sets the default values. +func NewSigstoreBundle0_verificationMaterial_x509CertificateChain()(*SigstoreBundle0_verificationMaterial_x509CertificateChain) { + m := &SigstoreBundle0_verificationMaterial_x509CertificateChain{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSigstoreBundle0_verificationMaterial_x509CertificateChainFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSigstoreBundle0_verificationMaterial_x509CertificateChainFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSigstoreBundle0_verificationMaterial_x509CertificateChain(), 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 *SigstoreBundle0_verificationMaterial_x509CertificateChain) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCertificates gets the certificates property value. The certificates property +// returns a []SigstoreBundle0_verificationMaterial_x509CertificateChain_certificatesable when successful +func (m *SigstoreBundle0_verificationMaterial_x509CertificateChain) GetCertificates()([]SigstoreBundle0_verificationMaterial_x509CertificateChain_certificatesable) { + return m.certificates +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SigstoreBundle0_verificationMaterial_x509CertificateChain) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["certificates"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSigstoreBundle0_verificationMaterial_x509CertificateChain_certificatesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SigstoreBundle0_verificationMaterial_x509CertificateChain_certificatesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SigstoreBundle0_verificationMaterial_x509CertificateChain_certificatesable) + } + } + m.SetCertificates(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *SigstoreBundle0_verificationMaterial_x509CertificateChain) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCertificates() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCertificates())) + for i, v := range m.GetCertificates() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("certificates", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *SigstoreBundle0_verificationMaterial_x509CertificateChain) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCertificates sets the certificates property value. The certificates property +func (m *SigstoreBundle0_verificationMaterial_x509CertificateChain) SetCertificates(value []SigstoreBundle0_verificationMaterial_x509CertificateChain_certificatesable)() { + m.certificates = value +} +type SigstoreBundle0_verificationMaterial_x509CertificateChainable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCertificates()([]SigstoreBundle0_verificationMaterial_x509CertificateChain_certificatesable) + SetCertificates(value []SigstoreBundle0_verificationMaterial_x509CertificateChain_certificatesable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_x509_certificate_chain_certificates.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_x509_certificate_chain_certificates.go new file mode 100644 index 000000000..101c4a6cd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/sigstore_bundle0_verification_material_x509_certificate_chain_certificates.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SigstoreBundle0_verificationMaterial_x509CertificateChain_certificates struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The rawBytes property + rawBytes *string +} +// NewSigstoreBundle0_verificationMaterial_x509CertificateChain_certificates instantiates a new SigstoreBundle0_verificationMaterial_x509CertificateChain_certificates and sets the default values. +func NewSigstoreBundle0_verificationMaterial_x509CertificateChain_certificates()(*SigstoreBundle0_verificationMaterial_x509CertificateChain_certificates) { + m := &SigstoreBundle0_verificationMaterial_x509CertificateChain_certificates{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSigstoreBundle0_verificationMaterial_x509CertificateChain_certificatesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSigstoreBundle0_verificationMaterial_x509CertificateChain_certificatesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSigstoreBundle0_verificationMaterial_x509CertificateChain_certificates(), 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 *SigstoreBundle0_verificationMaterial_x509CertificateChain_certificates) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SigstoreBundle0_verificationMaterial_x509CertificateChain_certificates) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["rawBytes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRawBytes(val) + } + return nil + } + return res +} +// GetRawBytes gets the rawBytes property value. The rawBytes property +// returns a *string when successful +func (m *SigstoreBundle0_verificationMaterial_x509CertificateChain_certificates) GetRawBytes()(*string) { + return m.rawBytes +} +// Serialize serializes information the current object +func (m *SigstoreBundle0_verificationMaterial_x509CertificateChain_certificates) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("rawBytes", m.GetRawBytes()) + 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 *SigstoreBundle0_verificationMaterial_x509CertificateChain_certificates) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRawBytes sets the rawBytes property value. The rawBytes property +func (m *SigstoreBundle0_verificationMaterial_x509CertificateChain_certificates) SetRawBytes(value *string)() { + m.rawBytes = value +} +type SigstoreBundle0_verificationMaterial_x509CertificateChain_certificatesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRawBytes()(*string) + SetRawBytes(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom.go new file mode 100644 index 000000000..86a51f6c5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SimpleClassroom a GitHub Classroom classroom +type SimpleClassroom struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Returns whether classroom is archived or not. + archived *bool + // Unique identifier of the classroom. + id *int32 + // The name of the classroom. + name *string + // The url of the classroom on GitHub Classroom. + url *string +} +// NewSimpleClassroom instantiates a new SimpleClassroom and sets the default values. +func NewSimpleClassroom()(*SimpleClassroom) { + m := &SimpleClassroom{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSimpleClassroomFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSimpleClassroomFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSimpleClassroom(), 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 *SimpleClassroom) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArchived gets the archived property value. Returns whether classroom is archived or not. +// returns a *bool when successful +func (m *SimpleClassroom) GetArchived()(*bool) { + return m.archived +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SimpleClassroom) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the classroom. +// returns a *int32 when successful +func (m *SimpleClassroom) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name of the classroom. +// returns a *string when successful +func (m *SimpleClassroom) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url of the classroom on GitHub Classroom. +// returns a *string when successful +func (m *SimpleClassroom) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *SimpleClassroom) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *SimpleClassroom) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArchived sets the archived property value. Returns whether classroom is archived or not. +func (m *SimpleClassroom) SetArchived(value *bool)() { + m.archived = value +} +// SetId sets the id property value. Unique identifier of the classroom. +func (m *SimpleClassroom) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name of the classroom. +func (m *SimpleClassroom) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url of the classroom on GitHub Classroom. +func (m *SimpleClassroom) SetUrl(value *string)() { + m.url = value +} +type SimpleClassroomable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArchived()(*bool) + GetId()(*int32) + GetName()(*string) + GetUrl()(*string) + SetArchived(value *bool)() + SetId(value *int32)() + SetName(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom_assignment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom_assignment.go new file mode 100644 index 000000000..a9415d7a0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom_assignment.go @@ -0,0 +1,576 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SimpleClassroomAssignment a GitHub Classroom assignment +type SimpleClassroomAssignment struct { + // The number of students that have accepted the assignment. + accepted *int32 + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub Classroom classroom + classroom SimpleClassroomable + // The time at which the assignment is due. + deadline *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The selected editor for the assignment. + editor *string + // Whether feedback pull request will be created on assignment acceptance. + feedback_pull_requests_enabled *bool + // Unique identifier of the repository. + id *int32 + // Whether the invitation link is enabled. Visiting an enabled invitation link will accept the assignment. + invitations_enabled *bool + // The link that a student can use to accept the assignment. + invite_link *string + // The programming language used in the assignment. + language *string + // The maximum allowable members per team. + max_members *int32 + // The maximum allowable teams for the assignment. + max_teams *int32 + // The number of students that have passed the assignment. + passing *int32 + // Whether an accepted assignment creates a public repository. + public_repo *bool + // Sluggified name of the assignment. + slug *string + // Whether students are admins on created repository on accepted assignment. + students_are_repo_admins *bool + // The number of students that have submitted the assignment. + submitted *int32 + // Assignment title. + title *string + // Whether it's a Group Assignment or Individual Assignment. + typeEscaped *SimpleClassroomAssignment_type +} +// NewSimpleClassroomAssignment instantiates a new SimpleClassroomAssignment and sets the default values. +func NewSimpleClassroomAssignment()(*SimpleClassroomAssignment) { + m := &SimpleClassroomAssignment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSimpleClassroomAssignmentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSimpleClassroomAssignmentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSimpleClassroomAssignment(), nil +} +// GetAccepted gets the accepted property value. The number of students that have accepted the assignment. +// returns a *int32 when successful +func (m *SimpleClassroomAssignment) GetAccepted()(*int32) { + return m.accepted +} +// 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 *SimpleClassroomAssignment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClassroom gets the classroom property value. A GitHub Classroom classroom +// returns a SimpleClassroomable when successful +func (m *SimpleClassroomAssignment) GetClassroom()(SimpleClassroomable) { + return m.classroom +} +// GetDeadline gets the deadline property value. The time at which the assignment is due. +// returns a *Time when successful +func (m *SimpleClassroomAssignment) GetDeadline()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.deadline +} +// GetEditor gets the editor property value. The selected editor for the assignment. +// returns a *string when successful +func (m *SimpleClassroomAssignment) GetEditor()(*string) { + return m.editor +} +// GetFeedbackPullRequestsEnabled gets the feedback_pull_requests_enabled property value. Whether feedback pull request will be created on assignment acceptance. +// returns a *bool when successful +func (m *SimpleClassroomAssignment) GetFeedbackPullRequestsEnabled()(*bool) { + return m.feedback_pull_requests_enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SimpleClassroomAssignment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["accepted"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAccepted(val) + } + return nil + } + res["classroom"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleClassroomFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetClassroom(val.(SimpleClassroomable)) + } + return nil + } + res["deadline"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDeadline(val) + } + return nil + } + res["editor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEditor(val) + } + return nil + } + res["feedback_pull_requests_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFeedbackPullRequestsEnabled(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["invitations_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetInvitationsEnabled(val) + } + return nil + } + res["invite_link"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInviteLink(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["max_members"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMaxMembers(val) + } + return nil + } + res["max_teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMaxTeams(val) + } + return nil + } + res["passing"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPassing(val) + } + return nil + } + res["public_repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicRepo(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["students_are_repo_admins"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetStudentsAreRepoAdmins(val) + } + return nil + } + res["submitted"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSubmitted(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSimpleClassroomAssignment_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*SimpleClassroomAssignment_type)) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the repository. +// returns a *int32 when successful +func (m *SimpleClassroomAssignment) GetId()(*int32) { + return m.id +} +// GetInvitationsEnabled gets the invitations_enabled property value. Whether the invitation link is enabled. Visiting an enabled invitation link will accept the assignment. +// returns a *bool when successful +func (m *SimpleClassroomAssignment) GetInvitationsEnabled()(*bool) { + return m.invitations_enabled +} +// GetInviteLink gets the invite_link property value. The link that a student can use to accept the assignment. +// returns a *string when successful +func (m *SimpleClassroomAssignment) GetInviteLink()(*string) { + return m.invite_link +} +// GetLanguage gets the language property value. The programming language used in the assignment. +// returns a *string when successful +func (m *SimpleClassroomAssignment) GetLanguage()(*string) { + return m.language +} +// GetMaxMembers gets the max_members property value. The maximum allowable members per team. +// returns a *int32 when successful +func (m *SimpleClassroomAssignment) GetMaxMembers()(*int32) { + return m.max_members +} +// GetMaxTeams gets the max_teams property value. The maximum allowable teams for the assignment. +// returns a *int32 when successful +func (m *SimpleClassroomAssignment) GetMaxTeams()(*int32) { + return m.max_teams +} +// GetPassing gets the passing property value. The number of students that have passed the assignment. +// returns a *int32 when successful +func (m *SimpleClassroomAssignment) GetPassing()(*int32) { + return m.passing +} +// GetPublicRepo gets the public_repo property value. Whether an accepted assignment creates a public repository. +// returns a *bool when successful +func (m *SimpleClassroomAssignment) GetPublicRepo()(*bool) { + return m.public_repo +} +// GetSlug gets the slug property value. Sluggified name of the assignment. +// returns a *string when successful +func (m *SimpleClassroomAssignment) GetSlug()(*string) { + return m.slug +} +// GetStudentsAreRepoAdmins gets the students_are_repo_admins property value. Whether students are admins on created repository on accepted assignment. +// returns a *bool when successful +func (m *SimpleClassroomAssignment) GetStudentsAreRepoAdmins()(*bool) { + return m.students_are_repo_admins +} +// GetSubmitted gets the submitted property value. The number of students that have submitted the assignment. +// returns a *int32 when successful +func (m *SimpleClassroomAssignment) GetSubmitted()(*int32) { + return m.submitted +} +// GetTitle gets the title property value. Assignment title. +// returns a *string when successful +func (m *SimpleClassroomAssignment) GetTitle()(*string) { + return m.title +} +// GetTypeEscaped gets the type property value. Whether it's a Group Assignment or Individual Assignment. +// returns a *SimpleClassroomAssignment_type when successful +func (m *SimpleClassroomAssignment) GetTypeEscaped()(*SimpleClassroomAssignment_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *SimpleClassroomAssignment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("accepted", m.GetAccepted()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("classroom", m.GetClassroom()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("deadline", m.GetDeadline()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("editor", m.GetEditor()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("feedback_pull_requests_enabled", m.GetFeedbackPullRequestsEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("invitations_enabled", m.GetInvitationsEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("invite_link", m.GetInviteLink()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("max_members", m.GetMaxMembers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("max_teams", m.GetMaxTeams()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("passing", m.GetPassing()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("public_repo", m.GetPublicRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("students_are_repo_admins", m.GetStudentsAreRepoAdmins()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("submitted", m.GetSubmitted()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccepted sets the accepted property value. The number of students that have accepted the assignment. +func (m *SimpleClassroomAssignment) SetAccepted(value *int32)() { + m.accepted = value +} +// 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 *SimpleClassroomAssignment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClassroom sets the classroom property value. A GitHub Classroom classroom +func (m *SimpleClassroomAssignment) SetClassroom(value SimpleClassroomable)() { + m.classroom = value +} +// SetDeadline sets the deadline property value. The time at which the assignment is due. +func (m *SimpleClassroomAssignment) SetDeadline(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.deadline = value +} +// SetEditor sets the editor property value. The selected editor for the assignment. +func (m *SimpleClassroomAssignment) SetEditor(value *string)() { + m.editor = value +} +// SetFeedbackPullRequestsEnabled sets the feedback_pull_requests_enabled property value. Whether feedback pull request will be created on assignment acceptance. +func (m *SimpleClassroomAssignment) SetFeedbackPullRequestsEnabled(value *bool)() { + m.feedback_pull_requests_enabled = value +} +// SetId sets the id property value. Unique identifier of the repository. +func (m *SimpleClassroomAssignment) SetId(value *int32)() { + m.id = value +} +// SetInvitationsEnabled sets the invitations_enabled property value. Whether the invitation link is enabled. Visiting an enabled invitation link will accept the assignment. +func (m *SimpleClassroomAssignment) SetInvitationsEnabled(value *bool)() { + m.invitations_enabled = value +} +// SetInviteLink sets the invite_link property value. The link that a student can use to accept the assignment. +func (m *SimpleClassroomAssignment) SetInviteLink(value *string)() { + m.invite_link = value +} +// SetLanguage sets the language property value. The programming language used in the assignment. +func (m *SimpleClassroomAssignment) SetLanguage(value *string)() { + m.language = value +} +// SetMaxMembers sets the max_members property value. The maximum allowable members per team. +func (m *SimpleClassroomAssignment) SetMaxMembers(value *int32)() { + m.max_members = value +} +// SetMaxTeams sets the max_teams property value. The maximum allowable teams for the assignment. +func (m *SimpleClassroomAssignment) SetMaxTeams(value *int32)() { + m.max_teams = value +} +// SetPassing sets the passing property value. The number of students that have passed the assignment. +func (m *SimpleClassroomAssignment) SetPassing(value *int32)() { + m.passing = value +} +// SetPublicRepo sets the public_repo property value. Whether an accepted assignment creates a public repository. +func (m *SimpleClassroomAssignment) SetPublicRepo(value *bool)() { + m.public_repo = value +} +// SetSlug sets the slug property value. Sluggified name of the assignment. +func (m *SimpleClassroomAssignment) SetSlug(value *string)() { + m.slug = value +} +// SetStudentsAreRepoAdmins sets the students_are_repo_admins property value. Whether students are admins on created repository on accepted assignment. +func (m *SimpleClassroomAssignment) SetStudentsAreRepoAdmins(value *bool)() { + m.students_are_repo_admins = value +} +// SetSubmitted sets the submitted property value. The number of students that have submitted the assignment. +func (m *SimpleClassroomAssignment) SetSubmitted(value *int32)() { + m.submitted = value +} +// SetTitle sets the title property value. Assignment title. +func (m *SimpleClassroomAssignment) SetTitle(value *string)() { + m.title = value +} +// SetTypeEscaped sets the type property value. Whether it's a Group Assignment or Individual Assignment. +func (m *SimpleClassroomAssignment) SetTypeEscaped(value *SimpleClassroomAssignment_type)() { + m.typeEscaped = value +} +type SimpleClassroomAssignmentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccepted()(*int32) + GetClassroom()(SimpleClassroomable) + GetDeadline()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEditor()(*string) + GetFeedbackPullRequestsEnabled()(*bool) + GetId()(*int32) + GetInvitationsEnabled()(*bool) + GetInviteLink()(*string) + GetLanguage()(*string) + GetMaxMembers()(*int32) + GetMaxTeams()(*int32) + GetPassing()(*int32) + GetPublicRepo()(*bool) + GetSlug()(*string) + GetStudentsAreRepoAdmins()(*bool) + GetSubmitted()(*int32) + GetTitle()(*string) + GetTypeEscaped()(*SimpleClassroomAssignment_type) + SetAccepted(value *int32)() + SetClassroom(value SimpleClassroomable)() + SetDeadline(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEditor(value *string)() + SetFeedbackPullRequestsEnabled(value *bool)() + SetId(value *int32)() + SetInvitationsEnabled(value *bool)() + SetInviteLink(value *string)() + SetLanguage(value *string)() + SetMaxMembers(value *int32)() + SetMaxTeams(value *int32)() + SetPassing(value *int32)() + SetPublicRepo(value *bool)() + SetSlug(value *string)() + SetStudentsAreRepoAdmins(value *bool)() + SetSubmitted(value *int32)() + SetTitle(value *string)() + SetTypeEscaped(value *SimpleClassroomAssignment_type)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom_assignment_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom_assignment_type.go new file mode 100644 index 000000000..5e9dfb1b3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom_assignment_type.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// Whether it's a Group Assignment or Individual Assignment. +type SimpleClassroomAssignment_type int + +const ( + INDIVIDUAL_SIMPLECLASSROOMASSIGNMENT_TYPE SimpleClassroomAssignment_type = iota + GROUP_SIMPLECLASSROOMASSIGNMENT_TYPE +) + +func (i SimpleClassroomAssignment_type) String() string { + return []string{"individual", "group"}[i] +} +func ParseSimpleClassroomAssignment_type(v string) (any, error) { + result := INDIVIDUAL_SIMPLECLASSROOMASSIGNMENT_TYPE + switch v { + case "individual": + result = INDIVIDUAL_SIMPLECLASSROOMASSIGNMENT_TYPE + case "group": + result = GROUP_SIMPLECLASSROOMASSIGNMENT_TYPE + default: + return 0, errors.New("Unknown SimpleClassroomAssignment_type value: " + v) + } + return &result, nil +} +func SerializeSimpleClassroomAssignment_type(values []SimpleClassroomAssignment_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SimpleClassroomAssignment_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom_organization.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom_organization.go new file mode 100644 index 000000000..31fcfed84 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom_organization.go @@ -0,0 +1,226 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SimpleClassroomOrganization a GitHub organization. +type SimpleClassroomOrganization struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string +} +// NewSimpleClassroomOrganization instantiates a new SimpleClassroomOrganization and sets the default values. +func NewSimpleClassroomOrganization()(*SimpleClassroomOrganization) { + m := &SimpleClassroomOrganization{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSimpleClassroomOrganizationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSimpleClassroomOrganizationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSimpleClassroomOrganization(), 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 *SimpleClassroomOrganization) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *SimpleClassroomOrganization) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SimpleClassroomOrganization) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *SimpleClassroomOrganization) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *SimpleClassroomOrganization) GetId()(*int32) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *SimpleClassroomOrganization) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *SimpleClassroomOrganization) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *SimpleClassroomOrganization) GetNodeId()(*string) { + return m.node_id +} +// Serialize serializes information the current object +func (m *SimpleClassroomOrganization) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + 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 *SimpleClassroomOrganization) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *SimpleClassroomOrganization) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *SimpleClassroomOrganization) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *SimpleClassroomOrganization) SetId(value *int32)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *SimpleClassroomOrganization) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *SimpleClassroomOrganization) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *SimpleClassroomOrganization) SetNodeId(value *string)() { + m.node_id = value +} +type SimpleClassroomOrganizationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + SetAvatarUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom_repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom_repository.go new file mode 100644 index 000000000..d7804a0db --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom_repository.go @@ -0,0 +1,226 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SimpleClassroomRepository a GitHub repository view for Classroom +type SimpleClassroomRepository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The default branch for the repository. + default_branch *string + // The full, globally unique name of the repository. + full_name *string + // The URL to view the repository on GitHub.com. + html_url *string + // A unique identifier of the repository. + id *int32 + // The GraphQL identifier of the repository. + node_id *string + // Whether the repository is private. + private *bool +} +// NewSimpleClassroomRepository instantiates a new SimpleClassroomRepository and sets the default values. +func NewSimpleClassroomRepository()(*SimpleClassroomRepository) { + m := &SimpleClassroomRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSimpleClassroomRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSimpleClassroomRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSimpleClassroomRepository(), 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 *SimpleClassroomRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDefaultBranch gets the default_branch property value. The default branch for the repository. +// returns a *string when successful +func (m *SimpleClassroomRepository) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SimpleClassroomRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + return res +} +// GetFullName gets the full_name property value. The full, globally unique name of the repository. +// returns a *string when successful +func (m *SimpleClassroomRepository) GetFullName()(*string) { + return m.full_name +} +// GetHtmlUrl gets the html_url property value. The URL to view the repository on GitHub.com. +// returns a *string when successful +func (m *SimpleClassroomRepository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. A unique identifier of the repository. +// returns a *int32 when successful +func (m *SimpleClassroomRepository) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The GraphQL identifier of the repository. +// returns a *string when successful +func (m *SimpleClassroomRepository) GetNodeId()(*string) { + return m.node_id +} +// GetPrivate gets the private property value. Whether the repository is private. +// returns a *bool when successful +func (m *SimpleClassroomRepository) GetPrivate()(*bool) { + return m.private +} +// Serialize serializes information the current object +func (m *SimpleClassroomRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + 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 *SimpleClassroomRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDefaultBranch sets the default_branch property value. The default branch for the repository. +func (m *SimpleClassroomRepository) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetFullName sets the full_name property value. The full, globally unique name of the repository. +func (m *SimpleClassroomRepository) SetFullName(value *string)() { + m.full_name = value +} +// SetHtmlUrl sets the html_url property value. The URL to view the repository on GitHub.com. +func (m *SimpleClassroomRepository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. A unique identifier of the repository. +func (m *SimpleClassroomRepository) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The GraphQL identifier of the repository. +func (m *SimpleClassroomRepository) SetNodeId(value *string)() { + m.node_id = value +} +// SetPrivate sets the private property value. Whether the repository is private. +func (m *SimpleClassroomRepository) SetPrivate(value *bool)() { + m.private = value +} +type SimpleClassroomRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDefaultBranch()(*string) + GetFullName()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPrivate()(*bool) + SetDefaultBranch(value *string)() + SetFullName(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPrivate(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom_user.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom_user.go new file mode 100644 index 000000000..ec5a3cb0e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_classroom_user.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SimpleClassroomUser a GitHub user simplified for Classroom. +type SimpleClassroomUser struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The login property + login *string +} +// NewSimpleClassroomUser instantiates a new SimpleClassroomUser and sets the default values. +func NewSimpleClassroomUser()(*SimpleClassroomUser) { + m := &SimpleClassroomUser{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSimpleClassroomUserFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSimpleClassroomUserFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSimpleClassroomUser(), 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 *SimpleClassroomUser) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *SimpleClassroomUser) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SimpleClassroomUser) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *SimpleClassroomUser) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *SimpleClassroomUser) GetId()(*int32) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *SimpleClassroomUser) GetLogin()(*string) { + return m.login +} +// Serialize serializes information the current object +func (m *SimpleClassroomUser) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + 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 *SimpleClassroomUser) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *SimpleClassroomUser) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *SimpleClassroomUser) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *SimpleClassroomUser) SetId(value *int32)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *SimpleClassroomUser) SetLogin(value *string)() { + m.login = value +} +type SimpleClassroomUserable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLogin()(*string) + SetAvatarUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLogin(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_commit.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_commit.go new file mode 100644 index 000000000..319c3cd91 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_commit.go @@ -0,0 +1,227 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SimpleCommit a commit. +type SimpleCommit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Information about the Git author + author SimpleCommit_authorable + // Information about the Git committer + committer SimpleCommit_committerable + // SHA for the commit + id *string + // Message describing the purpose of the commit + message *string + // Timestamp of the commit + timestamp *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // SHA for the commit's tree + tree_id *string +} +// NewSimpleCommit instantiates a new SimpleCommit and sets the default values. +func NewSimpleCommit()(*SimpleCommit) { + m := &SimpleCommit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSimpleCommitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSimpleCommitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSimpleCommit(), 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 *SimpleCommit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. Information about the Git author +// returns a SimpleCommit_authorable when successful +func (m *SimpleCommit) GetAuthor()(SimpleCommit_authorable) { + return m.author +} +// GetCommitter gets the committer property value. Information about the Git committer +// returns a SimpleCommit_committerable when successful +func (m *SimpleCommit) GetCommitter()(SimpleCommit_committerable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SimpleCommit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleCommit_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(SimpleCommit_authorable)) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleCommit_committerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(SimpleCommit_committerable)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["timestamp"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetTimestamp(val) + } + return nil + } + res["tree_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreeId(val) + } + return nil + } + return res +} +// GetId gets the id property value. SHA for the commit +// returns a *string when successful +func (m *SimpleCommit) GetId()(*string) { + return m.id +} +// GetMessage gets the message property value. Message describing the purpose of the commit +// returns a *string when successful +func (m *SimpleCommit) GetMessage()(*string) { + return m.message +} +// GetTimestamp gets the timestamp property value. Timestamp of the commit +// returns a *Time when successful +func (m *SimpleCommit) GetTimestamp()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.timestamp +} +// GetTreeId gets the tree_id property value. SHA for the commit's tree +// returns a *string when successful +func (m *SimpleCommit) GetTreeId()(*string) { + return m.tree_id +} +// Serialize serializes information the current object +func (m *SimpleCommit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("timestamp", m.GetTimestamp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tree_id", m.GetTreeId()) + 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 *SimpleCommit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. Information about the Git author +func (m *SimpleCommit) SetAuthor(value SimpleCommit_authorable)() { + m.author = value +} +// SetCommitter sets the committer property value. Information about the Git committer +func (m *SimpleCommit) SetCommitter(value SimpleCommit_committerable)() { + m.committer = value +} +// SetId sets the id property value. SHA for the commit +func (m *SimpleCommit) SetId(value *string)() { + m.id = value +} +// SetMessage sets the message property value. Message describing the purpose of the commit +func (m *SimpleCommit) SetMessage(value *string)() { + m.message = value +} +// SetTimestamp sets the timestamp property value. Timestamp of the commit +func (m *SimpleCommit) SetTimestamp(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.timestamp = value +} +// SetTreeId sets the tree_id property value. SHA for the commit's tree +func (m *SimpleCommit) SetTreeId(value *string)() { + m.tree_id = value +} +type SimpleCommitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(SimpleCommit_authorable) + GetCommitter()(SimpleCommit_committerable) + GetId()(*string) + GetMessage()(*string) + GetTimestamp()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetTreeId()(*string) + SetAuthor(value SimpleCommit_authorable)() + SetCommitter(value SimpleCommit_committerable)() + SetId(value *string)() + SetMessage(value *string)() + SetTimestamp(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetTreeId(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_commit_author.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_commit_author.go new file mode 100644 index 000000000..5b308cf5b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_commit_author.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SimpleCommit_author information about the Git author +type SimpleCommit_author struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Git email address of the commit's author + email *string + // Name of the commit's author + name *string +} +// NewSimpleCommit_author instantiates a new SimpleCommit_author and sets the default values. +func NewSimpleCommit_author()(*SimpleCommit_author) { + m := &SimpleCommit_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSimpleCommit_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSimpleCommit_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSimpleCommit_author(), 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 *SimpleCommit_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. Git email address of the commit's author +// returns a *string when successful +func (m *SimpleCommit_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SimpleCommit_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. Name of the commit's author +// returns a *string when successful +func (m *SimpleCommit_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *SimpleCommit_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *SimpleCommit_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. Git email address of the commit's author +func (m *SimpleCommit_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. Name of the commit's author +func (m *SimpleCommit_author) SetName(value *string)() { + m.name = value +} +type SimpleCommit_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetName()(*string) + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_commit_committer.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_commit_committer.go new file mode 100644 index 000000000..015008982 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_commit_committer.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SimpleCommit_committer information about the Git committer +type SimpleCommit_committer struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Git email address of the commit's committer + email *string + // Name of the commit's committer + name *string +} +// NewSimpleCommit_committer instantiates a new SimpleCommit_committer and sets the default values. +func NewSimpleCommit_committer()(*SimpleCommit_committer) { + m := &SimpleCommit_committer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSimpleCommit_committerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSimpleCommit_committerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSimpleCommit_committer(), 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 *SimpleCommit_committer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. Git email address of the commit's committer +// returns a *string when successful +func (m *SimpleCommit_committer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SimpleCommit_committer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. Name of the commit's committer +// returns a *string when successful +func (m *SimpleCommit_committer) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *SimpleCommit_committer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *SimpleCommit_committer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. Git email address of the commit's committer +func (m *SimpleCommit_committer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. Name of the commit's committer +func (m *SimpleCommit_committer) SetName(value *string)() { + m.name = value +} +type SimpleCommit_committerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetName()(*string) + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_commit_status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_commit_status.go new file mode 100644 index 000000000..bcd10b4c5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_commit_status.go @@ -0,0 +1,371 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SimpleCommitStatus struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The context property + context *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The description property + description *string + // The id property + id *int32 + // The node_id property + node_id *string + // The required property + required *bool + // The state property + state *string + // The target_url property + target_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewSimpleCommitStatus instantiates a new SimpleCommitStatus and sets the default values. +func NewSimpleCommitStatus()(*SimpleCommitStatus) { + m := &SimpleCommitStatus{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSimpleCommitStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSimpleCommitStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSimpleCommitStatus(), 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 *SimpleCommitStatus) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *SimpleCommitStatus) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetContext gets the context property value. The context property +// returns a *string when successful +func (m *SimpleCommitStatus) GetContext()(*string) { + return m.context +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *SimpleCommitStatus) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *SimpleCommitStatus) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SimpleCommitStatus) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequired(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["target_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *SimpleCommitStatus) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *SimpleCommitStatus) GetNodeId()(*string) { + return m.node_id +} +// GetRequired gets the required property value. The required property +// returns a *bool when successful +func (m *SimpleCommitStatus) GetRequired()(*bool) { + return m.required +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *SimpleCommitStatus) GetState()(*string) { + return m.state +} +// GetTargetUrl gets the target_url property value. The target_url property +// returns a *string when successful +func (m *SimpleCommitStatus) GetTargetUrl()(*string) { + return m.target_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *SimpleCommitStatus) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *SimpleCommitStatus) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *SimpleCommitStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("context", m.GetContext()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("required", m.GetRequired()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_url", m.GetTargetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *SimpleCommitStatus) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *SimpleCommitStatus) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetContext sets the context property value. The context property +func (m *SimpleCommitStatus) SetContext(value *string)() { + m.context = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *SimpleCommitStatus) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *SimpleCommitStatus) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. The id property +func (m *SimpleCommitStatus) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *SimpleCommitStatus) SetNodeId(value *string)() { + m.node_id = value +} +// SetRequired sets the required property value. The required property +func (m *SimpleCommitStatus) SetRequired(value *bool)() { + m.required = value +} +// SetState sets the state property value. The state property +func (m *SimpleCommitStatus) SetState(value *string)() { + m.state = value +} +// SetTargetUrl sets the target_url property value. The target_url property +func (m *SimpleCommitStatus) SetTargetUrl(value *string)() { + m.target_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *SimpleCommitStatus) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *SimpleCommitStatus) SetUrl(value *string)() { + m.url = value +} +type SimpleCommitStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetContext()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetRequired()(*bool) + GetState()(*string) + GetTargetUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetContext(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetRequired(value *bool)() + SetState(value *string)() + SetTargetUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_repository.go new file mode 100644 index 000000000..dae4b6d37 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_repository.go @@ -0,0 +1,1386 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SimpleRepository a GitHub repository. +type SimpleRepository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A template for the API URL to download the repository as an archive. + archive_url *string + // A template for the API URL to list the available assignees for issues in the repository. + assignees_url *string + // A template for the API URL to create or retrieve a raw Git blob in the repository. + blobs_url *string + // A template for the API URL to get information about branches in the repository. + branches_url *string + // A template for the API URL to get information about collaborators of the repository. + collaborators_url *string + // A template for the API URL to get information about comments on the repository. + comments_url *string + // A template for the API URL to get information about commits on the repository. + commits_url *string + // A template for the API URL to compare two commits or refs. + compare_url *string + // A template for the API URL to get the contents of the repository. + contents_url *string + // A template for the API URL to list the contributors to the repository. + contributors_url *string + // The API URL to list the deployments of the repository. + deployments_url *string + // The repository description. + description *string + // The API URL to list the downloads on the repository. + downloads_url *string + // The API URL to list the events of the repository. + events_url *string + // Whether the repository is a fork. + fork *bool + // The API URL to list the forks of the repository. + forks_url *string + // The full, globally unique, name of the repository. + full_name *string + // A template for the API URL to get information about Git commits of the repository. + git_commits_url *string + // A template for the API URL to get information about Git refs of the repository. + git_refs_url *string + // A template for the API URL to get information about Git tags of the repository. + git_tags_url *string + // The API URL to list the hooks on the repository. + hooks_url *string + // The URL to view the repository on GitHub.com. + html_url *string + // A unique identifier of the repository. + id *int64 + // A template for the API URL to get information about issue comments on the repository. + issue_comment_url *string + // A template for the API URL to get information about issue events on the repository. + issue_events_url *string + // A template for the API URL to get information about issues on the repository. + issues_url *string + // A template for the API URL to get information about deploy keys on the repository. + keys_url *string + // A template for the API URL to get information about labels of the repository. + labels_url *string + // The API URL to get information about the languages of the repository. + languages_url *string + // The API URL to merge branches in the repository. + merges_url *string + // A template for the API URL to get information about milestones of the repository. + milestones_url *string + // The name of the repository. + name *string + // The GraphQL identifier of the repository. + node_id *string + // A template for the API URL to get information about notifications on the repository. + notifications_url *string + // A GitHub user. + owner SimpleUserable + // Whether the repository is private. + private *bool + // A template for the API URL to get information about pull requests on the repository. + pulls_url *string + // A template for the API URL to get information about releases on the repository. + releases_url *string + // The API URL to list the stargazers on the repository. + stargazers_url *string + // A template for the API URL to get information about statuses of a commit. + statuses_url *string + // The API URL to list the subscribers on the repository. + subscribers_url *string + // The API URL to subscribe to notifications for this repository. + subscription_url *string + // The API URL to get information about tags on the repository. + tags_url *string + // The API URL to list the teams on the repository. + teams_url *string + // A template for the API URL to create or retrieve a raw Git tree of the repository. + trees_url *string + // The URL to get more information about the repository from the GitHub API. + url *string +} +// NewSimpleRepository instantiates a new SimpleRepository and sets the default values. +func NewSimpleRepository()(*SimpleRepository) { + m := &SimpleRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSimpleRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSimpleRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSimpleRepository(), 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 *SimpleRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArchiveUrl gets the archive_url property value. A template for the API URL to download the repository as an archive. +// returns a *string when successful +func (m *SimpleRepository) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. A template for the API URL to list the available assignees for issues in the repository. +// returns a *string when successful +func (m *SimpleRepository) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. A template for the API URL to create or retrieve a raw Git blob in the repository. +// returns a *string when successful +func (m *SimpleRepository) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. A template for the API URL to get information about branches in the repository. +// returns a *string when successful +func (m *SimpleRepository) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCollaboratorsUrl gets the collaborators_url property value. A template for the API URL to get information about collaborators of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. A template for the API URL to get information about comments on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. A template for the API URL to get information about commits on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. A template for the API URL to compare two commits or refs. +// returns a *string when successful +func (m *SimpleRepository) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. A template for the API URL to get the contents of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. A template for the API URL to list the contributors to the repository. +// returns a *string when successful +func (m *SimpleRepository) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetDeploymentsUrl gets the deployments_url property value. The API URL to list the deployments of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The repository description. +// returns a *string when successful +func (m *SimpleRepository) GetDescription()(*string) { + return m.description +} +// GetDownloadsUrl gets the downloads_url property value. The API URL to list the downloads on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The API URL to list the events of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SimpleRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. Whether the repository is a fork. +// returns a *bool when successful +func (m *SimpleRepository) GetFork()(*bool) { + return m.fork +} +// GetForksUrl gets the forks_url property value. The API URL to list the forks of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full, globally unique, name of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. A template for the API URL to get information about Git commits of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. A template for the API URL to get information about Git refs of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. A template for the API URL to get information about Git tags of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetHooksUrl gets the hooks_url property value. The API URL to list the hooks on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The URL to view the repository on GitHub.com. +// returns a *string when successful +func (m *SimpleRepository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. A unique identifier of the repository. +// returns a *int64 when successful +func (m *SimpleRepository) GetId()(*int64) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. A template for the API URL to get information about issue comments on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. A template for the API URL to get information about issue events on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. A template for the API URL to get information about issues on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetKeysUrl gets the keys_url property value. A template for the API URL to get information about deploy keys on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. A template for the API URL to get information about labels of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguagesUrl gets the languages_url property value. The API URL to get information about the languages of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetMergesUrl gets the merges_url property value. The API URL to merge branches in the repository. +// returns a *string when successful +func (m *SimpleRepository) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. A template for the API URL to get information about milestones of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetName gets the name property value. The name of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The GraphQL identifier of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. A template for the API URL to get information about notifications on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *SimpleRepository) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPrivate gets the private property value. Whether the repository is private. +// returns a *bool when successful +func (m *SimpleRepository) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. A template for the API URL to get information about pull requests on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetReleasesUrl gets the releases_url property value. A template for the API URL to get information about releases on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetStargazersUrl gets the stargazers_url property value. The API URL to list the stargazers on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. A template for the API URL to get information about statuses of a commit. +// returns a *string when successful +func (m *SimpleRepository) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersUrl gets the subscribers_url property value. The API URL to list the subscribers on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The API URL to subscribe to notifications for this repository. +// returns a *string when successful +func (m *SimpleRepository) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetTagsUrl gets the tags_url property value. The API URL to get information about tags on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The API URL to list the teams on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTreesUrl gets the trees_url property value. A template for the API URL to create or retrieve a raw Git tree of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUrl gets the url property value. The URL to get more information about the repository from the GitHub API. +// returns a *string when successful +func (m *SimpleRepository) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *SimpleRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *SimpleRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArchiveUrl sets the archive_url property value. A template for the API URL to download the repository as an archive. +func (m *SimpleRepository) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. A template for the API URL to list the available assignees for issues in the repository. +func (m *SimpleRepository) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. A template for the API URL to create or retrieve a raw Git blob in the repository. +func (m *SimpleRepository) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. A template for the API URL to get information about branches in the repository. +func (m *SimpleRepository) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. A template for the API URL to get information about collaborators of the repository. +func (m *SimpleRepository) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. A template for the API URL to get information about comments on the repository. +func (m *SimpleRepository) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. A template for the API URL to get information about commits on the repository. +func (m *SimpleRepository) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. A template for the API URL to compare two commits or refs. +func (m *SimpleRepository) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. A template for the API URL to get the contents of the repository. +func (m *SimpleRepository) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. A template for the API URL to list the contributors to the repository. +func (m *SimpleRepository) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetDeploymentsUrl sets the deployments_url property value. The API URL to list the deployments of the repository. +func (m *SimpleRepository) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The repository description. +func (m *SimpleRepository) SetDescription(value *string)() { + m.description = value +} +// SetDownloadsUrl sets the downloads_url property value. The API URL to list the downloads on the repository. +func (m *SimpleRepository) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The API URL to list the events of the repository. +func (m *SimpleRepository) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. Whether the repository is a fork. +func (m *SimpleRepository) SetFork(value *bool)() { + m.fork = value +} +// SetForksUrl sets the forks_url property value. The API URL to list the forks of the repository. +func (m *SimpleRepository) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full, globally unique, name of the repository. +func (m *SimpleRepository) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. A template for the API URL to get information about Git commits of the repository. +func (m *SimpleRepository) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. A template for the API URL to get information about Git refs of the repository. +func (m *SimpleRepository) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. A template for the API URL to get information about Git tags of the repository. +func (m *SimpleRepository) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetHooksUrl sets the hooks_url property value. The API URL to list the hooks on the repository. +func (m *SimpleRepository) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The URL to view the repository on GitHub.com. +func (m *SimpleRepository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. A unique identifier of the repository. +func (m *SimpleRepository) SetId(value *int64)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. A template for the API URL to get information about issue comments on the repository. +func (m *SimpleRepository) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. A template for the API URL to get information about issue events on the repository. +func (m *SimpleRepository) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. A template for the API URL to get information about issues on the repository. +func (m *SimpleRepository) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetKeysUrl sets the keys_url property value. A template for the API URL to get information about deploy keys on the repository. +func (m *SimpleRepository) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. A template for the API URL to get information about labels of the repository. +func (m *SimpleRepository) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguagesUrl sets the languages_url property value. The API URL to get information about the languages of the repository. +func (m *SimpleRepository) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetMergesUrl sets the merges_url property value. The API URL to merge branches in the repository. +func (m *SimpleRepository) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. A template for the API URL to get information about milestones of the repository. +func (m *SimpleRepository) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetName sets the name property value. The name of the repository. +func (m *SimpleRepository) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The GraphQL identifier of the repository. +func (m *SimpleRepository) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. A template for the API URL to get information about notifications on the repository. +func (m *SimpleRepository) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *SimpleRepository) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPrivate sets the private property value. Whether the repository is private. +func (m *SimpleRepository) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. A template for the API URL to get information about pull requests on the repository. +func (m *SimpleRepository) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetReleasesUrl sets the releases_url property value. A template for the API URL to get information about releases on the repository. +func (m *SimpleRepository) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetStargazersUrl sets the stargazers_url property value. The API URL to list the stargazers on the repository. +func (m *SimpleRepository) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. A template for the API URL to get information about statuses of a commit. +func (m *SimpleRepository) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersUrl sets the subscribers_url property value. The API URL to list the subscribers on the repository. +func (m *SimpleRepository) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The API URL to subscribe to notifications for this repository. +func (m *SimpleRepository) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetTagsUrl sets the tags_url property value. The API URL to get information about tags on the repository. +func (m *SimpleRepository) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The API URL to list the teams on the repository. +func (m *SimpleRepository) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTreesUrl sets the trees_url property value. A template for the API URL to create or retrieve a raw Git tree of the repository. +func (m *SimpleRepository) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUrl sets the url property value. The URL to get more information about the repository from the GitHub API. +func (m *SimpleRepository) SetUrl(value *string)() { + m.url = value +} +type SimpleRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguagesUrl()(*string) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOwner()(SimpleUserable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetReleasesUrl()(*string) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTreesUrl()(*string) + GetUrl()(*string) + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguagesUrl(value *string)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOwner(value SimpleUserable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetReleasesUrl(value *string)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTreesUrl(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_user.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_user.go new file mode 100644 index 000000000..d90bd0f32 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/simple_user.go @@ -0,0 +1,661 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SimpleUser a GitHub user. +type SimpleUser struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The email property + email *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int64 + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_at property + starred_at *string + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewSimpleUser instantiates a new SimpleUser and sets the default values. +func NewSimpleUser()(*SimpleUser) { + m := &SimpleUser{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSimpleUserFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSimpleUserFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSimpleUser(), 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 *SimpleUser) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *SimpleUser) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *SimpleUser) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *SimpleUser) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SimpleUser) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredAt(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *SimpleUser) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *SimpleUser) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *SimpleUser) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *SimpleUser) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *SimpleUser) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *SimpleUser) GetId()(*int64) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *SimpleUser) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *SimpleUser) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *SimpleUser) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *SimpleUser) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *SimpleUser) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *SimpleUser) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *SimpleUser) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredAt gets the starred_at property value. The starred_at property +// returns a *string when successful +func (m *SimpleUser) GetStarredAt()(*string) { + return m.starred_at +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *SimpleUser) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *SimpleUser) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *SimpleUser) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *SimpleUser) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *SimpleUser) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_at", m.GetStarredAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *SimpleUser) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *SimpleUser) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEmail sets the email property value. The email property +func (m *SimpleUser) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *SimpleUser) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *SimpleUser) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *SimpleUser) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *SimpleUser) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *SimpleUser) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *SimpleUser) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *SimpleUser) SetId(value *int64)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *SimpleUser) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *SimpleUser) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *SimpleUser) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *SimpleUser) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *SimpleUser) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *SimpleUser) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *SimpleUser) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredAt sets the starred_at property value. The starred_at property +func (m *SimpleUser) SetStarredAt(value *string)() { + m.starred_at = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *SimpleUser) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *SimpleUser) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *SimpleUser) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *SimpleUser) SetUrl(value *string)() { + m.url = value +} +type SimpleUserable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredAt()(*string) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredAt(value *string)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/snapshot.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/snapshot.go new file mode 100644 index 000000000..fc696912f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/snapshot.go @@ -0,0 +1,266 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Snapshot create a new snapshot of a repository's dependencies. +type Snapshot struct { + // A description of the detector used. + detector Snapshot_detectorable + // The job property + job Snapshot_jobable + // A collection of package manifests, which are a collection of related dependencies declared in a file or representing a logical group of dependencies. + manifests Snapshot_manifestsable + // User-defined metadata to store domain-specific information limited to 8 keys with scalar values. + metadata Metadataable + // The repository branch that triggered this snapshot. + ref *string + // The time at which the snapshot was scanned. + scanned *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The commit SHA associated with this dependency snapshot. Maximum length: 40 characters. + sha *string + // The version of the repository snapshot submission. + version *int32 +} +// NewSnapshot instantiates a new Snapshot and sets the default values. +func NewSnapshot()(*Snapshot) { + m := &Snapshot{ + } + return m +} +// CreateSnapshotFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSnapshotFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSnapshot(), nil +} +// GetDetector gets the detector property value. A description of the detector used. +// returns a Snapshot_detectorable when successful +func (m *Snapshot) GetDetector()(Snapshot_detectorable) { + return m.detector +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Snapshot) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["detector"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSnapshot_detectorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDetector(val.(Snapshot_detectorable)) + } + return nil + } + res["job"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSnapshot_jobFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetJob(val.(Snapshot_jobable)) + } + return nil + } + res["manifests"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSnapshot_manifestsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetManifests(val.(Snapshot_manifestsable)) + } + return nil + } + res["metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMetadataFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMetadata(val.(Metadataable)) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["scanned"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetScanned(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + return res +} +// GetJob gets the job property value. The job property +// returns a Snapshot_jobable when successful +func (m *Snapshot) GetJob()(Snapshot_jobable) { + return m.job +} +// GetManifests gets the manifests property value. A collection of package manifests, which are a collection of related dependencies declared in a file or representing a logical group of dependencies. +// returns a Snapshot_manifestsable when successful +func (m *Snapshot) GetManifests()(Snapshot_manifestsable) { + return m.manifests +} +// GetMetadata gets the metadata property value. User-defined metadata to store domain-specific information limited to 8 keys with scalar values. +// returns a Metadataable when successful +func (m *Snapshot) GetMetadata()(Metadataable) { + return m.metadata +} +// GetRef gets the ref property value. The repository branch that triggered this snapshot. +// returns a *string when successful +func (m *Snapshot) GetRef()(*string) { + return m.ref +} +// GetScanned gets the scanned property value. The time at which the snapshot was scanned. +// returns a *Time when successful +func (m *Snapshot) GetScanned()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.scanned +} +// GetSha gets the sha property value. The commit SHA associated with this dependency snapshot. Maximum length: 40 characters. +// returns a *string when successful +func (m *Snapshot) GetSha()(*string) { + return m.sha +} +// GetVersion gets the version property value. The version of the repository snapshot submission. +// returns a *int32 when successful +func (m *Snapshot) GetVersion()(*int32) { + return m.version +} +// Serialize serializes information the current object +func (m *Snapshot) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("detector", m.GetDetector()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("job", m.GetJob()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("manifests", m.GetManifests()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("metadata", m.GetMetadata()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("scanned", m.GetScanned()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("version", m.GetVersion()) + if err != nil { + return err + } + } + return nil +} +// SetDetector sets the detector property value. A description of the detector used. +func (m *Snapshot) SetDetector(value Snapshot_detectorable)() { + m.detector = value +} +// SetJob sets the job property value. The job property +func (m *Snapshot) SetJob(value Snapshot_jobable)() { + m.job = value +} +// SetManifests sets the manifests property value. A collection of package manifests, which are a collection of related dependencies declared in a file or representing a logical group of dependencies. +func (m *Snapshot) SetManifests(value Snapshot_manifestsable)() { + m.manifests = value +} +// SetMetadata sets the metadata property value. User-defined metadata to store domain-specific information limited to 8 keys with scalar values. +func (m *Snapshot) SetMetadata(value Metadataable)() { + m.metadata = value +} +// SetRef sets the ref property value. The repository branch that triggered this snapshot. +func (m *Snapshot) SetRef(value *string)() { + m.ref = value +} +// SetScanned sets the scanned property value. The time at which the snapshot was scanned. +func (m *Snapshot) SetScanned(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.scanned = value +} +// SetSha sets the sha property value. The commit SHA associated with this dependency snapshot. Maximum length: 40 characters. +func (m *Snapshot) SetSha(value *string)() { + m.sha = value +} +// SetVersion sets the version property value. The version of the repository snapshot submission. +func (m *Snapshot) SetVersion(value *int32)() { + m.version = value +} +type Snapshotable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDetector()(Snapshot_detectorable) + GetJob()(Snapshot_jobable) + GetManifests()(Snapshot_manifestsable) + GetMetadata()(Metadataable) + GetRef()(*string) + GetScanned()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetSha()(*string) + GetVersion()(*int32) + SetDetector(value Snapshot_detectorable)() + SetJob(value Snapshot_jobable)() + SetManifests(value Snapshot_manifestsable)() + SetMetadata(value Metadataable)() + SetRef(value *string)() + SetScanned(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetSha(value *string)() + SetVersion(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/snapshot_detector.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/snapshot_detector.go new file mode 100644 index 000000000..4c3e499fe --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/snapshot_detector.go @@ -0,0 +1,120 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Snapshot_detector a description of the detector used. +type Snapshot_detector struct { + // The name of the detector used. + name *string + // The url of the detector used. + url *string + // The version of the detector used. + version *string +} +// NewSnapshot_detector instantiates a new Snapshot_detector and sets the default values. +func NewSnapshot_detector()(*Snapshot_detector) { + m := &Snapshot_detector{ + } + return m +} +// CreateSnapshot_detectorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSnapshot_detectorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSnapshot_detector(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Snapshot_detector) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the detector used. +// returns a *string when successful +func (m *Snapshot_detector) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url of the detector used. +// returns a *string when successful +func (m *Snapshot_detector) GetUrl()(*string) { + return m.url +} +// GetVersion gets the version property value. The version of the detector used. +// returns a *string when successful +func (m *Snapshot_detector) GetVersion()(*string) { + return m.version +} +// Serialize serializes information the current object +func (m *Snapshot_detector) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("version", m.GetVersion()) + if err != nil { + return err + } + } + return nil +} +// SetName sets the name property value. The name of the detector used. +func (m *Snapshot_detector) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url of the detector used. +func (m *Snapshot_detector) SetUrl(value *string)() { + m.url = value +} +// SetVersion sets the version property value. The version of the detector used. +func (m *Snapshot_detector) SetVersion(value *string)() { + m.version = value +} +type Snapshot_detectorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetUrl()(*string) + GetVersion()(*string) + SetName(value *string)() + SetUrl(value *string)() + SetVersion(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/snapshot_job.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/snapshot_job.go new file mode 100644 index 000000000..aff72c671 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/snapshot_job.go @@ -0,0 +1,119 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Snapshot_job struct { + // Correlator provides a key that is used to group snapshots submitted over time. Only the "latest" submitted snapshot for a given combination of `job.correlator` and `detector.name` will be considered when calculating a repository's current dependencies. Correlator should be as unique as it takes to distinguish all detection runs for a given "wave" of CI workflow you run. If you're using GitHub Actions, a good default value for this could be the environment variables GITHUB_WORKFLOW and GITHUB_JOB concatenated together. If you're using a build matrix, then you'll also need to add additional key(s) to distinguish between each submission inside a matrix variation. + correlator *string + // The url for the job. + html_url *string + // The external ID of the job. + id *string +} +// NewSnapshot_job instantiates a new Snapshot_job and sets the default values. +func NewSnapshot_job()(*Snapshot_job) { + m := &Snapshot_job{ + } + return m +} +// CreateSnapshot_jobFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSnapshot_jobFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSnapshot_job(), nil +} +// GetCorrelator gets the correlator property value. Correlator provides a key that is used to group snapshots submitted over time. Only the "latest" submitted snapshot for a given combination of `job.correlator` and `detector.name` will be considered when calculating a repository's current dependencies. Correlator should be as unique as it takes to distinguish all detection runs for a given "wave" of CI workflow you run. If you're using GitHub Actions, a good default value for this could be the environment variables GITHUB_WORKFLOW and GITHUB_JOB concatenated together. If you're using a build matrix, then you'll also need to add additional key(s) to distinguish between each submission inside a matrix variation. +// returns a *string when successful +func (m *Snapshot_job) GetCorrelator()(*string) { + return m.correlator +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Snapshot_job) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["correlator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCorrelator(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The url for the job. +// returns a *string when successful +func (m *Snapshot_job) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The external ID of the job. +// returns a *string when successful +func (m *Snapshot_job) GetId()(*string) { + return m.id +} +// Serialize serializes information the current object +func (m *Snapshot_job) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("correlator", m.GetCorrelator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + return nil +} +// SetCorrelator sets the correlator property value. Correlator provides a key that is used to group snapshots submitted over time. Only the "latest" submitted snapshot for a given combination of `job.correlator` and `detector.name` will be considered when calculating a repository's current dependencies. Correlator should be as unique as it takes to distinguish all detection runs for a given "wave" of CI workflow you run. If you're using GitHub Actions, a good default value for this could be the environment variables GITHUB_WORKFLOW and GITHUB_JOB concatenated together. If you're using a build matrix, then you'll also need to add additional key(s) to distinguish between each submission inside a matrix variation. +func (m *Snapshot_job) SetCorrelator(value *string)() { + m.correlator = value +} +// SetHtmlUrl sets the html_url property value. The url for the job. +func (m *Snapshot_job) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The external ID of the job. +func (m *Snapshot_job) SetId(value *string)() { + m.id = value +} +type Snapshot_jobable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCorrelator()(*string) + GetHtmlUrl()(*string) + GetId()(*string) + SetCorrelator(value *string)() + SetHtmlUrl(value *string)() + SetId(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/snapshot_manifests.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/snapshot_manifests.go new file mode 100644 index 000000000..77dcf5196 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/snapshot_manifests.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Snapshot_manifests a collection of package manifests, which are a collection of related dependencies declared in a file or representing a logical group of dependencies. +type Snapshot_manifests struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewSnapshot_manifests instantiates a new Snapshot_manifests and sets the default values. +func NewSnapshot_manifests()(*Snapshot_manifests) { + m := &Snapshot_manifests{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSnapshot_manifestsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSnapshot_manifestsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSnapshot_manifests(), 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 *Snapshot_manifests) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Snapshot_manifests) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *Snapshot_manifests) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *Snapshot_manifests) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type Snapshot_manifestsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/social_account.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/social_account.go new file mode 100644 index 000000000..5998cfe19 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/social_account.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SocialAccount social media account +type SocialAccount struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The provider property + provider *string + // The url property + url *string +} +// NewSocialAccount instantiates a new SocialAccount and sets the default values. +func NewSocialAccount()(*SocialAccount) { + m := &SocialAccount{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSocialAccountFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSocialAccountFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSocialAccount(), 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 *SocialAccount) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SocialAccount) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["provider"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProvider(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetProvider gets the provider property value. The provider property +// returns a *string when successful +func (m *SocialAccount) GetProvider()(*string) { + return m.provider +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *SocialAccount) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *SocialAccount) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("provider", m.GetProvider()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *SocialAccount) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetProvider sets the provider property value. The provider property +func (m *SocialAccount) SetProvider(value *string)() { + m.provider = value +} +// SetUrl sets the url property value. The url property +func (m *SocialAccount) SetUrl(value *string)() { + m.url = value +} +type SocialAccountable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetProvider()(*string) + GetUrl()(*string) + SetProvider(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/ssh_signing_key.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/ssh_signing_key.go new file mode 100644 index 000000000..21a76d384 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/ssh_signing_key.go @@ -0,0 +1,169 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SshSigningKey a public SSH key used to sign Git commits +type SshSigningKey struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The id property + id *int32 + // The key property + key *string + // The title property + title *string +} +// NewSshSigningKey instantiates a new SshSigningKey and sets the default values. +func NewSshSigningKey()(*SshSigningKey) { + m := &SshSigningKey{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSshSigningKeyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSshSigningKeyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSshSigningKey(), 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 *SshSigningKey) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *SshSigningKey) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SshSigningKey) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *SshSigningKey) GetId()(*int32) { + return m.id +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *SshSigningKey) GetKey()(*string) { + return m.key +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *SshSigningKey) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *SshSigningKey) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *SshSigningKey) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *SshSigningKey) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *SshSigningKey) SetId(value *int32)() { + m.id = value +} +// SetKey sets the key property value. The key property +func (m *SshSigningKey) SetKey(value *string)() { + m.key = value +} +// SetTitle sets the title property value. The title property +func (m *SshSigningKey) SetTitle(value *string)() { + m.title = value +} +type SshSigningKeyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int32) + GetKey()(*string) + GetTitle()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int32)() + SetKey(value *string)() + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/state_change_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/state_change_issue_event.go new file mode 100644 index 000000000..da93e4aeb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/state_change_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// StateChangeIssueEvent state Change Issue Event +type StateChangeIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The state_reason property + state_reason *string + // The url property + url *string +} +// NewStateChangeIssueEvent instantiates a new StateChangeIssueEvent and sets the default values. +func NewStateChangeIssueEvent()(*StateChangeIssueEvent) { + m := &StateChangeIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateStateChangeIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateStateChangeIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewStateChangeIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *StateChangeIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *StateChangeIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *StateChangeIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *StateChangeIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *StateChangeIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *StateChangeIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *StateChangeIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["state_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStateReason(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *StateChangeIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *StateChangeIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *StateChangeIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetStateReason gets the state_reason property value. The state_reason property +// returns a *string when successful +func (m *StateChangeIssueEvent) GetStateReason()(*string) { + return m.state_reason +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *StateChangeIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *StateChangeIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state_reason", m.GetStateReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *StateChangeIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *StateChangeIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *StateChangeIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *StateChangeIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *StateChangeIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *StateChangeIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *StateChangeIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *StateChangeIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *StateChangeIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetStateReason sets the state_reason property value. The state_reason property +func (m *StateChangeIssueEvent) SetStateReason(value *string)() { + m.state_reason = value +} +// SetUrl sets the url property value. The url property +func (m *StateChangeIssueEvent) SetUrl(value *string)() { + m.url = value +} +type StateChangeIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetStateReason()(*string) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetStateReason(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/status.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/status.go new file mode 100644 index 000000000..e6d2a2770 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/status.go @@ -0,0 +1,371 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Status the status of a commit. +type Status struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The context property + context *string + // The created_at property + created_at *string + // A GitHub user. + creator NullableSimpleUserable + // The description property + description *string + // The id property + id *int32 + // The node_id property + node_id *string + // The state property + state *string + // The target_url property + target_url *string + // The updated_at property + updated_at *string + // The url property + url *string +} +// NewStatus instantiates a new Status and sets the default values. +func NewStatus()(*Status) { + m := &Status{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewStatus(), 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 *Status) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *Status) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetContext gets the context property value. The context property +// returns a *string when successful +func (m *Status) GetContext()(*string) { + return m.context +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *Status) GetCreatedAt()(*string) { + return m.created_at +} +// GetCreator gets the creator property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Status) GetCreator()(NullableSimpleUserable) { + return m.creator +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *Status) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Status) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["creator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreator(val.(NullableSimpleUserable)) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["target_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Status) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Status) GetNodeId()(*string) { + return m.node_id +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *Status) GetState()(*string) { + return m.state +} +// GetTargetUrl gets the target_url property value. The target_url property +// returns a *string when successful +func (m *Status) GetTargetUrl()(*string) { + return m.target_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *string when successful +func (m *Status) GetUpdatedAt()(*string) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Status) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Status) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("context", m.GetContext()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("creator", m.GetCreator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_url", m.GetTargetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Status) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *Status) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetContext sets the context property value. The context property +func (m *Status) SetContext(value *string)() { + m.context = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Status) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetCreator sets the creator property value. A GitHub user. +func (m *Status) SetCreator(value NullableSimpleUserable)() { + m.creator = value +} +// SetDescription sets the description property value. The description property +func (m *Status) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. The id property +func (m *Status) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Status) SetNodeId(value *string)() { + m.node_id = value +} +// SetState sets the state property value. The state property +func (m *Status) SetState(value *string)() { + m.state = value +} +// SetTargetUrl sets the target_url property value. The target_url property +func (m *Status) SetTargetUrl(value *string)() { + m.target_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Status) SetUpdatedAt(value *string)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Status) SetUrl(value *string)() { + m.url = value +} +type Statusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetContext()(*string) + GetCreatedAt()(*string) + GetCreator()(NullableSimpleUserable) + GetDescription()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetState()(*string) + GetTargetUrl()(*string) + GetUpdatedAt()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetContext(value *string)() + SetCreatedAt(value *string)() + SetCreator(value NullableSimpleUserable)() + SetDescription(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetState(value *string)() + SetTargetUrl(value *string)() + SetUpdatedAt(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/status_check_policy.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/status_check_policy.go new file mode 100644 index 000000000..383fa002a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/status_check_policy.go @@ -0,0 +1,215 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// StatusCheckPolicy status Check Policy +type StatusCheckPolicy struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The checks property + checks []StatusCheckPolicy_checksable + // The contexts property + contexts []string + // The contexts_url property + contexts_url *string + // The strict property + strict *bool + // The url property + url *string +} +// NewStatusCheckPolicy instantiates a new StatusCheckPolicy and sets the default values. +func NewStatusCheckPolicy()(*StatusCheckPolicy) { + m := &StatusCheckPolicy{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateStatusCheckPolicyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateStatusCheckPolicyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewStatusCheckPolicy(), 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 *StatusCheckPolicy) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChecks gets the checks property value. The checks property +// returns a []StatusCheckPolicy_checksable when successful +func (m *StatusCheckPolicy) GetChecks()([]StatusCheckPolicy_checksable) { + return m.checks +} +// GetContexts gets the contexts property value. The contexts property +// returns a []string when successful +func (m *StatusCheckPolicy) GetContexts()([]string) { + return m.contexts +} +// GetContextsUrl gets the contexts_url property value. The contexts_url property +// returns a *string when successful +func (m *StatusCheckPolicy) GetContextsUrl()(*string) { + return m.contexts_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *StatusCheckPolicy) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateStatusCheckPolicy_checksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]StatusCheckPolicy_checksable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(StatusCheckPolicy_checksable) + } + } + m.SetChecks(res) + } + return nil + } + res["contexts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetContexts(res) + } + return nil + } + res["contexts_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContextsUrl(val) + } + return nil + } + res["strict"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetStrict(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetStrict gets the strict property value. The strict property +// returns a *bool when successful +func (m *StatusCheckPolicy) GetStrict()(*bool) { + return m.strict +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *StatusCheckPolicy) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *StatusCheckPolicy) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetChecks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetChecks())) + for i, v := range m.GetChecks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("checks", cast) + if err != nil { + return err + } + } + if m.GetContexts() != nil { + err := writer.WriteCollectionOfStringValues("contexts", m.GetContexts()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contexts_url", m.GetContextsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("strict", m.GetStrict()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *StatusCheckPolicy) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChecks sets the checks property value. The checks property +func (m *StatusCheckPolicy) SetChecks(value []StatusCheckPolicy_checksable)() { + m.checks = value +} +// SetContexts sets the contexts property value. The contexts property +func (m *StatusCheckPolicy) SetContexts(value []string)() { + m.contexts = value +} +// SetContextsUrl sets the contexts_url property value. The contexts_url property +func (m *StatusCheckPolicy) SetContextsUrl(value *string)() { + m.contexts_url = value +} +// SetStrict sets the strict property value. The strict property +func (m *StatusCheckPolicy) SetStrict(value *bool)() { + m.strict = value +} +// SetUrl sets the url property value. The url property +func (m *StatusCheckPolicy) SetUrl(value *string)() { + m.url = value +} +type StatusCheckPolicyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChecks()([]StatusCheckPolicy_checksable) + GetContexts()([]string) + GetContextsUrl()(*string) + GetStrict()(*bool) + GetUrl()(*string) + SetChecks(value []StatusCheckPolicy_checksable)() + SetContexts(value []string)() + SetContextsUrl(value *string)() + SetStrict(value *bool)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/status_check_policy_checks.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/status_check_policy_checks.go new file mode 100644 index 000000000..cde7c5009 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/status_check_policy_checks.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type StatusCheckPolicy_checks struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The app_id property + app_id *int32 + // The context property + context *string +} +// NewStatusCheckPolicy_checks instantiates a new StatusCheckPolicy_checks and sets the default values. +func NewStatusCheckPolicy_checks()(*StatusCheckPolicy_checks) { + m := &StatusCheckPolicy_checks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateStatusCheckPolicy_checksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateStatusCheckPolicy_checksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewStatusCheckPolicy_checks(), 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 *StatusCheckPolicy_checks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAppId gets the app_id property value. The app_id property +// returns a *int32 when successful +func (m *StatusCheckPolicy_checks) GetAppId()(*int32) { + return m.app_id +} +// GetContext gets the context property value. The context property +// returns a *string when successful +func (m *StatusCheckPolicy_checks) GetContext()(*string) { + return m.context +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *StatusCheckPolicy_checks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *StatusCheckPolicy_checks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("app_id", m.GetAppId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("context", m.GetContext()) + 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 *StatusCheckPolicy_checks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAppId sets the app_id property value. The app_id property +func (m *StatusCheckPolicy_checks) SetAppId(value *int32)() { + m.app_id = value +} +// SetContext sets the context property value. The context property +func (m *StatusCheckPolicy_checks) SetContext(value *string)() { + m.context = value +} +type StatusCheckPolicy_checksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppId()(*int32) + GetContext()(*string) + SetAppId(value *int32)() + SetContext(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/tag.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/tag.go new file mode 100644 index 000000000..33a026968 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/tag.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Tag tag +type Tag struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit property + commit Tag_commitable + // The name property + name *string + // The node_id property + node_id *string + // The tarball_url property + tarball_url *string + // The zipball_url property + zipball_url *string +} +// NewTag instantiates a new Tag and sets the default values. +func NewTag()(*Tag) { + m := &Tag{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTagFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTagFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTag(), 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 *Tag) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommit gets the commit property value. The commit property +// returns a Tag_commitable when successful +func (m *Tag) GetCommit()(Tag_commitable) { + return m.commit +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Tag) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTag_commitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommit(val.(Tag_commitable)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["tarball_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTarballUrl(val) + } + return nil + } + res["zipball_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetZipballUrl(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *Tag) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Tag) GetNodeId()(*string) { + return m.node_id +} +// GetTarballUrl gets the tarball_url property value. The tarball_url property +// returns a *string when successful +func (m *Tag) GetTarballUrl()(*string) { + return m.tarball_url +} +// GetZipballUrl gets the zipball_url property value. The zipball_url property +// returns a *string when successful +func (m *Tag) GetZipballUrl()(*string) { + return m.zipball_url +} +// Serialize serializes information the current object +func (m *Tag) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("commit", m.GetCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tarball_url", m.GetTarballUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("zipball_url", m.GetZipballUrl()) + 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 *Tag) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommit sets the commit property value. The commit property +func (m *Tag) SetCommit(value Tag_commitable)() { + m.commit = value +} +// SetName sets the name property value. The name property +func (m *Tag) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Tag) SetNodeId(value *string)() { + m.node_id = value +} +// SetTarballUrl sets the tarball_url property value. The tarball_url property +func (m *Tag) SetTarballUrl(value *string)() { + m.tarball_url = value +} +// SetZipballUrl sets the zipball_url property value. The zipball_url property +func (m *Tag) SetZipballUrl(value *string)() { + m.zipball_url = value +} +type Tagable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommit()(Tag_commitable) + GetName()(*string) + GetNodeId()(*string) + GetTarballUrl()(*string) + GetZipballUrl()(*string) + SetCommit(value Tag_commitable)() + SetName(value *string)() + SetNodeId(value *string)() + SetTarballUrl(value *string)() + SetZipballUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/tag_commit.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/tag_commit.go new file mode 100644 index 000000000..63ff25e1e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/tag_commit.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Tag_commit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The sha property + sha *string + // The url property + url *string +} +// NewTag_commit instantiates a new Tag_commit and sets the default values. +func NewTag_commit()(*Tag_commit) { + m := &Tag_commit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTag_commitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTag_commitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTag_commit(), 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 *Tag_commit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Tag_commit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *Tag_commit) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Tag_commit) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Tag_commit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Tag_commit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *Tag_commit) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *Tag_commit) SetUrl(value *string)() { + m.url = value +} +type Tag_commitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/tag_protection.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/tag_protection.go new file mode 100644 index 000000000..a0d9766fe --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/tag_protection.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TagProtection tag protection +type TagProtection struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *string + // The enabled property + enabled *bool + // The id property + id *int32 + // The pattern property + pattern *string + // The updated_at property + updated_at *string +} +// NewTagProtection instantiates a new TagProtection and sets the default values. +func NewTagProtection()(*TagProtection) { + m := &TagProtection{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTagProtectionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTagProtectionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTagProtection(), 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 *TagProtection) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *TagProtection) GetCreatedAt()(*string) { + return m.created_at +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *TagProtection) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TagProtection) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["pattern"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPattern(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *TagProtection) GetId()(*int32) { + return m.id +} +// GetPattern gets the pattern property value. The pattern property +// returns a *string when successful +func (m *TagProtection) GetPattern()(*string) { + return m.pattern +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *string when successful +func (m *TagProtection) GetUpdatedAt()(*string) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *TagProtection) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pattern", m.GetPattern()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + 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 *TagProtection) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TagProtection) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *TagProtection) SetEnabled(value *bool)() { + m.enabled = value +} +// SetId sets the id property value. The id property +func (m *TagProtection) SetId(value *int32)() { + m.id = value +} +// SetPattern sets the pattern property value. The pattern property +func (m *TagProtection) SetPattern(value *string)() { + m.pattern = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TagProtection) SetUpdatedAt(value *string)() { + m.updated_at = value +} +type TagProtectionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*string) + GetEnabled()(*bool) + GetId()(*int32) + GetPattern()(*string) + GetUpdatedAt()(*string) + SetCreatedAt(value *string)() + SetEnabled(value *bool)() + SetId(value *int32)() + SetPattern(value *string)() + SetUpdatedAt(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team.go new file mode 100644 index 000000000..ecd18c820 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team.go @@ -0,0 +1,458 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Team groups of organization members that gives permissions on specified repositories. +type Team struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The description property + description *string + // The html_url property + html_url *string + // The id property + id *int32 + // The members_url property + members_url *string + // The name property + name *string + // The node_id property + node_id *string + // The notification_setting property + notification_setting *string + // Groups of organization members that gives permissions on specified repositories. + parent NullableTeamSimpleable + // The permission property + permission *string + // The permissions property + permissions Team_permissionsable + // The privacy property + privacy *string + // The repositories_url property + repositories_url *string + // The slug property + slug *string + // The url property + url *string +} +// NewTeam instantiates a new Team and sets the default values. +func NewTeam()(*Team) { + m := &Team{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeam(), 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 *Team) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *Team) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Team) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notification_setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationSetting(val) + } + return nil + } + res["parent"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableTeamSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParent(val.(NullableTeamSimpleable)) + } + return nil + } + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeam_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(Team_permissionsable)) + } + return nil + } + res["privacy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivacy(val) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Team) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Team) GetId()(*int32) { + return m.id +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *Team) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *Team) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Team) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationSetting gets the notification_setting property value. The notification_setting property +// returns a *string when successful +func (m *Team) GetNotificationSetting()(*string) { + return m.notification_setting +} +// GetParent gets the parent property value. Groups of organization members that gives permissions on specified repositories. +// returns a NullableTeamSimpleable when successful +func (m *Team) GetParent()(NullableTeamSimpleable) { + return m.parent +} +// GetPermission gets the permission property value. The permission property +// returns a *string when successful +func (m *Team) GetPermission()(*string) { + return m.permission +} +// GetPermissions gets the permissions property value. The permissions property +// returns a Team_permissionsable when successful +func (m *Team) GetPermissions()(Team_permissionsable) { + return m.permissions +} +// GetPrivacy gets the privacy property value. The privacy property +// returns a *string when successful +func (m *Team) GetPrivacy()(*string) { + return m.privacy +} +// GetRepositoriesUrl gets the repositories_url property value. The repositories_url property +// returns a *string when successful +func (m *Team) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetSlug gets the slug property value. The slug property +// returns a *string when successful +func (m *Team) GetSlug()(*string) { + return m.slug +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Team) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Team) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notification_setting", m.GetNotificationSetting()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("parent", m.GetParent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("permission", m.GetPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("privacy", m.GetPrivacy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Team) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description property +func (m *Team) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Team) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Team) SetId(value *int32)() { + m.id = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *Team) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. The name property +func (m *Team) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Team) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationSetting sets the notification_setting property value. The notification_setting property +func (m *Team) SetNotificationSetting(value *string)() { + m.notification_setting = value +} +// SetParent sets the parent property value. Groups of organization members that gives permissions on specified repositories. +func (m *Team) SetParent(value NullableTeamSimpleable)() { + m.parent = value +} +// SetPermission sets the permission property value. The permission property +func (m *Team) SetPermission(value *string)() { + m.permission = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *Team) SetPermissions(value Team_permissionsable)() { + m.permissions = value +} +// SetPrivacy sets the privacy property value. The privacy property +func (m *Team) SetPrivacy(value *string)() { + m.privacy = value +} +// SetRepositoriesUrl sets the repositories_url property value. The repositories_url property +func (m *Team) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetSlug sets the slug property value. The slug property +func (m *Team) SetSlug(value *string)() { + m.slug = value +} +// SetUrl sets the url property value. The url property +func (m *Team) SetUrl(value *string)() { + m.url = value +} +type Teamable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationSetting()(*string) + GetParent()(NullableTeamSimpleable) + GetPermission()(*string) + GetPermissions()(Team_permissionsable) + GetPrivacy()(*string) + GetRepositoriesUrl()(*string) + GetSlug()(*string) + GetUrl()(*string) + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationSetting(value *string)() + SetParent(value NullableTeamSimpleable)() + SetPermission(value *string)() + SetPermissions(value Team_permissionsable)() + SetPrivacy(value *string)() + SetRepositoriesUrl(value *string)() + SetSlug(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_discussion.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_discussion.go new file mode 100644 index 000000000..1ee997168 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_discussion.go @@ -0,0 +1,575 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamDiscussion a team discussion is a persistent record of a free-form conversation within a team. +type TeamDiscussion struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + author NullableSimpleUserable + // The main text of the discussion. + body *string + // The body_html property + body_html *string + // The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. + body_version *string + // The comments_count property + comments_count *int32 + // The comments_url property + comments_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The html_url property + html_url *string + // The last_edited_at property + last_edited_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The node_id property + node_id *string + // The unique sequence number of a team discussion. + number *int32 + // Whether or not this discussion should be pinned for easy retrieval. + pinned *bool + // Whether or not this discussion should be restricted to team members and organization owners. + private *bool + // The reactions property + reactions ReactionRollupable + // The team_url property + team_url *string + // The title of the discussion. + title *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewTeamDiscussion instantiates a new TeamDiscussion and sets the default values. +func NewTeamDiscussion()(*TeamDiscussion) { + m := &TeamDiscussion{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamDiscussionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamDiscussionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamDiscussion(), 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 *TeamDiscussion) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *TeamDiscussion) GetAuthor()(NullableSimpleUserable) { + return m.author +} +// GetBody gets the body property value. The main text of the discussion. +// returns a *string when successful +func (m *TeamDiscussion) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *TeamDiscussion) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyVersion gets the body_version property value. The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. +// returns a *string when successful +func (m *TeamDiscussion) GetBodyVersion()(*string) { + return m.body_version +} +// GetCommentsCount gets the comments_count property value. The comments_count property +// returns a *int32 when successful +func (m *TeamDiscussion) GetCommentsCount()(*int32) { + return m.comments_count +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *TeamDiscussion) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *TeamDiscussion) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamDiscussion) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(NullableSimpleUserable)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyVersion(val) + } + return nil + } + res["comments_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCommentsCount(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["last_edited_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastEditedAt(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["pinned"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPinned(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["team_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamUrl(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TeamDiscussion) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLastEditedAt gets the last_edited_at property value. The last_edited_at property +// returns a *Time when successful +func (m *TeamDiscussion) GetLastEditedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.last_edited_at +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TeamDiscussion) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. The unique sequence number of a team discussion. +// returns a *int32 when successful +func (m *TeamDiscussion) GetNumber()(*int32) { + return m.number +} +// GetPinned gets the pinned property value. Whether or not this discussion should be pinned for easy retrieval. +// returns a *bool when successful +func (m *TeamDiscussion) GetPinned()(*bool) { + return m.pinned +} +// GetPrivate gets the private property value. Whether or not this discussion should be restricted to team members and organization owners. +// returns a *bool when successful +func (m *TeamDiscussion) GetPrivate()(*bool) { + return m.private +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *TeamDiscussion) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetTeamUrl gets the team_url property value. The team_url property +// returns a *string when successful +func (m *TeamDiscussion) GetTeamUrl()(*string) { + return m.team_url +} +// GetTitle gets the title property value. The title of the discussion. +// returns a *string when successful +func (m *TeamDiscussion) GetTitle()(*string) { + return m.title +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *TeamDiscussion) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TeamDiscussion) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TeamDiscussion) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_version", m.GetBodyVersion()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("comments_count", m.GetCommentsCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("last_edited_at", m.GetLastEditedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pinned", m.GetPinned()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("team_url", m.GetTeamUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TeamDiscussion) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. A GitHub user. +func (m *TeamDiscussion) SetAuthor(value NullableSimpleUserable)() { + m.author = value +} +// SetBody sets the body property value. The main text of the discussion. +func (m *TeamDiscussion) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *TeamDiscussion) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyVersion sets the body_version property value. The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. +func (m *TeamDiscussion) SetBodyVersion(value *string)() { + m.body_version = value +} +// SetCommentsCount sets the comments_count property value. The comments_count property +func (m *TeamDiscussion) SetCommentsCount(value *int32)() { + m.comments_count = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *TeamDiscussion) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TeamDiscussion) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TeamDiscussion) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLastEditedAt sets the last_edited_at property value. The last_edited_at property +func (m *TeamDiscussion) SetLastEditedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.last_edited_at = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TeamDiscussion) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. The unique sequence number of a team discussion. +func (m *TeamDiscussion) SetNumber(value *int32)() { + m.number = value +} +// SetPinned sets the pinned property value. Whether or not this discussion should be pinned for easy retrieval. +func (m *TeamDiscussion) SetPinned(value *bool)() { + m.pinned = value +} +// SetPrivate sets the private property value. Whether or not this discussion should be restricted to team members and organization owners. +func (m *TeamDiscussion) SetPrivate(value *bool)() { + m.private = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *TeamDiscussion) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetTeamUrl sets the team_url property value. The team_url property +func (m *TeamDiscussion) SetTeamUrl(value *string)() { + m.team_url = value +} +// SetTitle sets the title property value. The title of the discussion. +func (m *TeamDiscussion) SetTitle(value *string)() { + m.title = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TeamDiscussion) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *TeamDiscussion) SetUrl(value *string)() { + m.url = value +} +type TeamDiscussionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(NullableSimpleUserable) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyVersion()(*string) + GetCommentsCount()(*int32) + GetCommentsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetLastEditedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetNodeId()(*string) + GetNumber()(*int32) + GetPinned()(*bool) + GetPrivate()(*bool) + GetReactions()(ReactionRollupable) + GetTeamUrl()(*string) + GetTitle()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAuthor(value NullableSimpleUserable)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyVersion(value *string)() + SetCommentsCount(value *int32)() + SetCommentsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetLastEditedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetPinned(value *bool)() + SetPrivate(value *bool)() + SetReactions(value ReactionRollupable)() + SetTeamUrl(value *string)() + SetTitle(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_discussion_comment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_discussion_comment.go new file mode 100644 index 000000000..660d75ed3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_discussion_comment.go @@ -0,0 +1,430 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamDiscussionComment a reply to a discussion within a team. +type TeamDiscussionComment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + author NullableSimpleUserable + // The main text of the comment. + body *string + // The body_html property + body_html *string + // The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. + body_version *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The discussion_url property + discussion_url *string + // The html_url property + html_url *string + // The last_edited_at property + last_edited_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The node_id property + node_id *string + // The unique sequence number of a team discussion comment. + number *int32 + // The reactions property + reactions ReactionRollupable + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewTeamDiscussionComment instantiates a new TeamDiscussionComment and sets the default values. +func NewTeamDiscussionComment()(*TeamDiscussionComment) { + m := &TeamDiscussionComment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamDiscussionCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamDiscussionCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamDiscussionComment(), 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 *TeamDiscussionComment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *TeamDiscussionComment) GetAuthor()(NullableSimpleUserable) { + return m.author +} +// GetBody gets the body property value. The main text of the comment. +// returns a *string when successful +func (m *TeamDiscussionComment) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *TeamDiscussionComment) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyVersion gets the body_version property value. The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. +// returns a *string when successful +func (m *TeamDiscussionComment) GetBodyVersion()(*string) { + return m.body_version +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *TeamDiscussionComment) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDiscussionUrl gets the discussion_url property value. The discussion_url property +// returns a *string when successful +func (m *TeamDiscussionComment) GetDiscussionUrl()(*string) { + return m.discussion_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamDiscussionComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(NullableSimpleUserable)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyVersion(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["discussion_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiscussionUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["last_edited_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastEditedAt(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TeamDiscussionComment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLastEditedAt gets the last_edited_at property value. The last_edited_at property +// returns a *Time when successful +func (m *TeamDiscussionComment) GetLastEditedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.last_edited_at +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TeamDiscussionComment) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. The unique sequence number of a team discussion comment. +// returns a *int32 when successful +func (m *TeamDiscussionComment) GetNumber()(*int32) { + return m.number +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *TeamDiscussionComment) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *TeamDiscussionComment) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TeamDiscussionComment) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TeamDiscussionComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_version", m.GetBodyVersion()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("discussion_url", m.GetDiscussionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("last_edited_at", m.GetLastEditedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TeamDiscussionComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. A GitHub user. +func (m *TeamDiscussionComment) SetAuthor(value NullableSimpleUserable)() { + m.author = value +} +// SetBody sets the body property value. The main text of the comment. +func (m *TeamDiscussionComment) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *TeamDiscussionComment) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyVersion sets the body_version property value. The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. +func (m *TeamDiscussionComment) SetBodyVersion(value *string)() { + m.body_version = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TeamDiscussionComment) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDiscussionUrl sets the discussion_url property value. The discussion_url property +func (m *TeamDiscussionComment) SetDiscussionUrl(value *string)() { + m.discussion_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TeamDiscussionComment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLastEditedAt sets the last_edited_at property value. The last_edited_at property +func (m *TeamDiscussionComment) SetLastEditedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.last_edited_at = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TeamDiscussionComment) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. The unique sequence number of a team discussion comment. +func (m *TeamDiscussionComment) SetNumber(value *int32)() { + m.number = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *TeamDiscussionComment) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TeamDiscussionComment) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *TeamDiscussionComment) SetUrl(value *string)() { + m.url = value +} +type TeamDiscussionCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(NullableSimpleUserable) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyVersion()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDiscussionUrl()(*string) + GetHtmlUrl()(*string) + GetLastEditedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetNodeId()(*string) + GetNumber()(*int32) + GetReactions()(ReactionRollupable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAuthor(value NullableSimpleUserable)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyVersion(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDiscussionUrl(value *string)() + SetHtmlUrl(value *string)() + SetLastEditedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetReactions(value ReactionRollupable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_full.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_full.go new file mode 100644 index 000000000..26cbb656a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_full.go @@ -0,0 +1,606 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamFull groups of organization members that gives permissions on specified repositories. +type TeamFull struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The description property + description *string + // The html_url property + html_url *string + // Unique identifier of the team + id *int32 + // Distinguished Name (DN) that team maps to within LDAP environment + ldap_dn *string + // The members_count property + members_count *int32 + // The members_url property + members_url *string + // Name of the team + name *string + // The node_id property + node_id *string + // The notification setting the team has set + notification_setting *TeamFull_notification_setting + // Team Organization + organization TeamOrganizationable + // Groups of organization members that gives permissions on specified repositories. + parent NullableTeamSimpleable + // Permission that the team will have for its repositories + permission *string + // The level of privacy this team should have + privacy *TeamFull_privacy + // The repos_count property + repos_count *int32 + // The repositories_url property + repositories_url *string + // The slug property + slug *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // URL for the team + url *string +} +// NewTeamFull instantiates a new TeamFull and sets the default values. +func NewTeamFull()(*TeamFull) { + m := &TeamFull{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamFullFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamFullFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamFull(), 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 *TeamFull) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *TeamFull) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *TeamFull) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamFull) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["ldap_dn"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLdapDn(val) + } + return nil + } + res["members_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMembersCount(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notification_setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseTeamFull_notification_setting) + if err != nil { + return err + } + if val != nil { + m.SetNotificationSetting(val.(*TeamFull_notification_setting)) + } + return nil + } + res["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeamOrganizationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrganization(val.(TeamOrganizationable)) + } + return nil + } + res["parent"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableTeamSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParent(val.(NullableTeamSimpleable)) + } + return nil + } + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + res["privacy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseTeamFull_privacy) + if err != nil { + return err + } + if val != nil { + m.SetPrivacy(val.(*TeamFull_privacy)) + } + return nil + } + res["repos_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetReposCount(val) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TeamFull) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the team +// returns a *int32 when successful +func (m *TeamFull) GetId()(*int32) { + return m.id +} +// GetLdapDn gets the ldap_dn property value. Distinguished Name (DN) that team maps to within LDAP environment +// returns a *string when successful +func (m *TeamFull) GetLdapDn()(*string) { + return m.ldap_dn +} +// GetMembersCount gets the members_count property value. The members_count property +// returns a *int32 when successful +func (m *TeamFull) GetMembersCount()(*int32) { + return m.members_count +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *TeamFull) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. Name of the team +// returns a *string when successful +func (m *TeamFull) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TeamFull) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationSetting gets the notification_setting property value. The notification setting the team has set +// returns a *TeamFull_notification_setting when successful +func (m *TeamFull) GetNotificationSetting()(*TeamFull_notification_setting) { + return m.notification_setting +} +// GetOrganization gets the organization property value. Team Organization +// returns a TeamOrganizationable when successful +func (m *TeamFull) GetOrganization()(TeamOrganizationable) { + return m.organization +} +// GetParent gets the parent property value. Groups of organization members that gives permissions on specified repositories. +// returns a NullableTeamSimpleable when successful +func (m *TeamFull) GetParent()(NullableTeamSimpleable) { + return m.parent +} +// GetPermission gets the permission property value. Permission that the team will have for its repositories +// returns a *string when successful +func (m *TeamFull) GetPermission()(*string) { + return m.permission +} +// GetPrivacy gets the privacy property value. The level of privacy this team should have +// returns a *TeamFull_privacy when successful +func (m *TeamFull) GetPrivacy()(*TeamFull_privacy) { + return m.privacy +} +// GetReposCount gets the repos_count property value. The repos_count property +// returns a *int32 when successful +func (m *TeamFull) GetReposCount()(*int32) { + return m.repos_count +} +// GetRepositoriesUrl gets the repositories_url property value. The repositories_url property +// returns a *string when successful +func (m *TeamFull) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetSlug gets the slug property value. The slug property +// returns a *string when successful +func (m *TeamFull) GetSlug()(*string) { + return m.slug +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *TeamFull) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. URL for the team +// returns a *string when successful +func (m *TeamFull) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TeamFull) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ldap_dn", m.GetLdapDn()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("members_count", m.GetMembersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetNotificationSetting() != nil { + cast := (*m.GetNotificationSetting()).String() + err := writer.WriteStringValue("notification_setting", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("organization", m.GetOrganization()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("parent", m.GetParent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("permission", m.GetPermission()) + if err != nil { + return err + } + } + if m.GetPrivacy() != nil { + cast := (*m.GetPrivacy()).String() + err := writer.WriteStringValue("privacy", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repos_count", m.GetReposCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TeamFull) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TeamFull) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *TeamFull) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TeamFull) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the team +func (m *TeamFull) SetId(value *int32)() { + m.id = value +} +// SetLdapDn sets the ldap_dn property value. Distinguished Name (DN) that team maps to within LDAP environment +func (m *TeamFull) SetLdapDn(value *string)() { + m.ldap_dn = value +} +// SetMembersCount sets the members_count property value. The members_count property +func (m *TeamFull) SetMembersCount(value *int32)() { + m.members_count = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *TeamFull) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. Name of the team +func (m *TeamFull) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TeamFull) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationSetting sets the notification_setting property value. The notification setting the team has set +func (m *TeamFull) SetNotificationSetting(value *TeamFull_notification_setting)() { + m.notification_setting = value +} +// SetOrganization sets the organization property value. Team Organization +func (m *TeamFull) SetOrganization(value TeamOrganizationable)() { + m.organization = value +} +// SetParent sets the parent property value. Groups of organization members that gives permissions on specified repositories. +func (m *TeamFull) SetParent(value NullableTeamSimpleable)() { + m.parent = value +} +// SetPermission sets the permission property value. Permission that the team will have for its repositories +func (m *TeamFull) SetPermission(value *string)() { + m.permission = value +} +// SetPrivacy sets the privacy property value. The level of privacy this team should have +func (m *TeamFull) SetPrivacy(value *TeamFull_privacy)() { + m.privacy = value +} +// SetReposCount sets the repos_count property value. The repos_count property +func (m *TeamFull) SetReposCount(value *int32)() { + m.repos_count = value +} +// SetRepositoriesUrl sets the repositories_url property value. The repositories_url property +func (m *TeamFull) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetSlug sets the slug property value. The slug property +func (m *TeamFull) SetSlug(value *string)() { + m.slug = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TeamFull) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. URL for the team +func (m *TeamFull) SetUrl(value *string)() { + m.url = value +} +type TeamFullable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLdapDn()(*string) + GetMembersCount()(*int32) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationSetting()(*TeamFull_notification_setting) + GetOrganization()(TeamOrganizationable) + GetParent()(NullableTeamSimpleable) + GetPermission()(*string) + GetPrivacy()(*TeamFull_privacy) + GetReposCount()(*int32) + GetRepositoriesUrl()(*string) + GetSlug()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLdapDn(value *string)() + SetMembersCount(value *int32)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationSetting(value *TeamFull_notification_setting)() + SetOrganization(value TeamOrganizationable)() + SetParent(value NullableTeamSimpleable)() + SetPermission(value *string)() + SetPrivacy(value *TeamFull_privacy)() + SetReposCount(value *int32)() + SetRepositoriesUrl(value *string)() + SetSlug(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_full_notification_setting.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_full_notification_setting.go new file mode 100644 index 000000000..6bcdc7d81 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_full_notification_setting.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The notification setting the team has set +type TeamFull_notification_setting int + +const ( + NOTIFICATIONS_ENABLED_TEAMFULL_NOTIFICATION_SETTING TeamFull_notification_setting = iota + NOTIFICATIONS_DISABLED_TEAMFULL_NOTIFICATION_SETTING +) + +func (i TeamFull_notification_setting) String() string { + return []string{"notifications_enabled", "notifications_disabled"}[i] +} +func ParseTeamFull_notification_setting(v string) (any, error) { + result := NOTIFICATIONS_ENABLED_TEAMFULL_NOTIFICATION_SETTING + switch v { + case "notifications_enabled": + result = NOTIFICATIONS_ENABLED_TEAMFULL_NOTIFICATION_SETTING + case "notifications_disabled": + result = NOTIFICATIONS_DISABLED_TEAMFULL_NOTIFICATION_SETTING + default: + return 0, errors.New("Unknown TeamFull_notification_setting value: " + v) + } + return &result, nil +} +func SerializeTeamFull_notification_setting(values []TeamFull_notification_setting) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i TeamFull_notification_setting) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_full_privacy.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_full_privacy.go new file mode 100644 index 000000000..1b7d0f4d6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_full_privacy.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The level of privacy this team should have +type TeamFull_privacy int + +const ( + CLOSED_TEAMFULL_PRIVACY TeamFull_privacy = iota + SECRET_TEAMFULL_PRIVACY +) + +func (i TeamFull_privacy) String() string { + return []string{"closed", "secret"}[i] +} +func ParseTeamFull_privacy(v string) (any, error) { + result := CLOSED_TEAMFULL_PRIVACY + switch v { + case "closed": + result = CLOSED_TEAMFULL_PRIVACY + case "secret": + result = SECRET_TEAMFULL_PRIVACY + default: + return 0, errors.New("Unknown TeamFull_privacy value: " + v) + } + return &result, nil +} +func SerializeTeamFull_privacy(values []TeamFull_privacy) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i TeamFull_privacy) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_membership.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_membership.go new file mode 100644 index 000000000..8f5bdf012 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_membership.go @@ -0,0 +1,143 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamMembership team Membership +type TeamMembership struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The role of the user in the team. + role *TeamMembership_role + // The state of the user's membership in the team. + state *TeamMembership_state + // The url property + url *string +} +// NewTeamMembership instantiates a new TeamMembership and sets the default values. +func NewTeamMembership()(*TeamMembership) { + m := &TeamMembership{ + } + m.SetAdditionalData(make(map[string]any)) + roleValue := MEMBER_TEAMMEMBERSHIP_ROLE + m.SetRole(&roleValue) + return m +} +// CreateTeamMembershipFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamMembershipFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamMembership(), 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 *TeamMembership) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamMembership) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["role"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseTeamMembership_role) + if err != nil { + return err + } + if val != nil { + m.SetRole(val.(*TeamMembership_role)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseTeamMembership_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*TeamMembership_state)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetRole gets the role property value. The role of the user in the team. +// returns a *TeamMembership_role when successful +func (m *TeamMembership) GetRole()(*TeamMembership_role) { + return m.role +} +// GetState gets the state property value. The state of the user's membership in the team. +// returns a *TeamMembership_state when successful +func (m *TeamMembership) GetState()(*TeamMembership_state) { + return m.state +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TeamMembership) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TeamMembership) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRole() != nil { + cast := (*m.GetRole()).String() + err := writer.WriteStringValue("role", &cast) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TeamMembership) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRole sets the role property value. The role of the user in the team. +func (m *TeamMembership) SetRole(value *TeamMembership_role)() { + m.role = value +} +// SetState sets the state property value. The state of the user's membership in the team. +func (m *TeamMembership) SetState(value *TeamMembership_state)() { + m.state = value +} +// SetUrl sets the url property value. The url property +func (m *TeamMembership) SetUrl(value *string)() { + m.url = value +} +type TeamMembershipable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRole()(*TeamMembership_role) + GetState()(*TeamMembership_state) + GetUrl()(*string) + SetRole(value *TeamMembership_role)() + SetState(value *TeamMembership_state)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_membership_role.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_membership_role.go new file mode 100644 index 000000000..e280eb0a3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_membership_role.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The role of the user in the team. +type TeamMembership_role int + +const ( + MEMBER_TEAMMEMBERSHIP_ROLE TeamMembership_role = iota + MAINTAINER_TEAMMEMBERSHIP_ROLE +) + +func (i TeamMembership_role) String() string { + return []string{"member", "maintainer"}[i] +} +func ParseTeamMembership_role(v string) (any, error) { + result := MEMBER_TEAMMEMBERSHIP_ROLE + switch v { + case "member": + result = MEMBER_TEAMMEMBERSHIP_ROLE + case "maintainer": + result = MAINTAINER_TEAMMEMBERSHIP_ROLE + default: + return 0, errors.New("Unknown TeamMembership_role value: " + v) + } + return &result, nil +} +func SerializeTeamMembership_role(values []TeamMembership_role) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i TeamMembership_role) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_membership_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_membership_state.go new file mode 100644 index 000000000..17b0580ab --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_membership_state.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// The state of the user's membership in the team. +type TeamMembership_state int + +const ( + ACTIVE_TEAMMEMBERSHIP_STATE TeamMembership_state = iota + PENDING_TEAMMEMBERSHIP_STATE +) + +func (i TeamMembership_state) String() string { + return []string{"active", "pending"}[i] +} +func ParseTeamMembership_state(v string) (any, error) { + result := ACTIVE_TEAMMEMBERSHIP_STATE + switch v { + case "active": + result = ACTIVE_TEAMMEMBERSHIP_STATE + case "pending": + result = PENDING_TEAMMEMBERSHIP_STATE + default: + return 0, errors.New("Unknown TeamMembership_state value: " + v) + } + return &result, nil +} +func SerializeTeamMembership_state(values []TeamMembership_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i TeamMembership_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_organization.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_organization.go new file mode 100644 index 000000000..439df771d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_organization.go @@ -0,0 +1,1474 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamOrganization team Organization +type TeamOrganization struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The archived_at property + archived_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The avatar_url property + avatar_url *string + // The billing_email property + billing_email *string + // The blog property + blog *string + // The collaborators property + collaborators *int32 + // The company property + company *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default_repository_permission property + default_repository_permission *string + // The description property + description *string + // The disk_usage property + disk_usage *int32 + // The email property + email *string + // The events_url property + events_url *string + // The followers property + followers *int32 + // The following property + following *int32 + // The has_organization_projects property + has_organization_projects *bool + // The has_repository_projects property + has_repository_projects *bool + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The is_verified property + is_verified *bool + // The issues_url property + issues_url *string + // The location property + location *string + // The login property + login *string + // The members_allowed_repository_creation_type property + members_allowed_repository_creation_type *string + // The members_can_create_internal_repositories property + members_can_create_internal_repositories *bool + // The members_can_create_pages property + members_can_create_pages *bool + // The members_can_create_private_pages property + members_can_create_private_pages *bool + // The members_can_create_private_repositories property + members_can_create_private_repositories *bool + // The members_can_create_public_pages property + members_can_create_public_pages *bool + // The members_can_create_public_repositories property + members_can_create_public_repositories *bool + // The members_can_create_repositories property + members_can_create_repositories *bool + // The members_can_fork_private_repositories property + members_can_fork_private_repositories *bool + // The members_url property + members_url *string + // The name property + name *string + // The node_id property + node_id *string + // The owned_private_repos property + owned_private_repos *int32 + // The plan property + plan TeamOrganization_planable + // The private_gists property + private_gists *int32 + // The public_gists property + public_gists *int32 + // The public_members_url property + public_members_url *string + // The public_repos property + public_repos *int32 + // The repos_url property + repos_url *string + // The total_private_repos property + total_private_repos *int32 + // The twitter_username property + twitter_username *string + // The two_factor_requirement_enabled property + two_factor_requirement_enabled *bool + // The type property + typeEscaped *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The web_commit_signoff_required property + web_commit_signoff_required *bool +} +// NewTeamOrganization instantiates a new TeamOrganization and sets the default values. +func NewTeamOrganization()(*TeamOrganization) { + m := &TeamOrganization{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamOrganizationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamOrganizationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamOrganization(), 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 *TeamOrganization) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArchivedAt gets the archived_at property value. The archived_at property +// returns a *Time when successful +func (m *TeamOrganization) GetArchivedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.archived_at +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *TeamOrganization) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetBillingEmail gets the billing_email property value. The billing_email property +// returns a *string when successful +func (m *TeamOrganization) GetBillingEmail()(*string) { + return m.billing_email +} +// GetBlog gets the blog property value. The blog property +// returns a *string when successful +func (m *TeamOrganization) GetBlog()(*string) { + return m.blog +} +// GetCollaborators gets the collaborators property value. The collaborators property +// returns a *int32 when successful +func (m *TeamOrganization) GetCollaborators()(*int32) { + return m.collaborators +} +// GetCompany gets the company property value. The company property +// returns a *string when successful +func (m *TeamOrganization) GetCompany()(*string) { + return m.company +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *TeamOrganization) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultRepositoryPermission gets the default_repository_permission property value. The default_repository_permission property +// returns a *string when successful +func (m *TeamOrganization) GetDefaultRepositoryPermission()(*string) { + return m.default_repository_permission +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *TeamOrganization) GetDescription()(*string) { + return m.description +} +// GetDiskUsage gets the disk_usage property value. The disk_usage property +// returns a *int32 when successful +func (m *TeamOrganization) GetDiskUsage()(*int32) { + return m.disk_usage +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *TeamOrganization) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *TeamOrganization) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamOrganization) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["archived_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetArchivedAt(val) + } + return nil + } + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["billing_email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBillingEmail(val) + } + return nil + } + res["blog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlog(val) + } + return nil + } + res["collaborators"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCollaborators(val) + } + return nil + } + res["company"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompany(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["default_repository_permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultRepositoryPermission(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["disk_usage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDiskUsage(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowers(val) + } + return nil + } + res["following"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowing(val) + } + return nil + } + res["has_organization_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasOrganizationProjects(val) + } + return nil + } + res["has_repository_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasRepositoryProjects(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsVerified(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["members_allowed_repository_creation_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersAllowedRepositoryCreationType(val) + } + return nil + } + res["members_can_create_internal_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreateInternalRepositories(val) + } + return nil + } + res["members_can_create_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePages(val) + } + return nil + } + res["members_can_create_private_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePrivatePages(val) + } + return nil + } + res["members_can_create_private_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePrivateRepositories(val) + } + return nil + } + res["members_can_create_public_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePublicPages(val) + } + return nil + } + res["members_can_create_public_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePublicRepositories(val) + } + return nil + } + res["members_can_create_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreateRepositories(val) + } + return nil + } + res["members_can_fork_private_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanForkPrivateRepositories(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["owned_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOwnedPrivateRepos(val) + } + return nil + } + res["plan"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeamOrganization_planFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPlan(val.(TeamOrganization_planable)) + } + return nil + } + res["private_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateGists(val) + } + return nil + } + res["public_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicGists(val) + } + return nil + } + res["public_members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicMembersUrl(val) + } + return nil + } + res["public_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicRepos(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["total_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalPrivateRepos(val) + } + return nil + } + res["twitter_username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTwitterUsername(val) + } + return nil + } + res["two_factor_requirement_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTwoFactorRequirementEnabled(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFollowers gets the followers property value. The followers property +// returns a *int32 when successful +func (m *TeamOrganization) GetFollowers()(*int32) { + return m.followers +} +// GetFollowing gets the following property value. The following property +// returns a *int32 when successful +func (m *TeamOrganization) GetFollowing()(*int32) { + return m.following +} +// GetHasOrganizationProjects gets the has_organization_projects property value. The has_organization_projects property +// returns a *bool when successful +func (m *TeamOrganization) GetHasOrganizationProjects()(*bool) { + return m.has_organization_projects +} +// GetHasRepositoryProjects gets the has_repository_projects property value. The has_repository_projects property +// returns a *bool when successful +func (m *TeamOrganization) GetHasRepositoryProjects()(*bool) { + return m.has_repository_projects +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *TeamOrganization) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TeamOrganization) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *TeamOrganization) GetId()(*int32) { + return m.id +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *TeamOrganization) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsVerified gets the is_verified property value. The is_verified property +// returns a *bool when successful +func (m *TeamOrganization) GetIsVerified()(*bool) { + return m.is_verified +} +// GetLocation gets the location property value. The location property +// returns a *string when successful +func (m *TeamOrganization) GetLocation()(*string) { + return m.location +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *TeamOrganization) GetLogin()(*string) { + return m.login +} +// GetMembersAllowedRepositoryCreationType gets the members_allowed_repository_creation_type property value. The members_allowed_repository_creation_type property +// returns a *string when successful +func (m *TeamOrganization) GetMembersAllowedRepositoryCreationType()(*string) { + return m.members_allowed_repository_creation_type +} +// GetMembersCanCreateInternalRepositories gets the members_can_create_internal_repositories property value. The members_can_create_internal_repositories property +// returns a *bool when successful +func (m *TeamOrganization) GetMembersCanCreateInternalRepositories()(*bool) { + return m.members_can_create_internal_repositories +} +// GetMembersCanCreatePages gets the members_can_create_pages property value. The members_can_create_pages property +// returns a *bool when successful +func (m *TeamOrganization) GetMembersCanCreatePages()(*bool) { + return m.members_can_create_pages +} +// GetMembersCanCreatePrivatePages gets the members_can_create_private_pages property value. The members_can_create_private_pages property +// returns a *bool when successful +func (m *TeamOrganization) GetMembersCanCreatePrivatePages()(*bool) { + return m.members_can_create_private_pages +} +// GetMembersCanCreatePrivateRepositories gets the members_can_create_private_repositories property value. The members_can_create_private_repositories property +// returns a *bool when successful +func (m *TeamOrganization) GetMembersCanCreatePrivateRepositories()(*bool) { + return m.members_can_create_private_repositories +} +// GetMembersCanCreatePublicPages gets the members_can_create_public_pages property value. The members_can_create_public_pages property +// returns a *bool when successful +func (m *TeamOrganization) GetMembersCanCreatePublicPages()(*bool) { + return m.members_can_create_public_pages +} +// GetMembersCanCreatePublicRepositories gets the members_can_create_public_repositories property value. The members_can_create_public_repositories property +// returns a *bool when successful +func (m *TeamOrganization) GetMembersCanCreatePublicRepositories()(*bool) { + return m.members_can_create_public_repositories +} +// GetMembersCanCreateRepositories gets the members_can_create_repositories property value. The members_can_create_repositories property +// returns a *bool when successful +func (m *TeamOrganization) GetMembersCanCreateRepositories()(*bool) { + return m.members_can_create_repositories +} +// GetMembersCanForkPrivateRepositories gets the members_can_fork_private_repositories property value. The members_can_fork_private_repositories property +// returns a *bool when successful +func (m *TeamOrganization) GetMembersCanForkPrivateRepositories()(*bool) { + return m.members_can_fork_private_repositories +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *TeamOrganization) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *TeamOrganization) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TeamOrganization) GetNodeId()(*string) { + return m.node_id +} +// GetOwnedPrivateRepos gets the owned_private_repos property value. The owned_private_repos property +// returns a *int32 when successful +func (m *TeamOrganization) GetOwnedPrivateRepos()(*int32) { + return m.owned_private_repos +} +// GetPlan gets the plan property value. The plan property +// returns a TeamOrganization_planable when successful +func (m *TeamOrganization) GetPlan()(TeamOrganization_planable) { + return m.plan +} +// GetPrivateGists gets the private_gists property value. The private_gists property +// returns a *int32 when successful +func (m *TeamOrganization) GetPrivateGists()(*int32) { + return m.private_gists +} +// GetPublicGists gets the public_gists property value. The public_gists property +// returns a *int32 when successful +func (m *TeamOrganization) GetPublicGists()(*int32) { + return m.public_gists +} +// GetPublicMembersUrl gets the public_members_url property value. The public_members_url property +// returns a *string when successful +func (m *TeamOrganization) GetPublicMembersUrl()(*string) { + return m.public_members_url +} +// GetPublicRepos gets the public_repos property value. The public_repos property +// returns a *int32 when successful +func (m *TeamOrganization) GetPublicRepos()(*int32) { + return m.public_repos +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *TeamOrganization) GetReposUrl()(*string) { + return m.repos_url +} +// GetTotalPrivateRepos gets the total_private_repos property value. The total_private_repos property +// returns a *int32 when successful +func (m *TeamOrganization) GetTotalPrivateRepos()(*int32) { + return m.total_private_repos +} +// GetTwitterUsername gets the twitter_username property value. The twitter_username property +// returns a *string when successful +func (m *TeamOrganization) GetTwitterUsername()(*string) { + return m.twitter_username +} +// GetTwoFactorRequirementEnabled gets the two_factor_requirement_enabled property value. The two_factor_requirement_enabled property +// returns a *bool when successful +func (m *TeamOrganization) GetTwoFactorRequirementEnabled()(*bool) { + return m.two_factor_requirement_enabled +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *TeamOrganization) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *TeamOrganization) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TeamOrganization) GetUrl()(*string) { + return m.url +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. The web_commit_signoff_required property +// returns a *bool when successful +func (m *TeamOrganization) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *TeamOrganization) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("archived_at", m.GetArchivedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("billing_email", m.GetBillingEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blog", m.GetBlog()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("collaborators", m.GetCollaborators()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("company", m.GetCompany()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_repository_permission", m.GetDefaultRepositoryPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("disk_usage", m.GetDiskUsage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("followers", m.GetFollowers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("following", m.GetFollowing()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_organization_projects", m.GetHasOrganizationProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_repository_projects", m.GetHasRepositoryProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_verified", m.GetIsVerified()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_allowed_repository_creation_type", m.GetMembersAllowedRepositoryCreationType()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_internal_repositories", m.GetMembersCanCreateInternalRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_pages", m.GetMembersCanCreatePages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_private_pages", m.GetMembersCanCreatePrivatePages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_private_repositories", m.GetMembersCanCreatePrivateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_public_pages", m.GetMembersCanCreatePublicPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_public_repositories", m.GetMembersCanCreatePublicRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_repositories", m.GetMembersCanCreateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_fork_private_repositories", m.GetMembersCanForkPrivateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("owned_private_repos", m.GetOwnedPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("plan", m.GetPlan()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_gists", m.GetPrivateGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_gists", m.GetPublicGists()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("public_members_url", m.GetPublicMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_repos", m.GetPublicRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_private_repos", m.GetTotalPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("twitter_username", m.GetTwitterUsername()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("two_factor_requirement_enabled", m.GetTwoFactorRequirementEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *TeamOrganization) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArchivedAt sets the archived_at property value. The archived_at property +func (m *TeamOrganization) SetArchivedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.archived_at = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *TeamOrganization) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetBillingEmail sets the billing_email property value. The billing_email property +func (m *TeamOrganization) SetBillingEmail(value *string)() { + m.billing_email = value +} +// SetBlog sets the blog property value. The blog property +func (m *TeamOrganization) SetBlog(value *string)() { + m.blog = value +} +// SetCollaborators sets the collaborators property value. The collaborators property +func (m *TeamOrganization) SetCollaborators(value *int32)() { + m.collaborators = value +} +// SetCompany sets the company property value. The company property +func (m *TeamOrganization) SetCompany(value *string)() { + m.company = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TeamOrganization) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultRepositoryPermission sets the default_repository_permission property value. The default_repository_permission property +func (m *TeamOrganization) SetDefaultRepositoryPermission(value *string)() { + m.default_repository_permission = value +} +// SetDescription sets the description property value. The description property +func (m *TeamOrganization) SetDescription(value *string)() { + m.description = value +} +// SetDiskUsage sets the disk_usage property value. The disk_usage property +func (m *TeamOrganization) SetDiskUsage(value *int32)() { + m.disk_usage = value +} +// SetEmail sets the email property value. The email property +func (m *TeamOrganization) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *TeamOrganization) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowers sets the followers property value. The followers property +func (m *TeamOrganization) SetFollowers(value *int32)() { + m.followers = value +} +// SetFollowing sets the following property value. The following property +func (m *TeamOrganization) SetFollowing(value *int32)() { + m.following = value +} +// SetHasOrganizationProjects sets the has_organization_projects property value. The has_organization_projects property +func (m *TeamOrganization) SetHasOrganizationProjects(value *bool)() { + m.has_organization_projects = value +} +// SetHasRepositoryProjects sets the has_repository_projects property value. The has_repository_projects property +func (m *TeamOrganization) SetHasRepositoryProjects(value *bool)() { + m.has_repository_projects = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *TeamOrganization) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TeamOrganization) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *TeamOrganization) SetId(value *int32)() { + m.id = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *TeamOrganization) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsVerified sets the is_verified property value. The is_verified property +func (m *TeamOrganization) SetIsVerified(value *bool)() { + m.is_verified = value +} +// SetLocation sets the location property value. The location property +func (m *TeamOrganization) SetLocation(value *string)() { + m.location = value +} +// SetLogin sets the login property value. The login property +func (m *TeamOrganization) SetLogin(value *string)() { + m.login = value +} +// SetMembersAllowedRepositoryCreationType sets the members_allowed_repository_creation_type property value. The members_allowed_repository_creation_type property +func (m *TeamOrganization) SetMembersAllowedRepositoryCreationType(value *string)() { + m.members_allowed_repository_creation_type = value +} +// SetMembersCanCreateInternalRepositories sets the members_can_create_internal_repositories property value. The members_can_create_internal_repositories property +func (m *TeamOrganization) SetMembersCanCreateInternalRepositories(value *bool)() { + m.members_can_create_internal_repositories = value +} +// SetMembersCanCreatePages sets the members_can_create_pages property value. The members_can_create_pages property +func (m *TeamOrganization) SetMembersCanCreatePages(value *bool)() { + m.members_can_create_pages = value +} +// SetMembersCanCreatePrivatePages sets the members_can_create_private_pages property value. The members_can_create_private_pages property +func (m *TeamOrganization) SetMembersCanCreatePrivatePages(value *bool)() { + m.members_can_create_private_pages = value +} +// SetMembersCanCreatePrivateRepositories sets the members_can_create_private_repositories property value. The members_can_create_private_repositories property +func (m *TeamOrganization) SetMembersCanCreatePrivateRepositories(value *bool)() { + m.members_can_create_private_repositories = value +} +// SetMembersCanCreatePublicPages sets the members_can_create_public_pages property value. The members_can_create_public_pages property +func (m *TeamOrganization) SetMembersCanCreatePublicPages(value *bool)() { + m.members_can_create_public_pages = value +} +// SetMembersCanCreatePublicRepositories sets the members_can_create_public_repositories property value. The members_can_create_public_repositories property +func (m *TeamOrganization) SetMembersCanCreatePublicRepositories(value *bool)() { + m.members_can_create_public_repositories = value +} +// SetMembersCanCreateRepositories sets the members_can_create_repositories property value. The members_can_create_repositories property +func (m *TeamOrganization) SetMembersCanCreateRepositories(value *bool)() { + m.members_can_create_repositories = value +} +// SetMembersCanForkPrivateRepositories sets the members_can_fork_private_repositories property value. The members_can_fork_private_repositories property +func (m *TeamOrganization) SetMembersCanForkPrivateRepositories(value *bool)() { + m.members_can_fork_private_repositories = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *TeamOrganization) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. The name property +func (m *TeamOrganization) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TeamOrganization) SetNodeId(value *string)() { + m.node_id = value +} +// SetOwnedPrivateRepos sets the owned_private_repos property value. The owned_private_repos property +func (m *TeamOrganization) SetOwnedPrivateRepos(value *int32)() { + m.owned_private_repos = value +} +// SetPlan sets the plan property value. The plan property +func (m *TeamOrganization) SetPlan(value TeamOrganization_planable)() { + m.plan = value +} +// SetPrivateGists sets the private_gists property value. The private_gists property +func (m *TeamOrganization) SetPrivateGists(value *int32)() { + m.private_gists = value +} +// SetPublicGists sets the public_gists property value. The public_gists property +func (m *TeamOrganization) SetPublicGists(value *int32)() { + m.public_gists = value +} +// SetPublicMembersUrl sets the public_members_url property value. The public_members_url property +func (m *TeamOrganization) SetPublicMembersUrl(value *string)() { + m.public_members_url = value +} +// SetPublicRepos sets the public_repos property value. The public_repos property +func (m *TeamOrganization) SetPublicRepos(value *int32)() { + m.public_repos = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *TeamOrganization) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetTotalPrivateRepos sets the total_private_repos property value. The total_private_repos property +func (m *TeamOrganization) SetTotalPrivateRepos(value *int32)() { + m.total_private_repos = value +} +// SetTwitterUsername sets the twitter_username property value. The twitter_username property +func (m *TeamOrganization) SetTwitterUsername(value *string)() { + m.twitter_username = value +} +// SetTwoFactorRequirementEnabled sets the two_factor_requirement_enabled property value. The two_factor_requirement_enabled property +func (m *TeamOrganization) SetTwoFactorRequirementEnabled(value *bool)() { + m.two_factor_requirement_enabled = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *TeamOrganization) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TeamOrganization) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *TeamOrganization) SetUrl(value *string)() { + m.url = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. The web_commit_signoff_required property +func (m *TeamOrganization) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type TeamOrganizationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArchivedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetAvatarUrl()(*string) + GetBillingEmail()(*string) + GetBlog()(*string) + GetCollaborators()(*int32) + GetCompany()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultRepositoryPermission()(*string) + GetDescription()(*string) + GetDiskUsage()(*int32) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowers()(*int32) + GetFollowing()(*int32) + GetHasOrganizationProjects()(*bool) + GetHasRepositoryProjects()(*bool) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssuesUrl()(*string) + GetIsVerified()(*bool) + GetLocation()(*string) + GetLogin()(*string) + GetMembersAllowedRepositoryCreationType()(*string) + GetMembersCanCreateInternalRepositories()(*bool) + GetMembersCanCreatePages()(*bool) + GetMembersCanCreatePrivatePages()(*bool) + GetMembersCanCreatePrivateRepositories()(*bool) + GetMembersCanCreatePublicPages()(*bool) + GetMembersCanCreatePublicRepositories()(*bool) + GetMembersCanCreateRepositories()(*bool) + GetMembersCanForkPrivateRepositories()(*bool) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOwnedPrivateRepos()(*int32) + GetPlan()(TeamOrganization_planable) + GetPrivateGists()(*int32) + GetPublicGists()(*int32) + GetPublicMembersUrl()(*string) + GetPublicRepos()(*int32) + GetReposUrl()(*string) + GetTotalPrivateRepos()(*int32) + GetTwitterUsername()(*string) + GetTwoFactorRequirementEnabled()(*bool) + GetTypeEscaped()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetWebCommitSignoffRequired()(*bool) + SetArchivedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetAvatarUrl(value *string)() + SetBillingEmail(value *string)() + SetBlog(value *string)() + SetCollaborators(value *int32)() + SetCompany(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultRepositoryPermission(value *string)() + SetDescription(value *string)() + SetDiskUsage(value *int32)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowers(value *int32)() + SetFollowing(value *int32)() + SetHasOrganizationProjects(value *bool)() + SetHasRepositoryProjects(value *bool)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssuesUrl(value *string)() + SetIsVerified(value *bool)() + SetLocation(value *string)() + SetLogin(value *string)() + SetMembersAllowedRepositoryCreationType(value *string)() + SetMembersCanCreateInternalRepositories(value *bool)() + SetMembersCanCreatePages(value *bool)() + SetMembersCanCreatePrivatePages(value *bool)() + SetMembersCanCreatePrivateRepositories(value *bool)() + SetMembersCanCreatePublicPages(value *bool)() + SetMembersCanCreatePublicRepositories(value *bool)() + SetMembersCanCreateRepositories(value *bool)() + SetMembersCanForkPrivateRepositories(value *bool)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOwnedPrivateRepos(value *int32)() + SetPlan(value TeamOrganization_planable)() + SetPrivateGists(value *int32)() + SetPublicGists(value *int32)() + SetPublicMembersUrl(value *string)() + SetPublicRepos(value *int32)() + SetReposUrl(value *string)() + SetTotalPrivateRepos(value *int32)() + SetTwitterUsername(value *string)() + SetTwoFactorRequirementEnabled(value *bool)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_organization_plan.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_organization_plan.go new file mode 100644 index 000000000..774360a9d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_organization_plan.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TeamOrganization_plan struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The filled_seats property + filled_seats *int32 + // The name property + name *string + // The private_repos property + private_repos *int32 + // The seats property + seats *int32 + // The space property + space *int32 +} +// NewTeamOrganization_plan instantiates a new TeamOrganization_plan and sets the default values. +func NewTeamOrganization_plan()(*TeamOrganization_plan) { + m := &TeamOrganization_plan{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamOrganization_planFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamOrganization_planFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamOrganization_plan(), 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 *TeamOrganization_plan) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamOrganization_plan) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["filled_seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFilledSeats(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateRepos(val) + } + return nil + } + res["seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSeats(val) + } + return nil + } + res["space"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSpace(val) + } + return nil + } + return res +} +// GetFilledSeats gets the filled_seats property value. The filled_seats property +// returns a *int32 when successful +func (m *TeamOrganization_plan) GetFilledSeats()(*int32) { + return m.filled_seats +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *TeamOrganization_plan) GetName()(*string) { + return m.name +} +// GetPrivateRepos gets the private_repos property value. The private_repos property +// returns a *int32 when successful +func (m *TeamOrganization_plan) GetPrivateRepos()(*int32) { + return m.private_repos +} +// GetSeats gets the seats property value. The seats property +// returns a *int32 when successful +func (m *TeamOrganization_plan) GetSeats()(*int32) { + return m.seats +} +// GetSpace gets the space property value. The space property +// returns a *int32 when successful +func (m *TeamOrganization_plan) GetSpace()(*int32) { + return m.space +} +// Serialize serializes information the current object +func (m *TeamOrganization_plan) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("filled_seats", m.GetFilledSeats()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_repos", m.GetPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("seats", m.GetSeats()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("space", m.GetSpace()) + 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 *TeamOrganization_plan) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFilledSeats sets the filled_seats property value. The filled_seats property +func (m *TeamOrganization_plan) SetFilledSeats(value *int32)() { + m.filled_seats = value +} +// SetName sets the name property value. The name property +func (m *TeamOrganization_plan) SetName(value *string)() { + m.name = value +} +// SetPrivateRepos sets the private_repos property value. The private_repos property +func (m *TeamOrganization_plan) SetPrivateRepos(value *int32)() { + m.private_repos = value +} +// SetSeats sets the seats property value. The seats property +func (m *TeamOrganization_plan) SetSeats(value *int32)() { + m.seats = value +} +// SetSpace sets the space property value. The space property +func (m *TeamOrganization_plan) SetSpace(value *int32)() { + m.space = value +} +type TeamOrganization_planable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFilledSeats()(*int32) + GetName()(*string) + GetPrivateRepos()(*int32) + GetSeats()(*int32) + GetSpace()(*int32) + SetFilledSeats(value *int32)() + SetName(value *string)() + SetPrivateRepos(value *int32)() + SetSeats(value *int32)() + SetSpace(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_permissions.go new file mode 100644 index 000000000..22127e9fd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Team_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewTeam_permissions instantiates a new Team_permissions and sets the default values. +func NewTeam_permissions()(*Team_permissions) { + m := &Team_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeam_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeam_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeam_permissions(), 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 *Team_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *Team_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Team_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *Team_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *Team_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *Team_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *Team_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *Team_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *Team_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *Team_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *Team_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *Team_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *Team_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *Team_permissions) SetTriage(value *bool)() { + m.triage = value +} +type Team_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_project.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_project.go new file mode 100644 index 000000000..df9e78879 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_project.go @@ -0,0 +1,516 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamProject a team's access to a project. +type TeamProject struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The body property + body *string + // The columns_url property + columns_url *string + // The created_at property + created_at *string + // A GitHub user. + creator SimpleUserable + // The html_url property + html_url *string + // The id property + id *int32 + // The name property + name *string + // The node_id property + node_id *string + // The number property + number *int32 + // The organization permission for this project. Only present when owner is an organization. + organization_permission *string + // The owner_url property + owner_url *string + // The permissions property + permissions TeamProject_permissionsable + // Whether the project is private or not. Only present when owner is an organization. + private *bool + // The state property + state *string + // The updated_at property + updated_at *string + // The url property + url *string +} +// NewTeamProject instantiates a new TeamProject and sets the default values. +func NewTeamProject()(*TeamProject) { + m := &TeamProject{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamProjectFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamProjectFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamProject(), 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 *TeamProject) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *TeamProject) GetBody()(*string) { + return m.body +} +// GetColumnsUrl gets the columns_url property value. The columns_url property +// returns a *string when successful +func (m *TeamProject) GetColumnsUrl()(*string) { + return m.columns_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *TeamProject) GetCreatedAt()(*string) { + return m.created_at +} +// GetCreator gets the creator property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TeamProject) GetCreator()(SimpleUserable) { + return m.creator +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamProject) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["columns_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["creator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreator(val.(SimpleUserable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["organization_permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationPermission(val) + } + return nil + } + res["owner_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOwnerUrl(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeamProject_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(TeamProject_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TeamProject) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *TeamProject) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *TeamProject) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TeamProject) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. The number property +// returns a *int32 when successful +func (m *TeamProject) GetNumber()(*int32) { + return m.number +} +// GetOrganizationPermission gets the organization_permission property value. The organization permission for this project. Only present when owner is an organization. +// returns a *string when successful +func (m *TeamProject) GetOrganizationPermission()(*string) { + return m.organization_permission +} +// GetOwnerUrl gets the owner_url property value. The owner_url property +// returns a *string when successful +func (m *TeamProject) GetOwnerUrl()(*string) { + return m.owner_url +} +// GetPermissions gets the permissions property value. The permissions property +// returns a TeamProject_permissionsable when successful +func (m *TeamProject) GetPermissions()(TeamProject_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. Whether the project is private or not. Only present when owner is an organization. +// returns a *bool when successful +func (m *TeamProject) GetPrivate()(*bool) { + return m.private +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *TeamProject) GetState()(*string) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *string when successful +func (m *TeamProject) GetUpdatedAt()(*string) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TeamProject) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TeamProject) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("columns_url", m.GetColumnsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("creator", m.GetCreator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization_permission", m.GetOrganizationPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("owner_url", m.GetOwnerUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TeamProject) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The body property +func (m *TeamProject) SetBody(value *string)() { + m.body = value +} +// SetColumnsUrl sets the columns_url property value. The columns_url property +func (m *TeamProject) SetColumnsUrl(value *string)() { + m.columns_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TeamProject) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetCreator sets the creator property value. A GitHub user. +func (m *TeamProject) SetCreator(value SimpleUserable)() { + m.creator = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TeamProject) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *TeamProject) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *TeamProject) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TeamProject) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. The number property +func (m *TeamProject) SetNumber(value *int32)() { + m.number = value +} +// SetOrganizationPermission sets the organization_permission property value. The organization permission for this project. Only present when owner is an organization. +func (m *TeamProject) SetOrganizationPermission(value *string)() { + m.organization_permission = value +} +// SetOwnerUrl sets the owner_url property value. The owner_url property +func (m *TeamProject) SetOwnerUrl(value *string)() { + m.owner_url = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *TeamProject) SetPermissions(value TeamProject_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. Whether the project is private or not. Only present when owner is an organization. +func (m *TeamProject) SetPrivate(value *bool)() { + m.private = value +} +// SetState sets the state property value. The state property +func (m *TeamProject) SetState(value *string)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TeamProject) SetUpdatedAt(value *string)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *TeamProject) SetUrl(value *string)() { + m.url = value +} +type TeamProjectable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetColumnsUrl()(*string) + GetCreatedAt()(*string) + GetCreator()(SimpleUserable) + GetHtmlUrl()(*string) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetNumber()(*int32) + GetOrganizationPermission()(*string) + GetOwnerUrl()(*string) + GetPermissions()(TeamProject_permissionsable) + GetPrivate()(*bool) + GetState()(*string) + GetUpdatedAt()(*string) + GetUrl()(*string) + SetBody(value *string)() + SetColumnsUrl(value *string)() + SetCreatedAt(value *string)() + SetCreator(value SimpleUserable)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetOrganizationPermission(value *string)() + SetOwnerUrl(value *string)() + SetPermissions(value TeamProject_permissionsable)() + SetPrivate(value *bool)() + SetState(value *string)() + SetUpdatedAt(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_project_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_project_permissions.go new file mode 100644 index 000000000..bdaed3c31 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_project_permissions.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TeamProject_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The admin property + admin *bool + // The read property + read *bool + // The write property + write *bool +} +// NewTeamProject_permissions instantiates a new TeamProject_permissions and sets the default values. +func NewTeamProject_permissions()(*TeamProject_permissions) { + m := &TeamProject_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamProject_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamProject_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamProject_permissions(), 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 *TeamProject_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *TeamProject_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamProject_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["read"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRead(val) + } + return nil + } + res["write"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWrite(val) + } + return nil + } + return res +} +// GetRead gets the read property value. The read property +// returns a *bool when successful +func (m *TeamProject_permissions) GetRead()(*bool) { + return m.read +} +// GetWrite gets the write property value. The write property +// returns a *bool when successful +func (m *TeamProject_permissions) GetWrite()(*bool) { + return m.write +} +// Serialize serializes information the current object +func (m *TeamProject_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("read", m.GetRead()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("write", m.GetWrite()) + 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 *TeamProject_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *TeamProject_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetRead sets the read property value. The read property +func (m *TeamProject_permissions) SetRead(value *bool)() { + m.read = value +} +// SetWrite sets the write property value. The write property +func (m *TeamProject_permissions) SetWrite(value *bool)() { + m.write = value +} +type TeamProject_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetRead()(*bool) + GetWrite()(*bool) + SetAdmin(value *bool)() + SetRead(value *bool)() + SetWrite(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_repository.go new file mode 100644 index 000000000..c50f114d8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_repository.go @@ -0,0 +1,2642 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamRepository a team's access to a repository. +type TeamRepository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether to allow Auto-merge to be used on pull requests. + allow_auto_merge *bool + // Whether to allow forking this repo + allow_forking *bool + // Whether to allow merge commits for pull requests. + allow_merge_commit *bool + // Whether to allow rebase merges for pull requests. + allow_rebase_merge *bool + // Whether to allow squash merges for pull requests. + allow_squash_merge *bool + // The archive_url property + archive_url *string + // Whether the repository is archived. + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default branch of the repository. + default_branch *string + // Whether to delete head branches when pull requests are merged + delete_branch_on_merge *bool + // The deployments_url property + deployments_url *string + // The description property + description *string + // Returns whether or not this repository disabled. + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // Whether downloads are enabled. + has_downloads *bool + // Whether issues are enabled. + has_issues *bool + // The has_pages property + has_pages *bool + // Whether projects are enabled. + has_projects *bool + // Whether the wiki is enabled. + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // Unique identifier of the repository + id *int32 + // Whether this repository acts as a template that can be used to generate new repositories. + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // License Simple + license NullableLicenseSimpleable + // The master_branch property + master_branch *string + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name of the repository. + name *string + // The network_count property + network_count *int32 + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // A GitHub user. + owner NullableSimpleUserable + // The permissions property + permissions TeamRepository_permissionsable + // Whether the repository is private or public. + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The role_name property + role_name *string + // The size property + size *int32 + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The statuses_url property + statuses_url *string + // The subscribers_count property + subscribers_count *int32 + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The repository visibility: public, private, or internal. + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // Whether to require contributors to sign off on web-based commits + web_commit_signoff_required *bool +} +// NewTeamRepository instantiates a new TeamRepository and sets the default values. +func NewTeamRepository()(*TeamRepository) { + m := &TeamRepository{ + } + m.SetAdditionalData(make(map[string]any)) + visibilityValue := "public" + m.SetVisibility(&visibilityValue) + return m +} +// CreateTeamRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamRepository(), 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 *TeamRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. Whether to allow Auto-merge to be used on pull requests. +// returns a *bool when successful +func (m *TeamRepository) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowForking gets the allow_forking property value. Whether to allow forking this repo +// returns a *bool when successful +func (m *TeamRepository) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. Whether to allow merge commits for pull requests. +// returns a *bool when successful +func (m *TeamRepository) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. Whether to allow rebase merges for pull requests. +// returns a *bool when successful +func (m *TeamRepository) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. Whether to allow squash merges for pull requests. +// returns a *bool when successful +func (m *TeamRepository) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetArchived gets the archived property value. Whether the repository is archived. +// returns a *bool when successful +func (m *TeamRepository) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *TeamRepository) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *TeamRepository) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *TeamRepository) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *TeamRepository) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *TeamRepository) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *TeamRepository) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *TeamRepository) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *TeamRepository) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *TeamRepository) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *TeamRepository) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *TeamRepository) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *TeamRepository) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default branch of the repository. +// returns a *string when successful +func (m *TeamRepository) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged +// returns a *bool when successful +func (m *TeamRepository) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *TeamRepository) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *TeamRepository) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. Returns whether or not this repository disabled. +// returns a *bool when successful +func (m *TeamRepository) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *TeamRepository) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *TeamRepository) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableLicenseSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(NullableLicenseSimpleable)) + } + return nil + } + res["master_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMasterBranch(val) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["network_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNetworkCount(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(NullableSimpleUserable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeamRepository_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(TeamRepository_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["role_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRoleName(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersCount(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["topics"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *TeamRepository) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *TeamRepository) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *TeamRepository) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *TeamRepository) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *TeamRepository) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *TeamRepository) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *TeamRepository) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *TeamRepository) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *TeamRepository) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDownloads gets the has_downloads property value. Whether downloads are enabled. +// returns a *bool when successful +func (m *TeamRepository) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. Whether issues are enabled. +// returns a *bool when successful +func (m *TeamRepository) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *TeamRepository) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. Whether projects are enabled. +// returns a *bool when successful +func (m *TeamRepository) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. Whether the wiki is enabled. +// returns a *bool when successful +func (m *TeamRepository) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *TeamRepository) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *TeamRepository) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TeamRepository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the repository +// returns a *int32 when successful +func (m *TeamRepository) GetId()(*int32) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *TeamRepository) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *TeamRepository) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *TeamRepository) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. Whether this repository acts as a template that can be used to generate new repositories. +// returns a *bool when successful +func (m *TeamRepository) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *TeamRepository) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *TeamRepository) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *TeamRepository) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *TeamRepository) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. License Simple +// returns a NullableLicenseSimpleable when successful +func (m *TeamRepository) GetLicense()(NullableLicenseSimpleable) { + return m.license +} +// GetMasterBranch gets the master_branch property value. The master_branch property +// returns a *string when successful +func (m *TeamRepository) GetMasterBranch()(*string) { + return m.master_branch +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *TeamRepository) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *TeamRepository) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *TeamRepository) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name of the repository. +// returns a *string when successful +func (m *TeamRepository) GetName()(*string) { + return m.name +} +// GetNetworkCount gets the network_count property value. The network_count property +// returns a *int32 when successful +func (m *TeamRepository) GetNetworkCount()(*int32) { + return m.network_count +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TeamRepository) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *TeamRepository) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *TeamRepository) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *TeamRepository) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *TeamRepository) GetOwner()(NullableSimpleUserable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a TeamRepository_permissionsable when successful +func (m *TeamRepository) GetPermissions()(TeamRepository_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. Whether the repository is private or public. +// returns a *bool when successful +func (m *TeamRepository) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *TeamRepository) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *TeamRepository) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *TeamRepository) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetRoleName gets the role_name property value. The role_name property +// returns a *string when successful +func (m *TeamRepository) GetRoleName()(*string) { + return m.role_name +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *TeamRepository) GetSize()(*int32) { + return m.size +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *TeamRepository) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *TeamRepository) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *TeamRepository) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *TeamRepository) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersCount gets the subscribers_count property value. The subscribers_count property +// returns a *int32 when successful +func (m *TeamRepository) GetSubscribersCount()(*int32) { + return m.subscribers_count +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *TeamRepository) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *TeamRepository) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *TeamRepository) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *TeamRepository) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *TeamRepository) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *TeamRepository) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *TeamRepository) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *TeamRepository) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *TeamRepository) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TeamRepository) GetUrl()(*string) { + return m.url +} +// GetVisibility gets the visibility property value. The repository visibility: public, private, or internal. +// returns a *string when successful +func (m *TeamRepository) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *TeamRepository) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *TeamRepository) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. Whether to require contributors to sign off on web-based commits +// returns a *bool when successful +func (m *TeamRepository) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *TeamRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("master_branch", m.GetMasterBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("network_count", m.GetNetworkCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("role_name", m.GetRoleName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("subscribers_count", m.GetSubscribersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *TeamRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. Whether to allow Auto-merge to be used on pull requests. +func (m *TeamRepository) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowForking sets the allow_forking property value. Whether to allow forking this repo +func (m *TeamRepository) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. Whether to allow merge commits for pull requests. +func (m *TeamRepository) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. Whether to allow rebase merges for pull requests. +func (m *TeamRepository) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. Whether to allow squash merges for pull requests. +func (m *TeamRepository) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetArchived sets the archived property value. Whether the repository is archived. +func (m *TeamRepository) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *TeamRepository) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *TeamRepository) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *TeamRepository) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *TeamRepository) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *TeamRepository) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *TeamRepository) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *TeamRepository) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *TeamRepository) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *TeamRepository) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *TeamRepository) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *TeamRepository) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TeamRepository) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default branch of the repository. +func (m *TeamRepository) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged +func (m *TeamRepository) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *TeamRepository) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *TeamRepository) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. Returns whether or not this repository disabled. +func (m *TeamRepository) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *TeamRepository) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *TeamRepository) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *TeamRepository) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *TeamRepository) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *TeamRepository) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *TeamRepository) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *TeamRepository) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *TeamRepository) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *TeamRepository) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *TeamRepository) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *TeamRepository) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDownloads sets the has_downloads property value. Whether downloads are enabled. +func (m *TeamRepository) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. Whether issues are enabled. +func (m *TeamRepository) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *TeamRepository) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. Whether projects are enabled. +func (m *TeamRepository) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. Whether the wiki is enabled. +func (m *TeamRepository) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *TeamRepository) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *TeamRepository) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TeamRepository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the repository +func (m *TeamRepository) SetId(value *int32)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *TeamRepository) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *TeamRepository) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *TeamRepository) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. Whether this repository acts as a template that can be used to generate new repositories. +func (m *TeamRepository) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *TeamRepository) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *TeamRepository) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *TeamRepository) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *TeamRepository) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. License Simple +func (m *TeamRepository) SetLicense(value NullableLicenseSimpleable)() { + m.license = value +} +// SetMasterBranch sets the master_branch property value. The master_branch property +func (m *TeamRepository) SetMasterBranch(value *string)() { + m.master_branch = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *TeamRepository) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *TeamRepository) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *TeamRepository) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name of the repository. +func (m *TeamRepository) SetName(value *string)() { + m.name = value +} +// SetNetworkCount sets the network_count property value. The network_count property +func (m *TeamRepository) SetNetworkCount(value *int32)() { + m.network_count = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TeamRepository) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *TeamRepository) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *TeamRepository) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *TeamRepository) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *TeamRepository) SetOwner(value NullableSimpleUserable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *TeamRepository) SetPermissions(value TeamRepository_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. Whether the repository is private or public. +func (m *TeamRepository) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *TeamRepository) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *TeamRepository) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *TeamRepository) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetRoleName sets the role_name property value. The role_name property +func (m *TeamRepository) SetRoleName(value *string)() { + m.role_name = value +} +// SetSize sets the size property value. The size property +func (m *TeamRepository) SetSize(value *int32)() { + m.size = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *TeamRepository) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *TeamRepository) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *TeamRepository) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *TeamRepository) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersCount sets the subscribers_count property value. The subscribers_count property +func (m *TeamRepository) SetSubscribersCount(value *int32)() { + m.subscribers_count = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *TeamRepository) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *TeamRepository) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *TeamRepository) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *TeamRepository) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *TeamRepository) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *TeamRepository) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTopics sets the topics property value. The topics property +func (m *TeamRepository) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *TeamRepository) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TeamRepository) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *TeamRepository) SetUrl(value *string)() { + m.url = value +} +// SetVisibility sets the visibility property value. The repository visibility: public, private, or internal. +func (m *TeamRepository) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *TeamRepository) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *TeamRepository) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. Whether to require contributors to sign off on web-based commits +func (m *TeamRepository) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type TeamRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(NullableLicenseSimpleable) + GetMasterBranch()(*string) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNetworkCount()(*int32) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOwner()(NullableSimpleUserable) + GetPermissions()(TeamRepository_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetRoleName()(*string) + GetSize()(*int32) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersCount()(*int32) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowAutoMerge(value *bool)() + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value NullableLicenseSimpleable)() + SetMasterBranch(value *string)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNetworkCount(value *int32)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOwner(value NullableSimpleUserable)() + SetPermissions(value TeamRepository_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetRoleName(value *string)() + SetSize(value *int32)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersCount(value *int32)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_repository_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_repository_permissions.go new file mode 100644 index 000000000..5546c286b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_repository_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TeamRepository_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewTeamRepository_permissions instantiates a new TeamRepository_permissions and sets the default values. +func NewTeamRepository_permissions()(*TeamRepository_permissions) { + m := &TeamRepository_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamRepository_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamRepository_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamRepository_permissions(), 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 *TeamRepository_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *TeamRepository_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamRepository_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *TeamRepository_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *TeamRepository_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *TeamRepository_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *TeamRepository_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *TeamRepository_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *TeamRepository_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *TeamRepository_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *TeamRepository_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *TeamRepository_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *TeamRepository_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *TeamRepository_permissions) SetTriage(value *bool)() { + m.triage = value +} +type TeamRepository_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_role_assignment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_role_assignment.go new file mode 100644 index 000000000..e51c85fcc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_role_assignment.go @@ -0,0 +1,458 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamRoleAssignment the Relationship a Team has with a role. +type TeamRoleAssignment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The description property + description *string + // The html_url property + html_url *string + // The id property + id *int32 + // The members_url property + members_url *string + // The name property + name *string + // The node_id property + node_id *string + // The notification_setting property + notification_setting *string + // Groups of organization members that gives permissions on specified repositories. + parent NullableTeamSimpleable + // The permission property + permission *string + // The permissions property + permissions TeamRoleAssignment_permissionsable + // The privacy property + privacy *string + // The repositories_url property + repositories_url *string + // The slug property + slug *string + // The url property + url *string +} +// NewTeamRoleAssignment instantiates a new TeamRoleAssignment and sets the default values. +func NewTeamRoleAssignment()(*TeamRoleAssignment) { + m := &TeamRoleAssignment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamRoleAssignmentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamRoleAssignmentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamRoleAssignment(), 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 *TeamRoleAssignment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *TeamRoleAssignment) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamRoleAssignment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notification_setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationSetting(val) + } + return nil + } + res["parent"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableTeamSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParent(val.(NullableTeamSimpleable)) + } + return nil + } + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeamRoleAssignment_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(TeamRoleAssignment_permissionsable)) + } + return nil + } + res["privacy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivacy(val) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TeamRoleAssignment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *TeamRoleAssignment) GetId()(*int32) { + return m.id +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *TeamRoleAssignment) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *TeamRoleAssignment) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TeamRoleAssignment) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationSetting gets the notification_setting property value. The notification_setting property +// returns a *string when successful +func (m *TeamRoleAssignment) GetNotificationSetting()(*string) { + return m.notification_setting +} +// GetParent gets the parent property value. Groups of organization members that gives permissions on specified repositories. +// returns a NullableTeamSimpleable when successful +func (m *TeamRoleAssignment) GetParent()(NullableTeamSimpleable) { + return m.parent +} +// GetPermission gets the permission property value. The permission property +// returns a *string when successful +func (m *TeamRoleAssignment) GetPermission()(*string) { + return m.permission +} +// GetPermissions gets the permissions property value. The permissions property +// returns a TeamRoleAssignment_permissionsable when successful +func (m *TeamRoleAssignment) GetPermissions()(TeamRoleAssignment_permissionsable) { + return m.permissions +} +// GetPrivacy gets the privacy property value. The privacy property +// returns a *string when successful +func (m *TeamRoleAssignment) GetPrivacy()(*string) { + return m.privacy +} +// GetRepositoriesUrl gets the repositories_url property value. The repositories_url property +// returns a *string when successful +func (m *TeamRoleAssignment) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetSlug gets the slug property value. The slug property +// returns a *string when successful +func (m *TeamRoleAssignment) GetSlug()(*string) { + return m.slug +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TeamRoleAssignment) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TeamRoleAssignment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notification_setting", m.GetNotificationSetting()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("parent", m.GetParent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("permission", m.GetPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("privacy", m.GetPrivacy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TeamRoleAssignment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description property +func (m *TeamRoleAssignment) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TeamRoleAssignment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *TeamRoleAssignment) SetId(value *int32)() { + m.id = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *TeamRoleAssignment) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. The name property +func (m *TeamRoleAssignment) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TeamRoleAssignment) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationSetting sets the notification_setting property value. The notification_setting property +func (m *TeamRoleAssignment) SetNotificationSetting(value *string)() { + m.notification_setting = value +} +// SetParent sets the parent property value. Groups of organization members that gives permissions on specified repositories. +func (m *TeamRoleAssignment) SetParent(value NullableTeamSimpleable)() { + m.parent = value +} +// SetPermission sets the permission property value. The permission property +func (m *TeamRoleAssignment) SetPermission(value *string)() { + m.permission = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *TeamRoleAssignment) SetPermissions(value TeamRoleAssignment_permissionsable)() { + m.permissions = value +} +// SetPrivacy sets the privacy property value. The privacy property +func (m *TeamRoleAssignment) SetPrivacy(value *string)() { + m.privacy = value +} +// SetRepositoriesUrl sets the repositories_url property value. The repositories_url property +func (m *TeamRoleAssignment) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetSlug sets the slug property value. The slug property +func (m *TeamRoleAssignment) SetSlug(value *string)() { + m.slug = value +} +// SetUrl sets the url property value. The url property +func (m *TeamRoleAssignment) SetUrl(value *string)() { + m.url = value +} +type TeamRoleAssignmentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationSetting()(*string) + GetParent()(NullableTeamSimpleable) + GetPermission()(*string) + GetPermissions()(TeamRoleAssignment_permissionsable) + GetPrivacy()(*string) + GetRepositoriesUrl()(*string) + GetSlug()(*string) + GetUrl()(*string) + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationSetting(value *string)() + SetParent(value NullableTeamSimpleable)() + SetPermission(value *string)() + SetPermissions(value TeamRoleAssignment_permissionsable)() + SetPrivacy(value *string)() + SetRepositoriesUrl(value *string)() + SetSlug(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_role_assignment_permissions.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_role_assignment_permissions.go new file mode 100644 index 000000000..295a8588d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_role_assignment_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TeamRoleAssignment_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewTeamRoleAssignment_permissions instantiates a new TeamRoleAssignment_permissions and sets the default values. +func NewTeamRoleAssignment_permissions()(*TeamRoleAssignment_permissions) { + m := &TeamRoleAssignment_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamRoleAssignment_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamRoleAssignment_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamRoleAssignment_permissions(), 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 *TeamRoleAssignment_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *TeamRoleAssignment_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamRoleAssignment_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *TeamRoleAssignment_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *TeamRoleAssignment_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *TeamRoleAssignment_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *TeamRoleAssignment_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *TeamRoleAssignment_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *TeamRoleAssignment_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *TeamRoleAssignment_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *TeamRoleAssignment_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *TeamRoleAssignment_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *TeamRoleAssignment_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *TeamRoleAssignment_permissions) SetTriage(value *bool)() { + m.triage = value +} +type TeamRoleAssignment_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/team_simple.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_simple.go new file mode 100644 index 000000000..b71d3cce9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/team_simple.go @@ -0,0 +1,429 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamSimple groups of organization members that gives permissions on specified repositories. +type TeamSimple struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Description of the team + description *string + // The html_url property + html_url *string + // Unique identifier of the team + id *int32 + // Distinguished Name (DN) that team maps to within LDAP environment + ldap_dn *string + // The members_url property + members_url *string + // Name of the team + name *string + // The node_id property + node_id *string + // The notification setting the team has set + notification_setting *string + // Permission that the team will have for its repositories + permission *string + // The level of privacy this team should have + privacy *string + // The repositories_url property + repositories_url *string + // The slug property + slug *string + // URL for the team + url *string +} +// NewTeamSimple instantiates a new TeamSimple and sets the default values. +func NewTeamSimple()(*TeamSimple) { + m := &TeamSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamSimple(), 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 *TeamSimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. Description of the team +// returns a *string when successful +func (m *TeamSimple) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["ldap_dn"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLdapDn(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notification_setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationSetting(val) + } + return nil + } + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + res["privacy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivacy(val) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TeamSimple) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the team +// returns a *int32 when successful +func (m *TeamSimple) GetId()(*int32) { + return m.id +} +// GetLdapDn gets the ldap_dn property value. Distinguished Name (DN) that team maps to within LDAP environment +// returns a *string when successful +func (m *TeamSimple) GetLdapDn()(*string) { + return m.ldap_dn +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *TeamSimple) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. Name of the team +// returns a *string when successful +func (m *TeamSimple) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TeamSimple) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationSetting gets the notification_setting property value. The notification setting the team has set +// returns a *string when successful +func (m *TeamSimple) GetNotificationSetting()(*string) { + return m.notification_setting +} +// GetPermission gets the permission property value. Permission that the team will have for its repositories +// returns a *string when successful +func (m *TeamSimple) GetPermission()(*string) { + return m.permission +} +// GetPrivacy gets the privacy property value. The level of privacy this team should have +// returns a *string when successful +func (m *TeamSimple) GetPrivacy()(*string) { + return m.privacy +} +// GetRepositoriesUrl gets the repositories_url property value. The repositories_url property +// returns a *string when successful +func (m *TeamSimple) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetSlug gets the slug property value. The slug property +// returns a *string when successful +func (m *TeamSimple) GetSlug()(*string) { + return m.slug +} +// GetUrl gets the url property value. URL for the team +// returns a *string when successful +func (m *TeamSimple) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TeamSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ldap_dn", m.GetLdapDn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notification_setting", m.GetNotificationSetting()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("permission", m.GetPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("privacy", m.GetPrivacy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TeamSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. Description of the team +func (m *TeamSimple) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TeamSimple) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the team +func (m *TeamSimple) SetId(value *int32)() { + m.id = value +} +// SetLdapDn sets the ldap_dn property value. Distinguished Name (DN) that team maps to within LDAP environment +func (m *TeamSimple) SetLdapDn(value *string)() { + m.ldap_dn = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *TeamSimple) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. Name of the team +func (m *TeamSimple) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TeamSimple) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationSetting sets the notification_setting property value. The notification setting the team has set +func (m *TeamSimple) SetNotificationSetting(value *string)() { + m.notification_setting = value +} +// SetPermission sets the permission property value. Permission that the team will have for its repositories +func (m *TeamSimple) SetPermission(value *string)() { + m.permission = value +} +// SetPrivacy sets the privacy property value. The level of privacy this team should have +func (m *TeamSimple) SetPrivacy(value *string)() { + m.privacy = value +} +// SetRepositoriesUrl sets the repositories_url property value. The repositories_url property +func (m *TeamSimple) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetSlug sets the slug property value. The slug property +func (m *TeamSimple) SetSlug(value *string)() { + m.slug = value +} +// SetUrl sets the url property value. URL for the team +func (m *TeamSimple) SetUrl(value *string)() { + m.url = value +} +type TeamSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLdapDn()(*string) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationSetting()(*string) + GetPermission()(*string) + GetPrivacy()(*string) + GetRepositoriesUrl()(*string) + GetSlug()(*string) + GetUrl()(*string) + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLdapDn(value *string)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationSetting(value *string)() + SetPermission(value *string)() + SetPrivacy(value *string)() + SetRepositoriesUrl(value *string)() + SetSlug(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/thread.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/thread.go new file mode 100644 index 000000000..094b07a1e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/thread.go @@ -0,0 +1,313 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Thread thread +type Thread struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *string + // The last_read_at property + last_read_at *string + // The reason property + reason *string + // Minimal Repository + repository MinimalRepositoryable + // The subject property + subject Thread_subjectable + // The subscription_url property + subscription_url *string + // The unread property + unread *bool + // The updated_at property + updated_at *string + // The url property + url *string +} +// NewThread instantiates a new Thread and sets the default values. +func NewThread()(*Thread) { + m := &Thread{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateThreadFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateThreadFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewThread(), 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 *Thread) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Thread) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["last_read_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLastReadAt(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(MinimalRepositoryable)) + } + return nil + } + res["subject"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateThread_subjectFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSubject(val.(Thread_subjectable)) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["unread"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUnread(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *string when successful +func (m *Thread) GetId()(*string) { + return m.id +} +// GetLastReadAt gets the last_read_at property value. The last_read_at property +// returns a *string when successful +func (m *Thread) GetLastReadAt()(*string) { + return m.last_read_at +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *Thread) GetReason()(*string) { + return m.reason +} +// GetRepository gets the repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *Thread) GetRepository()(MinimalRepositoryable) { + return m.repository +} +// GetSubject gets the subject property value. The subject property +// returns a Thread_subjectable when successful +func (m *Thread) GetSubject()(Thread_subjectable) { + return m.subject +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *Thread) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetUnread gets the unread property value. The unread property +// returns a *bool when successful +func (m *Thread) GetUnread()(*bool) { + return m.unread +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *string when successful +func (m *Thread) GetUpdatedAt()(*string) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Thread) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Thread) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("last_read_at", m.GetLastReadAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("subject", m.GetSubject()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("unread", m.GetUnread()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Thread) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *Thread) SetId(value *string)() { + m.id = value +} +// SetLastReadAt sets the last_read_at property value. The last_read_at property +func (m *Thread) SetLastReadAt(value *string)() { + m.last_read_at = value +} +// SetReason sets the reason property value. The reason property +func (m *Thread) SetReason(value *string)() { + m.reason = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *Thread) SetRepository(value MinimalRepositoryable)() { + m.repository = value +} +// SetSubject sets the subject property value. The subject property +func (m *Thread) SetSubject(value Thread_subjectable)() { + m.subject = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *Thread) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetUnread sets the unread property value. The unread property +func (m *Thread) SetUnread(value *bool)() { + m.unread = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Thread) SetUpdatedAt(value *string)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Thread) SetUrl(value *string)() { + m.url = value +} +type Threadable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*string) + GetLastReadAt()(*string) + GetReason()(*string) + GetRepository()(MinimalRepositoryable) + GetSubject()(Thread_subjectable) + GetSubscriptionUrl()(*string) + GetUnread()(*bool) + GetUpdatedAt()(*string) + GetUrl()(*string) + SetId(value *string)() + SetLastReadAt(value *string)() + SetReason(value *string)() + SetRepository(value MinimalRepositoryable)() + SetSubject(value Thread_subjectable)() + SetSubscriptionUrl(value *string)() + SetUnread(value *bool)() + SetUpdatedAt(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/thread_subject.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/thread_subject.go new file mode 100644 index 000000000..252b430e2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/thread_subject.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Thread_subject struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The latest_comment_url property + latest_comment_url *string + // The title property + title *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewThread_subject instantiates a new Thread_subject and sets the default values. +func NewThread_subject()(*Thread_subject) { + m := &Thread_subject{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateThread_subjectFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateThread_subjectFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewThread_subject(), 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 *Thread_subject) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Thread_subject) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["latest_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLatestCommentUrl(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetLatestCommentUrl gets the latest_comment_url property value. The latest_comment_url property +// returns a *string when successful +func (m *Thread_subject) GetLatestCommentUrl()(*string) { + return m.latest_comment_url +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *Thread_subject) GetTitle()(*string) { + return m.title +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *Thread_subject) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Thread_subject) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Thread_subject) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("latest_comment_url", m.GetLatestCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Thread_subject) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLatestCommentUrl sets the latest_comment_url property value. The latest_comment_url property +func (m *Thread_subject) SetLatestCommentUrl(value *string)() { + m.latest_comment_url = value +} +// SetTitle sets the title property value. The title property +func (m *Thread_subject) SetTitle(value *string)() { + m.title = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Thread_subject) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *Thread_subject) SetUrl(value *string)() { + m.url = value +} +type Thread_subjectable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLatestCommentUrl()(*string) + GetTitle()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetLatestCommentUrl(value *string)() + SetTitle(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/thread_subscription.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/thread_subscription.go new file mode 100644 index 000000000..2c473ff57 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/thread_subscription.go @@ -0,0 +1,256 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ThreadSubscription thread Subscription +type ThreadSubscription struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The ignored property + ignored *bool + // The reason property + reason *string + // The repository_url property + repository_url *string + // The subscribed property + subscribed *bool + // The thread_url property + thread_url *string + // The url property + url *string +} +// NewThreadSubscription instantiates a new ThreadSubscription and sets the default values. +func NewThreadSubscription()(*ThreadSubscription) { + m := &ThreadSubscription{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateThreadSubscriptionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateThreadSubscriptionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewThreadSubscription(), 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 *ThreadSubscription) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *ThreadSubscription) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ThreadSubscription) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["ignored"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIgnored(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["subscribed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribed(val) + } + return nil + } + res["thread_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetThreadUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetIgnored gets the ignored property value. The ignored property +// returns a *bool when successful +func (m *ThreadSubscription) GetIgnored()(*bool) { + return m.ignored +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *ThreadSubscription) GetReason()(*string) { + return m.reason +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *ThreadSubscription) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetSubscribed gets the subscribed property value. The subscribed property +// returns a *bool when successful +func (m *ThreadSubscription) GetSubscribed()(*bool) { + return m.subscribed +} +// GetThreadUrl gets the thread_url property value. The thread_url property +// returns a *string when successful +func (m *ThreadSubscription) GetThreadUrl()(*string) { + return m.thread_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ThreadSubscription) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ThreadSubscription) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("ignored", m.GetIgnored()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("subscribed", m.GetSubscribed()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("thread_url", m.GetThreadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ThreadSubscription) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ThreadSubscription) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetIgnored sets the ignored property value. The ignored property +func (m *ThreadSubscription) SetIgnored(value *bool)() { + m.ignored = value +} +// SetReason sets the reason property value. The reason property +func (m *ThreadSubscription) SetReason(value *string)() { + m.reason = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *ThreadSubscription) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetSubscribed sets the subscribed property value. The subscribed property +func (m *ThreadSubscription) SetSubscribed(value *bool)() { + m.subscribed = value +} +// SetThreadUrl sets the thread_url property value. The thread_url property +func (m *ThreadSubscription) SetThreadUrl(value *string)() { + m.thread_url = value +} +// SetUrl sets the url property value. The url property +func (m *ThreadSubscription) SetUrl(value *string)() { + m.url = value +} +type ThreadSubscriptionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetIgnored()(*bool) + GetReason()(*string) + GetRepositoryUrl()(*string) + GetSubscribed()(*bool) + GetThreadUrl()(*string) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetIgnored(value *bool)() + SetReason(value *string)() + SetRepositoryUrl(value *string)() + SetSubscribed(value *bool)() + SetThreadUrl(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_assigned_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_assigned_issue_event.go new file mode 100644 index 000000000..4a9d802b8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_assigned_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineAssignedIssueEvent timeline Assigned Issue Event +type TimelineAssignedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee SimpleUserable + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewTimelineAssignedIssueEvent instantiates a new TimelineAssignedIssueEvent and sets the default values. +func NewTimelineAssignedIssueEvent()(*TimelineAssignedIssueEvent) { + m := &TimelineAssignedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineAssignedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineAssignedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineAssignedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TimelineAssignedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *TimelineAssignedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TimelineAssignedIssueEvent) GetAssignee()(SimpleUserable) { + return m.assignee +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *TimelineAssignedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *TimelineAssignedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *TimelineAssignedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *TimelineAssignedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineAssignedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *TimelineAssignedIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TimelineAssignedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *TimelineAssignedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TimelineAssignedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TimelineAssignedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *TimelineAssignedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *TimelineAssignedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *TimelineAssignedIssueEvent) SetAssignee(value SimpleUserable)() { + m.assignee = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *TimelineAssignedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *TimelineAssignedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TimelineAssignedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *TimelineAssignedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *TimelineAssignedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TimelineAssignedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *TimelineAssignedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *TimelineAssignedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type TimelineAssignedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetAssignee()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetAssignee(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_comment_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_comment_event.go new file mode 100644 index 000000000..129e61b2f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_comment_event.go @@ -0,0 +1,518 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineCommentEvent timeline Comment Event +type TimelineCommentEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How the author is associated with the repository. + author_association *AuthorAssociation + // Contents of the issue comment + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The event property + event *string + // The html_url property + html_url *string + // Unique identifier of the issue comment + id *int32 + // The issue_url property + issue_url *string + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The reactions property + reactions ReactionRollupable + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // URL for the issue comment + url *string + // A GitHub user. + user SimpleUserable +} +// NewTimelineCommentEvent instantiates a new TimelineCommentEvent and sets the default values. +func NewTimelineCommentEvent()(*TimelineCommentEvent) { + m := &TimelineCommentEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCommentEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCommentEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCommentEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TimelineCommentEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *TimelineCommentEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *TimelineCommentEvent) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. Contents of the issue comment +// returns a *string when successful +func (m *TimelineCommentEvent) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *TimelineCommentEvent) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *TimelineCommentEvent) GetBodyText()(*string) { + return m.body_text +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *TimelineCommentEvent) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *TimelineCommentEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineCommentEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["issue_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(SimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TimelineCommentEvent) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the issue comment +// returns a *int32 when successful +func (m *TimelineCommentEvent) GetId()(*int32) { + return m.id +} +// GetIssueUrl gets the issue_url property value. The issue_url property +// returns a *string when successful +func (m *TimelineCommentEvent) GetIssueUrl()(*string) { + return m.issue_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TimelineCommentEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *TimelineCommentEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *TimelineCommentEvent) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *TimelineCommentEvent) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. URL for the issue comment +// returns a *string when successful +func (m *TimelineCommentEvent) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TimelineCommentEvent) GetUser()(SimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *TimelineCommentEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_url", m.GetIssueUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *TimelineCommentEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *TimelineCommentEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *TimelineCommentEvent) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. Contents of the issue comment +func (m *TimelineCommentEvent) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *TimelineCommentEvent) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *TimelineCommentEvent) SetBodyText(value *string)() { + m.body_text = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TimelineCommentEvent) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *TimelineCommentEvent) SetEvent(value *string)() { + m.event = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TimelineCommentEvent) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the issue comment +func (m *TimelineCommentEvent) SetId(value *int32)() { + m.id = value +} +// SetIssueUrl sets the issue_url property value. The issue_url property +func (m *TimelineCommentEvent) SetIssueUrl(value *string)() { + m.issue_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TimelineCommentEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *TimelineCommentEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *TimelineCommentEvent) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TimelineCommentEvent) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. URL for the issue comment +func (m *TimelineCommentEvent) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *TimelineCommentEvent) SetUser(value SimpleUserable)() { + m.user = value +} +type TimelineCommentEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEvent()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssueUrl()(*string) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetReactions()(ReactionRollupable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(SimpleUserable) + SetActor(value SimpleUserable)() + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEvent(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssueUrl(value *string)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetReactions(value ReactionRollupable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value SimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_commit_commented_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_commit_commented_event.go new file mode 100644 index 000000000..c5a928449 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_commit_commented_event.go @@ -0,0 +1,180 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineCommitCommentedEvent timeline Commit Commented Event +type TimelineCommitCommentedEvent struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The comments property + comments []CommitCommentable + // The commit_id property + commit_id *string + // The event property + event *string + // The node_id property + node_id *string +} +// NewTimelineCommitCommentedEvent instantiates a new TimelineCommitCommentedEvent and sets the default values. +func NewTimelineCommitCommentedEvent()(*TimelineCommitCommentedEvent) { + m := &TimelineCommitCommentedEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCommitCommentedEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCommitCommentedEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCommitCommentedEvent(), 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 *TimelineCommitCommentedEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComments gets the comments property value. The comments property +// returns a []CommitCommentable when successful +func (m *TimelineCommitCommentedEvent) GetComments()([]CommitCommentable) { + return m.comments +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *TimelineCommitCommentedEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *TimelineCommitCommentedEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineCommitCommentedEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCommitCommentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CommitCommentable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CommitCommentable) + } + } + m.SetComments(res) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + return res +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TimelineCommitCommentedEvent) GetNodeId()(*string) { + return m.node_id +} +// Serialize serializes information the current object +func (m *TimelineCommitCommentedEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetComments() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetComments())) + for i, v := range m.GetComments() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("comments", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + 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 *TimelineCommitCommentedEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComments sets the comments property value. The comments property +func (m *TimelineCommitCommentedEvent) SetComments(value []CommitCommentable)() { + m.comments = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *TimelineCommitCommentedEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetEvent sets the event property value. The event property +func (m *TimelineCommitCommentedEvent) SetEvent(value *string)() { + m.event = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TimelineCommitCommentedEvent) SetNodeId(value *string)() { + m.node_id = value +} +type TimelineCommitCommentedEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComments()([]CommitCommentable) + GetCommitId()(*string) + GetEvent()(*string) + GetNodeId()(*string) + SetComments(value []CommitCommentable)() + SetCommitId(value *string)() + SetEvent(value *string)() + SetNodeId(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event.go new file mode 100644 index 000000000..e9ed04b49 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event.go @@ -0,0 +1,383 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineCommittedEvent timeline Committed Event +type TimelineCommittedEvent struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Identifying information for the git-user + author TimelineCommittedEvent_authorable + // Identifying information for the git-user + committer TimelineCommittedEvent_committerable + // The event property + event *string + // The html_url property + html_url *string + // Message describing the purpose of the commit + message *string + // The node_id property + node_id *string + // The parents property + parents []TimelineCommittedEvent_parentsable + // SHA for the commit + sha *string + // The tree property + tree TimelineCommittedEvent_treeable + // The url property + url *string + // The verification property + verification TimelineCommittedEvent_verificationable +} +// NewTimelineCommittedEvent instantiates a new TimelineCommittedEvent and sets the default values. +func NewTimelineCommittedEvent()(*TimelineCommittedEvent) { + m := &TimelineCommittedEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCommittedEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCommittedEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCommittedEvent(), 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 *TimelineCommittedEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. Identifying information for the git-user +// returns a TimelineCommittedEvent_authorable when successful +func (m *TimelineCommittedEvent) GetAuthor()(TimelineCommittedEvent_authorable) { + return m.author +} +// GetCommitter gets the committer property value. Identifying information for the git-user +// returns a TimelineCommittedEvent_committerable when successful +func (m *TimelineCommittedEvent) GetCommitter()(TimelineCommittedEvent_committerable) { + return m.committer +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *TimelineCommittedEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineCommittedEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTimelineCommittedEvent_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(TimelineCommittedEvent_authorable)) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTimelineCommittedEvent_committerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(TimelineCommittedEvent_committerable)) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["parents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTimelineCommittedEvent_parentsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]TimelineCommittedEvent_parentsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(TimelineCommittedEvent_parentsable) + } + } + m.SetParents(res) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTimelineCommittedEvent_treeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTree(val.(TimelineCommittedEvent_treeable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["verification"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTimelineCommittedEvent_verificationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerification(val.(TimelineCommittedEvent_verificationable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TimelineCommittedEvent) GetHtmlUrl()(*string) { + return m.html_url +} +// GetMessage gets the message property value. Message describing the purpose of the commit +// returns a *string when successful +func (m *TimelineCommittedEvent) GetMessage()(*string) { + return m.message +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TimelineCommittedEvent) GetNodeId()(*string) { + return m.node_id +} +// GetParents gets the parents property value. The parents property +// returns a []TimelineCommittedEvent_parentsable when successful +func (m *TimelineCommittedEvent) GetParents()([]TimelineCommittedEvent_parentsable) { + return m.parents +} +// GetSha gets the sha property value. SHA for the commit +// returns a *string when successful +func (m *TimelineCommittedEvent) GetSha()(*string) { + return m.sha +} +// GetTree gets the tree property value. The tree property +// returns a TimelineCommittedEvent_treeable when successful +func (m *TimelineCommittedEvent) GetTree()(TimelineCommittedEvent_treeable) { + return m.tree +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TimelineCommittedEvent) GetUrl()(*string) { + return m.url +} +// GetVerification gets the verification property value. The verification property +// returns a TimelineCommittedEvent_verificationable when successful +func (m *TimelineCommittedEvent) GetVerification()(TimelineCommittedEvent_verificationable) { + return m.verification +} +// Serialize serializes information the current object +func (m *TimelineCommittedEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetParents() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetParents())) + for i, v := range m.GetParents() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("parents", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tree", m.GetTree()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("verification", m.GetVerification()) + 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 *TimelineCommittedEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. Identifying information for the git-user +func (m *TimelineCommittedEvent) SetAuthor(value TimelineCommittedEvent_authorable)() { + m.author = value +} +// SetCommitter sets the committer property value. Identifying information for the git-user +func (m *TimelineCommittedEvent) SetCommitter(value TimelineCommittedEvent_committerable)() { + m.committer = value +} +// SetEvent sets the event property value. The event property +func (m *TimelineCommittedEvent) SetEvent(value *string)() { + m.event = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TimelineCommittedEvent) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetMessage sets the message property value. Message describing the purpose of the commit +func (m *TimelineCommittedEvent) SetMessage(value *string)() { + m.message = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TimelineCommittedEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetParents sets the parents property value. The parents property +func (m *TimelineCommittedEvent) SetParents(value []TimelineCommittedEvent_parentsable)() { + m.parents = value +} +// SetSha sets the sha property value. SHA for the commit +func (m *TimelineCommittedEvent) SetSha(value *string)() { + m.sha = value +} +// SetTree sets the tree property value. The tree property +func (m *TimelineCommittedEvent) SetTree(value TimelineCommittedEvent_treeable)() { + m.tree = value +} +// SetUrl sets the url property value. The url property +func (m *TimelineCommittedEvent) SetUrl(value *string)() { + m.url = value +} +// SetVerification sets the verification property value. The verification property +func (m *TimelineCommittedEvent) SetVerification(value TimelineCommittedEvent_verificationable)() { + m.verification = value +} +type TimelineCommittedEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(TimelineCommittedEvent_authorable) + GetCommitter()(TimelineCommittedEvent_committerable) + GetEvent()(*string) + GetHtmlUrl()(*string) + GetMessage()(*string) + GetNodeId()(*string) + GetParents()([]TimelineCommittedEvent_parentsable) + GetSha()(*string) + GetTree()(TimelineCommittedEvent_treeable) + GetUrl()(*string) + GetVerification()(TimelineCommittedEvent_verificationable) + SetAuthor(value TimelineCommittedEvent_authorable)() + SetCommitter(value TimelineCommittedEvent_committerable)() + SetEvent(value *string)() + SetHtmlUrl(value *string)() + SetMessage(value *string)() + SetNodeId(value *string)() + SetParents(value []TimelineCommittedEvent_parentsable)() + SetSha(value *string)() + SetTree(value TimelineCommittedEvent_treeable)() + SetUrl(value *string)() + SetVerification(value TimelineCommittedEvent_verificationable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event_author.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event_author.go new file mode 100644 index 000000000..8e7fa09cd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event_author.go @@ -0,0 +1,140 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineCommittedEvent_author identifying information for the git-user +type TimelineCommittedEvent_author struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Timestamp of the commit + date *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Git email address of the user + email *string + // Name of the git user + name *string +} +// NewTimelineCommittedEvent_author instantiates a new TimelineCommittedEvent_author and sets the default values. +func NewTimelineCommittedEvent_author()(*TimelineCommittedEvent_author) { + m := &TimelineCommittedEvent_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCommittedEvent_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCommittedEvent_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCommittedEvent_author(), 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 *TimelineCommittedEvent_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. Timestamp of the commit +// returns a *Time when successful +func (m *TimelineCommittedEvent_author) GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.date +} +// GetEmail gets the email property value. Git email address of the user +// returns a *string when successful +func (m *TimelineCommittedEvent_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineCommittedEvent_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. Name of the git user +// returns a *string when successful +func (m *TimelineCommittedEvent_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *TimelineCommittedEvent_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *TimelineCommittedEvent_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. Timestamp of the commit +func (m *TimelineCommittedEvent_author) SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.date = value +} +// SetEmail sets the email property value. Git email address of the user +func (m *TimelineCommittedEvent_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. Name of the git user +func (m *TimelineCommittedEvent_author) SetName(value *string)() { + m.name = value +} +type TimelineCommittedEvent_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetName()(*string) + SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event_committer.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event_committer.go new file mode 100644 index 000000000..bf5824885 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event_committer.go @@ -0,0 +1,140 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineCommittedEvent_committer identifying information for the git-user +type TimelineCommittedEvent_committer struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Timestamp of the commit + date *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Git email address of the user + email *string + // Name of the git user + name *string +} +// NewTimelineCommittedEvent_committer instantiates a new TimelineCommittedEvent_committer and sets the default values. +func NewTimelineCommittedEvent_committer()(*TimelineCommittedEvent_committer) { + m := &TimelineCommittedEvent_committer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCommittedEvent_committerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCommittedEvent_committerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCommittedEvent_committer(), 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 *TimelineCommittedEvent_committer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. Timestamp of the commit +// returns a *Time when successful +func (m *TimelineCommittedEvent_committer) GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.date +} +// GetEmail gets the email property value. Git email address of the user +// returns a *string when successful +func (m *TimelineCommittedEvent_committer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineCommittedEvent_committer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. Name of the git user +// returns a *string when successful +func (m *TimelineCommittedEvent_committer) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *TimelineCommittedEvent_committer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *TimelineCommittedEvent_committer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. Timestamp of the commit +func (m *TimelineCommittedEvent_committer) SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.date = value +} +// SetEmail sets the email property value. Git email address of the user +func (m *TimelineCommittedEvent_committer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. Name of the git user +func (m *TimelineCommittedEvent_committer) SetName(value *string)() { + m.name = value +} +type TimelineCommittedEvent_committerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetName()(*string) + SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event_parents.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event_parents.go new file mode 100644 index 000000000..f6c79c36b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event_parents.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TimelineCommittedEvent_parents struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html_url property + html_url *string + // SHA for the commit + sha *string + // The url property + url *string +} +// NewTimelineCommittedEvent_parents instantiates a new TimelineCommittedEvent_parents and sets the default values. +func NewTimelineCommittedEvent_parents()(*TimelineCommittedEvent_parents) { + m := &TimelineCommittedEvent_parents{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCommittedEvent_parentsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCommittedEvent_parentsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCommittedEvent_parents(), 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 *TimelineCommittedEvent_parents) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineCommittedEvent_parents) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TimelineCommittedEvent_parents) GetHtmlUrl()(*string) { + return m.html_url +} +// GetSha gets the sha property value. SHA for the commit +// returns a *string when successful +func (m *TimelineCommittedEvent_parents) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TimelineCommittedEvent_parents) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TimelineCommittedEvent_parents) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TimelineCommittedEvent_parents) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TimelineCommittedEvent_parents) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetSha sets the sha property value. SHA for the commit +func (m *TimelineCommittedEvent_parents) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *TimelineCommittedEvent_parents) SetUrl(value *string)() { + m.url = value +} +type TimelineCommittedEvent_parentsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetSha()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event_tree.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event_tree.go new file mode 100644 index 000000000..7286cc683 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event_tree.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TimelineCommittedEvent_tree 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 for the commit + sha *string + // The url property + url *string +} +// NewTimelineCommittedEvent_tree instantiates a new TimelineCommittedEvent_tree and sets the default values. +func NewTimelineCommittedEvent_tree()(*TimelineCommittedEvent_tree) { + m := &TimelineCommittedEvent_tree{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCommittedEvent_treeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCommittedEvent_treeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCommittedEvent_tree(), 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 *TimelineCommittedEvent_tree) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineCommittedEvent_tree) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. SHA for the commit +// returns a *string when successful +func (m *TimelineCommittedEvent_tree) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TimelineCommittedEvent_tree) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TimelineCommittedEvent_tree) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TimelineCommittedEvent_tree) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. SHA for the commit +func (m *TimelineCommittedEvent_tree) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *TimelineCommittedEvent_tree) SetUrl(value *string)() { + m.url = value +} +type TimelineCommittedEvent_treeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event_verification.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event_verification.go new file mode 100644 index 000000000..8d14cad80 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_committed_event_verification.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TimelineCommittedEvent_verification struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The payload property + payload *string + // The reason property + reason *string + // The signature property + signature *string + // The verified property + verified *bool +} +// NewTimelineCommittedEvent_verification instantiates a new TimelineCommittedEvent_verification and sets the default values. +func NewTimelineCommittedEvent_verification()(*TimelineCommittedEvent_verification) { + m := &TimelineCommittedEvent_verification{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCommittedEvent_verificationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCommittedEvent_verificationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCommittedEvent_verification(), 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 *TimelineCommittedEvent_verification) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineCommittedEvent_verification) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPayload(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["signature"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSignature(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + return res +} +// GetPayload gets the payload property value. The payload property +// returns a *string when successful +func (m *TimelineCommittedEvent_verification) GetPayload()(*string) { + return m.payload +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *TimelineCommittedEvent_verification) GetReason()(*string) { + return m.reason +} +// GetSignature gets the signature property value. The signature property +// returns a *string when successful +func (m *TimelineCommittedEvent_verification) GetSignature()(*string) { + return m.signature +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *TimelineCommittedEvent_verification) GetVerified()(*bool) { + return m.verified +} +// Serialize serializes information the current object +func (m *TimelineCommittedEvent_verification) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("payload", m.GetPayload()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("signature", m.GetSignature()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + 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 *TimelineCommittedEvent_verification) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPayload sets the payload property value. The payload property +func (m *TimelineCommittedEvent_verification) SetPayload(value *string)() { + m.payload = value +} +// SetReason sets the reason property value. The reason property +func (m *TimelineCommittedEvent_verification) SetReason(value *string)() { + m.reason = value +} +// SetSignature sets the signature property value. The signature property +func (m *TimelineCommittedEvent_verification) SetSignature(value *string)() { + m.signature = value +} +// SetVerified sets the verified property value. The verified property +func (m *TimelineCommittedEvent_verification) SetVerified(value *bool)() { + m.verified = value +} +type TimelineCommittedEvent_verificationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPayload()(*string) + GetReason()(*string) + GetSignature()(*string) + GetVerified()(*bool) + SetPayload(value *string)() + SetReason(value *string)() + SetSignature(value *string)() + SetVerified(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_cross_referenced_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_cross_referenced_event.go new file mode 100644 index 000000000..30445865a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_cross_referenced_event.go @@ -0,0 +1,198 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineCrossReferencedEvent timeline Cross Referenced Event +type TimelineCrossReferencedEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The event property + event *string + // The source property + source TimelineCrossReferencedEvent_sourceable + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewTimelineCrossReferencedEvent instantiates a new TimelineCrossReferencedEvent and sets the default values. +func NewTimelineCrossReferencedEvent()(*TimelineCrossReferencedEvent) { + m := &TimelineCrossReferencedEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCrossReferencedEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCrossReferencedEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCrossReferencedEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TimelineCrossReferencedEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *TimelineCrossReferencedEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *TimelineCrossReferencedEvent) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *TimelineCrossReferencedEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineCrossReferencedEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTimelineCrossReferencedEvent_sourceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSource(val.(TimelineCrossReferencedEvent_sourceable)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetSource gets the source property value. The source property +// returns a TimelineCrossReferencedEvent_sourceable when successful +func (m *TimelineCrossReferencedEvent) GetSource()(TimelineCrossReferencedEvent_sourceable) { + return m.source +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *TimelineCrossReferencedEvent) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *TimelineCrossReferencedEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("source", m.GetSource()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *TimelineCrossReferencedEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *TimelineCrossReferencedEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TimelineCrossReferencedEvent) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *TimelineCrossReferencedEvent) SetEvent(value *string)() { + m.event = value +} +// SetSource sets the source property value. The source property +func (m *TimelineCrossReferencedEvent) SetSource(value TimelineCrossReferencedEvent_sourceable)() { + m.source = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TimelineCrossReferencedEvent) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type TimelineCrossReferencedEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEvent()(*string) + GetSource()(TimelineCrossReferencedEvent_sourceable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetActor(value SimpleUserable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEvent(value *string)() + SetSource(value TimelineCrossReferencedEvent_sourceable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_cross_referenced_event_source.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_cross_referenced_event_source.go new file mode 100644 index 000000000..e0dbbd8f6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_cross_referenced_event_source.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TimelineCrossReferencedEvent_source struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. + issue Issueable + // The type property + typeEscaped *string +} +// NewTimelineCrossReferencedEvent_source instantiates a new TimelineCrossReferencedEvent_source and sets the default values. +func NewTimelineCrossReferencedEvent_source()(*TimelineCrossReferencedEvent_source) { + m := &TimelineCrossReferencedEvent_source{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCrossReferencedEvent_sourceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCrossReferencedEvent_sourceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCrossReferencedEvent_source(), 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 *TimelineCrossReferencedEvent_source) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineCrossReferencedEvent_source) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["issue"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIssue(val.(Issueable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + return res +} +// GetIssue gets the issue property value. Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. +// returns a Issueable when successful +func (m *TimelineCrossReferencedEvent_source) GetIssue()(Issueable) { + return m.issue +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *TimelineCrossReferencedEvent_source) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *TimelineCrossReferencedEvent_source) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("issue", m.GetIssue()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + 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 *TimelineCrossReferencedEvent_source) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIssue sets the issue property value. Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. +func (m *TimelineCrossReferencedEvent_source) SetIssue(value Issueable)() { + m.issue = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *TimelineCrossReferencedEvent_source) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +type TimelineCrossReferencedEvent_sourceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIssue()(Issueable) + GetTypeEscaped()(*string) + SetIssue(value Issueable)() + SetTypeEscaped(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_issue_events.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_issue_events.go new file mode 100644 index 000000000..f48fc5539 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_issue_events.go @@ -0,0 +1,592 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineIssueEvents composed type wrapper for classes AddedToProjectIssueEventable, ConvertedNoteToIssueIssueEventable, DemilestonedIssueEventable, LabeledIssueEventable, LockedIssueEventable, MilestonedIssueEventable, MovedColumnInProjectIssueEventable, RemovedFromProjectIssueEventable, RenamedIssueEventable, ReviewDismissedIssueEventable, ReviewRequestedIssueEventable, ReviewRequestRemovedIssueEventable, StateChangeIssueEventable, TimelineAssignedIssueEventable, TimelineCommentEventable, TimelineCommitCommentedEventable, TimelineCommittedEventable, TimelineCrossReferencedEventable, TimelineLineCommentedEventable, TimelineReviewedEventable, TimelineUnassignedIssueEventable, UnlabeledIssueEventable +type TimelineIssueEvents struct { + // Composed type representation for type AddedToProjectIssueEventable + addedToProjectIssueEvent AddedToProjectIssueEventable + // Composed type representation for type ConvertedNoteToIssueIssueEventable + convertedNoteToIssueIssueEvent ConvertedNoteToIssueIssueEventable + // Composed type representation for type DemilestonedIssueEventable + demilestonedIssueEvent DemilestonedIssueEventable + // Composed type representation for type LabeledIssueEventable + labeledIssueEvent LabeledIssueEventable + // Composed type representation for type LockedIssueEventable + lockedIssueEvent LockedIssueEventable + // Composed type representation for type MilestonedIssueEventable + milestonedIssueEvent MilestonedIssueEventable + // Composed type representation for type MovedColumnInProjectIssueEventable + movedColumnInProjectIssueEvent MovedColumnInProjectIssueEventable + // Composed type representation for type RemovedFromProjectIssueEventable + removedFromProjectIssueEvent RemovedFromProjectIssueEventable + // Composed type representation for type RenamedIssueEventable + renamedIssueEvent RenamedIssueEventable + // Composed type representation for type ReviewDismissedIssueEventable + reviewDismissedIssueEvent ReviewDismissedIssueEventable + // Composed type representation for type ReviewRequestedIssueEventable + reviewRequestedIssueEvent ReviewRequestedIssueEventable + // Composed type representation for type ReviewRequestRemovedIssueEventable + reviewRequestRemovedIssueEvent ReviewRequestRemovedIssueEventable + // Composed type representation for type StateChangeIssueEventable + stateChangeIssueEvent StateChangeIssueEventable + // Composed type representation for type TimelineAssignedIssueEventable + timelineAssignedIssueEvent TimelineAssignedIssueEventable + // Composed type representation for type TimelineCommentEventable + timelineCommentEvent TimelineCommentEventable + // Composed type representation for type TimelineCommitCommentedEventable + timelineCommitCommentedEvent TimelineCommitCommentedEventable + // Composed type representation for type TimelineCommittedEventable + timelineCommittedEvent TimelineCommittedEventable + // Composed type representation for type TimelineCrossReferencedEventable + timelineCrossReferencedEvent TimelineCrossReferencedEventable + // Composed type representation for type TimelineLineCommentedEventable + timelineLineCommentedEvent TimelineLineCommentedEventable + // Composed type representation for type TimelineReviewedEventable + timelineReviewedEvent TimelineReviewedEventable + // Composed type representation for type TimelineUnassignedIssueEventable + timelineUnassignedIssueEvent TimelineUnassignedIssueEventable + // Composed type representation for type UnlabeledIssueEventable + unlabeledIssueEvent UnlabeledIssueEventable +} +// NewTimelineIssueEvents instantiates a new TimelineIssueEvents and sets the default values. +func NewTimelineIssueEvents()(*TimelineIssueEvents) { + m := &TimelineIssueEvents{ + } + return m +} +// CreateTimelineIssueEventsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineIssueEventsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewTimelineIssueEvents() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateAddedToProjectIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(AddedToProjectIssueEventable); ok { + result.SetAddedToProjectIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateConvertedNoteToIssueIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ConvertedNoteToIssueIssueEventable); ok { + result.SetConvertedNoteToIssueIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateDemilestonedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(DemilestonedIssueEventable); ok { + result.SetDemilestonedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateLabeledIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(LabeledIssueEventable); ok { + result.SetLabeledIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateLockedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(LockedIssueEventable); ok { + result.SetLockedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateMilestonedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(MilestonedIssueEventable); ok { + result.SetMilestonedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateMovedColumnInProjectIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(MovedColumnInProjectIssueEventable); ok { + result.SetMovedColumnInProjectIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateRemovedFromProjectIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(RemovedFromProjectIssueEventable); ok { + result.SetRemovedFromProjectIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateRenamedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(RenamedIssueEventable); ok { + result.SetRenamedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateReviewDismissedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ReviewDismissedIssueEventable); ok { + result.SetReviewDismissedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateReviewRequestedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ReviewRequestedIssueEventable); ok { + result.SetReviewRequestedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateReviewRequestRemovedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ReviewRequestRemovedIssueEventable); ok { + result.SetReviewRequestRemovedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateStateChangeIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(StateChangeIssueEventable); ok { + result.SetStateChangeIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTimelineAssignedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(TimelineAssignedIssueEventable); ok { + result.SetTimelineAssignedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTimelineCommentEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(TimelineCommentEventable); ok { + result.SetTimelineCommentEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTimelineCommitCommentedEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(TimelineCommitCommentedEventable); ok { + result.SetTimelineCommitCommentedEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTimelineCommittedEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(TimelineCommittedEventable); ok { + result.SetTimelineCommittedEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTimelineCrossReferencedEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(TimelineCrossReferencedEventable); ok { + result.SetTimelineCrossReferencedEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTimelineLineCommentedEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(TimelineLineCommentedEventable); ok { + result.SetTimelineLineCommentedEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTimelineReviewedEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(TimelineReviewedEventable); ok { + result.SetTimelineReviewedEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTimelineUnassignedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(TimelineUnassignedIssueEventable); ok { + result.SetTimelineUnassignedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateUnlabeledIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(UnlabeledIssueEventable); ok { + result.SetUnlabeledIssueEvent(cast) + } + } + } + return result, nil +} +// GetAddedToProjectIssueEvent gets the addedToProjectIssueEvent property value. Composed type representation for type AddedToProjectIssueEventable +// returns a AddedToProjectIssueEventable when successful +func (m *TimelineIssueEvents) GetAddedToProjectIssueEvent()(AddedToProjectIssueEventable) { + return m.addedToProjectIssueEvent +} +// GetConvertedNoteToIssueIssueEvent gets the convertedNoteToIssueIssueEvent property value. Composed type representation for type ConvertedNoteToIssueIssueEventable +// returns a ConvertedNoteToIssueIssueEventable when successful +func (m *TimelineIssueEvents) GetConvertedNoteToIssueIssueEvent()(ConvertedNoteToIssueIssueEventable) { + return m.convertedNoteToIssueIssueEvent +} +// GetDemilestonedIssueEvent gets the demilestonedIssueEvent property value. Composed type representation for type DemilestonedIssueEventable +// returns a DemilestonedIssueEventable when successful +func (m *TimelineIssueEvents) GetDemilestonedIssueEvent()(DemilestonedIssueEventable) { + return m.demilestonedIssueEvent +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineIssueEvents) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *TimelineIssueEvents) GetIsComposedType()(bool) { + return true +} +// GetLabeledIssueEvent gets the labeledIssueEvent property value. Composed type representation for type LabeledIssueEventable +// returns a LabeledIssueEventable when successful +func (m *TimelineIssueEvents) GetLabeledIssueEvent()(LabeledIssueEventable) { + return m.labeledIssueEvent +} +// GetLockedIssueEvent gets the lockedIssueEvent property value. Composed type representation for type LockedIssueEventable +// returns a LockedIssueEventable when successful +func (m *TimelineIssueEvents) GetLockedIssueEvent()(LockedIssueEventable) { + return m.lockedIssueEvent +} +// GetMilestonedIssueEvent gets the milestonedIssueEvent property value. Composed type representation for type MilestonedIssueEventable +// returns a MilestonedIssueEventable when successful +func (m *TimelineIssueEvents) GetMilestonedIssueEvent()(MilestonedIssueEventable) { + return m.milestonedIssueEvent +} +// GetMovedColumnInProjectIssueEvent gets the movedColumnInProjectIssueEvent property value. Composed type representation for type MovedColumnInProjectIssueEventable +// returns a MovedColumnInProjectIssueEventable when successful +func (m *TimelineIssueEvents) GetMovedColumnInProjectIssueEvent()(MovedColumnInProjectIssueEventable) { + return m.movedColumnInProjectIssueEvent +} +// GetRemovedFromProjectIssueEvent gets the removedFromProjectIssueEvent property value. Composed type representation for type RemovedFromProjectIssueEventable +// returns a RemovedFromProjectIssueEventable when successful +func (m *TimelineIssueEvents) GetRemovedFromProjectIssueEvent()(RemovedFromProjectIssueEventable) { + return m.removedFromProjectIssueEvent +} +// GetRenamedIssueEvent gets the renamedIssueEvent property value. Composed type representation for type RenamedIssueEventable +// returns a RenamedIssueEventable when successful +func (m *TimelineIssueEvents) GetRenamedIssueEvent()(RenamedIssueEventable) { + return m.renamedIssueEvent +} +// GetReviewDismissedIssueEvent gets the reviewDismissedIssueEvent property value. Composed type representation for type ReviewDismissedIssueEventable +// returns a ReviewDismissedIssueEventable when successful +func (m *TimelineIssueEvents) GetReviewDismissedIssueEvent()(ReviewDismissedIssueEventable) { + return m.reviewDismissedIssueEvent +} +// GetReviewRequestedIssueEvent gets the reviewRequestedIssueEvent property value. Composed type representation for type ReviewRequestedIssueEventable +// returns a ReviewRequestedIssueEventable when successful +func (m *TimelineIssueEvents) GetReviewRequestedIssueEvent()(ReviewRequestedIssueEventable) { + return m.reviewRequestedIssueEvent +} +// GetReviewRequestRemovedIssueEvent gets the reviewRequestRemovedIssueEvent property value. Composed type representation for type ReviewRequestRemovedIssueEventable +// returns a ReviewRequestRemovedIssueEventable when successful +func (m *TimelineIssueEvents) GetReviewRequestRemovedIssueEvent()(ReviewRequestRemovedIssueEventable) { + return m.reviewRequestRemovedIssueEvent +} +// GetStateChangeIssueEvent gets the stateChangeIssueEvent property value. Composed type representation for type StateChangeIssueEventable +// returns a StateChangeIssueEventable when successful +func (m *TimelineIssueEvents) GetStateChangeIssueEvent()(StateChangeIssueEventable) { + return m.stateChangeIssueEvent +} +// GetTimelineAssignedIssueEvent gets the timelineAssignedIssueEvent property value. Composed type representation for type TimelineAssignedIssueEventable +// returns a TimelineAssignedIssueEventable when successful +func (m *TimelineIssueEvents) GetTimelineAssignedIssueEvent()(TimelineAssignedIssueEventable) { + return m.timelineAssignedIssueEvent +} +// GetTimelineCommentEvent gets the timelineCommentEvent property value. Composed type representation for type TimelineCommentEventable +// returns a TimelineCommentEventable when successful +func (m *TimelineIssueEvents) GetTimelineCommentEvent()(TimelineCommentEventable) { + return m.timelineCommentEvent +} +// GetTimelineCommitCommentedEvent gets the timelineCommitCommentedEvent property value. Composed type representation for type TimelineCommitCommentedEventable +// returns a TimelineCommitCommentedEventable when successful +func (m *TimelineIssueEvents) GetTimelineCommitCommentedEvent()(TimelineCommitCommentedEventable) { + return m.timelineCommitCommentedEvent +} +// GetTimelineCommittedEvent gets the timelineCommittedEvent property value. Composed type representation for type TimelineCommittedEventable +// returns a TimelineCommittedEventable when successful +func (m *TimelineIssueEvents) GetTimelineCommittedEvent()(TimelineCommittedEventable) { + return m.timelineCommittedEvent +} +// GetTimelineCrossReferencedEvent gets the timelineCrossReferencedEvent property value. Composed type representation for type TimelineCrossReferencedEventable +// returns a TimelineCrossReferencedEventable when successful +func (m *TimelineIssueEvents) GetTimelineCrossReferencedEvent()(TimelineCrossReferencedEventable) { + return m.timelineCrossReferencedEvent +} +// GetTimelineLineCommentedEvent gets the timelineLineCommentedEvent property value. Composed type representation for type TimelineLineCommentedEventable +// returns a TimelineLineCommentedEventable when successful +func (m *TimelineIssueEvents) GetTimelineLineCommentedEvent()(TimelineLineCommentedEventable) { + return m.timelineLineCommentedEvent +} +// GetTimelineReviewedEvent gets the timelineReviewedEvent property value. Composed type representation for type TimelineReviewedEventable +// returns a TimelineReviewedEventable when successful +func (m *TimelineIssueEvents) GetTimelineReviewedEvent()(TimelineReviewedEventable) { + return m.timelineReviewedEvent +} +// GetTimelineUnassignedIssueEvent gets the timelineUnassignedIssueEvent property value. Composed type representation for type TimelineUnassignedIssueEventable +// returns a TimelineUnassignedIssueEventable when successful +func (m *TimelineIssueEvents) GetTimelineUnassignedIssueEvent()(TimelineUnassignedIssueEventable) { + return m.timelineUnassignedIssueEvent +} +// GetUnlabeledIssueEvent gets the unlabeledIssueEvent property value. Composed type representation for type UnlabeledIssueEventable +// returns a UnlabeledIssueEventable when successful +func (m *TimelineIssueEvents) GetUnlabeledIssueEvent()(UnlabeledIssueEventable) { + return m.unlabeledIssueEvent +} +// Serialize serializes information the current object +func (m *TimelineIssueEvents) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAddedToProjectIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetAddedToProjectIssueEvent()) + if err != nil { + return err + } + } else if m.GetConvertedNoteToIssueIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetConvertedNoteToIssueIssueEvent()) + if err != nil { + return err + } + } else if m.GetDemilestonedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetDemilestonedIssueEvent()) + if err != nil { + return err + } + } else if m.GetLabeledIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetLabeledIssueEvent()) + if err != nil { + return err + } + } else if m.GetLockedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetLockedIssueEvent()) + if err != nil { + return err + } + } else if m.GetMilestonedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetMilestonedIssueEvent()) + if err != nil { + return err + } + } else if m.GetMovedColumnInProjectIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetMovedColumnInProjectIssueEvent()) + if err != nil { + return err + } + } else if m.GetRemovedFromProjectIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetRemovedFromProjectIssueEvent()) + if err != nil { + return err + } + } else if m.GetRenamedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetRenamedIssueEvent()) + if err != nil { + return err + } + } else if m.GetReviewDismissedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetReviewDismissedIssueEvent()) + if err != nil { + return err + } + } else if m.GetReviewRequestedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetReviewRequestedIssueEvent()) + if err != nil { + return err + } + } else if m.GetReviewRequestRemovedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetReviewRequestRemovedIssueEvent()) + if err != nil { + return err + } + } else if m.GetStateChangeIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetStateChangeIssueEvent()) + if err != nil { + return err + } + } else if m.GetTimelineAssignedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetTimelineAssignedIssueEvent()) + if err != nil { + return err + } + } else if m.GetTimelineCommentEvent() != nil { + err := writer.WriteObjectValue("", m.GetTimelineCommentEvent()) + if err != nil { + return err + } + } else if m.GetTimelineCommitCommentedEvent() != nil { + err := writer.WriteObjectValue("", m.GetTimelineCommitCommentedEvent()) + if err != nil { + return err + } + } else if m.GetTimelineCommittedEvent() != nil { + err := writer.WriteObjectValue("", m.GetTimelineCommittedEvent()) + if err != nil { + return err + } + } else if m.GetTimelineCrossReferencedEvent() != nil { + err := writer.WriteObjectValue("", m.GetTimelineCrossReferencedEvent()) + if err != nil { + return err + } + } else if m.GetTimelineLineCommentedEvent() != nil { + err := writer.WriteObjectValue("", m.GetTimelineLineCommentedEvent()) + if err != nil { + return err + } + } else if m.GetTimelineReviewedEvent() != nil { + err := writer.WriteObjectValue("", m.GetTimelineReviewedEvent()) + if err != nil { + return err + } + } else if m.GetTimelineUnassignedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetTimelineUnassignedIssueEvent()) + if err != nil { + return err + } + } else if m.GetUnlabeledIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetUnlabeledIssueEvent()) + if err != nil { + return err + } + } + return nil +} +// SetAddedToProjectIssueEvent sets the addedToProjectIssueEvent property value. Composed type representation for type AddedToProjectIssueEventable +func (m *TimelineIssueEvents) SetAddedToProjectIssueEvent(value AddedToProjectIssueEventable)() { + m.addedToProjectIssueEvent = value +} +// SetConvertedNoteToIssueIssueEvent sets the convertedNoteToIssueIssueEvent property value. Composed type representation for type ConvertedNoteToIssueIssueEventable +func (m *TimelineIssueEvents) SetConvertedNoteToIssueIssueEvent(value ConvertedNoteToIssueIssueEventable)() { + m.convertedNoteToIssueIssueEvent = value +} +// SetDemilestonedIssueEvent sets the demilestonedIssueEvent property value. Composed type representation for type DemilestonedIssueEventable +func (m *TimelineIssueEvents) SetDemilestonedIssueEvent(value DemilestonedIssueEventable)() { + m.demilestonedIssueEvent = value +} +// SetLabeledIssueEvent sets the labeledIssueEvent property value. Composed type representation for type LabeledIssueEventable +func (m *TimelineIssueEvents) SetLabeledIssueEvent(value LabeledIssueEventable)() { + m.labeledIssueEvent = value +} +// SetLockedIssueEvent sets the lockedIssueEvent property value. Composed type representation for type LockedIssueEventable +func (m *TimelineIssueEvents) SetLockedIssueEvent(value LockedIssueEventable)() { + m.lockedIssueEvent = value +} +// SetMilestonedIssueEvent sets the milestonedIssueEvent property value. Composed type representation for type MilestonedIssueEventable +func (m *TimelineIssueEvents) SetMilestonedIssueEvent(value MilestonedIssueEventable)() { + m.milestonedIssueEvent = value +} +// SetMovedColumnInProjectIssueEvent sets the movedColumnInProjectIssueEvent property value. Composed type representation for type MovedColumnInProjectIssueEventable +func (m *TimelineIssueEvents) SetMovedColumnInProjectIssueEvent(value MovedColumnInProjectIssueEventable)() { + m.movedColumnInProjectIssueEvent = value +} +// SetRemovedFromProjectIssueEvent sets the removedFromProjectIssueEvent property value. Composed type representation for type RemovedFromProjectIssueEventable +func (m *TimelineIssueEvents) SetRemovedFromProjectIssueEvent(value RemovedFromProjectIssueEventable)() { + m.removedFromProjectIssueEvent = value +} +// SetRenamedIssueEvent sets the renamedIssueEvent property value. Composed type representation for type RenamedIssueEventable +func (m *TimelineIssueEvents) SetRenamedIssueEvent(value RenamedIssueEventable)() { + m.renamedIssueEvent = value +} +// SetReviewDismissedIssueEvent sets the reviewDismissedIssueEvent property value. Composed type representation for type ReviewDismissedIssueEventable +func (m *TimelineIssueEvents) SetReviewDismissedIssueEvent(value ReviewDismissedIssueEventable)() { + m.reviewDismissedIssueEvent = value +} +// SetReviewRequestedIssueEvent sets the reviewRequestedIssueEvent property value. Composed type representation for type ReviewRequestedIssueEventable +func (m *TimelineIssueEvents) SetReviewRequestedIssueEvent(value ReviewRequestedIssueEventable)() { + m.reviewRequestedIssueEvent = value +} +// SetReviewRequestRemovedIssueEvent sets the reviewRequestRemovedIssueEvent property value. Composed type representation for type ReviewRequestRemovedIssueEventable +func (m *TimelineIssueEvents) SetReviewRequestRemovedIssueEvent(value ReviewRequestRemovedIssueEventable)() { + m.reviewRequestRemovedIssueEvent = value +} +// SetStateChangeIssueEvent sets the stateChangeIssueEvent property value. Composed type representation for type StateChangeIssueEventable +func (m *TimelineIssueEvents) SetStateChangeIssueEvent(value StateChangeIssueEventable)() { + m.stateChangeIssueEvent = value +} +// SetTimelineAssignedIssueEvent sets the timelineAssignedIssueEvent property value. Composed type representation for type TimelineAssignedIssueEventable +func (m *TimelineIssueEvents) SetTimelineAssignedIssueEvent(value TimelineAssignedIssueEventable)() { + m.timelineAssignedIssueEvent = value +} +// SetTimelineCommentEvent sets the timelineCommentEvent property value. Composed type representation for type TimelineCommentEventable +func (m *TimelineIssueEvents) SetTimelineCommentEvent(value TimelineCommentEventable)() { + m.timelineCommentEvent = value +} +// SetTimelineCommitCommentedEvent sets the timelineCommitCommentedEvent property value. Composed type representation for type TimelineCommitCommentedEventable +func (m *TimelineIssueEvents) SetTimelineCommitCommentedEvent(value TimelineCommitCommentedEventable)() { + m.timelineCommitCommentedEvent = value +} +// SetTimelineCommittedEvent sets the timelineCommittedEvent property value. Composed type representation for type TimelineCommittedEventable +func (m *TimelineIssueEvents) SetTimelineCommittedEvent(value TimelineCommittedEventable)() { + m.timelineCommittedEvent = value +} +// SetTimelineCrossReferencedEvent sets the timelineCrossReferencedEvent property value. Composed type representation for type TimelineCrossReferencedEventable +func (m *TimelineIssueEvents) SetTimelineCrossReferencedEvent(value TimelineCrossReferencedEventable)() { + m.timelineCrossReferencedEvent = value +} +// SetTimelineLineCommentedEvent sets the timelineLineCommentedEvent property value. Composed type representation for type TimelineLineCommentedEventable +func (m *TimelineIssueEvents) SetTimelineLineCommentedEvent(value TimelineLineCommentedEventable)() { + m.timelineLineCommentedEvent = value +} +// SetTimelineReviewedEvent sets the timelineReviewedEvent property value. Composed type representation for type TimelineReviewedEventable +func (m *TimelineIssueEvents) SetTimelineReviewedEvent(value TimelineReviewedEventable)() { + m.timelineReviewedEvent = value +} +// SetTimelineUnassignedIssueEvent sets the timelineUnassignedIssueEvent property value. Composed type representation for type TimelineUnassignedIssueEventable +func (m *TimelineIssueEvents) SetTimelineUnassignedIssueEvent(value TimelineUnassignedIssueEventable)() { + m.timelineUnassignedIssueEvent = value +} +// SetUnlabeledIssueEvent sets the unlabeledIssueEvent property value. Composed type representation for type UnlabeledIssueEventable +func (m *TimelineIssueEvents) SetUnlabeledIssueEvent(value UnlabeledIssueEventable)() { + m.unlabeledIssueEvent = value +} +type TimelineIssueEventsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAddedToProjectIssueEvent()(AddedToProjectIssueEventable) + GetConvertedNoteToIssueIssueEvent()(ConvertedNoteToIssueIssueEventable) + GetDemilestonedIssueEvent()(DemilestonedIssueEventable) + GetLabeledIssueEvent()(LabeledIssueEventable) + GetLockedIssueEvent()(LockedIssueEventable) + GetMilestonedIssueEvent()(MilestonedIssueEventable) + GetMovedColumnInProjectIssueEvent()(MovedColumnInProjectIssueEventable) + GetRemovedFromProjectIssueEvent()(RemovedFromProjectIssueEventable) + GetRenamedIssueEvent()(RenamedIssueEventable) + GetReviewDismissedIssueEvent()(ReviewDismissedIssueEventable) + GetReviewRequestedIssueEvent()(ReviewRequestedIssueEventable) + GetReviewRequestRemovedIssueEvent()(ReviewRequestRemovedIssueEventable) + GetStateChangeIssueEvent()(StateChangeIssueEventable) + GetTimelineAssignedIssueEvent()(TimelineAssignedIssueEventable) + GetTimelineCommentEvent()(TimelineCommentEventable) + GetTimelineCommitCommentedEvent()(TimelineCommitCommentedEventable) + GetTimelineCommittedEvent()(TimelineCommittedEventable) + GetTimelineCrossReferencedEvent()(TimelineCrossReferencedEventable) + GetTimelineLineCommentedEvent()(TimelineLineCommentedEventable) + GetTimelineReviewedEvent()(TimelineReviewedEventable) + GetTimelineUnassignedIssueEvent()(TimelineUnassignedIssueEventable) + GetUnlabeledIssueEvent()(UnlabeledIssueEventable) + SetAddedToProjectIssueEvent(value AddedToProjectIssueEventable)() + SetConvertedNoteToIssueIssueEvent(value ConvertedNoteToIssueIssueEventable)() + SetDemilestonedIssueEvent(value DemilestonedIssueEventable)() + SetLabeledIssueEvent(value LabeledIssueEventable)() + SetLockedIssueEvent(value LockedIssueEventable)() + SetMilestonedIssueEvent(value MilestonedIssueEventable)() + SetMovedColumnInProjectIssueEvent(value MovedColumnInProjectIssueEventable)() + SetRemovedFromProjectIssueEvent(value RemovedFromProjectIssueEventable)() + SetRenamedIssueEvent(value RenamedIssueEventable)() + SetReviewDismissedIssueEvent(value ReviewDismissedIssueEventable)() + SetReviewRequestedIssueEvent(value ReviewRequestedIssueEventable)() + SetReviewRequestRemovedIssueEvent(value ReviewRequestRemovedIssueEventable)() + SetStateChangeIssueEvent(value StateChangeIssueEventable)() + SetTimelineAssignedIssueEvent(value TimelineAssignedIssueEventable)() + SetTimelineCommentEvent(value TimelineCommentEventable)() + SetTimelineCommitCommentedEvent(value TimelineCommitCommentedEventable)() + SetTimelineCommittedEvent(value TimelineCommittedEventable)() + SetTimelineCrossReferencedEvent(value TimelineCrossReferencedEventable)() + SetTimelineLineCommentedEvent(value TimelineLineCommentedEventable)() + SetTimelineReviewedEvent(value TimelineReviewedEventable)() + SetTimelineUnassignedIssueEvent(value TimelineUnassignedIssueEventable)() + SetUnlabeledIssueEvent(value UnlabeledIssueEventable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_line_commented_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_line_commented_event.go new file mode 100644 index 000000000..998052a6d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_line_commented_event.go @@ -0,0 +1,151 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineLineCommentedEvent timeline Line Commented Event +type TimelineLineCommentedEvent struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The comments property + comments []PullRequestReviewCommentable + // The event property + event *string + // The node_id property + node_id *string +} +// NewTimelineLineCommentedEvent instantiates a new TimelineLineCommentedEvent and sets the default values. +func NewTimelineLineCommentedEvent()(*TimelineLineCommentedEvent) { + m := &TimelineLineCommentedEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineLineCommentedEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineLineCommentedEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineLineCommentedEvent(), 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 *TimelineLineCommentedEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComments gets the comments property value. The comments property +// returns a []PullRequestReviewCommentable when successful +func (m *TimelineLineCommentedEvent) GetComments()([]PullRequestReviewCommentable) { + return m.comments +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *TimelineLineCommentedEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineLineCommentedEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePullRequestReviewCommentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PullRequestReviewCommentable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PullRequestReviewCommentable) + } + } + m.SetComments(res) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + return res +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TimelineLineCommentedEvent) GetNodeId()(*string) { + return m.node_id +} +// Serialize serializes information the current object +func (m *TimelineLineCommentedEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetComments() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetComments())) + for i, v := range m.GetComments() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("comments", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + 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 *TimelineLineCommentedEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComments sets the comments property value. The comments property +func (m *TimelineLineCommentedEvent) SetComments(value []PullRequestReviewCommentable)() { + m.comments = value +} +// SetEvent sets the event property value. The event property +func (m *TimelineLineCommentedEvent) SetEvent(value *string)() { + m.event = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TimelineLineCommentedEvent) SetNodeId(value *string)() { + m.node_id = value +} +type TimelineLineCommentedEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComments()([]PullRequestReviewCommentable) + GetEvent()(*string) + GetNodeId()(*string) + SetComments(value []PullRequestReviewCommentable)() + SetEvent(value *string)() + SetNodeId(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_reviewed_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_reviewed_event.go new file mode 100644 index 000000000..fbd750523 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_reviewed_event.go @@ -0,0 +1,460 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineReviewedEvent timeline Reviewed Event +type TimelineReviewedEvent struct { + // The _links property + _links TimelineReviewedEvent__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How the author is associated with the repository. + author_association *AuthorAssociation + // The text of the review. + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // A commit SHA for the review. + commit_id *string + // The event property + event *string + // The html_url property + html_url *string + // Unique identifier of the review + id *int32 + // The node_id property + node_id *string + // The pull_request_url property + pull_request_url *string + // The state property + state *string + // The submitted_at property + submitted_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + user SimpleUserable +} +// NewTimelineReviewedEvent instantiates a new TimelineReviewedEvent and sets the default values. +func NewTimelineReviewedEvent()(*TimelineReviewedEvent) { + m := &TimelineReviewedEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineReviewedEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineReviewedEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineReviewedEvent(), 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 *TimelineReviewedEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *TimelineReviewedEvent) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. The text of the review. +// returns a *string when successful +func (m *TimelineReviewedEvent) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *TimelineReviewedEvent) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *TimelineReviewedEvent) GetBodyText()(*string) { + return m.body_text +} +// GetCommitId gets the commit_id property value. A commit SHA for the review. +// returns a *string when successful +func (m *TimelineReviewedEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *TimelineReviewedEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineReviewedEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTimelineReviewedEvent__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(TimelineReviewedEvent__linksable)) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["pull_request_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestUrl(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["submitted_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetSubmittedAt(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(SimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TimelineReviewedEvent) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the review +// returns a *int32 when successful +func (m *TimelineReviewedEvent) GetId()(*int32) { + return m.id +} +// GetLinks gets the _links property value. The _links property +// returns a TimelineReviewedEvent__linksable when successful +func (m *TimelineReviewedEvent) GetLinks()(TimelineReviewedEvent__linksable) { + return m._links +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TimelineReviewedEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPullRequestUrl gets the pull_request_url property value. The pull_request_url property +// returns a *string when successful +func (m *TimelineReviewedEvent) GetPullRequestUrl()(*string) { + return m.pull_request_url +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *TimelineReviewedEvent) GetState()(*string) { + return m.state +} +// GetSubmittedAt gets the submitted_at property value. The submitted_at property +// returns a *Time when successful +func (m *TimelineReviewedEvent) GetSubmittedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.submitted_at +} +// GetUser gets the user property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TimelineReviewedEvent) GetUser()(SimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *TimelineReviewedEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pull_request_url", m.GetPullRequestUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("submitted_at", m.GetSubmittedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *TimelineReviewedEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *TimelineReviewedEvent) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. The text of the review. +func (m *TimelineReviewedEvent) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *TimelineReviewedEvent) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *TimelineReviewedEvent) SetBodyText(value *string)() { + m.body_text = value +} +// SetCommitId sets the commit_id property value. A commit SHA for the review. +func (m *TimelineReviewedEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetEvent sets the event property value. The event property +func (m *TimelineReviewedEvent) SetEvent(value *string)() { + m.event = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TimelineReviewedEvent) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the review +func (m *TimelineReviewedEvent) SetId(value *int32)() { + m.id = value +} +// SetLinks sets the _links property value. The _links property +func (m *TimelineReviewedEvent) SetLinks(value TimelineReviewedEvent__linksable)() { + m._links = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TimelineReviewedEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPullRequestUrl sets the pull_request_url property value. The pull_request_url property +func (m *TimelineReviewedEvent) SetPullRequestUrl(value *string)() { + m.pull_request_url = value +} +// SetState sets the state property value. The state property +func (m *TimelineReviewedEvent) SetState(value *string)() { + m.state = value +} +// SetSubmittedAt sets the submitted_at property value. The submitted_at property +func (m *TimelineReviewedEvent) SetSubmittedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.submitted_at = value +} +// SetUser sets the user property value. A GitHub user. +func (m *TimelineReviewedEvent) SetUser(value SimpleUserable)() { + m.user = value +} +type TimelineReviewedEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetCommitId()(*string) + GetEvent()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLinks()(TimelineReviewedEvent__linksable) + GetNodeId()(*string) + GetPullRequestUrl()(*string) + GetState()(*string) + GetSubmittedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUser()(SimpleUserable) + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetCommitId(value *string)() + SetEvent(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLinks(value TimelineReviewedEvent__linksable)() + SetNodeId(value *string)() + SetPullRequestUrl(value *string)() + SetState(value *string)() + SetSubmittedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUser(value SimpleUserable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_reviewed_event__links.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_reviewed_event__links.go new file mode 100644 index 000000000..74e93ddf7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_reviewed_event__links.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TimelineReviewedEvent__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html property + html TimelineReviewedEvent__links_htmlable + // The pull_request property + pull_request TimelineReviewedEvent__links_pull_requestable +} +// NewTimelineReviewedEvent__links instantiates a new TimelineReviewedEvent__links and sets the default values. +func NewTimelineReviewedEvent__links()(*TimelineReviewedEvent__links) { + m := &TimelineReviewedEvent__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineReviewedEvent__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineReviewedEvent__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineReviewedEvent__links(), 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 *TimelineReviewedEvent__links) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineReviewedEvent__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTimelineReviewedEvent__links_htmlFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHtml(val.(TimelineReviewedEvent__links_htmlable)) + } + return nil + } + res["pull_request"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTimelineReviewedEvent__links_pull_requestFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPullRequest(val.(TimelineReviewedEvent__links_pull_requestable)) + } + return nil + } + return res +} +// GetHtml gets the html property value. The html property +// returns a TimelineReviewedEvent__links_htmlable when successful +func (m *TimelineReviewedEvent__links) GetHtml()(TimelineReviewedEvent__links_htmlable) { + return m.html +} +// GetPullRequest gets the pull_request property value. The pull_request property +// returns a TimelineReviewedEvent__links_pull_requestable when successful +func (m *TimelineReviewedEvent__links) GetPullRequest()(TimelineReviewedEvent__links_pull_requestable) { + return m.pull_request +} +// Serialize serializes information the current object +func (m *TimelineReviewedEvent__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pull_request", m.GetPullRequest()) + 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 *TimelineReviewedEvent__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtml sets the html property value. The html property +func (m *TimelineReviewedEvent__links) SetHtml(value TimelineReviewedEvent__links_htmlable)() { + m.html = value +} +// SetPullRequest sets the pull_request property value. The pull_request property +func (m *TimelineReviewedEvent__links) SetPullRequest(value TimelineReviewedEvent__links_pull_requestable)() { + m.pull_request = value +} +type TimelineReviewedEvent__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtml()(TimelineReviewedEvent__links_htmlable) + GetPullRequest()(TimelineReviewedEvent__links_pull_requestable) + SetHtml(value TimelineReviewedEvent__links_htmlable)() + SetPullRequest(value TimelineReviewedEvent__links_pull_requestable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_reviewed_event__links_html.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_reviewed_event__links_html.go new file mode 100644 index 000000000..c886137f7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_reviewed_event__links_html.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TimelineReviewedEvent__links_html struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The href property + href *string +} +// NewTimelineReviewedEvent__links_html instantiates a new TimelineReviewedEvent__links_html and sets the default values. +func NewTimelineReviewedEvent__links_html()(*TimelineReviewedEvent__links_html) { + m := &TimelineReviewedEvent__links_html{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineReviewedEvent__links_htmlFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineReviewedEvent__links_htmlFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineReviewedEvent__links_html(), 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 *TimelineReviewedEvent__links_html) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineReviewedEvent__links_html) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *TimelineReviewedEvent__links_html) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *TimelineReviewedEvent__links_html) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *TimelineReviewedEvent__links_html) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *TimelineReviewedEvent__links_html) SetHref(value *string)() { + m.href = value +} +type TimelineReviewedEvent__links_htmlable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_reviewed_event__links_pull_request.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_reviewed_event__links_pull_request.go new file mode 100644 index 000000000..d8d35c278 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_reviewed_event__links_pull_request.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TimelineReviewedEvent__links_pull_request struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The href property + href *string +} +// NewTimelineReviewedEvent__links_pull_request instantiates a new TimelineReviewedEvent__links_pull_request and sets the default values. +func NewTimelineReviewedEvent__links_pull_request()(*TimelineReviewedEvent__links_pull_request) { + m := &TimelineReviewedEvent__links_pull_request{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineReviewedEvent__links_pull_requestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineReviewedEvent__links_pull_requestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineReviewedEvent__links_pull_request(), 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 *TimelineReviewedEvent__links_pull_request) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineReviewedEvent__links_pull_request) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *TimelineReviewedEvent__links_pull_request) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *TimelineReviewedEvent__links_pull_request) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *TimelineReviewedEvent__links_pull_request) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *TimelineReviewedEvent__links_pull_request) SetHref(value *string)() { + m.href = value +} +type TimelineReviewedEvent__links_pull_requestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_unassigned_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_unassigned_issue_event.go new file mode 100644 index 000000000..228839d63 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/timeline_unassigned_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineUnassignedIssueEvent timeline Unassigned Issue Event +type TimelineUnassignedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee SimpleUserable + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewTimelineUnassignedIssueEvent instantiates a new TimelineUnassignedIssueEvent and sets the default values. +func NewTimelineUnassignedIssueEvent()(*TimelineUnassignedIssueEvent) { + m := &TimelineUnassignedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineUnassignedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineUnassignedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineUnassignedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TimelineUnassignedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *TimelineUnassignedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TimelineUnassignedIssueEvent) GetAssignee()(SimpleUserable) { + return m.assignee +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *TimelineUnassignedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *TimelineUnassignedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *TimelineUnassignedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *TimelineUnassignedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineUnassignedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *TimelineUnassignedIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TimelineUnassignedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *TimelineUnassignedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TimelineUnassignedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TimelineUnassignedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *TimelineUnassignedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *TimelineUnassignedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *TimelineUnassignedIssueEvent) SetAssignee(value SimpleUserable)() { + m.assignee = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *TimelineUnassignedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *TimelineUnassignedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TimelineUnassignedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *TimelineUnassignedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *TimelineUnassignedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TimelineUnassignedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *TimelineUnassignedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *TimelineUnassignedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type TimelineUnassignedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetAssignee()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetAssignee(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/topic.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/topic.go new file mode 100644 index 000000000..86b2eba81 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/topic.go @@ -0,0 +1,87 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Topic a topic aggregates entities that are related to a subject. +type Topic struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The names property + names []string +} +// NewTopic instantiates a new Topic and sets the default values. +func NewTopic()(*Topic) { + m := &Topic{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopicFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopicFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopic(), 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 *Topic) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Topic) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["names"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetNames(res) + } + return nil + } + return res +} +// GetNames gets the names property value. The names property +// returns a []string when successful +func (m *Topic) GetNames()([]string) { + return m.names +} +// Serialize serializes information the current object +func (m *Topic) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetNames() != nil { + err := writer.WriteCollectionOfStringValues("names", m.GetNames()) + 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 *Topic) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNames sets the names property value. The names property +func (m *Topic) SetNames(value []string)() { + m.names = value +} +type Topicable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNames()([]string) + SetNames(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/topic_search_result_item.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/topic_search_result_item.go new file mode 100644 index 000000000..909ee4378 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/topic_search_result_item.go @@ -0,0 +1,553 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TopicSearchResultItem topic Search Result Item +type TopicSearchResultItem struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The aliases property + aliases []TopicSearchResultItem_aliasesable + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The created_by property + created_by *string + // The curated property + curated *bool + // The description property + description *string + // The display_name property + display_name *string + // The featured property + featured *bool + // The logo_url property + logo_url *string + // The name property + name *string + // The related property + related []TopicSearchResultItem_relatedable + // The released property + released *string + // The repository_count property + repository_count *int32 + // The score property + score *float64 + // The short_description property + short_description *string + // The text_matches property + text_matches []Topicsable + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewTopicSearchResultItem instantiates a new TopicSearchResultItem and sets the default values. +func NewTopicSearchResultItem()(*TopicSearchResultItem) { + m := &TopicSearchResultItem{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopicSearchResultItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopicSearchResultItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopicSearchResultItem(), 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 *TopicSearchResultItem) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAliases gets the aliases property value. The aliases property +// returns a []TopicSearchResultItem_aliasesable when successful +func (m *TopicSearchResultItem) GetAliases()([]TopicSearchResultItem_aliasesable) { + return m.aliases +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *TopicSearchResultItem) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCreatedBy gets the created_by property value. The created_by property +// returns a *string when successful +func (m *TopicSearchResultItem) GetCreatedBy()(*string) { + return m.created_by +} +// GetCurated gets the curated property value. The curated property +// returns a *bool when successful +func (m *TopicSearchResultItem) GetCurated()(*bool) { + return m.curated +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *TopicSearchResultItem) GetDescription()(*string) { + return m.description +} +// GetDisplayName gets the display_name property value. The display_name property +// returns a *string when successful +func (m *TopicSearchResultItem) GetDisplayName()(*string) { + return m.display_name +} +// GetFeatured gets the featured property value. The featured property +// returns a *bool when successful +func (m *TopicSearchResultItem) GetFeatured()(*bool) { + return m.featured +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TopicSearchResultItem) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["aliases"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTopicSearchResultItem_aliasesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]TopicSearchResultItem_aliasesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(TopicSearchResultItem_aliasesable) + } + } + m.SetAliases(res) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["created_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedBy(val) + } + return nil + } + res["curated"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCurated(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["display_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["featured"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFeatured(val) + } + return nil + } + res["logo_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogoUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["related"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTopicSearchResultItem_relatedFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]TopicSearchResultItem_relatedable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(TopicSearchResultItem_relatedable) + } + } + m.SetRelated(res) + } + return nil + } + res["released"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleased(val) + } + return nil + } + res["repository_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryCount(val) + } + return nil + } + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["short_description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetShortDescription(val) + } + return nil + } + res["text_matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTopicsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Topicsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Topicsable) + } + } + m.SetTextMatches(res) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetLogoUrl gets the logo_url property value. The logo_url property +// returns a *string when successful +func (m *TopicSearchResultItem) GetLogoUrl()(*string) { + return m.logo_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *TopicSearchResultItem) GetName()(*string) { + return m.name +} +// GetRelated gets the related property value. The related property +// returns a []TopicSearchResultItem_relatedable when successful +func (m *TopicSearchResultItem) GetRelated()([]TopicSearchResultItem_relatedable) { + return m.related +} +// GetReleased gets the released property value. The released property +// returns a *string when successful +func (m *TopicSearchResultItem) GetReleased()(*string) { + return m.released +} +// GetRepositoryCount gets the repository_count property value. The repository_count property +// returns a *int32 when successful +func (m *TopicSearchResultItem) GetRepositoryCount()(*int32) { + return m.repository_count +} +// GetScore gets the score property value. The score property +// returns a *float64 when successful +func (m *TopicSearchResultItem) GetScore()(*float64) { + return m.score +} +// GetShortDescription gets the short_description property value. The short_description property +// returns a *string when successful +func (m *TopicSearchResultItem) GetShortDescription()(*string) { + return m.short_description +} +// GetTextMatches gets the text_matches property value. The text_matches property +// returns a []Topicsable when successful +func (m *TopicSearchResultItem) GetTextMatches()([]Topicsable) { + return m.text_matches +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *TopicSearchResultItem) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *TopicSearchResultItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAliases() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAliases())) + for i, v := range m.GetAliases() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("aliases", cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_by", m.GetCreatedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("curated", m.GetCurated()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("display_name", m.GetDisplayName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("featured", m.GetFeatured()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("logo_url", m.GetLogoUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetRelated() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRelated())) + for i, v := range m.GetRelated() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("related", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("released", m.GetReleased()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_count", m.GetRepositoryCount()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("score", m.GetScore()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("short_description", m.GetShortDescription()) + if err != nil { + return err + } + } + if m.GetTextMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTextMatches())) + for i, v := range m.GetTextMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("text_matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + 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 *TopicSearchResultItem) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAliases sets the aliases property value. The aliases property +func (m *TopicSearchResultItem) SetAliases(value []TopicSearchResultItem_aliasesable)() { + m.aliases = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TopicSearchResultItem) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCreatedBy sets the created_by property value. The created_by property +func (m *TopicSearchResultItem) SetCreatedBy(value *string)() { + m.created_by = value +} +// SetCurated sets the curated property value. The curated property +func (m *TopicSearchResultItem) SetCurated(value *bool)() { + m.curated = value +} +// SetDescription sets the description property value. The description property +func (m *TopicSearchResultItem) SetDescription(value *string)() { + m.description = value +} +// SetDisplayName sets the display_name property value. The display_name property +func (m *TopicSearchResultItem) SetDisplayName(value *string)() { + m.display_name = value +} +// SetFeatured sets the featured property value. The featured property +func (m *TopicSearchResultItem) SetFeatured(value *bool)() { + m.featured = value +} +// SetLogoUrl sets the logo_url property value. The logo_url property +func (m *TopicSearchResultItem) SetLogoUrl(value *string)() { + m.logo_url = value +} +// SetName sets the name property value. The name property +func (m *TopicSearchResultItem) SetName(value *string)() { + m.name = value +} +// SetRelated sets the related property value. The related property +func (m *TopicSearchResultItem) SetRelated(value []TopicSearchResultItem_relatedable)() { + m.related = value +} +// SetReleased sets the released property value. The released property +func (m *TopicSearchResultItem) SetReleased(value *string)() { + m.released = value +} +// SetRepositoryCount sets the repository_count property value. The repository_count property +func (m *TopicSearchResultItem) SetRepositoryCount(value *int32)() { + m.repository_count = value +} +// SetScore sets the score property value. The score property +func (m *TopicSearchResultItem) SetScore(value *float64)() { + m.score = value +} +// SetShortDescription sets the short_description property value. The short_description property +func (m *TopicSearchResultItem) SetShortDescription(value *string)() { + m.short_description = value +} +// SetTextMatches sets the text_matches property value. The text_matches property +func (m *TopicSearchResultItem) SetTextMatches(value []Topicsable)() { + m.text_matches = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TopicSearchResultItem) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type TopicSearchResultItemable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAliases()([]TopicSearchResultItem_aliasesable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreatedBy()(*string) + GetCurated()(*bool) + GetDescription()(*string) + GetDisplayName()(*string) + GetFeatured()(*bool) + GetLogoUrl()(*string) + GetName()(*string) + GetRelated()([]TopicSearchResultItem_relatedable) + GetReleased()(*string) + GetRepositoryCount()(*int32) + GetScore()(*float64) + GetShortDescription()(*string) + GetTextMatches()([]Topicsable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetAliases(value []TopicSearchResultItem_aliasesable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreatedBy(value *string)() + SetCurated(value *bool)() + SetDescription(value *string)() + SetDisplayName(value *string)() + SetFeatured(value *bool)() + SetLogoUrl(value *string)() + SetName(value *string)() + SetRelated(value []TopicSearchResultItem_relatedable)() + SetReleased(value *string)() + SetRepositoryCount(value *int32)() + SetScore(value *float64)() + SetShortDescription(value *string)() + SetTextMatches(value []Topicsable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/topic_search_result_item_aliases.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/topic_search_result_item_aliases.go new file mode 100644 index 000000000..8e3eabd2a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/topic_search_result_item_aliases.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TopicSearchResultItem_aliases struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The topic_relation property + topic_relation TopicSearchResultItem_aliases_topic_relationable +} +// NewTopicSearchResultItem_aliases instantiates a new TopicSearchResultItem_aliases and sets the default values. +func NewTopicSearchResultItem_aliases()(*TopicSearchResultItem_aliases) { + m := &TopicSearchResultItem_aliases{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopicSearchResultItem_aliasesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopicSearchResultItem_aliasesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopicSearchResultItem_aliases(), 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 *TopicSearchResultItem_aliases) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TopicSearchResultItem_aliases) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["topic_relation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTopicSearchResultItem_aliases_topic_relationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTopicRelation(val.(TopicSearchResultItem_aliases_topic_relationable)) + } + return nil + } + return res +} +// GetTopicRelation gets the topic_relation property value. The topic_relation property +// returns a TopicSearchResultItem_aliases_topic_relationable when successful +func (m *TopicSearchResultItem_aliases) GetTopicRelation()(TopicSearchResultItem_aliases_topic_relationable) { + return m.topic_relation +} +// Serialize serializes information the current object +func (m *TopicSearchResultItem_aliases) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("topic_relation", m.GetTopicRelation()) + 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 *TopicSearchResultItem_aliases) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTopicRelation sets the topic_relation property value. The topic_relation property +func (m *TopicSearchResultItem_aliases) SetTopicRelation(value TopicSearchResultItem_aliases_topic_relationable)() { + m.topic_relation = value +} +type TopicSearchResultItem_aliasesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTopicRelation()(TopicSearchResultItem_aliases_topic_relationable) + SetTopicRelation(value TopicSearchResultItem_aliases_topic_relationable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/topic_search_result_item_aliases_topic_relation.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/topic_search_result_item_aliases_topic_relation.go new file mode 100644 index 000000000..b0027c506 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/topic_search_result_item_aliases_topic_relation.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TopicSearchResultItem_aliases_topic_relation struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 + // The name property + name *string + // The relation_type property + relation_type *string + // The topic_id property + topic_id *int32 +} +// NewTopicSearchResultItem_aliases_topic_relation instantiates a new TopicSearchResultItem_aliases_topic_relation and sets the default values. +func NewTopicSearchResultItem_aliases_topic_relation()(*TopicSearchResultItem_aliases_topic_relation) { + m := &TopicSearchResultItem_aliases_topic_relation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopicSearchResultItem_aliases_topic_relationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopicSearchResultItem_aliases_topic_relationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopicSearchResultItem_aliases_topic_relation(), 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 *TopicSearchResultItem_aliases_topic_relation) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TopicSearchResultItem_aliases_topic_relation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["relation_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRelationType(val) + } + return nil + } + res["topic_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTopicId(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *TopicSearchResultItem_aliases_topic_relation) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *TopicSearchResultItem_aliases_topic_relation) GetName()(*string) { + return m.name +} +// GetRelationType gets the relation_type property value. The relation_type property +// returns a *string when successful +func (m *TopicSearchResultItem_aliases_topic_relation) GetRelationType()(*string) { + return m.relation_type +} +// GetTopicId gets the topic_id property value. The topic_id property +// returns a *int32 when successful +func (m *TopicSearchResultItem_aliases_topic_relation) GetTopicId()(*int32) { + return m.topic_id +} +// Serialize serializes information the current object +func (m *TopicSearchResultItem_aliases_topic_relation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("relation_type", m.GetRelationType()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("topic_id", m.GetTopicId()) + 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 *TopicSearchResultItem_aliases_topic_relation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *TopicSearchResultItem_aliases_topic_relation) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *TopicSearchResultItem_aliases_topic_relation) SetName(value *string)() { + m.name = value +} +// SetRelationType sets the relation_type property value. The relation_type property +func (m *TopicSearchResultItem_aliases_topic_relation) SetRelationType(value *string)() { + m.relation_type = value +} +// SetTopicId sets the topic_id property value. The topic_id property +func (m *TopicSearchResultItem_aliases_topic_relation) SetTopicId(value *int32)() { + m.topic_id = value +} +type TopicSearchResultItem_aliases_topic_relationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetName()(*string) + GetRelationType()(*string) + GetTopicId()(*int32) + SetId(value *int32)() + SetName(value *string)() + SetRelationType(value *string)() + SetTopicId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/topic_search_result_item_related.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/topic_search_result_item_related.go new file mode 100644 index 000000000..0eeb02d97 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/topic_search_result_item_related.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TopicSearchResultItem_related struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The topic_relation property + topic_relation TopicSearchResultItem_related_topic_relationable +} +// NewTopicSearchResultItem_related instantiates a new TopicSearchResultItem_related and sets the default values. +func NewTopicSearchResultItem_related()(*TopicSearchResultItem_related) { + m := &TopicSearchResultItem_related{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopicSearchResultItem_relatedFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopicSearchResultItem_relatedFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopicSearchResultItem_related(), 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 *TopicSearchResultItem_related) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TopicSearchResultItem_related) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["topic_relation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTopicSearchResultItem_related_topic_relationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTopicRelation(val.(TopicSearchResultItem_related_topic_relationable)) + } + return nil + } + return res +} +// GetTopicRelation gets the topic_relation property value. The topic_relation property +// returns a TopicSearchResultItem_related_topic_relationable when successful +func (m *TopicSearchResultItem_related) GetTopicRelation()(TopicSearchResultItem_related_topic_relationable) { + return m.topic_relation +} +// Serialize serializes information the current object +func (m *TopicSearchResultItem_related) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("topic_relation", m.GetTopicRelation()) + 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 *TopicSearchResultItem_related) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTopicRelation sets the topic_relation property value. The topic_relation property +func (m *TopicSearchResultItem_related) SetTopicRelation(value TopicSearchResultItem_related_topic_relationable)() { + m.topic_relation = value +} +type TopicSearchResultItem_relatedable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTopicRelation()(TopicSearchResultItem_related_topic_relationable) + SetTopicRelation(value TopicSearchResultItem_related_topic_relationable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/topic_search_result_item_related_topic_relation.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/topic_search_result_item_related_topic_relation.go new file mode 100644 index 000000000..65cd1bf11 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/topic_search_result_item_related_topic_relation.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TopicSearchResultItem_related_topic_relation struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 + // The name property + name *string + // The relation_type property + relation_type *string + // The topic_id property + topic_id *int32 +} +// NewTopicSearchResultItem_related_topic_relation instantiates a new TopicSearchResultItem_related_topic_relation and sets the default values. +func NewTopicSearchResultItem_related_topic_relation()(*TopicSearchResultItem_related_topic_relation) { + m := &TopicSearchResultItem_related_topic_relation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopicSearchResultItem_related_topic_relationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopicSearchResultItem_related_topic_relationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopicSearchResultItem_related_topic_relation(), 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 *TopicSearchResultItem_related_topic_relation) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TopicSearchResultItem_related_topic_relation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["relation_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRelationType(val) + } + return nil + } + res["topic_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTopicId(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *TopicSearchResultItem_related_topic_relation) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *TopicSearchResultItem_related_topic_relation) GetName()(*string) { + return m.name +} +// GetRelationType gets the relation_type property value. The relation_type property +// returns a *string when successful +func (m *TopicSearchResultItem_related_topic_relation) GetRelationType()(*string) { + return m.relation_type +} +// GetTopicId gets the topic_id property value. The topic_id property +// returns a *int32 when successful +func (m *TopicSearchResultItem_related_topic_relation) GetTopicId()(*int32) { + return m.topic_id +} +// Serialize serializes information the current object +func (m *TopicSearchResultItem_related_topic_relation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("relation_type", m.GetRelationType()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("topic_id", m.GetTopicId()) + 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 *TopicSearchResultItem_related_topic_relation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *TopicSearchResultItem_related_topic_relation) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *TopicSearchResultItem_related_topic_relation) SetName(value *string)() { + m.name = value +} +// SetRelationType sets the relation_type property value. The relation_type property +func (m *TopicSearchResultItem_related_topic_relation) SetRelationType(value *string)() { + m.relation_type = value +} +// SetTopicId sets the topic_id property value. The topic_id property +func (m *TopicSearchResultItem_related_topic_relation) SetTopicId(value *int32)() { + m.topic_id = value +} +type TopicSearchResultItem_related_topic_relationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetName()(*string) + GetRelationType()(*string) + GetTopicId()(*int32) + SetId(value *int32)() + SetName(value *string)() + SetRelationType(value *string)() + SetTopicId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/topics.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/topics.go new file mode 100644 index 000000000..981a379f7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/topics.go @@ -0,0 +1,208 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Topics struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The fragment property + fragment *string + // The matches property + matches []Topics_matchesable + // The object_type property + object_type *string + // The object_url property + object_url *string + // The property property + property *string +} +// NewTopics instantiates a new Topics and sets the default values. +func NewTopics()(*Topics) { + m := &Topics{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopicsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopicsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopics(), 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 *Topics) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Topics) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["fragment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFragment(val) + } + return nil + } + res["matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTopics_matchesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Topics_matchesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Topics_matchesable) + } + } + m.SetMatches(res) + } + return nil + } + res["object_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectType(val) + } + return nil + } + res["object_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectUrl(val) + } + return nil + } + res["property"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProperty(val) + } + return nil + } + return res +} +// GetFragment gets the fragment property value. The fragment property +// returns a *string when successful +func (m *Topics) GetFragment()(*string) { + return m.fragment +} +// GetMatches gets the matches property value. The matches property +// returns a []Topics_matchesable when successful +func (m *Topics) GetMatches()([]Topics_matchesable) { + return m.matches +} +// GetObjectType gets the object_type property value. The object_type property +// returns a *string when successful +func (m *Topics) GetObjectType()(*string) { + return m.object_type +} +// GetObjectUrl gets the object_url property value. The object_url property +// returns a *string when successful +func (m *Topics) GetObjectUrl()(*string) { + return m.object_url +} +// GetProperty gets the property property value. The property property +// returns a *string when successful +func (m *Topics) GetProperty()(*string) { + return m.property +} +// Serialize serializes information the current object +func (m *Topics) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("fragment", m.GetFragment()) + if err != nil { + return err + } + } + if m.GetMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMatches())) + for i, v := range m.GetMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_type", m.GetObjectType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_url", m.GetObjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("property", m.GetProperty()) + 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 *Topics) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFragment sets the fragment property value. The fragment property +func (m *Topics) SetFragment(value *string)() { + m.fragment = value +} +// SetMatches sets the matches property value. The matches property +func (m *Topics) SetMatches(value []Topics_matchesable)() { + m.matches = value +} +// SetObjectType sets the object_type property value. The object_type property +func (m *Topics) SetObjectType(value *string)() { + m.object_type = value +} +// SetObjectUrl sets the object_url property value. The object_url property +func (m *Topics) SetObjectUrl(value *string)() { + m.object_url = value +} +// SetProperty sets the property property value. The property property +func (m *Topics) SetProperty(value *string)() { + m.property = value +} +type Topicsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFragment()(*string) + GetMatches()([]Topics_matchesable) + GetObjectType()(*string) + GetObjectUrl()(*string) + GetProperty()(*string) + SetFragment(value *string)() + SetMatches(value []Topics_matchesable)() + SetObjectType(value *string)() + SetObjectUrl(value *string)() + SetProperty(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/topics_matches.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/topics_matches.go new file mode 100644 index 000000000..7c500d494 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/topics_matches.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Topics_matches struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The indices property + indices []int32 + // The text property + text *string +} +// NewTopics_matches instantiates a new Topics_matches and sets the default values. +func NewTopics_matches()(*Topics_matches) { + m := &Topics_matches{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopics_matchesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopics_matchesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopics_matches(), 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 *Topics_matches) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Topics_matches) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["indices"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetIndices(res) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetIndices gets the indices property value. The indices property +// returns a []int32 when successful +func (m *Topics_matches) GetIndices()([]int32) { + return m.indices +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *Topics_matches) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *Topics_matches) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIndices() != nil { + err := writer.WriteCollectionOfInt32Values("indices", m.GetIndices()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + 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 *Topics_matches) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIndices sets the indices property value. The indices property +func (m *Topics_matches) SetIndices(value []int32)() { + m.indices = value +} +// SetText sets the text property value. The text property +func (m *Topics_matches) SetText(value *string)() { + m.text = value +} +type Topics_matchesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIndices()([]int32) + GetText()(*string) + SetIndices(value []int32)() + SetText(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/traffic.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/traffic.go new file mode 100644 index 000000000..58e1a7c8e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/traffic.go @@ -0,0 +1,139 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Traffic struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The count property + count *int32 + // The timestamp property + timestamp *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The uniques property + uniques *int32 +} +// NewTraffic instantiates a new Traffic and sets the default values. +func NewTraffic()(*Traffic) { + m := &Traffic{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTrafficFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTrafficFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTraffic(), 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 *Traffic) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCount gets the count property value. The count property +// returns a *int32 when successful +func (m *Traffic) GetCount()(*int32) { + return m.count +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Traffic) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCount(val) + } + return nil + } + res["timestamp"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetTimestamp(val) + } + return nil + } + res["uniques"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUniques(val) + } + return nil + } + return res +} +// GetTimestamp gets the timestamp property value. The timestamp property +// returns a *Time when successful +func (m *Traffic) GetTimestamp()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.timestamp +} +// GetUniques gets the uniques property value. The uniques property +// returns a *int32 when successful +func (m *Traffic) GetUniques()(*int32) { + return m.uniques +} +// Serialize serializes information the current object +func (m *Traffic) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("count", m.GetCount()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("timestamp", m.GetTimestamp()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("uniques", m.GetUniques()) + 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 *Traffic) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCount sets the count property value. The count property +func (m *Traffic) SetCount(value *int32)() { + m.count = value +} +// SetTimestamp sets the timestamp property value. The timestamp property +func (m *Traffic) SetTimestamp(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.timestamp = value +} +// SetUniques sets the uniques property value. The uniques property +func (m *Traffic) SetUniques(value *int32)() { + m.uniques = value +} +type Trafficable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCount()(*int32) + GetTimestamp()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUniques()(*int32) + SetCount(value *int32)() + SetTimestamp(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUniques(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/unassigned_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/unassigned_issue_event.go new file mode 100644 index 000000000..2a1ea9451 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/unassigned_issue_event.go @@ -0,0 +1,371 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// UnassignedIssueEvent unassigned Issue Event +type UnassignedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee SimpleUserable + // A GitHub user. + assigner SimpleUserable + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewUnassignedIssueEvent instantiates a new UnassignedIssueEvent and sets the default values. +func NewUnassignedIssueEvent()(*UnassignedIssueEvent) { + m := &UnassignedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUnassignedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUnassignedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUnassignedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *UnassignedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *UnassignedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *UnassignedIssueEvent) GetAssignee()(SimpleUserable) { + return m.assignee +} +// GetAssigner gets the assigner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *UnassignedIssueEvent) GetAssigner()(SimpleUserable) { + return m.assigner +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *UnassignedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *UnassignedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *UnassignedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *UnassignedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UnassignedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(SimpleUserable)) + } + return nil + } + res["assigner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssigner(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *UnassignedIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *UnassignedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *UnassignedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *UnassignedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *UnassignedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assigner", m.GetAssigner()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *UnassignedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *UnassignedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *UnassignedIssueEvent) SetAssignee(value SimpleUserable)() { + m.assignee = value +} +// SetAssigner sets the assigner property value. A GitHub user. +func (m *UnassignedIssueEvent) SetAssigner(value SimpleUserable)() { + m.assigner = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *UnassignedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *UnassignedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *UnassignedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *UnassignedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *UnassignedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *UnassignedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *UnassignedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *UnassignedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type UnassignedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetAssignee()(SimpleUserable) + GetAssigner()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetAssignee(value SimpleUserable)() + SetAssigner(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/unlabeled_issue_event.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/unlabeled_issue_event.go new file mode 100644 index 000000000..85e560ca7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/unlabeled_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// UnlabeledIssueEvent unlabeled Issue Event +type UnlabeledIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The label property + label UnlabeledIssueEvent_labelable + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewUnlabeledIssueEvent instantiates a new UnlabeledIssueEvent and sets the default values. +func NewUnlabeledIssueEvent()(*UnlabeledIssueEvent) { + m := &UnlabeledIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUnlabeledIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUnlabeledIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUnlabeledIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *UnlabeledIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *UnlabeledIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *UnlabeledIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *UnlabeledIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *UnlabeledIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *UnlabeledIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UnlabeledIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(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["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateUnlabeledIssueEvent_labelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLabel(val.(UnlabeledIssueEvent_labelable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *UnlabeledIssueEvent) GetId()(*int32) { + return m.id +} +// GetLabel gets the label property value. The label property +// returns a UnlabeledIssueEvent_labelable when successful +func (m *UnlabeledIssueEvent) GetLabel()(UnlabeledIssueEvent_labelable) { + return m.label +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *UnlabeledIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *UnlabeledIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *UnlabeledIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *UnlabeledIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *UnlabeledIssueEvent) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *UnlabeledIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *UnlabeledIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *UnlabeledIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *UnlabeledIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *UnlabeledIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *UnlabeledIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetLabel sets the label property value. The label property +func (m *UnlabeledIssueEvent) SetLabel(value UnlabeledIssueEvent_labelable)() { + m.label = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *UnlabeledIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *UnlabeledIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *UnlabeledIssueEvent) SetUrl(value *string)() { + m.url = value +} +type UnlabeledIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetLabel()(UnlabeledIssueEvent_labelable) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetLabel(value UnlabeledIssueEvent_labelable)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/unlabeled_issue_event_label.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/unlabeled_issue_event_label.go new file mode 100644 index 000000000..36e77e8a4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/unlabeled_issue_event_label.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type UnlabeledIssueEvent_label struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The color property + color *string + // The name property + name *string +} +// NewUnlabeledIssueEvent_label instantiates a new UnlabeledIssueEvent_label and sets the default values. +func NewUnlabeledIssueEvent_label()(*UnlabeledIssueEvent_label) { + m := &UnlabeledIssueEvent_label{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUnlabeledIssueEvent_labelFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUnlabeledIssueEvent_labelFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUnlabeledIssueEvent_label(), 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 *UnlabeledIssueEvent_label) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The color property +// returns a *string when successful +func (m *UnlabeledIssueEvent_label) GetColor()(*string) { + return m.color +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UnlabeledIssueEvent_label) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *UnlabeledIssueEvent_label) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *UnlabeledIssueEvent_label) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *UnlabeledIssueEvent_label) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The color property +func (m *UnlabeledIssueEvent_label) SetColor(value *string)() { + m.color = value +} +// SetName sets the name property value. The name property +func (m *UnlabeledIssueEvent_label) SetName(value *string)() { + m.name = value +} +type UnlabeledIssueEvent_labelable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetName()(*string) + SetColor(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/user_marketplace_purchase.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/user_marketplace_purchase.go new file mode 100644 index 000000000..f889d3242 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/user_marketplace_purchase.go @@ -0,0 +1,285 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// UserMarketplacePurchase user Marketplace Purchase +type UserMarketplacePurchase struct { + // The account property + account MarketplaceAccountable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The billing_cycle property + billing_cycle *string + // The free_trial_ends_on property + free_trial_ends_on *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The next_billing_date property + next_billing_date *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The on_free_trial property + on_free_trial *bool + // Marketplace Listing Plan + plan MarketplaceListingPlanable + // The unit_count property + unit_count *int32 + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewUserMarketplacePurchase instantiates a new UserMarketplacePurchase and sets the default values. +func NewUserMarketplacePurchase()(*UserMarketplacePurchase) { + m := &UserMarketplacePurchase{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUserMarketplacePurchaseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUserMarketplacePurchaseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUserMarketplacePurchase(), nil +} +// GetAccount gets the account property value. The account property +// returns a MarketplaceAccountable when successful +func (m *UserMarketplacePurchase) GetAccount()(MarketplaceAccountable) { + return m.account +} +// 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 *UserMarketplacePurchase) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBillingCycle gets the billing_cycle property value. The billing_cycle property +// returns a *string when successful +func (m *UserMarketplacePurchase) GetBillingCycle()(*string) { + return m.billing_cycle +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UserMarketplacePurchase) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["account"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMarketplaceAccountFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAccount(val.(MarketplaceAccountable)) + } + return nil + } + res["billing_cycle"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBillingCycle(val) + } + return nil + } + res["free_trial_ends_on"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetFreeTrialEndsOn(val) + } + return nil + } + res["next_billing_date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetNextBillingDate(val) + } + return nil + } + res["on_free_trial"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetOnFreeTrial(val) + } + return nil + } + res["plan"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMarketplaceListingPlanFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPlan(val.(MarketplaceListingPlanable)) + } + return nil + } + res["unit_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUnitCount(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetFreeTrialEndsOn gets the free_trial_ends_on property value. The free_trial_ends_on property +// returns a *Time when successful +func (m *UserMarketplacePurchase) GetFreeTrialEndsOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.free_trial_ends_on +} +// GetNextBillingDate gets the next_billing_date property value. The next_billing_date property +// returns a *Time when successful +func (m *UserMarketplacePurchase) GetNextBillingDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.next_billing_date +} +// GetOnFreeTrial gets the on_free_trial property value. The on_free_trial property +// returns a *bool when successful +func (m *UserMarketplacePurchase) GetOnFreeTrial()(*bool) { + return m.on_free_trial +} +// GetPlan gets the plan property value. Marketplace Listing Plan +// returns a MarketplaceListingPlanable when successful +func (m *UserMarketplacePurchase) GetPlan()(MarketplaceListingPlanable) { + return m.plan +} +// GetUnitCount gets the unit_count property value. The unit_count property +// returns a *int32 when successful +func (m *UserMarketplacePurchase) GetUnitCount()(*int32) { + return m.unit_count +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *UserMarketplacePurchase) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *UserMarketplacePurchase) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("account", m.GetAccount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("billing_cycle", m.GetBillingCycle()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("free_trial_ends_on", m.GetFreeTrialEndsOn()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("next_billing_date", m.GetNextBillingDate()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("on_free_trial", m.GetOnFreeTrial()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("plan", m.GetPlan()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("unit_count", m.GetUnitCount()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccount sets the account property value. The account property +func (m *UserMarketplacePurchase) SetAccount(value MarketplaceAccountable)() { + m.account = value +} +// 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 *UserMarketplacePurchase) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBillingCycle sets the billing_cycle property value. The billing_cycle property +func (m *UserMarketplacePurchase) SetBillingCycle(value *string)() { + m.billing_cycle = value +} +// SetFreeTrialEndsOn sets the free_trial_ends_on property value. The free_trial_ends_on property +func (m *UserMarketplacePurchase) SetFreeTrialEndsOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.free_trial_ends_on = value +} +// SetNextBillingDate sets the next_billing_date property value. The next_billing_date property +func (m *UserMarketplacePurchase) SetNextBillingDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.next_billing_date = value +} +// SetOnFreeTrial sets the on_free_trial property value. The on_free_trial property +func (m *UserMarketplacePurchase) SetOnFreeTrial(value *bool)() { + m.on_free_trial = value +} +// SetPlan sets the plan property value. Marketplace Listing Plan +func (m *UserMarketplacePurchase) SetPlan(value MarketplaceListingPlanable)() { + m.plan = value +} +// SetUnitCount sets the unit_count property value. The unit_count property +func (m *UserMarketplacePurchase) SetUnitCount(value *int32)() { + m.unit_count = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *UserMarketplacePurchase) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type UserMarketplacePurchaseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccount()(MarketplaceAccountable) + GetBillingCycle()(*string) + GetFreeTrialEndsOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetNextBillingDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetOnFreeTrial()(*bool) + GetPlan()(MarketplaceListingPlanable) + GetUnitCount()(*int32) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetAccount(value MarketplaceAccountable)() + SetBillingCycle(value *string)() + SetFreeTrialEndsOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetNextBillingDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetOnFreeTrial(value *bool)() + SetPlan(value MarketplaceListingPlanable)() + SetUnitCount(value *int32)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/user_role_assignment.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/user_role_assignment.go new file mode 100644 index 000000000..245e34524 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/user_role_assignment.go @@ -0,0 +1,661 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// UserRoleAssignment the Relationship a User has with a role. +type UserRoleAssignment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The email property + email *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int32 + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_at property + starred_at *string + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewUserRoleAssignment instantiates a new UserRoleAssignment and sets the default values. +func NewUserRoleAssignment()(*UserRoleAssignment) { + m := &UserRoleAssignment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUserRoleAssignmentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUserRoleAssignmentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUserRoleAssignment(), 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 *UserRoleAssignment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *UserRoleAssignment) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UserRoleAssignment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredAt(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *UserRoleAssignment) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *UserRoleAssignment) GetId()(*int32) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *UserRoleAssignment) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *UserRoleAssignment) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *UserRoleAssignment) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *UserRoleAssignment) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredAt gets the starred_at property value. The starred_at property +// returns a *string when successful +func (m *UserRoleAssignment) GetStarredAt()(*string) { + return m.starred_at +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *UserRoleAssignment) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *UserRoleAssignment) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *UserRoleAssignment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_at", m.GetStarredAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *UserRoleAssignment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *UserRoleAssignment) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEmail sets the email property value. The email property +func (m *UserRoleAssignment) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *UserRoleAssignment) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *UserRoleAssignment) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *UserRoleAssignment) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *UserRoleAssignment) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *UserRoleAssignment) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *UserRoleAssignment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *UserRoleAssignment) SetId(value *int32)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *UserRoleAssignment) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *UserRoleAssignment) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *UserRoleAssignment) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *UserRoleAssignment) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *UserRoleAssignment) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *UserRoleAssignment) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *UserRoleAssignment) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredAt sets the starred_at property value. The starred_at property +func (m *UserRoleAssignment) SetStarredAt(value *string)() { + m.starred_at = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *UserRoleAssignment) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *UserRoleAssignment) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *UserRoleAssignment) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *UserRoleAssignment) SetUrl(value *string)() { + m.url = value +} +type UserRoleAssignmentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredAt()(*string) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredAt(value *string)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/user_search_result_item.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/user_search_result_item.go new file mode 100644 index 000000000..3e393cb75 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/user_search_result_item.go @@ -0,0 +1,1051 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// UserSearchResultItem user Search Result Item +type UserSearchResultItem struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The bio property + bio *string + // The blog property + blog *string + // The company property + company *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The email property + email *string + // The events_url property + events_url *string + // The followers property + followers *int32 + // The followers_url property + followers_url *string + // The following property + following *int32 + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The hireable property + hireable *bool + // The html_url property + html_url *string + // The id property + id *int64 + // The location property + location *string + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The public_gists property + public_gists *int32 + // The public_repos property + public_repos *int32 + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The score property + score *float64 + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The suspended_at property + suspended_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The text_matches property + text_matches []Usersable + // The type property + typeEscaped *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewUserSearchResultItem instantiates a new UserSearchResultItem and sets the default values. +func NewUserSearchResultItem()(*UserSearchResultItem) { + m := &UserSearchResultItem{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUserSearchResultItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUserSearchResultItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUserSearchResultItem(), 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 *UserSearchResultItem) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetBio gets the bio property value. The bio property +// returns a *string when successful +func (m *UserSearchResultItem) GetBio()(*string) { + return m.bio +} +// GetBlog gets the blog property value. The blog property +// returns a *string when successful +func (m *UserSearchResultItem) GetBlog()(*string) { + return m.blog +} +// GetCompany gets the company property value. The company property +// returns a *string when successful +func (m *UserSearchResultItem) GetCompany()(*string) { + return m.company +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *UserSearchResultItem) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *UserSearchResultItem) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UserSearchResultItem) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["bio"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBio(val) + } + return nil + } + res["blog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlog(val) + } + return nil + } + res["company"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompany(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowers(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowing(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["hireable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHireable(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["public_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicGists(val) + } + return nil + } + res["public_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicRepos(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["suspended_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetSuspendedAt(val) + } + return nil + } + res["text_matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateUsersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Usersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Usersable) + } + } + m.SetTextMatches(res) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowers gets the followers property value. The followers property +// returns a *int32 when successful +func (m *UserSearchResultItem) GetFollowers()(*int32) { + return m.followers +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowing gets the following property value. The following property +// returns a *int32 when successful +func (m *UserSearchResultItem) GetFollowing()(*int32) { + return m.following +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *UserSearchResultItem) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHireable gets the hireable property value. The hireable property +// returns a *bool when successful +func (m *UserSearchResultItem) GetHireable()(*bool) { + return m.hireable +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *UserSearchResultItem) GetId()(*int64) { + return m.id +} +// GetLocation gets the location property value. The location property +// returns a *string when successful +func (m *UserSearchResultItem) GetLocation()(*string) { + return m.location +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *UserSearchResultItem) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *UserSearchResultItem) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *UserSearchResultItem) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetPublicGists gets the public_gists property value. The public_gists property +// returns a *int32 when successful +func (m *UserSearchResultItem) GetPublicGists()(*int32) { + return m.public_gists +} +// GetPublicRepos gets the public_repos property value. The public_repos property +// returns a *int32 when successful +func (m *UserSearchResultItem) GetPublicRepos()(*int32) { + return m.public_repos +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetReposUrl()(*string) { + return m.repos_url +} +// GetScore gets the score property value. The score property +// returns a *float64 when successful +func (m *UserSearchResultItem) GetScore()(*float64) { + return m.score +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *UserSearchResultItem) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetSuspendedAt gets the suspended_at property value. The suspended_at property +// returns a *Time when successful +func (m *UserSearchResultItem) GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.suspended_at +} +// GetTextMatches gets the text_matches property value. The text_matches property +// returns a []Usersable when successful +func (m *UserSearchResultItem) GetTextMatches()([]Usersable) { + return m.text_matches +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *UserSearchResultItem) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *UserSearchResultItem) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *UserSearchResultItem) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *UserSearchResultItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("bio", m.GetBio()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blog", m.GetBlog()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("company", m.GetCompany()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("followers", m.GetFollowers()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("following", m.GetFollowing()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("hireable", m.GetHireable()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_gists", m.GetPublicGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_repos", m.GetPublicRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("score", m.GetScore()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("suspended_at", m.GetSuspendedAt()) + if err != nil { + return err + } + } + if m.GetTextMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTextMatches())) + for i, v := range m.GetTextMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("text_matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *UserSearchResultItem) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *UserSearchResultItem) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetBio sets the bio property value. The bio property +func (m *UserSearchResultItem) SetBio(value *string)() { + m.bio = value +} +// SetBlog sets the blog property value. The blog property +func (m *UserSearchResultItem) SetBlog(value *string)() { + m.blog = value +} +// SetCompany sets the company property value. The company property +func (m *UserSearchResultItem) SetCompany(value *string)() { + m.company = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *UserSearchResultItem) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetEmail sets the email property value. The email property +func (m *UserSearchResultItem) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *UserSearchResultItem) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowers sets the followers property value. The followers property +func (m *UserSearchResultItem) SetFollowers(value *int32)() { + m.followers = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *UserSearchResultItem) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowing sets the following property value. The following property +func (m *UserSearchResultItem) SetFollowing(value *int32)() { + m.following = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *UserSearchResultItem) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *UserSearchResultItem) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *UserSearchResultItem) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHireable sets the hireable property value. The hireable property +func (m *UserSearchResultItem) SetHireable(value *bool)() { + m.hireable = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *UserSearchResultItem) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *UserSearchResultItem) SetId(value *int64)() { + m.id = value +} +// SetLocation sets the location property value. The location property +func (m *UserSearchResultItem) SetLocation(value *string)() { + m.location = value +} +// SetLogin sets the login property value. The login property +func (m *UserSearchResultItem) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *UserSearchResultItem) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *UserSearchResultItem) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *UserSearchResultItem) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetPublicGists sets the public_gists property value. The public_gists property +func (m *UserSearchResultItem) SetPublicGists(value *int32)() { + m.public_gists = value +} +// SetPublicRepos sets the public_repos property value. The public_repos property +func (m *UserSearchResultItem) SetPublicRepos(value *int32)() { + m.public_repos = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *UserSearchResultItem) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *UserSearchResultItem) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetScore sets the score property value. The score property +func (m *UserSearchResultItem) SetScore(value *float64)() { + m.score = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *UserSearchResultItem) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *UserSearchResultItem) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *UserSearchResultItem) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetSuspendedAt sets the suspended_at property value. The suspended_at property +func (m *UserSearchResultItem) SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.suspended_at = value +} +// SetTextMatches sets the text_matches property value. The text_matches property +func (m *UserSearchResultItem) SetTextMatches(value []Usersable)() { + m.text_matches = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *UserSearchResultItem) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *UserSearchResultItem) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *UserSearchResultItem) SetUrl(value *string)() { + m.url = value +} +type UserSearchResultItemable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetBio()(*string) + GetBlog()(*string) + GetCompany()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowers()(*int32) + GetFollowersUrl()(*string) + GetFollowing()(*int32) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHireable()(*bool) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLocation()(*string) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetPublicGists()(*int32) + GetPublicRepos()(*int32) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetScore()(*float64) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetTextMatches()([]Usersable) + GetTypeEscaped()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetBio(value *string)() + SetBlog(value *string)() + SetCompany(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowers(value *int32)() + SetFollowersUrl(value *string)() + SetFollowing(value *int32)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHireable(value *bool)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLocation(value *string)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetPublicGists(value *int32)() + SetPublicRepos(value *int32)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetScore(value *float64)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetTextMatches(value []Usersable)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/users.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/users.go new file mode 100644 index 000000000..dd87f2abb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/users.go @@ -0,0 +1,208 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Users struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The fragment property + fragment *string + // The matches property + matches []Users_matchesable + // The object_type property + object_type *string + // The object_url property + object_url *string + // The property property + property *string +} +// NewUsers instantiates a new Users and sets the default values. +func NewUsers()(*Users) { + m := &Users{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUsersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUsers(), 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 *Users) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Users) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["fragment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFragment(val) + } + return nil + } + res["matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateUsers_matchesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Users_matchesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Users_matchesable) + } + } + m.SetMatches(res) + } + return nil + } + res["object_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectType(val) + } + return nil + } + res["object_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectUrl(val) + } + return nil + } + res["property"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProperty(val) + } + return nil + } + return res +} +// GetFragment gets the fragment property value. The fragment property +// returns a *string when successful +func (m *Users) GetFragment()(*string) { + return m.fragment +} +// GetMatches gets the matches property value. The matches property +// returns a []Users_matchesable when successful +func (m *Users) GetMatches()([]Users_matchesable) { + return m.matches +} +// GetObjectType gets the object_type property value. The object_type property +// returns a *string when successful +func (m *Users) GetObjectType()(*string) { + return m.object_type +} +// GetObjectUrl gets the object_url property value. The object_url property +// returns a *string when successful +func (m *Users) GetObjectUrl()(*string) { + return m.object_url +} +// GetProperty gets the property property value. The property property +// returns a *string when successful +func (m *Users) GetProperty()(*string) { + return m.property +} +// Serialize serializes information the current object +func (m *Users) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("fragment", m.GetFragment()) + if err != nil { + return err + } + } + if m.GetMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMatches())) + for i, v := range m.GetMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_type", m.GetObjectType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_url", m.GetObjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("property", m.GetProperty()) + 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 *Users) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFragment sets the fragment property value. The fragment property +func (m *Users) SetFragment(value *string)() { + m.fragment = value +} +// SetMatches sets the matches property value. The matches property +func (m *Users) SetMatches(value []Users_matchesable)() { + m.matches = value +} +// SetObjectType sets the object_type property value. The object_type property +func (m *Users) SetObjectType(value *string)() { + m.object_type = value +} +// SetObjectUrl sets the object_url property value. The object_url property +func (m *Users) SetObjectUrl(value *string)() { + m.object_url = value +} +// SetProperty sets the property property value. The property property +func (m *Users) SetProperty(value *string)() { + m.property = value +} +type Usersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFragment()(*string) + GetMatches()([]Users_matchesable) + GetObjectType()(*string) + GetObjectUrl()(*string) + GetProperty()(*string) + SetFragment(value *string)() + SetMatches(value []Users_matchesable)() + SetObjectType(value *string)() + SetObjectUrl(value *string)() + SetProperty(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/users503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/users503_error.go new file mode 100644 index 000000000..02d5fad0a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/users503_error.go @@ -0,0 +1,146 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Users503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewUsers503Error instantiates a new Users503Error and sets the default values. +func NewUsers503Error()(*Users503Error) { + m := &Users503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUsers503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsers503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUsers503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Users503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Users503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Users503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Users503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Users503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Users503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Users503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *Users503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Users503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Users503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Users503Error) SetMessage(value *string)() { + m.message = value +} +type Users503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/users_matches.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/users_matches.go new file mode 100644 index 000000000..01a8d51e6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/users_matches.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Users_matches struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The indices property + indices []int32 + // The text property + text *string +} +// NewUsers_matches instantiates a new Users_matches and sets the default values. +func NewUsers_matches()(*Users_matches) { + m := &Users_matches{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUsers_matchesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsers_matchesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUsers_matches(), 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 *Users_matches) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Users_matches) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["indices"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetIndices(res) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetIndices gets the indices property value. The indices property +// returns a []int32 when successful +func (m *Users_matches) GetIndices()([]int32) { + return m.indices +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *Users_matches) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *Users_matches) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIndices() != nil { + err := writer.WriteCollectionOfInt32Values("indices", m.GetIndices()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + 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 *Users_matches) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIndices sets the indices property value. The indices property +func (m *Users_matches) SetIndices(value []int32)() { + m.indices = value +} +// SetText sets the text property value. The text property +func (m *Users_matches) SetText(value *string)() { + m.text = value +} +type Users_matchesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIndices()([]int32) + GetText()(*string) + SetIndices(value []int32)() + SetText(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/validation_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/validation_error.go new file mode 100644 index 000000000..1c9487750 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/validation_error.go @@ -0,0 +1,159 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ValidationError validation Error +type ValidationError struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The documentation_url property + documentation_url *string + // The errors property + errors []ValidationError_errorsable + // The message property + message *string +} +// NewValidationError instantiates a new ValidationError and sets the default values. +func NewValidationError()(*ValidationError) { + m := &ValidationError{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateValidationErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateValidationErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewValidationError(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ValidationError) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ValidationError) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ValidationError) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetErrors gets the errors property value. The errors property +// returns a []ValidationError_errorsable when successful +func (m *ValidationError) GetErrors()([]ValidationError_errorsable) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ValidationError) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateValidationError_errorsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ValidationError_errorsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ValidationError_errorsable) + } + } + m.SetErrors(res) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ValidationError) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ValidationError) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + if m.GetErrors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetErrors())) + for i, v := range m.GetErrors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("errors", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ValidationError) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ValidationError) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetErrors sets the errors property value. The errors property +func (m *ValidationError) SetErrors(value []ValidationError_errorsable)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *ValidationError) SetMessage(value *string)() { + m.message = value +} +type ValidationErrorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetErrors()([]ValidationError_errorsable) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetErrors(value []ValidationError_errorsable)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/validation_error_errors.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/validation_error_errors.go new file mode 100644 index 000000000..25a901d82 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/validation_error_errors.go @@ -0,0 +1,319 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ValidationError_errors struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The field property + field *string + // The index property + index *int32 + // The message property + message *string + // The resource property + resource *string + // The value property + value ValidationError_errors_ValidationError_errors_valueable +} +// ValidationError_errors_ValidationError_errors_value composed type wrapper for classes int32, string +type ValidationError_errors_ValidationError_errors_value struct { + // Composed type representation for type int32 + integer *int32 + // Composed type representation for type string + string *string +} +// NewValidationError_errors_ValidationError_errors_value instantiates a new ValidationError_errors_ValidationError_errors_value and sets the default values. +func NewValidationError_errors_ValidationError_errors_value()(*ValidationError_errors_ValidationError_errors_value) { + m := &ValidationError_errors_ValidationError_errors_value{ + } + return m +} +// CreateValidationError_errors_ValidationError_errors_valueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateValidationError_errors_ValidationError_errors_valueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewValidationError_errors_ValidationError_errors_value() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetInt32Value(); val != nil { + if err != nil { + return nil, err + } + result.SetInteger(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ValidationError_errors_ValidationError_errors_value) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetInteger gets the integer property value. Composed type representation for type int32 +// returns a *int32 when successful +func (m *ValidationError_errors_ValidationError_errors_value) GetInteger()(*int32) { + return m.integer +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *ValidationError_errors_ValidationError_errors_value) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ValidationError_errors_ValidationError_errors_value) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ValidationError_errors_ValidationError_errors_value) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInteger() != nil { + err := writer.WriteInt32Value("", m.GetInteger()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetInteger sets the integer property value. Composed type representation for type int32 +func (m *ValidationError_errors_ValidationError_errors_value) SetInteger(value *int32)() { + m.integer = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ValidationError_errors_ValidationError_errors_value) SetString(value *string)() { + m.string = value +} +type ValidationError_errors_ValidationError_errors_valueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInteger()(*int32) + GetString()(*string) + SetInteger(value *int32)() + SetString(value *string)() +} +// NewValidationError_errors instantiates a new ValidationError_errors and sets the default values. +func NewValidationError_errors()(*ValidationError_errors) { + m := &ValidationError_errors{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateValidationError_errorsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateValidationError_errorsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewValidationError_errors(), 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 *ValidationError_errors) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *ValidationError_errors) GetCode()(*string) { + return m.code +} +// GetField gets the field property value. The field property +// returns a *string when successful +func (m *ValidationError_errors) GetField()(*string) { + return m.field +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ValidationError_errors) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["field"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetField(val) + } + return nil + } + res["index"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetIndex(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["resource"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResource(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateValidationError_errors_ValidationError_errors_valueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetValue(val.(ValidationError_errors_ValidationError_errors_valueable)) + } + return nil + } + return res +} +// GetIndex gets the index property value. The index property +// returns a *int32 when successful +func (m *ValidationError_errors) GetIndex()(*int32) { + return m.index +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ValidationError_errors) GetMessage()(*string) { + return m.message +} +// GetResource gets the resource property value. The resource property +// returns a *string when successful +func (m *ValidationError_errors) GetResource()(*string) { + return m.resource +} +// GetValue gets the value property value. The value property +// returns a ValidationError_errors_ValidationError_errors_valueable when successful +func (m *ValidationError_errors) GetValue()(ValidationError_errors_ValidationError_errors_valueable) { + return m.value +} +// Serialize serializes information the current object +func (m *ValidationError_errors) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("field", m.GetField()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("index", m.GetIndex()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("resource", m.GetResource()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("value", m.GetValue()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ValidationError_errors) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *ValidationError_errors) SetCode(value *string)() { + m.code = value +} +// SetField sets the field property value. The field property +func (m *ValidationError_errors) SetField(value *string)() { + m.field = value +} +// SetIndex sets the index property value. The index property +func (m *ValidationError_errors) SetIndex(value *int32)() { + m.index = value +} +// SetMessage sets the message property value. The message property +func (m *ValidationError_errors) SetMessage(value *string)() { + m.message = value +} +// SetResource sets the resource property value. The resource property +func (m *ValidationError_errors) SetResource(value *string)() { + m.resource = value +} +// SetValue sets the value property value. The value property +func (m *ValidationError_errors) SetValue(value ValidationError_errors_ValidationError_errors_valueable)() { + m.value = value +} +type ValidationError_errorsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetField()(*string) + GetIndex()(*int32) + GetMessage()(*string) + GetResource()(*string) + GetValue()(ValidationError_errors_ValidationError_errors_valueable) + SetCode(value *string)() + SetField(value *string)() + SetIndex(value *int32)() + SetMessage(value *string)() + SetResource(value *string)() + SetValue(value ValidationError_errors_ValidationError_errors_valueable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/validation_error_simple.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/validation_error_simple.go new file mode 100644 index 000000000..dbe7ed253 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/validation_error_simple.go @@ -0,0 +1,153 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ValidationErrorSimple validation Error Simple +type ValidationErrorSimple struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The documentation_url property + documentation_url *string + // The errors property + errors []string + // The message property + message *string +} +// NewValidationErrorSimple instantiates a new ValidationErrorSimple and sets the default values. +func NewValidationErrorSimple()(*ValidationErrorSimple) { + m := &ValidationErrorSimple{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateValidationErrorSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateValidationErrorSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewValidationErrorSimple(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ValidationErrorSimple) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ValidationErrorSimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ValidationErrorSimple) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetErrors gets the errors property value. The errors property +// returns a []string when successful +func (m *ValidationErrorSimple) GetErrors()([]string) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ValidationErrorSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetErrors(res) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ValidationErrorSimple) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ValidationErrorSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + if m.GetErrors() != nil { + err := writer.WriteCollectionOfStringValues("errors", m.GetErrors()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ValidationErrorSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ValidationErrorSimple) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetErrors sets the errors property value. The errors property +func (m *ValidationErrorSimple) SetErrors(value []string)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *ValidationErrorSimple) SetMessage(value *string)() { + m.message = value +} +type ValidationErrorSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetErrors()([]string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetErrors(value []string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/verification.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/verification.go new file mode 100644 index 000000000..8ee7f11e2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/verification.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Verification struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The payload property + payload *string + // The reason property + reason *string + // The signature property + signature *string + // The verified property + verified *bool +} +// NewVerification instantiates a new Verification and sets the default values. +func NewVerification()(*Verification) { + m := &Verification{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateVerificationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateVerificationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewVerification(), 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 *Verification) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Verification) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPayload(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["signature"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSignature(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + return res +} +// GetPayload gets the payload property value. The payload property +// returns a *string when successful +func (m *Verification) GetPayload()(*string) { + return m.payload +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *Verification) GetReason()(*string) { + return m.reason +} +// GetSignature gets the signature property value. The signature property +// returns a *string when successful +func (m *Verification) GetSignature()(*string) { + return m.signature +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *Verification) GetVerified()(*bool) { + return m.verified +} +// Serialize serializes information the current object +func (m *Verification) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("payload", m.GetPayload()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("signature", m.GetSignature()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + 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 *Verification) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPayload sets the payload property value. The payload property +func (m *Verification) SetPayload(value *string)() { + m.payload = value +} +// SetReason sets the reason property value. The reason property +func (m *Verification) SetReason(value *string)() { + m.reason = value +} +// SetSignature sets the signature property value. The signature property +func (m *Verification) SetSignature(value *string)() { + m.signature = value +} +// SetVerified sets the verified property value. The verified property +func (m *Verification) SetVerified(value *bool)() { + m.verified = value +} +type Verificationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPayload()(*string) + GetReason()(*string) + GetSignature()(*string) + GetVerified()(*bool) + SetPayload(value *string)() + SetReason(value *string)() + SetSignature(value *string)() + SetVerified(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/view_traffic.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/view_traffic.go new file mode 100644 index 000000000..c1e6d56dc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/view_traffic.go @@ -0,0 +1,151 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ViewTraffic view Traffic +type ViewTraffic struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The count property + count *int32 + // The uniques property + uniques *int32 + // The views property + views []Trafficable +} +// NewViewTraffic instantiates a new ViewTraffic and sets the default values. +func NewViewTraffic()(*ViewTraffic) { + m := &ViewTraffic{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateViewTrafficFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateViewTrafficFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewViewTraffic(), 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 *ViewTraffic) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCount gets the count property value. The count property +// returns a *int32 when successful +func (m *ViewTraffic) GetCount()(*int32) { + return m.count +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ViewTraffic) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCount(val) + } + return nil + } + res["uniques"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUniques(val) + } + return nil + } + res["views"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTrafficFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Trafficable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Trafficable) + } + } + m.SetViews(res) + } + return nil + } + return res +} +// GetUniques gets the uniques property value. The uniques property +// returns a *int32 when successful +func (m *ViewTraffic) GetUniques()(*int32) { + return m.uniques +} +// GetViews gets the views property value. The views property +// returns a []Trafficable when successful +func (m *ViewTraffic) GetViews()([]Trafficable) { + return m.views +} +// Serialize serializes information the current object +func (m *ViewTraffic) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("count", m.GetCount()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("uniques", m.GetUniques()) + if err != nil { + return err + } + } + if m.GetViews() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetViews())) + for i, v := range m.GetViews() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("views", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ViewTraffic) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCount sets the count property value. The count property +func (m *ViewTraffic) SetCount(value *int32)() { + m.count = value +} +// SetUniques sets the uniques property value. The uniques property +func (m *ViewTraffic) SetUniques(value *int32)() { + m.uniques = value +} +// SetViews sets the views property value. The views property +func (m *ViewTraffic) SetViews(value []Trafficable)() { + m.views = value +} +type ViewTrafficable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCount()(*int32) + GetUniques()(*int32) + GetViews()([]Trafficable) + SetCount(value *int32)() + SetUniques(value *int32)() + SetViews(value []Trafficable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/vulnerability.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/vulnerability.go new file mode 100644 index 000000000..5d1c49be2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/vulnerability.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Vulnerability a vulnerability describing the product and its affected versions within a GitHub Security Advisory. +type Vulnerability struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The package version that resolves the vulnerability. + first_patched_version *string + // The name of the package affected by the vulnerability. + packageEscaped Vulnerability_packageable + // The functions in the package that are affected by the vulnerability. + vulnerable_functions []string + // The range of the package versions affected by the vulnerability. + vulnerable_version_range *string +} +// NewVulnerability instantiates a new Vulnerability and sets the default values. +func NewVulnerability()(*Vulnerability) { + m := &Vulnerability{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateVulnerabilityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateVulnerabilityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewVulnerability(), 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 *Vulnerability) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Vulnerability) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["first_patched_version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFirstPatchedVersion(val) + } + return nil + } + res["package"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateVulnerability_packageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPackageEscaped(val.(Vulnerability_packageable)) + } + return nil + } + res["vulnerable_functions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetVulnerableFunctions(res) + } + return nil + } + res["vulnerable_version_range"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVulnerableVersionRange(val) + } + return nil + } + return res +} +// GetFirstPatchedVersion gets the first_patched_version property value. The package version that resolves the vulnerability. +// returns a *string when successful +func (m *Vulnerability) GetFirstPatchedVersion()(*string) { + return m.first_patched_version +} +// GetPackageEscaped gets the package property value. The name of the package affected by the vulnerability. +// returns a Vulnerability_packageable when successful +func (m *Vulnerability) GetPackageEscaped()(Vulnerability_packageable) { + return m.packageEscaped +} +// GetVulnerableFunctions gets the vulnerable_functions property value. The functions in the package that are affected by the vulnerability. +// returns a []string when successful +func (m *Vulnerability) GetVulnerableFunctions()([]string) { + return m.vulnerable_functions +} +// GetVulnerableVersionRange gets the vulnerable_version_range property value. The range of the package versions affected by the vulnerability. +// returns a *string when successful +func (m *Vulnerability) GetVulnerableVersionRange()(*string) { + return m.vulnerable_version_range +} +// Serialize serializes information the current object +func (m *Vulnerability) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("first_patched_version", m.GetFirstPatchedVersion()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("package", m.GetPackageEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("vulnerable_version_range", m.GetVulnerableVersionRange()) + 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 *Vulnerability) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFirstPatchedVersion sets the first_patched_version property value. The package version that resolves the vulnerability. +func (m *Vulnerability) SetFirstPatchedVersion(value *string)() { + m.first_patched_version = value +} +// SetPackageEscaped sets the package property value. The name of the package affected by the vulnerability. +func (m *Vulnerability) SetPackageEscaped(value Vulnerability_packageable)() { + m.packageEscaped = value +} +// SetVulnerableFunctions sets the vulnerable_functions property value. The functions in the package that are affected by the vulnerability. +func (m *Vulnerability) SetVulnerableFunctions(value []string)() { + m.vulnerable_functions = value +} +// SetVulnerableVersionRange sets the vulnerable_version_range property value. The range of the package versions affected by the vulnerability. +func (m *Vulnerability) SetVulnerableVersionRange(value *string)() { + m.vulnerable_version_range = value +} +type Vulnerabilityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFirstPatchedVersion()(*string) + GetPackageEscaped()(Vulnerability_packageable) + GetVulnerableFunctions()([]string) + GetVulnerableVersionRange()(*string) + SetFirstPatchedVersion(value *string)() + SetPackageEscaped(value Vulnerability_packageable)() + SetVulnerableFunctions(value []string)() + SetVulnerableVersionRange(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/vulnerability_package.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/vulnerability_package.go new file mode 100644 index 000000000..e111b4c24 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/vulnerability_package.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Vulnerability_package the name of the package affected by the vulnerability. +type Vulnerability_package struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The package's language or package management ecosystem. + ecosystem *SecurityAdvisoryEcosystems + // The unique package name within its ecosystem. + name *string +} +// NewVulnerability_package instantiates a new Vulnerability_package and sets the default values. +func NewVulnerability_package()(*Vulnerability_package) { + m := &Vulnerability_package{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateVulnerability_packageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateVulnerability_packageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewVulnerability_package(), 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 *Vulnerability_package) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEcosystem gets the ecosystem property value. The package's language or package management ecosystem. +// returns a *SecurityAdvisoryEcosystems when successful +func (m *Vulnerability_package) GetEcosystem()(*SecurityAdvisoryEcosystems) { + return m.ecosystem +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Vulnerability_package) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ecosystem"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAdvisoryEcosystems) + if err != nil { + return err + } + if val != nil { + m.SetEcosystem(val.(*SecurityAdvisoryEcosystems)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The unique package name within its ecosystem. +// returns a *string when successful +func (m *Vulnerability_package) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *Vulnerability_package) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEcosystem() != nil { + cast := (*m.GetEcosystem()).String() + err := writer.WriteStringValue("ecosystem", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *Vulnerability_package) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEcosystem sets the ecosystem property value. The package's language or package management ecosystem. +func (m *Vulnerability_package) SetEcosystem(value *SecurityAdvisoryEcosystems)() { + m.ecosystem = value +} +// SetName sets the name property value. The unique package name within its ecosystem. +func (m *Vulnerability_package) SetName(value *string)() { + m.name = value +} +type Vulnerability_packageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEcosystem()(*SecurityAdvisoryEcosystems) + GetName()(*string) + SetEcosystem(value *SecurityAdvisoryEcosystems)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/webhook_config.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/webhook_config.go new file mode 100644 index 000000000..f70045a1d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/webhook_config.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// WebhookConfig configuration object of the webhook +type WebhookConfig struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // The insecure_ssl property + insecure_ssl WebhookConfigInsecureSslable + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). + secret *string + // The URL to which the payloads will be delivered. + url *string +} +// NewWebhookConfig instantiates a new WebhookConfig and sets the default values. +func NewWebhookConfig()(*WebhookConfig) { + m := &WebhookConfig{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWebhookConfigFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWebhookConfigFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWebhookConfig(), 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 *WebhookConfig) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +// returns a *string when successful +func (m *WebhookConfig) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WebhookConfig) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateWebhookConfigInsecureSslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val.(WebhookConfigInsecureSslable)) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a WebhookConfigInsecureSslable when successful +func (m *WebhookConfig) GetInsecureSsl()(WebhookConfigInsecureSslable) { + return m.insecure_ssl +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +// returns a *string when successful +func (m *WebhookConfig) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +// returns a *string when successful +func (m *WebhookConfig) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *WebhookConfig) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *WebhookConfig) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *WebhookConfig) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *WebhookConfig) SetInsecureSsl(value WebhookConfigInsecureSslable)() { + m.insecure_ssl = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +func (m *WebhookConfig) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *WebhookConfig) SetUrl(value *string)() { + m.url = value +} +type WebhookConfigable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(WebhookConfigInsecureSslable) + GetSecret()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value WebhookConfigInsecureSslable)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/webhook_config_insecure_ssl.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/webhook_config_insecure_ssl.go new file mode 100644 index 000000000..7f27dd98c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/webhook_config_insecure_ssl.go @@ -0,0 +1,376 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// WebhookConfigInsecureSsl composed type wrapper for classes float64, string +type WebhookConfigInsecureSsl struct { + // Composed type representation for type float64 + double *float64 + // Composed type representation for type string + string *string + // Composed type representation for type float64 + webhookConfigInsecureSslDouble *float64 + // Composed type representation for type float64 + webhookConfigInsecureSslDouble0 *float64 + // Composed type representation for type float64 + webhookConfigInsecureSslDouble1 *float64 + // Composed type representation for type float64 + webhookConfigInsecureSslDouble2 *float64 + // Composed type representation for type float64 + webhookConfigInsecureSslDouble3 *float64 + // Composed type representation for type float64 + webhookConfigInsecureSslDouble4 *float64 + // Composed type representation for type string + webhookConfigInsecureSslString *string + // Composed type representation for type string + webhookConfigInsecureSslString0 *string + // Composed type representation for type string + webhookConfigInsecureSslString1 *string + // Composed type representation for type string + webhookConfigInsecureSslString2 *string + // Composed type representation for type string + webhookConfigInsecureSslString3 *string + // Composed type representation for type string + webhookConfigInsecureSslString4 *string +} +// NewWebhookConfigInsecureSsl instantiates a new WebhookConfigInsecureSsl and sets the default values. +func NewWebhookConfigInsecureSsl()(*WebhookConfigInsecureSsl) { + m := &WebhookConfigInsecureSsl{ + } + return m +} +// CreateWebhookConfigInsecureSslFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWebhookConfigInsecureSslFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewWebhookConfigInsecureSsl() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetFloat64Value(); val != nil { + if err != nil { + return nil, err + } + result.SetDouble(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } else if val, err := parseNode.GetFloat64Value(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslDouble(val) + } else if val, err := parseNode.GetFloat64Value(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslDouble0(val) + } else if val, err := parseNode.GetFloat64Value(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslDouble1(val) + } else if val, err := parseNode.GetFloat64Value(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslDouble2(val) + } else if val, err := parseNode.GetFloat64Value(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslDouble3(val) + } else if val, err := parseNode.GetFloat64Value(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslDouble4(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslString0(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslString1(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslString2(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslString3(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslString4(val) + } + return result, nil +} +// GetDouble gets the double property value. Composed type representation for type float64 +// returns a *float64 when successful +func (m *WebhookConfigInsecureSsl) GetDouble()(*float64) { + return m.double +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WebhookConfigInsecureSsl) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *WebhookConfigInsecureSsl) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *WebhookConfigInsecureSsl) GetString()(*string) { + return m.string +} +// GetWebhookConfigInsecureSslDouble gets the double property value. Composed type representation for type float64 +// returns a *float64 when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslDouble()(*float64) { + return m.webhookConfigInsecureSslDouble +} +// GetWebhookConfigInsecureSslDouble0 gets the double property value. Composed type representation for type float64 +// returns a *float64 when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslDouble0()(*float64) { + return m.webhookConfigInsecureSslDouble0 +} +// GetWebhookConfigInsecureSslDouble1 gets the double property value. Composed type representation for type float64 +// returns a *float64 when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslDouble1()(*float64) { + return m.webhookConfigInsecureSslDouble1 +} +// GetWebhookConfigInsecureSslDouble2 gets the double property value. Composed type representation for type float64 +// returns a *float64 when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslDouble2()(*float64) { + return m.webhookConfigInsecureSslDouble2 +} +// GetWebhookConfigInsecureSslDouble3 gets the double property value. Composed type representation for type float64 +// returns a *float64 when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslDouble3()(*float64) { + return m.webhookConfigInsecureSslDouble3 +} +// GetWebhookConfigInsecureSslDouble4 gets the double property value. Composed type representation for type float64 +// returns a *float64 when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslDouble4()(*float64) { + return m.webhookConfigInsecureSslDouble4 +} +// GetWebhookConfigInsecureSslString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslString()(*string) { + return m.webhookConfigInsecureSslString +} +// GetWebhookConfigInsecureSslString0 gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslString0()(*string) { + return m.webhookConfigInsecureSslString0 +} +// GetWebhookConfigInsecureSslString1 gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslString1()(*string) { + return m.webhookConfigInsecureSslString1 +} +// GetWebhookConfigInsecureSslString2 gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslString2()(*string) { + return m.webhookConfigInsecureSslString2 +} +// GetWebhookConfigInsecureSslString3 gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslString3()(*string) { + return m.webhookConfigInsecureSslString3 +} +// GetWebhookConfigInsecureSslString4 gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslString4()(*string) { + return m.webhookConfigInsecureSslString4 +} +// Serialize serializes information the current object +func (m *WebhookConfigInsecureSsl) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetDouble() != nil { + err := writer.WriteFloat64Value("", m.GetDouble()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslDouble() != nil { + err := writer.WriteFloat64Value("", m.GetWebhookConfigInsecureSslDouble()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslDouble0() != nil { + err := writer.WriteFloat64Value("", m.GetWebhookConfigInsecureSslDouble0()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslDouble1() != nil { + err := writer.WriteFloat64Value("", m.GetWebhookConfigInsecureSslDouble1()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslDouble2() != nil { + err := writer.WriteFloat64Value("", m.GetWebhookConfigInsecureSslDouble2()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslDouble3() != nil { + err := writer.WriteFloat64Value("", m.GetWebhookConfigInsecureSslDouble3()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslDouble4() != nil { + err := writer.WriteFloat64Value("", m.GetWebhookConfigInsecureSslDouble4()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslString() != nil { + err := writer.WriteStringValue("", m.GetWebhookConfigInsecureSslString()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslString0() != nil { + err := writer.WriteStringValue("", m.GetWebhookConfigInsecureSslString0()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslString1() != nil { + err := writer.WriteStringValue("", m.GetWebhookConfigInsecureSslString1()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslString2() != nil { + err := writer.WriteStringValue("", m.GetWebhookConfigInsecureSslString2()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslString3() != nil { + err := writer.WriteStringValue("", m.GetWebhookConfigInsecureSslString3()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslString4() != nil { + err := writer.WriteStringValue("", m.GetWebhookConfigInsecureSslString4()) + if err != nil { + return err + } + } + return nil +} +// SetDouble sets the double property value. Composed type representation for type float64 +func (m *WebhookConfigInsecureSsl) SetDouble(value *float64)() { + m.double = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *WebhookConfigInsecureSsl) SetString(value *string)() { + m.string = value +} +// SetWebhookConfigInsecureSslDouble sets the double property value. Composed type representation for type float64 +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslDouble(value *float64)() { + m.webhookConfigInsecureSslDouble = value +} +// SetWebhookConfigInsecureSslDouble0 sets the double property value. Composed type representation for type float64 +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslDouble0(value *float64)() { + m.webhookConfigInsecureSslDouble0 = value +} +// SetWebhookConfigInsecureSslDouble1 sets the double property value. Composed type representation for type float64 +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslDouble1(value *float64)() { + m.webhookConfigInsecureSslDouble1 = value +} +// SetWebhookConfigInsecureSslDouble2 sets the double property value. Composed type representation for type float64 +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslDouble2(value *float64)() { + m.webhookConfigInsecureSslDouble2 = value +} +// SetWebhookConfigInsecureSslDouble3 sets the double property value. Composed type representation for type float64 +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslDouble3(value *float64)() { + m.webhookConfigInsecureSslDouble3 = value +} +// SetWebhookConfigInsecureSslDouble4 sets the double property value. Composed type representation for type float64 +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslDouble4(value *float64)() { + m.webhookConfigInsecureSslDouble4 = value +} +// SetWebhookConfigInsecureSslString sets the string property value. Composed type representation for type string +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslString(value *string)() { + m.webhookConfigInsecureSslString = value +} +// SetWebhookConfigInsecureSslString0 sets the string property value. Composed type representation for type string +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslString0(value *string)() { + m.webhookConfigInsecureSslString0 = value +} +// SetWebhookConfigInsecureSslString1 sets the string property value. Composed type representation for type string +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslString1(value *string)() { + m.webhookConfigInsecureSslString1 = value +} +// SetWebhookConfigInsecureSslString2 sets the string property value. Composed type representation for type string +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslString2(value *string)() { + m.webhookConfigInsecureSslString2 = value +} +// SetWebhookConfigInsecureSslString3 sets the string property value. Composed type representation for type string +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslString3(value *string)() { + m.webhookConfigInsecureSslString3 = value +} +// SetWebhookConfigInsecureSslString4 sets the string property value. Composed type representation for type string +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslString4(value *string)() { + m.webhookConfigInsecureSslString4 = value +} +type WebhookConfigInsecureSslable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDouble()(*float64) + GetString()(*string) + GetWebhookConfigInsecureSslDouble()(*float64) + GetWebhookConfigInsecureSslDouble0()(*float64) + GetWebhookConfigInsecureSslDouble1()(*float64) + GetWebhookConfigInsecureSslDouble2()(*float64) + GetWebhookConfigInsecureSslDouble3()(*float64) + GetWebhookConfigInsecureSslDouble4()(*float64) + GetWebhookConfigInsecureSslString()(*string) + GetWebhookConfigInsecureSslString0()(*string) + GetWebhookConfigInsecureSslString1()(*string) + GetWebhookConfigInsecureSslString2()(*string) + GetWebhookConfigInsecureSslString3()(*string) + GetWebhookConfigInsecureSslString4()(*string) + SetDouble(value *float64)() + SetString(value *string)() + SetWebhookConfigInsecureSslDouble(value *float64)() + SetWebhookConfigInsecureSslDouble0(value *float64)() + SetWebhookConfigInsecureSslDouble1(value *float64)() + SetWebhookConfigInsecureSslDouble2(value *float64)() + SetWebhookConfigInsecureSslDouble3(value *float64)() + SetWebhookConfigInsecureSslDouble4(value *float64)() + SetWebhookConfigInsecureSslString(value *string)() + SetWebhookConfigInsecureSslString0(value *string)() + SetWebhookConfigInsecureSslString1(value *string)() + SetWebhookConfigInsecureSslString2(value *string)() + SetWebhookConfigInsecureSslString3(value *string)() + SetWebhookConfigInsecureSslString4(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/with_path_get_response_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/with_path_get_response_member1.go new file mode 100644 index 000000000..8d44ff8c0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/with_path_get_response_member1.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// WithPathGetResponseMember1 a list of directory items +type WithPathGetResponseMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewWithPathGetResponseMember1 instantiates a new WithPathGetResponseMember1 and sets the default values. +func NewWithPathGetResponseMember1()(*WithPathGetResponseMember1) { + m := &WithPathGetResponseMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWithPathGetResponseMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWithPathGetResponseMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWithPathGetResponseMember1(), 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 *WithPathGetResponseMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WithPathGetResponseMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *WithPathGetResponseMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *WithPathGetResponseMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type WithPathGetResponseMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow.go new file mode 100644 index 000000000..4d0fb6b6b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow.go @@ -0,0 +1,373 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Workflow a GitHub Actions workflow +type Workflow struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The badge_url property + badge_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The deleted_at property + deleted_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The html_url property + html_url *string + // The id property + id *int32 + // The name property + name *string + // The node_id property + node_id *string + // The path property + path *string + // The state property + state *Workflow_state + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewWorkflow instantiates a new Workflow and sets the default values. +func NewWorkflow()(*Workflow) { + m := &Workflow{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWorkflowFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWorkflowFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWorkflow(), 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 *Workflow) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBadgeUrl gets the badge_url property value. The badge_url property +// returns a *string when successful +func (m *Workflow) GetBadgeUrl()(*string) { + return m.badge_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Workflow) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDeletedAt gets the deleted_at property value. The deleted_at property +// returns a *Time when successful +func (m *Workflow) GetDeletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.deleted_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Workflow) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["badge_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBadgeUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["deleted_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDeletedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(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["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseWorkflow_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*Workflow_state)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Workflow) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Workflow) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *Workflow) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Workflow) GetNodeId()(*string) { + return m.node_id +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *Workflow) GetPath()(*string) { + return m.path +} +// GetState gets the state property value. The state property +// returns a *Workflow_state when successful +func (m *Workflow) GetState()(*Workflow_state) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Workflow) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Workflow) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Workflow) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("badge_url", m.GetBadgeUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("deleted_at", m.GetDeletedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Workflow) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBadgeUrl sets the badge_url property value. The badge_url property +func (m *Workflow) SetBadgeUrl(value *string)() { + m.badge_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Workflow) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDeletedAt sets the deleted_at property value. The deleted_at property +func (m *Workflow) SetDeletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.deleted_at = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Workflow) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Workflow) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *Workflow) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Workflow) SetNodeId(value *string)() { + m.node_id = value +} +// SetPath sets the path property value. The path property +func (m *Workflow) SetPath(value *string)() { + m.path = value +} +// SetState sets the state property value. The state property +func (m *Workflow) SetState(value *Workflow_state)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Workflow) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Workflow) SetUrl(value *string)() { + m.url = value +} +type Workflowable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBadgeUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDeletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetPath()(*string) + GetState()(*Workflow_state) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetBadgeUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDeletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetPath(value *string)() + SetState(value *Workflow_state)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run.go new file mode 100644 index 000000000..f9555ee99 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run.go @@ -0,0 +1,1121 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// WorkflowRun an invocation of a workflow +type WorkflowRun struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The URL to the artifacts for the workflow run. + artifacts_url *string + // The URL to cancel the workflow run. + cancel_url *string + // The ID of the associated check suite. + check_suite_id *int32 + // The node ID of the associated check suite. + check_suite_node_id *string + // The URL to the associated check suite. + check_suite_url *string + // The conclusion property + conclusion *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The event-specific title associated with the run or the run-name if set, or the value of `run-name` if it is set in the workflow. + display_title *string + // The event property + event *string + // The head_branch property + head_branch *string + // A commit. + head_commit NullableSimpleCommitable + // Minimal Repository + head_repository MinimalRepositoryable + // The head_repository_id property + head_repository_id *int32 + // The SHA of the head commit that points to the version of the workflow being run. + head_sha *string + // The html_url property + html_url *string + // The ID of the workflow run. + id *int32 + // The URL to the jobs for the workflow run. + jobs_url *string + // The URL to download the logs for the workflow run. + logs_url *string + // The name of the workflow run. + name *string + // The node_id property + node_id *string + // The full path of the workflow + path *string + // The URL to the previous attempted run of this workflow, if one exists. + previous_attempt_url *string + // Pull requests that are open with a `head_sha` or `head_branch` that matches the workflow run. The returned pull requests do not necessarily indicate pull requests that triggered the run. + pull_requests []PullRequestMinimalable + // The referenced_workflows property + referenced_workflows []ReferencedWorkflowable + // Minimal Repository + repository MinimalRepositoryable + // The URL to rerun the workflow run. + rerun_url *string + // Attempt number of the run, 1 for first attempt and higher if the workflow was re-run. + run_attempt *int32 + // The auto incrementing run number for the workflow run. + run_number *int32 + // The start time of the latest run. Resets on re-run. + run_started_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The status property + status *string + // A GitHub user. + triggering_actor SimpleUserable + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The URL to the workflow run. + url *string + // The ID of the parent workflow. + workflow_id *int32 + // The URL to the workflow. + workflow_url *string +} +// NewWorkflowRun instantiates a new WorkflowRun and sets the default values. +func NewWorkflowRun()(*WorkflowRun) { + m := &WorkflowRun{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWorkflowRunFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWorkflowRunFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWorkflowRun(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *WorkflowRun) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *WorkflowRun) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArtifactsUrl gets the artifacts_url property value. The URL to the artifacts for the workflow run. +// returns a *string when successful +func (m *WorkflowRun) GetArtifactsUrl()(*string) { + return m.artifacts_url +} +// GetCancelUrl gets the cancel_url property value. The URL to cancel the workflow run. +// returns a *string when successful +func (m *WorkflowRun) GetCancelUrl()(*string) { + return m.cancel_url +} +// GetCheckSuiteId gets the check_suite_id property value. The ID of the associated check suite. +// returns a *int32 when successful +func (m *WorkflowRun) GetCheckSuiteId()(*int32) { + return m.check_suite_id +} +// GetCheckSuiteNodeId gets the check_suite_node_id property value. The node ID of the associated check suite. +// returns a *string when successful +func (m *WorkflowRun) GetCheckSuiteNodeId()(*string) { + return m.check_suite_node_id +} +// GetCheckSuiteUrl gets the check_suite_url property value. The URL to the associated check suite. +// returns a *string when successful +func (m *WorkflowRun) GetCheckSuiteUrl()(*string) { + return m.check_suite_url +} +// GetConclusion gets the conclusion property value. The conclusion property +// returns a *string when successful +func (m *WorkflowRun) GetConclusion()(*string) { + return m.conclusion +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *WorkflowRun) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDisplayTitle gets the display_title property value. The event-specific title associated with the run or the run-name if set, or the value of `run-name` if it is set in the workflow. +// returns a *string when successful +func (m *WorkflowRun) GetDisplayTitle()(*string) { + return m.display_title +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *WorkflowRun) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WorkflowRun) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["artifacts_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArtifactsUrl(val) + } + return nil + } + res["cancel_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCancelUrl(val) + } + return nil + } + res["check_suite_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCheckSuiteId(val) + } + return nil + } + res["check_suite_node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCheckSuiteNodeId(val) + } + return nil + } + res["check_suite_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCheckSuiteUrl(val) + } + return nil + } + res["conclusion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetConclusion(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["display_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayTitle(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["head_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadBranch(val) + } + return nil + } + res["head_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleCommitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHeadCommit(val.(NullableSimpleCommitable)) + } + return nil + } + res["head_repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHeadRepository(val.(MinimalRepositoryable)) + } + return nil + } + res["head_repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetHeadRepositoryId(val) + } + return nil + } + res["head_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadSha(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["jobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetJobsUrl(val) + } + return nil + } + res["logs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogsUrl(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(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["previous_attempt_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviousAttemptUrl(val) + } + return nil + } + res["pull_requests"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePullRequestMinimalFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PullRequestMinimalable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PullRequestMinimalable) + } + } + m.SetPullRequests(res) + } + return nil + } + res["referenced_workflows"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateReferencedWorkflowFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ReferencedWorkflowable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ReferencedWorkflowable) + } + } + m.SetReferencedWorkflows(res) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(MinimalRepositoryable)) + } + return nil + } + res["rerun_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRerunUrl(val) + } + return nil + } + res["run_attempt"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunAttempt(val) + } + return nil + } + res["run_number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunNumber(val) + } + return nil + } + res["run_started_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetRunStartedAt(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + res["triggering_actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTriggeringActor(val.(SimpleUserable)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["workflow_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWorkflowId(val) + } + return nil + } + res["workflow_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWorkflowUrl(val) + } + return nil + } + return res +} +// GetHeadBranch gets the head_branch property value. The head_branch property +// returns a *string when successful +func (m *WorkflowRun) GetHeadBranch()(*string) { + return m.head_branch +} +// GetHeadCommit gets the head_commit property value. A commit. +// returns a NullableSimpleCommitable when successful +func (m *WorkflowRun) GetHeadCommit()(NullableSimpleCommitable) { + return m.head_commit +} +// GetHeadRepository gets the head_repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *WorkflowRun) GetHeadRepository()(MinimalRepositoryable) { + return m.head_repository +} +// GetHeadRepositoryId gets the head_repository_id property value. The head_repository_id property +// returns a *int32 when successful +func (m *WorkflowRun) GetHeadRepositoryId()(*int32) { + return m.head_repository_id +} +// GetHeadSha gets the head_sha property value. The SHA of the head commit that points to the version of the workflow being run. +// returns a *string when successful +func (m *WorkflowRun) GetHeadSha()(*string) { + return m.head_sha +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *WorkflowRun) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The ID of the workflow run. +// returns a *int32 when successful +func (m *WorkflowRun) GetId()(*int32) { + return m.id +} +// GetJobsUrl gets the jobs_url property value. The URL to the jobs for the workflow run. +// returns a *string when successful +func (m *WorkflowRun) GetJobsUrl()(*string) { + return m.jobs_url +} +// GetLogsUrl gets the logs_url property value. The URL to download the logs for the workflow run. +// returns a *string when successful +func (m *WorkflowRun) GetLogsUrl()(*string) { + return m.logs_url +} +// GetName gets the name property value. The name of the workflow run. +// returns a *string when successful +func (m *WorkflowRun) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *WorkflowRun) GetNodeId()(*string) { + return m.node_id +} +// GetPath gets the path property value. The full path of the workflow +// returns a *string when successful +func (m *WorkflowRun) GetPath()(*string) { + return m.path +} +// GetPreviousAttemptUrl gets the previous_attempt_url property value. The URL to the previous attempted run of this workflow, if one exists. +// returns a *string when successful +func (m *WorkflowRun) GetPreviousAttemptUrl()(*string) { + return m.previous_attempt_url +} +// GetPullRequests gets the pull_requests property value. Pull requests that are open with a `head_sha` or `head_branch` that matches the workflow run. The returned pull requests do not necessarily indicate pull requests that triggered the run. +// returns a []PullRequestMinimalable when successful +func (m *WorkflowRun) GetPullRequests()([]PullRequestMinimalable) { + return m.pull_requests +} +// GetReferencedWorkflows gets the referenced_workflows property value. The referenced_workflows property +// returns a []ReferencedWorkflowable when successful +func (m *WorkflowRun) GetReferencedWorkflows()([]ReferencedWorkflowable) { + return m.referenced_workflows +} +// GetRepository gets the repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *WorkflowRun) GetRepository()(MinimalRepositoryable) { + return m.repository +} +// GetRerunUrl gets the rerun_url property value. The URL to rerun the workflow run. +// returns a *string when successful +func (m *WorkflowRun) GetRerunUrl()(*string) { + return m.rerun_url +} +// GetRunAttempt gets the run_attempt property value. Attempt number of the run, 1 for first attempt and higher if the workflow was re-run. +// returns a *int32 when successful +func (m *WorkflowRun) GetRunAttempt()(*int32) { + return m.run_attempt +} +// GetRunNumber gets the run_number property value. The auto incrementing run number for the workflow run. +// returns a *int32 when successful +func (m *WorkflowRun) GetRunNumber()(*int32) { + return m.run_number +} +// GetRunStartedAt gets the run_started_at property value. The start time of the latest run. Resets on re-run. +// returns a *Time when successful +func (m *WorkflowRun) GetRunStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.run_started_at +} +// GetStatus gets the status property value. The status property +// returns a *string when successful +func (m *WorkflowRun) GetStatus()(*string) { + return m.status +} +// GetTriggeringActor gets the triggering_actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *WorkflowRun) GetTriggeringActor()(SimpleUserable) { + return m.triggering_actor +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *WorkflowRun) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The URL to the workflow run. +// returns a *string when successful +func (m *WorkflowRun) GetUrl()(*string) { + return m.url +} +// GetWorkflowId gets the workflow_id property value. The ID of the parent workflow. +// returns a *int32 when successful +func (m *WorkflowRun) GetWorkflowId()(*int32) { + return m.workflow_id +} +// GetWorkflowUrl gets the workflow_url property value. The URL to the workflow. +// returns a *string when successful +func (m *WorkflowRun) GetWorkflowUrl()(*string) { + return m.workflow_url +} +// Serialize serializes information the current object +func (m *WorkflowRun) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("artifacts_url", m.GetArtifactsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("cancel_url", m.GetCancelUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("check_suite_id", m.GetCheckSuiteId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("check_suite_node_id", m.GetCheckSuiteNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("check_suite_url", m.GetCheckSuiteUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("conclusion", m.GetConclusion()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("display_title", m.GetDisplayTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_branch", m.GetHeadBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("head_commit", m.GetHeadCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("head_repository", m.GetHeadRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("head_repository_id", m.GetHeadRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_sha", m.GetHeadSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("jobs_url", m.GetJobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("logs_url", m.GetLogsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("previous_attempt_url", m.GetPreviousAttemptUrl()) + if err != nil { + return err + } + } + if m.GetPullRequests() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetPullRequests())) + for i, v := range m.GetPullRequests() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("pull_requests", cast) + if err != nil { + return err + } + } + if m.GetReferencedWorkflows() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetReferencedWorkflows())) + for i, v := range m.GetReferencedWorkflows() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("referenced_workflows", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("rerun_url", m.GetRerunUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("run_attempt", m.GetRunAttempt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("run_number", m.GetRunNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("run_started_at", m.GetRunStartedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status", m.GetStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("triggering_actor", m.GetTriggeringActor()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("workflow_id", m.GetWorkflowId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("workflow_url", m.GetWorkflowUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *WorkflowRun) SetActor(value SimpleUserable)() { + m.actor = value +} +// 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 *WorkflowRun) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArtifactsUrl sets the artifacts_url property value. The URL to the artifacts for the workflow run. +func (m *WorkflowRun) SetArtifactsUrl(value *string)() { + m.artifacts_url = value +} +// SetCancelUrl sets the cancel_url property value. The URL to cancel the workflow run. +func (m *WorkflowRun) SetCancelUrl(value *string)() { + m.cancel_url = value +} +// SetCheckSuiteId sets the check_suite_id property value. The ID of the associated check suite. +func (m *WorkflowRun) SetCheckSuiteId(value *int32)() { + m.check_suite_id = value +} +// SetCheckSuiteNodeId sets the check_suite_node_id property value. The node ID of the associated check suite. +func (m *WorkflowRun) SetCheckSuiteNodeId(value *string)() { + m.check_suite_node_id = value +} +// SetCheckSuiteUrl sets the check_suite_url property value. The URL to the associated check suite. +func (m *WorkflowRun) SetCheckSuiteUrl(value *string)() { + m.check_suite_url = value +} +// SetConclusion sets the conclusion property value. The conclusion property +func (m *WorkflowRun) SetConclusion(value *string)() { + m.conclusion = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *WorkflowRun) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDisplayTitle sets the display_title property value. The event-specific title associated with the run or the run-name if set, or the value of `run-name` if it is set in the workflow. +func (m *WorkflowRun) SetDisplayTitle(value *string)() { + m.display_title = value +} +// SetEvent sets the event property value. The event property +func (m *WorkflowRun) SetEvent(value *string)() { + m.event = value +} +// SetHeadBranch sets the head_branch property value. The head_branch property +func (m *WorkflowRun) SetHeadBranch(value *string)() { + m.head_branch = value +} +// SetHeadCommit sets the head_commit property value. A commit. +func (m *WorkflowRun) SetHeadCommit(value NullableSimpleCommitable)() { + m.head_commit = value +} +// SetHeadRepository sets the head_repository property value. Minimal Repository +func (m *WorkflowRun) SetHeadRepository(value MinimalRepositoryable)() { + m.head_repository = value +} +// SetHeadRepositoryId sets the head_repository_id property value. The head_repository_id property +func (m *WorkflowRun) SetHeadRepositoryId(value *int32)() { + m.head_repository_id = value +} +// SetHeadSha sets the head_sha property value. The SHA of the head commit that points to the version of the workflow being run. +func (m *WorkflowRun) SetHeadSha(value *string)() { + m.head_sha = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *WorkflowRun) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The ID of the workflow run. +func (m *WorkflowRun) SetId(value *int32)() { + m.id = value +} +// SetJobsUrl sets the jobs_url property value. The URL to the jobs for the workflow run. +func (m *WorkflowRun) SetJobsUrl(value *string)() { + m.jobs_url = value +} +// SetLogsUrl sets the logs_url property value. The URL to download the logs for the workflow run. +func (m *WorkflowRun) SetLogsUrl(value *string)() { + m.logs_url = value +} +// SetName sets the name property value. The name of the workflow run. +func (m *WorkflowRun) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *WorkflowRun) SetNodeId(value *string)() { + m.node_id = value +} +// SetPath sets the path property value. The full path of the workflow +func (m *WorkflowRun) SetPath(value *string)() { + m.path = value +} +// SetPreviousAttemptUrl sets the previous_attempt_url property value. The URL to the previous attempted run of this workflow, if one exists. +func (m *WorkflowRun) SetPreviousAttemptUrl(value *string)() { + m.previous_attempt_url = value +} +// SetPullRequests sets the pull_requests property value. Pull requests that are open with a `head_sha` or `head_branch` that matches the workflow run. The returned pull requests do not necessarily indicate pull requests that triggered the run. +func (m *WorkflowRun) SetPullRequests(value []PullRequestMinimalable)() { + m.pull_requests = value +} +// SetReferencedWorkflows sets the referenced_workflows property value. The referenced_workflows property +func (m *WorkflowRun) SetReferencedWorkflows(value []ReferencedWorkflowable)() { + m.referenced_workflows = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *WorkflowRun) SetRepository(value MinimalRepositoryable)() { + m.repository = value +} +// SetRerunUrl sets the rerun_url property value. The URL to rerun the workflow run. +func (m *WorkflowRun) SetRerunUrl(value *string)() { + m.rerun_url = value +} +// SetRunAttempt sets the run_attempt property value. Attempt number of the run, 1 for first attempt and higher if the workflow was re-run. +func (m *WorkflowRun) SetRunAttempt(value *int32)() { + m.run_attempt = value +} +// SetRunNumber sets the run_number property value. The auto incrementing run number for the workflow run. +func (m *WorkflowRun) SetRunNumber(value *int32)() { + m.run_number = value +} +// SetRunStartedAt sets the run_started_at property value. The start time of the latest run. Resets on re-run. +func (m *WorkflowRun) SetRunStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.run_started_at = value +} +// SetStatus sets the status property value. The status property +func (m *WorkflowRun) SetStatus(value *string)() { + m.status = value +} +// SetTriggeringActor sets the triggering_actor property value. A GitHub user. +func (m *WorkflowRun) SetTriggeringActor(value SimpleUserable)() { + m.triggering_actor = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *WorkflowRun) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The URL to the workflow run. +func (m *WorkflowRun) SetUrl(value *string)() { + m.url = value +} +// SetWorkflowId sets the workflow_id property value. The ID of the parent workflow. +func (m *WorkflowRun) SetWorkflowId(value *int32)() { + m.workflow_id = value +} +// SetWorkflowUrl sets the workflow_url property value. The URL to the workflow. +func (m *WorkflowRun) SetWorkflowUrl(value *string)() { + m.workflow_url = value +} +type WorkflowRunable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetArtifactsUrl()(*string) + GetCancelUrl()(*string) + GetCheckSuiteId()(*int32) + GetCheckSuiteNodeId()(*string) + GetCheckSuiteUrl()(*string) + GetConclusion()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDisplayTitle()(*string) + GetEvent()(*string) + GetHeadBranch()(*string) + GetHeadCommit()(NullableSimpleCommitable) + GetHeadRepository()(MinimalRepositoryable) + GetHeadRepositoryId()(*int32) + GetHeadSha()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetJobsUrl()(*string) + GetLogsUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetPath()(*string) + GetPreviousAttemptUrl()(*string) + GetPullRequests()([]PullRequestMinimalable) + GetReferencedWorkflows()([]ReferencedWorkflowable) + GetRepository()(MinimalRepositoryable) + GetRerunUrl()(*string) + GetRunAttempt()(*int32) + GetRunNumber()(*int32) + GetRunStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetStatus()(*string) + GetTriggeringActor()(SimpleUserable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetWorkflowId()(*int32) + GetWorkflowUrl()(*string) + SetActor(value SimpleUserable)() + SetArtifactsUrl(value *string)() + SetCancelUrl(value *string)() + SetCheckSuiteId(value *int32)() + SetCheckSuiteNodeId(value *string)() + SetCheckSuiteUrl(value *string)() + SetConclusion(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDisplayTitle(value *string)() + SetEvent(value *string)() + SetHeadBranch(value *string)() + SetHeadCommit(value NullableSimpleCommitable)() + SetHeadRepository(value MinimalRepositoryable)() + SetHeadRepositoryId(value *int32)() + SetHeadSha(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetJobsUrl(value *string)() + SetLogsUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetPath(value *string)() + SetPreviousAttemptUrl(value *string)() + SetPullRequests(value []PullRequestMinimalable)() + SetReferencedWorkflows(value []ReferencedWorkflowable)() + SetRepository(value MinimalRepositoryable)() + SetRerunUrl(value *string)() + SetRunAttempt(value *int32)() + SetRunNumber(value *int32)() + SetRunStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetStatus(value *string)() + SetTriggeringActor(value SimpleUserable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetWorkflowId(value *int32)() + SetWorkflowUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage.go new file mode 100644 index 000000000..2814c3cd5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// WorkflowRunUsage workflow Run Usage +type WorkflowRunUsage struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The billable property + billable WorkflowRunUsage_billableable + // The run_duration_ms property + run_duration_ms *int32 +} +// NewWorkflowRunUsage instantiates a new WorkflowRunUsage and sets the default values. +func NewWorkflowRunUsage()(*WorkflowRunUsage) { + m := &WorkflowRunUsage{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWorkflowRunUsageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWorkflowRunUsageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWorkflowRunUsage(), 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 *WorkflowRunUsage) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBillable gets the billable property value. The billable property +// returns a WorkflowRunUsage_billableable when successful +func (m *WorkflowRunUsage) GetBillable()(WorkflowRunUsage_billableable) { + return m.billable +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WorkflowRunUsage) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["billable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateWorkflowRunUsage_billableFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBillable(val.(WorkflowRunUsage_billableable)) + } + return nil + } + res["run_duration_ms"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunDurationMs(val) + } + return nil + } + return res +} +// GetRunDurationMs gets the run_duration_ms property value. The run_duration_ms property +// returns a *int32 when successful +func (m *WorkflowRunUsage) GetRunDurationMs()(*int32) { + return m.run_duration_ms +} +// Serialize serializes information the current object +func (m *WorkflowRunUsage) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("billable", m.GetBillable()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("run_duration_ms", m.GetRunDurationMs()) + 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 *WorkflowRunUsage) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBillable sets the billable property value. The billable property +func (m *WorkflowRunUsage) SetBillable(value WorkflowRunUsage_billableable)() { + m.billable = value +} +// SetRunDurationMs sets the run_duration_ms property value. The run_duration_ms property +func (m *WorkflowRunUsage) SetRunDurationMs(value *int32)() { + m.run_duration_ms = value +} +type WorkflowRunUsageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBillable()(WorkflowRunUsage_billableable) + GetRunDurationMs()(*int32) + SetBillable(value WorkflowRunUsage_billableable)() + SetRunDurationMs(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable.go new file mode 100644 index 000000000..f1358d603 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type WorkflowRunUsage_billable struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The MACOS property + mACOS WorkflowRunUsage_billable_MACOSable + // The UBUNTU property + uBUNTU WorkflowRunUsage_billable_UBUNTUable + // The WINDOWS property + wINDOWS WorkflowRunUsage_billable_WINDOWSable +} +// NewWorkflowRunUsage_billable instantiates a new WorkflowRunUsage_billable and sets the default values. +func NewWorkflowRunUsage_billable()(*WorkflowRunUsage_billable) { + m := &WorkflowRunUsage_billable{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWorkflowRunUsage_billableFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWorkflowRunUsage_billableFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWorkflowRunUsage_billable(), 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 *WorkflowRunUsage_billable) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WorkflowRunUsage_billable) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["MACOS"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateWorkflowRunUsage_billable_MACOSFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMACOS(val.(WorkflowRunUsage_billable_MACOSable)) + } + return nil + } + res["UBUNTU"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateWorkflowRunUsage_billable_UBUNTUFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUBUNTU(val.(WorkflowRunUsage_billable_UBUNTUable)) + } + return nil + } + res["WINDOWS"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateWorkflowRunUsage_billable_WINDOWSFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetWINDOWS(val.(WorkflowRunUsage_billable_WINDOWSable)) + } + return nil + } + return res +} +// GetMACOS gets the MACOS property value. The MACOS property +// returns a WorkflowRunUsage_billable_MACOSable when successful +func (m *WorkflowRunUsage_billable) GetMACOS()(WorkflowRunUsage_billable_MACOSable) { + return m.mACOS +} +// GetUBUNTU gets the UBUNTU property value. The UBUNTU property +// returns a WorkflowRunUsage_billable_UBUNTUable when successful +func (m *WorkflowRunUsage_billable) GetUBUNTU()(WorkflowRunUsage_billable_UBUNTUable) { + return m.uBUNTU +} +// GetWINDOWS gets the WINDOWS property value. The WINDOWS property +// returns a WorkflowRunUsage_billable_WINDOWSable when successful +func (m *WorkflowRunUsage_billable) GetWINDOWS()(WorkflowRunUsage_billable_WINDOWSable) { + return m.wINDOWS +} +// Serialize serializes information the current object +func (m *WorkflowRunUsage_billable) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("MACOS", m.GetMACOS()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("UBUNTU", m.GetUBUNTU()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("WINDOWS", m.GetWINDOWS()) + 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 *WorkflowRunUsage_billable) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMACOS sets the MACOS property value. The MACOS property +func (m *WorkflowRunUsage_billable) SetMACOS(value WorkflowRunUsage_billable_MACOSable)() { + m.mACOS = value +} +// SetUBUNTU sets the UBUNTU property value. The UBUNTU property +func (m *WorkflowRunUsage_billable) SetUBUNTU(value WorkflowRunUsage_billable_UBUNTUable)() { + m.uBUNTU = value +} +// SetWINDOWS sets the WINDOWS property value. The WINDOWS property +func (m *WorkflowRunUsage_billable) SetWINDOWS(value WorkflowRunUsage_billable_WINDOWSable)() { + m.wINDOWS = value +} +type WorkflowRunUsage_billableable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMACOS()(WorkflowRunUsage_billable_MACOSable) + GetUBUNTU()(WorkflowRunUsage_billable_UBUNTUable) + GetWINDOWS()(WorkflowRunUsage_billable_WINDOWSable) + SetMACOS(value WorkflowRunUsage_billable_MACOSable)() + SetUBUNTU(value WorkflowRunUsage_billable_UBUNTUable)() + SetWINDOWS(value WorkflowRunUsage_billable_WINDOWSable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_m_a_c_o_s.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_m_a_c_o_s.go new file mode 100644 index 000000000..d2786c17f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_m_a_c_o_s.go @@ -0,0 +1,150 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type WorkflowRunUsage_billable_MACOS struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The job_runs property + job_runs []WorkflowRunUsage_billable_MACOS_job_runsable + // The jobs property + jobs *int32 + // The total_ms property + total_ms *int32 +} +// NewWorkflowRunUsage_billable_MACOS instantiates a new WorkflowRunUsage_billable_MACOS and sets the default values. +func NewWorkflowRunUsage_billable_MACOS()(*WorkflowRunUsage_billable_MACOS) { + m := &WorkflowRunUsage_billable_MACOS{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWorkflowRunUsage_billable_MACOSFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWorkflowRunUsage_billable_MACOSFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWorkflowRunUsage_billable_MACOS(), 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 *WorkflowRunUsage_billable_MACOS) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WorkflowRunUsage_billable_MACOS) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["job_runs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateWorkflowRunUsage_billable_MACOS_job_runsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]WorkflowRunUsage_billable_MACOS_job_runsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(WorkflowRunUsage_billable_MACOS_job_runsable) + } + } + m.SetJobRuns(res) + } + return nil + } + res["jobs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetJobs(val) + } + return nil + } + res["total_ms"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalMs(val) + } + return nil + } + return res +} +// GetJobRuns gets the job_runs property value. The job_runs property +// returns a []WorkflowRunUsage_billable_MACOS_job_runsable when successful +func (m *WorkflowRunUsage_billable_MACOS) GetJobRuns()([]WorkflowRunUsage_billable_MACOS_job_runsable) { + return m.job_runs +} +// GetJobs gets the jobs property value. The jobs property +// returns a *int32 when successful +func (m *WorkflowRunUsage_billable_MACOS) GetJobs()(*int32) { + return m.jobs +} +// GetTotalMs gets the total_ms property value. The total_ms property +// returns a *int32 when successful +func (m *WorkflowRunUsage_billable_MACOS) GetTotalMs()(*int32) { + return m.total_ms +} +// Serialize serializes information the current object +func (m *WorkflowRunUsage_billable_MACOS) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("jobs", m.GetJobs()) + if err != nil { + return err + } + } + if m.GetJobRuns() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetJobRuns())) + for i, v := range m.GetJobRuns() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("job_runs", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_ms", m.GetTotalMs()) + 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 *WorkflowRunUsage_billable_MACOS) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetJobRuns sets the job_runs property value. The job_runs property +func (m *WorkflowRunUsage_billable_MACOS) SetJobRuns(value []WorkflowRunUsage_billable_MACOS_job_runsable)() { + m.job_runs = value +} +// SetJobs sets the jobs property value. The jobs property +func (m *WorkflowRunUsage_billable_MACOS) SetJobs(value *int32)() { + m.jobs = value +} +// SetTotalMs sets the total_ms property value. The total_ms property +func (m *WorkflowRunUsage_billable_MACOS) SetTotalMs(value *int32)() { + m.total_ms = value +} +type WorkflowRunUsage_billable_MACOSable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetJobRuns()([]WorkflowRunUsage_billable_MACOS_job_runsable) + GetJobs()(*int32) + GetTotalMs()(*int32) + SetJobRuns(value []WorkflowRunUsage_billable_MACOS_job_runsable)() + SetJobs(value *int32)() + SetTotalMs(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_m_a_c_o_s_job_runs.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_m_a_c_o_s_job_runs.go new file mode 100644 index 000000000..218913459 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_m_a_c_o_s_job_runs.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type WorkflowRunUsage_billable_MACOS_job_runs struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The duration_ms property + duration_ms *int32 + // The job_id property + job_id *int32 +} +// NewWorkflowRunUsage_billable_MACOS_job_runs instantiates a new WorkflowRunUsage_billable_MACOS_job_runs and sets the default values. +func NewWorkflowRunUsage_billable_MACOS_job_runs()(*WorkflowRunUsage_billable_MACOS_job_runs) { + m := &WorkflowRunUsage_billable_MACOS_job_runs{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWorkflowRunUsage_billable_MACOS_job_runsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWorkflowRunUsage_billable_MACOS_job_runsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWorkflowRunUsage_billable_MACOS_job_runs(), 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 *WorkflowRunUsage_billable_MACOS_job_runs) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDurationMs gets the duration_ms property value. The duration_ms property +// returns a *int32 when successful +func (m *WorkflowRunUsage_billable_MACOS_job_runs) GetDurationMs()(*int32) { + return m.duration_ms +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WorkflowRunUsage_billable_MACOS_job_runs) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["duration_ms"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDurationMs(val) + } + return nil + } + res["job_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetJobId(val) + } + return nil + } + return res +} +// GetJobId gets the job_id property value. The job_id property +// returns a *int32 when successful +func (m *WorkflowRunUsage_billable_MACOS_job_runs) GetJobId()(*int32) { + return m.job_id +} +// Serialize serializes information the current object +func (m *WorkflowRunUsage_billable_MACOS_job_runs) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("duration_ms", m.GetDurationMs()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("job_id", m.GetJobId()) + 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 *WorkflowRunUsage_billable_MACOS_job_runs) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDurationMs sets the duration_ms property value. The duration_ms property +func (m *WorkflowRunUsage_billable_MACOS_job_runs) SetDurationMs(value *int32)() { + m.duration_ms = value +} +// SetJobId sets the job_id property value. The job_id property +func (m *WorkflowRunUsage_billable_MACOS_job_runs) SetJobId(value *int32)() { + m.job_id = value +} +type WorkflowRunUsage_billable_MACOS_job_runsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDurationMs()(*int32) + GetJobId()(*int32) + SetDurationMs(value *int32)() + SetJobId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_u_b_u_n_t_u.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_u_b_u_n_t_u.go new file mode 100644 index 000000000..8b0255bdb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_u_b_u_n_t_u.go @@ -0,0 +1,150 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type WorkflowRunUsage_billable_UBUNTU struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The job_runs property + job_runs []WorkflowRunUsage_billable_UBUNTU_job_runsable + // The jobs property + jobs *int32 + // The total_ms property + total_ms *int32 +} +// NewWorkflowRunUsage_billable_UBUNTU instantiates a new WorkflowRunUsage_billable_UBUNTU and sets the default values. +func NewWorkflowRunUsage_billable_UBUNTU()(*WorkflowRunUsage_billable_UBUNTU) { + m := &WorkflowRunUsage_billable_UBUNTU{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWorkflowRunUsage_billable_UBUNTUFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWorkflowRunUsage_billable_UBUNTUFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWorkflowRunUsage_billable_UBUNTU(), 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 *WorkflowRunUsage_billable_UBUNTU) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WorkflowRunUsage_billable_UBUNTU) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["job_runs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateWorkflowRunUsage_billable_UBUNTU_job_runsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]WorkflowRunUsage_billable_UBUNTU_job_runsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(WorkflowRunUsage_billable_UBUNTU_job_runsable) + } + } + m.SetJobRuns(res) + } + return nil + } + res["jobs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetJobs(val) + } + return nil + } + res["total_ms"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalMs(val) + } + return nil + } + return res +} +// GetJobRuns gets the job_runs property value. The job_runs property +// returns a []WorkflowRunUsage_billable_UBUNTU_job_runsable when successful +func (m *WorkflowRunUsage_billable_UBUNTU) GetJobRuns()([]WorkflowRunUsage_billable_UBUNTU_job_runsable) { + return m.job_runs +} +// GetJobs gets the jobs property value. The jobs property +// returns a *int32 when successful +func (m *WorkflowRunUsage_billable_UBUNTU) GetJobs()(*int32) { + return m.jobs +} +// GetTotalMs gets the total_ms property value. The total_ms property +// returns a *int32 when successful +func (m *WorkflowRunUsage_billable_UBUNTU) GetTotalMs()(*int32) { + return m.total_ms +} +// Serialize serializes information the current object +func (m *WorkflowRunUsage_billable_UBUNTU) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("jobs", m.GetJobs()) + if err != nil { + return err + } + } + if m.GetJobRuns() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetJobRuns())) + for i, v := range m.GetJobRuns() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("job_runs", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_ms", m.GetTotalMs()) + 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 *WorkflowRunUsage_billable_UBUNTU) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetJobRuns sets the job_runs property value. The job_runs property +func (m *WorkflowRunUsage_billable_UBUNTU) SetJobRuns(value []WorkflowRunUsage_billable_UBUNTU_job_runsable)() { + m.job_runs = value +} +// SetJobs sets the jobs property value. The jobs property +func (m *WorkflowRunUsage_billable_UBUNTU) SetJobs(value *int32)() { + m.jobs = value +} +// SetTotalMs sets the total_ms property value. The total_ms property +func (m *WorkflowRunUsage_billable_UBUNTU) SetTotalMs(value *int32)() { + m.total_ms = value +} +type WorkflowRunUsage_billable_UBUNTUable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetJobRuns()([]WorkflowRunUsage_billable_UBUNTU_job_runsable) + GetJobs()(*int32) + GetTotalMs()(*int32) + SetJobRuns(value []WorkflowRunUsage_billable_UBUNTU_job_runsable)() + SetJobs(value *int32)() + SetTotalMs(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_u_b_u_n_t_u_job_runs.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_u_b_u_n_t_u_job_runs.go new file mode 100644 index 000000000..539a07620 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_u_b_u_n_t_u_job_runs.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type WorkflowRunUsage_billable_UBUNTU_job_runs struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The duration_ms property + duration_ms *int32 + // The job_id property + job_id *int32 +} +// NewWorkflowRunUsage_billable_UBUNTU_job_runs instantiates a new WorkflowRunUsage_billable_UBUNTU_job_runs and sets the default values. +func NewWorkflowRunUsage_billable_UBUNTU_job_runs()(*WorkflowRunUsage_billable_UBUNTU_job_runs) { + m := &WorkflowRunUsage_billable_UBUNTU_job_runs{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWorkflowRunUsage_billable_UBUNTU_job_runsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWorkflowRunUsage_billable_UBUNTU_job_runsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWorkflowRunUsage_billable_UBUNTU_job_runs(), 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 *WorkflowRunUsage_billable_UBUNTU_job_runs) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDurationMs gets the duration_ms property value. The duration_ms property +// returns a *int32 when successful +func (m *WorkflowRunUsage_billable_UBUNTU_job_runs) GetDurationMs()(*int32) { + return m.duration_ms +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WorkflowRunUsage_billable_UBUNTU_job_runs) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["duration_ms"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDurationMs(val) + } + return nil + } + res["job_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetJobId(val) + } + return nil + } + return res +} +// GetJobId gets the job_id property value. The job_id property +// returns a *int32 when successful +func (m *WorkflowRunUsage_billable_UBUNTU_job_runs) GetJobId()(*int32) { + return m.job_id +} +// Serialize serializes information the current object +func (m *WorkflowRunUsage_billable_UBUNTU_job_runs) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("duration_ms", m.GetDurationMs()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("job_id", m.GetJobId()) + 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 *WorkflowRunUsage_billable_UBUNTU_job_runs) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDurationMs sets the duration_ms property value. The duration_ms property +func (m *WorkflowRunUsage_billable_UBUNTU_job_runs) SetDurationMs(value *int32)() { + m.duration_ms = value +} +// SetJobId sets the job_id property value. The job_id property +func (m *WorkflowRunUsage_billable_UBUNTU_job_runs) SetJobId(value *int32)() { + m.job_id = value +} +type WorkflowRunUsage_billable_UBUNTU_job_runsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDurationMs()(*int32) + GetJobId()(*int32) + SetDurationMs(value *int32)() + SetJobId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_w_i_n_d_o_w_s.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_w_i_n_d_o_w_s.go new file mode 100644 index 000000000..abe068594 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_w_i_n_d_o_w_s.go @@ -0,0 +1,150 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type WorkflowRunUsage_billable_WINDOWS struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The job_runs property + job_runs []WorkflowRunUsage_billable_WINDOWS_job_runsable + // The jobs property + jobs *int32 + // The total_ms property + total_ms *int32 +} +// NewWorkflowRunUsage_billable_WINDOWS instantiates a new WorkflowRunUsage_billable_WINDOWS and sets the default values. +func NewWorkflowRunUsage_billable_WINDOWS()(*WorkflowRunUsage_billable_WINDOWS) { + m := &WorkflowRunUsage_billable_WINDOWS{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWorkflowRunUsage_billable_WINDOWSFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWorkflowRunUsage_billable_WINDOWSFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWorkflowRunUsage_billable_WINDOWS(), 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 *WorkflowRunUsage_billable_WINDOWS) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WorkflowRunUsage_billable_WINDOWS) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["job_runs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateWorkflowRunUsage_billable_WINDOWS_job_runsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]WorkflowRunUsage_billable_WINDOWS_job_runsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(WorkflowRunUsage_billable_WINDOWS_job_runsable) + } + } + m.SetJobRuns(res) + } + return nil + } + res["jobs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetJobs(val) + } + return nil + } + res["total_ms"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalMs(val) + } + return nil + } + return res +} +// GetJobRuns gets the job_runs property value. The job_runs property +// returns a []WorkflowRunUsage_billable_WINDOWS_job_runsable when successful +func (m *WorkflowRunUsage_billable_WINDOWS) GetJobRuns()([]WorkflowRunUsage_billable_WINDOWS_job_runsable) { + return m.job_runs +} +// GetJobs gets the jobs property value. The jobs property +// returns a *int32 when successful +func (m *WorkflowRunUsage_billable_WINDOWS) GetJobs()(*int32) { + return m.jobs +} +// GetTotalMs gets the total_ms property value. The total_ms property +// returns a *int32 when successful +func (m *WorkflowRunUsage_billable_WINDOWS) GetTotalMs()(*int32) { + return m.total_ms +} +// Serialize serializes information the current object +func (m *WorkflowRunUsage_billable_WINDOWS) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("jobs", m.GetJobs()) + if err != nil { + return err + } + } + if m.GetJobRuns() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetJobRuns())) + for i, v := range m.GetJobRuns() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("job_runs", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_ms", m.GetTotalMs()) + 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 *WorkflowRunUsage_billable_WINDOWS) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetJobRuns sets the job_runs property value. The job_runs property +func (m *WorkflowRunUsage_billable_WINDOWS) SetJobRuns(value []WorkflowRunUsage_billable_WINDOWS_job_runsable)() { + m.job_runs = value +} +// SetJobs sets the jobs property value. The jobs property +func (m *WorkflowRunUsage_billable_WINDOWS) SetJobs(value *int32)() { + m.jobs = value +} +// SetTotalMs sets the total_ms property value. The total_ms property +func (m *WorkflowRunUsage_billable_WINDOWS) SetTotalMs(value *int32)() { + m.total_ms = value +} +type WorkflowRunUsage_billable_WINDOWSable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetJobRuns()([]WorkflowRunUsage_billable_WINDOWS_job_runsable) + GetJobs()(*int32) + GetTotalMs()(*int32) + SetJobRuns(value []WorkflowRunUsage_billable_WINDOWS_job_runsable)() + SetJobs(value *int32)() + SetTotalMs(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_w_i_n_d_o_w_s_job_runs.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_w_i_n_d_o_w_s_job_runs.go new file mode 100644 index 000000000..74ced2b63 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_run_usage_billable_w_i_n_d_o_w_s_job_runs.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type WorkflowRunUsage_billable_WINDOWS_job_runs struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The duration_ms property + duration_ms *int32 + // The job_id property + job_id *int32 +} +// NewWorkflowRunUsage_billable_WINDOWS_job_runs instantiates a new WorkflowRunUsage_billable_WINDOWS_job_runs and sets the default values. +func NewWorkflowRunUsage_billable_WINDOWS_job_runs()(*WorkflowRunUsage_billable_WINDOWS_job_runs) { + m := &WorkflowRunUsage_billable_WINDOWS_job_runs{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWorkflowRunUsage_billable_WINDOWS_job_runsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWorkflowRunUsage_billable_WINDOWS_job_runsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWorkflowRunUsage_billable_WINDOWS_job_runs(), 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 *WorkflowRunUsage_billable_WINDOWS_job_runs) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDurationMs gets the duration_ms property value. The duration_ms property +// returns a *int32 when successful +func (m *WorkflowRunUsage_billable_WINDOWS_job_runs) GetDurationMs()(*int32) { + return m.duration_ms +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WorkflowRunUsage_billable_WINDOWS_job_runs) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["duration_ms"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDurationMs(val) + } + return nil + } + res["job_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetJobId(val) + } + return nil + } + return res +} +// GetJobId gets the job_id property value. The job_id property +// returns a *int32 when successful +func (m *WorkflowRunUsage_billable_WINDOWS_job_runs) GetJobId()(*int32) { + return m.job_id +} +// Serialize serializes information the current object +func (m *WorkflowRunUsage_billable_WINDOWS_job_runs) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("duration_ms", m.GetDurationMs()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("job_id", m.GetJobId()) + 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 *WorkflowRunUsage_billable_WINDOWS_job_runs) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDurationMs sets the duration_ms property value. The duration_ms property +func (m *WorkflowRunUsage_billable_WINDOWS_job_runs) SetDurationMs(value *int32)() { + m.duration_ms = value +} +// SetJobId sets the job_id property value. The job_id property +func (m *WorkflowRunUsage_billable_WINDOWS_job_runs) SetJobId(value *int32)() { + m.job_id = value +} +type WorkflowRunUsage_billable_WINDOWS_job_runsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDurationMs()(*int32) + GetJobId()(*int32) + SetDurationMs(value *int32)() + SetJobId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_state.go new file mode 100644 index 000000000..9078846d5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_state.go @@ -0,0 +1,45 @@ +package models +import ( + "errors" +) +type Workflow_state int + +const ( + ACTIVE_WORKFLOW_STATE Workflow_state = iota + DELETED_WORKFLOW_STATE + DISABLED_FORK_WORKFLOW_STATE + DISABLED_INACTIVITY_WORKFLOW_STATE + DISABLED_MANUALLY_WORKFLOW_STATE +) + +func (i Workflow_state) String() string { + return []string{"active", "deleted", "disabled_fork", "disabled_inactivity", "disabled_manually"}[i] +} +func ParseWorkflow_state(v string) (any, error) { + result := ACTIVE_WORKFLOW_STATE + switch v { + case "active": + result = ACTIVE_WORKFLOW_STATE + case "deleted": + result = DELETED_WORKFLOW_STATE + case "disabled_fork": + result = DISABLED_FORK_WORKFLOW_STATE + case "disabled_inactivity": + result = DISABLED_INACTIVITY_WORKFLOW_STATE + case "disabled_manually": + result = DISABLED_MANUALLY_WORKFLOW_STATE + default: + return 0, errors.New("Unknown Workflow_state value: " + v) + } + return &result, nil +} +func SerializeWorkflow_state(values []Workflow_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Workflow_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_usage.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_usage.go new file mode 100644 index 000000000..22447553c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_usage.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// WorkflowUsage workflow Usage +type WorkflowUsage struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The billable property + billable WorkflowUsage_billableable +} +// NewWorkflowUsage instantiates a new WorkflowUsage and sets the default values. +func NewWorkflowUsage()(*WorkflowUsage) { + m := &WorkflowUsage{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWorkflowUsageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWorkflowUsageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWorkflowUsage(), 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 *WorkflowUsage) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBillable gets the billable property value. The billable property +// returns a WorkflowUsage_billableable when successful +func (m *WorkflowUsage) GetBillable()(WorkflowUsage_billableable) { + return m.billable +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WorkflowUsage) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["billable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateWorkflowUsage_billableFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBillable(val.(WorkflowUsage_billableable)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *WorkflowUsage) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("billable", m.GetBillable()) + 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 *WorkflowUsage) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBillable sets the billable property value. The billable property +func (m *WorkflowUsage) SetBillable(value WorkflowUsage_billableable)() { + m.billable = value +} +type WorkflowUsageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBillable()(WorkflowUsage_billableable) + SetBillable(value WorkflowUsage_billableable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_usage_billable.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_usage_billable.go new file mode 100644 index 000000000..ed371458b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_usage_billable.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type WorkflowUsage_billable struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The MACOS property + mACOS WorkflowUsage_billable_MACOSable + // The UBUNTU property + uBUNTU WorkflowUsage_billable_UBUNTUable + // The WINDOWS property + wINDOWS WorkflowUsage_billable_WINDOWSable +} +// NewWorkflowUsage_billable instantiates a new WorkflowUsage_billable and sets the default values. +func NewWorkflowUsage_billable()(*WorkflowUsage_billable) { + m := &WorkflowUsage_billable{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWorkflowUsage_billableFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWorkflowUsage_billableFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWorkflowUsage_billable(), 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 *WorkflowUsage_billable) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WorkflowUsage_billable) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["MACOS"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateWorkflowUsage_billable_MACOSFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMACOS(val.(WorkflowUsage_billable_MACOSable)) + } + return nil + } + res["UBUNTU"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateWorkflowUsage_billable_UBUNTUFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUBUNTU(val.(WorkflowUsage_billable_UBUNTUable)) + } + return nil + } + res["WINDOWS"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateWorkflowUsage_billable_WINDOWSFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetWINDOWS(val.(WorkflowUsage_billable_WINDOWSable)) + } + return nil + } + return res +} +// GetMACOS gets the MACOS property value. The MACOS property +// returns a WorkflowUsage_billable_MACOSable when successful +func (m *WorkflowUsage_billable) GetMACOS()(WorkflowUsage_billable_MACOSable) { + return m.mACOS +} +// GetUBUNTU gets the UBUNTU property value. The UBUNTU property +// returns a WorkflowUsage_billable_UBUNTUable when successful +func (m *WorkflowUsage_billable) GetUBUNTU()(WorkflowUsage_billable_UBUNTUable) { + return m.uBUNTU +} +// GetWINDOWS gets the WINDOWS property value. The WINDOWS property +// returns a WorkflowUsage_billable_WINDOWSable when successful +func (m *WorkflowUsage_billable) GetWINDOWS()(WorkflowUsage_billable_WINDOWSable) { + return m.wINDOWS +} +// Serialize serializes information the current object +func (m *WorkflowUsage_billable) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("MACOS", m.GetMACOS()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("UBUNTU", m.GetUBUNTU()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("WINDOWS", m.GetWINDOWS()) + 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 *WorkflowUsage_billable) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMACOS sets the MACOS property value. The MACOS property +func (m *WorkflowUsage_billable) SetMACOS(value WorkflowUsage_billable_MACOSable)() { + m.mACOS = value +} +// SetUBUNTU sets the UBUNTU property value. The UBUNTU property +func (m *WorkflowUsage_billable) SetUBUNTU(value WorkflowUsage_billable_UBUNTUable)() { + m.uBUNTU = value +} +// SetWINDOWS sets the WINDOWS property value. The WINDOWS property +func (m *WorkflowUsage_billable) SetWINDOWS(value WorkflowUsage_billable_WINDOWSable)() { + m.wINDOWS = value +} +type WorkflowUsage_billableable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMACOS()(WorkflowUsage_billable_MACOSable) + GetUBUNTU()(WorkflowUsage_billable_UBUNTUable) + GetWINDOWS()(WorkflowUsage_billable_WINDOWSable) + SetMACOS(value WorkflowUsage_billable_MACOSable)() + SetUBUNTU(value WorkflowUsage_billable_UBUNTUable)() + SetWINDOWS(value WorkflowUsage_billable_WINDOWSable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_usage_billable_m_a_c_o_s.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_usage_billable_m_a_c_o_s.go new file mode 100644 index 000000000..ddce7130e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_usage_billable_m_a_c_o_s.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type WorkflowUsage_billable_MACOS struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The total_ms property + total_ms *int32 +} +// NewWorkflowUsage_billable_MACOS instantiates a new WorkflowUsage_billable_MACOS and sets the default values. +func NewWorkflowUsage_billable_MACOS()(*WorkflowUsage_billable_MACOS) { + m := &WorkflowUsage_billable_MACOS{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWorkflowUsage_billable_MACOSFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWorkflowUsage_billable_MACOSFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWorkflowUsage_billable_MACOS(), 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 *WorkflowUsage_billable_MACOS) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WorkflowUsage_billable_MACOS) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["total_ms"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalMs(val) + } + return nil + } + return res +} +// GetTotalMs gets the total_ms property value. The total_ms property +// returns a *int32 when successful +func (m *WorkflowUsage_billable_MACOS) GetTotalMs()(*int32) { + return m.total_ms +} +// Serialize serializes information the current object +func (m *WorkflowUsage_billable_MACOS) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_ms", m.GetTotalMs()) + 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 *WorkflowUsage_billable_MACOS) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalMs sets the total_ms property value. The total_ms property +func (m *WorkflowUsage_billable_MACOS) SetTotalMs(value *int32)() { + m.total_ms = value +} +type WorkflowUsage_billable_MACOSable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalMs()(*int32) + SetTotalMs(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_usage_billable_u_b_u_n_t_u.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_usage_billable_u_b_u_n_t_u.go new file mode 100644 index 000000000..b8edca484 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_usage_billable_u_b_u_n_t_u.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type WorkflowUsage_billable_UBUNTU struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The total_ms property + total_ms *int32 +} +// NewWorkflowUsage_billable_UBUNTU instantiates a new WorkflowUsage_billable_UBUNTU and sets the default values. +func NewWorkflowUsage_billable_UBUNTU()(*WorkflowUsage_billable_UBUNTU) { + m := &WorkflowUsage_billable_UBUNTU{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWorkflowUsage_billable_UBUNTUFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWorkflowUsage_billable_UBUNTUFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWorkflowUsage_billable_UBUNTU(), 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 *WorkflowUsage_billable_UBUNTU) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WorkflowUsage_billable_UBUNTU) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["total_ms"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalMs(val) + } + return nil + } + return res +} +// GetTotalMs gets the total_ms property value. The total_ms property +// returns a *int32 when successful +func (m *WorkflowUsage_billable_UBUNTU) GetTotalMs()(*int32) { + return m.total_ms +} +// Serialize serializes information the current object +func (m *WorkflowUsage_billable_UBUNTU) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_ms", m.GetTotalMs()) + 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 *WorkflowUsage_billable_UBUNTU) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalMs sets the total_ms property value. The total_ms property +func (m *WorkflowUsage_billable_UBUNTU) SetTotalMs(value *int32)() { + m.total_ms = value +} +type WorkflowUsage_billable_UBUNTUable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalMs()(*int32) + SetTotalMs(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_usage_billable_w_i_n_d_o_w_s.go b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_usage_billable_w_i_n_d_o_w_s.go new file mode 100644 index 000000000..41a062d99 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/models/workflow_usage_billable_w_i_n_d_o_w_s.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type WorkflowUsage_billable_WINDOWS struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The total_ms property + total_ms *int32 +} +// NewWorkflowUsage_billable_WINDOWS instantiates a new WorkflowUsage_billable_WINDOWS and sets the default values. +func NewWorkflowUsage_billable_WINDOWS()(*WorkflowUsage_billable_WINDOWS) { + m := &WorkflowUsage_billable_WINDOWS{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWorkflowUsage_billable_WINDOWSFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWorkflowUsage_billable_WINDOWSFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWorkflowUsage_billable_WINDOWS(), 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 *WorkflowUsage_billable_WINDOWS) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WorkflowUsage_billable_WINDOWS) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["total_ms"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalMs(val) + } + return nil + } + return res +} +// GetTotalMs gets the total_ms property value. The total_ms property +// returns a *int32 when successful +func (m *WorkflowUsage_billable_WINDOWS) GetTotalMs()(*int32) { + return m.total_ms +} +// Serialize serializes information the current object +func (m *WorkflowUsage_billable_WINDOWS) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_ms", m.GetTotalMs()) + 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 *WorkflowUsage_billable_WINDOWS) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalMs sets the total_ms property value. The total_ms property +func (m *WorkflowUsage_billable_WINDOWS) SetTotalMs(value *int32)() { + m.total_ms = value +} +type WorkflowUsage_billable_WINDOWSable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalMs()(*int32) + SetTotalMs(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/networks/item_item_events_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/networks/item_item_events_request_builder.go new file mode 100644 index 000000000..7e9dbfb06 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/networks/item_item_events_request_builder.go @@ -0,0 +1,72 @@ +package networks + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemEventsRequestBuilder builds and executes requests for operations under \networks\{owner}\{repo}\events +type ItemItemEventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemEventsRequestBuilderGetQueryParameters list public events for a network of repositories +type ItemItemEventsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemEventsRequestBuilderInternal instantiates a new ItemItemEventsRequestBuilder and sets the default values. +func NewItemItemEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEventsRequestBuilder) { + m := &ItemItemEventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/networks/{owner}/{repo}/events{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemEventsRequestBuilder instantiates a new ItemItemEventsRequestBuilder and sets the default values. +func NewItemItemEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list public events for a network of repositories +// returns a []Eventable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories +func (m *ItemItemEventsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEventsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEventFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable) + } + } + return val, nil +} +// returns a *RequestInformation when successful +func (m *ItemItemEventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEventsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemEventsRequestBuilder when successful +func (m *ItemItemEventsRequestBuilder) WithUrl(rawUrl string)(*ItemItemEventsRequestBuilder) { + return NewItemItemEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/networks/item_with_repo_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/networks/item_with_repo_item_request_builder.go new file mode 100644 index 000000000..f02c418be --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/networks/item_with_repo_item_request_builder.go @@ -0,0 +1,28 @@ +package networks + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemWithRepoItemRequestBuilder builds and executes requests for operations under \networks\{owner}\{repo} +type ItemWithRepoItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemWithRepoItemRequestBuilderInternal instantiates a new ItemWithRepoItemRequestBuilder and sets the default values. +func NewItemWithRepoItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWithRepoItemRequestBuilder) { + m := &ItemWithRepoItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/networks/{owner}/{repo}", pathParameters), + } + return m +} +// NewItemWithRepoItemRequestBuilder instantiates a new ItemWithRepoItemRequestBuilder and sets the default values. +func NewItemWithRepoItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWithRepoItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemWithRepoItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Events the events property +// returns a *ItemItemEventsRequestBuilder when successful +func (m *ItemWithRepoItemRequestBuilder) Events()(*ItemItemEventsRequestBuilder) { + return NewItemItemEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/networks/networks_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/networks/networks_request_builder.go new file mode 100644 index 000000000..d9d2a94e0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/networks/networks_request_builder.go @@ -0,0 +1,35 @@ +package networks + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// NetworksRequestBuilder builds and executes requests for operations under \networks +type NetworksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByOwner gets an item from the github.com/octokit/go-sdk/pkg/github.networks.item collection +// returns a *WithOwnerItemRequestBuilder when successful +func (m *NetworksRequestBuilder) ByOwner(owner string)(*WithOwnerItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if owner != "" { + urlTplParams["owner"] = owner + } + return NewWithOwnerItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewNetworksRequestBuilderInternal instantiates a new NetworksRequestBuilder and sets the default values. +func NewNetworksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*NetworksRequestBuilder) { + m := &NetworksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/networks", pathParameters), + } + return m +} +// NewNetworksRequestBuilder instantiates a new NetworksRequestBuilder and sets the default values. +func NewNetworksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*NetworksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewNetworksRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/networks/with_owner_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/networks/with_owner_item_request_builder.go new file mode 100644 index 000000000..b69b47edf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/networks/with_owner_item_request_builder.go @@ -0,0 +1,35 @@ +package networks + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// WithOwnerItemRequestBuilder builds and executes requests for operations under \networks\{owner} +type WithOwnerItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRepo gets an item from the github.com/octokit/go-sdk/pkg/github.networks.item.item collection +// returns a *ItemWithRepoItemRequestBuilder when successful +func (m *WithOwnerItemRequestBuilder) ByRepo(repo string)(*ItemWithRepoItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if repo != "" { + urlTplParams["repo"] = repo + } + return NewItemWithRepoItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewWithOwnerItemRequestBuilderInternal instantiates a new WithOwnerItemRequestBuilder and sets the default values. +func NewWithOwnerItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithOwnerItemRequestBuilder) { + m := &WithOwnerItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/networks/{owner}", pathParameters), + } + return m +} +// NewWithOwnerItemRequestBuilder instantiates a new WithOwnerItemRequestBuilder and sets the default values. +func NewWithOwnerItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithOwnerItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithOwnerItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/notifications/notifications_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/notifications/notifications_put_request_body.go new file mode 100644 index 000000000..f4bad88d7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/notifications/notifications_put_request_body.go @@ -0,0 +1,110 @@ +package notifications + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type NotificationsPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp. + last_read_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Whether the notification has been read. + read *bool +} +// NewNotificationsPutRequestBody instantiates a new NotificationsPutRequestBody and sets the default values. +func NewNotificationsPutRequestBody()(*NotificationsPutRequestBody) { + m := &NotificationsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNotificationsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNotificationsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNotificationsPutRequestBody(), 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 *NotificationsPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NotificationsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["last_read_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastReadAt(val) + } + return nil + } + res["read"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRead(val) + } + return nil + } + return res +} +// GetLastReadAt gets the last_read_at property value. Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp. +// returns a *Time when successful +func (m *NotificationsPutRequestBody) GetLastReadAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.last_read_at +} +// GetRead gets the read property value. Whether the notification has been read. +// returns a *bool when successful +func (m *NotificationsPutRequestBody) GetRead()(*bool) { + return m.read +} +// Serialize serializes information the current object +func (m *NotificationsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("last_read_at", m.GetLastReadAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("read", m.GetRead()) + 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 *NotificationsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLastReadAt sets the last_read_at property value. Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp. +func (m *NotificationsPutRequestBody) SetLastReadAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.last_read_at = value +} +// SetRead sets the read property value. Whether the notification has been read. +func (m *NotificationsPutRequestBody) SetRead(value *bool)() { + m.read = value +} +type NotificationsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLastReadAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetRead()(*bool) + SetLastReadAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetRead(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/notifications/notifications_put_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/notifications/notifications_put_response.go new file mode 100644 index 000000000..35f2fa9dd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/notifications/notifications_put_response.go @@ -0,0 +1,80 @@ +package notifications + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type NotificationsPutResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The message property + message *string +} +// NewNotificationsPutResponse instantiates a new NotificationsPutResponse and sets the default values. +func NewNotificationsPutResponse()(*NotificationsPutResponse) { + m := &NotificationsPutResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNotificationsPutResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNotificationsPutResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNotificationsPutResponse(), 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 *NotificationsPutResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NotificationsPutResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *NotificationsPutResponse) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *NotificationsPutResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *NotificationsPutResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. The message property +func (m *NotificationsPutResponse) SetMessage(value *string)() { + m.message = value +} +type NotificationsPutResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/notifications/notifications_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/notifications/notifications_request_builder.go new file mode 100644 index 000000000..f1c998f40 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/notifications/notifications_request_builder.go @@ -0,0 +1,126 @@ +package notifications + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// NotificationsRequestBuilder builds and executes requests for operations under \notifications +type NotificationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NotificationsRequestBuilderGetQueryParameters list all notifications for the current user, sorted by most recently updated. +type NotificationsRequestBuilderGetQueryParameters struct { + // If `true`, show notifications marked as read. + All *bool `uriparametername:"all"` + // Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Before *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"before"` + // 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"` + // If `true`, only shows notifications in which the user is directly participating or mentioned. + Participating *bool `uriparametername:"participating"` + // The number of results per page (max 50). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` +} +// NewNotificationsRequestBuilderInternal instantiates a new NotificationsRequestBuilder and sets the default values. +func NewNotificationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*NotificationsRequestBuilder) { + m := &NotificationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/notifications{?all*,before*,page*,participating*,per_page*,since*}", pathParameters), + } + return m +} +// NewNotificationsRequestBuilder instantiates a new NotificationsRequestBuilder and sets the default values. +func NewNotificationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*NotificationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewNotificationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all notifications for the current user, sorted by most recently updated. +// returns a []Threadable 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 +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user +func (m *NotificationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[NotificationsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Threadable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateThreadFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Threadable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Threadable) + } + } + return val, nil +} +// Put marks all notifications as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. +// returns a NotificationsPutResponseable 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/activity/notifications#mark-notifications-as-read +func (m *NotificationsRequestBuilder) Put(ctx context.Context, body NotificationsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(NotificationsPutResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateNotificationsPutResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(NotificationsPutResponseable), nil +} +// Threads the threads property +// returns a *ThreadsRequestBuilder when successful +func (m *NotificationsRequestBuilder) Threads()(*ThreadsRequestBuilder) { + return NewThreadsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation list all notifications for the current user, sorted by most recently updated. +// returns a *RequestInformation when successful +func (m *NotificationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[NotificationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation marks all notifications as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. +// returns a *RequestInformation when successful +func (m *NotificationsRequestBuilder) ToPutRequestInformation(ctx context.Context, body NotificationsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *NotificationsRequestBuilder when successful +func (m *NotificationsRequestBuilder) WithUrl(rawUrl string)(*NotificationsRequestBuilder) { + return NewNotificationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/notifications/notifications_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/notifications/notifications_response.go new file mode 100644 index 000000000..0dce649d3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/notifications/notifications_response.go @@ -0,0 +1,28 @@ +package notifications + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NotificationsResponse +// Deprecated: This class is obsolete. Use notificationsPutResponse instead. +type NotificationsResponse struct { + NotificationsPutResponse +} +// NewNotificationsResponse instantiates a new notificationsResponse and sets the default values. +func NewNotificationsResponse()(*NotificationsResponse) { + m := &NotificationsResponse{ + NotificationsPutResponse: *NewNotificationsPutResponse(), + } + return m +} +// CreateNotificationsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateNotificationsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNotificationsResponse(), nil +} +// NotificationsResponseable +// Deprecated: This class is obsolete. Use notificationsPutResponse instead. +type NotificationsResponseable interface { + NotificationsPutResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/notifications/threads_item_subscription_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/notifications/threads_item_subscription_put_request_body.go new file mode 100644 index 000000000..c4780b470 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/notifications/threads_item_subscription_put_request_body.go @@ -0,0 +1,80 @@ +package notifications + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ThreadsItemSubscriptionPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether to block all notifications from a thread. + ignored *bool +} +// NewThreadsItemSubscriptionPutRequestBody instantiates a new ThreadsItemSubscriptionPutRequestBody and sets the default values. +func NewThreadsItemSubscriptionPutRequestBody()(*ThreadsItemSubscriptionPutRequestBody) { + m := &ThreadsItemSubscriptionPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateThreadsItemSubscriptionPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateThreadsItemSubscriptionPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewThreadsItemSubscriptionPutRequestBody(), 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 *ThreadsItemSubscriptionPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ThreadsItemSubscriptionPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ignored"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIgnored(val) + } + return nil + } + return res +} +// GetIgnored gets the ignored property value. Whether to block all notifications from a thread. +// returns a *bool when successful +func (m *ThreadsItemSubscriptionPutRequestBody) GetIgnored()(*bool) { + return m.ignored +} +// Serialize serializes information the current object +func (m *ThreadsItemSubscriptionPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("ignored", m.GetIgnored()) + 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 *ThreadsItemSubscriptionPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIgnored sets the ignored property value. Whether to block all notifications from a thread. +func (m *ThreadsItemSubscriptionPutRequestBody) SetIgnored(value *bool)() { + m.ignored = value +} +type ThreadsItemSubscriptionPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIgnored()(*bool) + SetIgnored(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/notifications/threads_item_subscription_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/notifications/threads_item_subscription_request_builder.go new file mode 100644 index 000000000..5ecbfb989 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/notifications/threads_item_subscription_request_builder.go @@ -0,0 +1,129 @@ +package notifications + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ThreadsItemSubscriptionRequestBuilder builds and executes requests for operations under \notifications\threads\{thread_id}\subscription +type ThreadsItemSubscriptionRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewThreadsItemSubscriptionRequestBuilderInternal instantiates a new ThreadsItemSubscriptionRequestBuilder and sets the default values. +func NewThreadsItemSubscriptionRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ThreadsItemSubscriptionRequestBuilder) { + m := &ThreadsItemSubscriptionRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/notifications/threads/{thread_id}/subscription", pathParameters), + } + return m +} +// NewThreadsItemSubscriptionRequestBuilder instantiates a new ThreadsItemSubscriptionRequestBuilder and sets the default values. +func NewThreadsItemSubscriptionRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ThreadsItemSubscriptionRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewThreadsItemSubscriptionRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/activity/notifications#set-a-thread-subscription) endpoint and set `ignore` to `true`. +// 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/activity/notifications#delete-a-thread-subscription +func (m *ThreadsItemSubscriptionRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get this checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/activity/watching#get-a-repository-subscription).Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread. +// returns a ThreadSubscriptionable 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/activity/notifications#get-a-thread-subscription-for-the-authenticated-user +func (m *ThreadsItemSubscriptionRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ThreadSubscriptionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateThreadSubscriptionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ThreadSubscriptionable), nil +} +// Put if you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**.You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription) endpoint. +// returns a ThreadSubscriptionable 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/activity/notifications#set-a-thread-subscription +func (m *ThreadsItemSubscriptionRequestBuilder) Put(ctx context.Context, body ThreadsItemSubscriptionPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ThreadSubscriptionable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateThreadSubscriptionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ThreadSubscriptionable), nil +} +// ToDeleteRequestInformation mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/activity/notifications#set-a-thread-subscription) endpoint and set `ignore` to `true`. +// returns a *RequestInformation when successful +func (m *ThreadsItemSubscriptionRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation this checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/activity/watching#get-a-repository-subscription).Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread. +// returns a *RequestInformation when successful +func (m *ThreadsItemSubscriptionRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation if you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**.You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription) endpoint. +// returns a *RequestInformation when successful +func (m *ThreadsItemSubscriptionRequestBuilder) ToPutRequestInformation(ctx context.Context, body ThreadsItemSubscriptionPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ThreadsItemSubscriptionRequestBuilder when successful +func (m *ThreadsItemSubscriptionRequestBuilder) WithUrl(rawUrl string)(*ThreadsItemSubscriptionRequestBuilder) { + return NewThreadsItemSubscriptionRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/notifications/threads_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/notifications/threads_request_builder.go new file mode 100644 index 000000000..e4d612ecf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/notifications/threads_request_builder.go @@ -0,0 +1,34 @@ +package notifications + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ThreadsRequestBuilder builds and executes requests for operations under \notifications\threads +type ThreadsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByThread_id gets an item from the github.com/octokit/go-sdk/pkg/github.notifications.threads.item collection +// returns a *ThreadsWithThread_ItemRequestBuilder when successful +func (m *ThreadsRequestBuilder) ByThread_id(thread_id int32)(*ThreadsWithThread_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["thread_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(thread_id), 10) + return NewThreadsWithThread_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewThreadsRequestBuilderInternal instantiates a new ThreadsRequestBuilder and sets the default values. +func NewThreadsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ThreadsRequestBuilder) { + m := &ThreadsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/notifications/threads", pathParameters), + } + return m +} +// NewThreadsRequestBuilder instantiates a new ThreadsRequestBuilder and sets the default values. +func NewThreadsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ThreadsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewThreadsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/notifications/threads_with_thread_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/notifications/threads_with_thread_item_request_builder.go new file mode 100644 index 000000000..a5a376f21 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/notifications/threads_with_thread_item_request_builder.go @@ -0,0 +1,117 @@ +package notifications + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ThreadsWithThread_ItemRequestBuilder builds and executes requests for operations under \notifications\threads\{thread_id} +type ThreadsWithThread_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewThreadsWithThread_ItemRequestBuilderInternal instantiates a new ThreadsWithThread_ItemRequestBuilder and sets the default values. +func NewThreadsWithThread_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ThreadsWithThread_ItemRequestBuilder) { + m := &ThreadsWithThread_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/notifications/threads/{thread_id}", pathParameters), + } + return m +} +// NewThreadsWithThread_ItemRequestBuilder instantiates a new ThreadsWithThread_ItemRequestBuilder and sets the default values. +func NewThreadsWithThread_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ThreadsWithThread_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewThreadsWithThread_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete marks a thread as "done." Marking a thread as "done" is equivalent to marking a notification in your notification inbox on GitHub as done: https://github.com/notifications. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-done +func (m *ThreadsWithThread_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets information about a notification thread. +// returns a Threadable 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/activity/notifications#get-a-thread +func (m *ThreadsWithThread_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Threadable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateThreadFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Threadable), nil +} +// Patch marks a thread as "read." Marking a thread as "read" is equivalent to clicking a notification in your notification inbox on GitHub: https://github.com/notifications. +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read +func (m *ThreadsWithThread_ItemRequestBuilder) Patch(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Subscription the subscription property +// returns a *ThreadsItemSubscriptionRequestBuilder when successful +func (m *ThreadsWithThread_ItemRequestBuilder) Subscription()(*ThreadsItemSubscriptionRequestBuilder) { + return NewThreadsItemSubscriptionRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation marks a thread as "done." Marking a thread as "done" is equivalent to marking a notification in your notification inbox on GitHub as done: https://github.com/notifications. +// returns a *RequestInformation when successful +func (m *ThreadsWithThread_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets information about a notification thread. +// returns a *RequestInformation when successful +func (m *ThreadsWithThread_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation marks a thread as "read." Marking a thread as "read" is equivalent to clicking a notification in your notification inbox on GitHub: https://github.com/notifications. +// returns a *RequestInformation when successful +func (m *ThreadsWithThread_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ThreadsWithThread_ItemRequestBuilder when successful +func (m *ThreadsWithThread_ItemRequestBuilder) WithUrl(rawUrl string)(*ThreadsWithThread_ItemRequestBuilder) { + return NewThreadsWithThread_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/octocat/octocat_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/octocat/octocat_request_builder.go new file mode 100644 index 000000000..ae91689d0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/octocat/octocat_request_builder.go @@ -0,0 +1,61 @@ +package octocat + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// OctocatRequestBuilder builds and executes requests for operations under \octocat +type OctocatRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// OctocatRequestBuilderGetQueryParameters get the octocat as ASCII art +type OctocatRequestBuilderGetQueryParameters struct { + // The words to show in Octocat's speech bubble + S *string `uriparametername:"s"` +} +// NewOctocatRequestBuilderInternal instantiates a new OctocatRequestBuilder and sets the default values. +func NewOctocatRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OctocatRequestBuilder) { + m := &OctocatRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/octocat{?s*}", pathParameters), + } + return m +} +// NewOctocatRequestBuilder instantiates a new OctocatRequestBuilder and sets the default values. +func NewOctocatRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OctocatRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewOctocatRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get the octocat as ASCII art +// returns a []byte when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/meta/meta#get-octocat +func (m *OctocatRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[OctocatRequestBuilderGetQueryParameters])([]byte, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.([]byte), nil +} +// ToGetRequestInformation get the octocat as ASCII art +// returns a *RequestInformation when successful +func (m *OctocatRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[OctocatRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/octocat-stream") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *OctocatRequestBuilder when successful +func (m *OctocatRequestBuilder) WithUrl(rawUrl string)(*OctocatRequestBuilder) { + return NewOctocatRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/organizations/organizations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/organizations/organizations_request_builder.go new file mode 100644 index 000000000..24b3a8a55 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/organizations/organizations_request_builder.go @@ -0,0 +1,67 @@ +package organizations + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// OrganizationsRequestBuilder builds and executes requests for operations under \organizations +type OrganizationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// OrganizationsRequestBuilderGetQueryParameters lists all organizations, in the order that they were created.**Note:** Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of organizations. +type OrganizationsRequestBuilderGetQueryParameters struct { + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // An organization ID. Only return organizations with an ID greater than this ID. + Since *int32 `uriparametername:"since"` +} +// NewOrganizationsRequestBuilderInternal instantiates a new OrganizationsRequestBuilder and sets the default values. +func NewOrganizationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OrganizationsRequestBuilder) { + m := &OrganizationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/organizations{?per_page*,since*}", pathParameters), + } + return m +} +// NewOrganizationsRequestBuilder instantiates a new OrganizationsRequestBuilder and sets the default values. +func NewOrganizationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OrganizationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewOrganizationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all organizations, in the order that they were created.**Note:** Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of organizations. +// returns a []OrganizationSimpleable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/orgs#list-organizations +func (m *OrganizationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[OrganizationsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationSimpleFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationSimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationSimpleable) + } + } + return val, nil +} +// ToGetRequestInformation lists all organizations, in the order that they were created.**Note:** Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of organizations. +// returns a *RequestInformation when successful +func (m *OrganizationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[OrganizationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *OrganizationsRequestBuilder when successful +func (m *OrganizationsRequestBuilder) WithUrl(rawUrl string)(*OrganizationsRequestBuilder) { + return NewOrganizationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codescanning/alerts/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codescanning/alerts/get_direction_query_parameter_type.go new file mode 100644 index 000000000..70606a8da --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codescanning/alerts/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codescanning/alerts/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codescanning/alerts/get_sort_query_parameter_type.go new file mode 100644 index 000000000..bc094eda5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codescanning/alerts/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_advanced_security.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_advanced_security.go new file mode 100644 index 000000000..cecb782b2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_advanced_security.go @@ -0,0 +1,37 @@ +package configurations +import ( + "errors" +) +// The enablement status of GitHub Advanced Security +type ConfigurationsPostRequestBody_advanced_security int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_ADVANCED_SECURITY ConfigurationsPostRequestBody_advanced_security = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_ADVANCED_SECURITY +) + +func (i ConfigurationsPostRequestBody_advanced_security) String() string { + return []string{"enabled", "disabled"}[i] +} +func ParseConfigurationsPostRequestBody_advanced_security(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_ADVANCED_SECURITY + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_ADVANCED_SECURITY + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_ADVANCED_SECURITY + default: + return 0, errors.New("Unknown ConfigurationsPostRequestBody_advanced_security value: " + v) + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_advanced_security(values []ConfigurationsPostRequestBody_advanced_security) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_advanced_security) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_code_scanning_default_setup.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_code_scanning_default_setup.go new file mode 100644 index 000000000..b18aa0bf6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_code_scanning_default_setup.go @@ -0,0 +1,40 @@ +package configurations +import ( + "errors" +) +// The enablement status of code scanning default setup +type ConfigurationsPostRequestBody_code_scanning_default_setup int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP ConfigurationsPostRequestBody_code_scanning_default_setup = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP + NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP +) + +func (i ConfigurationsPostRequestBody_code_scanning_default_setup) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseConfigurationsPostRequestBody_code_scanning_default_setup(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP + case "not_set": + result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP + default: + return 0, errors.New("Unknown ConfigurationsPostRequestBody_code_scanning_default_setup value: " + v) + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_code_scanning_default_setup(values []ConfigurationsPostRequestBody_code_scanning_default_setup) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_code_scanning_default_setup) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_dependabot_alerts.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_dependabot_alerts.go new file mode 100644 index 000000000..9a83b7c57 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_dependabot_alerts.go @@ -0,0 +1,40 @@ +package configurations +import ( + "errors" +) +// The enablement status of Dependabot alerts +type ConfigurationsPostRequestBody_dependabot_alerts int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_ALERTS ConfigurationsPostRequestBody_dependabot_alerts = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_ALERTS + NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_ALERTS +) + +func (i ConfigurationsPostRequestBody_dependabot_alerts) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseConfigurationsPostRequestBody_dependabot_alerts(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_ALERTS + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_ALERTS + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_ALERTS + case "not_set": + result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_ALERTS + default: + return 0, errors.New("Unknown ConfigurationsPostRequestBody_dependabot_alerts value: " + v) + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_dependabot_alerts(values []ConfigurationsPostRequestBody_dependabot_alerts) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_dependabot_alerts) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_dependabot_security_updates.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_dependabot_security_updates.go new file mode 100644 index 000000000..bb975a4f3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_dependabot_security_updates.go @@ -0,0 +1,40 @@ +package configurations +import ( + "errors" +) +// The enablement status of Dependabot security updates +type ConfigurationsPostRequestBody_dependabot_security_updates int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_SECURITY_UPDATES ConfigurationsPostRequestBody_dependabot_security_updates = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_SECURITY_UPDATES + NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_SECURITY_UPDATES +) + +func (i ConfigurationsPostRequestBody_dependabot_security_updates) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseConfigurationsPostRequestBody_dependabot_security_updates(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_SECURITY_UPDATES + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_SECURITY_UPDATES + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_SECURITY_UPDATES + case "not_set": + result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_SECURITY_UPDATES + default: + return 0, errors.New("Unknown ConfigurationsPostRequestBody_dependabot_security_updates value: " + v) + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_dependabot_security_updates(values []ConfigurationsPostRequestBody_dependabot_security_updates) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_dependabot_security_updates) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_dependency_graph.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_dependency_graph.go new file mode 100644 index 000000000..80a486f02 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_dependency_graph.go @@ -0,0 +1,40 @@ +package configurations +import ( + "errors" +) +// The enablement status of Dependency Graph +type ConfigurationsPostRequestBody_dependency_graph int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH ConfigurationsPostRequestBody_dependency_graph = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH + NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH +) + +func (i ConfigurationsPostRequestBody_dependency_graph) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseConfigurationsPostRequestBody_dependency_graph(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH + case "not_set": + result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH + default: + return 0, errors.New("Unknown ConfigurationsPostRequestBody_dependency_graph value: " + v) + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_dependency_graph(values []ConfigurationsPostRequestBody_dependency_graph) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_dependency_graph) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_private_vulnerability_reporting.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_private_vulnerability_reporting.go new file mode 100644 index 000000000..c8b98e595 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_private_vulnerability_reporting.go @@ -0,0 +1,40 @@ +package configurations +import ( + "errors" +) +// The enablement status of private vulnerability reporting +type ConfigurationsPostRequestBody_private_vulnerability_reporting int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING ConfigurationsPostRequestBody_private_vulnerability_reporting = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING + NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING +) + +func (i ConfigurationsPostRequestBody_private_vulnerability_reporting) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseConfigurationsPostRequestBody_private_vulnerability_reporting(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING + case "not_set": + result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING + default: + return 0, errors.New("Unknown ConfigurationsPostRequestBody_private_vulnerability_reporting value: " + v) + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_private_vulnerability_reporting(values []ConfigurationsPostRequestBody_private_vulnerability_reporting) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_private_vulnerability_reporting) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_secret_scanning.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_secret_scanning.go new file mode 100644 index 000000000..97ae2a457 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_secret_scanning.go @@ -0,0 +1,40 @@ +package configurations +import ( + "errors" +) +// The enablement status of secret scanning +type ConfigurationsPostRequestBody_secret_scanning int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING ConfigurationsPostRequestBody_secret_scanning = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING + NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING +) + +func (i ConfigurationsPostRequestBody_secret_scanning) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseConfigurationsPostRequestBody_secret_scanning(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING + case "not_set": + result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING + default: + return 0, errors.New("Unknown ConfigurationsPostRequestBody_secret_scanning value: " + v) + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_secret_scanning(values []ConfigurationsPostRequestBody_secret_scanning) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_secret_scanning) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_secret_scanning_push_protection.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_secret_scanning_push_protection.go new file mode 100644 index 000000000..3f411e473 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_secret_scanning_push_protection.go @@ -0,0 +1,40 @@ +package configurations +import ( + "errors" +) +// The enablement status of secret scanning push protection +type ConfigurationsPostRequestBody_secret_scanning_push_protection int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION ConfigurationsPostRequestBody_secret_scanning_push_protection = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION + NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION +) + +func (i ConfigurationsPostRequestBody_secret_scanning_push_protection) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseConfigurationsPostRequestBody_secret_scanning_push_protection(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION + case "not_set": + result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION + default: + return 0, errors.New("Unknown ConfigurationsPostRequestBody_secret_scanning_push_protection value: " + v) + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_secret_scanning_push_protection(values []ConfigurationsPostRequestBody_secret_scanning_push_protection) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_secret_scanning_push_protection) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/get_target_type_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/get_target_type_query_parameter_type.go new file mode 100644 index 000000000..2dd790b4a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations/get_target_type_query_parameter_type.go @@ -0,0 +1,36 @@ +package configurations +import ( + "errors" +) +type GetTarget_typeQueryParameterType int + +const ( + GLOBAL_GETTARGET_TYPEQUERYPARAMETERTYPE GetTarget_typeQueryParameterType = iota + ALL_GETTARGET_TYPEQUERYPARAMETERTYPE +) + +func (i GetTarget_typeQueryParameterType) String() string { + return []string{"global", "all"}[i] +} +func ParseGetTarget_typeQueryParameterType(v string) (any, error) { + result := GLOBAL_GETTARGET_TYPEQUERYPARAMETERTYPE + switch v { + case "global": + result = GLOBAL_GETTARGET_TYPEQUERYPARAMETERTYPE + case "all": + result = ALL_GETTARGET_TYPEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetTarget_typeQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetTarget_typeQueryParameterType(values []GetTarget_typeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetTarget_typeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/dependabot/alerts/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/dependabot/alerts/get_direction_query_parameter_type.go new file mode 100644 index 000000000..70606a8da --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/dependabot/alerts/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/dependabot/alerts/get_scope_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/dependabot/alerts/get_scope_query_parameter_type.go new file mode 100644 index 000000000..906bdb78d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/dependabot/alerts/get_scope_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetScopeQueryParameterType int + +const ( + DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE GetScopeQueryParameterType = iota + RUNTIME_GETSCOPEQUERYPARAMETERTYPE +) + +func (i GetScopeQueryParameterType) String() string { + return []string{"development", "runtime"}[i] +} +func ParseGetScopeQueryParameterType(v string) (any, error) { + result := DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE + switch v { + case "development": + result = DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE + case "runtime": + result = RUNTIME_GETSCOPEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetScopeQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetScopeQueryParameterType(values []GetScopeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetScopeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/dependabot/alerts/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/dependabot/alerts/get_sort_query_parameter_type.go new file mode 100644 index 000000000..bc094eda5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/dependabot/alerts/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/invitations/get_invitation_source_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/invitations/get_invitation_source_query_parameter_type.go new file mode 100644 index 000000000..9048b9434 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/invitations/get_invitation_source_query_parameter_type.go @@ -0,0 +1,39 @@ +package invitations +import ( + "errors" +) +type GetInvitation_sourceQueryParameterType int + +const ( + ALL_GETINVITATION_SOURCEQUERYPARAMETERTYPE GetInvitation_sourceQueryParameterType = iota + MEMBER_GETINVITATION_SOURCEQUERYPARAMETERTYPE + SCIM_GETINVITATION_SOURCEQUERYPARAMETERTYPE +) + +func (i GetInvitation_sourceQueryParameterType) String() string { + return []string{"all", "member", "scim"}[i] +} +func ParseGetInvitation_sourceQueryParameterType(v string) (any, error) { + result := ALL_GETINVITATION_SOURCEQUERYPARAMETERTYPE + switch v { + case "all": + result = ALL_GETINVITATION_SOURCEQUERYPARAMETERTYPE + case "member": + result = MEMBER_GETINVITATION_SOURCEQUERYPARAMETERTYPE + case "scim": + result = SCIM_GETINVITATION_SOURCEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetInvitation_sourceQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetInvitation_sourceQueryParameterType(values []GetInvitation_sourceQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetInvitation_sourceQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/invitations/get_role_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/invitations/get_role_query_parameter_type.go new file mode 100644 index 000000000..afd7d40ba --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/invitations/get_role_query_parameter_type.go @@ -0,0 +1,45 @@ +package invitations +import ( + "errors" +) +type GetRoleQueryParameterType int + +const ( + ALL_GETROLEQUERYPARAMETERTYPE GetRoleQueryParameterType = iota + ADMIN_GETROLEQUERYPARAMETERTYPE + DIRECT_MEMBER_GETROLEQUERYPARAMETERTYPE + BILLING_MANAGER_GETROLEQUERYPARAMETERTYPE + HIRING_MANAGER_GETROLEQUERYPARAMETERTYPE +) + +func (i GetRoleQueryParameterType) String() string { + return []string{"all", "admin", "direct_member", "billing_manager", "hiring_manager"}[i] +} +func ParseGetRoleQueryParameterType(v string) (any, error) { + result := ALL_GETROLEQUERYPARAMETERTYPE + switch v { + case "all": + result = ALL_GETROLEQUERYPARAMETERTYPE + case "admin": + result = ADMIN_GETROLEQUERYPARAMETERTYPE + case "direct_member": + result = DIRECT_MEMBER_GETROLEQUERYPARAMETERTYPE + case "billing_manager": + result = BILLING_MANAGER_GETROLEQUERYPARAMETERTYPE + case "hiring_manager": + result = HIRING_MANAGER_GETROLEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetRoleQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetRoleQueryParameterType(values []GetRoleQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetRoleQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/invitations/invitations_post_request_body_role.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/invitations/invitations_post_request_body_role.go new file mode 100644 index 000000000..ad8464790 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/invitations/invitations_post_request_body_role.go @@ -0,0 +1,43 @@ +package invitations +import ( + "errors" +) +// The role for the new member. * `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. * `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. * `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. * `reinstate` - The previous role assigned to the invitee before they were removed from your organization. Can be one of the roles listed above. Only works if the invitee was previously part of your organization. +type InvitationsPostRequestBody_role int + +const ( + ADMIN_INVITATIONSPOSTREQUESTBODY_ROLE InvitationsPostRequestBody_role = iota + DIRECT_MEMBER_INVITATIONSPOSTREQUESTBODY_ROLE + BILLING_MANAGER_INVITATIONSPOSTREQUESTBODY_ROLE + REINSTATE_INVITATIONSPOSTREQUESTBODY_ROLE +) + +func (i InvitationsPostRequestBody_role) String() string { + return []string{"admin", "direct_member", "billing_manager", "reinstate"}[i] +} +func ParseInvitationsPostRequestBody_role(v string) (any, error) { + result := ADMIN_INVITATIONSPOSTREQUESTBODY_ROLE + switch v { + case "admin": + result = ADMIN_INVITATIONSPOSTREQUESTBODY_ROLE + case "direct_member": + result = DIRECT_MEMBER_INVITATIONSPOSTREQUESTBODY_ROLE + case "billing_manager": + result = BILLING_MANAGER_INVITATIONSPOSTREQUESTBODY_ROLE + case "reinstate": + result = REINSTATE_INVITATIONSPOSTREQUESTBODY_ROLE + default: + return 0, errors.New("Unknown InvitationsPostRequestBody_role value: " + v) + } + return &result, nil +} +func SerializeInvitationsPostRequestBody_role(values []InvitationsPostRequestBody_role) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i InvitationsPostRequestBody_role) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/issues/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/issues/get_direction_query_parameter_type.go new file mode 100644 index 000000000..6aca6ecb9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/issues/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package issues +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/issues/get_filter_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/issues/get_filter_query_parameter_type.go new file mode 100644 index 000000000..bd35fa09b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/issues/get_filter_query_parameter_type.go @@ -0,0 +1,48 @@ +package issues +import ( + "errors" +) +type GetFilterQueryParameterType int + +const ( + ASSIGNED_GETFILTERQUERYPARAMETERTYPE GetFilterQueryParameterType = iota + CREATED_GETFILTERQUERYPARAMETERTYPE + MENTIONED_GETFILTERQUERYPARAMETERTYPE + SUBSCRIBED_GETFILTERQUERYPARAMETERTYPE + REPOS_GETFILTERQUERYPARAMETERTYPE + ALL_GETFILTERQUERYPARAMETERTYPE +) + +func (i GetFilterQueryParameterType) String() string { + return []string{"assigned", "created", "mentioned", "subscribed", "repos", "all"}[i] +} +func ParseGetFilterQueryParameterType(v string) (any, error) { + result := ASSIGNED_GETFILTERQUERYPARAMETERTYPE + switch v { + case "assigned": + result = ASSIGNED_GETFILTERQUERYPARAMETERTYPE + case "created": + result = CREATED_GETFILTERQUERYPARAMETERTYPE + case "mentioned": + result = MENTIONED_GETFILTERQUERYPARAMETERTYPE + case "subscribed": + result = SUBSCRIBED_GETFILTERQUERYPARAMETERTYPE + case "repos": + result = REPOS_GETFILTERQUERYPARAMETERTYPE + case "all": + result = ALL_GETFILTERQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetFilterQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetFilterQueryParameterType(values []GetFilterQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetFilterQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/issues/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/issues/get_sort_query_parameter_type.go new file mode 100644 index 000000000..ba962acfb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/issues/get_sort_query_parameter_type.go @@ -0,0 +1,39 @@ +package issues +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + COMMENTS_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "comments"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "comments": + result = COMMENTS_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/issues/get_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/issues/get_state_query_parameter_type.go new file mode 100644 index 000000000..554151074 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/issues/get_state_query_parameter_type.go @@ -0,0 +1,39 @@ +package issues +import ( + "errors" +) +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/members/get_filter_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/members/get_filter_query_parameter_type.go new file mode 100644 index 000000000..fcf97ec97 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/members/get_filter_query_parameter_type.go @@ -0,0 +1,36 @@ +package members +import ( + "errors" +) +type GetFilterQueryParameterType int + +const ( + TWOFA_DISABLED_GETFILTERQUERYPARAMETERTYPE GetFilterQueryParameterType = iota + ALL_GETFILTERQUERYPARAMETERTYPE +) + +func (i GetFilterQueryParameterType) String() string { + return []string{"2fa_disabled", "all"}[i] +} +func ParseGetFilterQueryParameterType(v string) (any, error) { + result := TWOFA_DISABLED_GETFILTERQUERYPARAMETERTYPE + switch v { + case "2fa_disabled": + result = TWOFA_DISABLED_GETFILTERQUERYPARAMETERTYPE + case "all": + result = ALL_GETFILTERQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetFilterQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetFilterQueryParameterType(values []GetFilterQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetFilterQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/members/get_role_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/members/get_role_query_parameter_type.go new file mode 100644 index 000000000..b8a87b1ff --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/members/get_role_query_parameter_type.go @@ -0,0 +1,39 @@ +package members +import ( + "errors" +) +type GetRoleQueryParameterType int + +const ( + ALL_GETROLEQUERYPARAMETERTYPE GetRoleQueryParameterType = iota + ADMIN_GETROLEQUERYPARAMETERTYPE + MEMBER_GETROLEQUERYPARAMETERTYPE +) + +func (i GetRoleQueryParameterType) String() string { + return []string{"all", "admin", "member"}[i] +} +func ParseGetRoleQueryParameterType(v string) (any, error) { + result := ALL_GETROLEQUERYPARAMETERTYPE + switch v { + case "all": + result = ALL_GETROLEQUERYPARAMETERTYPE + case "admin": + result = ADMIN_GETROLEQUERYPARAMETERTYPE + case "member": + result = MEMBER_GETROLEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetRoleQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetRoleQueryParameterType(values []GetRoleQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetRoleQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/migrations/get_exclude_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/migrations/get_exclude_query_parameter_type.go new file mode 100644 index 000000000..2f48bb7f0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/migrations/get_exclude_query_parameter_type.go @@ -0,0 +1,34 @@ +package migrations +import ( + "errors" +) +// Allowed values that can be passed to the exclude param. +type GetExcludeQueryParameterType int + +const ( + REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE GetExcludeQueryParameterType = iota +) + +func (i GetExcludeQueryParameterType) String() string { + return []string{"repositories"}[i] +} +func ParseGetExcludeQueryParameterType(v string) (any, error) { + result := REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE + switch v { + case "repositories": + result = REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetExcludeQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetExcludeQueryParameterType(values []GetExcludeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetExcludeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/migrations/item/get_exclude_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/migrations/item/get_exclude_query_parameter_type.go new file mode 100644 index 000000000..a67821d87 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/migrations/item/get_exclude_query_parameter_type.go @@ -0,0 +1,34 @@ +package item +import ( + "errors" +) +// Allowed values that can be passed to the exclude param. +type GetExcludeQueryParameterType int + +const ( + REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE GetExcludeQueryParameterType = iota +) + +func (i GetExcludeQueryParameterType) String() string { + return []string{"repositories"}[i] +} +func ParseGetExcludeQueryParameterType(v string) (any, error) { + result := REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE + switch v { + case "repositories": + result = REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetExcludeQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetExcludeQueryParameterType(values []GetExcludeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetExcludeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/migrations/migrations_post_request_body_exclude.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/migrations/migrations_post_request_body_exclude.go new file mode 100644 index 000000000..522a8b573 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/migrations/migrations_post_request_body_exclude.go @@ -0,0 +1,33 @@ +package migrations +import ( + "errors" +) +type MigrationsPostRequestBody_exclude int + +const ( + REPOSITORIES_MIGRATIONSPOSTREQUESTBODY_EXCLUDE MigrationsPostRequestBody_exclude = iota +) + +func (i MigrationsPostRequestBody_exclude) String() string { + return []string{"repositories"}[i] +} +func ParseMigrationsPostRequestBody_exclude(v string) (any, error) { + result := REPOSITORIES_MIGRATIONSPOSTREQUESTBODY_EXCLUDE + switch v { + case "repositories": + result = REPOSITORIES_MIGRATIONSPOSTREQUESTBODY_EXCLUDE + default: + return 0, errors.New("Unknown MigrationsPostRequestBody_exclude value: " + v) + } + return &result, nil +} +func SerializeMigrationsPostRequestBody_exclude(values []MigrationsPostRequestBody_exclude) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i MigrationsPostRequestBody_exclude) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/outside_collaborators/get_filter_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/outside_collaborators/get_filter_query_parameter_type.go new file mode 100644 index 000000000..b56cab1ec --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/outside_collaborators/get_filter_query_parameter_type.go @@ -0,0 +1,36 @@ +package outside_collaborators +import ( + "errors" +) +type GetFilterQueryParameterType int + +const ( + TWOFA_DISABLED_GETFILTERQUERYPARAMETERTYPE GetFilterQueryParameterType = iota + ALL_GETFILTERQUERYPARAMETERTYPE +) + +func (i GetFilterQueryParameterType) String() string { + return []string{"2fa_disabled", "all"}[i] +} +func ParseGetFilterQueryParameterType(v string) (any, error) { + result := TWOFA_DISABLED_GETFILTERQUERYPARAMETERTYPE + switch v { + case "2fa_disabled": + result = TWOFA_DISABLED_GETFILTERQUERYPARAMETERTYPE + case "all": + result = ALL_GETFILTERQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetFilterQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetFilterQueryParameterType(values []GetFilterQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetFilterQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/packages/get_package_type_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/packages/get_package_type_query_parameter_type.go new file mode 100644 index 000000000..ae4025d39 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/packages/get_package_type_query_parameter_type.go @@ -0,0 +1,48 @@ +package packages +import ( + "errors" +) +type GetPackage_typeQueryParameterType int + +const ( + NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE GetPackage_typeQueryParameterType = iota + MAVEN_GETPACKAGE_TYPEQUERYPARAMETERTYPE + RUBYGEMS_GETPACKAGE_TYPEQUERYPARAMETERTYPE + DOCKER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + NUGET_GETPACKAGE_TYPEQUERYPARAMETERTYPE + CONTAINER_GETPACKAGE_TYPEQUERYPARAMETERTYPE +) + +func (i GetPackage_typeQueryParameterType) String() string { + return []string{"npm", "maven", "rubygems", "docker", "nuget", "container"}[i] +} +func ParseGetPackage_typeQueryParameterType(v string) (any, error) { + result := NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE + switch v { + case "npm": + result = NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "maven": + result = MAVEN_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "rubygems": + result = RUBYGEMS_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "docker": + result = DOCKER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "nuget": + result = NUGET_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "container": + result = CONTAINER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetPackage_typeQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetPackage_typeQueryParameterType(values []GetPackage_typeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetPackage_typeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/packages/get_visibility_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/packages/get_visibility_query_parameter_type.go new file mode 100644 index 000000000..daf1c43e6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/packages/get_visibility_query_parameter_type.go @@ -0,0 +1,39 @@ +package packages +import ( + "errors" +) +type GetVisibilityQueryParameterType int + +const ( + PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE GetVisibilityQueryParameterType = iota + PRIVATE_GETVISIBILITYQUERYPARAMETERTYPE + INTERNAL_GETVISIBILITYQUERYPARAMETERTYPE +) + +func (i GetVisibilityQueryParameterType) String() string { + return []string{"public", "private", "internal"}[i] +} +func ParseGetVisibilityQueryParameterType(v string) (any, error) { + result := PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE + switch v { + case "public": + result = PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE + case "private": + result = PRIVATE_GETVISIBILITYQUERYPARAMETERTYPE + case "internal": + result = INTERNAL_GETVISIBILITYQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetVisibilityQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetVisibilityQueryParameterType(values []GetVisibilityQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetVisibilityQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/packages/item/item/versions/get_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/packages/item/item/versions/get_state_query_parameter_type.go new file mode 100644 index 000000000..cf4ef3c82 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/packages/item/item/versions/get_state_query_parameter_type.go @@ -0,0 +1,36 @@ +package versions +import ( + "errors" +) +type GetStateQueryParameterType int + +const ( + ACTIVE_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + DELETED_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"active", "deleted"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := ACTIVE_GETSTATEQUERYPARAMETERTYPE + switch v { + case "active": + result = ACTIVE_GETSTATEQUERYPARAMETERTYPE + case "deleted": + result = DELETED_GETSTATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokenrequests/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokenrequests/get_direction_query_parameter_type.go new file mode 100644 index 000000000..af4892ea4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokenrequests/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package personalaccesstokenrequests +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokenrequests/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokenrequests/get_sort_query_parameter_type.go new file mode 100644 index 000000000..cf8d1a846 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokenrequests/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package personalaccesstokenrequests +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_AT_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created_at"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_AT_GETSORTQUERYPARAMETERTYPE + switch v { + case "created_at": + result = CREATED_AT_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokenrequests/personal_access_token_requests_post_request_body_action.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokenrequests/personal_access_token_requests_post_request_body_action.go new file mode 100644 index 000000000..6c75c9aa9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokenrequests/personal_access_token_requests_post_request_body_action.go @@ -0,0 +1,37 @@ +package personalaccesstokenrequests +import ( + "errors" +) +// Action to apply to the requests. +type PersonalAccessTokenRequestsPostRequestBody_action int + +const ( + APPROVE_PERSONALACCESSTOKENREQUESTSPOSTREQUESTBODY_ACTION PersonalAccessTokenRequestsPostRequestBody_action = iota + DENY_PERSONALACCESSTOKENREQUESTSPOSTREQUESTBODY_ACTION +) + +func (i PersonalAccessTokenRequestsPostRequestBody_action) String() string { + return []string{"approve", "deny"}[i] +} +func ParsePersonalAccessTokenRequestsPostRequestBody_action(v string) (any, error) { + result := APPROVE_PERSONALACCESSTOKENREQUESTSPOSTREQUESTBODY_ACTION + switch v { + case "approve": + result = APPROVE_PERSONALACCESSTOKENREQUESTSPOSTREQUESTBODY_ACTION + case "deny": + result = DENY_PERSONALACCESSTOKENREQUESTSPOSTREQUESTBODY_ACTION + default: + return 0, errors.New("Unknown PersonalAccessTokenRequestsPostRequestBody_action value: " + v) + } + return &result, nil +} +func SerializePersonalAccessTokenRequestsPostRequestBody_action(values []PersonalAccessTokenRequestsPostRequestBody_action) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PersonalAccessTokenRequestsPostRequestBody_action) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokens/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokens/get_direction_query_parameter_type.go new file mode 100644 index 000000000..aa02e9d64 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokens/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package personalaccesstokens +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokens/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokens/get_sort_query_parameter_type.go new file mode 100644 index 000000000..ad59d82e0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokens/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package personalaccesstokens +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_AT_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created_at"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_AT_GETSORTQUERYPARAMETERTYPE + switch v { + case "created_at": + result = CREATED_AT_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokens/personal_access_tokens_post_request_body_action.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokens/personal_access_tokens_post_request_body_action.go new file mode 100644 index 000000000..4bafd5628 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokens/personal_access_tokens_post_request_body_action.go @@ -0,0 +1,34 @@ +package personalaccesstokens +import ( + "errors" +) +// Action to apply to the fine-grained personal access token. +type PersonalAccessTokensPostRequestBody_action int + +const ( + REVOKE_PERSONALACCESSTOKENSPOSTREQUESTBODY_ACTION PersonalAccessTokensPostRequestBody_action = iota +) + +func (i PersonalAccessTokensPostRequestBody_action) String() string { + return []string{"revoke"}[i] +} +func ParsePersonalAccessTokensPostRequestBody_action(v string) (any, error) { + result := REVOKE_PERSONALACCESSTOKENSPOSTREQUESTBODY_ACTION + switch v { + case "revoke": + result = REVOKE_PERSONALACCESSTOKENSPOSTREQUESTBODY_ACTION + default: + return 0, errors.New("Unknown PersonalAccessTokensPostRequestBody_action value: " + v) + } + return &result, nil +} +func SerializePersonalAccessTokensPostRequestBody_action(values []PersonalAccessTokensPostRequestBody_action) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PersonalAccessTokensPostRequestBody_action) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/projects/get_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/projects/get_state_query_parameter_type.go new file mode 100644 index 000000000..985374b5e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/projects/get_state_query_parameter_type.go @@ -0,0 +1,39 @@ +package projects +import ( + "errors" +) +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/get_direction_query_parameter_type.go new file mode 100644 index 000000000..afa5d0fa6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package repos +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/get_sort_query_parameter_type.go new file mode 100644 index 000000000..8dee1bb8c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/get_sort_query_parameter_type.go @@ -0,0 +1,42 @@ +package repos +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + PUSHED_GETSORTQUERYPARAMETERTYPE + FULL_NAME_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "pushed", "full_name"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "pushed": + result = PUSHED_GETSORTQUERYPARAMETERTYPE + case "full_name": + result = FULL_NAME_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/get_type_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/get_type_query_parameter_type.go new file mode 100644 index 000000000..251702033 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/get_type_query_parameter_type.go @@ -0,0 +1,48 @@ +package repos +import ( + "errors" +) +type GetTypeQueryParameterType int + +const ( + ALL_GETTYPEQUERYPARAMETERTYPE GetTypeQueryParameterType = iota + PUBLIC_GETTYPEQUERYPARAMETERTYPE + PRIVATE_GETTYPEQUERYPARAMETERTYPE + FORKS_GETTYPEQUERYPARAMETERTYPE + SOURCES_GETTYPEQUERYPARAMETERTYPE + MEMBER_GETTYPEQUERYPARAMETERTYPE +) + +func (i GetTypeQueryParameterType) String() string { + return []string{"all", "public", "private", "forks", "sources", "member"}[i] +} +func ParseGetTypeQueryParameterType(v string) (any, error) { + result := ALL_GETTYPEQUERYPARAMETERTYPE + switch v { + case "all": + result = ALL_GETTYPEQUERYPARAMETERTYPE + case "public": + result = PUBLIC_GETTYPEQUERYPARAMETERTYPE + case "private": + result = PRIVATE_GETTYPEQUERYPARAMETERTYPE + case "forks": + result = FORKS_GETTYPEQUERYPARAMETERTYPE + case "sources": + result = SOURCES_GETTYPEQUERYPARAMETERTYPE + case "member": + result = MEMBER_GETTYPEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetTypeQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetTypeQueryParameterType(values []GetTypeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetTypeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/repos_post_request_body_merge_commit_message.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/repos_post_request_body_merge_commit_message.go new file mode 100644 index 000000000..50a0ccf4f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/repos_post_request_body_merge_commit_message.go @@ -0,0 +1,40 @@ +package repos +import ( + "errors" +) +// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +type ReposPostRequestBody_merge_commit_message int + +const ( + PR_BODY_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE ReposPostRequestBody_merge_commit_message = iota + PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + BLANK_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE +) + +func (i ReposPostRequestBody_merge_commit_message) String() string { + return []string{"PR_BODY", "PR_TITLE", "BLANK"}[i] +} +func ParseReposPostRequestBody_merge_commit_message(v string) (any, error) { + result := PR_BODY_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + case "PR_TITLE": + result = PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + default: + return 0, errors.New("Unknown ReposPostRequestBody_merge_commit_message value: " + v) + } + return &result, nil +} +func SerializeReposPostRequestBody_merge_commit_message(values []ReposPostRequestBody_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/repos_post_request_body_merge_commit_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/repos_post_request_body_merge_commit_title.go new file mode 100644 index 000000000..dd1e4b9d6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/repos_post_request_body_merge_commit_title.go @@ -0,0 +1,37 @@ +package repos +import ( + "errors" +) +// The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +type ReposPostRequestBody_merge_commit_title int + +const ( + PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE ReposPostRequestBody_merge_commit_title = iota + MERGE_MESSAGE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE +) + +func (i ReposPostRequestBody_merge_commit_title) String() string { + return []string{"PR_TITLE", "MERGE_MESSAGE"}[i] +} +func ParseReposPostRequestBody_merge_commit_title(v string) (any, error) { + result := PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE + case "MERGE_MESSAGE": + result = MERGE_MESSAGE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE + default: + return 0, errors.New("Unknown ReposPostRequestBody_merge_commit_title value: " + v) + } + return &result, nil +} +func SerializeReposPostRequestBody_merge_commit_title(values []ReposPostRequestBody_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/repos_post_request_body_squash_merge_commit_message.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/repos_post_request_body_squash_merge_commit_message.go new file mode 100644 index 000000000..0ecd209b2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/repos_post_request_body_squash_merge_commit_message.go @@ -0,0 +1,40 @@ +package repos +import ( + "errors" +) +// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +type ReposPostRequestBody_squash_merge_commit_message int + +const ( + PR_BODY_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE ReposPostRequestBody_squash_merge_commit_message = iota + COMMIT_MESSAGES_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + BLANK_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE +) + +func (i ReposPostRequestBody_squash_merge_commit_message) String() string { + return []string{"PR_BODY", "COMMIT_MESSAGES", "BLANK"}[i] +} +func ParseReposPostRequestBody_squash_merge_commit_message(v string) (any, error) { + result := PR_BODY_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + case "COMMIT_MESSAGES": + result = COMMIT_MESSAGES_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + default: + return 0, errors.New("Unknown ReposPostRequestBody_squash_merge_commit_message value: " + v) + } + return &result, nil +} +func SerializeReposPostRequestBody_squash_merge_commit_message(values []ReposPostRequestBody_squash_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_squash_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/repos_post_request_body_squash_merge_commit_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/repos_post_request_body_squash_merge_commit_title.go new file mode 100644 index 000000000..51ceb4f65 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/repos_post_request_body_squash_merge_commit_title.go @@ -0,0 +1,37 @@ +package repos +import ( + "errors" +) +// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +type ReposPostRequestBody_squash_merge_commit_title int + +const ( + PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE ReposPostRequestBody_squash_merge_commit_title = iota + COMMIT_OR_PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE +) + +func (i ReposPostRequestBody_squash_merge_commit_title) String() string { + return []string{"PR_TITLE", "COMMIT_OR_PR_TITLE"}[i] +} +func ParseReposPostRequestBody_squash_merge_commit_title(v string) (any, error) { + result := PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE + case "COMMIT_OR_PR_TITLE": + result = COMMIT_OR_PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE + default: + return 0, errors.New("Unknown ReposPostRequestBody_squash_merge_commit_title value: " + v) + } + return &result, nil +} +func SerializeReposPostRequestBody_squash_merge_commit_title(values []ReposPostRequestBody_squash_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_squash_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/repos_post_request_body_visibility.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/repos_post_request_body_visibility.go new file mode 100644 index 000000000..05511876c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/repos/repos_post_request_body_visibility.go @@ -0,0 +1,37 @@ +package repos +import ( + "errors" +) +// The visibility of the repository. +type ReposPostRequestBody_visibility int + +const ( + PUBLIC_REPOSPOSTREQUESTBODY_VISIBILITY ReposPostRequestBody_visibility = iota + PRIVATE_REPOSPOSTREQUESTBODY_VISIBILITY +) + +func (i ReposPostRequestBody_visibility) String() string { + return []string{"public", "private"}[i] +} +func ParseReposPostRequestBody_visibility(v string) (any, error) { + result := PUBLIC_REPOSPOSTREQUESTBODY_VISIBILITY + switch v { + case "public": + result = PUBLIC_REPOSPOSTREQUESTBODY_VISIBILITY + case "private": + result = PRIVATE_REPOSPOSTREQUESTBODY_VISIBILITY + default: + return 0, errors.New("Unknown ReposPostRequestBody_visibility value: " + v) + } + return &result, nil +} +func SerializeReposPostRequestBody_visibility(values []ReposPostRequestBody_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_visibility) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/rulesets/rulesuites/get_rule_suite_result_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/rulesets/rulesuites/get_rule_suite_result_query_parameter_type.go new file mode 100644 index 000000000..91a669a60 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/rulesets/rulesuites/get_rule_suite_result_query_parameter_type.go @@ -0,0 +1,42 @@ +package rulesuites +import ( + "errors" +) +type GetRule_suite_resultQueryParameterType int + +const ( + PASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE GetRule_suite_resultQueryParameterType = iota + FAIL_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + BYPASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + ALL_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE +) + +func (i GetRule_suite_resultQueryParameterType) String() string { + return []string{"pass", "fail", "bypass", "all"}[i] +} +func ParseGetRule_suite_resultQueryParameterType(v string) (any, error) { + result := PASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + switch v { + case "pass": + result = PASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + case "fail": + result = FAIL_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + case "bypass": + result = BYPASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + case "all": + result = ALL_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetRule_suite_resultQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetRule_suite_resultQueryParameterType(values []GetRule_suite_resultQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetRule_suite_resultQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/rulesets/rulesuites/get_time_period_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/rulesets/rulesuites/get_time_period_query_parameter_type.go new file mode 100644 index 000000000..82dfab2d3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/rulesets/rulesuites/get_time_period_query_parameter_type.go @@ -0,0 +1,42 @@ +package rulesuites +import ( + "errors" +) +type GetTime_periodQueryParameterType int + +const ( + HOUR_GETTIME_PERIODQUERYPARAMETERTYPE GetTime_periodQueryParameterType = iota + DAY_GETTIME_PERIODQUERYPARAMETERTYPE + WEEK_GETTIME_PERIODQUERYPARAMETERTYPE + MONTH_GETTIME_PERIODQUERYPARAMETERTYPE +) + +func (i GetTime_periodQueryParameterType) String() string { + return []string{"hour", "day", "week", "month"}[i] +} +func ParseGetTime_periodQueryParameterType(v string) (any, error) { + result := HOUR_GETTIME_PERIODQUERYPARAMETERTYPE + switch v { + case "hour": + result = HOUR_GETTIME_PERIODQUERYPARAMETERTYPE + case "day": + result = DAY_GETTIME_PERIODQUERYPARAMETERTYPE + case "week": + result = WEEK_GETTIME_PERIODQUERYPARAMETERTYPE + case "month": + result = MONTH_GETTIME_PERIODQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetTime_periodQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetTime_periodQueryParameterType(values []GetTime_periodQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetTime_periodQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/secretscanning/alerts/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/secretscanning/alerts/get_direction_query_parameter_type.go new file mode 100644 index 000000000..70606a8da --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/secretscanning/alerts/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/secretscanning/alerts/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/secretscanning/alerts/get_sort_query_parameter_type.go new file mode 100644 index 000000000..bc094eda5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/secretscanning/alerts/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/secretscanning/alerts/get_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/secretscanning/alerts/get_state_query_parameter_type.go new file mode 100644 index 000000000..382957f5c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/secretscanning/alerts/get_state_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + RESOLVED_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "resolved"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "resolved": + result = RESOLVED_GETSTATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/securityadvisories/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/securityadvisories/get_direction_query_parameter_type.go new file mode 100644 index 000000000..41aa1584f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/securityadvisories/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package securityadvisories +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/securityadvisories/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/securityadvisories/get_sort_query_parameter_type.go new file mode 100644 index 000000000..93822450e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/securityadvisories/get_sort_query_parameter_type.go @@ -0,0 +1,39 @@ +package securityadvisories +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + PUBLISHED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "published"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "published": + result = PUBLISHED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/securityadvisories/get_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/securityadvisories/get_state_query_parameter_type.go new file mode 100644 index 000000000..4f106c12b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/securityadvisories/get_state_query_parameter_type.go @@ -0,0 +1,42 @@ +package securityadvisories +import ( + "errors" +) +type GetStateQueryParameterType int + +const ( + TRIAGE_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + DRAFT_GETSTATEQUERYPARAMETERTYPE + PUBLISHED_GETSTATEQUERYPARAMETERTYPE + CLOSED_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"triage", "draft", "published", "closed"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := TRIAGE_GETSTATEQUERYPARAMETERTYPE + switch v { + case "triage": + result = TRIAGE_GETSTATEQUERYPARAMETERTYPE + case "draft": + result = DRAFT_GETSTATEQUERYPARAMETERTYPE + case "published": + result = PUBLISHED_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/get_direction_query_parameter_type.go new file mode 100644 index 000000000..9b519628c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package discussions +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/comments/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/comments/get_direction_query_parameter_type.go new file mode 100644 index 000000000..ac2550630 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/comments/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package comments +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/comments/item/reactions/get_content_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/comments/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 000000000..7aef65a2e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/comments/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,54 @@ +package reactions +import ( + "errors" +) +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + MINUS_1_GETCONTENTQUERYPARAMETERTYPE + LAUGH_GETCONTENTQUERYPARAMETERTYPE + CONFUSED_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "-1": + result = MINUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "confused": + result = CONFUSED_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetContentQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/comments/item/reactions/reactions_post_request_body_content.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/comments/item/reactions/reactions_post_request_body_content.go new file mode 100644 index 000000000..c934402d3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/comments/item/reactions/reactions_post_request_body_content.go @@ -0,0 +1,55 @@ +package reactions +import ( + "errors" +) +// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion comment. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "-1": + result = MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "confused": + result = CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return 0, errors.New("Unknown ReactionsPostRequestBody_content value: " + v) + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/reactions/get_content_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 000000000..7aef65a2e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,54 @@ +package reactions +import ( + "errors" +) +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + MINUS_1_GETCONTENTQUERYPARAMETERTYPE + LAUGH_GETCONTENTQUERYPARAMETERTYPE + CONFUSED_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "-1": + result = MINUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "confused": + result = CONFUSED_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetContentQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/reactions/reactions_post_request_body_content.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/reactions/reactions_post_request_body_content.go new file mode 100644 index 000000000..114e88e09 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/reactions/reactions_post_request_body_content.go @@ -0,0 +1,55 @@ +package reactions +import ( + "errors" +) +// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "-1": + result = MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "confused": + result = CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return 0, errors.New("Unknown ReactionsPostRequestBody_content value: " + v) + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/members/get_role_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/members/get_role_query_parameter_type.go new file mode 100644 index 000000000..d4e359b44 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/members/get_role_query_parameter_type.go @@ -0,0 +1,39 @@ +package members +import ( + "errors" +) +type GetRoleQueryParameterType int + +const ( + MEMBER_GETROLEQUERYPARAMETERTYPE GetRoleQueryParameterType = iota + MAINTAINER_GETROLEQUERYPARAMETERTYPE + ALL_GETROLEQUERYPARAMETERTYPE +) + +func (i GetRoleQueryParameterType) String() string { + return []string{"member", "maintainer", "all"}[i] +} +func ParseGetRoleQueryParameterType(v string) (any, error) { + result := MEMBER_GETROLEQUERYPARAMETERTYPE + switch v { + case "member": + result = MEMBER_GETROLEQUERYPARAMETERTYPE + case "maintainer": + result = MAINTAINER_GETROLEQUERYPARAMETERTYPE + case "all": + result = ALL_GETROLEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetRoleQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetRoleQueryParameterType(values []GetRoleQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetRoleQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_cache_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_cache_request_builder.go new file mode 100644 index 000000000..3929cf9e5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_cache_request_builder.go @@ -0,0 +1,33 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsCacheRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\cache +type ItemActionsCacheRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsCacheRequestBuilderInternal instantiates a new ItemActionsCacheRequestBuilder and sets the default values. +func NewItemActionsCacheRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheRequestBuilder) { + m := &ItemActionsCacheRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/cache", pathParameters), + } + return m +} +// NewItemActionsCacheRequestBuilder instantiates a new ItemActionsCacheRequestBuilder and sets the default values. +func NewItemActionsCacheRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsCacheRequestBuilderInternal(urlParams, requestAdapter) +} +// Usage the usage property +// returns a *ItemActionsCacheUsageRequestBuilder when successful +func (m *ItemActionsCacheRequestBuilder) Usage()(*ItemActionsCacheUsageRequestBuilder) { + return NewItemActionsCacheUsageRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// UsageByRepository the usageByRepository property +// returns a *ItemActionsCacheUsageByRepositoryRequestBuilder when successful +func (m *ItemActionsCacheRequestBuilder) UsageByRepository()(*ItemActionsCacheUsageByRepositoryRequestBuilder) { + return NewItemActionsCacheUsageByRepositoryRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_cache_usage_by_repository_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_cache_usage_by_repository_get_response.go new file mode 100644 index 000000000..9a77e3b43 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_cache_usage_by_repository_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemActionsCacheUsageByRepositoryGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The repository_cache_usages property + repository_cache_usages []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsCacheUsageByRepositoryable + // The total_count property + total_count *int32 +} +// NewItemActionsCacheUsageByRepositoryGetResponse instantiates a new ItemActionsCacheUsageByRepositoryGetResponse and sets the default values. +func NewItemActionsCacheUsageByRepositoryGetResponse()(*ItemActionsCacheUsageByRepositoryGetResponse) { + m := &ItemActionsCacheUsageByRepositoryGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsCacheUsageByRepositoryGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsCacheUsageByRepositoryGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsCacheUsageByRepositoryGetResponse(), 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 *ItemActionsCacheUsageByRepositoryGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsCacheUsageByRepositoryGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repository_cache_usages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsCacheUsageByRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsCacheUsageByRepositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsCacheUsageByRepositoryable) + } + } + m.SetRepositoryCacheUsages(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRepositoryCacheUsages gets the repository_cache_usages property value. The repository_cache_usages property +// returns a []ActionsCacheUsageByRepositoryable when successful +func (m *ItemActionsCacheUsageByRepositoryGetResponse) GetRepositoryCacheUsages()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsCacheUsageByRepositoryable) { + return m.repository_cache_usages +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsCacheUsageByRepositoryGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsCacheUsageByRepositoryGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositoryCacheUsages() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositoryCacheUsages())) + for i, v := range m.GetRepositoryCacheUsages() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repository_cache_usages", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemActionsCacheUsageByRepositoryGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositoryCacheUsages sets the repository_cache_usages property value. The repository_cache_usages property +func (m *ItemActionsCacheUsageByRepositoryGetResponse) SetRepositoryCacheUsages(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsCacheUsageByRepositoryable)() { + m.repository_cache_usages = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsCacheUsageByRepositoryGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsCacheUsageByRepositoryGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositoryCacheUsages()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsCacheUsageByRepositoryable) + GetTotalCount()(*int32) + SetRepositoryCacheUsages(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsCacheUsageByRepositoryable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_cache_usage_by_repository_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_cache_usage_by_repository_request_builder.go new file mode 100644 index 000000000..e8165fc33 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_cache_usage_by_repository_request_builder.go @@ -0,0 +1,63 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsCacheUsageByRepositoryRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\cache\usage-by-repository +type ItemActionsCacheUsageByRepositoryRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsCacheUsageByRepositoryRequestBuilderGetQueryParameters lists repositories and their GitHub Actions cache usage for an organization.The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +type ItemActionsCacheUsageByRepositoryRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemActionsCacheUsageByRepositoryRequestBuilderInternal instantiates a new ItemActionsCacheUsageByRepositoryRequestBuilder and sets the default values. +func NewItemActionsCacheUsageByRepositoryRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheUsageByRepositoryRequestBuilder) { + m := &ItemActionsCacheUsageByRepositoryRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/cache/usage-by-repository{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsCacheUsageByRepositoryRequestBuilder instantiates a new ItemActionsCacheUsageByRepositoryRequestBuilder and sets the default values. +func NewItemActionsCacheUsageByRepositoryRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheUsageByRepositoryRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsCacheUsageByRepositoryRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists repositories and their GitHub Actions cache usage for an organization.The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +// returns a ItemActionsCacheUsageByRepositoryGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization +func (m *ItemActionsCacheUsageByRepositoryRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsCacheUsageByRepositoryRequestBuilderGetQueryParameters])(ItemActionsCacheUsageByRepositoryGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsCacheUsageByRepositoryGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsCacheUsageByRepositoryGetResponseable), nil +} +// ToGetRequestInformation lists repositories and their GitHub Actions cache usage for an organization.The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsCacheUsageByRepositoryRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsCacheUsageByRepositoryRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsCacheUsageByRepositoryRequestBuilder when successful +func (m *ItemActionsCacheUsageByRepositoryRequestBuilder) WithUrl(rawUrl string)(*ItemActionsCacheUsageByRepositoryRequestBuilder) { + return NewItemActionsCacheUsageByRepositoryRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_cache_usage_by_repository_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_cache_usage_by_repository_response.go new file mode 100644 index 000000000..e07cf7a26 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_cache_usage_by_repository_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemActionsCacheUsageByRepositoryResponse +// Deprecated: This class is obsolete. Use usageByRepositoryGetResponse instead. +type ItemActionsCacheUsageByRepositoryResponse struct { + ItemActionsCacheUsageByRepositoryGetResponse +} +// NewItemActionsCacheUsageByRepositoryResponse instantiates a new ItemActionsCacheUsageByRepositoryResponse and sets the default values. +func NewItemActionsCacheUsageByRepositoryResponse()(*ItemActionsCacheUsageByRepositoryResponse) { + m := &ItemActionsCacheUsageByRepositoryResponse{ + ItemActionsCacheUsageByRepositoryGetResponse: *NewItemActionsCacheUsageByRepositoryGetResponse(), + } + return m +} +// CreateItemActionsCacheUsageByRepositoryResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemActionsCacheUsageByRepositoryResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsCacheUsageByRepositoryResponse(), nil +} +// ItemActionsCacheUsageByRepositoryResponseable +// Deprecated: This class is obsolete. Use usageByRepositoryGetResponse instead. +type ItemActionsCacheUsageByRepositoryResponseable interface { + ItemActionsCacheUsageByRepositoryGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_cache_usage_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_cache_usage_request_builder.go new file mode 100644 index 000000000..dbbddcbee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_cache_usage_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemActionsCacheUsageRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\cache\usage +type ItemActionsCacheUsageRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsCacheUsageRequestBuilderInternal instantiates a new ItemActionsCacheUsageRequestBuilder and sets the default values. +func NewItemActionsCacheUsageRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheUsageRequestBuilder) { + m := &ItemActionsCacheUsageRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/cache/usage", pathParameters), + } + return m +} +// NewItemActionsCacheUsageRequestBuilder instantiates a new ItemActionsCacheUsageRequestBuilder and sets the default values. +func NewItemActionsCacheUsageRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheUsageRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsCacheUsageRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the total GitHub Actions cache usage for an organization.The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +// returns a ActionsCacheUsageOrgEnterpriseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization +func (m *ItemActionsCacheUsageRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsCacheUsageOrgEnterpriseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsCacheUsageOrgEnterpriseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsCacheUsageOrgEnterpriseable), nil +} +// ToGetRequestInformation gets the total GitHub Actions cache usage for an organization.The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsCacheUsageRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsCacheUsageRequestBuilder when successful +func (m *ItemActionsCacheUsageRequestBuilder) WithUrl(rawUrl string)(*ItemActionsCacheUsageRequestBuilder) { + return NewItemActionsCacheUsageRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_oidc_customization_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_oidc_customization_request_builder.go new file mode 100644 index 000000000..febf2ccb8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_oidc_customization_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsOidcCustomizationRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\oidc\customization +type ItemActionsOidcCustomizationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsOidcCustomizationRequestBuilderInternal instantiates a new ItemActionsOidcCustomizationRequestBuilder and sets the default values. +func NewItemActionsOidcCustomizationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsOidcCustomizationRequestBuilder) { + m := &ItemActionsOidcCustomizationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/oidc/customization", pathParameters), + } + return m +} +// NewItemActionsOidcCustomizationRequestBuilder instantiates a new ItemActionsOidcCustomizationRequestBuilder and sets the default values. +func NewItemActionsOidcCustomizationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsOidcCustomizationRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsOidcCustomizationRequestBuilderInternal(urlParams, requestAdapter) +} +// Sub the sub property +// returns a *ItemActionsOidcCustomizationSubRequestBuilder when successful +func (m *ItemActionsOidcCustomizationRequestBuilder) Sub()(*ItemActionsOidcCustomizationSubRequestBuilder) { + return NewItemActionsOidcCustomizationSubRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_oidc_customization_sub_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_oidc_customization_sub_request_builder.go new file mode 100644 index 000000000..bfe9b5a6d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_oidc_customization_sub_request_builder.go @@ -0,0 +1,94 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemActionsOidcCustomizationSubRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\oidc\customization\sub +type ItemActionsOidcCustomizationSubRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsOidcCustomizationSubRequestBuilderInternal instantiates a new ItemActionsOidcCustomizationSubRequestBuilder and sets the default values. +func NewItemActionsOidcCustomizationSubRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsOidcCustomizationSubRequestBuilder) { + m := &ItemActionsOidcCustomizationSubRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/oidc/customization/sub", pathParameters), + } + return m +} +// NewItemActionsOidcCustomizationSubRequestBuilder instantiates a new ItemActionsOidcCustomizationSubRequestBuilder and sets the default values. +func NewItemActionsOidcCustomizationSubRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsOidcCustomizationSubRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsOidcCustomizationSubRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the customization template for an OpenID Connect (OIDC) subject claim.OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +// returns a OidcCustomSubable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization +func (m *ItemActionsOidcCustomizationSubRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OidcCustomSubable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOidcCustomSubFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OidcCustomSubable), nil +} +// Put creates or updates the customization template for an OpenID Connect (OIDC) subject claim.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a EmptyObjectable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization +func (m *ItemActionsOidcCustomizationSubRequestBuilder) Put(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OidcCustomSubable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToGetRequestInformation gets the customization template for an OpenID Connect (OIDC) subject claim.OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsOidcCustomizationSubRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation creates or updates the customization template for an OpenID Connect (OIDC) subject claim.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsOidcCustomizationSubRequestBuilder) ToPutRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OidcCustomSubable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsOidcCustomizationSubRequestBuilder when successful +func (m *ItemActionsOidcCustomizationSubRequestBuilder) WithUrl(rawUrl string)(*ItemActionsOidcCustomizationSubRequestBuilder) { + return NewItemActionsOidcCustomizationSubRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_oidc_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_oidc_request_builder.go new file mode 100644 index 000000000..961dff292 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_oidc_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsOidcRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\oidc +type ItemActionsOidcRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsOidcRequestBuilderInternal instantiates a new ItemActionsOidcRequestBuilder and sets the default values. +func NewItemActionsOidcRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsOidcRequestBuilder) { + m := &ItemActionsOidcRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/oidc", pathParameters), + } + return m +} +// NewItemActionsOidcRequestBuilder instantiates a new ItemActionsOidcRequestBuilder and sets the default values. +func NewItemActionsOidcRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsOidcRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsOidcRequestBuilderInternal(urlParams, requestAdapter) +} +// Customization the customization property +// returns a *ItemActionsOidcCustomizationRequestBuilder when successful +func (m *ItemActionsOidcRequestBuilder) Customization()(*ItemActionsOidcCustomizationRequestBuilder) { + return NewItemActionsOidcCustomizationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_put_request_body.go new file mode 100644 index 000000000..90cc36c59 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_put_request_body.go @@ -0,0 +1,112 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemActionsPermissionsPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The permissions policy that controls the actions and reusable workflows that are allowed to run. + allowed_actions *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AllowedActions + // The policy that controls the repositories in the organization that are allowed to run GitHub Actions. + enabled_repositories *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EnabledRepositories +} +// NewItemActionsPermissionsPutRequestBody instantiates a new ItemActionsPermissionsPutRequestBody and sets the default values. +func NewItemActionsPermissionsPutRequestBody()(*ItemActionsPermissionsPutRequestBody) { + m := &ItemActionsPermissionsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsPermissionsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsPermissionsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsPermissionsPutRequestBody(), 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 *ItemActionsPermissionsPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowedActions gets the allowed_actions property value. The permissions policy that controls the actions and reusable workflows that are allowed to run. +// returns a *AllowedActions when successful +func (m *ItemActionsPermissionsPutRequestBody) GetAllowedActions()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AllowedActions) { + return m.allowed_actions +} +// GetEnabledRepositories gets the enabled_repositories property value. The policy that controls the repositories in the organization that are allowed to run GitHub Actions. +// returns a *EnabledRepositories when successful +func (m *ItemActionsPermissionsPutRequestBody) GetEnabledRepositories()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EnabledRepositories) { + return m.enabled_repositories +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsPermissionsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allowed_actions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ParseAllowedActions) + if err != nil { + return err + } + if val != nil { + m.SetAllowedActions(val.(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AllowedActions)) + } + return nil + } + res["enabled_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ParseEnabledRepositories) + if err != nil { + return err + } + if val != nil { + m.SetEnabledRepositories(val.(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EnabledRepositories)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemActionsPermissionsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAllowedActions() != nil { + cast := (*m.GetAllowedActions()).String() + err := writer.WriteStringValue("allowed_actions", &cast) + if err != nil { + return err + } + } + if m.GetEnabledRepositories() != nil { + cast := (*m.GetEnabledRepositories()).String() + err := writer.WriteStringValue("enabled_repositories", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemActionsPermissionsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowedActions sets the allowed_actions property value. The permissions policy that controls the actions and reusable workflows that are allowed to run. +func (m *ItemActionsPermissionsPutRequestBody) SetAllowedActions(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AllowedActions)() { + m.allowed_actions = value +} +// SetEnabledRepositories sets the enabled_repositories property value. The policy that controls the repositories in the organization that are allowed to run GitHub Actions. +func (m *ItemActionsPermissionsPutRequestBody) SetEnabledRepositories(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EnabledRepositories)() { + m.enabled_repositories = value +} +type ItemActionsPermissionsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowedActions()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AllowedActions) + GetEnabledRepositories()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EnabledRepositories) + SetAllowedActions(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AllowedActions)() + SetEnabledRepositories(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EnabledRepositories)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_repositories_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_repositories_get_response.go new file mode 100644 index 000000000..bd3849e67 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_repositories_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemActionsPermissionsRepositoriesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The repositories property + repositories []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable + // The total_count property + total_count *float64 +} +// NewItemActionsPermissionsRepositoriesGetResponse instantiates a new ItemActionsPermissionsRepositoriesGetResponse and sets the default values. +func NewItemActionsPermissionsRepositoriesGetResponse()(*ItemActionsPermissionsRepositoriesGetResponse) { + m := &ItemActionsPermissionsRepositoriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsPermissionsRepositoriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsPermissionsRepositoriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsPermissionsRepositoriesGetResponse(), 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 *ItemActionsPermissionsRepositoriesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsPermissionsRepositoriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []Repositoryable when successful +func (m *ItemActionsPermissionsRepositoriesGetResponse) GetRepositories()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable) { + return m.repositories +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *float64 when successful +func (m *ItemActionsPermissionsRepositoriesGetResponse) GetTotalCount()(*float64) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsPermissionsRepositoriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemActionsPermissionsRepositoriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *ItemActionsPermissionsRepositoriesGetResponse) SetRepositories(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable)() { + m.repositories = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsPermissionsRepositoriesGetResponse) SetTotalCount(value *float64)() { + m.total_count = value +} +type ItemActionsPermissionsRepositoriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositories()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable) + GetTotalCount()(*float64) + SetRepositories(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable)() + SetTotalCount(value *float64)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_repositories_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_repositories_put_request_body.go new file mode 100644 index 000000000..4c47be7c2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_repositories_put_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsPermissionsRepositoriesPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // List of repository IDs to enable for GitHub Actions. + selected_repository_ids []int32 +} +// NewItemActionsPermissionsRepositoriesPutRequestBody instantiates a new ItemActionsPermissionsRepositoriesPutRequestBody and sets the default values. +func NewItemActionsPermissionsRepositoriesPutRequestBody()(*ItemActionsPermissionsRepositoriesPutRequestBody) { + m := &ItemActionsPermissionsRepositoriesPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsPermissionsRepositoriesPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsPermissionsRepositoriesPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsPermissionsRepositoriesPutRequestBody(), 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 *ItemActionsPermissionsRepositoriesPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsPermissionsRepositoriesPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["selected_repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetSelectedRepositoryIds(res) + } + return nil + } + return res +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. List of repository IDs to enable for GitHub Actions. +// returns a []int32 when successful +func (m *ItemActionsPermissionsRepositoriesPutRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *ItemActionsPermissionsRepositoriesPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + 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 *ItemActionsPermissionsRepositoriesPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. List of repository IDs to enable for GitHub Actions. +func (m *ItemActionsPermissionsRepositoriesPutRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +type ItemActionsPermissionsRepositoriesPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedRepositoryIds()([]int32) + SetSelectedRepositoryIds(value []int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_repositories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_repositories_request_builder.go new file mode 100644 index 000000000..cd7ec14fb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_repositories_request_builder.go @@ -0,0 +1,100 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsPermissionsRepositoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\permissions\repositories +type ItemActionsPermissionsRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsPermissionsRepositoriesRequestBuilderGetQueryParameters lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemActionsPermissionsRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRepository_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.actions.permissions.repositories.item collection +// returns a *ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemActionsPermissionsRepositoriesRequestBuilder) ByRepository_id(repository_id int32)(*ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["repository_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(repository_id), 10) + return NewItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsPermissionsRepositoriesRequestBuilderInternal instantiates a new ItemActionsPermissionsRepositoriesRequestBuilder and sets the default values. +func NewItemActionsPermissionsRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsRepositoriesRequestBuilder) { + m := &ItemActionsPermissionsRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/permissions/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsPermissionsRepositoriesRequestBuilder instantiates a new ItemActionsPermissionsRepositoriesRequestBuilder and sets the default values. +func NewItemActionsPermissionsRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsPermissionsRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemActionsPermissionsRepositoriesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization +func (m *ItemActionsPermissionsRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsPermissionsRepositoriesRequestBuilderGetQueryParameters])(ItemActionsPermissionsRepositoriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsPermissionsRepositoriesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsPermissionsRepositoriesGetResponseable), nil +} +// Put replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization +func (m *ItemActionsPermissionsRepositoriesRequestBuilder) Put(ctx context.Context, body ItemActionsPermissionsRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsPermissionsRepositoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsRepositoriesRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsPermissionsRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsPermissionsRepositoriesRequestBuilder when successful +func (m *ItemActionsPermissionsRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemActionsPermissionsRepositoriesRequestBuilder) { + return NewItemActionsPermissionsRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_repositories_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_repositories_response.go new file mode 100644 index 000000000..4189b5cf7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_repositories_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemActionsPermissionsRepositoriesResponse +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type ItemActionsPermissionsRepositoriesResponse struct { + ItemActionsPermissionsRepositoriesGetResponse +} +// NewItemActionsPermissionsRepositoriesResponse instantiates a new ItemActionsPermissionsRepositoriesResponse and sets the default values. +func NewItemActionsPermissionsRepositoriesResponse()(*ItemActionsPermissionsRepositoriesResponse) { + m := &ItemActionsPermissionsRepositoriesResponse{ + ItemActionsPermissionsRepositoriesGetResponse: *NewItemActionsPermissionsRepositoriesGetResponse(), + } + return m +} +// CreateItemActionsPermissionsRepositoriesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemActionsPermissionsRepositoriesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsPermissionsRepositoriesResponse(), nil +} +// ItemActionsPermissionsRepositoriesResponseable +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type ItemActionsPermissionsRepositoriesResponseable interface { + ItemActionsPermissionsRepositoriesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_repositories_with_repository_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_repositories_with_repository_item_request_builder.go new file mode 100644 index 000000000..c11464551 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_repositories_with_repository_item_request_builder.go @@ -0,0 +1,73 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\permissions\repositories\{repository_id} +type ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilderInternal instantiates a new ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder) { + m := &ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/permissions/repositories/{repository_id}", pathParameters), + } + return m +} +// NewItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder instantiates a new ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization +func (m *ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization +func (m *ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToPutRequestInformation adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder) { + return NewItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_request_builder.go new file mode 100644 index 000000000..57bc021cd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_request_builder.go @@ -0,0 +1,98 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemActionsPermissionsRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\permissions +type ItemActionsPermissionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsPermissionsRequestBuilderInternal instantiates a new ItemActionsPermissionsRequestBuilder and sets the default values. +func NewItemActionsPermissionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsRequestBuilder) { + m := &ItemActionsPermissionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/permissions", pathParameters), + } + return m +} +// NewItemActionsPermissionsRequestBuilder instantiates a new ItemActionsPermissionsRequestBuilder and sets the default values. +func NewItemActionsPermissionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsPermissionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ActionsOrganizationPermissionsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization +func (m *ItemActionsPermissionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsOrganizationPermissionsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsOrganizationPermissionsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsOrganizationPermissionsable), nil +} +// Put sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization +func (m *ItemActionsPermissionsRequestBuilder) Put(ctx context.Context, body ItemActionsPermissionsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Repositories the repositories property +// returns a *ItemActionsPermissionsRepositoriesRequestBuilder when successful +func (m *ItemActionsPermissionsRequestBuilder) Repositories()(*ItemActionsPermissionsRepositoriesRequestBuilder) { + return NewItemActionsPermissionsRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SelectedActions the selectedActions property +// returns a *ItemActionsPermissionsSelectedActionsRequestBuilder when successful +func (m *ItemActionsPermissionsRequestBuilder) SelectedActions()(*ItemActionsPermissionsSelectedActionsRequestBuilder) { + return NewItemActionsPermissionsSelectedActionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsPermissionsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsPermissionsRequestBuilder when successful +func (m *ItemActionsPermissionsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsPermissionsRequestBuilder) { + return NewItemActionsPermissionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} +// Workflow the workflow property +// returns a *ItemActionsPermissionsWorkflowRequestBuilder when successful +func (m *ItemActionsPermissionsRequestBuilder) Workflow()(*ItemActionsPermissionsWorkflowRequestBuilder) { + return NewItemActionsPermissionsWorkflowRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_selected_actions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_selected_actions_request_builder.go new file mode 100644 index 000000000..6263eac79 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_selected_actions_request_builder.go @@ -0,0 +1,83 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemActionsPermissionsSelectedActionsRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\permissions\selected-actions +type ItemActionsPermissionsSelectedActionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsPermissionsSelectedActionsRequestBuilderInternal instantiates a new ItemActionsPermissionsSelectedActionsRequestBuilder and sets the default values. +func NewItemActionsPermissionsSelectedActionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsSelectedActionsRequestBuilder) { + m := &ItemActionsPermissionsSelectedActionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/permissions/selected-actions", pathParameters), + } + return m +} +// NewItemActionsPermissionsSelectedActionsRequestBuilder instantiates a new ItemActionsPermissionsSelectedActionsRequestBuilder and sets the default values. +func NewItemActionsPermissionsSelectedActionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsSelectedActionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsPermissionsSelectedActionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a SelectedActionsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization +func (m *ItemActionsPermissionsSelectedActionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SelectedActionsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSelectedActionsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SelectedActionsable), nil +} +// Put sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization +func (m *ItemActionsPermissionsSelectedActionsRequestBuilder) Put(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SelectedActionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsSelectedActionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsSelectedActionsRequestBuilder) ToPutRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SelectedActionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsPermissionsSelectedActionsRequestBuilder when successful +func (m *ItemActionsPermissionsSelectedActionsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsPermissionsSelectedActionsRequestBuilder) { + return NewItemActionsPermissionsSelectedActionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_workflow_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_workflow_request_builder.go new file mode 100644 index 000000000..929960527 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_permissions_workflow_request_builder.go @@ -0,0 +1,83 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemActionsPermissionsWorkflowRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\permissions\workflow +type ItemActionsPermissionsWorkflowRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsPermissionsWorkflowRequestBuilderInternal instantiates a new ItemActionsPermissionsWorkflowRequestBuilder and sets the default values. +func NewItemActionsPermissionsWorkflowRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsWorkflowRequestBuilder) { + m := &ItemActionsPermissionsWorkflowRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/permissions/workflow", pathParameters), + } + return m +} +// NewItemActionsPermissionsWorkflowRequestBuilder instantiates a new ItemActionsPermissionsWorkflowRequestBuilder and sets the default values. +func NewItemActionsPermissionsWorkflowRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsWorkflowRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsPermissionsWorkflowRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization,as well as whether GitHub Actions can submit approving pull request reviews. For more information, see"[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)."OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ActionsGetDefaultWorkflowPermissionsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-an-organization +func (m *ItemActionsPermissionsWorkflowRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsGetDefaultWorkflowPermissionsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsGetDefaultWorkflowPermissionsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsGetDefaultWorkflowPermissionsable), nil +} +// Put sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actionscan submit approving pull request reviews. For more information, see"[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-an-organization +func (m *ItemActionsPermissionsWorkflowRequestBuilder) Put(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSetDefaultWorkflowPermissionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization,as well as whether GitHub Actions can submit approving pull request reviews. For more information, see"[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)."OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsWorkflowRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actionscan submit approving pull request reviews. For more information, see"[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsWorkflowRequestBuilder) ToPutRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSetDefaultWorkflowPermissionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsPermissionsWorkflowRequestBuilder when successful +func (m *ItemActionsPermissionsWorkflowRequestBuilder) WithUrl(rawUrl string)(*ItemActionsPermissionsWorkflowRequestBuilder) { + return NewItemActionsPermissionsWorkflowRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_request_builder.go new file mode 100644 index 000000000..a2b7e8327 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_request_builder.go @@ -0,0 +1,53 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsRequestBuilder builds and executes requests for operations under \orgs\{org}\actions +type ItemActionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Cache the cache property +// returns a *ItemActionsCacheRequestBuilder when successful +func (m *ItemActionsRequestBuilder) Cache()(*ItemActionsCacheRequestBuilder) { + return NewItemActionsCacheRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsRequestBuilderInternal instantiates a new ItemActionsRequestBuilder and sets the default values. +func NewItemActionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRequestBuilder) { + m := &ItemActionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions", pathParameters), + } + return m +} +// NewItemActionsRequestBuilder instantiates a new ItemActionsRequestBuilder and sets the default values. +func NewItemActionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Oidc the oidc property +// returns a *ItemActionsOidcRequestBuilder when successful +func (m *ItemActionsRequestBuilder) Oidc()(*ItemActionsOidcRequestBuilder) { + return NewItemActionsOidcRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Permissions the permissions property +// returns a *ItemActionsPermissionsRequestBuilder when successful +func (m *ItemActionsRequestBuilder) Permissions()(*ItemActionsPermissionsRequestBuilder) { + return NewItemActionsPermissionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Runners the runners property +// returns a *ItemActionsRunnersRequestBuilder when successful +func (m *ItemActionsRequestBuilder) Runners()(*ItemActionsRunnersRequestBuilder) { + return NewItemActionsRunnersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Secrets the secrets property +// returns a *ItemActionsSecretsRequestBuilder when successful +func (m *ItemActionsRequestBuilder) Secrets()(*ItemActionsSecretsRequestBuilder) { + return NewItemActionsSecretsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Variables the variables property +// returns a *ItemActionsVariablesRequestBuilder when successful +func (m *ItemActionsRequestBuilder) Variables()(*ItemActionsVariablesRequestBuilder) { + return NewItemActionsVariablesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_downloads_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_downloads_request_builder.go new file mode 100644 index 000000000..b8bc12fc1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_downloads_request_builder.go @@ -0,0 +1,60 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemActionsRunnersDownloadsRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runners\downloads +type ItemActionsRunnersDownloadsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersDownloadsRequestBuilderInternal instantiates a new ItemActionsRunnersDownloadsRequestBuilder and sets the default values. +func NewItemActionsRunnersDownloadsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersDownloadsRequestBuilder) { + m := &ItemActionsRunnersDownloadsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runners/downloads", pathParameters), + } + return m +} +// NewItemActionsRunnersDownloadsRequestBuilder instantiates a new ItemActionsRunnersDownloadsRequestBuilder and sets the default values. +func NewItemActionsRunnersDownloadsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersDownloadsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersDownloadsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists binaries for the runner application that you can download and run.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a []RunnerApplicationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization +func (m *ItemActionsRunnersDownloadsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerApplicationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerApplicationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerApplicationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerApplicationable) + } + } + return val, nil +} +// ToGetRequestInformation lists binaries for the runner application that you can download and run.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersDownloadsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsRunnersDownloadsRequestBuilder when successful +func (m *ItemActionsRunnersDownloadsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersDownloadsRequestBuilder) { + return NewItemActionsRunnersDownloadsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_generate_jitconfig_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_generate_jitconfig_post_request_body.go new file mode 100644 index 000000000..a7fec12ee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_generate_jitconfig_post_request_body.go @@ -0,0 +1,175 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsRunnersGenerateJitconfigPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. + labels []string + // The name of the new runner. + name *string + // The ID of the runner group to register the runner to. + runner_group_id *int32 + // The working directory to be used for job execution, relative to the runner install directory. + work_folder *string +} +// NewItemActionsRunnersGenerateJitconfigPostRequestBody instantiates a new ItemActionsRunnersGenerateJitconfigPostRequestBody and sets the default values. +func NewItemActionsRunnersGenerateJitconfigPostRequestBody()(*ItemActionsRunnersGenerateJitconfigPostRequestBody) { + m := &ItemActionsRunnersGenerateJitconfigPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + work_folderValue := "_work" + m.SetWorkFolder(&work_folderValue) + return m +} +// CreateItemActionsRunnersGenerateJitconfigPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersGenerateJitconfigPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersGenerateJitconfigPostRequestBody(), 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 *ItemActionsRunnersGenerateJitconfigPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetLabels(res) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["runner_group_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunnerGroupId(val) + } + return nil + } + res["work_folder"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWorkFolder(val) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. +// returns a []string when successful +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) GetLabels()([]string) { + return m.labels +} +// GetName gets the name property value. The name of the new runner. +// returns a *string when successful +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) GetName()(*string) { + return m.name +} +// GetRunnerGroupId gets the runner_group_id property value. The ID of the runner group to register the runner to. +// returns a *int32 when successful +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) GetRunnerGroupId()(*int32) { + return m.runner_group_id +} +// GetWorkFolder gets the work_folder property value. The working directory to be used for job execution, relative to the runner install directory. +// returns a *string when successful +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) GetWorkFolder()(*string) { + return m.work_folder +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("runner_group_id", m.GetRunnerGroupId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("work_folder", m.GetWorkFolder()) + 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 *ItemActionsRunnersGenerateJitconfigPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) SetLabels(value []string)() { + m.labels = value +} +// SetName sets the name property value. The name of the new runner. +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetRunnerGroupId sets the runner_group_id property value. The ID of the runner group to register the runner to. +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) SetRunnerGroupId(value *int32)() { + m.runner_group_id = value +} +// SetWorkFolder sets the work_folder property value. The working directory to be used for job execution, relative to the runner install directory. +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) SetWorkFolder(value *string)() { + m.work_folder = value +} +type ItemActionsRunnersGenerateJitconfigPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + GetName()(*string) + GetRunnerGroupId()(*int32) + GetWorkFolder()(*string) + SetLabels(value []string)() + SetName(value *string)() + SetRunnerGroupId(value *int32)() + SetWorkFolder(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_generate_jitconfig_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_generate_jitconfig_post_response.go new file mode 100644 index 000000000..0d999bc56 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_generate_jitconfig_post_response.go @@ -0,0 +1,110 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemActionsRunnersGenerateJitconfigPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The base64 encoded runner configuration. + encoded_jit_config *string + // A self hosted runner + runner i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable +} +// NewItemActionsRunnersGenerateJitconfigPostResponse instantiates a new ItemActionsRunnersGenerateJitconfigPostResponse and sets the default values. +func NewItemActionsRunnersGenerateJitconfigPostResponse()(*ItemActionsRunnersGenerateJitconfigPostResponse) { + m := &ItemActionsRunnersGenerateJitconfigPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersGenerateJitconfigPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersGenerateJitconfigPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersGenerateJitconfigPostResponse(), 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 *ItemActionsRunnersGenerateJitconfigPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncodedJitConfig gets the encoded_jit_config property value. The base64 encoded runner configuration. +// returns a *string when successful +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) GetEncodedJitConfig()(*string) { + return m.encoded_jit_config +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["encoded_jit_config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncodedJitConfig(val) + } + return nil + } + res["runner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRunner(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable)) + } + return nil + } + return res +} +// GetRunner gets the runner property value. A self hosted runner +// returns a Runnerable when successful +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) GetRunner()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable) { + return m.runner +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("encoded_jit_config", m.GetEncodedJitConfig()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("runner", m.GetRunner()) + 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 *ItemActionsRunnersGenerateJitconfigPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncodedJitConfig sets the encoded_jit_config property value. The base64 encoded runner configuration. +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) SetEncodedJitConfig(value *string)() { + m.encoded_jit_config = value +} +// SetRunner sets the runner property value. A self hosted runner +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) SetRunner(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable)() { + m.runner = value +} +type ItemActionsRunnersGenerateJitconfigPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncodedJitConfig()(*string) + GetRunner()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable) + SetEncodedJitConfig(value *string)() + SetRunner(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_generate_jitconfig_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_generate_jitconfig_request_builder.go new file mode 100644 index 000000000..fe3291f3d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_generate_jitconfig_request_builder.go @@ -0,0 +1,67 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemActionsRunnersGenerateJitconfigRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runners\generate-jitconfig +type ItemActionsRunnersGenerateJitconfigRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersGenerateJitconfigRequestBuilderInternal instantiates a new ItemActionsRunnersGenerateJitconfigRequestBuilder and sets the default values. +func NewItemActionsRunnersGenerateJitconfigRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersGenerateJitconfigRequestBuilder) { + m := &ItemActionsRunnersGenerateJitconfigRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runners/generate-jitconfig", pathParameters), + } + return m +} +// NewItemActionsRunnersGenerateJitconfigRequestBuilder instantiates a new ItemActionsRunnersGenerateJitconfigRequestBuilder and sets the default values. +func NewItemActionsRunnersGenerateJitconfigRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersGenerateJitconfigRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersGenerateJitconfigRequestBuilderInternal(urlParams, requestAdapter) +} +// Post generates a configuration that can be passed to the runner application at startup.The authenticated user must have admin access to the organization.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to 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 ItemActionsRunnersGenerateJitconfigPostResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization +func (m *ItemActionsRunnersGenerateJitconfigRequestBuilder) Post(ctx context.Context, body ItemActionsRunnersGenerateJitconfigPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersGenerateJitconfigPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersGenerateJitconfigPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersGenerateJitconfigPostResponseable), nil +} +// ToPostRequestInformation generates a configuration that can be passed to the runner application at startup.The authenticated user must have admin access to the organization.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersGenerateJitconfigRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemActionsRunnersGenerateJitconfigPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsRunnersGenerateJitconfigRequestBuilder when successful +func (m *ItemActionsRunnersGenerateJitconfigRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersGenerateJitconfigRequestBuilder) { + return NewItemActionsRunnersGenerateJitconfigRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_generate_jitconfig_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_generate_jitconfig_response.go new file mode 100644 index 000000000..10f019eb3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_generate_jitconfig_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemActionsRunnersGenerateJitconfigResponse +// Deprecated: This class is obsolete. Use generateJitconfigPostResponse instead. +type ItemActionsRunnersGenerateJitconfigResponse struct { + ItemActionsRunnersGenerateJitconfigPostResponse +} +// NewItemActionsRunnersGenerateJitconfigResponse instantiates a new ItemActionsRunnersGenerateJitconfigResponse and sets the default values. +func NewItemActionsRunnersGenerateJitconfigResponse()(*ItemActionsRunnersGenerateJitconfigResponse) { + m := &ItemActionsRunnersGenerateJitconfigResponse{ + ItemActionsRunnersGenerateJitconfigPostResponse: *NewItemActionsRunnersGenerateJitconfigPostResponse(), + } + return m +} +// CreateItemActionsRunnersGenerateJitconfigResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemActionsRunnersGenerateJitconfigResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersGenerateJitconfigResponse(), nil +} +// ItemActionsRunnersGenerateJitconfigResponseable +// Deprecated: This class is obsolete. Use generateJitconfigPostResponse instead. +type ItemActionsRunnersGenerateJitconfigResponseable interface { + ItemActionsRunnersGenerateJitconfigPostResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_get_response.go new file mode 100644 index 000000000..6d20e02f9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemActionsRunnersGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The runners property + runners []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable + // The total_count property + total_count *int32 +} +// NewItemActionsRunnersGetResponse instantiates a new ItemActionsRunnersGetResponse and sets the default values. +func NewItemActionsRunnersGetResponse()(*ItemActionsRunnersGetResponse) { + m := &ItemActionsRunnersGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersGetResponse(), 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 *ItemActionsRunnersGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsRunnersGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["runners"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable) + } + } + m.SetRunners(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRunners gets the runners property value. The runners property +// returns a []Runnerable when successful +func (m *ItemActionsRunnersGetResponse) GetRunners()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable) { + return m.runners +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsRunnersGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRunners() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRunners())) + for i, v := range m.GetRunners() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("runners", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemActionsRunnersGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRunners sets the runners property value. The runners property +func (m *ItemActionsRunnersGetResponse) SetRunners(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable)() { + m.runners = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsRunnersGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRunners()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable) + GetTotalCount()(*int32) + SetRunners(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_delete_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_delete_response.go new file mode 100644 index 000000000..165c7a7f5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_delete_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemActionsRunnersItemLabelsDeleteResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The labels property + labels []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemActionsRunnersItemLabelsDeleteResponse instantiates a new ItemActionsRunnersItemLabelsDeleteResponse and sets the default values. +func NewItemActionsRunnersItemLabelsDeleteResponse()(*ItemActionsRunnersItemLabelsDeleteResponse) { + m := &ItemActionsRunnersItemLabelsDeleteResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsDeleteResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsDeleteResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsDeleteResponse(), 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 *ItemActionsRunnersItemLabelsDeleteResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsRunnersItemLabelsDeleteResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + } + } + m.SetLabels(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemActionsRunnersItemLabelsDeleteResponse) GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsRunnersItemLabelsDeleteResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsDeleteResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemActionsRunnersItemLabelsDeleteResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemActionsRunnersItemLabelsDeleteResponse) SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersItemLabelsDeleteResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsRunnersItemLabelsDeleteResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_get_response.go new file mode 100644 index 000000000..d9b6ab9e1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemActionsRunnersItemLabelsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The labels property + labels []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemActionsRunnersItemLabelsGetResponse instantiates a new ItemActionsRunnersItemLabelsGetResponse and sets the default values. +func NewItemActionsRunnersItemLabelsGetResponse()(*ItemActionsRunnersItemLabelsGetResponse) { + m := &ItemActionsRunnersItemLabelsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsGetResponse(), 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 *ItemActionsRunnersItemLabelsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsRunnersItemLabelsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + } + } + m.SetLabels(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemActionsRunnersItemLabelsGetResponse) GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsRunnersItemLabelsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemActionsRunnersItemLabelsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemActionsRunnersItemLabelsGetResponse) SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersItemLabelsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsRunnersItemLabelsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_item_with_name_delete_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_item_with_name_delete_response.go new file mode 100644 index 000000000..d512eda12 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_item_with_name_delete_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemActionsRunnersItemLabelsItemWithNameDeleteResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The labels property + labels []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemActionsRunnersItemLabelsItemWithNameDeleteResponse instantiates a new ItemActionsRunnersItemLabelsItemWithNameDeleteResponse and sets the default values. +func NewItemActionsRunnersItemLabelsItemWithNameDeleteResponse()(*ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) { + m := &ItemActionsRunnersItemLabelsItemWithNameDeleteResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsItemWithNameDeleteResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsItemWithNameDeleteResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsItemWithNameDeleteResponse(), 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 *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + } + } + m.SetLabels(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsRunnersItemLabelsItemWithNameDeleteResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_item_with_name_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_item_with_name_response.go new file mode 100644 index 000000000..0582fa764 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_item_with_name_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemActionsRunnersItemLabelsItemWithNameResponse +// Deprecated: This class is obsolete. Use WithNameDeleteResponse instead. +type ItemActionsRunnersItemLabelsItemWithNameResponse struct { + ItemActionsRunnersItemLabelsItemWithNameDeleteResponse +} +// NewItemActionsRunnersItemLabelsItemWithNameResponse instantiates a new ItemActionsRunnersItemLabelsItemWithNameResponse and sets the default values. +func NewItemActionsRunnersItemLabelsItemWithNameResponse()(*ItemActionsRunnersItemLabelsItemWithNameResponse) { + m := &ItemActionsRunnersItemLabelsItemWithNameResponse{ + ItemActionsRunnersItemLabelsItemWithNameDeleteResponse: *NewItemActionsRunnersItemLabelsItemWithNameDeleteResponse(), + } + return m +} +// CreateItemActionsRunnersItemLabelsItemWithNameResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemActionsRunnersItemLabelsItemWithNameResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsItemWithNameResponse(), nil +} +// ItemActionsRunnersItemLabelsItemWithNameResponseable +// Deprecated: This class is obsolete. Use WithNameDeleteResponse instead. +type ItemActionsRunnersItemLabelsItemWithNameResponseable interface { + ItemActionsRunnersItemLabelsItemWithNameDeleteResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_post_request_body.go new file mode 100644 index 000000000..9a05259a0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_post_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsRunnersItemLabelsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The names of the custom labels to add to the runner. + labels []string +} +// NewItemActionsRunnersItemLabelsPostRequestBody instantiates a new ItemActionsRunnersItemLabelsPostRequestBody and sets the default values. +func NewItemActionsRunnersItemLabelsPostRequestBody()(*ItemActionsRunnersItemLabelsPostRequestBody) { + m := &ItemActionsRunnersItemLabelsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsPostRequestBody(), 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 *ItemActionsRunnersItemLabelsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsRunnersItemLabelsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the custom labels to add to the runner. +// returns a []string when successful +func (m *ItemActionsRunnersItemLabelsPostRequestBody) GetLabels()([]string) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + 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 *ItemActionsRunnersItemLabelsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the custom labels to add to the runner. +func (m *ItemActionsRunnersItemLabelsPostRequestBody) SetLabels(value []string)() { + m.labels = value +} +type ItemActionsRunnersItemLabelsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + SetLabels(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_post_response.go new file mode 100644 index 000000000..828a67fca --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_post_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemActionsRunnersItemLabelsPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The labels property + labels []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemActionsRunnersItemLabelsPostResponse instantiates a new ItemActionsRunnersItemLabelsPostResponse and sets the default values. +func NewItemActionsRunnersItemLabelsPostResponse()(*ItemActionsRunnersItemLabelsPostResponse) { + m := &ItemActionsRunnersItemLabelsPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsPostResponse(), 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 *ItemActionsRunnersItemLabelsPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsRunnersItemLabelsPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + } + } + m.SetLabels(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemActionsRunnersItemLabelsPostResponse) GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsRunnersItemLabelsPostResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemActionsRunnersItemLabelsPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemActionsRunnersItemLabelsPostResponse) SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersItemLabelsPostResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsRunnersItemLabelsPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_put_request_body.go new file mode 100644 index 000000000..7ceebb536 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_put_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsRunnersItemLabelsPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. + labels []string +} +// NewItemActionsRunnersItemLabelsPutRequestBody instantiates a new ItemActionsRunnersItemLabelsPutRequestBody and sets the default values. +func NewItemActionsRunnersItemLabelsPutRequestBody()(*ItemActionsRunnersItemLabelsPutRequestBody) { + m := &ItemActionsRunnersItemLabelsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsPutRequestBody(), 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 *ItemActionsRunnersItemLabelsPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsRunnersItemLabelsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. +// returns a []string when successful +func (m *ItemActionsRunnersItemLabelsPutRequestBody) GetLabels()([]string) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + 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 *ItemActionsRunnersItemLabelsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. +func (m *ItemActionsRunnersItemLabelsPutRequestBody) SetLabels(value []string)() { + m.labels = value +} +type ItemActionsRunnersItemLabelsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + SetLabels(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_put_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_put_response.go new file mode 100644 index 000000000..b30b2faa1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_put_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemActionsRunnersItemLabelsPutResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The labels property + labels []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemActionsRunnersItemLabelsPutResponse instantiates a new ItemActionsRunnersItemLabelsPutResponse and sets the default values. +func NewItemActionsRunnersItemLabelsPutResponse()(*ItemActionsRunnersItemLabelsPutResponse) { + m := &ItemActionsRunnersItemLabelsPutResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsPutResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsPutResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsPutResponse(), 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 *ItemActionsRunnersItemLabelsPutResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsRunnersItemLabelsPutResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + } + } + m.SetLabels(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemActionsRunnersItemLabelsPutResponse) GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsRunnersItemLabelsPutResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsPutResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemActionsRunnersItemLabelsPutResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemActionsRunnersItemLabelsPutResponse) SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersItemLabelsPutResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsRunnersItemLabelsPutResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_request_builder.go new file mode 100644 index 000000000..6fc5693a9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_request_builder.go @@ -0,0 +1,178 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemActionsRunnersItemLabelsRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runners\{runner_id}\labels +type ItemActionsRunnersItemLabelsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByName gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.actions.runners.item.labels.item collection +// returns a *ItemActionsRunnersItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) ByName(name string)(*ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsRunnersItemLabelsRequestBuilderInternal instantiates a new ItemActionsRunnersItemLabelsRequestBuilder and sets the default values. +func NewItemActionsRunnersItemLabelsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersItemLabelsRequestBuilder) { + m := &ItemActionsRunnersItemLabelsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runners/{runner_id}/labels", pathParameters), + } + return m +} +// NewItemActionsRunnersItemLabelsRequestBuilder instantiates a new ItemActionsRunnersItemLabelsRequestBuilder and sets the default values. +func NewItemActionsRunnersItemLabelsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersItemLabelsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersItemLabelsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete remove all custom labels from a self-hosted runner configured in anorganization. Returns the remaining read-only labels from the runner.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsRunnersItemLabelsDeleteResponseable 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/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-organization +func (m *ItemActionsRunnersItemLabelsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersItemLabelsDeleteResponseable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersItemLabelsDeleteResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersItemLabelsDeleteResponseable), nil +} +// Get lists all labels for a self-hosted runner configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsRunnersItemLabelsGetResponseable 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/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-organization +func (m *ItemActionsRunnersItemLabelsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersItemLabelsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersItemLabelsGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersItemLabelsGetResponseable), nil +} +// Post adds custom labels to a self-hosted runner configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemActionsRunnersItemLabelsPostResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-organization +func (m *ItemActionsRunnersItemLabelsRequestBuilder) Post(ctx context.Context, body ItemActionsRunnersItemLabelsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersItemLabelsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersItemLabelsPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersItemLabelsPostResponseable), nil +} +// Put remove all previous custom labels and set the new custom labels for a specificself-hosted runner configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsRunnersItemLabelsPutResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-organization +func (m *ItemActionsRunnersItemLabelsRequestBuilder) Put(ctx context.Context, body ItemActionsRunnersItemLabelsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersItemLabelsPutResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersItemLabelsPutResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersItemLabelsPutResponseable), nil +} +// ToDeleteRequestInformation remove all custom labels from a self-hosted runner configured in anorganization. Returns the remaining read-only labels from the runner.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation lists all labels for a self-hosted runner configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation adds custom labels to a self-hosted runner configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemActionsRunnersItemLabelsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPutRequestInformation remove all previous custom labels and set the new custom labels for a specificself-hosted runner configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsRunnersItemLabelsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsRunnersItemLabelsRequestBuilder when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersItemLabelsRequestBuilder) { + return NewItemActionsRunnersItemLabelsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_response.go new file mode 100644 index 000000000..de085b1c8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemActionsRunnersItemLabelsResponse +// Deprecated: This class is obsolete. Use labelsGetResponse instead. +type ItemActionsRunnersItemLabelsResponse struct { + ItemActionsRunnersItemLabelsGetResponse +} +// NewItemActionsRunnersItemLabelsResponse instantiates a new ItemActionsRunnersItemLabelsResponse and sets the default values. +func NewItemActionsRunnersItemLabelsResponse()(*ItemActionsRunnersItemLabelsResponse) { + m := &ItemActionsRunnersItemLabelsResponse{ + ItemActionsRunnersItemLabelsGetResponse: *NewItemActionsRunnersItemLabelsGetResponse(), + } + return m +} +// CreateItemActionsRunnersItemLabelsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemActionsRunnersItemLabelsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsResponse(), nil +} +// ItemActionsRunnersItemLabelsResponseable +// Deprecated: This class is obsolete. Use labelsGetResponse instead. +type ItemActionsRunnersItemLabelsResponseable interface { + ItemActionsRunnersItemLabelsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_with_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_with_name_item_request_builder.go new file mode 100644 index 000000000..755852820 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_item_labels_with_name_item_request_builder.go @@ -0,0 +1,63 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemActionsRunnersItemLabelsWithNameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runners\{runner_id}\labels\{name} +type ItemActionsRunnersItemLabelsWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal instantiates a new ItemActionsRunnersItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + m := &ItemActionsRunnersItemLabelsWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runners/{runner_id}/labels/{name}", pathParameters), + } + return m +} +// NewItemActionsRunnersItemLabelsWithNameItemRequestBuilder instantiates a new ItemActionsRunnersItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemActionsRunnersItemLabelsWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete remove a custom label from a self-hosted runner configuredin an organization. Returns the remaining labels from the runner.This endpoint returns a `404 Not Found` status if the custom label is notpresent on the runner.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsRunnersItemLabelsItemWithNameDeleteResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-organization +func (m *ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersItemLabelsItemWithNameDeleteResponseable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersItemLabelsItemWithNameDeleteResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersItemLabelsItemWithNameDeleteResponseable), nil +} +// ToDeleteRequestInformation remove a custom label from a self-hosted runner configuredin an organization. Returns the remaining labels from the runner.This endpoint returns a `404 Not Found` status if the custom label is notpresent on the runner.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsRunnersItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + return NewItemActionsRunnersItemLabelsWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_registration_token_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_registration_token_request_builder.go new file mode 100644 index 000000000..cbf87590d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_registration_token_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemActionsRunnersRegistrationTokenRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runners\registration-token +type ItemActionsRunnersRegistrationTokenRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersRegistrationTokenRequestBuilderInternal instantiates a new ItemActionsRunnersRegistrationTokenRequestBuilder and sets the default values. +func NewItemActionsRunnersRegistrationTokenRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRegistrationTokenRequestBuilder) { + m := &ItemActionsRunnersRegistrationTokenRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runners/registration-token", pathParameters), + } + return m +} +// NewItemActionsRunnersRegistrationTokenRequestBuilder instantiates a new ItemActionsRunnersRegistrationTokenRequestBuilder and sets the default values. +func NewItemActionsRunnersRegistrationTokenRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRegistrationTokenRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersRegistrationTokenRequestBuilderInternal(urlParams, requestAdapter) +} +// Post returns a token that you can pass to the `config` script. The token expires after one hour.For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner:```./config.sh --url https://github.com/octo-org --token TOKEN```Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to 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 AuthenticationTokenable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization +func (m *ItemActionsRunnersRegistrationTokenRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AuthenticationTokenable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAuthenticationTokenFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AuthenticationTokenable), nil +} +// ToPostRequestInformation returns a token that you can pass to the `config` script. The token expires after one hour.For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner:```./config.sh --url https://github.com/octo-org --token TOKEN```Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersRegistrationTokenRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsRunnersRegistrationTokenRequestBuilder when successful +func (m *ItemActionsRunnersRegistrationTokenRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersRegistrationTokenRequestBuilder) { + return NewItemActionsRunnersRegistrationTokenRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_remove_token_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_remove_token_request_builder.go new file mode 100644 index 000000000..64a7364c6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_remove_token_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemActionsRunnersRemoveTokenRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runners\remove-token +type ItemActionsRunnersRemoveTokenRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersRemoveTokenRequestBuilderInternal instantiates a new ItemActionsRunnersRemoveTokenRequestBuilder and sets the default values. +func NewItemActionsRunnersRemoveTokenRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRemoveTokenRequestBuilder) { + m := &ItemActionsRunnersRemoveTokenRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runners/remove-token", pathParameters), + } + return m +} +// NewItemActionsRunnersRemoveTokenRequestBuilder instantiates a new ItemActionsRunnersRemoveTokenRequestBuilder and sets the default values. +func NewItemActionsRunnersRemoveTokenRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRemoveTokenRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersRemoveTokenRequestBuilderInternal(urlParams, requestAdapter) +} +// Post returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour.For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization:```./config.sh remove --token TOKEN```Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to 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 AuthenticationTokenable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization +func (m *ItemActionsRunnersRemoveTokenRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AuthenticationTokenable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAuthenticationTokenFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AuthenticationTokenable), nil +} +// ToPostRequestInformation returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour.For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization:```./config.sh remove --token TOKEN```Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersRemoveTokenRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsRunnersRemoveTokenRequestBuilder when successful +func (m *ItemActionsRunnersRemoveTokenRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersRemoveTokenRequestBuilder) { + return NewItemActionsRunnersRemoveTokenRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_request_builder.go new file mode 100644 index 000000000..04356f864 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_request_builder.go @@ -0,0 +1,96 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsRunnersRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runners +type ItemActionsRunnersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsRunnersRequestBuilderGetQueryParameters lists all self-hosted runners configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +type ItemActionsRunnersRequestBuilderGetQueryParameters struct { + // The name of a self-hosted runner. + Name *string `uriparametername:"name"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRunner_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.actions.runners.item collection +// returns a *ItemActionsRunnersWithRunner_ItemRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) ByRunner_id(runner_id int32)(*ItemActionsRunnersWithRunner_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["runner_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(runner_id), 10) + return NewItemActionsRunnersWithRunner_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsRunnersRequestBuilderInternal instantiates a new ItemActionsRunnersRequestBuilder and sets the default values. +func NewItemActionsRunnersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRequestBuilder) { + m := &ItemActionsRunnersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runners{?name*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsRunnersRequestBuilder instantiates a new ItemActionsRunnersRequestBuilder and sets the default values. +func NewItemActionsRunnersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersRequestBuilderInternal(urlParams, requestAdapter) +} +// Downloads the downloads property +// returns a *ItemActionsRunnersDownloadsRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) Downloads()(*ItemActionsRunnersDownloadsRequestBuilder) { + return NewItemActionsRunnersDownloadsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// GenerateJitconfig the generateJitconfig property +// returns a *ItemActionsRunnersGenerateJitconfigRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) GenerateJitconfig()(*ItemActionsRunnersGenerateJitconfigRequestBuilder) { + return NewItemActionsRunnersGenerateJitconfigRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get lists all self-hosted runners configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsRunnersGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization +func (m *ItemActionsRunnersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnersRequestBuilderGetQueryParameters])(ItemActionsRunnersGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersGetResponseable), nil +} +// RegistrationToken the registrationToken property +// returns a *ItemActionsRunnersRegistrationTokenRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) RegistrationToken()(*ItemActionsRunnersRegistrationTokenRequestBuilder) { + return NewItemActionsRunnersRegistrationTokenRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// RemoveToken the removeToken property +// returns a *ItemActionsRunnersRemoveTokenRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) RemoveToken()(*ItemActionsRunnersRemoveTokenRequestBuilder) { + return NewItemActionsRunnersRemoveTokenRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all self-hosted runners configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnersRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsRunnersRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersRequestBuilder) { + return NewItemActionsRunnersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_response.go new file mode 100644 index 000000000..ea1e01945 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemActionsRunnersResponse +// Deprecated: This class is obsolete. Use runnersGetResponse instead. +type ItemActionsRunnersResponse struct { + ItemActionsRunnersGetResponse +} +// NewItemActionsRunnersResponse instantiates a new ItemActionsRunnersResponse and sets the default values. +func NewItemActionsRunnersResponse()(*ItemActionsRunnersResponse) { + m := &ItemActionsRunnersResponse{ + ItemActionsRunnersGetResponse: *NewItemActionsRunnersGetResponse(), + } + return m +} +// CreateItemActionsRunnersResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemActionsRunnersResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersResponse(), nil +} +// ItemActionsRunnersResponseable +// Deprecated: This class is obsolete. Use runnersGetResponse instead. +type ItemActionsRunnersResponseable interface { + ItemActionsRunnersGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_with_runner_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_with_runner_item_request_builder.go new file mode 100644 index 000000000..c510e61b6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_runners_with_runner_item_request_builder.go @@ -0,0 +1,84 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemActionsRunnersWithRunner_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runners\{runner_id} +type ItemActionsRunnersWithRunner_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersWithRunner_ItemRequestBuilderInternal instantiates a new ItemActionsRunnersWithRunner_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnersWithRunner_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersWithRunner_ItemRequestBuilder) { + m := &ItemActionsRunnersWithRunner_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runners/{runner_id}", pathParameters), + } + return m +} +// NewItemActionsRunnersWithRunner_ItemRequestBuilder instantiates a new ItemActionsRunnersWithRunner_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnersWithRunner_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersWithRunner_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersWithRunner_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization +func (m *ItemActionsRunnersWithRunner_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a specific self-hosted runner configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a Runnerable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization +func (m *ItemActionsRunnersWithRunner_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable), nil +} +// Labels the labels property +// returns a *ItemActionsRunnersItemLabelsRequestBuilder when successful +func (m *ItemActionsRunnersWithRunner_ItemRequestBuilder) Labels()(*ItemActionsRunnersItemLabelsRequestBuilder) { + return NewItemActionsRunnersItemLabelsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersWithRunner_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a specific self-hosted runner configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersWithRunner_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsRunnersWithRunner_ItemRequestBuilder when successful +func (m *ItemActionsRunnersWithRunner_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersWithRunner_ItemRequestBuilder) { + return NewItemActionsRunnersWithRunner_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_get_response.go new file mode 100644 index 000000000..bdfa9d199 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemActionsSecretsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The secrets property + secrets []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsSecretable + // The total_count property + total_count *int32 +} +// NewItemActionsSecretsGetResponse instantiates a new ItemActionsSecretsGetResponse and sets the default values. +func NewItemActionsSecretsGetResponse()(*ItemActionsSecretsGetResponse) { + m := &ItemActionsSecretsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsSecretsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsSecretsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsSecretsGetResponse(), 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 *ItemActionsSecretsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsSecretsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationActionsSecretFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsSecretable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsSecretable) + } + } + m.SetSecrets(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetSecrets gets the secrets property value. The secrets property +// returns a []OrganizationActionsSecretable when successful +func (m *ItemActionsSecretsGetResponse) GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsSecretable) { + return m.secrets +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsSecretsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsSecretsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecrets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSecrets())) + for i, v := range m.GetSecrets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("secrets", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemActionsSecretsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSecrets sets the secrets property value. The secrets property +func (m *ItemActionsSecretsGetResponse) SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsSecretable)() { + m.secrets = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsSecretsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsSecretsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsSecretable) + GetTotalCount()(*int32) + SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsSecretable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_repositories_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_repositories_get_response.go new file mode 100644 index 000000000..a2d8c8198 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_repositories_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemActionsSecretsItemRepositoriesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The repositories property + repositories []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable + // The total_count property + total_count *int32 +} +// NewItemActionsSecretsItemRepositoriesGetResponse instantiates a new ItemActionsSecretsItemRepositoriesGetResponse and sets the default values. +func NewItemActionsSecretsItemRepositoriesGetResponse()(*ItemActionsSecretsItemRepositoriesGetResponse) { + m := &ItemActionsSecretsItemRepositoriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsSecretsItemRepositoriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsSecretsItemRepositoriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsSecretsItemRepositoriesGetResponse(), 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 *ItemActionsSecretsItemRepositoriesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsSecretsItemRepositoriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []MinimalRepositoryable when successful +func (m *ItemActionsSecretsItemRepositoriesGetResponse) GetRepositories()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) { + return m.repositories +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsSecretsItemRepositoriesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsSecretsItemRepositoriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemActionsSecretsItemRepositoriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *ItemActionsSecretsItemRepositoriesGetResponse) SetRepositories(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable)() { + m.repositories = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsSecretsItemRepositoriesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsSecretsItemRepositoriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositories()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + GetTotalCount()(*int32) + SetRepositories(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_repositories_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_repositories_put_request_body.go new file mode 100644 index 000000000..65c04c9c6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_repositories_put_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsSecretsItemRepositoriesPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Add selected repository to an organization secret](https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + selected_repository_ids []int32 +} +// NewItemActionsSecretsItemRepositoriesPutRequestBody instantiates a new ItemActionsSecretsItemRepositoriesPutRequestBody and sets the default values. +func NewItemActionsSecretsItemRepositoriesPutRequestBody()(*ItemActionsSecretsItemRepositoriesPutRequestBody) { + m := &ItemActionsSecretsItemRepositoriesPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsSecretsItemRepositoriesPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsSecretsItemRepositoriesPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsSecretsItemRepositoriesPutRequestBody(), 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 *ItemActionsSecretsItemRepositoriesPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsSecretsItemRepositoriesPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["selected_repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetSelectedRepositoryIds(res) + } + return nil + } + return res +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Add selected repository to an organization secret](https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. +// returns a []int32 when successful +func (m *ItemActionsSecretsItemRepositoriesPutRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *ItemActionsSecretsItemRepositoriesPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + 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 *ItemActionsSecretsItemRepositoriesPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Add selected repository to an organization secret](https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. +func (m *ItemActionsSecretsItemRepositoriesPutRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +type ItemActionsSecretsItemRepositoriesPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedRepositoryIds()([]int32) + SetSelectedRepositoryIds(value []int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_repositories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_repositories_request_builder.go new file mode 100644 index 000000000..dcb9df10c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_repositories_request_builder.go @@ -0,0 +1,100 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsSecretsItemRepositoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\secrets\{secret_name}\repositories +type ItemActionsSecretsItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsSecretsItemRepositoriesRequestBuilderGetQueryParameters lists all repositories that have been selected when the `visibility`for repository access to a secret is set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +type ItemActionsSecretsItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRepository_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.actions.secrets.item.repositories.item collection +// returns a *ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemActionsSecretsItemRepositoriesRequestBuilder) ByRepository_id(repository_id int32)(*ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["repository_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(repository_id), 10) + return NewItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsSecretsItemRepositoriesRequestBuilderInternal instantiates a new ItemActionsSecretsItemRepositoriesRequestBuilder and sets the default values. +func NewItemActionsSecretsItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsItemRepositoriesRequestBuilder) { + m := &ItemActionsSecretsItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/secrets/{secret_name}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsSecretsItemRepositoriesRequestBuilder instantiates a new ItemActionsSecretsItemRepositoriesRequestBuilder and sets the default values. +func NewItemActionsSecretsItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsSecretsItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all repositories that have been selected when the `visibility`for repository access to a secret is set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsSecretsItemRepositoriesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret +func (m *ItemActionsSecretsItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsSecretsItemRepositoriesRequestBuilderGetQueryParameters])(ItemActionsSecretsItemRepositoriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsSecretsItemRepositoriesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsSecretsItemRepositoriesGetResponseable), nil +} +// Put replaces all repositories for an organization secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret).Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret +func (m *ItemActionsSecretsItemRepositoriesRequestBuilder) Put(ctx context.Context, body ItemActionsSecretsItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation lists all repositories that have been selected when the `visibility`for repository access to a secret is set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsSecretsItemRepositoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation replaces all repositories for an organization secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret).Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsItemRepositoriesRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsSecretsItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsSecretsItemRepositoriesRequestBuilder when successful +func (m *ItemActionsSecretsItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemActionsSecretsItemRepositoriesRequestBuilder) { + return NewItemActionsSecretsItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_repositories_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_repositories_response.go new file mode 100644 index 000000000..6486a530f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_repositories_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemActionsSecretsItemRepositoriesResponse +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type ItemActionsSecretsItemRepositoriesResponse struct { + ItemActionsSecretsItemRepositoriesGetResponse +} +// NewItemActionsSecretsItemRepositoriesResponse instantiates a new ItemActionsSecretsItemRepositoriesResponse and sets the default values. +func NewItemActionsSecretsItemRepositoriesResponse()(*ItemActionsSecretsItemRepositoriesResponse) { + m := &ItemActionsSecretsItemRepositoriesResponse{ + ItemActionsSecretsItemRepositoriesGetResponse: *NewItemActionsSecretsItemRepositoriesGetResponse(), + } + return m +} +// CreateItemActionsSecretsItemRepositoriesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemActionsSecretsItemRepositoriesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsSecretsItemRepositoriesResponse(), nil +} +// ItemActionsSecretsItemRepositoriesResponseable +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type ItemActionsSecretsItemRepositoriesResponseable interface { + ItemActionsSecretsItemRepositoriesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_repositories_with_repository_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_repositories_with_repository_item_request_builder.go new file mode 100644 index 000000000..7ac5253e6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_repositories_with_repository_item_request_builder.go @@ -0,0 +1,73 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\secrets\{secret_name}\repositories\{repository_id} +type ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal instantiates a new ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + m := &ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}", pathParameters), + } + return m +} +// NewItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder instantiates a new ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a repository from an organization secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret).Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret +func (m *ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put adds a repository to an organization secret when the `visibility` forrepository access is set to `selected`. For more information about setting the visibility, see [Create orupdate an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret).Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret +func (m *ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a repository from an organization secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret).Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToPutRequestInformation adds a repository to an organization secret when the `visibility` forrepository access is set to `selected`. For more information about setting the visibility, see [Create orupdate an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret).Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + return NewItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_with_secret_name_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_with_secret_name_put_request_body.go new file mode 100644 index 000000000..b612f07cd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_item_with_secret_name_put_request_body.go @@ -0,0 +1,144 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsSecretsItemWithSecret_namePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/actions/secrets#get-an-organization-public-key) endpoint. + encrypted_value *string + // ID of the key you used to encrypt the secret. + key_id *string + // An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + selected_repository_ids []int32 +} +// NewItemActionsSecretsItemWithSecret_namePutRequestBody instantiates a new ItemActionsSecretsItemWithSecret_namePutRequestBody and sets the default values. +func NewItemActionsSecretsItemWithSecret_namePutRequestBody()(*ItemActionsSecretsItemWithSecret_namePutRequestBody) { + m := &ItemActionsSecretsItemWithSecret_namePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsSecretsItemWithSecret_namePutRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemActionsSecretsItemWithSecret_namePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncryptedValue gets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/actions/secrets#get-an-organization-public-key) endpoint. +// returns a *string when successful +func (m *ItemActionsSecretsItemWithSecret_namePutRequestBody) GetEncryptedValue()(*string) { + return m.encrypted_value +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsSecretsItemWithSecret_namePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["encrypted_value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncryptedValue(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + res["selected_repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetSelectedRepositoryIds(res) + } + return nil + } + return res +} +// GetKeyId gets the key_id property value. ID of the key you used to encrypt the secret. +// returns a *string when successful +func (m *ItemActionsSecretsItemWithSecret_namePutRequestBody) GetKeyId()(*string) { + return m.key_id +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. +// returns a []int32 when successful +func (m *ItemActionsSecretsItemWithSecret_namePutRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *ItemActionsSecretsItemWithSecret_namePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("encrypted_value", m.GetEncryptedValue()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + 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 *ItemActionsSecretsItemWithSecret_namePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncryptedValue sets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/actions/secrets#get-an-organization-public-key) endpoint. +func (m *ItemActionsSecretsItemWithSecret_namePutRequestBody) SetEncryptedValue(value *string)() { + m.encrypted_value = value +} +// SetKeyId sets the key_id property value. ID of the key you used to encrypt the secret. +func (m *ItemActionsSecretsItemWithSecret_namePutRequestBody) SetKeyId(value *string)() { + m.key_id = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. +func (m *ItemActionsSecretsItemWithSecret_namePutRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +type ItemActionsSecretsItemWithSecret_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncryptedValue()(*string) + GetKeyId()(*string) + GetSelectedRepositoryIds()([]int32) + SetEncryptedValue(value *string)() + SetKeyId(value *string)() + SetSelectedRepositoryIds(value []int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_public_key_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_public_key_request_builder.go new file mode 100644 index 000000000..2eebebc25 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_public_key_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemActionsSecretsPublicKeyRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\secrets\public-key +type ItemActionsSecretsPublicKeyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsSecretsPublicKeyRequestBuilderInternal instantiates a new ItemActionsSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemActionsSecretsPublicKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsPublicKeyRequestBuilder) { + m := &ItemActionsSecretsPublicKeyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/secrets/public-key", pathParameters), + } + return m +} +// NewItemActionsSecretsPublicKeyRequestBuilder instantiates a new ItemActionsSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemActionsSecretsPublicKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsPublicKeyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsSecretsPublicKeyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets.The authenticated user must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsPublicKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key +func (m *ItemActionsSecretsPublicKeyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsPublicKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsPublicKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsPublicKeyable), nil +} +// ToGetRequestInformation gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets.The authenticated user must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsPublicKeyRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsSecretsPublicKeyRequestBuilder when successful +func (m *ItemActionsSecretsPublicKeyRequestBuilder) WithUrl(rawUrl string)(*ItemActionsSecretsPublicKeyRequestBuilder) { + return NewItemActionsSecretsPublicKeyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_request_builder.go new file mode 100644 index 000000000..d37e827eb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_request_builder.go @@ -0,0 +1,80 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsSecretsRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\secrets +type ItemActionsSecretsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsSecretsRequestBuilderGetQueryParameters lists all secrets available in an organization without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +type ItemActionsSecretsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// BySecret_name gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.actions.secrets.item collection +// returns a *ItemActionsSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemActionsSecretsRequestBuilder) BySecret_name(secret_name string)(*ItemActionsSecretsWithSecret_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if secret_name != "" { + urlTplParams["secret_name"] = secret_name + } + return NewItemActionsSecretsWithSecret_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsSecretsRequestBuilderInternal instantiates a new ItemActionsSecretsRequestBuilder and sets the default values. +func NewItemActionsSecretsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsRequestBuilder) { + m := &ItemActionsSecretsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/secrets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsSecretsRequestBuilder instantiates a new ItemActionsSecretsRequestBuilder and sets the default values. +func NewItemActionsSecretsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsSecretsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all secrets available in an organization without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsSecretsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#list-organization-secrets +func (m *ItemActionsSecretsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsSecretsRequestBuilderGetQueryParameters])(ItemActionsSecretsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsSecretsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsSecretsGetResponseable), nil +} +// PublicKey the publicKey property +// returns a *ItemActionsSecretsPublicKeyRequestBuilder when successful +func (m *ItemActionsSecretsRequestBuilder) PublicKey()(*ItemActionsSecretsPublicKeyRequestBuilder) { + return NewItemActionsSecretsPublicKeyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all secrets available in an organization without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsSecretsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsSecretsRequestBuilder when successful +func (m *ItemActionsSecretsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsSecretsRequestBuilder) { + return NewItemActionsSecretsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_response.go new file mode 100644 index 000000000..6a0a6ed8d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemActionsSecretsResponse +// Deprecated: This class is obsolete. Use secretsGetResponse instead. +type ItemActionsSecretsResponse struct { + ItemActionsSecretsGetResponse +} +// NewItemActionsSecretsResponse instantiates a new ItemActionsSecretsResponse and sets the default values. +func NewItemActionsSecretsResponse()(*ItemActionsSecretsResponse) { + m := &ItemActionsSecretsResponse{ + ItemActionsSecretsGetResponse: *NewItemActionsSecretsGetResponse(), + } + return m +} +// CreateItemActionsSecretsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemActionsSecretsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsSecretsResponse(), nil +} +// ItemActionsSecretsResponseable +// Deprecated: This class is obsolete. Use secretsGetResponse instead. +type ItemActionsSecretsResponseable interface { + ItemActionsSecretsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_with_secret_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_with_secret_name_item_request_builder.go new file mode 100644 index 000000000..30c6cdcf7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_secrets_with_secret_name_item_request_builder.go @@ -0,0 +1,115 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemActionsSecretsWithSecret_nameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\secrets\{secret_name} +type ItemActionsSecretsWithSecret_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsSecretsWithSecret_nameItemRequestBuilderInternal instantiates a new ItemActionsSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemActionsSecretsWithSecret_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsWithSecret_nameItemRequestBuilder) { + m := &ItemActionsSecretsWithSecret_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/secrets/{secret_name}", pathParameters), + } + return m +} +// NewItemActionsSecretsWithSecret_nameItemRequestBuilder instantiates a new ItemActionsSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemActionsSecretsWithSecret_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsWithSecret_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsSecretsWithSecret_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a secret in an organization using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret +func (m *ItemActionsSecretsWithSecret_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a single organization secret without revealing its encrypted value.The authenticated user must have collaborator access to a repository to create, update, or read secretsOAuth tokens and personal access tokens (classic) need the`admin:org` scope to 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 OrganizationActionsSecretable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#get-an-organization-secret +func (m *ItemActionsSecretsWithSecret_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsSecretable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationActionsSecretFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsSecretable), nil +} +// Put creates or updates an organization secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to 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 EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret +func (m *ItemActionsSecretsWithSecret_nameItemRequestBuilder) Put(ctx context.Context, body ItemActionsSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// Repositories the repositories property +// returns a *ItemActionsSecretsItemRepositoriesRequestBuilder when successful +func (m *ItemActionsSecretsWithSecret_nameItemRequestBuilder) Repositories()(*ItemActionsSecretsItemRepositoriesRequestBuilder) { + return NewItemActionsSecretsItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a secret in an organization using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsWithSecret_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a single organization secret without revealing its encrypted value.The authenticated user must have collaborator access to a repository to create, update, or read secretsOAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsWithSecret_nameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation creates or updates an organization secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsWithSecret_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemActionsSecretsWithSecret_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsSecretsWithSecret_nameItemRequestBuilder) { + return NewItemActionsSecretsWithSecret_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_get_response.go new file mode 100644 index 000000000..01ebf05f4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemActionsVariablesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The total_count property + total_count *int32 + // The variables property + variables []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsVariableable +} +// NewItemActionsVariablesGetResponse instantiates a new ItemActionsVariablesGetResponse and sets the default values. +func NewItemActionsVariablesGetResponse()(*ItemActionsVariablesGetResponse) { + m := &ItemActionsVariablesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsVariablesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsVariablesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsVariablesGetResponse(), 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 *ItemActionsVariablesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsVariablesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + res["variables"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationActionsVariableFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsVariableable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsVariableable) + } + } + m.SetVariables(res) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsVariablesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// GetVariables gets the variables property value. The variables property +// returns a []OrganizationActionsVariableable when successful +func (m *ItemActionsVariablesGetResponse) GetVariables()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsVariableable) { + return m.variables +} +// Serialize serializes information the current object +func (m *ItemActionsVariablesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + if m.GetVariables() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVariables())) + for i, v := range m.GetVariables() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("variables", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemActionsVariablesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsVariablesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetVariables sets the variables property value. The variables property +func (m *ItemActionsVariablesGetResponse) SetVariables(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsVariableable)() { + m.variables = value +} +type ItemActionsVariablesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalCount()(*int32) + GetVariables()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsVariableable) + SetTotalCount(value *int32)() + SetVariables(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsVariableable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_repositories_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_repositories_get_response.go new file mode 100644 index 000000000..a804285bc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_repositories_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemActionsVariablesItemRepositoriesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The repositories property + repositories []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable + // The total_count property + total_count *int32 +} +// NewItemActionsVariablesItemRepositoriesGetResponse instantiates a new ItemActionsVariablesItemRepositoriesGetResponse and sets the default values. +func NewItemActionsVariablesItemRepositoriesGetResponse()(*ItemActionsVariablesItemRepositoriesGetResponse) { + m := &ItemActionsVariablesItemRepositoriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsVariablesItemRepositoriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsVariablesItemRepositoriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsVariablesItemRepositoriesGetResponse(), 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 *ItemActionsVariablesItemRepositoriesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsVariablesItemRepositoriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []MinimalRepositoryable when successful +func (m *ItemActionsVariablesItemRepositoriesGetResponse) GetRepositories()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) { + return m.repositories +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsVariablesItemRepositoriesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsVariablesItemRepositoriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemActionsVariablesItemRepositoriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *ItemActionsVariablesItemRepositoriesGetResponse) SetRepositories(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable)() { + m.repositories = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsVariablesItemRepositoriesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsVariablesItemRepositoriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositories()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + GetTotalCount()(*int32) + SetRepositories(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_repositories_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_repositories_put_request_body.go new file mode 100644 index 000000000..98eebbe27 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_repositories_put_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsVariablesItemRepositoriesPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The IDs of the repositories that can access the organization variable. + selected_repository_ids []int32 +} +// NewItemActionsVariablesItemRepositoriesPutRequestBody instantiates a new ItemActionsVariablesItemRepositoriesPutRequestBody and sets the default values. +func NewItemActionsVariablesItemRepositoriesPutRequestBody()(*ItemActionsVariablesItemRepositoriesPutRequestBody) { + m := &ItemActionsVariablesItemRepositoriesPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsVariablesItemRepositoriesPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsVariablesItemRepositoriesPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsVariablesItemRepositoriesPutRequestBody(), 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 *ItemActionsVariablesItemRepositoriesPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsVariablesItemRepositoriesPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["selected_repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetSelectedRepositoryIds(res) + } + return nil + } + return res +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. The IDs of the repositories that can access the organization variable. +// returns a []int32 when successful +func (m *ItemActionsVariablesItemRepositoriesPutRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *ItemActionsVariablesItemRepositoriesPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + 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 *ItemActionsVariablesItemRepositoriesPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. The IDs of the repositories that can access the organization variable. +func (m *ItemActionsVariablesItemRepositoriesPutRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +type ItemActionsVariablesItemRepositoriesPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedRepositoryIds()([]int32) + SetSelectedRepositoryIds(value []int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_repositories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_repositories_request_builder.go new file mode 100644 index 000000000..af5665be9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_repositories_request_builder.go @@ -0,0 +1,100 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsVariablesItemRepositoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\variables\{name}\repositories +type ItemActionsVariablesItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsVariablesItemRepositoriesRequestBuilderGetQueryParameters lists all repositories that can access an organization variablethat is available to selected repositories.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +type ItemActionsVariablesItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRepository_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.actions.variables.item.repositories.item collection +// returns a *ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemActionsVariablesItemRepositoriesRequestBuilder) ByRepository_id(repository_id int32)(*ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["repository_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(repository_id), 10) + return NewItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsVariablesItemRepositoriesRequestBuilderInternal instantiates a new ItemActionsVariablesItemRepositoriesRequestBuilder and sets the default values. +func NewItemActionsVariablesItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsVariablesItemRepositoriesRequestBuilder) { + m := &ItemActionsVariablesItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/variables/{name}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsVariablesItemRepositoriesRequestBuilder instantiates a new ItemActionsVariablesItemRepositoriesRequestBuilder and sets the default values. +func NewItemActionsVariablesItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsVariablesItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsVariablesItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all repositories that can access an organization variablethat is available to selected repositories.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsVariablesItemRepositoriesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable +func (m *ItemActionsVariablesItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsVariablesItemRepositoriesRequestBuilderGetQueryParameters])(ItemActionsVariablesItemRepositoriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsVariablesItemRepositoriesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsVariablesItemRepositoriesGetResponseable), nil +} +// Put replaces all repositories for an organization variable that is availableto selected repositories. Organization variables that are available to selectedrepositories have their `visibility` field set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable +func (m *ItemActionsVariablesItemRepositoriesRequestBuilder) Put(ctx context.Context, body ItemActionsVariablesItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation lists all repositories that can access an organization variablethat is available to selected repositories.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsVariablesItemRepositoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation replaces all repositories for an organization variable that is availableto selected repositories. Organization variables that are available to selectedrepositories have their `visibility` field set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesItemRepositoriesRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsVariablesItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsVariablesItemRepositoriesRequestBuilder when successful +func (m *ItemActionsVariablesItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemActionsVariablesItemRepositoriesRequestBuilder) { + return NewItemActionsVariablesItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_repositories_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_repositories_response.go new file mode 100644 index 000000000..10958901f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_repositories_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemActionsVariablesItemRepositoriesResponse +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type ItemActionsVariablesItemRepositoriesResponse struct { + ItemActionsVariablesItemRepositoriesGetResponse +} +// NewItemActionsVariablesItemRepositoriesResponse instantiates a new ItemActionsVariablesItemRepositoriesResponse and sets the default values. +func NewItemActionsVariablesItemRepositoriesResponse()(*ItemActionsVariablesItemRepositoriesResponse) { + m := &ItemActionsVariablesItemRepositoriesResponse{ + ItemActionsVariablesItemRepositoriesGetResponse: *NewItemActionsVariablesItemRepositoriesGetResponse(), + } + return m +} +// CreateItemActionsVariablesItemRepositoriesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemActionsVariablesItemRepositoriesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsVariablesItemRepositoriesResponse(), nil +} +// ItemActionsVariablesItemRepositoriesResponseable +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type ItemActionsVariablesItemRepositoriesResponseable interface { + ItemActionsVariablesItemRepositoriesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_repositories_with_repository_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_repositories_with_repository_item_request_builder.go new file mode 100644 index 000000000..1e92032c1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_repositories_with_repository_item_request_builder.go @@ -0,0 +1,73 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\variables\{name}\repositories\{repository_id} +type ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilderInternal instantiates a new ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder) { + m := &ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/variables/{name}/repositories/{repository_id}", pathParameters), + } + return m +} +// NewItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder instantiates a new ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a repository from an organization variable that isavailable to selected repositories. Organization variables that are available toselected repositories have their `visibility` field set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable +func (m *ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put adds a repository to an organization variable that is available to selected repositories.Organization variables that are available to selected repositories have their `visibility` field set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable +func (m *ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a repository from an organization variable that isavailable to selected repositories. Organization variables that are available toselected repositories have their `visibility` field set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToPutRequestInformation adds a repository to an organization variable that is available to selected repositories.Organization variables that are available to selected repositories have their `visibility` field set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder) { + return NewItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_with_name_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_with_name_patch_request_body.go new file mode 100644 index 000000000..02ae1c52b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_item_with_name_patch_request_body.go @@ -0,0 +1,144 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsVariablesItemWithNamePatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name of the variable. + name *string + // An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. + selected_repository_ids []int32 + // The value of the variable. + value *string +} +// NewItemActionsVariablesItemWithNamePatchRequestBody instantiates a new ItemActionsVariablesItemWithNamePatchRequestBody and sets the default values. +func NewItemActionsVariablesItemWithNamePatchRequestBody()(*ItemActionsVariablesItemWithNamePatchRequestBody) { + m := &ItemActionsVariablesItemWithNamePatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsVariablesItemWithNamePatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsVariablesItemWithNamePatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsVariablesItemWithNamePatchRequestBody(), 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 *ItemActionsVariablesItemWithNamePatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsVariablesItemWithNamePatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["selected_repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetSelectedRepositoryIds(res) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ItemActionsVariablesItemWithNamePatchRequestBody) GetName()(*string) { + return m.name +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. +// returns a []int32 when successful +func (m *ItemActionsVariablesItemWithNamePatchRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ItemActionsVariablesItemWithNamePatchRequestBody) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ItemActionsVariablesItemWithNamePatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemActionsVariablesItemWithNamePatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name of the variable. +func (m *ItemActionsVariablesItemWithNamePatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. +func (m *ItemActionsVariablesItemWithNamePatchRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ItemActionsVariablesItemWithNamePatchRequestBody) SetValue(value *string)() { + m.value = value +} +type ItemActionsVariablesItemWithNamePatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetSelectedRepositoryIds()([]int32) + GetValue()(*string) + SetName(value *string)() + SetSelectedRepositoryIds(value []int32)() + SetValue(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_post_request_body.go new file mode 100644 index 000000000..50106417f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_post_request_body.go @@ -0,0 +1,144 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsVariablesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name of the variable. + name *string + // An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. + selected_repository_ids []int32 + // The value of the variable. + value *string +} +// NewItemActionsVariablesPostRequestBody instantiates a new ItemActionsVariablesPostRequestBody and sets the default values. +func NewItemActionsVariablesPostRequestBody()(*ItemActionsVariablesPostRequestBody) { + m := &ItemActionsVariablesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsVariablesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsVariablesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsVariablesPostRequestBody(), 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 *ItemActionsVariablesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsVariablesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["selected_repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetSelectedRepositoryIds(res) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ItemActionsVariablesPostRequestBody) GetName()(*string) { + return m.name +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. +// returns a []int32 when successful +func (m *ItemActionsVariablesPostRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ItemActionsVariablesPostRequestBody) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ItemActionsVariablesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemActionsVariablesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name of the variable. +func (m *ItemActionsVariablesPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. +func (m *ItemActionsVariablesPostRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ItemActionsVariablesPostRequestBody) SetValue(value *string)() { + m.value = value +} +type ItemActionsVariablesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetSelectedRepositoryIds()([]int32) + GetValue()(*string) + SetName(value *string)() + SetSelectedRepositoryIds(value []int32)() + SetValue(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_request_builder.go new file mode 100644 index 000000000..1c0803bb6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_request_builder.go @@ -0,0 +1,107 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemActionsVariablesRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\variables +type ItemActionsVariablesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsVariablesRequestBuilderGetQueryParameters lists all organization variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +type ItemActionsVariablesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 30). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByName gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.actions.variables.item collection +// returns a *ItemActionsVariablesWithNameItemRequestBuilder when successful +func (m *ItemActionsVariablesRequestBuilder) ByName(name string)(*ItemActionsVariablesWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewItemActionsVariablesWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsVariablesRequestBuilderInternal instantiates a new ItemActionsVariablesRequestBuilder and sets the default values. +func NewItemActionsVariablesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsVariablesRequestBuilder) { + m := &ItemActionsVariablesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/variables{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsVariablesRequestBuilder instantiates a new ItemActionsVariablesRequestBuilder and sets the default values. +func NewItemActionsVariablesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsVariablesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsVariablesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all organization variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsVariablesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#list-organization-variables +func (m *ItemActionsVariablesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsVariablesRequestBuilderGetQueryParameters])(ItemActionsVariablesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsVariablesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsVariablesGetResponseable), nil +} +// Post creates an organization variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to 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 EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#create-an-organization-variable +func (m *ItemActionsVariablesRequestBuilder) Post(ctx context.Context, body ItemActionsVariablesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToGetRequestInformation lists all organization variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsVariablesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates an organization variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemActionsVariablesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsVariablesRequestBuilder when successful +func (m *ItemActionsVariablesRequestBuilder) WithUrl(rawUrl string)(*ItemActionsVariablesRequestBuilder) { + return NewItemActionsVariablesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_response.go new file mode 100644 index 000000000..b8620dbd0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemActionsVariablesResponse +// Deprecated: This class is obsolete. Use variablesGetResponse instead. +type ItemActionsVariablesResponse struct { + ItemActionsVariablesGetResponse +} +// NewItemActionsVariablesResponse instantiates a new ItemActionsVariablesResponse and sets the default values. +func NewItemActionsVariablesResponse()(*ItemActionsVariablesResponse) { + m := &ItemActionsVariablesResponse{ + ItemActionsVariablesGetResponse: *NewItemActionsVariablesGetResponse(), + } + return m +} +// CreateItemActionsVariablesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemActionsVariablesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsVariablesResponse(), nil +} +// ItemActionsVariablesResponseable +// Deprecated: This class is obsolete. Use variablesGetResponse instead. +type ItemActionsVariablesResponseable interface { + ItemActionsVariablesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_with_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_with_name_item_request_builder.go new file mode 100644 index 000000000..a53d803d5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_actions_variables_with_name_item_request_builder.go @@ -0,0 +1,110 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemActionsVariablesWithNameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\variables\{name} +type ItemActionsVariablesWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsVariablesWithNameItemRequestBuilderInternal instantiates a new ItemActionsVariablesWithNameItemRequestBuilder and sets the default values. +func NewItemActionsVariablesWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsVariablesWithNameItemRequestBuilder) { + m := &ItemActionsVariablesWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/variables/{name}", pathParameters), + } + return m +} +// NewItemActionsVariablesWithNameItemRequestBuilder instantiates a new ItemActionsVariablesWithNameItemRequestBuilder and sets the default values. +func NewItemActionsVariablesWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsVariablesWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsVariablesWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes an organization variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#delete-an-organization-variable +func (m *ItemActionsVariablesWithNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a specific variable in an organization.The authenticated user must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to 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 OrganizationActionsVariableable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#get-an-organization-variable +func (m *ItemActionsVariablesWithNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsVariableable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationActionsVariableFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationActionsVariableable), nil +} +// Patch updates an organization variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#update-an-organization-variable +func (m *ItemActionsVariablesWithNameItemRequestBuilder) Patch(ctx context.Context, body ItemActionsVariablesItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Repositories the repositories property +// returns a *ItemActionsVariablesItemRepositoriesRequestBuilder when successful +func (m *ItemActionsVariablesWithNameItemRequestBuilder) Repositories()(*ItemActionsVariablesItemRepositoriesRequestBuilder) { + return NewItemActionsVariablesItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes an organization variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesWithNameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a specific variable in an organization.The authenticated user must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesWithNameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates an organization variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesWithNameItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemActionsVariablesItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsVariablesWithNameItemRequestBuilder when successful +func (m *ItemActionsVariablesWithNameItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsVariablesWithNameItemRequestBuilder) { + return NewItemActionsVariablesWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_item_with_subject_digest_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_item_with_subject_digest_get_response.go new file mode 100644 index 000000000..1f5322d19 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_item_with_subject_digest_get_response.go @@ -0,0 +1,92 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemAttestationsItemWithSubject_digestGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The attestations property + attestations []ItemAttestationsItemWithSubject_digestGetResponse_attestationsable +} +// NewItemAttestationsItemWithSubject_digestGetResponse instantiates a new ItemAttestationsItemWithSubject_digestGetResponse and sets the default values. +func NewItemAttestationsItemWithSubject_digestGetResponse()(*ItemAttestationsItemWithSubject_digestGetResponse) { + m := &ItemAttestationsItemWithSubject_digestGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemAttestationsItemWithSubject_digestGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemAttestationsItemWithSubject_digestGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemAttestationsItemWithSubject_digestGetResponse(), 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 *ItemAttestationsItemWithSubject_digestGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAttestations gets the attestations property value. The attestations property +// returns a []ItemAttestationsItemWithSubject_digestGetResponse_attestationsable when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse) GetAttestations()([]ItemAttestationsItemWithSubject_digestGetResponse_attestationsable) { + return m.attestations +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["attestations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemAttestationsItemWithSubject_digestGetResponse_attestationsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemAttestationsItemWithSubject_digestGetResponse_attestationsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemAttestationsItemWithSubject_digestGetResponse_attestationsable) + } + } + m.SetAttestations(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemAttestationsItemWithSubject_digestGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAttestations() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAttestations())) + for i, v := range m.GetAttestations() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("attestations", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemAttestationsItemWithSubject_digestGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAttestations sets the attestations property value. The attestations property +func (m *ItemAttestationsItemWithSubject_digestGetResponse) SetAttestations(value []ItemAttestationsItemWithSubject_digestGetResponse_attestationsable)() { + m.attestations = value +} +type ItemAttestationsItemWithSubject_digestGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAttestations()([]ItemAttestationsItemWithSubject_digestGetResponse_attestationsable) + SetAttestations(value []ItemAttestationsItemWithSubject_digestGetResponse_attestationsable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_item_with_subject_digest_get_response_attestations.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_item_with_subject_digest_get_response_attestations.go new file mode 100644 index 000000000..ab001233b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_item_with_subject_digest_get_response_attestations.go @@ -0,0 +1,109 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemAttestationsItemWithSubject_digestGetResponse_attestations struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The attestation's Sigstore Bundle.Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. + bundle ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable + // The repository_id property + repository_id *int32 +} +// NewItemAttestationsItemWithSubject_digestGetResponse_attestations instantiates a new ItemAttestationsItemWithSubject_digestGetResponse_attestations and sets the default values. +func NewItemAttestationsItemWithSubject_digestGetResponse_attestations()(*ItemAttestationsItemWithSubject_digestGetResponse_attestations) { + m := &ItemAttestationsItemWithSubject_digestGetResponse_attestations{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemAttestationsItemWithSubject_digestGetResponse_attestationsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemAttestationsItemWithSubject_digestGetResponse_attestationsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemAttestationsItemWithSubject_digestGetResponse_attestations(), 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 *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBundle gets the bundle property value. The attestation's Sigstore Bundle.Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. +// returns a ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetBundle()(ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable) { + return m.bundle +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bundle"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBundle(val.(ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable)) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + return res +} +// GetRepositoryId gets the repository_id property value. The repository_id property +// returns a *int32 when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetRepositoryId()(*int32) { + return m.repository_id +} +// Serialize serializes information the current object +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("bundle", m.GetBundle()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + 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 *ItemAttestationsItemWithSubject_digestGetResponse_attestations) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBundle sets the bundle property value. The attestation's Sigstore Bundle.Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) SetBundle(value ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable)() { + m.bundle = value +} +// SetRepositoryId sets the repository_id property value. The repository_id property +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) SetRepositoryId(value *int32)() { + m.repository_id = value +} +type ItemAttestationsItemWithSubject_digestGetResponse_attestationsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBundle()(ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable) + GetRepositoryId()(*int32) + SetBundle(value ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable)() + SetRepositoryId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_item_with_subject_digest_get_response_attestations_bundle.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_item_with_subject_digest_get_response_attestations_bundle.go new file mode 100644 index 000000000..44f79a7a9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_item_with_subject_digest_get_response_attestations_bundle.go @@ -0,0 +1,139 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle the attestation's Sigstore Bundle.Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. +type ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The dsseEnvelope property + dsseEnvelope ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeable + // The mediaType property + mediaType *string + // The verificationMaterial property + verificationMaterial ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialable +} +// NewItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle instantiates a new ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle and sets the default values. +func NewItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle()(*ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) { + m := &ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle(), 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 *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDsseEnvelope gets the dsseEnvelope property value. The dsseEnvelope property +// returns a ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeable when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) GetDsseEnvelope()(ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeable) { + return m.dsseEnvelope +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["dsseEnvelope"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDsseEnvelope(val.(ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeable)) + } + return nil + } + res["mediaType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMediaType(val) + } + return nil + } + res["verificationMaterial"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerificationMaterial(val.(ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialable)) + } + return nil + } + return res +} +// GetMediaType gets the mediaType property value. The mediaType property +// returns a *string when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) GetMediaType()(*string) { + return m.mediaType +} +// GetVerificationMaterial gets the verificationMaterial property value. The verificationMaterial property +// returns a ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialable when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) GetVerificationMaterial()(ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialable) { + return m.verificationMaterial +} +// Serialize serializes information the current object +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("dsseEnvelope", m.GetDsseEnvelope()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mediaType", m.GetMediaType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("verificationMaterial", m.GetVerificationMaterial()) + 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 *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDsseEnvelope sets the dsseEnvelope property value. The dsseEnvelope property +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) SetDsseEnvelope(value ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeable)() { + m.dsseEnvelope = value +} +// SetMediaType sets the mediaType property value. The mediaType property +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) SetMediaType(value *string)() { + m.mediaType = value +} +// SetVerificationMaterial sets the verificationMaterial property value. The verificationMaterial property +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) SetVerificationMaterial(value ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialable)() { + m.verificationMaterial = value +} +type ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDsseEnvelope()(ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeable) + GetMediaType()(*string) + GetVerificationMaterial()(ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialable) + SetDsseEnvelope(value ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeable)() + SetMediaType(value *string)() + SetVerificationMaterial(value ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_item_with_subject_digest_get_response_attestations_bundle_dsse_envelope.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_item_with_subject_digest_get_response_attestations_bundle_dsse_envelope.go new file mode 100644 index 000000000..c2d6e0831 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_item_with_subject_digest_get_response_attestations_bundle_dsse_envelope.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope instantiates a new ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope and sets the default values. +func NewItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope()(*ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope) { + m := &ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope(), 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 *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_item_with_subject_digest_get_response_attestations_bundle_verification_material.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_item_with_subject_digest_get_response_attestations_bundle_verification_material.go new file mode 100644 index 000000000..ca19f71a2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_item_with_subject_digest_get_response_attestations_bundle_verification_material.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial instantiates a new ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial and sets the default values. +func NewItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial()(*ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial) { + m := &ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial(), 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 *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_request_builder.go new file mode 100644 index 000000000..c736e5f03 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemAttestationsRequestBuilder builds and executes requests for operations under \orgs\{org}\attestations +type ItemAttestationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// BySubject_digest gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.attestations.item collection +// returns a *ItemAttestationsWithSubject_digestItemRequestBuilder when successful +func (m *ItemAttestationsRequestBuilder) BySubject_digest(subject_digest string)(*ItemAttestationsWithSubject_digestItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if subject_digest != "" { + urlTplParams["subject_digest"] = subject_digest + } + return NewItemAttestationsWithSubject_digestItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemAttestationsRequestBuilderInternal instantiates a new ItemAttestationsRequestBuilder and sets the default values. +func NewItemAttestationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAttestationsRequestBuilder) { + m := &ItemAttestationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/attestations", pathParameters), + } + return m +} +// NewItemAttestationsRequestBuilder instantiates a new ItemAttestationsRequestBuilder and sets the default values. +func NewItemAttestationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAttestationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemAttestationsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_with_subject_digest_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_with_subject_digest_item_request_builder.go new file mode 100644 index 000000000..cdfa8f169 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_attestations_with_subject_digest_item_request_builder.go @@ -0,0 +1,65 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemAttestationsWithSubject_digestItemRequestBuilder builds and executes requests for operations under \orgs\{org}\attestations\{subject_digest} +type ItemAttestationsWithSubject_digestItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemAttestationsWithSubject_digestItemRequestBuilderGetQueryParameters list a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization.The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required.**Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). +type ItemAttestationsWithSubject_digestItemRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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)." + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + Before *string `uriparametername:"before"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemAttestationsWithSubject_digestItemRequestBuilderInternal instantiates a new ItemAttestationsWithSubject_digestItemRequestBuilder and sets the default values. +func NewItemAttestationsWithSubject_digestItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAttestationsWithSubject_digestItemRequestBuilder) { + m := &ItemAttestationsWithSubject_digestItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/attestations/{subject_digest}{?after*,before*,per_page*}", pathParameters), + } + return m +} +// NewItemAttestationsWithSubject_digestItemRequestBuilder instantiates a new ItemAttestationsWithSubject_digestItemRequestBuilder and sets the default values. +func NewItemAttestationsWithSubject_digestItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAttestationsWithSubject_digestItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemAttestationsWithSubject_digestItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization.The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required.**Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). +// returns a ItemAttestationsItemWithSubject_digestGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/orgs#list-attestations +func (m *ItemAttestationsWithSubject_digestItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemAttestationsWithSubject_digestItemRequestBuilderGetQueryParameters])(ItemAttestationsItemWithSubject_digestGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemAttestationsItemWithSubject_digestGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemAttestationsItemWithSubject_digestGetResponseable), nil +} +// ToGetRequestInformation list a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization.The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required.**Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). +// returns a *RequestInformation when successful +func (m *ItemAttestationsWithSubject_digestItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemAttestationsWithSubject_digestItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemAttestationsWithSubject_digestItemRequestBuilder when successful +func (m *ItemAttestationsWithSubject_digestItemRequestBuilder) WithUrl(rawUrl string)(*ItemAttestationsWithSubject_digestItemRequestBuilder) { + return NewItemAttestationsWithSubject_digestItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_blocks_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_blocks_request_builder.go new file mode 100644 index 000000000..9e308214c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_blocks_request_builder.go @@ -0,0 +1,79 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemBlocksRequestBuilder builds and executes requests for operations under \orgs\{org}\blocks +type ItemBlocksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemBlocksRequestBuilderGetQueryParameters list the users blocked by an organization. +type ItemBlocksRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.blocks.item collection +// returns a *ItemBlocksWithUsernameItemRequestBuilder when successful +func (m *ItemBlocksRequestBuilder) ByUsername(username string)(*ItemBlocksWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemBlocksWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemBlocksRequestBuilderInternal instantiates a new ItemBlocksRequestBuilder and sets the default values. +func NewItemBlocksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemBlocksRequestBuilder) { + m := &ItemBlocksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/blocks{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemBlocksRequestBuilder instantiates a new ItemBlocksRequestBuilder and sets the default values. +func NewItemBlocksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemBlocksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemBlocksRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the users blocked by an organization. +// returns a []SimpleUserable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization +func (m *ItemBlocksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemBlocksRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation list the users blocked by an organization. +// returns a *RequestInformation when successful +func (m *ItemBlocksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemBlocksRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemBlocksRequestBuilder when successful +func (m *ItemBlocksRequestBuilder) WithUrl(rawUrl string)(*ItemBlocksRequestBuilder) { + return NewItemBlocksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_blocks_with_username_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_blocks_with_username_item_request_builder.go new file mode 100644 index 000000000..6f0e19e6b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_blocks_with_username_item_request_builder.go @@ -0,0 +1,106 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemBlocksWithUsernameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\blocks\{username} +type ItemBlocksWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemBlocksWithUsernameItemRequestBuilderInternal instantiates a new ItemBlocksWithUsernameItemRequestBuilder and sets the default values. +func NewItemBlocksWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemBlocksWithUsernameItemRequestBuilder) { + m := &ItemBlocksWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/blocks/{username}", pathParameters), + } + return m +} +// NewItemBlocksWithUsernameItemRequestBuilder instantiates a new ItemBlocksWithUsernameItemRequestBuilder and sets the default values. +func NewItemBlocksWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemBlocksWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemBlocksWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete unblocks the given user on behalf of the specified organization. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization +func (m *ItemBlocksWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization +func (m *ItemBlocksWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned. +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization +func (m *ItemBlocksWithUsernameItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation unblocks the given user on behalf of the specified organization. +// returns a *RequestInformation when successful +func (m *ItemBlocksWithUsernameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub. +// returns a *RequestInformation when successful +func (m *ItemBlocksWithUsernameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned. +// returns a *RequestInformation when successful +func (m *ItemBlocksWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemBlocksWithUsernameItemRequestBuilder when successful +func (m *ItemBlocksWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemBlocksWithUsernameItemRequestBuilder) { + return NewItemBlocksWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_scanning_alerts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_scanning_alerts_request_builder.go new file mode 100644 index 000000000..34b7fa452 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_scanning_alerts_request_builder.go @@ -0,0 +1,90 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + iaeebf96a6843d7c20789a0ee17c57399b2ea1eb95bf0e1081de99038d40c50a8 "github.com/octokit/go-sdk/pkg/github/orgs/item/codescanning/alerts" +) + +// ItemCodeScanningAlertsRequestBuilder builds and executes requests for operations under \orgs\{org}\code-scanning\alerts +type ItemCodeScanningAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCodeScanningAlertsRequestBuilderGetQueryParameters lists code scanning alerts for the default branch for all eligible repositories in an organization. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an owner or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `security_events` or `repo`s cope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +type ItemCodeScanningAlertsRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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)." + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *iaeebf96a6843d7c20789a0ee17c57399b2ea1eb95bf0e1081de99038d40c50a8.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // If specified, only code scanning alerts with this severity will be returned. + Severity *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertSeverity `uriparametername:"severity"` + // The property by which to sort the results. + Sort *iaeebf96a6843d7c20789a0ee17c57399b2ea1eb95bf0e1081de99038d40c50a8.GetSortQueryParameterType `uriparametername:"sort"` + // If specified, only code scanning alerts with this state will be returned. + State *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertStateQuery `uriparametername:"state"` + // The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both. + Tool_guid *string `uriparametername:"tool_guid"` + // The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both. + Tool_name *string `uriparametername:"tool_name"` +} +// NewItemCodeScanningAlertsRequestBuilderInternal instantiates a new ItemCodeScanningAlertsRequestBuilder and sets the default values. +func NewItemCodeScanningAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeScanningAlertsRequestBuilder) { + m := &ItemCodeScanningAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/code-scanning/alerts{?after*,before*,direction*,page*,per_page*,severity*,sort*,state*,tool_guid*,tool_name*}", pathParameters), + } + return m +} +// NewItemCodeScanningAlertsRequestBuilder instantiates a new ItemCodeScanningAlertsRequestBuilder and sets the default values. +func NewItemCodeScanningAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeScanningAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeScanningAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists code scanning alerts for the default branch for all eligible repositories in an organization. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an owner or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `security_events` or `repo`s cope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a []CodeScanningOrganizationAlertItemsable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a Alerts503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization +func (m *ItemCodeScanningAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodeScanningAlertsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningOrganizationAlertItemsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAlerts503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningOrganizationAlertItemsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningOrganizationAlertItemsable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningOrganizationAlertItemsable) + } + } + return val, nil +} +// ToGetRequestInformation lists code scanning alerts for the default branch for all eligible repositories in an organization. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an owner or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `security_events` or `repo`s cope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemCodeScanningAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodeScanningAlertsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodeScanningAlertsRequestBuilder when successful +func (m *ItemCodeScanningAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemCodeScanningAlertsRequestBuilder) { + return NewItemCodeScanningAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_scanning_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_scanning_request_builder.go new file mode 100644 index 000000000..be8d74257 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_scanning_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemCodeScanningRequestBuilder builds and executes requests for operations under \orgs\{org}\code-scanning +type ItemCodeScanningRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Alerts the alerts property +// returns a *ItemCodeScanningAlertsRequestBuilder when successful +func (m *ItemCodeScanningRequestBuilder) Alerts()(*ItemCodeScanningAlertsRequestBuilder) { + return NewItemCodeScanningAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCodeScanningRequestBuilderInternal instantiates a new ItemCodeScanningRequestBuilder and sets the default values. +func NewItemCodeScanningRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeScanningRequestBuilder) { + m := &ItemCodeScanningRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/code-scanning", pathParameters), + } + return m +} +// NewItemCodeScanningRequestBuilder instantiates a new ItemCodeScanningRequestBuilder and sets the default values. +func NewItemCodeScanningRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeScanningRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeScanningRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_defaults_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_defaults_request_builder.go new file mode 100644 index 000000000..9d409b2de --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_defaults_request_builder.go @@ -0,0 +1,66 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCodeSecurityConfigurationsDefaultsRequestBuilder builds and executes requests for operations under \orgs\{org}\code-security\configurations\defaults +type ItemCodeSecurityConfigurationsDefaultsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCodeSecurityConfigurationsDefaultsRequestBuilderInternal instantiates a new ItemCodeSecurityConfigurationsDefaultsRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsDefaultsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsDefaultsRequestBuilder) { + m := &ItemCodeSecurityConfigurationsDefaultsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/code-security/configurations/defaults", pathParameters), + } + return m +} +// NewItemCodeSecurityConfigurationsDefaultsRequestBuilder instantiates a new ItemCodeSecurityConfigurationsDefaultsRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsDefaultsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsDefaultsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeSecurityConfigurationsDefaultsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the default code security configurations for an organization.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a []CodeSecurityDefaultConfigurationsable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations +func (m *ItemCodeSecurityConfigurationsDefaultsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityDefaultConfigurationsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeSecurityDefaultConfigurationsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityDefaultConfigurationsable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityDefaultConfigurationsable) + } + } + return val, nil +} +// ToGetRequestInformation lists the default code security configurations for an organization.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsDefaultsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodeSecurityConfigurationsDefaultsRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsDefaultsRequestBuilder) WithUrl(rawUrl string)(*ItemCodeSecurityConfigurationsDefaultsRequestBuilder) { + return NewItemCodeSecurityConfigurationsDefaultsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_attach_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_attach_post_request_body.go new file mode 100644 index 000000000..717e320e4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_attach_post_request_body.go @@ -0,0 +1,67 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCodeSecurityConfigurationsItemAttachPostRequestBody struct { + // An array of repository IDs to attach the configuration to. You can only provide a list of repository ids when the `scope` is set to `selected`. + selected_repository_ids []int32 +} +// NewItemCodeSecurityConfigurationsItemAttachPostRequestBody instantiates a new ItemCodeSecurityConfigurationsItemAttachPostRequestBody and sets the default values. +func NewItemCodeSecurityConfigurationsItemAttachPostRequestBody()(*ItemCodeSecurityConfigurationsItemAttachPostRequestBody) { + m := &ItemCodeSecurityConfigurationsItemAttachPostRequestBody{ + } + return m +} +// CreateItemCodeSecurityConfigurationsItemAttachPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodeSecurityConfigurationsItemAttachPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodeSecurityConfigurationsItemAttachPostRequestBody(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodeSecurityConfigurationsItemAttachPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["selected_repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetSelectedRepositoryIds(res) + } + return nil + } + return res +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository IDs to attach the configuration to. You can only provide a list of repository ids when the `scope` is set to `selected`. +// returns a []int32 when successful +func (m *ItemCodeSecurityConfigurationsItemAttachPostRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *ItemCodeSecurityConfigurationsItemAttachPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + if err != nil { + return err + } + } + return nil +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository IDs to attach the configuration to. You can only provide a list of repository ids when the `scope` is set to `selected`. +func (m *ItemCodeSecurityConfigurationsItemAttachPostRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +type ItemCodeSecurityConfigurationsItemAttachPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedRepositoryIds()([]int32) + SetSelectedRepositoryIds(value []int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_attach_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_attach_post_response.go new file mode 100644 index 000000000..1305df28a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_attach_post_response.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCodeSecurityConfigurationsItemAttachPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemCodeSecurityConfigurationsItemAttachPostResponse instantiates a new ItemCodeSecurityConfigurationsItemAttachPostResponse and sets the default values. +func NewItemCodeSecurityConfigurationsItemAttachPostResponse()(*ItemCodeSecurityConfigurationsItemAttachPostResponse) { + m := &ItemCodeSecurityConfigurationsItemAttachPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCodeSecurityConfigurationsItemAttachPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodeSecurityConfigurationsItemAttachPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodeSecurityConfigurationsItemAttachPostResponse(), 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 *ItemCodeSecurityConfigurationsItemAttachPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodeSecurityConfigurationsItemAttachPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemCodeSecurityConfigurationsItemAttachPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemCodeSecurityConfigurationsItemAttachPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemCodeSecurityConfigurationsItemAttachPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_attach_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_attach_request_builder.go new file mode 100644 index 000000000..3ce9b00de --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_attach_request_builder.go @@ -0,0 +1,60 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemCodeSecurityConfigurationsItemAttachRequestBuilder builds and executes requests for operations under \orgs\{org}\code-security\configurations\{configuration_id}\attach +type ItemCodeSecurityConfigurationsItemAttachRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCodeSecurityConfigurationsItemAttachRequestBuilderInternal instantiates a new ItemCodeSecurityConfigurationsItemAttachRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsItemAttachRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsItemAttachRequestBuilder) { + m := &ItemCodeSecurityConfigurationsItemAttachRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/code-security/configurations/{configuration_id}/attach", pathParameters), + } + return m +} +// NewItemCodeSecurityConfigurationsItemAttachRequestBuilder instantiates a new ItemCodeSecurityConfigurationsItemAttachRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsItemAttachRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsItemAttachRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeSecurityConfigurationsItemAttachRequestBuilderInternal(urlParams, requestAdapter) +} +// Post attach a code security configuration to a set of repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration.If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a ItemCodeSecurityConfigurationsItemAttachPostResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#attach-a-configuration-to-repositories +func (m *ItemCodeSecurityConfigurationsItemAttachRequestBuilder) Post(ctx context.Context, body ItemCodeSecurityConfigurationsItemAttachPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemCodeSecurityConfigurationsItemAttachPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemCodeSecurityConfigurationsItemAttachPostResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemCodeSecurityConfigurationsItemAttachPostResponseable), nil +} +// ToPostRequestInformation attach a code security configuration to a set of repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration.If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsItemAttachRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemCodeSecurityConfigurationsItemAttachPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodeSecurityConfigurationsItemAttachRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsItemAttachRequestBuilder) WithUrl(rawUrl string)(*ItemCodeSecurityConfigurationsItemAttachRequestBuilder) { + return NewItemCodeSecurityConfigurationsItemAttachRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_defaults_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_defaults_put_request_body.go new file mode 100644 index 000000000..c08f646db --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_defaults_put_request_body.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCodeSecurityConfigurationsItemDefaultsPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemCodeSecurityConfigurationsItemDefaultsPutRequestBody instantiates a new ItemCodeSecurityConfigurationsItemDefaultsPutRequestBody and sets the default values. +func NewItemCodeSecurityConfigurationsItemDefaultsPutRequestBody()(*ItemCodeSecurityConfigurationsItemDefaultsPutRequestBody) { + m := &ItemCodeSecurityConfigurationsItemDefaultsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCodeSecurityConfigurationsItemDefaultsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodeSecurityConfigurationsItemDefaultsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodeSecurityConfigurationsItemDefaultsPutRequestBody(), 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 *ItemCodeSecurityConfigurationsItemDefaultsPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodeSecurityConfigurationsItemDefaultsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemCodeSecurityConfigurationsItemDefaultsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemCodeSecurityConfigurationsItemDefaultsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemCodeSecurityConfigurationsItemDefaultsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_defaults_put_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_defaults_put_response.go new file mode 100644 index 000000000..aa385eddc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_defaults_put_response.go @@ -0,0 +1,81 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemCodeSecurityConfigurationsItemDefaultsPutResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A code security configuration + configuration i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable +} +// NewItemCodeSecurityConfigurationsItemDefaultsPutResponse instantiates a new ItemCodeSecurityConfigurationsItemDefaultsPutResponse and sets the default values. +func NewItemCodeSecurityConfigurationsItemDefaultsPutResponse()(*ItemCodeSecurityConfigurationsItemDefaultsPutResponse) { + m := &ItemCodeSecurityConfigurationsItemDefaultsPutResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCodeSecurityConfigurationsItemDefaultsPutResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodeSecurityConfigurationsItemDefaultsPutResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodeSecurityConfigurationsItemDefaultsPutResponse(), 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 *ItemCodeSecurityConfigurationsItemDefaultsPutResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfiguration gets the configuration property value. A code security configuration +// returns a CodeSecurityConfigurationable when successful +func (m *ItemCodeSecurityConfigurationsItemDefaultsPutResponse) GetConfiguration()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable) { + return m.configuration +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodeSecurityConfigurationsItemDefaultsPutResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["configuration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeSecurityConfigurationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfiguration(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemCodeSecurityConfigurationsItemDefaultsPutResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("configuration", m.GetConfiguration()) + 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 *ItemCodeSecurityConfigurationsItemDefaultsPutResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfiguration sets the configuration property value. A code security configuration +func (m *ItemCodeSecurityConfigurationsItemDefaultsPutResponse) SetConfiguration(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable)() { + m.configuration = value +} +type ItemCodeSecurityConfigurationsItemDefaultsPutResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetConfiguration()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable) + SetConfiguration(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_defaults_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_defaults_request_builder.go new file mode 100644 index 000000000..54a5bd2fe --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_defaults_request_builder.go @@ -0,0 +1,67 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder builds and executes requests for operations under \orgs\{org}\code-security\configurations\{configuration_id}\defaults +type ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCodeSecurityConfigurationsItemDefaultsRequestBuilderInternal instantiates a new ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsItemDefaultsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder) { + m := &ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/code-security/configurations/{configuration_id}/defaults", pathParameters), + } + return m +} +// NewItemCodeSecurityConfigurationsItemDefaultsRequestBuilder instantiates a new ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsItemDefaultsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeSecurityConfigurationsItemDefaultsRequestBuilderInternal(urlParams, requestAdapter) +} +// Put sets a code security configuration as a default to be applied to new repositories in your organization.This configuration will be applied to the matching repository type (all, none, public, private and internal) by default when they are created.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a ItemCodeSecurityConfigurationsItemDefaultsPutResponseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization +func (m *ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder) Put(ctx context.Context, body ItemCodeSecurityConfigurationsItemDefaultsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemCodeSecurityConfigurationsItemDefaultsPutResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemCodeSecurityConfigurationsItemDefaultsPutResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemCodeSecurityConfigurationsItemDefaultsPutResponseable), nil +} +// ToPutRequestInformation sets a code security configuration as a default to be applied to new repositories in your organization.This configuration will be applied to the matching repository type (all, none, public, private and internal) by default when they are created.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemCodeSecurityConfigurationsItemDefaultsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder) WithUrl(rawUrl string)(*ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder) { + return NewItemCodeSecurityConfigurationsItemDefaultsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_repositories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_repositories_request_builder.go new file mode 100644 index 000000000..e34a6bf98 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_repositories_request_builder.go @@ -0,0 +1,77 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\code-security\configurations\{configuration_id}\repositories +type ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderGetQueryParameters lists the repositories associated with a code security configuration in an organization.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +type ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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)." + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + Before *string `uriparametername:"before"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // A comma-separated list of statuses. If specified, only repositories with these attachment statuses will be returned.Can be: `all`, `attached`, `attaching`, `detached`, `enforced`, `failed`, `updating` + Status *string `uriparametername:"status"` +} +// NewItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderInternal instantiates a new ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder) { + m := &ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/code-security/configurations/{configuration_id}/repositories{?after*,before*,per_page*,status*}", pathParameters), + } + return m +} +// NewItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder instantiates a new ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the repositories associated with a code security configuration in an organization.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a []CodeSecurityConfigurationRepositoriesable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-a-code-security-configuration +func (m *ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationRepositoriesable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeSecurityConfigurationRepositoriesFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationRepositoriesable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationRepositoriesable) + } + } + return val, nil +} +// ToGetRequestInformation lists the repositories associated with a code security configuration in an organization.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder) { + return NewItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_with_configuration_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_with_configuration_patch_request_body.go new file mode 100644 index 000000000..e3740858a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_item_with_configuration_patch_request_body.go @@ -0,0 +1,90 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody struct { + // A description of the code security configuration + description *string + // The name of the code security configuration. Must be unique within the organization. + name *string +} +// NewItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody instantiates a new ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody and sets the default values. +func NewItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody()(*ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) { + m := &ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody{ + } + return m +} +// CreateItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody(), nil +} +// GetDescription gets the description property value. A description of the code security configuration +// returns a *string when successful +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the code security configuration. Must be unique within the organization. +// returns a *string when successful +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + return nil +} +// SetDescription sets the description property value. A description of the code security configuration +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetName sets the name property value. The name of the code security configuration. Must be unique within the organization. +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) SetName(value *string)() { + m.name = value +} +type ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetName()(*string) + SetDescription(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_post_request_body.go new file mode 100644 index 000000000..b23563784 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_post_request_body.go @@ -0,0 +1,90 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCodeSecurityConfigurationsPostRequestBody struct { + // A description of the code security configuration + description *string + // The name of the code security configuration. Must be unique within the organization. + name *string +} +// NewItemCodeSecurityConfigurationsPostRequestBody instantiates a new ItemCodeSecurityConfigurationsPostRequestBody and sets the default values. +func NewItemCodeSecurityConfigurationsPostRequestBody()(*ItemCodeSecurityConfigurationsPostRequestBody) { + m := &ItemCodeSecurityConfigurationsPostRequestBody{ + } + return m +} +// CreateItemCodeSecurityConfigurationsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodeSecurityConfigurationsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodeSecurityConfigurationsPostRequestBody(), nil +} +// GetDescription gets the description property value. A description of the code security configuration +// returns a *string when successful +func (m *ItemCodeSecurityConfigurationsPostRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodeSecurityConfigurationsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the code security configuration. Must be unique within the organization. +// returns a *string when successful +func (m *ItemCodeSecurityConfigurationsPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemCodeSecurityConfigurationsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + return nil +} +// SetDescription sets the description property value. A description of the code security configuration +func (m *ItemCodeSecurityConfigurationsPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetName sets the name property value. The name of the code security configuration. Must be unique within the organization. +func (m *ItemCodeSecurityConfigurationsPostRequestBody) SetName(value *string)() { + m.name = value +} +type ItemCodeSecurityConfigurationsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetName()(*string) + SetDescription(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_request_builder.go new file mode 100644 index 000000000..c29cbb000 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_request_builder.go @@ -0,0 +1,125 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i52d196ba31fe242a3b1c122ebea75dc29b66835834cf12c73d3ed455433c35e8 "github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations" +) + +// ItemCodeSecurityConfigurationsRequestBuilder builds and executes requests for operations under \orgs\{org}\code-security\configurations +type ItemCodeSecurityConfigurationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCodeSecurityConfigurationsRequestBuilderGetQueryParameters lists all code security configurations available in an organization.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +type ItemCodeSecurityConfigurationsRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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)." + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + Before *string `uriparametername:"before"` + // 'The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."' + Per_page *int32 `uriparametername:"per_page"` + // The target type of the code security configuration + Target_type *i52d196ba31fe242a3b1c122ebea75dc29b66835834cf12c73d3ed455433c35e8.GetTarget_typeQueryParameterType `uriparametername:"target_type"` +} +// ByConfiguration_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.codeSecurity.configurations.item collection +// returns a *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsRequestBuilder) ByConfiguration_id(configuration_id int32)(*ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["configuration_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(configuration_id), 10) + return NewItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCodeSecurityConfigurationsRequestBuilderInternal instantiates a new ItemCodeSecurityConfigurationsRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsRequestBuilder) { + m := &ItemCodeSecurityConfigurationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/code-security/configurations{?after*,before*,per_page*,target_type*}", pathParameters), + } + return m +} +// NewItemCodeSecurityConfigurationsRequestBuilder instantiates a new ItemCodeSecurityConfigurationsRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeSecurityConfigurationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Defaults the defaults property +// returns a *ItemCodeSecurityConfigurationsDefaultsRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsRequestBuilder) Defaults()(*ItemCodeSecurityConfigurationsDefaultsRequestBuilder) { + return NewItemCodeSecurityConfigurationsDefaultsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get lists all code security configurations available in an organization.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a []CodeSecurityConfigurationable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-organization +func (m *ItemCodeSecurityConfigurationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodeSecurityConfigurationsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeSecurityConfigurationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable) + } + } + return val, nil +} +// Post creates a code security configuration in an organization.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a CodeSecurityConfigurationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration +func (m *ItemCodeSecurityConfigurationsRequestBuilder) Post(ctx context.Context, body ItemCodeSecurityConfigurationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeSecurityConfigurationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable), nil +} +// ToGetRequestInformation lists all code security configurations available in an organization.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodeSecurityConfigurationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a code security configuration in an organization.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemCodeSecurityConfigurationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodeSecurityConfigurationsRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsRequestBuilder) WithUrl(rawUrl string)(*ItemCodeSecurityConfigurationsRequestBuilder) { + return NewItemCodeSecurityConfigurationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_with_configuration_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_with_configuration_item_request_builder.go new file mode 100644 index 000000000..cf5adb822 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_configurations_with_configuration_item_request_builder.go @@ -0,0 +1,142 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\code-security\configurations\{configuration_id} +type ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Attach the attach property +// returns a *ItemCodeSecurityConfigurationsItemAttachRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) Attach()(*ItemCodeSecurityConfigurationsItemAttachRequestBuilder) { + return NewItemCodeSecurityConfigurationsItemAttachRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilderInternal instantiates a new ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) { + m := &ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/code-security/configurations/{configuration_id}", pathParameters), + } + return m +} +// NewItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder instantiates a new ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Defaults the defaults property +// returns a *ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) Defaults()(*ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder) { + return NewItemCodeSecurityConfigurationsItemDefaultsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Delete deletes the desired code security configuration from an organization.Repositories attached to the configuration will retain their settings but will no longer be associated withthe configuration.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a code security configuration available in an organization.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a CodeSecurityConfigurationable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#get-a-code-security-configuration +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeSecurityConfigurationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable), nil +} +// Patch updates a code security configuration in an organization.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a CodeSecurityConfigurationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#update-a-code-security-configuration +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) Patch(ctx context.Context, body ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeSecurityConfigurationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable), nil +} +// Repositories the repositories property +// returns a *ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) Repositories()(*ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder) { + return NewItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes the desired code security configuration from an organization.Repositories attached to the configuration will retain their settings but will no longer be associated withthe configuration.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json, application/scim+json") + return requestInfo, nil +} +// ToGetRequestInformation gets a code security configuration available in an organization.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates a code security configuration in an organization.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) { + return NewItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_request_builder.go new file mode 100644 index 000000000..3cb8c9a49 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_code_security_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemCodeSecurityRequestBuilder builds and executes requests for operations under \orgs\{org}\code-security +type ItemCodeSecurityRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Configurations the configurations property +// returns a *ItemCodeSecurityConfigurationsRequestBuilder when successful +func (m *ItemCodeSecurityRequestBuilder) Configurations()(*ItemCodeSecurityConfigurationsRequestBuilder) { + return NewItemCodeSecurityConfigurationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCodeSecurityRequestBuilderInternal instantiates a new ItemCodeSecurityRequestBuilder and sets the default values. +func NewItemCodeSecurityRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityRequestBuilder) { + m := &ItemCodeSecurityRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/code-security", pathParameters), + } + return m +} +// NewItemCodeSecurityRequestBuilder instantiates a new ItemCodeSecurityRequestBuilder and sets the default values. +func NewItemCodeSecurityRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeSecurityRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_access_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_access_put_request_body.go new file mode 100644 index 000000000..8c24cb023 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_access_put_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCodespacesAccessPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The usernames of the organization members who should have access to codespaces in the organization. Required when `visibility` is `selected_members`. The provided list of usernames will replace any existing value. + selected_usernames []string +} +// NewItemCodespacesAccessPutRequestBody instantiates a new ItemCodespacesAccessPutRequestBody and sets the default values. +func NewItemCodespacesAccessPutRequestBody()(*ItemCodespacesAccessPutRequestBody) { + m := &ItemCodespacesAccessPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCodespacesAccessPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodespacesAccessPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodespacesAccessPutRequestBody(), 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 *ItemCodespacesAccessPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodespacesAccessPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["selected_usernames"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetSelectedUsernames(res) + } + return nil + } + return res +} +// GetSelectedUsernames gets the selected_usernames property value. The usernames of the organization members who should have access to codespaces in the organization. Required when `visibility` is `selected_members`. The provided list of usernames will replace any existing value. +// returns a []string when successful +func (m *ItemCodespacesAccessPutRequestBody) GetSelectedUsernames()([]string) { + return m.selected_usernames +} +// Serialize serializes information the current object +func (m *ItemCodespacesAccessPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedUsernames() != nil { + err := writer.WriteCollectionOfStringValues("selected_usernames", m.GetSelectedUsernames()) + 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 *ItemCodespacesAccessPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedUsernames sets the selected_usernames property value. The usernames of the organization members who should have access to codespaces in the organization. Required when `visibility` is `selected_members`. The provided list of usernames will replace any existing value. +func (m *ItemCodespacesAccessPutRequestBody) SetSelectedUsernames(value []string)() { + m.selected_usernames = value +} +type ItemCodespacesAccessPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedUsernames()([]string) + SetSelectedUsernames(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_access_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_access_request_builder.go new file mode 100644 index 000000000..7b3c3892a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_access_request_builder.go @@ -0,0 +1,73 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCodespacesAccessRequestBuilder builds and executes requests for operations under \orgs\{org}\codespaces\access +type ItemCodespacesAccessRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCodespacesAccessRequestBuilderInternal instantiates a new ItemCodespacesAccessRequestBuilder and sets the default values. +func NewItemCodespacesAccessRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodespacesAccessRequestBuilder) { + m := &ItemCodespacesAccessRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/codespaces/access", pathParameters), + } + return m +} +// NewItemCodespacesAccessRequestBuilder instantiates a new ItemCodespacesAccessRequestBuilder and sets the default values. +func NewItemCodespacesAccessRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodespacesAccessRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodespacesAccessRequestBuilderInternal(urlParams, requestAdapter) +} +// Put sets which users can access codespaces in an organization. This is synonymous with granting or revoking codespaces access permissions for users according to the visibility.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// Deprecated: +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces +func (m *ItemCodespacesAccessRequestBuilder) Put(ctx context.Context, body ItemCodespacesAccessPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Selected_users the selected_users property +// returns a *ItemCodespacesAccessSelected_usersRequestBuilder when successful +func (m *ItemCodespacesAccessRequestBuilder) Selected_users()(*ItemCodespacesAccessSelected_usersRequestBuilder) { + return NewItemCodespacesAccessSelected_usersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToPutRequestInformation sets which users can access codespaces in an organization. This is synonymous with granting or revoking codespaces access permissions for users according to the visibility.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemCodespacesAccessRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemCodespacesAccessPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemCodespacesAccessRequestBuilder when successful +func (m *ItemCodespacesAccessRequestBuilder) WithUrl(rawUrl string)(*ItemCodespacesAccessRequestBuilder) { + return NewItemCodespacesAccessRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_access_selected_users_delete_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_access_selected_users_delete_request_body.go new file mode 100644 index 000000000..4dc0b6e4a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_access_selected_users_delete_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCodespacesAccessSelected_usersDeleteRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The usernames of the organization members whose codespaces should not be billed to the organization. + selected_usernames []string +} +// NewItemCodespacesAccessSelected_usersDeleteRequestBody instantiates a new ItemCodespacesAccessSelected_usersDeleteRequestBody and sets the default values. +func NewItemCodespacesAccessSelected_usersDeleteRequestBody()(*ItemCodespacesAccessSelected_usersDeleteRequestBody) { + m := &ItemCodespacesAccessSelected_usersDeleteRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCodespacesAccessSelected_usersDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodespacesAccessSelected_usersDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodespacesAccessSelected_usersDeleteRequestBody(), 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 *ItemCodespacesAccessSelected_usersDeleteRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodespacesAccessSelected_usersDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["selected_usernames"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetSelectedUsernames(res) + } + return nil + } + return res +} +// GetSelectedUsernames gets the selected_usernames property value. The usernames of the organization members whose codespaces should not be billed to the organization. +// returns a []string when successful +func (m *ItemCodespacesAccessSelected_usersDeleteRequestBody) GetSelectedUsernames()([]string) { + return m.selected_usernames +} +// Serialize serializes information the current object +func (m *ItemCodespacesAccessSelected_usersDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedUsernames() != nil { + err := writer.WriteCollectionOfStringValues("selected_usernames", m.GetSelectedUsernames()) + 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 *ItemCodespacesAccessSelected_usersDeleteRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedUsernames sets the selected_usernames property value. The usernames of the organization members whose codespaces should not be billed to the organization. +func (m *ItemCodespacesAccessSelected_usersDeleteRequestBody) SetSelectedUsernames(value []string)() { + m.selected_usernames = value +} +type ItemCodespacesAccessSelected_usersDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedUsernames()([]string) + SetSelectedUsernames(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_access_selected_users_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_access_selected_users_post_request_body.go new file mode 100644 index 000000000..b5ff0a8ea --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_access_selected_users_post_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCodespacesAccessSelected_usersPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The usernames of the organization members whose codespaces be billed to the organization. + selected_usernames []string +} +// NewItemCodespacesAccessSelected_usersPostRequestBody instantiates a new ItemCodespacesAccessSelected_usersPostRequestBody and sets the default values. +func NewItemCodespacesAccessSelected_usersPostRequestBody()(*ItemCodespacesAccessSelected_usersPostRequestBody) { + m := &ItemCodespacesAccessSelected_usersPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCodespacesAccessSelected_usersPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodespacesAccessSelected_usersPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodespacesAccessSelected_usersPostRequestBody(), 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 *ItemCodespacesAccessSelected_usersPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodespacesAccessSelected_usersPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["selected_usernames"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetSelectedUsernames(res) + } + return nil + } + return res +} +// GetSelectedUsernames gets the selected_usernames property value. The usernames of the organization members whose codespaces be billed to the organization. +// returns a []string when successful +func (m *ItemCodespacesAccessSelected_usersPostRequestBody) GetSelectedUsernames()([]string) { + return m.selected_usernames +} +// Serialize serializes information the current object +func (m *ItemCodespacesAccessSelected_usersPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedUsernames() != nil { + err := writer.WriteCollectionOfStringValues("selected_usernames", m.GetSelectedUsernames()) + 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 *ItemCodespacesAccessSelected_usersPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedUsernames sets the selected_usernames property value. The usernames of the organization members whose codespaces be billed to the organization. +func (m *ItemCodespacesAccessSelected_usersPostRequestBody) SetSelectedUsernames(value []string)() { + m.selected_usernames = value +} +type ItemCodespacesAccessSelected_usersPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedUsernames()([]string) + SetSelectedUsernames(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_access_selected_users_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_access_selected_users_request_builder.go new file mode 100644 index 000000000..4311c93c3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_access_selected_users_request_builder.go @@ -0,0 +1,105 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCodespacesAccessSelected_usersRequestBuilder builds and executes requests for operations under \orgs\{org}\codespaces\access\selected_users +type ItemCodespacesAccessSelected_usersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCodespacesAccessSelected_usersRequestBuilderInternal instantiates a new ItemCodespacesAccessSelected_usersRequestBuilder and sets the default values. +func NewItemCodespacesAccessSelected_usersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodespacesAccessSelected_usersRequestBuilder) { + m := &ItemCodespacesAccessSelected_usersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/codespaces/access/selected_users", pathParameters), + } + return m +} +// NewItemCodespacesAccessSelected_usersRequestBuilder instantiates a new ItemCodespacesAccessSelected_usersRequestBuilder and sets the default values. +func NewItemCodespacesAccessSelected_usersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodespacesAccessSelected_usersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodespacesAccessSelected_usersRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete codespaces for the specified users will no longer be billed to the organization.To use this endpoint, the access settings for the organization must be set to `selected_members`.For information on how to change this setting, see "[Manage access control for organization codespaces](https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// Deprecated: +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/organizations#remove-users-from-codespaces-access-for-an-organization +func (m *ItemCodespacesAccessSelected_usersRequestBuilder) Delete(ctx context.Context, body ItemCodespacesAccessSelected_usersDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Post codespaces for the specified users will be billed to the organization.To use this endpoint, the access settings for the organization must be set to `selected_members`.For information on how to change this setting, see "[Manage access control for organization codespaces](https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// Deprecated: +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/organizations#add-users-to-codespaces-access-for-an-organization +func (m *ItemCodespacesAccessSelected_usersRequestBuilder) Post(ctx context.Context, body ItemCodespacesAccessSelected_usersPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation codespaces for the specified users will no longer be billed to the organization.To use this endpoint, the access settings for the organization must be set to `selected_members`.For information on how to change this setting, see "[Manage access control for organization codespaces](https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemCodespacesAccessSelected_usersRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ItemCodespacesAccessSelected_usersDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPostRequestInformation codespaces for the specified users will be billed to the organization.To use this endpoint, the access settings for the organization must be set to `selected_members`.For information on how to change this setting, see "[Manage access control for organization codespaces](https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemCodespacesAccessSelected_usersRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemCodespacesAccessSelected_usersPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemCodespacesAccessSelected_usersRequestBuilder when successful +func (m *ItemCodespacesAccessSelected_usersRequestBuilder) WithUrl(rawUrl string)(*ItemCodespacesAccessSelected_usersRequestBuilder) { + return NewItemCodespacesAccessSelected_usersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_get_response.go new file mode 100644 index 000000000..2a3629b3d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemCodespacesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The codespaces property + codespaces []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable + // The total_count property + total_count *int32 +} +// NewItemCodespacesGetResponse instantiates a new ItemCodespacesGetResponse and sets the default values. +func NewItemCodespacesGetResponse()(*ItemCodespacesGetResponse) { + m := &ItemCodespacesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCodespacesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodespacesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodespacesGetResponse(), 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 *ItemCodespacesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCodespaces gets the codespaces property value. The codespaces property +// returns a []Codespaceable when successful +func (m *ItemCodespacesGetResponse) GetCodespaces()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable) { + return m.codespaces +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodespacesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["codespaces"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespaceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable) + } + } + m.SetCodespaces(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemCodespacesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemCodespacesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCodespaces() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCodespaces())) + for i, v := range m.GetCodespaces() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("codespaces", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemCodespacesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCodespaces sets the codespaces property value. The codespaces property +func (m *ItemCodespacesGetResponse) SetCodespaces(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable)() { + m.codespaces = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemCodespacesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemCodespacesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCodespaces()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable) + GetTotalCount()(*int32) + SetCodespaces(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_request_builder.go new file mode 100644 index 000000000..b03b8ba72 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_request_builder.go @@ -0,0 +1,84 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCodespacesRequestBuilder builds and executes requests for operations under \orgs\{org}\codespaces +type ItemCodespacesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCodespacesRequestBuilderGetQueryParameters lists the codespaces associated to a specified organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemCodespacesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// Access the access property +// returns a *ItemCodespacesAccessRequestBuilder when successful +func (m *ItemCodespacesRequestBuilder) Access()(*ItemCodespacesAccessRequestBuilder) { + return NewItemCodespacesAccessRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCodespacesRequestBuilderInternal instantiates a new ItemCodespacesRequestBuilder and sets the default values. +func NewItemCodespacesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodespacesRequestBuilder) { + m := &ItemCodespacesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/codespaces{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemCodespacesRequestBuilder instantiates a new ItemCodespacesRequestBuilder and sets the default values. +func NewItemCodespacesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodespacesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodespacesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the codespaces associated to a specified organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemCodespacesGetResponseable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization +func (m *ItemCodespacesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodespacesRequestBuilderGetQueryParameters])(ItemCodespacesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemCodespacesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemCodespacesGetResponseable), nil +} +// Secrets the secrets property +// returns a *ItemCodespacesSecretsRequestBuilder when successful +func (m *ItemCodespacesRequestBuilder) Secrets()(*ItemCodespacesSecretsRequestBuilder) { + return NewItemCodespacesSecretsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists the codespaces associated to a specified organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodespacesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodespacesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodespacesRequestBuilder when successful +func (m *ItemCodespacesRequestBuilder) WithUrl(rawUrl string)(*ItemCodespacesRequestBuilder) { + return NewItemCodespacesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_response.go new file mode 100644 index 000000000..d6e4dfb4f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemCodespacesResponse +// Deprecated: This class is obsolete. Use codespacesGetResponse instead. +type ItemCodespacesResponse struct { + ItemCodespacesGetResponse +} +// NewItemCodespacesResponse instantiates a new ItemCodespacesResponse and sets the default values. +func NewItemCodespacesResponse()(*ItemCodespacesResponse) { + m := &ItemCodespacesResponse{ + ItemCodespacesGetResponse: *NewItemCodespacesGetResponse(), + } + return m +} +// CreateItemCodespacesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemCodespacesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodespacesResponse(), nil +} +// ItemCodespacesResponseable +// Deprecated: This class is obsolete. Use codespacesGetResponse instead. +type ItemCodespacesResponseable interface { + ItemCodespacesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_get_response.go new file mode 100644 index 000000000..49e509e98 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemCodespacesSecretsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The secrets property + secrets []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesOrgSecretable + // The total_count property + total_count *int32 +} +// NewItemCodespacesSecretsGetResponse instantiates a new ItemCodespacesSecretsGetResponse and sets the default values. +func NewItemCodespacesSecretsGetResponse()(*ItemCodespacesSecretsGetResponse) { + m := &ItemCodespacesSecretsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCodespacesSecretsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodespacesSecretsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodespacesSecretsGetResponse(), 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 *ItemCodespacesSecretsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodespacesSecretsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespacesOrgSecretFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesOrgSecretable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesOrgSecretable) + } + } + m.SetSecrets(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetSecrets gets the secrets property value. The secrets property +// returns a []CodespacesOrgSecretable when successful +func (m *ItemCodespacesSecretsGetResponse) GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesOrgSecretable) { + return m.secrets +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemCodespacesSecretsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemCodespacesSecretsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecrets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSecrets())) + for i, v := range m.GetSecrets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("secrets", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemCodespacesSecretsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSecrets sets the secrets property value. The secrets property +func (m *ItemCodespacesSecretsGetResponse) SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesOrgSecretable)() { + m.secrets = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemCodespacesSecretsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemCodespacesSecretsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesOrgSecretable) + GetTotalCount()(*int32) + SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesOrgSecretable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_repositories_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_repositories_get_response.go new file mode 100644 index 000000000..41add13ff --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_repositories_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemCodespacesSecretsItemRepositoriesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The repositories property + repositories []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable + // The total_count property + total_count *int32 +} +// NewItemCodespacesSecretsItemRepositoriesGetResponse instantiates a new ItemCodespacesSecretsItemRepositoriesGetResponse and sets the default values. +func NewItemCodespacesSecretsItemRepositoriesGetResponse()(*ItemCodespacesSecretsItemRepositoriesGetResponse) { + m := &ItemCodespacesSecretsItemRepositoriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCodespacesSecretsItemRepositoriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodespacesSecretsItemRepositoriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodespacesSecretsItemRepositoriesGetResponse(), 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 *ItemCodespacesSecretsItemRepositoriesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodespacesSecretsItemRepositoriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []MinimalRepositoryable when successful +func (m *ItemCodespacesSecretsItemRepositoriesGetResponse) GetRepositories()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) { + return m.repositories +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemCodespacesSecretsItemRepositoriesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemCodespacesSecretsItemRepositoriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemCodespacesSecretsItemRepositoriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *ItemCodespacesSecretsItemRepositoriesGetResponse) SetRepositories(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable)() { + m.repositories = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemCodespacesSecretsItemRepositoriesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemCodespacesSecretsItemRepositoriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositories()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + GetTotalCount()(*int32) + SetRepositories(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_repositories_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_repositories_put_request_body.go new file mode 100644 index 000000000..d86167762 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_repositories_put_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCodespacesSecretsItemRepositoriesPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret) endpoints. + selected_repository_ids []int32 +} +// NewItemCodespacesSecretsItemRepositoriesPutRequestBody instantiates a new ItemCodespacesSecretsItemRepositoriesPutRequestBody and sets the default values. +func NewItemCodespacesSecretsItemRepositoriesPutRequestBody()(*ItemCodespacesSecretsItemRepositoriesPutRequestBody) { + m := &ItemCodespacesSecretsItemRepositoriesPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCodespacesSecretsItemRepositoriesPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodespacesSecretsItemRepositoriesPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodespacesSecretsItemRepositoriesPutRequestBody(), 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 *ItemCodespacesSecretsItemRepositoriesPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodespacesSecretsItemRepositoriesPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["selected_repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetSelectedRepositoryIds(res) + } + return nil + } + return res +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret) endpoints. +// returns a []int32 when successful +func (m *ItemCodespacesSecretsItemRepositoriesPutRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *ItemCodespacesSecretsItemRepositoriesPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + 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 *ItemCodespacesSecretsItemRepositoriesPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret) endpoints. +func (m *ItemCodespacesSecretsItemRepositoriesPutRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +type ItemCodespacesSecretsItemRepositoriesPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedRepositoryIds()([]int32) + SetSelectedRepositoryIds(value []int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_repositories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_repositories_request_builder.go new file mode 100644 index 000000000..e54a3699c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_repositories_request_builder.go @@ -0,0 +1,110 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCodespacesSecretsItemRepositoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\codespaces\secrets\{secret_name}\repositories +type ItemCodespacesSecretsItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCodespacesSecretsItemRepositoriesRequestBuilderGetQueryParameters lists all repositories that have been selected when the `visibility`for repository access to a secret is set to `selected`.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemCodespacesSecretsItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRepository_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.codespaces.secrets.item.repositories.item collection +// returns a *ItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemCodespacesSecretsItemRepositoriesRequestBuilder) ByRepository_id(repository_id int32)(*ItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["repository_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(repository_id), 10) + return NewItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCodespacesSecretsItemRepositoriesRequestBuilderInternal instantiates a new ItemCodespacesSecretsItemRepositoriesRequestBuilder and sets the default values. +func NewItemCodespacesSecretsItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodespacesSecretsItemRepositoriesRequestBuilder) { + m := &ItemCodespacesSecretsItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/codespaces/secrets/{secret_name}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemCodespacesSecretsItemRepositoriesRequestBuilder instantiates a new ItemCodespacesSecretsItemRepositoriesRequestBuilder and sets the default values. +func NewItemCodespacesSecretsItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodespacesSecretsItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodespacesSecretsItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all repositories that have been selected when the `visibility`for repository access to a secret is set to `selected`.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemCodespacesSecretsItemRepositoriesGetResponseable 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/codespaces/organization-secrets#list-selected-repositories-for-an-organization-secret +func (m *ItemCodespacesSecretsItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodespacesSecretsItemRepositoriesRequestBuilderGetQueryParameters])(ItemCodespacesSecretsItemRepositoriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemCodespacesSecretsItemRepositoriesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemCodespacesSecretsItemRepositoriesGetResponseable), nil +} +// Put replaces all repositories for an organization development environment secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret +func (m *ItemCodespacesSecretsItemRepositoriesRequestBuilder) Put(ctx context.Context, body ItemCodespacesSecretsItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation lists all repositories that have been selected when the `visibility`for repository access to a secret is set to `selected`.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodespacesSecretsItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodespacesSecretsItemRepositoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation replaces all repositories for an organization development environment secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodespacesSecretsItemRepositoriesRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemCodespacesSecretsItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodespacesSecretsItemRepositoriesRequestBuilder when successful +func (m *ItemCodespacesSecretsItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemCodespacesSecretsItemRepositoriesRequestBuilder) { + return NewItemCodespacesSecretsItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_repositories_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_repositories_response.go new file mode 100644 index 000000000..a66aa8eff --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_repositories_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemCodespacesSecretsItemRepositoriesResponse +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type ItemCodespacesSecretsItemRepositoriesResponse struct { + ItemCodespacesSecretsItemRepositoriesGetResponse +} +// NewItemCodespacesSecretsItemRepositoriesResponse instantiates a new ItemCodespacesSecretsItemRepositoriesResponse and sets the default values. +func NewItemCodespacesSecretsItemRepositoriesResponse()(*ItemCodespacesSecretsItemRepositoriesResponse) { + m := &ItemCodespacesSecretsItemRepositoriesResponse{ + ItemCodespacesSecretsItemRepositoriesGetResponse: *NewItemCodespacesSecretsItemRepositoriesGetResponse(), + } + return m +} +// CreateItemCodespacesSecretsItemRepositoriesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemCodespacesSecretsItemRepositoriesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodespacesSecretsItemRepositoriesResponse(), nil +} +// ItemCodespacesSecretsItemRepositoriesResponseable +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type ItemCodespacesSecretsItemRepositoriesResponseable interface { + ItemCodespacesSecretsItemRepositoriesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_repositories_with_repository_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_repositories_with_repository_item_request_builder.go new file mode 100644 index 000000000..e62818b75 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_repositories_with_repository_item_request_builder.go @@ -0,0 +1,88 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\codespaces\secrets\{secret_name}\repositories\{repository_id} +type ItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal instantiates a new ItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + m := &ItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}", pathParameters), + } + return m +} +// NewItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder instantiates a new ItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a repository from an organization development environment secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` 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] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret +func (m *ItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put adds a repository to an organization development environment secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` 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] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/organization-secrets#add-selected-repository-to-an-organization-secret +func (m *ItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a repository from an organization development environment secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation adds a repository to an organization development environment secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + return NewItemCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_with_secret_name_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_with_secret_name_put_request_body.go new file mode 100644 index 000000000..7485dca8f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_item_with_secret_name_put_request_body.go @@ -0,0 +1,144 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCodespacesSecretsItemWithSecret_namePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-public-key) endpoint. + encrypted_value *string + // The ID of the key you used to encrypt the secret. + key_id *string + // An array of repository IDs that can access the organization secret. You can only provide a list of repository IDs when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret) endpoints. + selected_repository_ids []int32 +} +// NewItemCodespacesSecretsItemWithSecret_namePutRequestBody instantiates a new ItemCodespacesSecretsItemWithSecret_namePutRequestBody and sets the default values. +func NewItemCodespacesSecretsItemWithSecret_namePutRequestBody()(*ItemCodespacesSecretsItemWithSecret_namePutRequestBody) { + m := &ItemCodespacesSecretsItemWithSecret_namePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCodespacesSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodespacesSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodespacesSecretsItemWithSecret_namePutRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemCodespacesSecretsItemWithSecret_namePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncryptedValue gets the encrypted_value property value. The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-public-key) endpoint. +// returns a *string when successful +func (m *ItemCodespacesSecretsItemWithSecret_namePutRequestBody) GetEncryptedValue()(*string) { + return m.encrypted_value +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodespacesSecretsItemWithSecret_namePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["encrypted_value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncryptedValue(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + res["selected_repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetSelectedRepositoryIds(res) + } + return nil + } + return res +} +// GetKeyId gets the key_id property value. The ID of the key you used to encrypt the secret. +// returns a *string when successful +func (m *ItemCodespacesSecretsItemWithSecret_namePutRequestBody) GetKeyId()(*string) { + return m.key_id +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository IDs that can access the organization secret. You can only provide a list of repository IDs when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret) endpoints. +// returns a []int32 when successful +func (m *ItemCodespacesSecretsItemWithSecret_namePutRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *ItemCodespacesSecretsItemWithSecret_namePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("encrypted_value", m.GetEncryptedValue()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + 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 *ItemCodespacesSecretsItemWithSecret_namePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncryptedValue sets the encrypted_value property value. The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-public-key) endpoint. +func (m *ItemCodespacesSecretsItemWithSecret_namePutRequestBody) SetEncryptedValue(value *string)() { + m.encrypted_value = value +} +// SetKeyId sets the key_id property value. The ID of the key you used to encrypt the secret. +func (m *ItemCodespacesSecretsItemWithSecret_namePutRequestBody) SetKeyId(value *string)() { + m.key_id = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository IDs that can access the organization secret. You can only provide a list of repository IDs when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret) endpoints. +func (m *ItemCodespacesSecretsItemWithSecret_namePutRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +type ItemCodespacesSecretsItemWithSecret_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncryptedValue()(*string) + GetKeyId()(*string) + GetSelectedRepositoryIds()([]int32) + SetEncryptedValue(value *string)() + SetKeyId(value *string)() + SetSelectedRepositoryIds(value []int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_public_key_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_public_key_request_builder.go new file mode 100644 index 000000000..befe53476 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_public_key_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCodespacesSecretsPublicKeyRequestBuilder builds and executes requests for operations under \orgs\{org}\codespaces\secrets\public-key +type ItemCodespacesSecretsPublicKeyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCodespacesSecretsPublicKeyRequestBuilderInternal instantiates a new ItemCodespacesSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemCodespacesSecretsPublicKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodespacesSecretsPublicKeyRequestBuilder) { + m := &ItemCodespacesSecretsPublicKeyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/codespaces/secrets/public-key", pathParameters), + } + return m +} +// NewItemCodespacesSecretsPublicKeyRequestBuilder instantiates a new ItemCodespacesSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemCodespacesSecretsPublicKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodespacesSecretsPublicKeyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodespacesSecretsPublicKeyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a public key for an organization, which is required in order to encrypt secrets. You need to encrypt the value of a secret before you can create or update secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a CodespacesPublicKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-public-key +func (m *ItemCodespacesSecretsPublicKeyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesPublicKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespacesPublicKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesPublicKeyable), nil +} +// ToGetRequestInformation gets a public key for an organization, which is required in order to encrypt secrets. You need to encrypt the value of a secret before you can create or update secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodespacesSecretsPublicKeyRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodespacesSecretsPublicKeyRequestBuilder when successful +func (m *ItemCodespacesSecretsPublicKeyRequestBuilder) WithUrl(rawUrl string)(*ItemCodespacesSecretsPublicKeyRequestBuilder) { + return NewItemCodespacesSecretsPublicKeyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_request_builder.go new file mode 100644 index 000000000..6d5f00a5c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_request_builder.go @@ -0,0 +1,80 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemCodespacesSecretsRequestBuilder builds and executes requests for operations under \orgs\{org}\codespaces\secrets +type ItemCodespacesSecretsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCodespacesSecretsRequestBuilderGetQueryParameters lists all Codespaces development environment secrets available at the organization-level without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemCodespacesSecretsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// BySecret_name gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.codespaces.secrets.item collection +// returns a *ItemCodespacesSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemCodespacesSecretsRequestBuilder) BySecret_name(secret_name string)(*ItemCodespacesSecretsWithSecret_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if secret_name != "" { + urlTplParams["secret_name"] = secret_name + } + return NewItemCodespacesSecretsWithSecret_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCodespacesSecretsRequestBuilderInternal instantiates a new ItemCodespacesSecretsRequestBuilder and sets the default values. +func NewItemCodespacesSecretsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodespacesSecretsRequestBuilder) { + m := &ItemCodespacesSecretsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/codespaces/secrets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemCodespacesSecretsRequestBuilder instantiates a new ItemCodespacesSecretsRequestBuilder and sets the default values. +func NewItemCodespacesSecretsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodespacesSecretsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodespacesSecretsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all Codespaces development environment secrets available at the organization-level without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemCodespacesSecretsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/organization-secrets#list-organization-secrets +func (m *ItemCodespacesSecretsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodespacesSecretsRequestBuilderGetQueryParameters])(ItemCodespacesSecretsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemCodespacesSecretsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemCodespacesSecretsGetResponseable), nil +} +// PublicKey the publicKey property +// returns a *ItemCodespacesSecretsPublicKeyRequestBuilder when successful +func (m *ItemCodespacesSecretsRequestBuilder) PublicKey()(*ItemCodespacesSecretsPublicKeyRequestBuilder) { + return NewItemCodespacesSecretsPublicKeyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all Codespaces development environment secrets available at the organization-level without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodespacesSecretsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodespacesSecretsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodespacesSecretsRequestBuilder when successful +func (m *ItemCodespacesSecretsRequestBuilder) WithUrl(rawUrl string)(*ItemCodespacesSecretsRequestBuilder) { + return NewItemCodespacesSecretsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_response.go new file mode 100644 index 000000000..88fcfc4c2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemCodespacesSecretsResponse +// Deprecated: This class is obsolete. Use secretsGetResponse instead. +type ItemCodespacesSecretsResponse struct { + ItemCodespacesSecretsGetResponse +} +// NewItemCodespacesSecretsResponse instantiates a new ItemCodespacesSecretsResponse and sets the default values. +func NewItemCodespacesSecretsResponse()(*ItemCodespacesSecretsResponse) { + m := &ItemCodespacesSecretsResponse{ + ItemCodespacesSecretsGetResponse: *NewItemCodespacesSecretsGetResponse(), + } + return m +} +// CreateItemCodespacesSecretsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemCodespacesSecretsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodespacesSecretsResponse(), nil +} +// ItemCodespacesSecretsResponseable +// Deprecated: This class is obsolete. Use secretsGetResponse instead. +type ItemCodespacesSecretsResponseable interface { + ItemCodespacesSecretsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_with_secret_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_with_secret_name_item_request_builder.go new file mode 100644 index 000000000..7bd136c76 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_codespaces_secrets_with_secret_name_item_request_builder.go @@ -0,0 +1,126 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCodespacesSecretsWithSecret_nameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\codespaces\secrets\{secret_name} +type ItemCodespacesSecretsWithSecret_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCodespacesSecretsWithSecret_nameItemRequestBuilderInternal instantiates a new ItemCodespacesSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemCodespacesSecretsWithSecret_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodespacesSecretsWithSecret_nameItemRequestBuilder) { + m := &ItemCodespacesSecretsWithSecret_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/codespaces/secrets/{secret_name}", pathParameters), + } + return m +} +// NewItemCodespacesSecretsWithSecret_nameItemRequestBuilder instantiates a new ItemCodespacesSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemCodespacesSecretsWithSecret_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodespacesSecretsWithSecret_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodespacesSecretsWithSecret_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes an organization development environment secret using the secret name.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/organization-secrets#delete-an-organization-secret +func (m *ItemCodespacesSecretsWithSecret_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets an organization development environment secret without revealing its encrypted value.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a CodespacesOrgSecretable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-secret +func (m *ItemCodespacesSecretsWithSecret_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesOrgSecretable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespacesOrgSecretFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesOrgSecretable), nil +} +// Put creates or updates an organization development environment secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a EmptyObjectable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret +func (m *ItemCodespacesSecretsWithSecret_nameItemRequestBuilder) Put(ctx context.Context, body ItemCodespacesSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// Repositories the repositories property +// returns a *ItemCodespacesSecretsItemRepositoriesRequestBuilder when successful +func (m *ItemCodespacesSecretsWithSecret_nameItemRequestBuilder) Repositories()(*ItemCodespacesSecretsItemRepositoriesRequestBuilder) { + return NewItemCodespacesSecretsItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes an organization development environment secret using the secret name.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodespacesSecretsWithSecret_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets an organization development environment secret without revealing its encrypted value.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodespacesSecretsWithSecret_nameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation creates or updates an organization development environment secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodespacesSecretsWithSecret_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemCodespacesSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodespacesSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemCodespacesSecretsWithSecret_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemCodespacesSecretsWithSecret_nameItemRequestBuilder) { + return NewItemCodespacesSecretsWithSecret_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_request_builder.go new file mode 100644 index 000000000..ad18e5bf4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_request_builder.go @@ -0,0 +1,82 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCopilotBillingRequestBuilder builds and executes requests for operations under \orgs\{org}\copilot\billing +type ItemCopilotBillingRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCopilotBillingRequestBuilderInternal instantiates a new ItemCopilotBillingRequestBuilder and sets the default values. +func NewItemCopilotBillingRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotBillingRequestBuilder) { + m := &ItemCopilotBillingRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/copilot/billing", pathParameters), + } + return m +} +// NewItemCopilotBillingRequestBuilder instantiates a new ItemCopilotBillingRequestBuilder and sets the default values. +func NewItemCopilotBillingRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotBillingRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCopilotBillingRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Note**: This endpoint is in beta and is subject to change.Gets information about an organization's Copilot subscription, including seat breakdownand feature policies. To configure these settings, go to your organization's settings on GitHub.com.For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)".Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. +// returns a CopilotOrganizationDetailsable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-information-and-settings-for-an-organization +func (m *ItemCopilotBillingRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotOrganizationDetailsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCopilotOrganizationDetailsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotOrganizationDetailsable), nil +} +// Seats the seats property +// returns a *ItemCopilotBillingSeatsRequestBuilder when successful +func (m *ItemCopilotBillingRequestBuilder) Seats()(*ItemCopilotBillingSeatsRequestBuilder) { + return NewItemCopilotBillingSeatsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Selected_teams the selected_teams property +// returns a *ItemCopilotBillingSelected_teamsRequestBuilder when successful +func (m *ItemCopilotBillingRequestBuilder) Selected_teams()(*ItemCopilotBillingSelected_teamsRequestBuilder) { + return NewItemCopilotBillingSelected_teamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Selected_users the selected_users property +// returns a *ItemCopilotBillingSelected_usersRequestBuilder when successful +func (m *ItemCopilotBillingRequestBuilder) Selected_users()(*ItemCopilotBillingSelected_usersRequestBuilder) { + return NewItemCopilotBillingSelected_usersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation **Note**: This endpoint is in beta and is subject to change.Gets information about an organization's Copilot subscription, including seat breakdownand feature policies. To configure these settings, go to your organization's settings on GitHub.com.For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)".Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCopilotBillingRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCopilotBillingRequestBuilder when successful +func (m *ItemCopilotBillingRequestBuilder) WithUrl(rawUrl string)(*ItemCopilotBillingRequestBuilder) { + return NewItemCopilotBillingRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_seats_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_seats_get_response.go new file mode 100644 index 000000000..a374b9e85 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_seats_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemCopilotBillingSeatsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The seats property + seats []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable + // Total number of Copilot seats for the organization currently being billed. + total_seats *int32 +} +// NewItemCopilotBillingSeatsGetResponse instantiates a new ItemCopilotBillingSeatsGetResponse and sets the default values. +func NewItemCopilotBillingSeatsGetResponse()(*ItemCopilotBillingSeatsGetResponse) { + m := &ItemCopilotBillingSeatsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCopilotBillingSeatsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCopilotBillingSeatsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCopilotBillingSeatsGetResponse(), 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 *ItemCopilotBillingSeatsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCopilotBillingSeatsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCopilotSeatDetailsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable) + } + } + m.SetSeats(res) + } + return nil + } + res["total_seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalSeats(val) + } + return nil + } + return res +} +// GetSeats gets the seats property value. The seats property +// returns a []CopilotSeatDetailsable when successful +func (m *ItemCopilotBillingSeatsGetResponse) GetSeats()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable) { + return m.seats +} +// GetTotalSeats gets the total_seats property value. Total number of Copilot seats for the organization currently being billed. +// returns a *int32 when successful +func (m *ItemCopilotBillingSeatsGetResponse) GetTotalSeats()(*int32) { + return m.total_seats +} +// Serialize serializes information the current object +func (m *ItemCopilotBillingSeatsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSeats() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSeats())) + for i, v := range m.GetSeats() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("seats", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_seats", m.GetTotalSeats()) + 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 *ItemCopilotBillingSeatsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSeats sets the seats property value. The seats property +func (m *ItemCopilotBillingSeatsGetResponse) SetSeats(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable)() { + m.seats = value +} +// SetTotalSeats sets the total_seats property value. Total number of Copilot seats for the organization currently being billed. +func (m *ItemCopilotBillingSeatsGetResponse) SetTotalSeats(value *int32)() { + m.total_seats = value +} +type ItemCopilotBillingSeatsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSeats()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable) + GetTotalSeats()(*int32) + SetSeats(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable)() + SetTotalSeats(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_seats_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_seats_request_builder.go new file mode 100644 index 000000000..ef228edbf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_seats_request_builder.go @@ -0,0 +1,74 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCopilotBillingSeatsRequestBuilder builds and executes requests for operations under \orgs\{org}\copilot\billing\seats +type ItemCopilotBillingSeatsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCopilotBillingSeatsRequestBuilderGetQueryParameters **Note**: This endpoint is in beta and is subject to change.Lists all active Copilot seats for an organization with a Copilot Business or Copilot Enterprise subscription.Only organization owners can view assigned seats.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. +type ItemCopilotBillingSeatsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemCopilotBillingSeatsRequestBuilderInternal instantiates a new ItemCopilotBillingSeatsRequestBuilder and sets the default values. +func NewItemCopilotBillingSeatsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotBillingSeatsRequestBuilder) { + m := &ItemCopilotBillingSeatsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/copilot/billing/seats{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemCopilotBillingSeatsRequestBuilder instantiates a new ItemCopilotBillingSeatsRequestBuilder and sets the default values. +func NewItemCopilotBillingSeatsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotBillingSeatsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCopilotBillingSeatsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Note**: This endpoint is in beta and is subject to change.Lists all active Copilot seats for an organization with a Copilot Business or Copilot Enterprise subscription.Only organization owners can view assigned seats.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. +// returns a ItemCopilotBillingSeatsGetResponseable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-organization +func (m *ItemCopilotBillingSeatsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCopilotBillingSeatsRequestBuilderGetQueryParameters])(ItemCopilotBillingSeatsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemCopilotBillingSeatsGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemCopilotBillingSeatsGetResponseable), nil +} +// ToGetRequestInformation **Note**: This endpoint is in beta and is subject to change.Lists all active Copilot seats for an organization with a Copilot Business or Copilot Enterprise subscription.Only organization owners can view assigned seats.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCopilotBillingSeatsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCopilotBillingSeatsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCopilotBillingSeatsRequestBuilder when successful +func (m *ItemCopilotBillingSeatsRequestBuilder) WithUrl(rawUrl string)(*ItemCopilotBillingSeatsRequestBuilder) { + return NewItemCopilotBillingSeatsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_seats_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_seats_response.go new file mode 100644 index 000000000..67a3f3a90 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_seats_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemCopilotBillingSeatsResponse +// Deprecated: This class is obsolete. Use seatsGetResponse instead. +type ItemCopilotBillingSeatsResponse struct { + ItemCopilotBillingSeatsGetResponse +} +// NewItemCopilotBillingSeatsResponse instantiates a new ItemCopilotBillingSeatsResponse and sets the default values. +func NewItemCopilotBillingSeatsResponse()(*ItemCopilotBillingSeatsResponse) { + m := &ItemCopilotBillingSeatsResponse{ + ItemCopilotBillingSeatsGetResponse: *NewItemCopilotBillingSeatsGetResponse(), + } + return m +} +// CreateItemCopilotBillingSeatsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemCopilotBillingSeatsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCopilotBillingSeatsResponse(), nil +} +// ItemCopilotBillingSeatsResponseable +// Deprecated: This class is obsolete. Use seatsGetResponse instead. +type ItemCopilotBillingSeatsResponseable interface { + ItemCopilotBillingSeatsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_delete_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_delete_request_body.go new file mode 100644 index 000000000..0bc21a8fa --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_delete_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCopilotBillingSelected_teamsDeleteRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The names of teams from which to revoke access to GitHub Copilot. + selected_teams []string +} +// NewItemCopilotBillingSelected_teamsDeleteRequestBody instantiates a new ItemCopilotBillingSelected_teamsDeleteRequestBody and sets the default values. +func NewItemCopilotBillingSelected_teamsDeleteRequestBody()(*ItemCopilotBillingSelected_teamsDeleteRequestBody) { + m := &ItemCopilotBillingSelected_teamsDeleteRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCopilotBillingSelected_teamsDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCopilotBillingSelected_teamsDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCopilotBillingSelected_teamsDeleteRequestBody(), 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 *ItemCopilotBillingSelected_teamsDeleteRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCopilotBillingSelected_teamsDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["selected_teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetSelectedTeams(res) + } + return nil + } + return res +} +// GetSelectedTeams gets the selected_teams property value. The names of teams from which to revoke access to GitHub Copilot. +// returns a []string when successful +func (m *ItemCopilotBillingSelected_teamsDeleteRequestBody) GetSelectedTeams()([]string) { + return m.selected_teams +} +// Serialize serializes information the current object +func (m *ItemCopilotBillingSelected_teamsDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedTeams() != nil { + err := writer.WriteCollectionOfStringValues("selected_teams", m.GetSelectedTeams()) + 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 *ItemCopilotBillingSelected_teamsDeleteRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedTeams sets the selected_teams property value. The names of teams from which to revoke access to GitHub Copilot. +func (m *ItemCopilotBillingSelected_teamsDeleteRequestBody) SetSelectedTeams(value []string)() { + m.selected_teams = value +} +type ItemCopilotBillingSelected_teamsDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedTeams()([]string) + SetSelectedTeams(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_delete_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_delete_response.go new file mode 100644 index 000000000..27cf7b173 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_delete_response.go @@ -0,0 +1,81 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemCopilotBillingSelected_teamsDeleteResponse the total number of seat assignments cancelled. +type ItemCopilotBillingSelected_teamsDeleteResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The seats_cancelled property + seats_cancelled *int32 +} +// NewItemCopilotBillingSelected_teamsDeleteResponse instantiates a new ItemCopilotBillingSelected_teamsDeleteResponse and sets the default values. +func NewItemCopilotBillingSelected_teamsDeleteResponse()(*ItemCopilotBillingSelected_teamsDeleteResponse) { + m := &ItemCopilotBillingSelected_teamsDeleteResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCopilotBillingSelected_teamsDeleteResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCopilotBillingSelected_teamsDeleteResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCopilotBillingSelected_teamsDeleteResponse(), 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 *ItemCopilotBillingSelected_teamsDeleteResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCopilotBillingSelected_teamsDeleteResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["seats_cancelled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSeatsCancelled(val) + } + return nil + } + return res +} +// GetSeatsCancelled gets the seats_cancelled property value. The seats_cancelled property +// returns a *int32 when successful +func (m *ItemCopilotBillingSelected_teamsDeleteResponse) GetSeatsCancelled()(*int32) { + return m.seats_cancelled +} +// Serialize serializes information the current object +func (m *ItemCopilotBillingSelected_teamsDeleteResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("seats_cancelled", m.GetSeatsCancelled()) + 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 *ItemCopilotBillingSelected_teamsDeleteResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSeatsCancelled sets the seats_cancelled property value. The seats_cancelled property +func (m *ItemCopilotBillingSelected_teamsDeleteResponse) SetSeatsCancelled(value *int32)() { + m.seats_cancelled = value +} +type ItemCopilotBillingSelected_teamsDeleteResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSeatsCancelled()(*int32) + SetSeatsCancelled(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_post_request_body.go new file mode 100644 index 000000000..3fb3fe546 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_post_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCopilotBillingSelected_teamsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // List of team names within the organization to which to grant access to GitHub Copilot. + selected_teams []string +} +// NewItemCopilotBillingSelected_teamsPostRequestBody instantiates a new ItemCopilotBillingSelected_teamsPostRequestBody and sets the default values. +func NewItemCopilotBillingSelected_teamsPostRequestBody()(*ItemCopilotBillingSelected_teamsPostRequestBody) { + m := &ItemCopilotBillingSelected_teamsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCopilotBillingSelected_teamsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCopilotBillingSelected_teamsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCopilotBillingSelected_teamsPostRequestBody(), 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 *ItemCopilotBillingSelected_teamsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCopilotBillingSelected_teamsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["selected_teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetSelectedTeams(res) + } + return nil + } + return res +} +// GetSelectedTeams gets the selected_teams property value. List of team names within the organization to which to grant access to GitHub Copilot. +// returns a []string when successful +func (m *ItemCopilotBillingSelected_teamsPostRequestBody) GetSelectedTeams()([]string) { + return m.selected_teams +} +// Serialize serializes information the current object +func (m *ItemCopilotBillingSelected_teamsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedTeams() != nil { + err := writer.WriteCollectionOfStringValues("selected_teams", m.GetSelectedTeams()) + 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 *ItemCopilotBillingSelected_teamsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedTeams sets the selected_teams property value. List of team names within the organization to which to grant access to GitHub Copilot. +func (m *ItemCopilotBillingSelected_teamsPostRequestBody) SetSelectedTeams(value []string)() { + m.selected_teams = value +} +type ItemCopilotBillingSelected_teamsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedTeams()([]string) + SetSelectedTeams(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_post_response.go new file mode 100644 index 000000000..62d27647c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_post_response.go @@ -0,0 +1,81 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemCopilotBillingSelected_teamsPostResponse the total number of seat assignments created. +type ItemCopilotBillingSelected_teamsPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The seats_created property + seats_created *int32 +} +// NewItemCopilotBillingSelected_teamsPostResponse instantiates a new ItemCopilotBillingSelected_teamsPostResponse and sets the default values. +func NewItemCopilotBillingSelected_teamsPostResponse()(*ItemCopilotBillingSelected_teamsPostResponse) { + m := &ItemCopilotBillingSelected_teamsPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCopilotBillingSelected_teamsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCopilotBillingSelected_teamsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCopilotBillingSelected_teamsPostResponse(), 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 *ItemCopilotBillingSelected_teamsPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCopilotBillingSelected_teamsPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["seats_created"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSeatsCreated(val) + } + return nil + } + return res +} +// GetSeatsCreated gets the seats_created property value. The seats_created property +// returns a *int32 when successful +func (m *ItemCopilotBillingSelected_teamsPostResponse) GetSeatsCreated()(*int32) { + return m.seats_created +} +// Serialize serializes information the current object +func (m *ItemCopilotBillingSelected_teamsPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("seats_created", m.GetSeatsCreated()) + 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 *ItemCopilotBillingSelected_teamsPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSeatsCreated sets the seats_created property value. The seats_created property +func (m *ItemCopilotBillingSelected_teamsPostResponse) SetSeatsCreated(value *int32)() { + m.seats_created = value +} +type ItemCopilotBillingSelected_teamsPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSeatsCreated()(*int32) + SetSeatsCreated(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_request_builder.go new file mode 100644 index 000000000..6cd021b4d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_request_builder.go @@ -0,0 +1,112 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCopilotBillingSelected_teamsRequestBuilder builds and executes requests for operations under \orgs\{org}\copilot\billing\selected_teams +type ItemCopilotBillingSelected_teamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCopilotBillingSelected_teamsRequestBuilderInternal instantiates a new ItemCopilotBillingSelected_teamsRequestBuilder and sets the default values. +func NewItemCopilotBillingSelected_teamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotBillingSelected_teamsRequestBuilder) { + m := &ItemCopilotBillingSelected_teamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/copilot/billing/selected_teams", pathParameters), + } + return m +} +// NewItemCopilotBillingSelected_teamsRequestBuilder instantiates a new ItemCopilotBillingSelected_teamsRequestBuilder and sets the default values. +func NewItemCopilotBillingSelected_teamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotBillingSelected_teamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCopilotBillingSelected_teamsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete **Note**: This endpoint is in beta and is subject to change.Cancels the Copilot seat assignment for all members of each team specified.This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users.For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)".For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)".Only organization owners can cancel Copilot seats for their organization members.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. +// returns a ItemCopilotBillingSelected_teamsDeleteResponseable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/copilot/copilot-user-management#remove-teams-from-the-copilot-subscription-for-an-organization +func (m *ItemCopilotBillingSelected_teamsRequestBuilder) Delete(ctx context.Context, body ItemCopilotBillingSelected_teamsDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemCopilotBillingSelected_teamsDeleteResponseable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemCopilotBillingSelected_teamsDeleteResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemCopilotBillingSelected_teamsDeleteResponseable), nil +} +// Post **Note**: This endpoint is in beta and is subject to change.Purchases a GitHub Copilot seat for all users within each specified team.The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)".Only organization owners can add Copilot seats for their organization members.In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy.For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)".For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)".OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. +// returns a ItemCopilotBillingSelected_teamsPostResponseable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/copilot/copilot-user-management#add-teams-to-the-copilot-subscription-for-an-organization +func (m *ItemCopilotBillingSelected_teamsRequestBuilder) Post(ctx context.Context, body ItemCopilotBillingSelected_teamsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemCopilotBillingSelected_teamsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemCopilotBillingSelected_teamsPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemCopilotBillingSelected_teamsPostResponseable), nil +} +// ToDeleteRequestInformation **Note**: This endpoint is in beta and is subject to change.Cancels the Copilot seat assignment for all members of each team specified.This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users.For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)".For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)".Only organization owners can cancel Copilot seats for their organization members.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCopilotBillingSelected_teamsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ItemCopilotBillingSelected_teamsDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPostRequestInformation **Note**: This endpoint is in beta and is subject to change.Purchases a GitHub Copilot seat for all users within each specified team.The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)".Only organization owners can add Copilot seats for their organization members.In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy.For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)".For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)".OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCopilotBillingSelected_teamsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemCopilotBillingSelected_teamsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCopilotBillingSelected_teamsRequestBuilder when successful +func (m *ItemCopilotBillingSelected_teamsRequestBuilder) WithUrl(rawUrl string)(*ItemCopilotBillingSelected_teamsRequestBuilder) { + return NewItemCopilotBillingSelected_teamsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_response.go new file mode 100644 index 000000000..2440a7b40 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_teams_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemCopilotBillingSelected_teamsResponse the total number of seat assignments created. +// Deprecated: This class is obsolete. Use selected_teamsPostResponse instead. +type ItemCopilotBillingSelected_teamsResponse struct { + ItemCopilotBillingSelected_teamsPostResponse +} +// NewItemCopilotBillingSelected_teamsResponse instantiates a new ItemCopilotBillingSelected_teamsResponse and sets the default values. +func NewItemCopilotBillingSelected_teamsResponse()(*ItemCopilotBillingSelected_teamsResponse) { + m := &ItemCopilotBillingSelected_teamsResponse{ + ItemCopilotBillingSelected_teamsPostResponse: *NewItemCopilotBillingSelected_teamsPostResponse(), + } + return m +} +// CreateItemCopilotBillingSelected_teamsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemCopilotBillingSelected_teamsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCopilotBillingSelected_teamsResponse(), nil +} +// ItemCopilotBillingSelected_teamsResponseable +// Deprecated: This class is obsolete. Use selected_teamsPostResponse instead. +type ItemCopilotBillingSelected_teamsResponseable interface { + ItemCopilotBillingSelected_teamsPostResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_delete_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_delete_request_body.go new file mode 100644 index 000000000..63b4d02ee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_delete_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCopilotBillingSelected_usersDeleteRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The usernames of the organization members for which to revoke access to GitHub Copilot. + selected_usernames []string +} +// NewItemCopilotBillingSelected_usersDeleteRequestBody instantiates a new ItemCopilotBillingSelected_usersDeleteRequestBody and sets the default values. +func NewItemCopilotBillingSelected_usersDeleteRequestBody()(*ItemCopilotBillingSelected_usersDeleteRequestBody) { + m := &ItemCopilotBillingSelected_usersDeleteRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCopilotBillingSelected_usersDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCopilotBillingSelected_usersDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCopilotBillingSelected_usersDeleteRequestBody(), 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 *ItemCopilotBillingSelected_usersDeleteRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCopilotBillingSelected_usersDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["selected_usernames"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetSelectedUsernames(res) + } + return nil + } + return res +} +// GetSelectedUsernames gets the selected_usernames property value. The usernames of the organization members for which to revoke access to GitHub Copilot. +// returns a []string when successful +func (m *ItemCopilotBillingSelected_usersDeleteRequestBody) GetSelectedUsernames()([]string) { + return m.selected_usernames +} +// Serialize serializes information the current object +func (m *ItemCopilotBillingSelected_usersDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedUsernames() != nil { + err := writer.WriteCollectionOfStringValues("selected_usernames", m.GetSelectedUsernames()) + 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 *ItemCopilotBillingSelected_usersDeleteRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedUsernames sets the selected_usernames property value. The usernames of the organization members for which to revoke access to GitHub Copilot. +func (m *ItemCopilotBillingSelected_usersDeleteRequestBody) SetSelectedUsernames(value []string)() { + m.selected_usernames = value +} +type ItemCopilotBillingSelected_usersDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedUsernames()([]string) + SetSelectedUsernames(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_delete_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_delete_response.go new file mode 100644 index 000000000..b658f15c1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_delete_response.go @@ -0,0 +1,81 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemCopilotBillingSelected_usersDeleteResponse the total number of seat assignments cancelled. +type ItemCopilotBillingSelected_usersDeleteResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The seats_cancelled property + seats_cancelled *int32 +} +// NewItemCopilotBillingSelected_usersDeleteResponse instantiates a new ItemCopilotBillingSelected_usersDeleteResponse and sets the default values. +func NewItemCopilotBillingSelected_usersDeleteResponse()(*ItemCopilotBillingSelected_usersDeleteResponse) { + m := &ItemCopilotBillingSelected_usersDeleteResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCopilotBillingSelected_usersDeleteResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCopilotBillingSelected_usersDeleteResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCopilotBillingSelected_usersDeleteResponse(), 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 *ItemCopilotBillingSelected_usersDeleteResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCopilotBillingSelected_usersDeleteResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["seats_cancelled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSeatsCancelled(val) + } + return nil + } + return res +} +// GetSeatsCancelled gets the seats_cancelled property value. The seats_cancelled property +// returns a *int32 when successful +func (m *ItemCopilotBillingSelected_usersDeleteResponse) GetSeatsCancelled()(*int32) { + return m.seats_cancelled +} +// Serialize serializes information the current object +func (m *ItemCopilotBillingSelected_usersDeleteResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("seats_cancelled", m.GetSeatsCancelled()) + 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 *ItemCopilotBillingSelected_usersDeleteResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSeatsCancelled sets the seats_cancelled property value. The seats_cancelled property +func (m *ItemCopilotBillingSelected_usersDeleteResponse) SetSeatsCancelled(value *int32)() { + m.seats_cancelled = value +} +type ItemCopilotBillingSelected_usersDeleteResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSeatsCancelled()(*int32) + SetSeatsCancelled(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_post_request_body.go new file mode 100644 index 000000000..c6d9802f9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_post_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCopilotBillingSelected_usersPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The usernames of the organization members to be granted access to GitHub Copilot. + selected_usernames []string +} +// NewItemCopilotBillingSelected_usersPostRequestBody instantiates a new ItemCopilotBillingSelected_usersPostRequestBody and sets the default values. +func NewItemCopilotBillingSelected_usersPostRequestBody()(*ItemCopilotBillingSelected_usersPostRequestBody) { + m := &ItemCopilotBillingSelected_usersPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCopilotBillingSelected_usersPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCopilotBillingSelected_usersPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCopilotBillingSelected_usersPostRequestBody(), 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 *ItemCopilotBillingSelected_usersPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCopilotBillingSelected_usersPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["selected_usernames"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetSelectedUsernames(res) + } + return nil + } + return res +} +// GetSelectedUsernames gets the selected_usernames property value. The usernames of the organization members to be granted access to GitHub Copilot. +// returns a []string when successful +func (m *ItemCopilotBillingSelected_usersPostRequestBody) GetSelectedUsernames()([]string) { + return m.selected_usernames +} +// Serialize serializes information the current object +func (m *ItemCopilotBillingSelected_usersPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedUsernames() != nil { + err := writer.WriteCollectionOfStringValues("selected_usernames", m.GetSelectedUsernames()) + 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 *ItemCopilotBillingSelected_usersPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedUsernames sets the selected_usernames property value. The usernames of the organization members to be granted access to GitHub Copilot. +func (m *ItemCopilotBillingSelected_usersPostRequestBody) SetSelectedUsernames(value []string)() { + m.selected_usernames = value +} +type ItemCopilotBillingSelected_usersPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedUsernames()([]string) + SetSelectedUsernames(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_post_response.go new file mode 100644 index 000000000..b90bf2333 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_post_response.go @@ -0,0 +1,81 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemCopilotBillingSelected_usersPostResponse the total number of seat assignments created. +type ItemCopilotBillingSelected_usersPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The seats_created property + seats_created *int32 +} +// NewItemCopilotBillingSelected_usersPostResponse instantiates a new ItemCopilotBillingSelected_usersPostResponse and sets the default values. +func NewItemCopilotBillingSelected_usersPostResponse()(*ItemCopilotBillingSelected_usersPostResponse) { + m := &ItemCopilotBillingSelected_usersPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCopilotBillingSelected_usersPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCopilotBillingSelected_usersPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCopilotBillingSelected_usersPostResponse(), 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 *ItemCopilotBillingSelected_usersPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCopilotBillingSelected_usersPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["seats_created"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSeatsCreated(val) + } + return nil + } + return res +} +// GetSeatsCreated gets the seats_created property value. The seats_created property +// returns a *int32 when successful +func (m *ItemCopilotBillingSelected_usersPostResponse) GetSeatsCreated()(*int32) { + return m.seats_created +} +// Serialize serializes information the current object +func (m *ItemCopilotBillingSelected_usersPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("seats_created", m.GetSeatsCreated()) + 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 *ItemCopilotBillingSelected_usersPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSeatsCreated sets the seats_created property value. The seats_created property +func (m *ItemCopilotBillingSelected_usersPostResponse) SetSeatsCreated(value *int32)() { + m.seats_created = value +} +type ItemCopilotBillingSelected_usersPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSeatsCreated()(*int32) + SetSeatsCreated(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_request_builder.go new file mode 100644 index 000000000..aed7cc9fb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_request_builder.go @@ -0,0 +1,112 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCopilotBillingSelected_usersRequestBuilder builds and executes requests for operations under \orgs\{org}\copilot\billing\selected_users +type ItemCopilotBillingSelected_usersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCopilotBillingSelected_usersRequestBuilderInternal instantiates a new ItemCopilotBillingSelected_usersRequestBuilder and sets the default values. +func NewItemCopilotBillingSelected_usersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotBillingSelected_usersRequestBuilder) { + m := &ItemCopilotBillingSelected_usersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/copilot/billing/selected_users", pathParameters), + } + return m +} +// NewItemCopilotBillingSelected_usersRequestBuilder instantiates a new ItemCopilotBillingSelected_usersRequestBuilder and sets the default values. +func NewItemCopilotBillingSelected_usersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotBillingSelected_usersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCopilotBillingSelected_usersRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete **Note**: This endpoint is in beta and is subject to change.Cancels the Copilot seat assignment for each user specified.This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users.For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)".For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)".Only organization owners can cancel Copilot seats for their organization members.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. +// returns a ItemCopilotBillingSelected_usersDeleteResponseable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/copilot/copilot-user-management#remove-users-from-the-copilot-subscription-for-an-organization +func (m *ItemCopilotBillingSelected_usersRequestBuilder) Delete(ctx context.Context, body ItemCopilotBillingSelected_usersDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemCopilotBillingSelected_usersDeleteResponseable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemCopilotBillingSelected_usersDeleteResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemCopilotBillingSelected_usersDeleteResponseable), nil +} +// Post **Note**: This endpoint is in beta and is subject to change.Purchases a GitHub Copilot seat for each user specified.The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)".Only organization owners can add Copilot seats for their organization members.In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy.For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)".For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)".OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. +// returns a ItemCopilotBillingSelected_usersPostResponseable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/copilot/copilot-user-management#add-users-to-the-copilot-subscription-for-an-organization +func (m *ItemCopilotBillingSelected_usersRequestBuilder) Post(ctx context.Context, body ItemCopilotBillingSelected_usersPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemCopilotBillingSelected_usersPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemCopilotBillingSelected_usersPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemCopilotBillingSelected_usersPostResponseable), nil +} +// ToDeleteRequestInformation **Note**: This endpoint is in beta and is subject to change.Cancels the Copilot seat assignment for each user specified.This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users.For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)".For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)".Only organization owners can cancel Copilot seats for their organization members.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCopilotBillingSelected_usersRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ItemCopilotBillingSelected_usersDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPostRequestInformation **Note**: This endpoint is in beta and is subject to change.Purchases a GitHub Copilot seat for each user specified.The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)".Only organization owners can add Copilot seats for their organization members.In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy.For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)".For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)".OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCopilotBillingSelected_usersRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemCopilotBillingSelected_usersPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCopilotBillingSelected_usersRequestBuilder when successful +func (m *ItemCopilotBillingSelected_usersRequestBuilder) WithUrl(rawUrl string)(*ItemCopilotBillingSelected_usersRequestBuilder) { + return NewItemCopilotBillingSelected_usersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_response.go new file mode 100644 index 000000000..441fe86a7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_billing_selected_users_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemCopilotBillingSelected_usersResponse the total number of seat assignments created. +// Deprecated: This class is obsolete. Use selected_usersPostResponse instead. +type ItemCopilotBillingSelected_usersResponse struct { + ItemCopilotBillingSelected_usersPostResponse +} +// NewItemCopilotBillingSelected_usersResponse instantiates a new ItemCopilotBillingSelected_usersResponse and sets the default values. +func NewItemCopilotBillingSelected_usersResponse()(*ItemCopilotBillingSelected_usersResponse) { + m := &ItemCopilotBillingSelected_usersResponse{ + ItemCopilotBillingSelected_usersPostResponse: *NewItemCopilotBillingSelected_usersPostResponse(), + } + return m +} +// CreateItemCopilotBillingSelected_usersResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemCopilotBillingSelected_usersResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCopilotBillingSelected_usersResponse(), nil +} +// ItemCopilotBillingSelected_usersResponseable +// Deprecated: This class is obsolete. Use selected_usersPostResponse instead. +type ItemCopilotBillingSelected_usersResponseable interface { + ItemCopilotBillingSelected_usersPostResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_request_builder.go new file mode 100644 index 000000000..a9a8889a5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_request_builder.go @@ -0,0 +1,33 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemCopilotRequestBuilder builds and executes requests for operations under \orgs\{org}\copilot +type ItemCopilotRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Billing the billing property +// returns a *ItemCopilotBillingRequestBuilder when successful +func (m *ItemCopilotRequestBuilder) Billing()(*ItemCopilotBillingRequestBuilder) { + return NewItemCopilotBillingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCopilotRequestBuilderInternal instantiates a new ItemCopilotRequestBuilder and sets the default values. +func NewItemCopilotRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotRequestBuilder) { + m := &ItemCopilotRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/copilot", pathParameters), + } + return m +} +// NewItemCopilotRequestBuilder instantiates a new ItemCopilotRequestBuilder and sets the default values. +func NewItemCopilotRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCopilotRequestBuilderInternal(urlParams, requestAdapter) +} +// Usage the usage property +// returns a *ItemCopilotUsageRequestBuilder when successful +func (m *ItemCopilotRequestBuilder) Usage()(*ItemCopilotUsageRequestBuilder) { + return NewItemCopilotUsageRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_usage_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_usage_request_builder.go new file mode 100644 index 000000000..3a2b2163b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_copilot_usage_request_builder.go @@ -0,0 +1,81 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCopilotUsageRequestBuilder builds and executes requests for operations under \orgs\{org}\copilot\usage +type ItemCopilotUsageRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCopilotUsageRequestBuilderGetQueryParameters **Note**: This endpoint is in beta and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEacross an organization, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.See the response schema tab for detailed metrics definitions.The response contains metrics for the prior 28 days. Usage metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. +type ItemCopilotUsageRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + Since *string `uriparametername:"since"` + // Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + Until *string `uriparametername:"until"` +} +// NewItemCopilotUsageRequestBuilderInternal instantiates a new ItemCopilotUsageRequestBuilder and sets the default values. +func NewItemCopilotUsageRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotUsageRequestBuilder) { + m := &ItemCopilotUsageRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/copilot/usage{?page*,per_page*,since*,until*}", pathParameters), + } + return m +} +// NewItemCopilotUsageRequestBuilder instantiates a new ItemCopilotUsageRequestBuilder and sets the default values. +func NewItemCopilotUsageRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotUsageRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCopilotUsageRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Note**: This endpoint is in beta and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEacross an organization, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.See the response schema tab for detailed metrics definitions.The response contains metrics for the prior 28 days. Usage metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. +// returns a []CopilotUsageMetricsable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-organization-members +func (m *ItemCopilotUsageRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCopilotUsageRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCopilotUsageMetricsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsable) + } + } + return val, nil +} +// ToGetRequestInformation **Note**: This endpoint is in beta and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEacross an organization, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.See the response schema tab for detailed metrics definitions.The response contains metrics for the prior 28 days. Usage metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCopilotUsageRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCopilotUsageRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCopilotUsageRequestBuilder when successful +func (m *ItemCopilotUsageRequestBuilder) WithUrl(rawUrl string)(*ItemCopilotUsageRequestBuilder) { + return NewItemCopilotUsageRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_alerts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_alerts_request_builder.go new file mode 100644 index 000000000..ffbd27b75 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_alerts_request_builder.go @@ -0,0 +1,98 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + id5ed4dfa872423f58318ec5274226649a680208c924c0fa4b6e180a4e9175a51 "github.com/octokit/go-sdk/pkg/github/orgs/item/dependabot/alerts" +) + +// ItemDependabotAlertsRequestBuilder builds and executes requests for operations under \orgs\{org}\dependabot\alerts +type ItemDependabotAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemDependabotAlertsRequestBuilderGetQueryParameters lists Dependabot alerts for an organization.The authenticated user must be an owner or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +type ItemDependabotAlertsRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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)." + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *id5ed4dfa872423f58318ec5274226649a680208c924c0fa4b6e180a4e9175a51.GetDirectionQueryParameterType `uriparametername:"direction"` + // A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned.Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust` + Ecosystem *string `uriparametername:"ecosystem"` + // **Deprecated**. The number of results per page (max 100), starting from the first matching result.This parameter must not be used in combination with `last`.Instead, use `per_page` in combination with `after` to fetch the first page of results. + First *int32 `uriparametername:"first"` + // **Deprecated**. The number of results per page (max 100), starting from the last matching result.This parameter must not be used in combination with `first`.Instead, use `per_page` in combination with `before` to fetch the last page of results. + Last *int32 `uriparametername:"last"` + // A comma-separated list of package names. If specified, only alerts for these packages will be returned. + Package *string `uriparametername:"package"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. + Scope *id5ed4dfa872423f58318ec5274226649a680208c924c0fa4b6e180a4e9175a51.GetScopeQueryParameterType `uriparametername:"scope"` + // A comma-separated list of severities. If specified, only alerts with these severities will be returned.Can be: `low`, `medium`, `high`, `critical` + Severity *string `uriparametername:"severity"` + // The property by which to sort the results.`created` means when the alert was created.`updated` means when the alert's state last changed. + Sort *id5ed4dfa872423f58318ec5274226649a680208c924c0fa4b6e180a4e9175a51.GetSortQueryParameterType `uriparametername:"sort"` + // A comma-separated list of states. If specified, only alerts with these states will be returned.Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` + State *string `uriparametername:"state"` +} +// NewItemDependabotAlertsRequestBuilderInternal instantiates a new ItemDependabotAlertsRequestBuilder and sets the default values. +func NewItemDependabotAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotAlertsRequestBuilder) { + m := &ItemDependabotAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/dependabot/alerts{?after*,before*,direction*,ecosystem*,first*,last*,package*,per_page*,scope*,severity*,sort*,state*}", pathParameters), + } + return m +} +// NewItemDependabotAlertsRequestBuilder instantiates a new ItemDependabotAlertsRequestBuilder and sets the default values. +func NewItemDependabotAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists Dependabot alerts for an organization.The authenticated user must be an owner or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a []DependabotAlertWithRepositoryable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization +func (m *ItemDependabotAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDependabotAlertsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotAlertWithRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDependabotAlertWithRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotAlertWithRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotAlertWithRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists Dependabot alerts for an organization.The authenticated user must be an owner or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemDependabotAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDependabotAlertsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemDependabotAlertsRequestBuilder when successful +func (m *ItemDependabotAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemDependabotAlertsRequestBuilder) { + return NewItemDependabotAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_request_builder.go new file mode 100644 index 000000000..3b6682e8b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_request_builder.go @@ -0,0 +1,33 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemDependabotRequestBuilder builds and executes requests for operations under \orgs\{org}\dependabot +type ItemDependabotRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Alerts the alerts property +// returns a *ItemDependabotAlertsRequestBuilder when successful +func (m *ItemDependabotRequestBuilder) Alerts()(*ItemDependabotAlertsRequestBuilder) { + return NewItemDependabotAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDependabotRequestBuilderInternal instantiates a new ItemDependabotRequestBuilder and sets the default values. +func NewItemDependabotRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotRequestBuilder) { + m := &ItemDependabotRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/dependabot", pathParameters), + } + return m +} +// NewItemDependabotRequestBuilder instantiates a new ItemDependabotRequestBuilder and sets the default values. +func NewItemDependabotRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotRequestBuilderInternal(urlParams, requestAdapter) +} +// Secrets the secrets property +// returns a *ItemDependabotSecretsRequestBuilder when successful +func (m *ItemDependabotRequestBuilder) Secrets()(*ItemDependabotSecretsRequestBuilder) { + return NewItemDependabotSecretsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_get_response.go new file mode 100644 index 000000000..f96a8fccc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemDependabotSecretsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The secrets property + secrets []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationDependabotSecretable + // The total_count property + total_count *int32 +} +// NewItemDependabotSecretsGetResponse instantiates a new ItemDependabotSecretsGetResponse and sets the default values. +func NewItemDependabotSecretsGetResponse()(*ItemDependabotSecretsGetResponse) { + m := &ItemDependabotSecretsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDependabotSecretsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDependabotSecretsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDependabotSecretsGetResponse(), 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 *ItemDependabotSecretsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemDependabotSecretsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationDependabotSecretFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationDependabotSecretable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationDependabotSecretable) + } + } + m.SetSecrets(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetSecrets gets the secrets property value. The secrets property +// returns a []OrganizationDependabotSecretable when successful +func (m *ItemDependabotSecretsGetResponse) GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationDependabotSecretable) { + return m.secrets +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemDependabotSecretsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemDependabotSecretsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecrets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSecrets())) + for i, v := range m.GetSecrets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("secrets", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemDependabotSecretsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSecrets sets the secrets property value. The secrets property +func (m *ItemDependabotSecretsGetResponse) SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationDependabotSecretable)() { + m.secrets = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemDependabotSecretsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemDependabotSecretsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationDependabotSecretable) + GetTotalCount()(*int32) + SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationDependabotSecretable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_repositories_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_repositories_get_response.go new file mode 100644 index 000000000..c8fa88ace --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_repositories_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemDependabotSecretsItemRepositoriesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The repositories property + repositories []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable + // The total_count property + total_count *int32 +} +// NewItemDependabotSecretsItemRepositoriesGetResponse instantiates a new ItemDependabotSecretsItemRepositoriesGetResponse and sets the default values. +func NewItemDependabotSecretsItemRepositoriesGetResponse()(*ItemDependabotSecretsItemRepositoriesGetResponse) { + m := &ItemDependabotSecretsItemRepositoriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDependabotSecretsItemRepositoriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDependabotSecretsItemRepositoriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDependabotSecretsItemRepositoriesGetResponse(), 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 *ItemDependabotSecretsItemRepositoriesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemDependabotSecretsItemRepositoriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []MinimalRepositoryable when successful +func (m *ItemDependabotSecretsItemRepositoriesGetResponse) GetRepositories()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) { + return m.repositories +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemDependabotSecretsItemRepositoriesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemDependabotSecretsItemRepositoriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemDependabotSecretsItemRepositoriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *ItemDependabotSecretsItemRepositoriesGetResponse) SetRepositories(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable)() { + m.repositories = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemDependabotSecretsItemRepositoriesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemDependabotSecretsItemRepositoriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositories()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + GetTotalCount()(*int32) + SetRepositories(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_repositories_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_repositories_put_request_body.go new file mode 100644 index 000000000..bc2abe8c3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_repositories_put_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemDependabotSecretsItemRepositoriesPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + selected_repository_ids []int32 +} +// NewItemDependabotSecretsItemRepositoriesPutRequestBody instantiates a new ItemDependabotSecretsItemRepositoriesPutRequestBody and sets the default values. +func NewItemDependabotSecretsItemRepositoriesPutRequestBody()(*ItemDependabotSecretsItemRepositoriesPutRequestBody) { + m := &ItemDependabotSecretsItemRepositoriesPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDependabotSecretsItemRepositoriesPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDependabotSecretsItemRepositoriesPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDependabotSecretsItemRepositoriesPutRequestBody(), 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 *ItemDependabotSecretsItemRepositoriesPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemDependabotSecretsItemRepositoriesPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["selected_repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetSelectedRepositoryIds(res) + } + return nil + } + return res +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. +// returns a []int32 when successful +func (m *ItemDependabotSecretsItemRepositoriesPutRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *ItemDependabotSecretsItemRepositoriesPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + 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 *ItemDependabotSecretsItemRepositoriesPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. +func (m *ItemDependabotSecretsItemRepositoriesPutRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +type ItemDependabotSecretsItemRepositoriesPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedRepositoryIds()([]int32) + SetSelectedRepositoryIds(value []int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_repositories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_repositories_request_builder.go new file mode 100644 index 000000000..349d16b7f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_repositories_request_builder.go @@ -0,0 +1,100 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemDependabotSecretsItemRepositoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\dependabot\secrets\{secret_name}\repositories +type ItemDependabotSecretsItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemDependabotSecretsItemRepositoriesRequestBuilderGetQueryParameters lists all repositories that have been selected when the `visibility`for repository access to a secret is set to `selected`.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemDependabotSecretsItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRepository_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.dependabot.secrets.item.repositories.item collection +// returns a *ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemDependabotSecretsItemRepositoriesRequestBuilder) ByRepository_id(repository_id int32)(*ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["repository_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(repository_id), 10) + return NewItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDependabotSecretsItemRepositoriesRequestBuilderInternal instantiates a new ItemDependabotSecretsItemRepositoriesRequestBuilder and sets the default values. +func NewItemDependabotSecretsItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsItemRepositoriesRequestBuilder) { + m := &ItemDependabotSecretsItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/dependabot/secrets/{secret_name}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemDependabotSecretsItemRepositoriesRequestBuilder instantiates a new ItemDependabotSecretsItemRepositoriesRequestBuilder and sets the default values. +func NewItemDependabotSecretsItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotSecretsItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all repositories that have been selected when the `visibility`for repository access to a secret is set to `selected`.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemDependabotSecretsItemRepositoriesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret +func (m *ItemDependabotSecretsItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDependabotSecretsItemRepositoriesRequestBuilderGetQueryParameters])(ItemDependabotSecretsItemRepositoriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemDependabotSecretsItemRepositoriesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemDependabotSecretsItemRepositoriesGetResponseable), nil +} +// Put replaces all repositories for an organization secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret +func (m *ItemDependabotSecretsItemRepositoriesRequestBuilder) Put(ctx context.Context, body ItemDependabotSecretsItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation lists all repositories that have been selected when the `visibility`for repository access to a secret is set to `selected`.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotSecretsItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDependabotSecretsItemRepositoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation replaces all repositories for an organization secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotSecretsItemRepositoriesRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemDependabotSecretsItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemDependabotSecretsItemRepositoriesRequestBuilder when successful +func (m *ItemDependabotSecretsItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemDependabotSecretsItemRepositoriesRequestBuilder) { + return NewItemDependabotSecretsItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_repositories_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_repositories_response.go new file mode 100644 index 000000000..96965ac85 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_repositories_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemDependabotSecretsItemRepositoriesResponse +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type ItemDependabotSecretsItemRepositoriesResponse struct { + ItemDependabotSecretsItemRepositoriesGetResponse +} +// NewItemDependabotSecretsItemRepositoriesResponse instantiates a new ItemDependabotSecretsItemRepositoriesResponse and sets the default values. +func NewItemDependabotSecretsItemRepositoriesResponse()(*ItemDependabotSecretsItemRepositoriesResponse) { + m := &ItemDependabotSecretsItemRepositoriesResponse{ + ItemDependabotSecretsItemRepositoriesGetResponse: *NewItemDependabotSecretsItemRepositoriesGetResponse(), + } + return m +} +// CreateItemDependabotSecretsItemRepositoriesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemDependabotSecretsItemRepositoriesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDependabotSecretsItemRepositoriesResponse(), nil +} +// ItemDependabotSecretsItemRepositoriesResponseable +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type ItemDependabotSecretsItemRepositoriesResponseable interface { + ItemDependabotSecretsItemRepositoriesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_repositories_with_repository_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_repositories_with_repository_item_request_builder.go new file mode 100644 index 000000000..3cad1a533 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_repositories_with_repository_item_request_builder.go @@ -0,0 +1,73 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\dependabot\secrets\{secret_name}\repositories\{repository_id} +type ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal instantiates a new ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + m := &ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}", pathParameters), + } + return m +} +// NewItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder instantiates a new ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a repository from an organization secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret +func (m *ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put adds a repository to an organization secret when the `visibility` forrepository access is set to `selected`. The visibility is set when you [Create orupdate an organization secret](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret +func (m *ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a repository from an organization secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToPutRequestInformation adds a repository to an organization secret when the `visibility` forrepository access is set to `selected`. The visibility is set when you [Create orupdate an organization secret](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + return NewItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_with_secret_name_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_with_secret_name_put_request_body.go new file mode 100644 index 000000000..af07b23e7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_item_with_secret_name_put_request_body.go @@ -0,0 +1,144 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemDependabotSecretsItemWithSecret_namePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key) endpoint. + encrypted_value *string + // ID of the key you used to encrypt the secret. + key_id *string + // An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + selected_repository_ids []string +} +// NewItemDependabotSecretsItemWithSecret_namePutRequestBody instantiates a new ItemDependabotSecretsItemWithSecret_namePutRequestBody and sets the default values. +func NewItemDependabotSecretsItemWithSecret_namePutRequestBody()(*ItemDependabotSecretsItemWithSecret_namePutRequestBody) { + m := &ItemDependabotSecretsItemWithSecret_namePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDependabotSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDependabotSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDependabotSecretsItemWithSecret_namePutRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemDependabotSecretsItemWithSecret_namePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncryptedValue gets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key) endpoint. +// returns a *string when successful +func (m *ItemDependabotSecretsItemWithSecret_namePutRequestBody) GetEncryptedValue()(*string) { + return m.encrypted_value +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemDependabotSecretsItemWithSecret_namePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["encrypted_value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncryptedValue(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + res["selected_repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetSelectedRepositoryIds(res) + } + return nil + } + return res +} +// GetKeyId gets the key_id property value. ID of the key you used to encrypt the secret. +// returns a *string when successful +func (m *ItemDependabotSecretsItemWithSecret_namePutRequestBody) GetKeyId()(*string) { + return m.key_id +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. +// returns a []string when successful +func (m *ItemDependabotSecretsItemWithSecret_namePutRequestBody) GetSelectedRepositoryIds()([]string) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *ItemDependabotSecretsItemWithSecret_namePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("encrypted_value", m.GetEncryptedValue()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfStringValues("selected_repository_ids", m.GetSelectedRepositoryIds()) + 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 *ItemDependabotSecretsItemWithSecret_namePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncryptedValue sets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key) endpoint. +func (m *ItemDependabotSecretsItemWithSecret_namePutRequestBody) SetEncryptedValue(value *string)() { + m.encrypted_value = value +} +// SetKeyId sets the key_id property value. ID of the key you used to encrypt the secret. +func (m *ItemDependabotSecretsItemWithSecret_namePutRequestBody) SetKeyId(value *string)() { + m.key_id = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. +func (m *ItemDependabotSecretsItemWithSecret_namePutRequestBody) SetSelectedRepositoryIds(value []string)() { + m.selected_repository_ids = value +} +type ItemDependabotSecretsItemWithSecret_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncryptedValue()(*string) + GetKeyId()(*string) + GetSelectedRepositoryIds()([]string) + SetEncryptedValue(value *string)() + SetKeyId(value *string)() + SetSelectedRepositoryIds(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_public_key_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_public_key_request_builder.go new file mode 100644 index 000000000..f5ee91467 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_public_key_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemDependabotSecretsPublicKeyRequestBuilder builds and executes requests for operations under \orgs\{org}\dependabot\secrets\public-key +type ItemDependabotSecretsPublicKeyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemDependabotSecretsPublicKeyRequestBuilderInternal instantiates a new ItemDependabotSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemDependabotSecretsPublicKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsPublicKeyRequestBuilder) { + m := &ItemDependabotSecretsPublicKeyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/dependabot/secrets/public-key", pathParameters), + } + return m +} +// NewItemDependabotSecretsPublicKeyRequestBuilder instantiates a new ItemDependabotSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemDependabotSecretsPublicKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsPublicKeyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotSecretsPublicKeyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a DependabotPublicKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key +func (m *ItemDependabotSecretsPublicKeyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotPublicKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDependabotPublicKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotPublicKeyable), nil +} +// ToGetRequestInformation gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotSecretsPublicKeyRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemDependabotSecretsPublicKeyRequestBuilder when successful +func (m *ItemDependabotSecretsPublicKeyRequestBuilder) WithUrl(rawUrl string)(*ItemDependabotSecretsPublicKeyRequestBuilder) { + return NewItemDependabotSecretsPublicKeyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_request_builder.go new file mode 100644 index 000000000..320da862b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_request_builder.go @@ -0,0 +1,80 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemDependabotSecretsRequestBuilder builds and executes requests for operations under \orgs\{org}\dependabot\secrets +type ItemDependabotSecretsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemDependabotSecretsRequestBuilderGetQueryParameters lists all secrets available in an organization without revealing theirencrypted values.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemDependabotSecretsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// BySecret_name gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.dependabot.secrets.item collection +// returns a *ItemDependabotSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemDependabotSecretsRequestBuilder) BySecret_name(secret_name string)(*ItemDependabotSecretsWithSecret_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if secret_name != "" { + urlTplParams["secret_name"] = secret_name + } + return NewItemDependabotSecretsWithSecret_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDependabotSecretsRequestBuilderInternal instantiates a new ItemDependabotSecretsRequestBuilder and sets the default values. +func NewItemDependabotSecretsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsRequestBuilder) { + m := &ItemDependabotSecretsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/dependabot/secrets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemDependabotSecretsRequestBuilder instantiates a new ItemDependabotSecretsRequestBuilder and sets the default values. +func NewItemDependabotSecretsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotSecretsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all secrets available in an organization without revealing theirencrypted values.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemDependabotSecretsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets +func (m *ItemDependabotSecretsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDependabotSecretsRequestBuilderGetQueryParameters])(ItemDependabotSecretsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemDependabotSecretsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemDependabotSecretsGetResponseable), nil +} +// PublicKey the publicKey property +// returns a *ItemDependabotSecretsPublicKeyRequestBuilder when successful +func (m *ItemDependabotSecretsRequestBuilder) PublicKey()(*ItemDependabotSecretsPublicKeyRequestBuilder) { + return NewItemDependabotSecretsPublicKeyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all secrets available in an organization without revealing theirencrypted values.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotSecretsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDependabotSecretsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemDependabotSecretsRequestBuilder when successful +func (m *ItemDependabotSecretsRequestBuilder) WithUrl(rawUrl string)(*ItemDependabotSecretsRequestBuilder) { + return NewItemDependabotSecretsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_response.go new file mode 100644 index 000000000..f2bcb157b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemDependabotSecretsResponse +// Deprecated: This class is obsolete. Use secretsGetResponse instead. +type ItemDependabotSecretsResponse struct { + ItemDependabotSecretsGetResponse +} +// NewItemDependabotSecretsResponse instantiates a new ItemDependabotSecretsResponse and sets the default values. +func NewItemDependabotSecretsResponse()(*ItemDependabotSecretsResponse) { + m := &ItemDependabotSecretsResponse{ + ItemDependabotSecretsGetResponse: *NewItemDependabotSecretsGetResponse(), + } + return m +} +// CreateItemDependabotSecretsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemDependabotSecretsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDependabotSecretsResponse(), nil +} +// ItemDependabotSecretsResponseable +// Deprecated: This class is obsolete. Use secretsGetResponse instead. +type ItemDependabotSecretsResponseable interface { + ItemDependabotSecretsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_with_secret_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_with_secret_name_item_request_builder.go new file mode 100644 index 000000000..277830b67 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_dependabot_secrets_with_secret_name_item_request_builder.go @@ -0,0 +1,115 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemDependabotSecretsWithSecret_nameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\dependabot\secrets\{secret_name} +type ItemDependabotSecretsWithSecret_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemDependabotSecretsWithSecret_nameItemRequestBuilderInternal instantiates a new ItemDependabotSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemDependabotSecretsWithSecret_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsWithSecret_nameItemRequestBuilder) { + m := &ItemDependabotSecretsWithSecret_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/dependabot/secrets/{secret_name}", pathParameters), + } + return m +} +// NewItemDependabotSecretsWithSecret_nameItemRequestBuilder instantiates a new ItemDependabotSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemDependabotSecretsWithSecret_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsWithSecret_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotSecretsWithSecret_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a secret in an organization using the secret name.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret +func (m *ItemDependabotSecretsWithSecret_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a single organization secret without revealing its encrypted value.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a OrganizationDependabotSecretable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret +func (m *ItemDependabotSecretsWithSecret_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationDependabotSecretable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationDependabotSecretFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationDependabotSecretable), nil +} +// Put creates or updates an organization secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret +func (m *ItemDependabotSecretsWithSecret_nameItemRequestBuilder) Put(ctx context.Context, body ItemDependabotSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// Repositories the repositories property +// returns a *ItemDependabotSecretsItemRepositoriesRequestBuilder when successful +func (m *ItemDependabotSecretsWithSecret_nameItemRequestBuilder) Repositories()(*ItemDependabotSecretsItemRepositoriesRequestBuilder) { + return NewItemDependabotSecretsItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a secret in an organization using the secret name.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotSecretsWithSecret_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a single organization secret without revealing its encrypted value.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotSecretsWithSecret_nameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation creates or updates an organization secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotSecretsWithSecret_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemDependabotSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemDependabotSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemDependabotSecretsWithSecret_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemDependabotSecretsWithSecret_nameItemRequestBuilder) { + return NewItemDependabotSecretsWithSecret_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_docker_conflicts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_docker_conflicts_request_builder.go new file mode 100644 index 000000000..82ae65114 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_docker_conflicts_request_builder.go @@ -0,0 +1,66 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemDockerConflictsRequestBuilder builds and executes requests for operations under \orgs\{org}\docker\conflicts +type ItemDockerConflictsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemDockerConflictsRequestBuilderInternal instantiates a new ItemDockerConflictsRequestBuilder and sets the default values. +func NewItemDockerConflictsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDockerConflictsRequestBuilder) { + m := &ItemDockerConflictsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/docker/conflicts", pathParameters), + } + return m +} +// NewItemDockerConflictsRequestBuilder instantiates a new ItemDockerConflictsRequestBuilder and sets the default values. +func NewItemDockerConflictsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDockerConflictsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDockerConflictsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all packages that are in a specific organization, are readable by the requesting user, and that encountered a conflict during a Docker migration.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. +// returns a []PackageEscapedable 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/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-organization +func (m *ItemDockerConflictsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePackageEscapedFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable) + } + } + return val, nil +} +// ToGetRequestInformation lists all packages that are in a specific organization, are readable by the requesting user, and that encountered a conflict during a Docker migration.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDockerConflictsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemDockerConflictsRequestBuilder when successful +func (m *ItemDockerConflictsRequestBuilder) WithUrl(rawUrl string)(*ItemDockerConflictsRequestBuilder) { + return NewItemDockerConflictsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_docker_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_docker_request_builder.go new file mode 100644 index 000000000..31f379113 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_docker_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemDockerRequestBuilder builds and executes requests for operations under \orgs\{org}\docker +type ItemDockerRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Conflicts the conflicts property +// returns a *ItemDockerConflictsRequestBuilder when successful +func (m *ItemDockerRequestBuilder) Conflicts()(*ItemDockerConflictsRequestBuilder) { + return NewItemDockerConflictsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDockerRequestBuilderInternal instantiates a new ItemDockerRequestBuilder and sets the default values. +func NewItemDockerRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDockerRequestBuilder) { + m := &ItemDockerRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/docker", pathParameters), + } + return m +} +// NewItemDockerRequestBuilder instantiates a new ItemDockerRequestBuilder and sets the default values. +func NewItemDockerRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDockerRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDockerRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_events_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_events_request_builder.go new file mode 100644 index 000000000..f28f1d2d2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_events_request_builder.go @@ -0,0 +1,66 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemEventsRequestBuilder builds and executes requests for operations under \orgs\{org}\events +type ItemEventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemEventsRequestBuilderGetQueryParameters list public organization events +type ItemEventsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemEventsRequestBuilderInternal instantiates a new ItemEventsRequestBuilder and sets the default values. +func NewItemEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsRequestBuilder) { + m := &ItemEventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/events{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemEventsRequestBuilder instantiates a new ItemEventsRequestBuilder and sets the default values. +func NewItemEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemEventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list public organization events +// returns a []Eventable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/events#list-public-organization-events +func (m *ItemEventsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEventsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEventFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable) + } + } + return val, nil +} +// returns a *RequestInformation when successful +func (m *ItemEventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEventsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemEventsRequestBuilder when successful +func (m *ItemEventsRequestBuilder) WithUrl(rawUrl string)(*ItemEventsRequestBuilder) { + return NewItemEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_failed_invitations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_failed_invitations_request_builder.go new file mode 100644 index 000000000..cedfda098 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_failed_invitations_request_builder.go @@ -0,0 +1,71 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemFailed_invitationsRequestBuilder builds and executes requests for operations under \orgs\{org}\failed_invitations +type ItemFailed_invitationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemFailed_invitationsRequestBuilderGetQueryParameters the return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure. +type ItemFailed_invitationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemFailed_invitationsRequestBuilderInternal instantiates a new ItemFailed_invitationsRequestBuilder and sets the default values. +func NewItemFailed_invitationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemFailed_invitationsRequestBuilder) { + m := &ItemFailed_invitationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/failed_invitations{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemFailed_invitationsRequestBuilder instantiates a new ItemFailed_invitationsRequestBuilder and sets the default values. +func NewItemFailed_invitationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemFailed_invitationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemFailed_invitationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get the return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure. +// returns a []OrganizationInvitationable 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/orgs/members#list-failed-organization-invitations +func (m *ItemFailed_invitationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemFailed_invitationsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationInvitationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationInvitationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationInvitationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationInvitationable) + } + } + return val, nil +} +// ToGetRequestInformation the return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure. +// returns a *RequestInformation when successful +func (m *ItemFailed_invitationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemFailed_invitationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemFailed_invitationsRequestBuilder when successful +func (m *ItemFailed_invitationsRequestBuilder) WithUrl(rawUrl string)(*ItemFailed_invitationsRequestBuilder) { + return NewItemFailed_invitationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_config_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_config_patch_request_body.go new file mode 100644 index 000000000..360355180 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_config_patch_request_body.go @@ -0,0 +1,168 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemHooksItemConfigPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // The insecure_ssl property + insecure_ssl i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). + secret *string + // The URL to which the payloads will be delivered. + url *string +} +// NewItemHooksItemConfigPatchRequestBody instantiates a new ItemHooksItemConfigPatchRequestBody and sets the default values. +func NewItemHooksItemConfigPatchRequestBody()(*ItemHooksItemConfigPatchRequestBody) { + m := &ItemHooksItemConfigPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemHooksItemConfigPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemHooksItemConfigPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemHooksItemConfigPatchRequestBody(), 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 *ItemHooksItemConfigPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +// returns a *string when successful +func (m *ItemHooksItemConfigPatchRequestBody) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemHooksItemConfigPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWebhookConfigInsecureSslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a WebhookConfigInsecureSslable when successful +func (m *ItemHooksItemConfigPatchRequestBody) GetInsecureSsl()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable) { + return m.insecure_ssl +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +// returns a *string when successful +func (m *ItemHooksItemConfigPatchRequestBody) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +// returns a *string when successful +func (m *ItemHooksItemConfigPatchRequestBody) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ItemHooksItemConfigPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ItemHooksItemConfigPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *ItemHooksItemConfigPatchRequestBody) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *ItemHooksItemConfigPatchRequestBody) SetInsecureSsl(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)() { + m.insecure_ssl = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +func (m *ItemHooksItemConfigPatchRequestBody) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *ItemHooksItemConfigPatchRequestBody) SetUrl(value *string)() { + m.url = value +} +type ItemHooksItemConfigPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable) + GetSecret()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_config_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_config_request_builder.go new file mode 100644 index 000000000..0777ea93f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_config_request_builder.go @@ -0,0 +1,88 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemHooksItemConfigRequestBuilder builds and executes requests for operations under \orgs\{org}\hooks\{hook_id}\config +type ItemHooksItemConfigRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemHooksItemConfigRequestBuilderInternal instantiates a new ItemHooksItemConfigRequestBuilder and sets the default values. +func NewItemHooksItemConfigRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemConfigRequestBuilder) { + m := &ItemHooksItemConfigRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/hooks/{hook_id}/config", pathParameters), + } + return m +} +// NewItemHooksItemConfigRequestBuilder instantiates a new ItemHooksItemConfigRequestBuilder and sets the default values. +func NewItemHooksItemConfigRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemConfigRequestBuilder) { + urlParams := make(map[string]string) + 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)."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 editwebhooks 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] +// +// [API method documentation]: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization +func (m *ItemHooksItemConfigRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWebhookConfigFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + 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)."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 editwebhooks 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] +// +// [API method documentation]: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization +func (m *ItemHooksItemConfigRequestBuilder) Patch(ctx context.Context, body ItemHooksItemConfigPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWebhookConfigFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + 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)."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 editwebhooks 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) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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)."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 editwebhooks 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) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemHooksItemConfigRequestBuilder when successful +func (m *ItemHooksItemConfigRequestBuilder) WithUrl(rawUrl string)(*ItemHooksItemConfigRequestBuilder) { + return NewItemHooksItemConfigRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_post_response.go new file mode 100644 index 000000000..f82829720 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_post_response.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemHooksItemDeliveriesItemAttemptsPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemHooksItemDeliveriesItemAttemptsPostResponse instantiates a new ItemHooksItemDeliveriesItemAttemptsPostResponse and sets the default values. +func NewItemHooksItemDeliveriesItemAttemptsPostResponse()(*ItemHooksItemDeliveriesItemAttemptsPostResponse) { + m := &ItemHooksItemDeliveriesItemAttemptsPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemHooksItemDeliveriesItemAttemptsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemHooksItemDeliveriesItemAttemptsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemHooksItemDeliveriesItemAttemptsPostResponse(), 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 *ItemHooksItemDeliveriesItemAttemptsPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemHooksItemDeliveriesItemAttemptsPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemHooksItemDeliveriesItemAttemptsPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemHooksItemDeliveriesItemAttemptsPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemHooksItemDeliveriesItemAttemptsPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_request_builder.go new file mode 100644 index 000000000..d1e9a5a24 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_request_builder.go @@ -0,0 +1,63 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemHooksItemDeliveriesItemAttemptsRequestBuilder builds and executes requests for operations under \orgs\{org}\hooks\{hook_id}\deliveries\{delivery_id}\attempts +type ItemHooksItemDeliveriesItemAttemptsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemHooksItemDeliveriesItemAttemptsRequestBuilderInternal instantiates a new ItemHooksItemDeliveriesItemAttemptsRequestBuilder and sets the default values. +func NewItemHooksItemDeliveriesItemAttemptsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemDeliveriesItemAttemptsRequestBuilder) { + m := &ItemHooksItemDeliveriesItemAttemptsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts", pathParameters), + } + return m +} +// NewItemHooksItemDeliveriesItemAttemptsRequestBuilder instantiates a new ItemHooksItemDeliveriesItemAttemptsRequestBuilder and sets the default values. +func NewItemHooksItemDeliveriesItemAttemptsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemDeliveriesItemAttemptsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemHooksItemDeliveriesItemAttemptsRequestBuilderInternal(urlParams, requestAdapter) +} +// 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 editwebhooks 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook +func (m *ItemHooksItemDeliveriesItemAttemptsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemHooksItemDeliveriesItemAttemptsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemHooksItemDeliveriesItemAttemptsPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemHooksItemDeliveriesItemAttemptsPostResponseable), nil +} +// 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 editwebhooks 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) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemHooksItemDeliveriesItemAttemptsRequestBuilder when successful +func (m *ItemHooksItemDeliveriesItemAttemptsRequestBuilder) WithUrl(rawUrl string)(*ItemHooksItemDeliveriesItemAttemptsRequestBuilder) { + return NewItemHooksItemDeliveriesItemAttemptsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_response.go new file mode 100644 index 000000000..d3a457040 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemHooksItemDeliveriesItemAttemptsResponse +// Deprecated: This class is obsolete. Use attemptsPostResponse instead. +type ItemHooksItemDeliveriesItemAttemptsResponse struct { + ItemHooksItemDeliveriesItemAttemptsPostResponse +} +// NewItemHooksItemDeliveriesItemAttemptsResponse instantiates a new ItemHooksItemDeliveriesItemAttemptsResponse and sets the default values. +func NewItemHooksItemDeliveriesItemAttemptsResponse()(*ItemHooksItemDeliveriesItemAttemptsResponse) { + m := &ItemHooksItemDeliveriesItemAttemptsResponse{ + ItemHooksItemDeliveriesItemAttemptsPostResponse: *NewItemHooksItemDeliveriesItemAttemptsPostResponse(), + } + return m +} +// CreateItemHooksItemDeliveriesItemAttemptsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemHooksItemDeliveriesItemAttemptsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemHooksItemDeliveriesItemAttemptsResponse(), nil +} +// ItemHooksItemDeliveriesItemAttemptsResponseable +// Deprecated: This class is obsolete. Use attemptsPostResponse instead. +type ItemHooksItemDeliveriesItemAttemptsResponseable interface { + ItemHooksItemDeliveriesItemAttemptsPostResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_deliveries_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_deliveries_request_builder.go new file mode 100644 index 000000000..c4a92a64d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_deliveries_request_builder.go @@ -0,0 +1,85 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemHooksItemDeliveriesRequestBuilder builds and executes requests for operations under \orgs\{org}\hooks\{hook_id}\deliveries +type ItemHooksItemDeliveriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// 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 editwebhooks 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"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + Redelivery *bool `uriparametername:"redelivery"` +} +// ByDelivery_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.hooks.item.deliveries.item collection +// returns a *ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder when successful +func (m *ItemHooksItemDeliveriesRequestBuilder) ByDelivery_id(delivery_id int32)(*ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["delivery_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(delivery_id), 10) + return NewItemHooksItemDeliveriesWithDelivery_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemHooksItemDeliveriesRequestBuilderInternal instantiates a new ItemHooksItemDeliveriesRequestBuilder and sets the default values. +func NewItemHooksItemDeliveriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemDeliveriesRequestBuilder) { + m := &ItemHooksItemDeliveriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/hooks/{hook_id}/deliveries{?cursor*,per_page*,redelivery*}", pathParameters), + } + return m +} +// NewItemHooksItemDeliveriesRequestBuilder instantiates a new ItemHooksItemDeliveriesRequestBuilder and sets the default values. +func NewItemHooksItemDeliveriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemDeliveriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemHooksItemDeliveriesRequestBuilderInternal(urlParams, requestAdapter) +} +// 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 editwebhooks 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook +func (m *ItemHooksItemDeliveriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemHooksItemDeliveriesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.HookDeliveryItemable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateHookDeliveryItemFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.HookDeliveryItemable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.HookDeliveryItemable) + } + } + return val, nil +} +// 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 editwebhooks 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) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemHooksItemDeliveriesRequestBuilder when successful +func (m *ItemHooksItemDeliveriesRequestBuilder) WithUrl(rawUrl string)(*ItemHooksItemDeliveriesRequestBuilder) { + return NewItemHooksItemDeliveriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_deliveries_with_delivery_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_deliveries_with_delivery_item_request_builder.go new file mode 100644 index 000000000..403eb78cf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_deliveries_with_delivery_item_request_builder.go @@ -0,0 +1,68 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\hooks\{hook_id}\deliveries\{delivery_id} +type ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Attempts the attempts property +// returns a *ItemHooksItemDeliveriesItemAttemptsRequestBuilder when successful +func (m *ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) Attempts()(*ItemHooksItemDeliveriesItemAttemptsRequestBuilder) { + return NewItemHooksItemDeliveriesItemAttemptsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemHooksItemDeliveriesWithDelivery_ItemRequestBuilderInternal instantiates a new ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder and sets the default values. +func NewItemHooksItemDeliveriesWithDelivery_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) { + m := &ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}", pathParameters), + } + return m +} +// NewItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder instantiates a new ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder and sets the default values. +func NewItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemHooksItemDeliveriesWithDelivery_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// 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 editwebhooks 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook +func (m *ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.HookDeliveryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateHookDeliveryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.HookDeliveryable), nil +} +// 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 editwebhooks 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) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder when successful +func (m *ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) { + return NewItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_pings_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_pings_request_builder.go new file mode 100644 index 000000000..bb632744b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_pings_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemHooksItemPingsRequestBuilder builds and executes requests for operations under \orgs\{org}\hooks\{hook_id}\pings +type ItemHooksItemPingsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemHooksItemPingsRequestBuilderInternal instantiates a new ItemHooksItemPingsRequestBuilder and sets the default values. +func NewItemHooksItemPingsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemPingsRequestBuilder) { + m := &ItemHooksItemPingsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/hooks/{hook_id}/pings", pathParameters), + } + return m +} +// NewItemHooksItemPingsRequestBuilder instantiates a new ItemHooksItemPingsRequestBuilder and sets the default values. +func NewItemHooksItemPingsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemPingsRequestBuilder) { + urlParams := make(map[string]string) + 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.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 editwebhooks 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] +// +// [API method documentation]: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook +func (m *ItemHooksItemPingsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// 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 editwebhooks 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) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemHooksItemPingsRequestBuilder when successful +func (m *ItemHooksItemPingsRequestBuilder) WithUrl(rawUrl string)(*ItemHooksItemPingsRequestBuilder) { + return NewItemHooksItemPingsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_with_hook_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_with_hook_patch_request_body.go new file mode 100644 index 000000000..63f3a7155 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_with_hook_patch_request_body.go @@ -0,0 +1,173 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemHooksItemWithHook_PatchRequestBody struct { + // Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + active *bool + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Key/value pairs to provide settings for this webhook. + config ItemHooksItemWithHook_PatchRequestBody_configable + // Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. + events []string + // The name property + name *string +} +// NewItemHooksItemWithHook_PatchRequestBody instantiates a new ItemHooksItemWithHook_PatchRequestBody and sets the default values. +func NewItemHooksItemWithHook_PatchRequestBody()(*ItemHooksItemWithHook_PatchRequestBody) { + m := &ItemHooksItemWithHook_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemHooksItemWithHook_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemHooksItemWithHook_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemHooksItemWithHook_PatchRequestBody(), nil +} +// GetActive gets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +// returns a *bool when successful +func (m *ItemHooksItemWithHook_PatchRequestBody) GetActive()(*bool) { + return m.active +} +// 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 *ItemHooksItemWithHook_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfig gets the config property value. Key/value pairs to provide settings for this webhook. +// returns a ItemHooksItemWithHook_PatchRequestBody_configable when successful +func (m *ItemHooksItemWithHook_PatchRequestBody) GetConfig()(ItemHooksItemWithHook_PatchRequestBody_configable) { + return m.config +} +// GetEvents gets the events property value. Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. +// returns a []string when successful +func (m *ItemHooksItemWithHook_PatchRequestBody) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemHooksItemWithHook_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemHooksItemWithHook_PatchRequestBody_configFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfig(val.(ItemHooksItemWithHook_PatchRequestBody_configable)) + } + return nil + } + res["events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetEvents(res) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *ItemHooksItemWithHook_PatchRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemHooksItemWithHook_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("config", m.GetConfig()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActive sets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +func (m *ItemHooksItemWithHook_PatchRequestBody) SetActive(value *bool)() { + m.active = value +} +// 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 *ItemHooksItemWithHook_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfig sets the config property value. Key/value pairs to provide settings for this webhook. +func (m *ItemHooksItemWithHook_PatchRequestBody) SetConfig(value ItemHooksItemWithHook_PatchRequestBody_configable)() { + m.config = value +} +// SetEvents sets the events property value. Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. +func (m *ItemHooksItemWithHook_PatchRequestBody) SetEvents(value []string)() { + m.events = value +} +// SetName sets the name property value. The name property +func (m *ItemHooksItemWithHook_PatchRequestBody) SetName(value *string)() { + m.name = value +} +type ItemHooksItemWithHook_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetConfig()(ItemHooksItemWithHook_PatchRequestBody_configable) + GetEvents()([]string) + GetName()(*string) + SetActive(value *bool)() + SetConfig(value ItemHooksItemWithHook_PatchRequestBody_configable)() + SetEvents(value []string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_with_hook_patch_request_body_config.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_with_hook_patch_request_body_config.go new file mode 100644 index 000000000..90e1d415d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_item_with_hook_patch_request_body_config.go @@ -0,0 +1,169 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemHooksItemWithHook_PatchRequestBody_config key/value pairs to provide settings for this webhook. +type ItemHooksItemWithHook_PatchRequestBody_config struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // The insecure_ssl property + insecure_ssl i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). + secret *string + // The URL to which the payloads will be delivered. + url *string +} +// NewItemHooksItemWithHook_PatchRequestBody_config instantiates a new ItemHooksItemWithHook_PatchRequestBody_config and sets the default values. +func NewItemHooksItemWithHook_PatchRequestBody_config()(*ItemHooksItemWithHook_PatchRequestBody_config) { + m := &ItemHooksItemWithHook_PatchRequestBody_config{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemHooksItemWithHook_PatchRequestBody_configFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemHooksItemWithHook_PatchRequestBody_configFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemHooksItemWithHook_PatchRequestBody_config(), 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 *ItemHooksItemWithHook_PatchRequestBody_config) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +// returns a *string when successful +func (m *ItemHooksItemWithHook_PatchRequestBody_config) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemHooksItemWithHook_PatchRequestBody_config) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWebhookConfigInsecureSslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a WebhookConfigInsecureSslable when successful +func (m *ItemHooksItemWithHook_PatchRequestBody_config) GetInsecureSsl()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable) { + return m.insecure_ssl +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +// returns a *string when successful +func (m *ItemHooksItemWithHook_PatchRequestBody_config) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +// returns a *string when successful +func (m *ItemHooksItemWithHook_PatchRequestBody_config) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ItemHooksItemWithHook_PatchRequestBody_config) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ItemHooksItemWithHook_PatchRequestBody_config) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *ItemHooksItemWithHook_PatchRequestBody_config) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *ItemHooksItemWithHook_PatchRequestBody_config) SetInsecureSsl(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)() { + m.insecure_ssl = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +func (m *ItemHooksItemWithHook_PatchRequestBody_config) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *ItemHooksItemWithHook_PatchRequestBody_config) SetUrl(value *string)() { + m.url = value +} +type ItemHooksItemWithHook_PatchRequestBody_configable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable) + GetSecret()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_post_request_body.go new file mode 100644 index 000000000..232c91b7c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_post_request_body.go @@ -0,0 +1,173 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemHooksPostRequestBody struct { + // Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + active *bool + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Key/value pairs to provide settings for this webhook. + config ItemHooksPostRequestBody_configable + // Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. Set to `["*"]` to receive all possible events. + events []string + // Must be passed as "web". + name *string +} +// NewItemHooksPostRequestBody instantiates a new ItemHooksPostRequestBody and sets the default values. +func NewItemHooksPostRequestBody()(*ItemHooksPostRequestBody) { + m := &ItemHooksPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemHooksPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemHooksPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemHooksPostRequestBody(), nil +} +// GetActive gets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +// returns a *bool when successful +func (m *ItemHooksPostRequestBody) GetActive()(*bool) { + return m.active +} +// 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 *ItemHooksPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfig gets the config property value. Key/value pairs to provide settings for this webhook. +// returns a ItemHooksPostRequestBody_configable when successful +func (m *ItemHooksPostRequestBody) GetConfig()(ItemHooksPostRequestBody_configable) { + return m.config +} +// GetEvents gets the events property value. Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. Set to `["*"]` to receive all possible events. +// returns a []string when successful +func (m *ItemHooksPostRequestBody) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemHooksPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemHooksPostRequestBody_configFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfig(val.(ItemHooksPostRequestBody_configable)) + } + return nil + } + res["events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetEvents(res) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. Must be passed as "web". +// returns a *string when successful +func (m *ItemHooksPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemHooksPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("config", m.GetConfig()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActive sets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +func (m *ItemHooksPostRequestBody) SetActive(value *bool)() { + m.active = value +} +// 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 *ItemHooksPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfig sets the config property value. Key/value pairs to provide settings for this webhook. +func (m *ItemHooksPostRequestBody) SetConfig(value ItemHooksPostRequestBody_configable)() { + m.config = value +} +// SetEvents sets the events property value. Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. Set to `["*"]` to receive all possible events. +func (m *ItemHooksPostRequestBody) SetEvents(value []string)() { + m.events = value +} +// SetName sets the name property value. Must be passed as "web". +func (m *ItemHooksPostRequestBody) SetName(value *string)() { + m.name = value +} +type ItemHooksPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetConfig()(ItemHooksPostRequestBody_configable) + GetEvents()([]string) + GetName()(*string) + SetActive(value *bool)() + SetConfig(value ItemHooksPostRequestBody_configable)() + SetEvents(value []string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_post_request_body_config.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_post_request_body_config.go new file mode 100644 index 000000000..79cdf27e1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_post_request_body_config.go @@ -0,0 +1,227 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemHooksPostRequestBody_config key/value pairs to provide settings for this webhook. +type ItemHooksPostRequestBody_config struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // The insecure_ssl property + insecure_ssl i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable + // The password property + password *string + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). + secret *string + // The URL to which the payloads will be delivered. + url *string + // The username property + username *string +} +// NewItemHooksPostRequestBody_config instantiates a new ItemHooksPostRequestBody_config and sets the default values. +func NewItemHooksPostRequestBody_config()(*ItemHooksPostRequestBody_config) { + m := &ItemHooksPostRequestBody_config{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemHooksPostRequestBody_configFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemHooksPostRequestBody_configFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemHooksPostRequestBody_config(), 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 *ItemHooksPostRequestBody_config) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +// returns a *string when successful +func (m *ItemHooksPostRequestBody_config) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemHooksPostRequestBody_config) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWebhookConfigInsecureSslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)) + } + return nil + } + res["password"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPassword(val) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUsername(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a WebhookConfigInsecureSslable when successful +func (m *ItemHooksPostRequestBody_config) GetInsecureSsl()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable) { + return m.insecure_ssl +} +// GetPassword gets the password property value. The password property +// returns a *string when successful +func (m *ItemHooksPostRequestBody_config) GetPassword()(*string) { + return m.password +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +// returns a *string when successful +func (m *ItemHooksPostRequestBody_config) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +// returns a *string when successful +func (m *ItemHooksPostRequestBody_config) GetUrl()(*string) { + return m.url +} +// GetUsername gets the username property value. The username property +// returns a *string when successful +func (m *ItemHooksPostRequestBody_config) GetUsername()(*string) { + return m.username +} +// Serialize serializes information the current object +func (m *ItemHooksPostRequestBody_config) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("password", m.GetPassword()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("username", m.GetUsername()) + 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 *ItemHooksPostRequestBody_config) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *ItemHooksPostRequestBody_config) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *ItemHooksPostRequestBody_config) SetInsecureSsl(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)() { + m.insecure_ssl = value +} +// SetPassword sets the password property value. The password property +func (m *ItemHooksPostRequestBody_config) SetPassword(value *string)() { + m.password = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +func (m *ItemHooksPostRequestBody_config) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *ItemHooksPostRequestBody_config) SetUrl(value *string)() { + m.url = value +} +// SetUsername sets the username property value. The username property +func (m *ItemHooksPostRequestBody_config) SetUsername(value *string)() { + m.username = value +} +type ItemHooksPostRequestBody_configable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable) + GetPassword()(*string) + GetSecret()(*string) + GetUrl()(*string) + GetUsername()(*string) + SetContentType(value *string)() + SetInsecureSsl(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)() + SetPassword(value *string)() + SetSecret(value *string)() + SetUrl(value *string)() + SetUsername(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_request_builder.go new file mode 100644 index 000000000..97347a477 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_request_builder.go @@ -0,0 +1,119 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemHooksRequestBuilder builds and executes requests for operations under \orgs\{org}\hooks +type ItemHooksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// 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 editwebhooks 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"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByHook_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.hooks.item collection +// returns a *ItemHooksWithHook_ItemRequestBuilder when successful +func (m *ItemHooksRequestBuilder) ByHook_id(hook_id int32)(*ItemHooksWithHook_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["hook_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(hook_id), 10) + return NewItemHooksWithHook_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemHooksRequestBuilderInternal instantiates a new ItemHooksRequestBuilder and sets the default values. +func NewItemHooksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksRequestBuilder) { + m := &ItemHooksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/hooks{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemHooksRequestBuilder instantiates a new ItemHooksRequestBuilder and sets the default values. +func NewItemHooksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemHooksRequestBuilderInternal(urlParams, requestAdapter) +} +// 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 editwebhooks 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] +// +// [API method documentation]: https://docs.github.com/rest/orgs/webhooks#list-organization-webhooks +func (m *ItemHooksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemHooksRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgHookable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgHookFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgHookable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgHookable) + } + } + return val, nil +} +// 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, oredit 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook +func (m *ItemHooksRequestBuilder) Post(ctx context.Context, body ItemHooksPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgHookable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgHookFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + 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 editwebhooks 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) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// 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, oredit 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, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemHooksRequestBuilder when successful +func (m *ItemHooksRequestBuilder) WithUrl(rawUrl string)(*ItemHooksRequestBuilder) { + return NewItemHooksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_with_hook_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_with_hook_item_request_builder.go new file mode 100644 index 000000000..213293bd2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_hooks_with_hook_item_request_builder.go @@ -0,0 +1,140 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemHooksWithHook_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\hooks\{hook_id} +type ItemHooksWithHook_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Config the config property +// returns a *ItemHooksItemConfigRequestBuilder when successful +func (m *ItemHooksWithHook_ItemRequestBuilder) Config()(*ItemHooksItemConfigRequestBuilder) { + return NewItemHooksItemConfigRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemHooksWithHook_ItemRequestBuilderInternal instantiates a new ItemHooksWithHook_ItemRequestBuilder and sets the default values. +func NewItemHooksWithHook_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksWithHook_ItemRequestBuilder) { + m := &ItemHooksWithHook_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/hooks/{hook_id}", pathParameters), + } + return m +} +// NewItemHooksWithHook_ItemRequestBuilder instantiates a new ItemHooksWithHook_ItemRequestBuilder and sets the default values. +func NewItemHooksWithHook_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksWithHook_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemHooksWithHook_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// 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 editwebhooks 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] +// +// [API method documentation]: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook +func (m *ItemHooksWithHook_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Deliveries the deliveries property +// returns a *ItemHooksItemDeliveriesRequestBuilder when successful +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).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 editwebhooks 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] +// +// [API method documentation]: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook +func (m *ItemHooksWithHook_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgHookable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgHookFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + 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 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 editwebhooks 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook +func (m *ItemHooksWithHook_ItemRequestBuilder) Patch(ctx context.Context, body ItemHooksItemWithHook_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgHookable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgHookFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgHookable), nil +} +// Pings the pings property +// returns a *ItemHooksItemPingsRequestBuilder when successful +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 editwebhooks 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) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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).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 editwebhooks 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) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 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 editwebhooks 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) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemHooksWithHook_ItemRequestBuilder when successful +func (m *ItemHooksWithHook_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemHooksWithHook_ItemRequestBuilder) { + return NewItemHooksWithHook_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_installation_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_installation_request_builder.go new file mode 100644 index 000000000..a5c519348 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_installation_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemInstallationRequestBuilder builds and executes requests for operations under \orgs\{org}\installation +type ItemInstallationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemInstallationRequestBuilderInternal instantiates a new ItemInstallationRequestBuilder and sets the default values. +func NewItemInstallationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInstallationRequestBuilder) { + m := &ItemInstallationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/installation", pathParameters), + } + return m +} +// NewItemInstallationRequestBuilder instantiates a new ItemInstallationRequestBuilder and sets the default values. +func NewItemInstallationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInstallationRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemInstallationRequestBuilderInternal(urlParams, requestAdapter) +} +// Get enables an authenticated GitHub App to find the organization's installation information.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a Installationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app +func (m *ItemInstallationRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateInstallationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable), nil +} +// ToGetRequestInformation enables an authenticated GitHub App to find the organization's installation information.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *ItemInstallationRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemInstallationRequestBuilder when successful +func (m *ItemInstallationRequestBuilder) WithUrl(rawUrl string)(*ItemInstallationRequestBuilder) { + return NewItemInstallationRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_installations_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_installations_get_response.go new file mode 100644 index 000000000..e4846228b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_installations_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemInstallationsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The installations property + installations []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable + // The total_count property + total_count *int32 +} +// NewItemInstallationsGetResponse instantiates a new ItemInstallationsGetResponse and sets the default values. +func NewItemInstallationsGetResponse()(*ItemInstallationsGetResponse) { + m := &ItemInstallationsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemInstallationsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemInstallationsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemInstallationsGetResponse(), 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 *ItemInstallationsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemInstallationsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["installations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateInstallationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable) + } + } + m.SetInstallations(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetInstallations gets the installations property value. The installations property +// returns a []Installationable when successful +func (m *ItemInstallationsGetResponse) GetInstallations()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable) { + return m.installations +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemInstallationsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemInstallationsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInstallations() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetInstallations())) + for i, v := range m.GetInstallations() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("installations", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemInstallationsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetInstallations sets the installations property value. The installations property +func (m *ItemInstallationsGetResponse) SetInstallations(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable)() { + m.installations = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemInstallationsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemInstallationsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInstallations()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable) + GetTotalCount()(*int32) + SetInstallations(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_installations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_installations_request_builder.go new file mode 100644 index 000000000..03c32fce0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_installations_request_builder.go @@ -0,0 +1,63 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemInstallationsRequestBuilder builds and executes requests for operations under \orgs\{org}\installations +type ItemInstallationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemInstallationsRequestBuilderGetQueryParameters lists all GitHub Apps in an organization. The installation count includesall GitHub Apps installed on repositories in the organization.The authenticated user must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint. +type ItemInstallationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemInstallationsRequestBuilderInternal instantiates a new ItemInstallationsRequestBuilder and sets the default values. +func NewItemInstallationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInstallationsRequestBuilder) { + m := &ItemInstallationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/installations{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemInstallationsRequestBuilder instantiates a new ItemInstallationsRequestBuilder and sets the default values. +func NewItemInstallationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInstallationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemInstallationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all GitHub Apps in an organization. The installation count includesall GitHub Apps installed on repositories in the organization.The authenticated user must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint. +// returns a ItemInstallationsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization +func (m *ItemInstallationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemInstallationsRequestBuilderGetQueryParameters])(ItemInstallationsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemInstallationsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemInstallationsGetResponseable), nil +} +// ToGetRequestInformation lists all GitHub Apps in an organization. The installation count includesall GitHub Apps installed on repositories in the organization.The authenticated user must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemInstallationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemInstallationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemInstallationsRequestBuilder when successful +func (m *ItemInstallationsRequestBuilder) WithUrl(rawUrl string)(*ItemInstallationsRequestBuilder) { + return NewItemInstallationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_installations_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_installations_response.go new file mode 100644 index 000000000..a9c4ceecf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_installations_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemInstallationsResponse +// Deprecated: This class is obsolete. Use installationsGetResponse instead. +type ItemInstallationsResponse struct { + ItemInstallationsGetResponse +} +// NewItemInstallationsResponse instantiates a new ItemInstallationsResponse and sets the default values. +func NewItemInstallationsResponse()(*ItemInstallationsResponse) { + m := &ItemInstallationsResponse{ + ItemInstallationsGetResponse: *NewItemInstallationsGetResponse(), + } + return m +} +// CreateItemInstallationsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemInstallationsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemInstallationsResponse(), nil +} +// ItemInstallationsResponseable +// Deprecated: This class is obsolete. Use installationsGetResponse instead. +type ItemInstallationsResponseable interface { + ItemInstallationsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_interaction_limits_get_response_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_interaction_limits_get_response_member1.go new file mode 100644 index 000000000..45f51b352 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_interaction_limits_get_response_member1.go @@ -0,0 +1,32 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemInteractionLimitsGetResponseMember1 +type ItemInteractionLimitsGetResponseMember1 struct { +} +// NewItemInteractionLimitsGetResponseMember1 instantiates a new ItemInteractionLimitsGetResponseMember1 and sets the default values. +func NewItemInteractionLimitsGetResponseMember1()(*ItemInteractionLimitsGetResponseMember1) { + m := &ItemInteractionLimitsGetResponseMember1{ + } + return m +} +// CreateItemInteractionLimitsGetResponseMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemInteractionLimitsGetResponseMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemInteractionLimitsGetResponseMember1(), nil +} +// GetFieldDeserializers the deserialization information for the current model +func (m *ItemInteractionLimitsGetResponseMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemInteractionLimitsGetResponseMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// ItemInteractionLimitsGetResponseMember1able +type ItemInteractionLimitsGetResponseMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_interaction_limits_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_interaction_limits_request_builder.go new file mode 100644 index 000000000..df17e86c4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_interaction_limits_request_builder.go @@ -0,0 +1,114 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemInteractionLimitsRequestBuilder builds and executes requests for operations under \orgs\{org}\interaction-limits +type ItemInteractionLimitsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemInteractionLimitsRequestBuilderInternal instantiates a new ItemInteractionLimitsRequestBuilder and sets the default values. +func NewItemInteractionLimitsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInteractionLimitsRequestBuilder) { + m := &ItemInteractionLimitsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/interaction-limits", pathParameters), + } + return m +} +// NewItemInteractionLimitsRequestBuilder instantiates a new ItemInteractionLimitsRequestBuilder and sets the default values. +func NewItemInteractionLimitsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInteractionLimitsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemInteractionLimitsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization +func (m *ItemInteractionLimitsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response. +// returns a InteractionLimitResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/interactions/orgs#get-interaction-restrictions-for-an-organization +func (m *ItemInteractionLimitsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateInteractionLimitResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitResponseable), nil +} +// Put temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization. +// returns a InteractionLimitResponseable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/interactions/orgs#set-interaction-restrictions-for-an-organization +func (m *ItemInteractionLimitsRequestBuilder) Put(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateInteractionLimitResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitResponseable), nil +} +// ToDeleteRequestInformation removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. +// returns a *RequestInformation when successful +func (m *ItemInteractionLimitsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response. +// returns a *RequestInformation when successful +func (m *ItemInteractionLimitsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization. +// returns a *RequestInformation when successful +func (m *ItemInteractionLimitsRequestBuilder) ToPutRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemInteractionLimitsRequestBuilder when successful +func (m *ItemInteractionLimitsRequestBuilder) WithUrl(rawUrl string)(*ItemInteractionLimitsRequestBuilder) { + return NewItemInteractionLimitsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_invitations_item_teams_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_invitations_item_teams_request_builder.go new file mode 100644 index 000000000..2b01c8377 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_invitations_item_teams_request_builder.go @@ -0,0 +1,71 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemInvitationsItemTeamsRequestBuilder builds and executes requests for operations under \orgs\{org}\invitations\{invitation_id}\teams +type ItemInvitationsItemTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemInvitationsItemTeamsRequestBuilderGetQueryParameters list all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. +type ItemInvitationsItemTeamsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemInvitationsItemTeamsRequestBuilderInternal instantiates a new ItemInvitationsItemTeamsRequestBuilder and sets the default values. +func NewItemInvitationsItemTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInvitationsItemTeamsRequestBuilder) { + m := &ItemInvitationsItemTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/invitations/{invitation_id}/teams{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemInvitationsItemTeamsRequestBuilder instantiates a new ItemInvitationsItemTeamsRequestBuilder and sets the default values. +func NewItemInvitationsItemTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInvitationsItemTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemInvitationsItemTeamsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. +// returns a []Teamable 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/orgs/members#list-organization-invitation-teams +func (m *ItemInvitationsItemTeamsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemInvitationsItemTeamsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable) + } + } + return val, nil +} +// ToGetRequestInformation list all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. +// returns a *RequestInformation when successful +func (m *ItemInvitationsItemTeamsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemInvitationsItemTeamsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemInvitationsItemTeamsRequestBuilder when successful +func (m *ItemInvitationsItemTeamsRequestBuilder) WithUrl(rawUrl string)(*ItemInvitationsItemTeamsRequestBuilder) { + return NewItemInvitationsItemTeamsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_invitations_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_invitations_post_request_body.go new file mode 100644 index 000000000..651d2d3c7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_invitations_post_request_body.go @@ -0,0 +1,144 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemInvitationsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. + email *string + // **Required unless you provide `email`**. GitHub user ID for the person you are inviting. + invitee_id *int32 + // Specify IDs for the teams you want to invite new members to. + team_ids []int32 +} +// NewItemInvitationsPostRequestBody instantiates a new ItemInvitationsPostRequestBody and sets the default values. +func NewItemInvitationsPostRequestBody()(*ItemInvitationsPostRequestBody) { + m := &ItemInvitationsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemInvitationsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemInvitationsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemInvitationsPostRequestBody(), 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 *ItemInvitationsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. +// returns a *string when successful +func (m *ItemInvitationsPostRequestBody) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemInvitationsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["invitee_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetInviteeId(val) + } + return nil + } + res["team_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetTeamIds(res) + } + return nil + } + return res +} +// GetInviteeId gets the invitee_id property value. **Required unless you provide `email`**. GitHub user ID for the person you are inviting. +// returns a *int32 when successful +func (m *ItemInvitationsPostRequestBody) GetInviteeId()(*int32) { + return m.invitee_id +} +// GetTeamIds gets the team_ids property value. Specify IDs for the teams you want to invite new members to. +// returns a []int32 when successful +func (m *ItemInvitationsPostRequestBody) GetTeamIds()([]int32) { + return m.team_ids +} +// Serialize serializes information the current object +func (m *ItemInvitationsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("invitee_id", m.GetInviteeId()) + if err != nil { + return err + } + } + if m.GetTeamIds() != nil { + err := writer.WriteCollectionOfInt32Values("team_ids", m.GetTeamIds()) + 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 *ItemInvitationsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. +func (m *ItemInvitationsPostRequestBody) SetEmail(value *string)() { + m.email = value +} +// SetInviteeId sets the invitee_id property value. **Required unless you provide `email`**. GitHub user ID for the person you are inviting. +func (m *ItemInvitationsPostRequestBody) SetInviteeId(value *int32)() { + m.invitee_id = value +} +// SetTeamIds sets the team_ids property value. Specify IDs for the teams you want to invite new members to. +func (m *ItemInvitationsPostRequestBody) SetTeamIds(value []int32)() { + m.team_ids = value +} +type ItemInvitationsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetInviteeId()(*int32) + GetTeamIds()([]int32) + SetEmail(value *string)() + SetInviteeId(value *int32)() + SetTeamIds(value []int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_invitations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_invitations_request_builder.go new file mode 100644 index 000000000..ab974edd8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_invitations_request_builder.go @@ -0,0 +1,124 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i2378633937c404127ad778eb05effbea7eb08f994ef028254c5d6c9a80ce3266 "github.com/octokit/go-sdk/pkg/github/orgs/item/invitations" +) + +// ItemInvitationsRequestBuilder builds and executes requests for operations under \orgs\{org}\invitations +type ItemInvitationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemInvitationsRequestBuilderGetQueryParameters the return hash contains a `role` field which refers to the OrganizationInvitation role and will be one of the following values: `direct_member`, `admin`,`billing_manager`, or `hiring_manager`. If the invitee is not a GitHubmember, the `login` field in the return hash will be `null`. +type ItemInvitationsRequestBuilderGetQueryParameters struct { + // Filter invitations by their invitation source. + Invitation_source *i2378633937c404127ad778eb05effbea7eb08f994ef028254c5d6c9a80ce3266.GetInvitation_sourceQueryParameterType `uriparametername:"invitation_source"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Filter invitations by their member role. + Role *i2378633937c404127ad778eb05effbea7eb08f994ef028254c5d6c9a80ce3266.GetRoleQueryParameterType `uriparametername:"role"` +} +// ByInvitation_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.invitations.item collection +// returns a *ItemInvitationsWithInvitation_ItemRequestBuilder when successful +func (m *ItemInvitationsRequestBuilder) ByInvitation_id(invitation_id int32)(*ItemInvitationsWithInvitation_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["invitation_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(invitation_id), 10) + return NewItemInvitationsWithInvitation_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemInvitationsRequestBuilderInternal instantiates a new ItemInvitationsRequestBuilder and sets the default values. +func NewItemInvitationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInvitationsRequestBuilder) { + m := &ItemInvitationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/invitations{?invitation_source*,page*,per_page*,role*}", pathParameters), + } + return m +} +// NewItemInvitationsRequestBuilder instantiates a new ItemInvitationsRequestBuilder and sets the default values. +func NewItemInvitationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInvitationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemInvitationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get the return hash contains a `role` field which refers to the OrganizationInvitation role and will be one of the following values: `direct_member`, `admin`,`billing_manager`, or `hiring_manager`. If the invitee is not a GitHubmember, the `login` field in the return hash will be `null`. +// returns a []OrganizationInvitationable 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/orgs/members#list-pending-organization-invitations +func (m *ItemInvitationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemInvitationsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationInvitationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationInvitationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationInvitationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationInvitationable) + } + } + return val, nil +} +// Post invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." +// returns a OrganizationInvitationable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/members#create-an-organization-invitation +func (m *ItemInvitationsRequestBuilder) Post(ctx context.Context, body ItemInvitationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationInvitationable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationInvitationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationInvitationable), nil +} +// ToGetRequestInformation the return hash contains a `role` field which refers to the OrganizationInvitation role and will be one of the following values: `direct_member`, `admin`,`billing_manager`, or `hiring_manager`. If the invitee is not a GitHubmember, the `login` field in the return hash will be `null`. +// returns a *RequestInformation when successful +func (m *ItemInvitationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemInvitationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." +// returns a *RequestInformation when successful +func (m *ItemInvitationsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemInvitationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemInvitationsRequestBuilder when successful +func (m *ItemInvitationsRequestBuilder) WithUrl(rawUrl string)(*ItemInvitationsRequestBuilder) { + return NewItemInvitationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_invitations_with_invitation_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_invitations_with_invitation_item_request_builder.go new file mode 100644 index 000000000..65cbced93 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_invitations_with_invitation_item_request_builder.go @@ -0,0 +1,64 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemInvitationsWithInvitation_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\invitations\{invitation_id} +type ItemInvitationsWithInvitation_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemInvitationsWithInvitation_ItemRequestBuilderInternal instantiates a new ItemInvitationsWithInvitation_ItemRequestBuilder and sets the default values. +func NewItemInvitationsWithInvitation_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInvitationsWithInvitation_ItemRequestBuilder) { + m := &ItemInvitationsWithInvitation_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/invitations/{invitation_id}", pathParameters), + } + return m +} +// NewItemInvitationsWithInvitation_ItemRequestBuilder instantiates a new ItemInvitationsWithInvitation_ItemRequestBuilder and sets the default values. +func NewItemInvitationsWithInvitation_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInvitationsWithInvitation_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemInvitationsWithInvitation_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). +// 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] +// +// [API method documentation]: https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation +func (m *ItemInvitationsWithInvitation_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Teams the teams property +// returns a *ItemInvitationsItemTeamsRequestBuilder when successful +func (m *ItemInvitationsWithInvitation_ItemRequestBuilder) Teams()(*ItemInvitationsItemTeamsRequestBuilder) { + return NewItemInvitationsItemTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). +// returns a *RequestInformation when successful +func (m *ItemInvitationsWithInvitation_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemInvitationsWithInvitation_ItemRequestBuilder when successful +func (m *ItemInvitationsWithInvitation_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemInvitationsWithInvitation_ItemRequestBuilder) { + return NewItemInvitationsWithInvitation_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_issues_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_issues_request_builder.go new file mode 100644 index 000000000..cc93c7b6e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_issues_request_builder.go @@ -0,0 +1,85 @@ +package orgs + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i5fc0bd3a41c40893d6db047c6304f8cbbf6705145bc486be813627a94bd7e2b3 "github.com/octokit/go-sdk/pkg/github/orgs/item/issues" +) + +// ItemIssuesRequestBuilder builds and executes requests for operations under \orgs\{org}\issues +type ItemIssuesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemIssuesRequestBuilderGetQueryParameters list issues in an organization assigned to the authenticated user.**Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For thisreason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests bythe `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pullrequest id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemIssuesRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i5fc0bd3a41c40893d6db047c6304f8cbbf6705145bc486be813627a94bd7e2b3.GetDirectionQueryParameterType `uriparametername:"direction"` + // Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation. + Filter *i5fc0bd3a41c40893d6db047c6304f8cbbf6705145bc486be813627a94bd7e2b3.GetFilterQueryParameterType `uriparametername:"filter"` + // A list of comma separated label names. Example: `bug,ui,@high` + Labels *string `uriparametername:"labels"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + // What to sort results by. + Sort *i5fc0bd3a41c40893d6db047c6304f8cbbf6705145bc486be813627a94bd7e2b3.GetSortQueryParameterType `uriparametername:"sort"` + // Indicates the state of the issues to return. + State *i5fc0bd3a41c40893d6db047c6304f8cbbf6705145bc486be813627a94bd7e2b3.GetStateQueryParameterType `uriparametername:"state"` +} +// NewItemIssuesRequestBuilderInternal instantiates a new ItemIssuesRequestBuilder and sets the default values. +func NewItemIssuesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemIssuesRequestBuilder) { + m := &ItemIssuesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/issues{?direction*,filter*,labels*,page*,per_page*,since*,sort*,state*}", pathParameters), + } + return m +} +// NewItemIssuesRequestBuilder instantiates a new ItemIssuesRequestBuilder and sets the default values. +func NewItemIssuesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemIssuesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemIssuesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list issues in an organization assigned to the authenticated user.**Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For thisreason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests bythe `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pullrequest id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []Issueable 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/issues/issues#list-organization-issues-assigned-to-the-authenticated-user +func (m *ItemIssuesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemIssuesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable) + } + } + return val, nil +} +// ToGetRequestInformation list issues in an organization assigned to the authenticated user.**Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For thisreason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests bythe `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pullrequest id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemIssuesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemIssuesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemIssuesRequestBuilder when successful +func (m *ItemIssuesRequestBuilder) WithUrl(rawUrl string)(*ItemIssuesRequestBuilder) { + return NewItemIssuesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_item_item_with_enablement_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_item_item_with_enablement_post_request_body.go new file mode 100644 index 000000000..cdf3c70a7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_item_item_with_enablement_post_request_body.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemItemWithEnablementPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemItemWithEnablementPostRequestBody instantiates a new ItemItemItemWithEnablementPostRequestBody and sets the default values. +func NewItemItemItemWithEnablementPostRequestBody()(*ItemItemItemWithEnablementPostRequestBody) { + m := &ItemItemItemWithEnablementPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemItemWithEnablementPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemItemWithEnablementPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemItemWithEnablementPostRequestBody(), 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 *ItemItemItemWithEnablementPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemItemWithEnablementPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemItemWithEnablementPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemItemWithEnablementPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemItemWithEnablementPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_item_with_enablement_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_item_with_enablement_item_request_builder.go new file mode 100644 index 000000000..e75c2ee53 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_item_with_enablement_item_request_builder.go @@ -0,0 +1,55 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemWithEnablementItemRequestBuilder builds and executes requests for operations under \orgs\{org}\{security_product}\{enablement} +type ItemItemWithEnablementItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemWithEnablementItemRequestBuilderInternal instantiates a new ItemItemWithEnablementItemRequestBuilder and sets the default values. +func NewItemItemWithEnablementItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemWithEnablementItemRequestBuilder) { + m := &ItemItemWithEnablementItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/{security_product}/{enablement}", pathParameters), + } + return m +} +// NewItemItemWithEnablementItemRequestBuilder instantiates a new ItemItemWithEnablementItemRequestBuilder and sets the default values. +func NewItemItemWithEnablementItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemWithEnablementItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemWithEnablementItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Post enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization +func (m *ItemItemWithEnablementItemRequestBuilder) Post(ctx context.Context, body ItemItemItemWithEnablementPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemWithEnablementItemRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemItemWithEnablementPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemWithEnablementItemRequestBuilder when successful +func (m *ItemItemWithEnablementItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemWithEnablementItemRequestBuilder) { + return NewItemItemWithEnablementItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_get_response.go new file mode 100644 index 000000000..22b66ddbc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemMembersItemCodespacesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The codespaces property + codespaces []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable + // The total_count property + total_count *int32 +} +// NewItemMembersItemCodespacesGetResponse instantiates a new ItemMembersItemCodespacesGetResponse and sets the default values. +func NewItemMembersItemCodespacesGetResponse()(*ItemMembersItemCodespacesGetResponse) { + m := &ItemMembersItemCodespacesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemMembersItemCodespacesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemMembersItemCodespacesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemMembersItemCodespacesGetResponse(), 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 *ItemMembersItemCodespacesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCodespaces gets the codespaces property value. The codespaces property +// returns a []Codespaceable when successful +func (m *ItemMembersItemCodespacesGetResponse) GetCodespaces()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable) { + return m.codespaces +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemMembersItemCodespacesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["codespaces"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespaceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable) + } + } + m.SetCodespaces(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemMembersItemCodespacesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemMembersItemCodespacesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCodespaces() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCodespaces())) + for i, v := range m.GetCodespaces() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("codespaces", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemMembersItemCodespacesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCodespaces sets the codespaces property value. The codespaces property +func (m *ItemMembersItemCodespacesGetResponse) SetCodespaces(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable)() { + m.codespaces = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemMembersItemCodespacesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemMembersItemCodespacesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCodespaces()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable) + GetTotalCount()(*int32) + SetCodespaces(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_item_stop_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_item_stop_request_builder.go new file mode 100644 index 000000000..1b1c43eee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_item_stop_request_builder.go @@ -0,0 +1,67 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemMembersItemCodespacesItemStopRequestBuilder builds and executes requests for operations under \orgs\{org}\members\{username}\codespaces\{codespace_name}\stop +type ItemMembersItemCodespacesItemStopRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemMembersItemCodespacesItemStopRequestBuilderInternal instantiates a new ItemMembersItemCodespacesItemStopRequestBuilder and sets the default values. +func NewItemMembersItemCodespacesItemStopRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersItemCodespacesItemStopRequestBuilder) { + m := &ItemMembersItemCodespacesItemStopRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/members/{username}/codespaces/{codespace_name}/stop", pathParameters), + } + return m +} +// NewItemMembersItemCodespacesItemStopRequestBuilder instantiates a new ItemMembersItemCodespacesItemStopRequestBuilder and sets the default values. +func NewItemMembersItemCodespacesItemStopRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersItemCodespacesItemStopRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembersItemCodespacesItemStopRequestBuilderInternal(urlParams, requestAdapter) +} +// Post stops a user's codespace.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a Codespaceable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/organizations#stop-a-codespace-for-an-organization-user +func (m *ItemMembersItemCodespacesItemStopRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespaceFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable), nil +} +// ToPostRequestInformation stops a user's codespace.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemMembersItemCodespacesItemStopRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemMembersItemCodespacesItemStopRequestBuilder when successful +func (m *ItemMembersItemCodespacesItemStopRequestBuilder) WithUrl(rawUrl string)(*ItemMembersItemCodespacesItemStopRequestBuilder) { + return NewItemMembersItemCodespacesItemStopRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_item_with_codespace_name_delete_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_item_with_codespace_name_delete_response.go new file mode 100644 index 000000000..19d310942 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_item_with_codespace_name_delete_response.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemMembersItemCodespacesItemWithCodespace_nameDeleteResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemMembersItemCodespacesItemWithCodespace_nameDeleteResponse instantiates a new ItemMembersItemCodespacesItemWithCodespace_nameDeleteResponse and sets the default values. +func NewItemMembersItemCodespacesItemWithCodespace_nameDeleteResponse()(*ItemMembersItemCodespacesItemWithCodespace_nameDeleteResponse) { + m := &ItemMembersItemCodespacesItemWithCodespace_nameDeleteResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemMembersItemCodespacesItemWithCodespace_nameDeleteResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemMembersItemCodespacesItemWithCodespace_nameDeleteResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemMembersItemCodespacesItemWithCodespace_nameDeleteResponse(), 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 *ItemMembersItemCodespacesItemWithCodespace_nameDeleteResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemMembersItemCodespacesItemWithCodespace_nameDeleteResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemMembersItemCodespacesItemWithCodespace_nameDeleteResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemMembersItemCodespacesItemWithCodespace_nameDeleteResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemMembersItemCodespacesItemWithCodespace_nameDeleteResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_item_with_codespace_name_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_item_with_codespace_name_response.go new file mode 100644 index 000000000..256b6a272 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_item_with_codespace_name_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemMembersItemCodespacesItemWithCodespace_nameResponse +// Deprecated: This class is obsolete. Use WithCodespace_nameDeleteResponse instead. +type ItemMembersItemCodespacesItemWithCodespace_nameResponse struct { + ItemMembersItemCodespacesItemWithCodespace_nameDeleteResponse +} +// NewItemMembersItemCodespacesItemWithCodespace_nameResponse instantiates a new ItemMembersItemCodespacesItemWithCodespace_nameResponse and sets the default values. +func NewItemMembersItemCodespacesItemWithCodespace_nameResponse()(*ItemMembersItemCodespacesItemWithCodespace_nameResponse) { + m := &ItemMembersItemCodespacesItemWithCodespace_nameResponse{ + ItemMembersItemCodespacesItemWithCodespace_nameDeleteResponse: *NewItemMembersItemCodespacesItemWithCodespace_nameDeleteResponse(), + } + return m +} +// CreateItemMembersItemCodespacesItemWithCodespace_nameResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemMembersItemCodespacesItemWithCodespace_nameResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemMembersItemCodespacesItemWithCodespace_nameResponse(), nil +} +// ItemMembersItemCodespacesItemWithCodespace_nameResponseable +// Deprecated: This class is obsolete. Use WithCodespace_nameDeleteResponse instead. +type ItemMembersItemCodespacesItemWithCodespace_nameResponseable interface { + ItemMembersItemCodespacesItemWithCodespace_nameDeleteResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_request_builder.go new file mode 100644 index 000000000..b02fb28e8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_request_builder.go @@ -0,0 +1,86 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemMembersItemCodespacesRequestBuilder builds and executes requests for operations under \orgs\{org}\members\{username}\codespaces +type ItemMembersItemCodespacesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemMembersItemCodespacesRequestBuilderGetQueryParameters lists the codespaces that a member of an organization has for repositories in that organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemMembersItemCodespacesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByCodespace_name gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.members.item.codespaces.item collection +// returns a *ItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder when successful +func (m *ItemMembersItemCodespacesRequestBuilder) ByCodespace_name(codespace_name string)(*ItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if codespace_name != "" { + urlTplParams["codespace_name"] = codespace_name + } + return NewItemMembersItemCodespacesWithCodespace_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemMembersItemCodespacesRequestBuilderInternal instantiates a new ItemMembersItemCodespacesRequestBuilder and sets the default values. +func NewItemMembersItemCodespacesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersItemCodespacesRequestBuilder) { + m := &ItemMembersItemCodespacesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/members/{username}/codespaces{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemMembersItemCodespacesRequestBuilder instantiates a new ItemMembersItemCodespacesRequestBuilder and sets the default values. +func NewItemMembersItemCodespacesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersItemCodespacesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembersItemCodespacesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the codespaces that a member of an organization has for repositories in that organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemMembersItemCodespacesGetResponseable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization +func (m *ItemMembersItemCodespacesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMembersItemCodespacesRequestBuilderGetQueryParameters])(ItemMembersItemCodespacesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemMembersItemCodespacesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemMembersItemCodespacesGetResponseable), nil +} +// ToGetRequestInformation lists the codespaces that a member of an organization has for repositories in that organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemMembersItemCodespacesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMembersItemCodespacesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemMembersItemCodespacesRequestBuilder when successful +func (m *ItemMembersItemCodespacesRequestBuilder) WithUrl(rawUrl string)(*ItemMembersItemCodespacesRequestBuilder) { + return NewItemMembersItemCodespacesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_response.go new file mode 100644 index 000000000..f5d844708 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemMembersItemCodespacesResponse +// Deprecated: This class is obsolete. Use codespacesGetResponse instead. +type ItemMembersItemCodespacesResponse struct { + ItemMembersItemCodespacesGetResponse +} +// NewItemMembersItemCodespacesResponse instantiates a new ItemMembersItemCodespacesResponse and sets the default values. +func NewItemMembersItemCodespacesResponse()(*ItemMembersItemCodespacesResponse) { + m := &ItemMembersItemCodespacesResponse{ + ItemMembersItemCodespacesGetResponse: *NewItemMembersItemCodespacesGetResponse(), + } + return m +} +// CreateItemMembersItemCodespacesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemMembersItemCodespacesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemMembersItemCodespacesResponse(), nil +} +// ItemMembersItemCodespacesResponseable +// Deprecated: This class is obsolete. Use codespacesGetResponse instead. +type ItemMembersItemCodespacesResponseable interface { + ItemMembersItemCodespacesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_with_codespace_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_with_codespace_name_item_request_builder.go new file mode 100644 index 000000000..77ea03e9b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_codespaces_with_codespace_name_item_request_builder.go @@ -0,0 +1,72 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\members\{username}\codespaces\{codespace_name} +type ItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemMembersItemCodespacesWithCodespace_nameItemRequestBuilderInternal instantiates a new ItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder and sets the default values. +func NewItemMembersItemCodespacesWithCodespace_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder) { + m := &ItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/members/{username}/codespaces/{codespace_name}", pathParameters), + } + return m +} +// NewItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder instantiates a new ItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder and sets the default values. +func NewItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembersItemCodespacesWithCodespace_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a user's codespace.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemMembersItemCodespacesItemWithCodespace_nameDeleteResponseable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/organizations#delete-a-codespace-from-the-organization +func (m *ItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemMembersItemCodespacesItemWithCodespace_nameDeleteResponseable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemMembersItemCodespacesItemWithCodespace_nameDeleteResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemMembersItemCodespacesItemWithCodespace_nameDeleteResponseable), nil +} +// Stop the stop property +// returns a *ItemMembersItemCodespacesItemStopRequestBuilder when successful +func (m *ItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder) Stop()(*ItemMembersItemCodespacesItemStopRequestBuilder) { + return NewItemMembersItemCodespacesItemStopRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a user's codespace.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder when successful +func (m *ItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder) { + return NewItemMembersItemCodespacesWithCodespace_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_copilot_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_copilot_request_builder.go new file mode 100644 index 000000000..1864647b4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_item_copilot_request_builder.go @@ -0,0 +1,67 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemMembersItemCopilotRequestBuilder builds and executes requests for operations under \orgs\{org}\members\{username}\copilot +type ItemMembersItemCopilotRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemMembersItemCopilotRequestBuilderInternal instantiates a new ItemMembersItemCopilotRequestBuilder and sets the default values. +func NewItemMembersItemCopilotRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersItemCopilotRequestBuilder) { + m := &ItemMembersItemCopilotRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/members/{username}/copilot", pathParameters), + } + return m +} +// NewItemMembersItemCopilotRequestBuilder instantiates a new ItemMembersItemCopilotRequestBuilder and sets the default values. +func NewItemMembersItemCopilotRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersItemCopilotRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembersItemCopilotRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Note**: This endpoint is in beta and is subject to change.Gets the GitHub Copilot seat assignment details for a member of an organization who currently has access to GitHub Copilot.Only organization owners can view Copilot seat assignment details for members of their organization.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. +// returns a CopilotSeatDetailsable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-assignment-details-for-a-user +func (m *ItemMembersItemCopilotRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCopilotSeatDetailsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable), nil +} +// ToGetRequestInformation **Note**: This endpoint is in beta and is subject to change.Gets the GitHub Copilot seat assignment details for a member of an organization who currently has access to GitHub Copilot.Only organization owners can view Copilot seat assignment details for members of their organization.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemMembersItemCopilotRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemMembersItemCopilotRequestBuilder when successful +func (m *ItemMembersItemCopilotRequestBuilder) WithUrl(rawUrl string)(*ItemMembersItemCopilotRequestBuilder) { + return NewItemMembersItemCopilotRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_request_builder.go new file mode 100644 index 000000000..12fd3161e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_request_builder.go @@ -0,0 +1,88 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + id17450d82944fa531d7f154d669a8b6ce833b49a25250377061627d436cc43a6 "github.com/octokit/go-sdk/pkg/github/orgs/item/members" +) + +// ItemMembersRequestBuilder builds and executes requests for operations under \orgs\{org}\members +type ItemMembersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemMembersRequestBuilderGetQueryParameters list all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. +type ItemMembersRequestBuilderGetQueryParameters struct { + // Filter members returned in the list. `2fa_disabled` means that only members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. This options is only available for organization owners. + Filter *id17450d82944fa531d7f154d669a8b6ce833b49a25250377061627d436cc43a6.GetFilterQueryParameterType `uriparametername:"filter"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Filter members returned by their role. + Role *id17450d82944fa531d7f154d669a8b6ce833b49a25250377061627d436cc43a6.GetRoleQueryParameterType `uriparametername:"role"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.members.item collection +// returns a *ItemMembersWithUsernameItemRequestBuilder when successful +func (m *ItemMembersRequestBuilder) ByUsername(username string)(*ItemMembersWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemMembersWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemMembersRequestBuilderInternal instantiates a new ItemMembersRequestBuilder and sets the default values. +func NewItemMembersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersRequestBuilder) { + m := &ItemMembersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/members{?filter*,page*,per_page*,role*}", pathParameters), + } + return m +} +// NewItemMembersRequestBuilder instantiates a new ItemMembersRequestBuilder and sets the default values. +func NewItemMembersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. +// returns a []SimpleUserable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/members#list-organization-members +func (m *ItemMembersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMembersRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation list all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. +// returns a *RequestInformation when successful +func (m *ItemMembersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMembersRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemMembersRequestBuilder when successful +func (m *ItemMembersRequestBuilder) WithUrl(rawUrl string)(*ItemMembersRequestBuilder) { + return NewItemMembersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_with_username_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_with_username_item_request_builder.go new file mode 100644 index 000000000..65ded55d4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_members_with_username_item_request_builder.go @@ -0,0 +1,89 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemMembersWithUsernameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\members\{username} +type ItemMembersWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Codespaces the codespaces property +// returns a *ItemMembersItemCodespacesRequestBuilder when successful +func (m *ItemMembersWithUsernameItemRequestBuilder) Codespaces()(*ItemMembersItemCodespacesRequestBuilder) { + return NewItemMembersItemCodespacesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemMembersWithUsernameItemRequestBuilderInternal instantiates a new ItemMembersWithUsernameItemRequestBuilder and sets the default values. +func NewItemMembersWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersWithUsernameItemRequestBuilder) { + m := &ItemMembersWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/members/{username}", pathParameters), + } + return m +} +// NewItemMembersWithUsernameItemRequestBuilder instantiates a new ItemMembersWithUsernameItemRequestBuilder and sets the default values. +func NewItemMembersWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembersWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Copilot the copilot property +// returns a *ItemMembersItemCopilotRequestBuilder when successful +func (m *ItemMembersWithUsernameItemRequestBuilder) Copilot()(*ItemMembersItemCopilotRequestBuilder) { + return NewItemMembersItemCopilotRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Delete removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/members#remove-an-organization-member +func (m *ItemMembersWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get check if a user is, publicly or privately, a member of the organization. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user +func (m *ItemMembersWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. +// returns a *RequestInformation when successful +func (m *ItemMembersWithUsernameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation check if a user is, publicly or privately, a member of the organization. +// returns a *RequestInformation when successful +func (m *ItemMembersWithUsernameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemMembersWithUsernameItemRequestBuilder when successful +func (m *ItemMembersWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemMembersWithUsernameItemRequestBuilder) { + return NewItemMembersWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_memberships_item_with_username_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_memberships_item_with_username_put_request_body.go new file mode 100644 index 000000000..4110b5ccd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_memberships_item_with_username_put_request_body.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemMembershipsItemWithUsernamePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemMembershipsItemWithUsernamePutRequestBody instantiates a new ItemMembershipsItemWithUsernamePutRequestBody and sets the default values. +func NewItemMembershipsItemWithUsernamePutRequestBody()(*ItemMembershipsItemWithUsernamePutRequestBody) { + m := &ItemMembershipsItemWithUsernamePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemMembershipsItemWithUsernamePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemMembershipsItemWithUsernamePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemMembershipsItemWithUsernamePutRequestBody(), 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 *ItemMembershipsItemWithUsernamePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemMembershipsItemWithUsernamePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemMembershipsItemWithUsernamePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemMembershipsItemWithUsernamePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemMembershipsItemWithUsernamePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_memberships_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_memberships_request_builder.go new file mode 100644 index 000000000..868f4b611 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_memberships_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemMembershipsRequestBuilder builds and executes requests for operations under \orgs\{org}\memberships +type ItemMembershipsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByUsername gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.memberships.item collection +// returns a *ItemMembershipsWithUsernameItemRequestBuilder when successful +func (m *ItemMembershipsRequestBuilder) ByUsername(username string)(*ItemMembershipsWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemMembershipsWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemMembershipsRequestBuilderInternal instantiates a new ItemMembershipsRequestBuilder and sets the default values. +func NewItemMembershipsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembershipsRequestBuilder) { + m := &ItemMembershipsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/memberships", pathParameters), + } + return m +} +// NewItemMembershipsRequestBuilder instantiates a new ItemMembershipsRequestBuilder and sets the default values. +func NewItemMembershipsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembershipsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembershipsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_memberships_with_username_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_memberships_with_username_item_request_builder.go new file mode 100644 index 000000000..1dbd36a0d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_memberships_with_username_item_request_builder.go @@ -0,0 +1,129 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemMembershipsWithUsernameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\memberships\{username} +type ItemMembershipsWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemMembershipsWithUsernameItemRequestBuilderInternal instantiates a new ItemMembershipsWithUsernameItemRequestBuilder and sets the default values. +func NewItemMembershipsWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembershipsWithUsernameItemRequestBuilder) { + m := &ItemMembershipsWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/memberships/{username}", pathParameters), + } + return m +} +// NewItemMembershipsWithUsernameItemRequestBuilder instantiates a new ItemMembershipsWithUsernameItemRequestBuilder and sets the default values. +func NewItemMembershipsWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembershipsWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembershipsWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete in order to remove a user's membership with an organization, the authenticated user must be an organization owner.If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/members#remove-organization-membership-for-a-user +func (m *ItemMembershipsWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get in order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status. +// returns a OrgMembershipable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user +func (m *ItemMembershipsWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgMembershipable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgMembershipFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgMembershipable), nil +} +// Put only authenticated organization owners can add a member to the organization or update the member's role.* If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user) will be `pending` until they accept the invitation. * Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent.**Rate limits**To prevent abuse, organization owners are limited to creating 50 organization invitations for an organization within a 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. +// returns a OrgMembershipable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user +func (m *ItemMembershipsWithUsernameItemRequestBuilder) Put(ctx context.Context, body ItemMembershipsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgMembershipable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgMembershipFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgMembershipable), nil +} +// ToDeleteRequestInformation in order to remove a user's membership with an organization, the authenticated user must be an organization owner.If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. +// returns a *RequestInformation when successful +func (m *ItemMembershipsWithUsernameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation in order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status. +// returns a *RequestInformation when successful +func (m *ItemMembershipsWithUsernameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation only authenticated organization owners can add a member to the organization or update the member's role.* If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user) will be `pending` until they accept the invitation. * Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent.**Rate limits**To prevent abuse, organization owners are limited to creating 50 organization invitations for an organization within a 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. +// returns a *RequestInformation when successful +func (m *ItemMembershipsWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemMembershipsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemMembershipsWithUsernameItemRequestBuilder when successful +func (m *ItemMembershipsWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemMembershipsWithUsernameItemRequestBuilder) { + return NewItemMembershipsWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_item_archive_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_item_archive_request_builder.go new file mode 100644 index 000000000..77f28f38c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_item_archive_request_builder.go @@ -0,0 +1,84 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemMigrationsItemArchiveRequestBuilder builds and executes requests for operations under \orgs\{org}\migrations\{migration_id}\archive +type ItemMigrationsItemArchiveRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemMigrationsItemArchiveRequestBuilderInternal instantiates a new ItemMigrationsItemArchiveRequestBuilder and sets the default values. +func NewItemMigrationsItemArchiveRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemArchiveRequestBuilder) { + m := &ItemMigrationsItemArchiveRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/migrations/{migration_id}/archive", pathParameters), + } + return m +} +// NewItemMigrationsItemArchiveRequestBuilder instantiates a new ItemMigrationsItemArchiveRequestBuilder and sets the default values. +func NewItemMigrationsItemArchiveRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemArchiveRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMigrationsItemArchiveRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a previous migration archive. Migration archives are automatically deleted after seven days. +// 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#delete-an-organization-migration-archive +func (m *ItemMigrationsItemArchiveRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get fetches the URL to a migration archive. +// 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])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation deletes a previous migration archive. Migration archives are automatically deleted after seven days. +// returns a *RequestInformation when successful +func (m *ItemMigrationsItemArchiveRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation fetches the URL to a migration archive. +// returns a *RequestInformation when successful +func (m *ItemMigrationsItemArchiveRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemMigrationsItemArchiveRequestBuilder when successful +func (m *ItemMigrationsItemArchiveRequestBuilder) WithUrl(rawUrl string)(*ItemMigrationsItemArchiveRequestBuilder) { + return NewItemMigrationsItemArchiveRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_item_repos_item_lock_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_item_repos_item_lock_request_builder.go new file mode 100644 index 000000000..084a70bfd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_item_repos_item_lock_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemMigrationsItemReposItemLockRequestBuilder builds and executes requests for operations under \orgs\{org}\migrations\{migration_id}\repos\{repo_name}\lock +type ItemMigrationsItemReposItemLockRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemMigrationsItemReposItemLockRequestBuilderInternal instantiates a new ItemMigrationsItemReposItemLockRequestBuilder and sets the default values. +func NewItemMigrationsItemReposItemLockRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemReposItemLockRequestBuilder) { + m := &ItemMigrationsItemReposItemLockRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock", pathParameters), + } + return m +} +// NewItemMigrationsItemReposItemLockRequestBuilder instantiates a new ItemMigrationsItemReposItemLockRequestBuilder and sets the default values. +func NewItemMigrationsItemReposItemLockRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemReposItemLockRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMigrationsItemReposItemLockRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/rest/repos/repos#delete-a-repository) when the migration is complete and you no longer need the source data. +// 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#unlock-an-organization-repository +func (m *ItemMigrationsItemReposItemLockRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/rest/repos/repos#delete-a-repository) when the migration is complete and you no longer need the source data. +// returns a *RequestInformation when successful +func (m *ItemMigrationsItemReposItemLockRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemMigrationsItemReposItemLockRequestBuilder when successful +func (m *ItemMigrationsItemReposItemLockRequestBuilder) WithUrl(rawUrl string)(*ItemMigrationsItemReposItemLockRequestBuilder) { + return NewItemMigrationsItemReposItemLockRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_item_repos_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_item_repos_request_builder.go new file mode 100644 index 000000000..70fcbdcad --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_item_repos_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemMigrationsItemReposRequestBuilder builds and executes requests for operations under \orgs\{org}\migrations\{migration_id}\repos +type ItemMigrationsItemReposRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRepo_name gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.migrations.item.repos.item collection +// returns a *ItemMigrationsItemReposWithRepo_nameItemRequestBuilder when successful +func (m *ItemMigrationsItemReposRequestBuilder) ByRepo_name(repo_name string)(*ItemMigrationsItemReposWithRepo_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if repo_name != "" { + urlTplParams["repo_name"] = repo_name + } + return NewItemMigrationsItemReposWithRepo_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemMigrationsItemReposRequestBuilderInternal instantiates a new ItemMigrationsItemReposRequestBuilder and sets the default values. +func NewItemMigrationsItemReposRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemReposRequestBuilder) { + m := &ItemMigrationsItemReposRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/migrations/{migration_id}/repos", pathParameters), + } + return m +} +// NewItemMigrationsItemReposRequestBuilder instantiates a new ItemMigrationsItemReposRequestBuilder and sets the default values. +func NewItemMigrationsItemReposRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemReposRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMigrationsItemReposRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_item_repos_with_repo_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_item_repos_with_repo_name_item_request_builder.go new file mode 100644 index 000000000..a19a03625 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_item_repos_with_repo_name_item_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemMigrationsItemReposWithRepo_nameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\migrations\{migration_id}\repos\{repo_name} +type ItemMigrationsItemReposWithRepo_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemMigrationsItemReposWithRepo_nameItemRequestBuilderInternal instantiates a new ItemMigrationsItemReposWithRepo_nameItemRequestBuilder and sets the default values. +func NewItemMigrationsItemReposWithRepo_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemReposWithRepo_nameItemRequestBuilder) { + m := &ItemMigrationsItemReposWithRepo_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/migrations/{migration_id}/repos/{repo_name}", pathParameters), + } + return m +} +// NewItemMigrationsItemReposWithRepo_nameItemRequestBuilder instantiates a new ItemMigrationsItemReposWithRepo_nameItemRequestBuilder and sets the default values. +func NewItemMigrationsItemReposWithRepo_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemReposWithRepo_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMigrationsItemReposWithRepo_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Lock the lock property +// returns a *ItemMigrationsItemReposItemLockRequestBuilder when successful +func (m *ItemMigrationsItemReposWithRepo_nameItemRequestBuilder) Lock()(*ItemMigrationsItemReposItemLockRequestBuilder) { + return NewItemMigrationsItemReposItemLockRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_item_repositories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_item_repositories_request_builder.go new file mode 100644 index 000000000..977f1d85b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_item_repositories_request_builder.go @@ -0,0 +1,71 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemMigrationsItemRepositoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\migrations\{migration_id}\repositories +type ItemMigrationsItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemMigrationsItemRepositoriesRequestBuilderGetQueryParameters list all the repositories for this organization migration. +type ItemMigrationsItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemMigrationsItemRepositoriesRequestBuilderInternal instantiates a new ItemMigrationsItemRepositoriesRequestBuilder and sets the default values. +func NewItemMigrationsItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemRepositoriesRequestBuilder) { + m := &ItemMigrationsItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/migrations/{migration_id}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemMigrationsItemRepositoriesRequestBuilder instantiates a new ItemMigrationsItemRepositoriesRequestBuilder and sets the default values. +func NewItemMigrationsItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMigrationsItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all the repositories for this organization migration. +// returns a []MinimalRepositoryable 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#list-repositories-in-an-organization-migration +func (m *ItemMigrationsItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMigrationsItemRepositoriesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation list all the repositories for this organization migration. +// returns a *RequestInformation when successful +func (m *ItemMigrationsItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMigrationsItemRepositoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemMigrationsItemRepositoriesRequestBuilder when successful +func (m *ItemMigrationsItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemMigrationsItemRepositoriesRequestBuilder) { + return NewItemMigrationsItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_post_request_body.go new file mode 100644 index 000000000..ce2837a83 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_post_request_body.go @@ -0,0 +1,289 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemMigrationsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). + exclude_attachments *bool + // Indicates whether the repository git data should be excluded from the migration. + exclude_git_data *bool + // Indicates whether metadata should be excluded and only git source should be included for the migration. + exclude_metadata *bool + // Indicates whether projects owned by the organization or users should be excluded. from the migration. + exclude_owner_projects *bool + // Indicates whether releases should be excluded from the migration (to reduce migration archive file size). + exclude_releases *bool + // Indicates whether repositories should be locked (to prevent manipulation) while migrating data. + lock_repositories *bool + // Indicates whether this should only include organization metadata (repositories array should be empty and will ignore other flags). + org_metadata_only *bool + // A list of arrays indicating which repositories should be migrated. + repositories []string +} +// NewItemMigrationsPostRequestBody instantiates a new ItemMigrationsPostRequestBody and sets the default values. +func NewItemMigrationsPostRequestBody()(*ItemMigrationsPostRequestBody) { + m := &ItemMigrationsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemMigrationsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemMigrationsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemMigrationsPostRequestBody(), 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 *ItemMigrationsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetExcludeAttachments gets the exclude_attachments property value. Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). +// returns a *bool when successful +func (m *ItemMigrationsPostRequestBody) GetExcludeAttachments()(*bool) { + return m.exclude_attachments +} +// GetExcludeGitData gets the exclude_git_data property value. Indicates whether the repository git data should be excluded from the migration. +// returns a *bool when successful +func (m *ItemMigrationsPostRequestBody) GetExcludeGitData()(*bool) { + return m.exclude_git_data +} +// GetExcludeMetadata gets the exclude_metadata property value. Indicates whether metadata should be excluded and only git source should be included for the migration. +// returns a *bool when successful +func (m *ItemMigrationsPostRequestBody) GetExcludeMetadata()(*bool) { + return m.exclude_metadata +} +// GetExcludeOwnerProjects gets the exclude_owner_projects property value. Indicates whether projects owned by the organization or users should be excluded. from the migration. +// returns a *bool when successful +func (m *ItemMigrationsPostRequestBody) GetExcludeOwnerProjects()(*bool) { + return m.exclude_owner_projects +} +// GetExcludeReleases gets the exclude_releases property value. Indicates whether releases should be excluded from the migration (to reduce migration archive file size). +// returns a *bool when successful +func (m *ItemMigrationsPostRequestBody) GetExcludeReleases()(*bool) { + return m.exclude_releases +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemMigrationsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["exclude_attachments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeAttachments(val) + } + return nil + } + res["exclude_git_data"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeGitData(val) + } + return nil + } + res["exclude_metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeMetadata(val) + } + return nil + } + res["exclude_owner_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeOwnerProjects(val) + } + return nil + } + res["exclude_releases"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeReleases(val) + } + return nil + } + res["lock_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLockRepositories(val) + } + return nil + } + res["org_metadata_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetOrgMetadataOnly(val) + } + return nil + } + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRepositories(res) + } + return nil + } + return res +} +// GetLockRepositories gets the lock_repositories property value. Indicates whether repositories should be locked (to prevent manipulation) while migrating data. +// returns a *bool when successful +func (m *ItemMigrationsPostRequestBody) GetLockRepositories()(*bool) { + return m.lock_repositories +} +// GetOrgMetadataOnly gets the org_metadata_only property value. Indicates whether this should only include organization metadata (repositories array should be empty and will ignore other flags). +// returns a *bool when successful +func (m *ItemMigrationsPostRequestBody) GetOrgMetadataOnly()(*bool) { + return m.org_metadata_only +} +// GetRepositories gets the repositories property value. A list of arrays indicating which repositories should be migrated. +// returns a []string when successful +func (m *ItemMigrationsPostRequestBody) GetRepositories()([]string) { + return m.repositories +} +// Serialize serializes information the current object +func (m *ItemMigrationsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("exclude_attachments", m.GetExcludeAttachments()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_git_data", m.GetExcludeGitData()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_metadata", m.GetExcludeMetadata()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_owner_projects", m.GetExcludeOwnerProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_releases", m.GetExcludeReleases()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("lock_repositories", m.GetLockRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("org_metadata_only", m.GetOrgMetadataOnly()) + if err != nil { + return err + } + } + if m.GetRepositories() != nil { + err := writer.WriteCollectionOfStringValues("repositories", m.GetRepositories()) + 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 *ItemMigrationsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetExcludeAttachments sets the exclude_attachments property value. Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). +func (m *ItemMigrationsPostRequestBody) SetExcludeAttachments(value *bool)() { + m.exclude_attachments = value +} +// SetExcludeGitData sets the exclude_git_data property value. Indicates whether the repository git data should be excluded from the migration. +func (m *ItemMigrationsPostRequestBody) SetExcludeGitData(value *bool)() { + m.exclude_git_data = value +} +// SetExcludeMetadata sets the exclude_metadata property value. Indicates whether metadata should be excluded and only git source should be included for the migration. +func (m *ItemMigrationsPostRequestBody) SetExcludeMetadata(value *bool)() { + m.exclude_metadata = value +} +// SetExcludeOwnerProjects sets the exclude_owner_projects property value. Indicates whether projects owned by the organization or users should be excluded. from the migration. +func (m *ItemMigrationsPostRequestBody) SetExcludeOwnerProjects(value *bool)() { + m.exclude_owner_projects = value +} +// SetExcludeReleases sets the exclude_releases property value. Indicates whether releases should be excluded from the migration (to reduce migration archive file size). +func (m *ItemMigrationsPostRequestBody) SetExcludeReleases(value *bool)() { + m.exclude_releases = value +} +// SetLockRepositories sets the lock_repositories property value. Indicates whether repositories should be locked (to prevent manipulation) while migrating data. +func (m *ItemMigrationsPostRequestBody) SetLockRepositories(value *bool)() { + m.lock_repositories = value +} +// SetOrgMetadataOnly sets the org_metadata_only property value. Indicates whether this should only include organization metadata (repositories array should be empty and will ignore other flags). +func (m *ItemMigrationsPostRequestBody) SetOrgMetadataOnly(value *bool)() { + m.org_metadata_only = value +} +// SetRepositories sets the repositories property value. A list of arrays indicating which repositories should be migrated. +func (m *ItemMigrationsPostRequestBody) SetRepositories(value []string)() { + m.repositories = value +} +type ItemMigrationsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetExcludeAttachments()(*bool) + GetExcludeGitData()(*bool) + GetExcludeMetadata()(*bool) + GetExcludeOwnerProjects()(*bool) + GetExcludeReleases()(*bool) + GetLockRepositories()(*bool) + GetOrgMetadataOnly()(*bool) + GetRepositories()([]string) + SetExcludeAttachments(value *bool)() + SetExcludeGitData(value *bool)() + SetExcludeMetadata(value *bool)() + SetExcludeOwnerProjects(value *bool)() + SetExcludeReleases(value *bool)() + SetLockRepositories(value *bool)() + SetOrgMetadataOnly(value *bool)() + SetRepositories(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_request_builder.go new file mode 100644 index 000000000..a08abfea3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_request_builder.go @@ -0,0 +1,118 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i010f80164593e67edac379301caa66f6c3b0369d2d666ed5683626e52e3f25fb "github.com/octokit/go-sdk/pkg/github/orgs/item/migrations" +) + +// ItemMigrationsRequestBuilder builds and executes requests for operations under \orgs\{org}\migrations +type ItemMigrationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemMigrationsRequestBuilderGetQueryParameters lists the most recent migrations, including both exports (which can be started through the REST API) and imports (which cannot be started using the REST API).A list of `repositories` is only returned for export migrations. +type ItemMigrationsRequestBuilderGetQueryParameters struct { + // Exclude attributes from the API response to improve performance + Exclude []i010f80164593e67edac379301caa66f6c3b0369d2d666ed5683626e52e3f25fb.GetExcludeQueryParameterType `uriparametername:"exclude"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByMigration_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.migrations.item collection +// returns a *ItemMigrationsWithMigration_ItemRequestBuilder when successful +func (m *ItemMigrationsRequestBuilder) ByMigration_id(migration_id int32)(*ItemMigrationsWithMigration_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["migration_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(migration_id), 10) + return NewItemMigrationsWithMigration_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemMigrationsRequestBuilderInternal instantiates a new ItemMigrationsRequestBuilder and sets the default values. +func NewItemMigrationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsRequestBuilder) { + m := &ItemMigrationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/migrations{?exclude*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemMigrationsRequestBuilder instantiates a new ItemMigrationsRequestBuilder and sets the default values. +func NewItemMigrationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMigrationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the most recent migrations, including both exports (which can be started through the REST API) and imports (which cannot be started using the REST API).A list of `repositories` is only returned for export migrations. +// returns a []Migrationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/migrations/orgs#list-organization-migrations +func (m *ItemMigrationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMigrationsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Migrationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMigrationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Migrationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Migrationable) + } + } + return val, nil +} +// Post initiates the generation of a migration archive. +// returns a Migrationable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration +func (m *ItemMigrationsRequestBuilder) Post(ctx context.Context, body ItemMigrationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Migrationable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMigrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Migrationable), nil +} +// ToGetRequestInformation lists the most recent migrations, including both exports (which can be started through the REST API) and imports (which cannot be started using the REST API).A list of `repositories` is only returned for export migrations. +// returns a *RequestInformation when successful +func (m *ItemMigrationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMigrationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation initiates the generation of a migration archive. +// returns a *RequestInformation when successful +func (m *ItemMigrationsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemMigrationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemMigrationsRequestBuilder when successful +func (m *ItemMigrationsRequestBuilder) WithUrl(rawUrl string)(*ItemMigrationsRequestBuilder) { + return NewItemMigrationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_with_migration_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_with_migration_item_request_builder.go new file mode 100644 index 000000000..1fea0e6b6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_migrations_with_migration_item_request_builder.go @@ -0,0 +1,82 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i399c3da064b81c83d30565b554a09039c3bc9dc0590affc1306cb54f75cd8e0d "github.com/octokit/go-sdk/pkg/github/orgs/item/migrations/item" +) + +// ItemMigrationsWithMigration_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\migrations\{migration_id} +type ItemMigrationsWithMigration_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemMigrationsWithMigration_ItemRequestBuilderGetQueryParameters fetches the status of a migration.The `state` of a migration can be one of the following values:* `pending`, which means the migration hasn't started yet.* `exporting`, which means the migration is in progress.* `exported`, which means the migration finished successfully.* `failed`, which means the migration failed. +type ItemMigrationsWithMigration_ItemRequestBuilderGetQueryParameters struct { + // Exclude attributes from the API response to improve performance + Exclude []i399c3da064b81c83d30565b554a09039c3bc9dc0590affc1306cb54f75cd8e0d.GetExcludeQueryParameterType `uriparametername:"exclude"` +} +// Archive the archive property +// returns a *ItemMigrationsItemArchiveRequestBuilder when successful +func (m *ItemMigrationsWithMigration_ItemRequestBuilder) Archive()(*ItemMigrationsItemArchiveRequestBuilder) { + return NewItemMigrationsItemArchiveRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemMigrationsWithMigration_ItemRequestBuilderInternal instantiates a new ItemMigrationsWithMigration_ItemRequestBuilder and sets the default values. +func NewItemMigrationsWithMigration_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsWithMigration_ItemRequestBuilder) { + m := &ItemMigrationsWithMigration_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/migrations/{migration_id}{?exclude*}", pathParameters), + } + return m +} +// NewItemMigrationsWithMigration_ItemRequestBuilder instantiates a new ItemMigrationsWithMigration_ItemRequestBuilder and sets the default values. +func NewItemMigrationsWithMigration_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsWithMigration_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMigrationsWithMigration_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get fetches the status of a migration.The `state` of a migration can be one of the following values:* `pending`, which means the migration hasn't started yet.* `exporting`, which means the migration is in progress.* `exported`, which means the migration finished successfully.* `failed`, which means the migration failed. +// returns a Migrationable 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#get-an-organization-migration-status +func (m *ItemMigrationsWithMigration_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMigrationsWithMigration_ItemRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Migrationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMigrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Migrationable), nil +} +// Repos the repos property +// returns a *ItemMigrationsItemReposRequestBuilder when successful +func (m *ItemMigrationsWithMigration_ItemRequestBuilder) Repos()(*ItemMigrationsItemReposRequestBuilder) { + return NewItemMigrationsItemReposRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repositories the repositories property +// returns a *ItemMigrationsItemRepositoriesRequestBuilder when successful +func (m *ItemMigrationsWithMigration_ItemRequestBuilder) Repositories()(*ItemMigrationsItemRepositoriesRequestBuilder) { + return NewItemMigrationsItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation fetches the status of a migration.The `state` of a migration can be one of the following values:* `pending`, which means the migration hasn't started yet.* `exporting`, which means the migration is in progress.* `exported`, which means the migration finished successfully.* `failed`, which means the migration failed. +// returns a *RequestInformation when successful +func (m *ItemMigrationsWithMigration_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMigrationsWithMigration_ItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemMigrationsWithMigration_ItemRequestBuilder when successful +func (m *ItemMigrationsWithMigration_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemMigrationsWithMigration_ItemRequestBuilder) { + return NewItemMigrationsWithMigration_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_fine_grained_permissions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_fine_grained_permissions_request_builder.go new file mode 100644 index 000000000..3523b1b21 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_fine_grained_permissions_request_builder.go @@ -0,0 +1,66 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemOrganizationFineGrainedPermissionsRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-fine-grained-permissions +type ItemOrganizationFineGrainedPermissionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemOrganizationFineGrainedPermissionsRequestBuilderInternal instantiates a new ItemOrganizationFineGrainedPermissionsRequestBuilder and sets the default values. +func NewItemOrganizationFineGrainedPermissionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationFineGrainedPermissionsRequestBuilder) { + m := &ItemOrganizationFineGrainedPermissionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-fine-grained-permissions", pathParameters), + } + return m +} +// NewItemOrganizationFineGrainedPermissionsRequestBuilder instantiates a new ItemOrganizationFineGrainedPermissionsRequestBuilder and sets the default values. +func NewItemOrganizationFineGrainedPermissionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationFineGrainedPermissionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationFineGrainedPermissionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the fine-grained permissions that can be used in custom organization roles for an organization. For more information, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To list the fine-grained permissions that can be used in custom repository roles for an organization, see "[List repository fine-grained permissions for an organization](https://docs.github.com/rest/orgs/organization-roles#list-repository-fine-grained-permissions-for-an-organization)."To use this endpoint, the authenticated user must be one of:- An administrator for the organization.- A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a []OrganizationFineGrainedPermissionable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/organization-roles#list-organization-fine-grained-permissions-for-an-organization +func (m *ItemOrganizationFineGrainedPermissionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationFineGrainedPermissionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationFineGrainedPermissionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationFineGrainedPermissionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationFineGrainedPermissionable) + } + } + return val, nil +} +// ToGetRequestInformation lists the fine-grained permissions that can be used in custom organization roles for an organization. For more information, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To list the fine-grained permissions that can be used in custom repository roles for an organization, see "[List repository fine-grained permissions for an organization](https://docs.github.com/rest/orgs/organization-roles#list-repository-fine-grained-permissions-for-an-organization)."To use this endpoint, the authenticated user must be one of:- An administrator for the organization.- A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationFineGrainedPermissionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemOrganizationFineGrainedPermissionsRequestBuilder when successful +func (m *ItemOrganizationFineGrainedPermissionsRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationFineGrainedPermissionsRequestBuilder) { + return NewItemOrganizationFineGrainedPermissionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_get_response.go new file mode 100644 index 000000000..cc5729f8b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemOrganizationRolesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The list of organization roles available to the organization. + roles []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationRoleable + // The total number of organization roles available to the organization. + total_count *int32 +} +// NewItemOrganizationRolesGetResponse instantiates a new ItemOrganizationRolesGetResponse and sets the default values. +func NewItemOrganizationRolesGetResponse()(*ItemOrganizationRolesGetResponse) { + m := &ItemOrganizationRolesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemOrganizationRolesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemOrganizationRolesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemOrganizationRolesGetResponse(), 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 *ItemOrganizationRolesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemOrganizationRolesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["roles"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationRoleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationRoleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationRoleable) + } + } + m.SetRoles(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRoles gets the roles property value. The list of organization roles available to the organization. +// returns a []OrganizationRoleable when successful +func (m *ItemOrganizationRolesGetResponse) GetRoles()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationRoleable) { + return m.roles +} +// GetTotalCount gets the total_count property value. The total number of organization roles available to the organization. +// returns a *int32 when successful +func (m *ItemOrganizationRolesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemOrganizationRolesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRoles() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRoles())) + for i, v := range m.GetRoles() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("roles", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemOrganizationRolesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRoles sets the roles property value. The list of organization roles available to the organization. +func (m *ItemOrganizationRolesGetResponse) SetRoles(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationRoleable)() { + m.roles = value +} +// SetTotalCount sets the total_count property value. The total number of organization roles available to the organization. +func (m *ItemOrganizationRolesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemOrganizationRolesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRoles()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationRoleable) + GetTotalCount()(*int32) + SetRoles(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationRoleable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_item_teams_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_item_teams_request_builder.go new file mode 100644 index 000000000..91f804e52 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_item_teams_request_builder.go @@ -0,0 +1,67 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemOrganizationRolesItemTeamsRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\{role_id}\teams +type ItemOrganizationRolesItemTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemOrganizationRolesItemTeamsRequestBuilderGetQueryParameters lists the teams that are assigned to an organization role. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To use this endpoint, you must be an administrator for the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemOrganizationRolesItemTeamsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemOrganizationRolesItemTeamsRequestBuilderInternal instantiates a new ItemOrganizationRolesItemTeamsRequestBuilder and sets the default values. +func NewItemOrganizationRolesItemTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesItemTeamsRequestBuilder) { + m := &ItemOrganizationRolesItemTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/{role_id}/teams{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemOrganizationRolesItemTeamsRequestBuilder instantiates a new ItemOrganizationRolesItemTeamsRequestBuilder and sets the default values. +func NewItemOrganizationRolesItemTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesItemTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesItemTeamsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the teams that are assigned to an organization role. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To use this endpoint, you must be an administrator for the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a []TeamRoleAssignmentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/organization-roles#list-teams-that-are-assigned-to-an-organization-role +func (m *ItemOrganizationRolesItemTeamsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemOrganizationRolesItemTeamsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamRoleAssignmentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamRoleAssignmentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamRoleAssignmentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamRoleAssignmentable) + } + } + return val, nil +} +// ToGetRequestInformation lists the teams that are assigned to an organization role. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To use this endpoint, you must be an administrator for the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesItemTeamsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemOrganizationRolesItemTeamsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemOrganizationRolesItemTeamsRequestBuilder when successful +func (m *ItemOrganizationRolesItemTeamsRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationRolesItemTeamsRequestBuilder) { + return NewItemOrganizationRolesItemTeamsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_item_users_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_item_users_request_builder.go new file mode 100644 index 000000000..f7cc70ee7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_item_users_request_builder.go @@ -0,0 +1,67 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemOrganizationRolesItemUsersRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\{role_id}\users +type ItemOrganizationRolesItemUsersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemOrganizationRolesItemUsersRequestBuilderGetQueryParameters lists organization members that are assigned to an organization role. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To use this endpoint, you must be an administrator for the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemOrganizationRolesItemUsersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemOrganizationRolesItemUsersRequestBuilderInternal instantiates a new ItemOrganizationRolesItemUsersRequestBuilder and sets the default values. +func NewItemOrganizationRolesItemUsersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesItemUsersRequestBuilder) { + m := &ItemOrganizationRolesItemUsersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/{role_id}/users{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemOrganizationRolesItemUsersRequestBuilder instantiates a new ItemOrganizationRolesItemUsersRequestBuilder and sets the default values. +func NewItemOrganizationRolesItemUsersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesItemUsersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesItemUsersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists organization members that are assigned to an organization role. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To use this endpoint, you must be an administrator for the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a []UserRoleAssignmentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/organization-roles#list-users-that-are-assigned-to-an-organization-role +func (m *ItemOrganizationRolesItemUsersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemOrganizationRolesItemUsersRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.UserRoleAssignmentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateUserRoleAssignmentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.UserRoleAssignmentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.UserRoleAssignmentable) + } + } + return val, nil +} +// ToGetRequestInformation lists organization members that are assigned to an organization role. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To use this endpoint, you must be an administrator for the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesItemUsersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemOrganizationRolesItemUsersRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemOrganizationRolesItemUsersRequestBuilder when successful +func (m *ItemOrganizationRolesItemUsersRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationRolesItemUsersRequestBuilder) { + return NewItemOrganizationRolesItemUsersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_item_with_role_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_item_with_role_patch_request_body.go new file mode 100644 index 000000000..67399c17c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_item_with_role_patch_request_body.go @@ -0,0 +1,144 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemOrganizationRolesItemWithRole_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A short description about the intended usage of this role or what permissions it grants. + description *string + // The name of the custom role. + name *string + // A list of additional permissions included in this role. + permissions []string +} +// NewItemOrganizationRolesItemWithRole_PatchRequestBody instantiates a new ItemOrganizationRolesItemWithRole_PatchRequestBody and sets the default values. +func NewItemOrganizationRolesItemWithRole_PatchRequestBody()(*ItemOrganizationRolesItemWithRole_PatchRequestBody) { + m := &ItemOrganizationRolesItemWithRole_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemOrganizationRolesItemWithRole_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemOrganizationRolesItemWithRole_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemOrganizationRolesItemWithRole_PatchRequestBody(), 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 *ItemOrganizationRolesItemWithRole_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. A short description about the intended usage of this role or what permissions it grants. +// returns a *string when successful +func (m *ItemOrganizationRolesItemWithRole_PatchRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemOrganizationRolesItemWithRole_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetPermissions(res) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the custom role. +// returns a *string when successful +func (m *ItemOrganizationRolesItemWithRole_PatchRequestBody) GetName()(*string) { + return m.name +} +// GetPermissions gets the permissions property value. A list of additional permissions included in this role. +// returns a []string when successful +func (m *ItemOrganizationRolesItemWithRole_PatchRequestBody) GetPermissions()([]string) { + return m.permissions +} +// Serialize serializes information the current object +func (m *ItemOrganizationRolesItemWithRole_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetPermissions() != nil { + err := writer.WriteCollectionOfStringValues("permissions", m.GetPermissions()) + 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 *ItemOrganizationRolesItemWithRole_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. A short description about the intended usage of this role or what permissions it grants. +func (m *ItemOrganizationRolesItemWithRole_PatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetName sets the name property value. The name of the custom role. +func (m *ItemOrganizationRolesItemWithRole_PatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetPermissions sets the permissions property value. A list of additional permissions included in this role. +func (m *ItemOrganizationRolesItemWithRole_PatchRequestBody) SetPermissions(value []string)() { + m.permissions = value +} +type ItemOrganizationRolesItemWithRole_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetName()(*string) + GetPermissions()([]string) + SetDescription(value *string)() + SetName(value *string)() + SetPermissions(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_post_request_body.go new file mode 100644 index 000000000..03f51083e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_post_request_body.go @@ -0,0 +1,144 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemOrganizationRolesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A short description about the intended usage of this role or what permissions it grants. + description *string + // The name of the custom role. + name *string + // A list of additional permissions included in this role. + permissions []string +} +// NewItemOrganizationRolesPostRequestBody instantiates a new ItemOrganizationRolesPostRequestBody and sets the default values. +func NewItemOrganizationRolesPostRequestBody()(*ItemOrganizationRolesPostRequestBody) { + m := &ItemOrganizationRolesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemOrganizationRolesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemOrganizationRolesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemOrganizationRolesPostRequestBody(), 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 *ItemOrganizationRolesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. A short description about the intended usage of this role or what permissions it grants. +// returns a *string when successful +func (m *ItemOrganizationRolesPostRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemOrganizationRolesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetPermissions(res) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the custom role. +// returns a *string when successful +func (m *ItemOrganizationRolesPostRequestBody) GetName()(*string) { + return m.name +} +// GetPermissions gets the permissions property value. A list of additional permissions included in this role. +// returns a []string when successful +func (m *ItemOrganizationRolesPostRequestBody) GetPermissions()([]string) { + return m.permissions +} +// Serialize serializes information the current object +func (m *ItemOrganizationRolesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetPermissions() != nil { + err := writer.WriteCollectionOfStringValues("permissions", m.GetPermissions()) + 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 *ItemOrganizationRolesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. A short description about the intended usage of this role or what permissions it grants. +func (m *ItemOrganizationRolesPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetName sets the name property value. The name of the custom role. +func (m *ItemOrganizationRolesPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetPermissions sets the permissions property value. A list of additional permissions included in this role. +func (m *ItemOrganizationRolesPostRequestBody) SetPermissions(value []string)() { + m.permissions = value +} +type ItemOrganizationRolesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetName()(*string) + GetPermissions()([]string) + SetDescription(value *string)() + SetName(value *string)() + SetPermissions(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_request_builder.go new file mode 100644 index 000000000..8a7ddf964 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_request_builder.go @@ -0,0 +1,123 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemOrganizationRolesRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles +type ItemOrganizationRolesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRole_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.organizationRoles.item collection +// returns a *ItemOrganizationRolesWithRole_ItemRequestBuilder when successful +func (m *ItemOrganizationRolesRequestBuilder) ByRole_id(role_id int32)(*ItemOrganizationRolesWithRole_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["role_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(role_id), 10) + return NewItemOrganizationRolesWithRole_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemOrganizationRolesRequestBuilderInternal instantiates a new ItemOrganizationRolesRequestBuilder and sets the default values. +func NewItemOrganizationRolesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesRequestBuilder) { + m := &ItemOrganizationRolesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles", pathParameters), + } + return m +} +// NewItemOrganizationRolesRequestBuilder instantiates a new ItemOrganizationRolesRequestBuilder and sets the default values. +func NewItemOrganizationRolesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the organization roles available in this organization. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To use this endpoint, the authenticated user must be one of:- An administrator for the organization.- A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemOrganizationRolesGetResponseable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/organization-roles#get-all-organization-roles-for-an-organization +func (m *ItemOrganizationRolesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemOrganizationRolesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemOrganizationRolesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemOrganizationRolesGetResponseable), nil +} +// Post creates a custom organization role that can be assigned to users and teams, granting them specific permissions over the organization. For more information on custom organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To use this endpoint, the authenticated user must be one of:- An administrator for the organization.- A user, or a user on a team, with the fine-grained permissions of `write_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a OrganizationRoleable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/organization-roles#create-a-custom-organization-role +func (m *ItemOrganizationRolesRequestBuilder) Post(ctx context.Context, body ItemOrganizationRolesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationRoleable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationRoleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationRoleable), nil +} +// Teams the teams property +// returns a *ItemOrganizationRolesTeamsRequestBuilder when successful +func (m *ItemOrganizationRolesRequestBuilder) Teams()(*ItemOrganizationRolesTeamsRequestBuilder) { + return NewItemOrganizationRolesTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists the organization roles available in this organization. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To use this endpoint, the authenticated user must be one of:- An administrator for the organization.- A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a custom organization role that can be assigned to users and teams, granting them specific permissions over the organization. For more information on custom organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To use this endpoint, the authenticated user must be one of:- An administrator for the organization.- A user, or a user on a team, with the fine-grained permissions of `write_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemOrganizationRolesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// Users the users property +// returns a *ItemOrganizationRolesUsersRequestBuilder when successful +func (m *ItemOrganizationRolesRequestBuilder) Users()(*ItemOrganizationRolesUsersRequestBuilder) { + return NewItemOrganizationRolesUsersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemOrganizationRolesRequestBuilder when successful +func (m *ItemOrganizationRolesRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationRolesRequestBuilder) { + return NewItemOrganizationRolesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_response.go new file mode 100644 index 000000000..bda5702d1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemOrganizationRolesResponse +// Deprecated: This class is obsolete. Use organizationRolesGetResponse instead. +type ItemOrganizationRolesResponse struct { + ItemOrganizationRolesGetResponse +} +// NewItemOrganizationRolesResponse instantiates a new ItemOrganizationRolesResponse and sets the default values. +func NewItemOrganizationRolesResponse()(*ItemOrganizationRolesResponse) { + m := &ItemOrganizationRolesResponse{ + ItemOrganizationRolesGetResponse: *NewItemOrganizationRolesGetResponse(), + } + return m +} +// CreateItemOrganizationRolesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemOrganizationRolesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemOrganizationRolesResponse(), nil +} +// ItemOrganizationRolesResponseable +// Deprecated: This class is obsolete. Use organizationRolesGetResponse instead. +type ItemOrganizationRolesResponseable interface { + ItemOrganizationRolesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_teams_item_with_role_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_teams_item_with_role_item_request_builder.go new file mode 100644 index 000000000..a819e4e16 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_teams_item_with_role_item_request_builder.go @@ -0,0 +1,73 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\teams\{team_slug}\{role_id} +type ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilderInternal instantiates a new ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder) { + m := &ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}", pathParameters), + } + return m +} +// NewItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder instantiates a new ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes an organization role from a team. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-team +func (m *ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put assigns an organization role to a team in an organization. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team +func (m *ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes an organization role from a team. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToPutRequestInformation assigns an organization role to a team in an organization. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder when successful +func (m *ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder) { + return NewItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_teams_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_teams_request_builder.go new file mode 100644 index 000000000..5b1019060 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_teams_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemOrganizationRolesTeamsRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\teams +type ItemOrganizationRolesTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByTeam_slug gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.organizationRoles.teams.item collection +// returns a *ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder when successful +func (m *ItemOrganizationRolesTeamsRequestBuilder) ByTeam_slug(team_slug string)(*ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if team_slug != "" { + urlTplParams["team_slug"] = team_slug + } + return NewItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemOrganizationRolesTeamsRequestBuilderInternal instantiates a new ItemOrganizationRolesTeamsRequestBuilder and sets the default values. +func NewItemOrganizationRolesTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesTeamsRequestBuilder) { + m := &ItemOrganizationRolesTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/teams", pathParameters), + } + return m +} +// NewItemOrganizationRolesTeamsRequestBuilder instantiates a new ItemOrganizationRolesTeamsRequestBuilder and sets the default values. +func NewItemOrganizationRolesTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesTeamsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_teams_with_team_slug_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_teams_with_team_slug_item_request_builder.go new file mode 100644 index 000000000..86f6cfb65 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_teams_with_team_slug_item_request_builder.go @@ -0,0 +1,62 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\teams\{team_slug} +type ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRole_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.organizationRoles.teams.item.item collection +// returns a *ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder when successful +func (m *ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder) ByRole_id(role_id int32)(*ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["role_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(role_id), 10) + return NewItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilderInternal instantiates a new ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder) { + m := &ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/teams/{team_slug}", pathParameters), + } + return m +} +// NewItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder instantiates a new ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes all assigned organization roles from a team. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-team +func (m *ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes all assigned organization roles from a team. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder when successful +func (m *ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder) { + return NewItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_users_item_with_role_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_users_item_with_role_item_request_builder.go new file mode 100644 index 000000000..924a38a5f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_users_item_with_role_item_request_builder.go @@ -0,0 +1,73 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\users\{username}\{role_id} +type ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemOrganizationRolesUsersItemWithRole_ItemRequestBuilderInternal instantiates a new ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesUsersItemWithRole_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder) { + m := &ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/users/{username}/{role_id}", pathParameters), + } + return m +} +// NewItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder instantiates a new ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesUsersItemWithRole_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete remove an organization role from a user. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-user +func (m *ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put assigns an organization role to a member of an organization. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user +func (m *ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation remove an organization role from a user. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToPutRequestInformation assigns an organization role to a member of an organization. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder when successful +func (m *ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder) { + return NewItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_users_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_users_request_builder.go new file mode 100644 index 000000000..d9a38e908 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_users_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemOrganizationRolesUsersRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\users +type ItemOrganizationRolesUsersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByUsername gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.organizationRoles.users.item collection +// returns a *ItemOrganizationRolesUsersWithUsernameItemRequestBuilder when successful +func (m *ItemOrganizationRolesUsersRequestBuilder) ByUsername(username string)(*ItemOrganizationRolesUsersWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemOrganizationRolesUsersWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemOrganizationRolesUsersRequestBuilderInternal instantiates a new ItemOrganizationRolesUsersRequestBuilder and sets the default values. +func NewItemOrganizationRolesUsersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesUsersRequestBuilder) { + m := &ItemOrganizationRolesUsersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/users", pathParameters), + } + return m +} +// NewItemOrganizationRolesUsersRequestBuilder instantiates a new ItemOrganizationRolesUsersRequestBuilder and sets the default values. +func NewItemOrganizationRolesUsersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesUsersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesUsersRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_users_with_username_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_users_with_username_item_request_builder.go new file mode 100644 index 000000000..bfa7d5f37 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_users_with_username_item_request_builder.go @@ -0,0 +1,62 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemOrganizationRolesUsersWithUsernameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\users\{username} +type ItemOrganizationRolesUsersWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRole_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.organizationRoles.users.item.item collection +// returns a *ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder when successful +func (m *ItemOrganizationRolesUsersWithUsernameItemRequestBuilder) ByRole_id(role_id int32)(*ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["role_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(role_id), 10) + return NewItemOrganizationRolesUsersItemWithRole_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemOrganizationRolesUsersWithUsernameItemRequestBuilderInternal instantiates a new ItemOrganizationRolesUsersWithUsernameItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesUsersWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesUsersWithUsernameItemRequestBuilder) { + m := &ItemOrganizationRolesUsersWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/users/{username}", pathParameters), + } + return m +} +// NewItemOrganizationRolesUsersWithUsernameItemRequestBuilder instantiates a new ItemOrganizationRolesUsersWithUsernameItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesUsersWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesUsersWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesUsersWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete revokes all assigned organization roles from a user. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-user +func (m *ItemOrganizationRolesUsersWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation revokes all assigned organization roles from a user. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesUsersWithUsernameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemOrganizationRolesUsersWithUsernameItemRequestBuilder when successful +func (m *ItemOrganizationRolesUsersWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationRolesUsersWithUsernameItemRequestBuilder) { + return NewItemOrganizationRolesUsersWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_with_role_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_with_role_item_request_builder.go new file mode 100644 index 000000000..af989f806 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_organization_roles_with_role_item_request_builder.go @@ -0,0 +1,134 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemOrganizationRolesWithRole_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\{role_id} +type ItemOrganizationRolesWithRole_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemOrganizationRolesWithRole_ItemRequestBuilderInternal instantiates a new ItemOrganizationRolesWithRole_ItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesWithRole_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesWithRole_ItemRequestBuilder) { + m := &ItemOrganizationRolesWithRole_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/{role_id}", pathParameters), + } + return m +} +// NewItemOrganizationRolesWithRole_ItemRequestBuilder instantiates a new ItemOrganizationRolesWithRole_ItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesWithRole_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesWithRole_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesWithRole_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a custom organization role. For more information on custom organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To use this endpoint, the authenticated user must be one of:- An administrator for the organization.- A user, or a user on a team, with the fine-grained permissions of `write_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/organization-roles#delete-a-custom-organization-role +func (m *ItemOrganizationRolesWithRole_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets an organization role that is available to this organization. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To use this endpoint, the authenticated user must be one of:- An administrator for the organization.- A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a OrganizationRoleable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role +func (m *ItemOrganizationRolesWithRole_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationRoleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationRoleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationRoleable), nil +} +// Patch updates an existing custom organization role. Permission changes will apply to all assignees. For more information on custom organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To use this endpoint, the authenticated user must be one of:- An administrator for the organization.- A user, or a user on a team, with the fine-grained permissions of `write_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a OrganizationRoleable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/organization-roles#update-a-custom-organization-role +func (m *ItemOrganizationRolesWithRole_ItemRequestBuilder) Patch(ctx context.Context, body ItemOrganizationRolesItemWithRole_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationRoleable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationRoleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationRoleable), nil +} +// Teams the teams property +// returns a *ItemOrganizationRolesItemTeamsRequestBuilder when successful +func (m *ItemOrganizationRolesWithRole_ItemRequestBuilder) Teams()(*ItemOrganizationRolesItemTeamsRequestBuilder) { + return NewItemOrganizationRolesItemTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a custom organization role. For more information on custom organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To use this endpoint, the authenticated user must be one of:- An administrator for the organization.- A user, or a user on a team, with the fine-grained permissions of `write_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesWithRole_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets an organization role that is available to this organization. For more information on organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To use this endpoint, the authenticated user must be one of:- An administrator for the organization.- A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesWithRole_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates an existing custom organization role. Permission changes will apply to all assignees. For more information on custom organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To use this endpoint, the authenticated user must be one of:- An administrator for the organization.- A user, or a user on a team, with the fine-grained permissions of `write_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesWithRole_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemOrganizationRolesItemWithRole_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// Users the users property +// returns a *ItemOrganizationRolesItemUsersRequestBuilder when successful +func (m *ItemOrganizationRolesWithRole_ItemRequestBuilder) Users()(*ItemOrganizationRolesItemUsersRequestBuilder) { + return NewItemOrganizationRolesItemUsersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemOrganizationRolesWithRole_ItemRequestBuilder when successful +func (m *ItemOrganizationRolesWithRole_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationRolesWithRole_ItemRequestBuilder) { + return NewItemOrganizationRolesWithRole_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_item_with_username422_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_item_with_username422_error.go new file mode 100644 index 000000000..8e9032825 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_item_with_username422_error.go @@ -0,0 +1,117 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemOutside_collaboratorsItemWithUsername422Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewItemOutside_collaboratorsItemWithUsername422Error instantiates a new ItemOutside_collaboratorsItemWithUsername422Error and sets the default values. +func NewItemOutside_collaboratorsItemWithUsername422Error()(*ItemOutside_collaboratorsItemWithUsername422Error) { + m := &ItemOutside_collaboratorsItemWithUsername422Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemOutside_collaboratorsItemWithUsername422ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemOutside_collaboratorsItemWithUsername422ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemOutside_collaboratorsItemWithUsername422Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemOutside_collaboratorsItemWithUsername422Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemOutside_collaboratorsItemWithUsername422Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ItemOutside_collaboratorsItemWithUsername422Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemOutside_collaboratorsItemWithUsername422Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ItemOutside_collaboratorsItemWithUsername422Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemOutside_collaboratorsItemWithUsername422Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ItemOutside_collaboratorsItemWithUsername422Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemOutside_collaboratorsItemWithUsername422Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *ItemOutside_collaboratorsItemWithUsername422Error) SetMessage(value *string)() { + m.message = value +} +type ItemOutside_collaboratorsItemWithUsername422Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_item_with_username_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_item_with_username_put_request_body.go new file mode 100644 index 000000000..b66410787 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_item_with_username_put_request_body.go @@ -0,0 +1,80 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemOutside_collaboratorsItemWithUsernamePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // When set to `true`, the request will be performed asynchronously. Returns a 202 status code when the job is successfully queued. + async *bool +} +// NewItemOutside_collaboratorsItemWithUsernamePutRequestBody instantiates a new ItemOutside_collaboratorsItemWithUsernamePutRequestBody and sets the default values. +func NewItemOutside_collaboratorsItemWithUsernamePutRequestBody()(*ItemOutside_collaboratorsItemWithUsernamePutRequestBody) { + m := &ItemOutside_collaboratorsItemWithUsernamePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemOutside_collaboratorsItemWithUsernamePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemOutside_collaboratorsItemWithUsernamePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemOutside_collaboratorsItemWithUsernamePutRequestBody(), 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 *ItemOutside_collaboratorsItemWithUsernamePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAsync gets the async property value. When set to `true`, the request will be performed asynchronously. Returns a 202 status code when the job is successfully queued. +// returns a *bool when successful +func (m *ItemOutside_collaboratorsItemWithUsernamePutRequestBody) GetAsync()(*bool) { + return m.async +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemOutside_collaboratorsItemWithUsernamePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["async"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAsync(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemOutside_collaboratorsItemWithUsernamePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("async", m.GetAsync()) + 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 *ItemOutside_collaboratorsItemWithUsernamePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAsync sets the async property value. When set to `true`, the request will be performed asynchronously. Returns a 202 status code when the job is successfully queued. +func (m *ItemOutside_collaboratorsItemWithUsernamePutRequestBody) SetAsync(value *bool)() { + m.async = value +} +type ItemOutside_collaboratorsItemWithUsernamePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAsync()(*bool) + SetAsync(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_item_with_username_put_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_item_with_username_put_response.go new file mode 100644 index 000000000..c00c2ff4b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_item_with_username_put_response.go @@ -0,0 +1,32 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemOutside_collaboratorsItemWithUsernamePutResponse struct { +} +// NewItemOutside_collaboratorsItemWithUsernamePutResponse instantiates a new ItemOutside_collaboratorsItemWithUsernamePutResponse and sets the default values. +func NewItemOutside_collaboratorsItemWithUsernamePutResponse()(*ItemOutside_collaboratorsItemWithUsernamePutResponse) { + m := &ItemOutside_collaboratorsItemWithUsernamePutResponse{ + } + return m +} +// CreateItemOutside_collaboratorsItemWithUsernamePutResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemOutside_collaboratorsItemWithUsernamePutResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemOutside_collaboratorsItemWithUsernamePutResponse(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemOutside_collaboratorsItemWithUsernamePutResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemOutside_collaboratorsItemWithUsernamePutResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +type ItemOutside_collaboratorsItemWithUsernamePutResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_item_with_username_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_item_with_username_response.go new file mode 100644 index 000000000..c02f5138b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_item_with_username_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemOutside_collaboratorsItemWithUsernameResponse +// Deprecated: This class is obsolete. Use WithUsernamePutResponse instead. +type ItemOutside_collaboratorsItemWithUsernameResponse struct { + ItemOutside_collaboratorsItemWithUsernamePutResponse +} +// NewItemOutside_collaboratorsItemWithUsernameResponse instantiates a new ItemOutside_collaboratorsItemWithUsernameResponse and sets the default values. +func NewItemOutside_collaboratorsItemWithUsernameResponse()(*ItemOutside_collaboratorsItemWithUsernameResponse) { + m := &ItemOutside_collaboratorsItemWithUsernameResponse{ + ItemOutside_collaboratorsItemWithUsernamePutResponse: *NewItemOutside_collaboratorsItemWithUsernamePutResponse(), + } + return m +} +// CreateItemOutside_collaboratorsItemWithUsernameResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemOutside_collaboratorsItemWithUsernameResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemOutside_collaboratorsItemWithUsernameResponse(), nil +} +// ItemOutside_collaboratorsItemWithUsernameResponseable +// Deprecated: This class is obsolete. Use WithUsernamePutResponse instead. +type ItemOutside_collaboratorsItemWithUsernameResponseable interface { + ItemOutside_collaboratorsItemWithUsernamePutResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_request_builder.go new file mode 100644 index 000000000..4cf8260ea --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_request_builder.go @@ -0,0 +1,82 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + if595b4d15d1c00ac6fbf03ef6c7dd96d7dbb91167133353a2db35acca910c87d "github.com/octokit/go-sdk/pkg/github/orgs/item/outside_collaborators" +) + +// ItemOutside_collaboratorsRequestBuilder builds and executes requests for operations under \orgs\{org}\outside_collaborators +type ItemOutside_collaboratorsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemOutside_collaboratorsRequestBuilderGetQueryParameters list all users who are outside collaborators of an organization. +type ItemOutside_collaboratorsRequestBuilderGetQueryParameters struct { + // Filter the list of outside collaborators. `2fa_disabled` means that only outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. + Filter *if595b4d15d1c00ac6fbf03ef6c7dd96d7dbb91167133353a2db35acca910c87d.GetFilterQueryParameterType `uriparametername:"filter"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.outside_collaborators.item collection +// returns a *ItemOutside_collaboratorsWithUsernameItemRequestBuilder when successful +func (m *ItemOutside_collaboratorsRequestBuilder) ByUsername(username string)(*ItemOutside_collaboratorsWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemOutside_collaboratorsWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemOutside_collaboratorsRequestBuilderInternal instantiates a new ItemOutside_collaboratorsRequestBuilder and sets the default values. +func NewItemOutside_collaboratorsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOutside_collaboratorsRequestBuilder) { + m := &ItemOutside_collaboratorsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/outside_collaborators{?filter*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemOutside_collaboratorsRequestBuilder instantiates a new ItemOutside_collaboratorsRequestBuilder and sets the default values. +func NewItemOutside_collaboratorsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOutside_collaboratorsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOutside_collaboratorsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all users who are outside collaborators of an organization. +// returns a []SimpleUserable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization +func (m *ItemOutside_collaboratorsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemOutside_collaboratorsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation list all users who are outside collaborators of an organization. +// returns a *RequestInformation when successful +func (m *ItemOutside_collaboratorsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemOutside_collaboratorsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemOutside_collaboratorsRequestBuilder when successful +func (m *ItemOutside_collaboratorsRequestBuilder) WithUrl(rawUrl string)(*ItemOutside_collaboratorsRequestBuilder) { + return NewItemOutside_collaboratorsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_with_username_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_with_username_item_request_builder.go new file mode 100644 index 000000000..ff0e1cc1f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_outside_collaborators_with_username_item_request_builder.go @@ -0,0 +1,92 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemOutside_collaboratorsWithUsernameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\outside_collaborators\{username} +type ItemOutside_collaboratorsWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemOutside_collaboratorsWithUsernameItemRequestBuilderInternal instantiates a new ItemOutside_collaboratorsWithUsernameItemRequestBuilder and sets the default values. +func NewItemOutside_collaboratorsWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOutside_collaboratorsWithUsernameItemRequestBuilder) { + m := &ItemOutside_collaboratorsWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/outside_collaborators/{username}", pathParameters), + } + return m +} +// NewItemOutside_collaboratorsWithUsernameItemRequestBuilder instantiates a new ItemOutside_collaboratorsWithUsernameItemRequestBuilder and sets the default values. +func NewItemOutside_collaboratorsWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOutside_collaboratorsWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOutside_collaboratorsWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removing a user from this list will remove them from all the organization's repositories. +// returns a ItemOutside_collaboratorsItemWithUsername422Error error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization +func (m *ItemOutside_collaboratorsWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": CreateItemOutside_collaboratorsItemWithUsername422ErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put when an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." +// returns a ItemOutside_collaboratorsItemWithUsernamePutResponseable 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/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator +func (m *ItemOutside_collaboratorsWithUsernameItemRequestBuilder) Put(ctx context.Context, body ItemOutside_collaboratorsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemOutside_collaboratorsItemWithUsernamePutResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemOutside_collaboratorsItemWithUsernamePutResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemOutside_collaboratorsItemWithUsernamePutResponseable), nil +} +// ToDeleteRequestInformation removing a user from this list will remove them from all the organization's repositories. +// returns a *RequestInformation when successful +func (m *ItemOutside_collaboratorsWithUsernameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation when an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." +// returns a *RequestInformation when successful +func (m *ItemOutside_collaboratorsWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemOutside_collaboratorsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemOutside_collaboratorsWithUsernameItemRequestBuilder when successful +func (m *ItemOutside_collaboratorsWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemOutside_collaboratorsWithUsernameItemRequestBuilder) { + return NewItemOutside_collaboratorsWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_item_item_restore_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_item_item_restore_request_builder.go new file mode 100644 index 000000000..256f98fec --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_item_item_restore_request_builder.go @@ -0,0 +1,66 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPackagesItemItemRestoreRequestBuilder builds and executes requests for operations under \orgs\{org}\packages\{package_type}\{package_name}\restore +type ItemPackagesItemItemRestoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPackagesItemItemRestoreRequestBuilderPostQueryParameters restores an entire package in an organization.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +type ItemPackagesItemItemRestoreRequestBuilderPostQueryParameters struct { + // package token + Token *string `uriparametername:"token"` +} +// NewItemPackagesItemItemRestoreRequestBuilderInternal instantiates a new ItemPackagesItemItemRestoreRequestBuilder and sets the default values. +func NewItemPackagesItemItemRestoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemRestoreRequestBuilder) { + m := &ItemPackagesItemItemRestoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/packages/{package_type}/{package_name}/restore{?token*}", pathParameters), + } + return m +} +// NewItemPackagesItemItemRestoreRequestBuilder instantiates a new ItemPackagesItemItemRestoreRequestBuilder and sets the default values. +func NewItemPackagesItemItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemRestoreRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemItemRestoreRequestBuilderInternal(urlParams, requestAdapter) +} +// Post restores an entire package in an organization.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization +func (m *ItemPackagesItemItemRestoreRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesItemItemRestoreRequestBuilderPostQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation restores an entire package in an organization.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesItemItemRestoreRequestBuilderPostQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPackagesItemItemRestoreRequestBuilder when successful +func (m *ItemPackagesItemItemRestoreRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemItemRestoreRequestBuilder) { + return NewItemPackagesItemItemRestoreRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_item_item_versions_item_restore_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_item_item_versions_item_restore_request_builder.go new file mode 100644 index 000000000..c1ad7697c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_item_item_versions_item_restore_request_builder.go @@ -0,0 +1,61 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPackagesItemItemVersionsItemRestoreRequestBuilder builds and executes requests for operations under \orgs\{org}\packages\{package_type}\{package_name}\versions\{package_version_id}\restore +type ItemPackagesItemItemVersionsItemRestoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPackagesItemItemVersionsItemRestoreRequestBuilderInternal instantiates a new ItemPackagesItemItemVersionsItemRestoreRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsItemRestoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsItemRestoreRequestBuilder) { + m := &ItemPackagesItemItemVersionsItemRestoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore", pathParameters), + } + return m +} +// NewItemPackagesItemItemVersionsItemRestoreRequestBuilder instantiates a new ItemPackagesItemItemVersionsItemRestoreRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsItemRestoreRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemItemVersionsItemRestoreRequestBuilderInternal(urlParams, requestAdapter) +} +// Post restores a specific package version in an organization.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization +func (m *ItemPackagesItemItemVersionsItemRestoreRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation restores a specific package version in an organization.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemVersionsItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPackagesItemItemVersionsItemRestoreRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsItemRestoreRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemItemVersionsItemRestoreRequestBuilder) { + return NewItemPackagesItemItemVersionsItemRestoreRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_item_item_versions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_item_item_versions_request_builder.go new file mode 100644 index 000000000..2078e44ee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_item_item_versions_request_builder.go @@ -0,0 +1,89 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i9a34b8e68f433e2618d3e623e60543e9c60f8c189bf5031f9180afed55466b3f "github.com/octokit/go-sdk/pkg/github/orgs/item/packages/item/item/versions" +) + +// ItemPackagesItemItemVersionsRequestBuilder builds and executes requests for operations under \orgs\{org}\packages\{package_type}\{package_name}\versions +type ItemPackagesItemItemVersionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPackagesItemItemVersionsRequestBuilderGetQueryParameters lists package versions for a package owned by an organization.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +type ItemPackagesItemItemVersionsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The state of the package, either active or deleted. + State *i9a34b8e68f433e2618d3e623e60543e9c60f8c189bf5031f9180afed55466b3f.GetStateQueryParameterType `uriparametername:"state"` +} +// ByPackage_version_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.packages.item.item.versions.item collection +// returns a *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsRequestBuilder) ByPackage_version_id(package_version_id int32)(*ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["package_version_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(package_version_id), 10) + return NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPackagesItemItemVersionsRequestBuilderInternal instantiates a new ItemPackagesItemItemVersionsRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsRequestBuilder) { + m := &ItemPackagesItemItemVersionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/packages/{package_type}/{package_name}/versions{?page*,per_page*,state*}", pathParameters), + } + return m +} +// NewItemPackagesItemItemVersionsRequestBuilder instantiates a new ItemPackagesItemItemVersionsRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemItemVersionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists package versions for a package owned by an organization.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a []PackageVersionable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization +func (m *ItemPackagesItemItemVersionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesItemItemVersionsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageVersionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePackageVersionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageVersionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageVersionable) + } + } + return val, nil +} +// ToGetRequestInformation lists package versions for a package owned by an organization.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemVersionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesItemItemVersionsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPackagesItemItemVersionsRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemItemVersionsRequestBuilder) { + return NewItemPackagesItemItemVersionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_item_item_versions_with_package_version_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_item_item_versions_with_package_version_item_request_builder.go new file mode 100644 index 000000000..8de2325fa --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_item_item_versions_with_package_version_item_request_builder.go @@ -0,0 +1,93 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\packages\{package_type}\{package_name}\versions\{package_version_id} +type ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal instantiates a new ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + m := &ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}", pathParameters), + } + return m +} +// NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder instantiates a new ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a specific package version in an organization. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a specific package version in an organization.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a PackageVersionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageVersionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePackageVersionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageVersionable), nil +} +// Restore the restore property +// returns a *ItemPackagesItemItemVersionsItemRestoreRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) Restore()(*ItemPackagesItemItemVersionsItemRestoreRequestBuilder) { + return NewItemPackagesItemItemVersionsItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a specific package version in an organization. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets a specific package version in an organization.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + return NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_item_with_package_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_item_with_package_name_item_request_builder.go new file mode 100644 index 000000000..e2a3ad97b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_item_with_package_name_item_request_builder.go @@ -0,0 +1,98 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPackagesItemWithPackage_nameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\packages\{package_type}\{package_name} +type ItemPackagesItemWithPackage_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPackagesItemWithPackage_nameItemRequestBuilderInternal instantiates a new ItemPackagesItemWithPackage_nameItemRequestBuilder and sets the default values. +func NewItemPackagesItemWithPackage_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemWithPackage_nameItemRequestBuilder) { + m := &ItemPackagesItemWithPackage_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/packages/{package_type}/{package_name}", pathParameters), + } + return m +} +// NewItemPackagesItemWithPackage_nameItemRequestBuilder instantiates a new ItemPackagesItemWithPackage_nameItemRequestBuilder and sets the default values. +func NewItemPackagesItemWithPackage_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemWithPackage_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemWithPackage_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes an entire package in an organization. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a specific package in an organization.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a PackageEscapedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePackageEscapedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable), nil +} +// Restore the restore property +// returns a *ItemPackagesItemItemRestoreRequestBuilder when successful +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) Restore()(*ItemPackagesItemItemRestoreRequestBuilder) { + return NewItemPackagesItemItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes an entire package in an organization. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets a specific package in an organization.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// Versions the versions property +// returns a *ItemPackagesItemItemVersionsRequestBuilder when successful +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) Versions()(*ItemPackagesItemItemVersionsRequestBuilder) { + return NewItemPackagesItemItemVersionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPackagesItemWithPackage_nameItemRequestBuilder when successful +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemWithPackage_nameItemRequestBuilder) { + return NewItemPackagesItemWithPackage_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_request_builder.go new file mode 100644 index 000000000..1c073f799 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_request_builder.go @@ -0,0 +1,90 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i54a313bac026cb0feec5bbef0f57abc11427cc4e5752056265b05087fd0d9089 "github.com/octokit/go-sdk/pkg/github/orgs/item/packages" +) + +// ItemPackagesRequestBuilder builds and executes requests for operations under \orgs\{org}\packages +type ItemPackagesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPackagesRequestBuilderGetQueryParameters lists packages in an organization readable by the user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +type ItemPackagesRequestBuilderGetQueryParameters struct { + // The type of supported package. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. + Package_type *i54a313bac026cb0feec5bbef0f57abc11427cc4e5752056265b05087fd0d9089.GetPackage_typeQueryParameterType `uriparametername:"package_type"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The selected visibility of the packages. This parameter is optional and only filters an existing result set.The `internal` visibility is only supported for GitHub Packages registries that allow for granular permissions. For other ecosystems `internal` is synonymous with `private`.For the list of GitHub Packages registries that support granular permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." + Visibility *i54a313bac026cb0feec5bbef0f57abc11427cc4e5752056265b05087fd0d9089.GetVisibilityQueryParameterType `uriparametername:"visibility"` +} +// ByPackage_type gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.packages.item collection +// returns a *ItemPackagesWithPackage_typeItemRequestBuilder when successful +func (m *ItemPackagesRequestBuilder) ByPackage_type(package_type string)(*ItemPackagesWithPackage_typeItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if package_type != "" { + urlTplParams["package_type"] = package_type + } + return NewItemPackagesWithPackage_typeItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPackagesRequestBuilderInternal instantiates a new ItemPackagesRequestBuilder and sets the default values. +func NewItemPackagesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesRequestBuilder) { + m := &ItemPackagesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/packages?package_type={package_type}{&page*,per_page*,visibility*}", pathParameters), + } + return m +} +// NewItemPackagesRequestBuilder instantiates a new ItemPackagesRequestBuilder and sets the default values. +func NewItemPackagesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists packages in an organization readable by the user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a []PackageEscapedable 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/packages/packages#list-packages-for-an-organization +func (m *ItemPackagesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePackageEscapedFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable) + } + } + return val, nil +} +// ToGetRequestInformation lists packages in an organization readable by the user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPackagesRequestBuilder when successful +func (m *ItemPackagesRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesRequestBuilder) { + return NewItemPackagesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_with_package_type_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_with_package_type_item_request_builder.go new file mode 100644 index 000000000..27b475e7e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_packages_with_package_type_item_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemPackagesWithPackage_typeItemRequestBuilder builds and executes requests for operations under \orgs\{org}\packages\{package_type} +type ItemPackagesWithPackage_typeItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByPackage_name gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.packages.item.item collection +// returns a *ItemPackagesItemWithPackage_nameItemRequestBuilder when successful +func (m *ItemPackagesWithPackage_typeItemRequestBuilder) ByPackage_name(package_name string)(*ItemPackagesItemWithPackage_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if package_name != "" { + urlTplParams["package_name"] = package_name + } + return NewItemPackagesItemWithPackage_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPackagesWithPackage_typeItemRequestBuilderInternal instantiates a new ItemPackagesWithPackage_typeItemRequestBuilder and sets the default values. +func NewItemPackagesWithPackage_typeItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesWithPackage_typeItemRequestBuilder) { + m := &ItemPackagesWithPackage_typeItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/packages/{package_type}", pathParameters), + } + return m +} +// NewItemPackagesWithPackage_typeItemRequestBuilder instantiates a new ItemPackagesWithPackage_typeItemRequestBuilder and sets the default values. +func NewItemPackagesWithPackage_typeItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesWithPackage_typeItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesWithPackage_typeItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_item_repositories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_item_repositories_request_builder.go new file mode 100644 index 000000000..e75a44d4e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_item_repositories_request_builder.go @@ -0,0 +1,75 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\personal-access-token-requests\{pat_request_id}\repositories +type ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilderGetQueryParameters lists the repositories a fine-grained personal access token request is requesting access to.Only GitHub Apps can use this endpoint. +type ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilderInternal instantiates a new ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder and sets the default values. +func NewItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder) { + m := &ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder instantiates a new ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder and sets the default values. +func NewItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the repositories a fine-grained personal access token request is requesting access to.Only GitHub Apps can use this endpoint. +// returns a []MinimalRepositoryable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-requested-to-be-accessed-by-a-fine-grained-personal-access-token +func (m *ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists the repositories a fine-grained personal access token request is requesting access to.Only GitHub Apps can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder when successful +func (m *ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder) { + return NewItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_item_with_pat_request_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_item_with_pat_request_post_request_body.go new file mode 100644 index 000000000..f6bef394c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_item_with_pat_request_post_request_body.go @@ -0,0 +1,80 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Reason for approving or denying the request. Max 1024 characters. + reason *string +} +// NewItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody instantiates a new ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody and sets the default values. +func NewItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody()(*ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody) { + m := &ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody(), 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 *ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + return res +} +// GetReason gets the reason property value. Reason for approving or denying the request. Max 1024 characters. +// returns a *string when successful +func (m *ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody) GetReason()(*string) { + return m.reason +} +// Serialize serializes information the current object +func (m *ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("reason", m.GetReason()) + 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 *ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetReason sets the reason property value. Reason for approving or denying the request. Max 1024 characters. +func (m *ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody) SetReason(value *string)() { + m.reason = value +} +type ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetReason()(*string) + SetReason(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_post_request_body.go new file mode 100644 index 000000000..41fc7db9b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_post_request_body.go @@ -0,0 +1,115 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemPersonalAccessTokenRequestsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Unique identifiers of the requests for access via fine-grained personal access token. Must be formed of between 1 and 100 `pat_request_id` values. + pat_request_ids []int32 + // Reason for approving or denying the requests. Max 1024 characters. + reason *string +} +// NewItemPersonalAccessTokenRequestsPostRequestBody instantiates a new ItemPersonalAccessTokenRequestsPostRequestBody and sets the default values. +func NewItemPersonalAccessTokenRequestsPostRequestBody()(*ItemPersonalAccessTokenRequestsPostRequestBody) { + m := &ItemPersonalAccessTokenRequestsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPersonalAccessTokenRequestsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPersonalAccessTokenRequestsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPersonalAccessTokenRequestsPostRequestBody(), 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 *ItemPersonalAccessTokenRequestsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemPersonalAccessTokenRequestsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["pat_request_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetPatRequestIds(res) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + return res +} +// GetPatRequestIds gets the pat_request_ids property value. Unique identifiers of the requests for access via fine-grained personal access token. Must be formed of between 1 and 100 `pat_request_id` values. +// returns a []int32 when successful +func (m *ItemPersonalAccessTokenRequestsPostRequestBody) GetPatRequestIds()([]int32) { + return m.pat_request_ids +} +// GetReason gets the reason property value. Reason for approving or denying the requests. Max 1024 characters. +// returns a *string when successful +func (m *ItemPersonalAccessTokenRequestsPostRequestBody) GetReason()(*string) { + return m.reason +} +// Serialize serializes information the current object +func (m *ItemPersonalAccessTokenRequestsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetPatRequestIds() != nil { + err := writer.WriteCollectionOfInt32Values("pat_request_ids", m.GetPatRequestIds()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + 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 *ItemPersonalAccessTokenRequestsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPatRequestIds sets the pat_request_ids property value. Unique identifiers of the requests for access via fine-grained personal access token. Must be formed of between 1 and 100 `pat_request_id` values. +func (m *ItemPersonalAccessTokenRequestsPostRequestBody) SetPatRequestIds(value []int32)() { + m.pat_request_ids = value +} +// SetReason sets the reason property value. Reason for approving or denying the requests. Max 1024 characters. +func (m *ItemPersonalAccessTokenRequestsPostRequestBody) SetReason(value *string)() { + m.reason = value +} +type ItemPersonalAccessTokenRequestsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPatRequestIds()([]int32) + GetReason()(*string) + SetPatRequestIds(value []int32)() + SetReason(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_post_response.go new file mode 100644 index 000000000..46e954406 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_post_response.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemPersonalAccessTokenRequestsPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemPersonalAccessTokenRequestsPostResponse instantiates a new ItemPersonalAccessTokenRequestsPostResponse and sets the default values. +func NewItemPersonalAccessTokenRequestsPostResponse()(*ItemPersonalAccessTokenRequestsPostResponse) { + m := &ItemPersonalAccessTokenRequestsPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPersonalAccessTokenRequestsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPersonalAccessTokenRequestsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPersonalAccessTokenRequestsPostResponse(), 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 *ItemPersonalAccessTokenRequestsPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemPersonalAccessTokenRequestsPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemPersonalAccessTokenRequestsPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemPersonalAccessTokenRequestsPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemPersonalAccessTokenRequestsPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_request_builder.go new file mode 100644 index 000000000..1ae16601e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_request_builder.go @@ -0,0 +1,145 @@ +package orgs + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + if40f6bba016cf7cc8e1dd7375501cb9368628a1bf123e37f5946192c743664a2 "github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokenrequests" +) + +// ItemPersonalAccessTokenRequestsRequestBuilder builds and executes requests for operations under \orgs\{org}\personal-access-token-requests +type ItemPersonalAccessTokenRequestsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPersonalAccessTokenRequestsRequestBuilderGetQueryParameters lists requests from organization members to access organization resources with a fine-grained personal access token.Only GitHub Apps can use this endpoint. +type ItemPersonalAccessTokenRequestsRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *if40f6bba016cf7cc8e1dd7375501cb9368628a1bf123e37f5946192c743664a2.GetDirectionQueryParameterType `uriparametername:"direction"` + // Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Last_used_after *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"last_used_after"` + // Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Last_used_before *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"last_used_before"` + // A list of owner usernames to use to filter the results. + Owner []string `uriparametername:"owner"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The permission to use to filter the results. + Permission *string `uriparametername:"permission"` + // The name of the repository to use to filter the results. + Repository *string `uriparametername:"repository"` + // The property by which to sort the results. + Sort *if40f6bba016cf7cc8e1dd7375501cb9368628a1bf123e37f5946192c743664a2.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByPat_request_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.personalAccessTokenRequests.item collection +// returns a *ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder when successful +func (m *ItemPersonalAccessTokenRequestsRequestBuilder) ByPat_request_id(pat_request_id int32)(*ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["pat_request_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(pat_request_id), 10) + return NewItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPersonalAccessTokenRequestsRequestBuilderInternal instantiates a new ItemPersonalAccessTokenRequestsRequestBuilder and sets the default values. +func NewItemPersonalAccessTokenRequestsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokenRequestsRequestBuilder) { + m := &ItemPersonalAccessTokenRequestsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/personal-access-token-requests{?direction*,last_used_after*,last_used_before*,owner*,page*,per_page*,permission*,repository*,sort*}", pathParameters), + } + return m +} +// NewItemPersonalAccessTokenRequestsRequestBuilder instantiates a new ItemPersonalAccessTokenRequestsRequestBuilder and sets the default values. +func NewItemPersonalAccessTokenRequestsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokenRequestsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPersonalAccessTokenRequestsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists requests from organization members to access organization resources with a fine-grained personal access token.Only GitHub Apps can use this endpoint. +// returns a []OrganizationProgrammaticAccessGrantRequestable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/personal-access-tokens#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens +func (m *ItemPersonalAccessTokenRequestsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPersonalAccessTokenRequestsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationProgrammaticAccessGrantRequestable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationProgrammaticAccessGrantRequestFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationProgrammaticAccessGrantRequestable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationProgrammaticAccessGrantRequestable) + } + } + return val, nil +} +// Post approves or denies multiple pending requests to access organization resources via a fine-grained personal access token.Only GitHub Apps can use this endpoint. +// returns a ItemPersonalAccessTokenRequestsPostResponseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/personal-access-tokens#review-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens +func (m *ItemPersonalAccessTokenRequestsRequestBuilder) Post(ctx context.Context, body ItemPersonalAccessTokenRequestsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemPersonalAccessTokenRequestsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemPersonalAccessTokenRequestsPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemPersonalAccessTokenRequestsPostResponseable), nil +} +// ToGetRequestInformation lists requests from organization members to access organization resources with a fine-grained personal access token.Only GitHub Apps can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPersonalAccessTokenRequestsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPersonalAccessTokenRequestsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation approves or denies multiple pending requests to access organization resources via a fine-grained personal access token.Only GitHub Apps can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPersonalAccessTokenRequestsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemPersonalAccessTokenRequestsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPersonalAccessTokenRequestsRequestBuilder when successful +func (m *ItemPersonalAccessTokenRequestsRequestBuilder) WithUrl(rawUrl string)(*ItemPersonalAccessTokenRequestsRequestBuilder) { + return NewItemPersonalAccessTokenRequestsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_response.go new file mode 100644 index 000000000..91e94e148 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemPersonalAccessTokenRequestsResponse +// Deprecated: This class is obsolete. Use personalAccessTokenRequestsPostResponse instead. +type ItemPersonalAccessTokenRequestsResponse struct { + ItemPersonalAccessTokenRequestsPostResponse +} +// NewItemPersonalAccessTokenRequestsResponse instantiates a new ItemPersonalAccessTokenRequestsResponse and sets the default values. +func NewItemPersonalAccessTokenRequestsResponse()(*ItemPersonalAccessTokenRequestsResponse) { + m := &ItemPersonalAccessTokenRequestsResponse{ + ItemPersonalAccessTokenRequestsPostResponse: *NewItemPersonalAccessTokenRequestsPostResponse(), + } + return m +} +// CreateItemPersonalAccessTokenRequestsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemPersonalAccessTokenRequestsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPersonalAccessTokenRequestsResponse(), nil +} +// ItemPersonalAccessTokenRequestsResponseable +// Deprecated: This class is obsolete. Use personalAccessTokenRequestsPostResponse instead. +type ItemPersonalAccessTokenRequestsResponseable interface { + ItemPersonalAccessTokenRequestsPostResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_with_pat_request_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_with_pat_request_item_request_builder.go new file mode 100644 index 000000000..5cfab5efe --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_token_requests_with_pat_request_item_request_builder.go @@ -0,0 +1,72 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\personal-access-token-requests\{pat_request_id} +type ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilderInternal instantiates a new ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder and sets the default values. +func NewItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder) { + m := &ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/personal-access-token-requests/{pat_request_id}", pathParameters), + } + return m +} +// NewItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder instantiates a new ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder and sets the default values. +func NewItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Post approves or denies a pending request to access organization resources via a fine-grained personal access token.Only GitHub Apps can use this endpoint. +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token +func (m *ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder) Post(ctx context.Context, body ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Repositories the repositories property +// returns a *ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder when successful +func (m *ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder) Repositories()(*ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder) { + return NewItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToPostRequestInformation approves or denies a pending request to access organization resources via a fine-grained personal access token.Only GitHub Apps can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder when successful +func (m *ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder) { + return NewItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_item_repositories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_item_repositories_request_builder.go new file mode 100644 index 000000000..ce15bc39e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_item_repositories_request_builder.go @@ -0,0 +1,75 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPersonalAccessTokensItemRepositoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\personal-access-tokens\{pat_id}\repositories +type ItemPersonalAccessTokensItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPersonalAccessTokensItemRepositoriesRequestBuilderGetQueryParameters lists the repositories a fine-grained personal access token has access to.Only GitHub Apps can use this endpoint. +type ItemPersonalAccessTokensItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemPersonalAccessTokensItemRepositoriesRequestBuilderInternal instantiates a new ItemPersonalAccessTokensItemRepositoriesRequestBuilder and sets the default values. +func NewItemPersonalAccessTokensItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokensItemRepositoriesRequestBuilder) { + m := &ItemPersonalAccessTokensItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/personal-access-tokens/{pat_id}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemPersonalAccessTokensItemRepositoriesRequestBuilder instantiates a new ItemPersonalAccessTokensItemRepositoriesRequestBuilder and sets the default values. +func NewItemPersonalAccessTokensItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokensItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPersonalAccessTokensItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the repositories a fine-grained personal access token has access to.Only GitHub Apps can use this endpoint. +// returns a []MinimalRepositoryable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-a-fine-grained-personal-access-token-has-access-to +func (m *ItemPersonalAccessTokensItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPersonalAccessTokensItemRepositoriesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists the repositories a fine-grained personal access token has access to.Only GitHub Apps can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPersonalAccessTokensItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPersonalAccessTokensItemRepositoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPersonalAccessTokensItemRepositoriesRequestBuilder when successful +func (m *ItemPersonalAccessTokensItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemPersonalAccessTokensItemRepositoriesRequestBuilder) { + return NewItemPersonalAccessTokensItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_item_with_pat_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_item_with_pat_post_request_body.go new file mode 100644 index 000000000..4aba84f7a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_item_with_pat_post_request_body.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemPersonalAccessTokensItemWithPat_PostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemPersonalAccessTokensItemWithPat_PostRequestBody instantiates a new ItemPersonalAccessTokensItemWithPat_PostRequestBody and sets the default values. +func NewItemPersonalAccessTokensItemWithPat_PostRequestBody()(*ItemPersonalAccessTokensItemWithPat_PostRequestBody) { + m := &ItemPersonalAccessTokensItemWithPat_PostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPersonalAccessTokensItemWithPat_PostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPersonalAccessTokensItemWithPat_PostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPersonalAccessTokensItemWithPat_PostRequestBody(), 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 *ItemPersonalAccessTokensItemWithPat_PostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemPersonalAccessTokensItemWithPat_PostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemPersonalAccessTokensItemWithPat_PostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemPersonalAccessTokensItemWithPat_PostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemPersonalAccessTokensItemWithPat_PostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_post_request_body.go new file mode 100644 index 000000000..0b802b329 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_post_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemPersonalAccessTokensPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The IDs of the fine-grained personal access tokens. + pat_ids []int32 +} +// NewItemPersonalAccessTokensPostRequestBody instantiates a new ItemPersonalAccessTokensPostRequestBody and sets the default values. +func NewItemPersonalAccessTokensPostRequestBody()(*ItemPersonalAccessTokensPostRequestBody) { + m := &ItemPersonalAccessTokensPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPersonalAccessTokensPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPersonalAccessTokensPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPersonalAccessTokensPostRequestBody(), 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 *ItemPersonalAccessTokensPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemPersonalAccessTokensPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["pat_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetPatIds(res) + } + return nil + } + return res +} +// GetPatIds gets the pat_ids property value. The IDs of the fine-grained personal access tokens. +// returns a []int32 when successful +func (m *ItemPersonalAccessTokensPostRequestBody) GetPatIds()([]int32) { + return m.pat_ids +} +// Serialize serializes information the current object +func (m *ItemPersonalAccessTokensPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetPatIds() != nil { + err := writer.WriteCollectionOfInt32Values("pat_ids", m.GetPatIds()) + 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 *ItemPersonalAccessTokensPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPatIds sets the pat_ids property value. The IDs of the fine-grained personal access tokens. +func (m *ItemPersonalAccessTokensPostRequestBody) SetPatIds(value []int32)() { + m.pat_ids = value +} +type ItemPersonalAccessTokensPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPatIds()([]int32) + SetPatIds(value []int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_post_response.go new file mode 100644 index 000000000..1bc4138b8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_post_response.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemPersonalAccessTokensPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemPersonalAccessTokensPostResponse instantiates a new ItemPersonalAccessTokensPostResponse and sets the default values. +func NewItemPersonalAccessTokensPostResponse()(*ItemPersonalAccessTokensPostResponse) { + m := &ItemPersonalAccessTokensPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPersonalAccessTokensPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPersonalAccessTokensPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPersonalAccessTokensPostResponse(), 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 *ItemPersonalAccessTokensPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemPersonalAccessTokensPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemPersonalAccessTokensPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemPersonalAccessTokensPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemPersonalAccessTokensPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_request_builder.go new file mode 100644 index 000000000..176a03095 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_request_builder.go @@ -0,0 +1,145 @@ +package orgs + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i3106aaea777cbd2e189aa9c11fbc93d90c3c7272c21ca15937589998ee7e5a2e "github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokens" +) + +// ItemPersonalAccessTokensRequestBuilder builds and executes requests for operations under \orgs\{org}\personal-access-tokens +type ItemPersonalAccessTokensRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPersonalAccessTokensRequestBuilderGetQueryParameters lists approved fine-grained personal access tokens owned by organization members that can access organization resources.Only GitHub Apps can use this endpoint. +type ItemPersonalAccessTokensRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i3106aaea777cbd2e189aa9c11fbc93d90c3c7272c21ca15937589998ee7e5a2e.GetDirectionQueryParameterType `uriparametername:"direction"` + // Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Last_used_after *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"last_used_after"` + // Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Last_used_before *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"last_used_before"` + // A list of owner usernames to use to filter the results. + Owner []string `uriparametername:"owner"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The permission to use to filter the results. + Permission *string `uriparametername:"permission"` + // The name of the repository to use to filter the results. + Repository *string `uriparametername:"repository"` + // The property by which to sort the results. + Sort *i3106aaea777cbd2e189aa9c11fbc93d90c3c7272c21ca15937589998ee7e5a2e.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByPat_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.personalAccessTokens.item collection +// returns a *ItemPersonalAccessTokensWithPat_ItemRequestBuilder when successful +func (m *ItemPersonalAccessTokensRequestBuilder) ByPat_id(pat_id int32)(*ItemPersonalAccessTokensWithPat_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["pat_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(pat_id), 10) + return NewItemPersonalAccessTokensWithPat_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPersonalAccessTokensRequestBuilderInternal instantiates a new ItemPersonalAccessTokensRequestBuilder and sets the default values. +func NewItemPersonalAccessTokensRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokensRequestBuilder) { + m := &ItemPersonalAccessTokensRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/personal-access-tokens{?direction*,last_used_after*,last_used_before*,owner*,page*,per_page*,permission*,repository*,sort*}", pathParameters), + } + return m +} +// NewItemPersonalAccessTokensRequestBuilder instantiates a new ItemPersonalAccessTokensRequestBuilder and sets the default values. +func NewItemPersonalAccessTokensRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokensRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPersonalAccessTokensRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists approved fine-grained personal access tokens owned by organization members that can access organization resources.Only GitHub Apps can use this endpoint. +// returns a []OrganizationProgrammaticAccessGrantable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources +func (m *ItemPersonalAccessTokensRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPersonalAccessTokensRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationProgrammaticAccessGrantable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationProgrammaticAccessGrantFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationProgrammaticAccessGrantable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationProgrammaticAccessGrantable) + } + } + return val, nil +} +// Post updates the access organization members have to organization resources via fine-grained personal access tokens. Limited to revoking a token's existing access.Only GitHub Apps can use this endpoint. +// returns a ItemPersonalAccessTokensPostResponseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-to-organization-resources-via-fine-grained-personal-access-tokens +func (m *ItemPersonalAccessTokensRequestBuilder) Post(ctx context.Context, body ItemPersonalAccessTokensPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemPersonalAccessTokensPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemPersonalAccessTokensPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemPersonalAccessTokensPostResponseable), nil +} +// ToGetRequestInformation lists approved fine-grained personal access tokens owned by organization members that can access organization resources.Only GitHub Apps can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPersonalAccessTokensRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPersonalAccessTokensRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation updates the access organization members have to organization resources via fine-grained personal access tokens. Limited to revoking a token's existing access.Only GitHub Apps can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPersonalAccessTokensRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemPersonalAccessTokensPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPersonalAccessTokensRequestBuilder when successful +func (m *ItemPersonalAccessTokensRequestBuilder) WithUrl(rawUrl string)(*ItemPersonalAccessTokensRequestBuilder) { + return NewItemPersonalAccessTokensRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_response.go new file mode 100644 index 000000000..5a7d9f329 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemPersonalAccessTokensResponse +// Deprecated: This class is obsolete. Use personalAccessTokensPostResponse instead. +type ItemPersonalAccessTokensResponse struct { + ItemPersonalAccessTokensPostResponse +} +// NewItemPersonalAccessTokensResponse instantiates a new ItemPersonalAccessTokensResponse and sets the default values. +func NewItemPersonalAccessTokensResponse()(*ItemPersonalAccessTokensResponse) { + m := &ItemPersonalAccessTokensResponse{ + ItemPersonalAccessTokensPostResponse: *NewItemPersonalAccessTokensPostResponse(), + } + return m +} +// CreateItemPersonalAccessTokensResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemPersonalAccessTokensResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPersonalAccessTokensResponse(), nil +} +// ItemPersonalAccessTokensResponseable +// Deprecated: This class is obsolete. Use personalAccessTokensPostResponse instead. +type ItemPersonalAccessTokensResponseable interface { + ItemPersonalAccessTokensPostResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_with_pat_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_with_pat_item_request_builder.go new file mode 100644 index 000000000..f7432946e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_personal_access_tokens_with_pat_item_request_builder.go @@ -0,0 +1,72 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPersonalAccessTokensWithPat_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\personal-access-tokens\{pat_id} +type ItemPersonalAccessTokensWithPat_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPersonalAccessTokensWithPat_ItemRequestBuilderInternal instantiates a new ItemPersonalAccessTokensWithPat_ItemRequestBuilder and sets the default values. +func NewItemPersonalAccessTokensWithPat_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokensWithPat_ItemRequestBuilder) { + m := &ItemPersonalAccessTokensWithPat_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/personal-access-tokens/{pat_id}", pathParameters), + } + return m +} +// NewItemPersonalAccessTokensWithPat_ItemRequestBuilder instantiates a new ItemPersonalAccessTokensWithPat_ItemRequestBuilder and sets the default values. +func NewItemPersonalAccessTokensWithPat_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokensWithPat_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPersonalAccessTokensWithPat_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Post updates the access an organization member has to organization resources via a fine-grained personal access token. Limited to revoking the token's existing access. Limited to revoking a token's existing access.Only GitHub Apps can use this endpoint. +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-a-fine-grained-personal-access-token-has-to-organization-resources +func (m *ItemPersonalAccessTokensWithPat_ItemRequestBuilder) Post(ctx context.Context, body ItemPersonalAccessTokensItemWithPat_PostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Repositories the repositories property +// returns a *ItemPersonalAccessTokensItemRepositoriesRequestBuilder when successful +func (m *ItemPersonalAccessTokensWithPat_ItemRequestBuilder) Repositories()(*ItemPersonalAccessTokensItemRepositoriesRequestBuilder) { + return NewItemPersonalAccessTokensItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToPostRequestInformation updates the access an organization member has to organization resources via a fine-grained personal access token. Limited to revoking the token's existing access. Limited to revoking a token's existing access.Only GitHub Apps can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPersonalAccessTokensWithPat_ItemRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemPersonalAccessTokensItemWithPat_PostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPersonalAccessTokensWithPat_ItemRequestBuilder when successful +func (m *ItemPersonalAccessTokensWithPat_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemPersonalAccessTokensWithPat_ItemRequestBuilder) { + return NewItemPersonalAccessTokensWithPat_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_projects_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_projects_post_request_body.go new file mode 100644 index 000000000..32b649450 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_projects_post_request_body.go @@ -0,0 +1,109 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemProjectsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The description of the project. + body *string + // The name of the project. + name *string +} +// NewItemProjectsPostRequestBody instantiates a new ItemProjectsPostRequestBody and sets the default values. +func NewItemProjectsPostRequestBody()(*ItemProjectsPostRequestBody) { + m := &ItemProjectsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemProjectsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemProjectsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemProjectsPostRequestBody(), 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 *ItemProjectsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The description of the project. +// returns a *string when successful +func (m *ItemProjectsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemProjectsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the project. +// returns a *string when successful +func (m *ItemProjectsPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemProjectsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemProjectsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The description of the project. +func (m *ItemProjectsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetName sets the name property value. The name of the project. +func (m *ItemProjectsPostRequestBody) SetName(value *string)() { + m.name = value +} +type ItemProjectsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetName()(*string) + SetBody(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_projects_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_projects_request_builder.go new file mode 100644 index 000000000..009de45e4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_projects_request_builder.go @@ -0,0 +1,117 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + icb2cc83b1b9fe3e8152a337766c164dfb2e1940a90971ea8c545383bf9d4719b "github.com/octokit/go-sdk/pkg/github/orgs/item/projects" +) + +// ItemProjectsRequestBuilder builds and executes requests for operations under \orgs\{org}\projects +type ItemProjectsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemProjectsRequestBuilderGetQueryParameters lists the projects in an organization. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +type ItemProjectsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Indicates the state of the projects to return. + State *icb2cc83b1b9fe3e8152a337766c164dfb2e1940a90971ea8c545383bf9d4719b.GetStateQueryParameterType `uriparametername:"state"` +} +// NewItemProjectsRequestBuilderInternal instantiates a new ItemProjectsRequestBuilder and sets the default values. +func NewItemProjectsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProjectsRequestBuilder) { + m := &ItemProjectsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/projects{?page*,per_page*,state*}", pathParameters), + } + return m +} +// NewItemProjectsRequestBuilder instantiates a new ItemProjectsRequestBuilder and sets the default values. +func NewItemProjectsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProjectsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemProjectsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the projects in an organization. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a []Projectable when successful +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/projects/projects#list-organization-projects +func (m *ItemProjectsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemProjectsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable) + } + } + return val, nil +} +// Post creates an organization project board. Returns a `410 Gone` status if projects are disabled in the organization or if the organization does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a Projectable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/projects/projects#create-an-organization-project +func (m *ItemProjectsRequestBuilder) Post(ctx context.Context, body ItemProjectsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable), nil +} +// ToGetRequestInformation lists the projects in an organization. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a *RequestInformation when successful +func (m *ItemProjectsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemProjectsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates an organization project board. Returns a `410 Gone` status if projects are disabled in the organization or if the organization does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a *RequestInformation when successful +func (m *ItemProjectsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemProjectsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemProjectsRequestBuilder when successful +func (m *ItemProjectsRequestBuilder) WithUrl(rawUrl string)(*ItemProjectsRequestBuilder) { + return NewItemProjectsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_request_builder.go new file mode 100644 index 000000000..25a021a87 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_request_builder.go @@ -0,0 +1,33 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemPropertiesRequestBuilder builds and executes requests for operations under \orgs\{org}\properties +type ItemPropertiesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPropertiesRequestBuilderInternal instantiates a new ItemPropertiesRequestBuilder and sets the default values. +func NewItemPropertiesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPropertiesRequestBuilder) { + m := &ItemPropertiesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/properties", pathParameters), + } + return m +} +// NewItemPropertiesRequestBuilder instantiates a new ItemPropertiesRequestBuilder and sets the default values. +func NewItemPropertiesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPropertiesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPropertiesRequestBuilderInternal(urlParams, requestAdapter) +} +// Schema the schema property +// returns a *ItemPropertiesSchemaRequestBuilder when successful +func (m *ItemPropertiesRequestBuilder) Schema()(*ItemPropertiesSchemaRequestBuilder) { + return NewItemPropertiesSchemaRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Values the values property +// returns a *ItemPropertiesValuesRequestBuilder when successful +func (m *ItemPropertiesRequestBuilder) Values()(*ItemPropertiesValuesRequestBuilder) { + return NewItemPropertiesValuesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_schema_item_with_custom_property_name_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_schema_item_with_custom_property_name_put_request_body.go new file mode 100644 index 000000000..de3b7982e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_schema_item_with_custom_property_name_put_request_body.go @@ -0,0 +1,244 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // An ordered list of the allowed values of the property.The property can have up to 200 allowed values. + allowed_values []string + // Default value of the property + default_value ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueable + // Short description of the property + description *string + // Whether the property is required. + required *bool +} +// ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value composed type wrapper for classes string +type ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value struct { + // Composed type representation for type string + string *string +} +// NewItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value instantiates a new ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value and sets the default values. +func NewItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value()(*ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value) { + m := &ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value{ + } + return m +} +// CreateItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetString sets the string property value. Composed type representation for type string +func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value) SetString(value *string)() { + m.string = value +} +type ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetString()(*string) + SetString(value *string)() +} +// NewItemPropertiesSchemaItemWithCustom_property_namePutRequestBody instantiates a new ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody and sets the default values. +func NewItemPropertiesSchemaItemWithCustom_property_namePutRequestBody()(*ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) { + m := &ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPropertiesSchemaItemWithCustom_property_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPropertiesSchemaItemWithCustom_property_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPropertiesSchemaItemWithCustom_property_namePutRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowedValues gets the allowed_values property value. An ordered list of the allowed values of the property.The property can have up to 200 allowed values. +// returns a []string when successful +func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) GetAllowedValues()([]string) { + return m.allowed_values +} +// GetDefaultValue gets the default_value property value. Default value of the property +// returns a ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueable when successful +func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) GetDefaultValue()(ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueable) { + return m.default_value +} +// GetDescription gets the description property value. Short description of the property +// returns a *string when successful +func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allowed_values"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetAllowedValues(res) + } + return nil + } + res["default_value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDefaultValue(val.(ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueable)) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequired(val) + } + return nil + } + return res +} +// GetRequired gets the required property value. Whether the property is required. +// returns a *bool when successful +func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) GetRequired()(*bool) { + return m.required +} +// Serialize serializes information the current object +func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAllowedValues() != nil { + err := writer.WriteCollectionOfStringValues("allowed_values", m.GetAllowedValues()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("default_value", m.GetDefaultValue()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("required", m.GetRequired()) + 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 *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowedValues sets the allowed_values property value. An ordered list of the allowed values of the property.The property can have up to 200 allowed values. +func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) SetAllowedValues(value []string)() { + m.allowed_values = value +} +// SetDefaultValue sets the default_value property value. Default value of the property +func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) SetDefaultValue(value ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueable)() { + m.default_value = value +} +// SetDescription sets the description property value. Short description of the property +func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetRequired sets the required property value. Whether the property is required. +func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) SetRequired(value *bool)() { + m.required = value +} +type ItemPropertiesSchemaItemWithCustom_property_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowedValues()([]string) + GetDefaultValue()(ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueable) + GetDescription()(*string) + GetRequired()(*bool) + SetAllowedValues(value []string)() + SetDefaultValue(value ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueable)() + SetDescription(value *string)() + SetRequired(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_schema_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_schema_patch_request_body.go new file mode 100644 index 000000000..c426848e1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_schema_patch_request_body.go @@ -0,0 +1,93 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemPropertiesSchemaPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The array of custom properties to create or update. + properties []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable +} +// NewItemPropertiesSchemaPatchRequestBody instantiates a new ItemPropertiesSchemaPatchRequestBody and sets the default values. +func NewItemPropertiesSchemaPatchRequestBody()(*ItemPropertiesSchemaPatchRequestBody) { + m := &ItemPropertiesSchemaPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPropertiesSchemaPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPropertiesSchemaPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPropertiesSchemaPatchRequestBody(), 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 *ItemPropertiesSchemaPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemPropertiesSchemaPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgCustomPropertyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable) + } + } + m.SetProperties(res) + } + return nil + } + return res +} +// GetProperties gets the properties property value. The array of custom properties to create or update. +// returns a []OrgCustomPropertyable when successful +func (m *ItemPropertiesSchemaPatchRequestBody) GetProperties()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable) { + return m.properties +} +// Serialize serializes information the current object +func (m *ItemPropertiesSchemaPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetProperties() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetProperties())) + for i, v := range m.GetProperties() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("properties", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemPropertiesSchemaPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetProperties sets the properties property value. The array of custom properties to create or update. +func (m *ItemPropertiesSchemaPatchRequestBody) SetProperties(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable)() { + m.properties = value +} +type ItemPropertiesSchemaPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetProperties()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable) + SetProperties(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_schema_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_schema_request_builder.go new file mode 100644 index 000000000..2f924b9a7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_schema_request_builder.go @@ -0,0 +1,118 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPropertiesSchemaRequestBuilder builds and executes requests for operations under \orgs\{org}\properties\schema +type ItemPropertiesSchemaRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByCustom_property_name gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.properties.schema.item collection +// returns a *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder when successful +func (m *ItemPropertiesSchemaRequestBuilder) ByCustom_property_name(custom_property_name string)(*ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if custom_property_name != "" { + urlTplParams["custom_property_name"] = custom_property_name + } + return NewItemPropertiesSchemaWithCustom_property_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPropertiesSchemaRequestBuilderInternal instantiates a new ItemPropertiesSchemaRequestBuilder and sets the default values. +func NewItemPropertiesSchemaRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPropertiesSchemaRequestBuilder) { + m := &ItemPropertiesSchemaRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/properties/schema", pathParameters), + } + return m +} +// NewItemPropertiesSchemaRequestBuilder instantiates a new ItemPropertiesSchemaRequestBuilder and sets the default values. +func NewItemPropertiesSchemaRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPropertiesSchemaRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPropertiesSchemaRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets all custom properties defined for an organization.Organization members can read these properties. +// returns a []OrgCustomPropertyable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization +func (m *ItemPropertiesSchemaRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgCustomPropertyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable) + } + } + return val, nil +} +// Patch creates new or updates existing custom properties defined for an organization in a batch.To use this endpoint, the authenticated user must be one of: - An administrator for the organization. - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. +// returns a []OrgCustomPropertyable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization +func (m *ItemPropertiesSchemaRequestBuilder) Patch(ctx context.Context, body ItemPropertiesSchemaPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgCustomPropertyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable) + } + } + return val, nil +} +// ToGetRequestInformation gets all custom properties defined for an organization.Organization members can read these properties. +// returns a *RequestInformation when successful +func (m *ItemPropertiesSchemaRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation creates new or updates existing custom properties defined for an organization in a batch.To use this endpoint, the authenticated user must be one of: - An administrator for the organization. - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. +// returns a *RequestInformation when successful +func (m *ItemPropertiesSchemaRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemPropertiesSchemaPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPropertiesSchemaRequestBuilder when successful +func (m *ItemPropertiesSchemaRequestBuilder) WithUrl(rawUrl string)(*ItemPropertiesSchemaRequestBuilder) { + return NewItemPropertiesSchemaRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_schema_with_custom_property_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_schema_with_custom_property_name_item_request_builder.go new file mode 100644 index 000000000..7159b94df --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_schema_with_custom_property_name_item_request_builder.go @@ -0,0 +1,129 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\properties\schema\{custom_property_name} +type ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPropertiesSchemaWithCustom_property_nameItemRequestBuilderInternal instantiates a new ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder and sets the default values. +func NewItemPropertiesSchemaWithCustom_property_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) { + m := &ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/properties/schema/{custom_property_name}", pathParameters), + } + return m +} +// NewItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder instantiates a new ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder and sets the default values. +func NewItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPropertiesSchemaWithCustom_property_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a custom property that is defined for an organization.To use this endpoint, the authenticated user must be one of: - An administrator for the organization. - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/custom-properties#remove-a-custom-property-for-an-organization +func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a custom property that is defined for an organization.Organization members can read these properties. +// returns a OrgCustomPropertyable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization +func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgCustomPropertyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable), nil +} +// Put creates a new or updates an existing custom property that is defined for an organization.To use this endpoint, the authenticated user must be one of:- An administrator for the organization.- A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. +// returns a OrgCustomPropertyable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization +func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) Put(ctx context.Context, body ItemPropertiesSchemaItemWithCustom_property_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgCustomPropertyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable), nil +} +// ToDeleteRequestInformation removes a custom property that is defined for an organization.To use this endpoint, the authenticated user must be one of: - An administrator for the organization. - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. +// returns a *RequestInformation when successful +func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets a custom property that is defined for an organization.Organization members can read these properties. +// returns a *RequestInformation when successful +func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation creates a new or updates an existing custom property that is defined for an organization.To use this endpoint, the authenticated user must be one of:- An administrator for the organization.- A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. +// returns a *RequestInformation when successful +func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemPropertiesSchemaItemWithCustom_property_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder when successful +func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) { + return NewItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_values_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_values_patch_request_body.go new file mode 100644 index 000000000..5a5c100ed --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_values_patch_request_body.go @@ -0,0 +1,128 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemPropertiesValuesPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // List of custom property names and associated values to apply to the repositories. + properties []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyValueable + // The names of repositories that the custom property values will be applied to. + repository_names []string +} +// NewItemPropertiesValuesPatchRequestBody instantiates a new ItemPropertiesValuesPatchRequestBody and sets the default values. +func NewItemPropertiesValuesPatchRequestBody()(*ItemPropertiesValuesPatchRequestBody) { + m := &ItemPropertiesValuesPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPropertiesValuesPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPropertiesValuesPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPropertiesValuesPatchRequestBody(), 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 *ItemPropertiesValuesPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemPropertiesValuesPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCustomPropertyValueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyValueable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyValueable) + } + } + m.SetProperties(res) + } + return nil + } + res["repository_names"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRepositoryNames(res) + } + return nil + } + return res +} +// GetProperties gets the properties property value. List of custom property names and associated values to apply to the repositories. +// returns a []CustomPropertyValueable when successful +func (m *ItemPropertiesValuesPatchRequestBody) GetProperties()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyValueable) { + return m.properties +} +// GetRepositoryNames gets the repository_names property value. The names of repositories that the custom property values will be applied to. +// returns a []string when successful +func (m *ItemPropertiesValuesPatchRequestBody) GetRepositoryNames()([]string) { + return m.repository_names +} +// Serialize serializes information the current object +func (m *ItemPropertiesValuesPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetProperties() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetProperties())) + for i, v := range m.GetProperties() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("properties", cast) + if err != nil { + return err + } + } + if m.GetRepositoryNames() != nil { + err := writer.WriteCollectionOfStringValues("repository_names", m.GetRepositoryNames()) + 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 *ItemPropertiesValuesPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetProperties sets the properties property value. List of custom property names and associated values to apply to the repositories. +func (m *ItemPropertiesValuesPatchRequestBody) SetProperties(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyValueable)() { + m.properties = value +} +// SetRepositoryNames sets the repository_names property value. The names of repositories that the custom property values will be applied to. +func (m *ItemPropertiesValuesPatchRequestBody) SetRepositoryNames(value []string)() { + m.repository_names = value +} +type ItemPropertiesValuesPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetProperties()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyValueable) + GetRepositoryNames()([]string) + SetProperties(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyValueable)() + SetRepositoryNames(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_values_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_values_request_builder.go new file mode 100644 index 000000000..30aeb0d77 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_properties_values_request_builder.go @@ -0,0 +1,110 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPropertiesValuesRequestBuilder builds and executes requests for operations under \orgs\{org}\properties\values +type ItemPropertiesValuesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPropertiesValuesRequestBuilderGetQueryParameters lists organization repositories with all of their custom property values.Organization members can read these properties. +type ItemPropertiesValuesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Finds repositories in the organization with a query containing one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See "[Searching for repositories](https://docs.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. + Repository_query *string `uriparametername:"repository_query"` +} +// NewItemPropertiesValuesRequestBuilderInternal instantiates a new ItemPropertiesValuesRequestBuilder and sets the default values. +func NewItemPropertiesValuesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPropertiesValuesRequestBuilder) { + m := &ItemPropertiesValuesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/properties/values{?page*,per_page*,repository_query*}", pathParameters), + } + return m +} +// NewItemPropertiesValuesRequestBuilder instantiates a new ItemPropertiesValuesRequestBuilder and sets the default values. +func NewItemPropertiesValuesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPropertiesValuesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPropertiesValuesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists organization repositories with all of their custom property values.Organization members can read these properties. +// returns a []OrgRepoCustomPropertyValuesable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories +func (m *ItemPropertiesValuesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPropertiesValuesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRepoCustomPropertyValuesable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgRepoCustomPropertyValuesFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRepoCustomPropertyValuesable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRepoCustomPropertyValuesable) + } + } + return val, nil +} +// Patch create new or update existing custom property values for repositories in a batch that belong to an organization.Each target repository will have its custom property values updated to match the values provided in the request.A maximum of 30 repositories can be updated in a single request.Using a value of `null` for a custom property will remove or 'unset' the property value from the repository.To use this endpoint, the authenticated user must be one of: - An administrator for the organization. - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories +func (m *ItemPropertiesValuesRequestBuilder) Patch(ctx context.Context, body ItemPropertiesValuesPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation lists organization repositories with all of their custom property values.Organization members can read these properties. +// returns a *RequestInformation when successful +func (m *ItemPropertiesValuesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPropertiesValuesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation create new or update existing custom property values for repositories in a batch that belong to an organization.Each target repository will have its custom property values updated to match the values provided in the request.A maximum of 30 repositories can be updated in a single request.Using a value of `null` for a custom property will remove or 'unset' the property value from the repository.To use this endpoint, the authenticated user must be one of: - An administrator for the organization. - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. +// returns a *RequestInformation when successful +func (m *ItemPropertiesValuesRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemPropertiesValuesPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPropertiesValuesRequestBuilder when successful +func (m *ItemPropertiesValuesRequestBuilder) WithUrl(rawUrl string)(*ItemPropertiesValuesRequestBuilder) { + return NewItemPropertiesValuesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_public_members_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_public_members_request_builder.go new file mode 100644 index 000000000..e562cf2da --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_public_members_request_builder.go @@ -0,0 +1,79 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPublic_membersRequestBuilder builds and executes requests for operations under \orgs\{org}\public_members +type ItemPublic_membersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPublic_membersRequestBuilderGetQueryParameters members of an organization can choose to have their membership publicized or not. +type ItemPublic_membersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.public_members.item collection +// returns a *ItemPublic_membersWithUsernameItemRequestBuilder when successful +func (m *ItemPublic_membersRequestBuilder) ByUsername(username string)(*ItemPublic_membersWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemPublic_membersWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPublic_membersRequestBuilderInternal instantiates a new ItemPublic_membersRequestBuilder and sets the default values. +func NewItemPublic_membersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPublic_membersRequestBuilder) { + m := &ItemPublic_membersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/public_members{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemPublic_membersRequestBuilder instantiates a new ItemPublic_membersRequestBuilder and sets the default values. +func NewItemPublic_membersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPublic_membersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPublic_membersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get members of an organization can choose to have their membership publicized or not. +// returns a []SimpleUserable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/members#list-public-organization-members +func (m *ItemPublic_membersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPublic_membersRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation members of an organization can choose to have their membership publicized or not. +// returns a *RequestInformation when successful +func (m *ItemPublic_membersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPublic_membersRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPublic_membersRequestBuilder when successful +func (m *ItemPublic_membersRequestBuilder) WithUrl(rawUrl string)(*ItemPublic_membersRequestBuilder) { + return NewItemPublic_membersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_public_members_with_username_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_public_members_with_username_item_request_builder.go new file mode 100644 index 000000000..e01f30521 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_public_members_with_username_item_request_builder.go @@ -0,0 +1,101 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPublic_membersWithUsernameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\public_members\{username} +type ItemPublic_membersWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPublic_membersWithUsernameItemRequestBuilderInternal instantiates a new ItemPublic_membersWithUsernameItemRequestBuilder and sets the default values. +func NewItemPublic_membersWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPublic_membersWithUsernameItemRequestBuilder) { + m := &ItemPublic_membersWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/public_members/{username}", pathParameters), + } + return m +} +// NewItemPublic_membersWithUsernameItemRequestBuilder instantiates a new ItemPublic_membersWithUsernameItemRequestBuilder and sets the default values. +func NewItemPublic_membersWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPublic_membersWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPublic_membersWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user +func (m *ItemPublic_membersWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get check if the provided user is a public member of the organization. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user +func (m *ItemPublic_membersWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put the user can publicize their own membership. (A user cannot publicize the membership for another user.)Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user +func (m *ItemPublic_membersWithUsernameItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default. +// returns a *RequestInformation when successful +func (m *ItemPublic_membersWithUsernameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation check if the provided user is a public member of the organization. +// returns a *RequestInformation when successful +func (m *ItemPublic_membersWithUsernameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToPutRequestInformation the user can publicize their own membership. (A user cannot publicize the membership for another user.)Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." +// returns a *RequestInformation when successful +func (m *ItemPublic_membersWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPublic_membersWithUsernameItemRequestBuilder when successful +func (m *ItemPublic_membersWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemPublic_membersWithUsernameItemRequestBuilder) { + return NewItemPublic_membersWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_repos_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_repos_post_request_body.go new file mode 100644 index 000000000..f0b55be72 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_repos_post_request_body.go @@ -0,0 +1,634 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemReposPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. + allow_auto_merge *bool + // Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. + allow_merge_commit *bool + // Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. + allow_rebase_merge *bool + // Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. + allow_squash_merge *bool + // Pass `true` to create an initial commit with empty README. + auto_init *bool + // The custom properties for the new repository. The keys are the custom property names, and the values are the corresponding custom property values. + custom_properties ItemReposPostRequestBody_custom_propertiesable + // Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. **The authenticated user must be an organization owner to set this property to `true`.** + delete_branch_on_merge *bool + // A short description of the repository. + description *string + // Desired language or platform [.gitignore template](https://github.com/github/gitignore) to apply. Use the name of the template without the extension. For example, "Haskell". + gitignore_template *string + // Whether downloads are enabled. + has_downloads *bool + // Either `true` to enable issues for this repository or `false` to disable them. + has_issues *bool + // Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. + has_projects *bool + // Either `true` to enable the wiki for this repository or `false` to disable it. + has_wiki *bool + // A URL with more information about the repository. + homepage *string + // Either `true` to make this repo available as a template repository or `false` to prevent it. + is_template *bool + // Choose an [open source license template](https://choosealicense.com/) that best suits your needs, and then use the [license keyword](https://docs.github.com/articles/licensing-a-repository/#searching-github-by-license-type) as the `license_template` string. For example, "mit" or "mpl-2.0". + license_template *string + // The name of the repository. + name *string + // Whether the repository is private. + private *bool + // The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. + team_id *int32 + // Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + // Deprecated: + use_squash_pr_title_as_default *bool +} +// NewItemReposPostRequestBody instantiates a new ItemReposPostRequestBody and sets the default values. +func NewItemReposPostRequestBody()(*ItemReposPostRequestBody) { + m := &ItemReposPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemReposPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemReposPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemReposPostRequestBody(), 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 *ItemReposPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowMergeCommit gets the allow_merge_commit property value. Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetAutoInit gets the auto_init property value. Pass `true` to create an initial commit with empty README. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetAutoInit()(*bool) { + return m.auto_init +} +// GetCustomProperties gets the custom_properties property value. The custom properties for the new repository. The keys are the custom property names, and the values are the corresponding custom property values. +// returns a ItemReposPostRequestBody_custom_propertiesable when successful +func (m *ItemReposPostRequestBody) GetCustomProperties()(ItemReposPostRequestBody_custom_propertiesable) { + return m.custom_properties +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. **The authenticated user must be an organization owner to set this property to `true`.** +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDescription gets the description property value. A short description of the repository. +// returns a *string when successful +func (m *ItemReposPostRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemReposPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["auto_init"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAutoInit(val) + } + return nil + } + res["custom_properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemReposPostRequestBody_custom_propertiesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCustomProperties(val.(ItemReposPostRequestBody_custom_propertiesable)) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["gitignore_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitignoreTemplate(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["license_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLicenseTemplate(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["team_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTeamId(val) + } + return nil + } + res["use_squash_pr_title_as_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseSquashPrTitleAsDefault(val) + } + return nil + } + return res +} +// GetGitignoreTemplate gets the gitignore_template property value. Desired language or platform [.gitignore template](https://github.com/github/gitignore) to apply. Use the name of the template without the extension. For example, "Haskell". +// returns a *string when successful +func (m *ItemReposPostRequestBody) GetGitignoreTemplate()(*string) { + return m.gitignore_template +} +// GetHasDownloads gets the has_downloads property value. Whether downloads are enabled. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. Either `true` to enable issues for this repository or `false` to disable them. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasProjects gets the has_projects property value. Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. Either `true` to enable the wiki for this repository or `false` to disable it. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. A URL with more information about the repository. +// returns a *string when successful +func (m *ItemReposPostRequestBody) GetHomepage()(*string) { + return m.homepage +} +// GetIsTemplate gets the is_template property value. Either `true` to make this repo available as a template repository or `false` to prevent it. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetIsTemplate()(*bool) { + return m.is_template +} +// GetLicenseTemplate gets the license_template property value. Choose an [open source license template](https://choosealicense.com/) that best suits your needs, and then use the [license keyword](https://docs.github.com/articles/licensing-a-repository/#searching-github-by-license-type) as the `license_template` string. For example, "mit" or "mpl-2.0". +// returns a *string when successful +func (m *ItemReposPostRequestBody) GetLicenseTemplate()(*string) { + return m.license_template +} +// GetName gets the name property value. The name of the repository. +// returns a *string when successful +func (m *ItemReposPostRequestBody) GetName()(*string) { + return m.name +} +// GetPrivate gets the private property value. Whether the repository is private. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetPrivate()(*bool) { + return m.private +} +// GetTeamId gets the team_id property value. The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. +// returns a *int32 when successful +func (m *ItemReposPostRequestBody) GetTeamId()(*int32) { + return m.team_id +} +// GetUseSquashPrTitleAsDefault gets the use_squash_pr_title_as_default property value. Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetUseSquashPrTitleAsDefault()(*bool) { + return m.use_squash_pr_title_as_default +} +// Serialize serializes information the current object +func (m *ItemReposPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("auto_init", m.GetAutoInit()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("custom_properties", m.GetCustomProperties()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gitignore_template", m.GetGitignoreTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("license_template", m.GetLicenseTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("team_id", m.GetTeamId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_squash_pr_title_as_default", m.GetUseSquashPrTitleAsDefault()) + 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 *ItemReposPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. +func (m *ItemReposPostRequestBody) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. +func (m *ItemReposPostRequestBody) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. +func (m *ItemReposPostRequestBody) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. +func (m *ItemReposPostRequestBody) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetAutoInit sets the auto_init property value. Pass `true` to create an initial commit with empty README. +func (m *ItemReposPostRequestBody) SetAutoInit(value *bool)() { + m.auto_init = value +} +// SetCustomProperties sets the custom_properties property value. The custom properties for the new repository. The keys are the custom property names, and the values are the corresponding custom property values. +func (m *ItemReposPostRequestBody) SetCustomProperties(value ItemReposPostRequestBody_custom_propertiesable)() { + m.custom_properties = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. **The authenticated user must be an organization owner to set this property to `true`.** +func (m *ItemReposPostRequestBody) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDescription sets the description property value. A short description of the repository. +func (m *ItemReposPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetGitignoreTemplate sets the gitignore_template property value. Desired language or platform [.gitignore template](https://github.com/github/gitignore) to apply. Use the name of the template without the extension. For example, "Haskell". +func (m *ItemReposPostRequestBody) SetGitignoreTemplate(value *string)() { + m.gitignore_template = value +} +// SetHasDownloads sets the has_downloads property value. Whether downloads are enabled. +func (m *ItemReposPostRequestBody) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. Either `true` to enable issues for this repository or `false` to disable them. +func (m *ItemReposPostRequestBody) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasProjects sets the has_projects property value. Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. +func (m *ItemReposPostRequestBody) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. Either `true` to enable the wiki for this repository or `false` to disable it. +func (m *ItemReposPostRequestBody) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. A URL with more information about the repository. +func (m *ItemReposPostRequestBody) SetHomepage(value *string)() { + m.homepage = value +} +// SetIsTemplate sets the is_template property value. Either `true` to make this repo available as a template repository or `false` to prevent it. +func (m *ItemReposPostRequestBody) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetLicenseTemplate sets the license_template property value. Choose an [open source license template](https://choosealicense.com/) that best suits your needs, and then use the [license keyword](https://docs.github.com/articles/licensing-a-repository/#searching-github-by-license-type) as the `license_template` string. For example, "mit" or "mpl-2.0". +func (m *ItemReposPostRequestBody) SetLicenseTemplate(value *string)() { + m.license_template = value +} +// SetName sets the name property value. The name of the repository. +func (m *ItemReposPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetPrivate sets the private property value. Whether the repository is private. +func (m *ItemReposPostRequestBody) SetPrivate(value *bool)() { + m.private = value +} +// SetTeamId sets the team_id property value. The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. +func (m *ItemReposPostRequestBody) SetTeamId(value *int32)() { + m.team_id = value +} +// SetUseSquashPrTitleAsDefault sets the use_squash_pr_title_as_default property value. Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +func (m *ItemReposPostRequestBody) SetUseSquashPrTitleAsDefault(value *bool)() { + m.use_squash_pr_title_as_default = value +} +type ItemReposPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetAutoInit()(*bool) + GetCustomProperties()(ItemReposPostRequestBody_custom_propertiesable) + GetDeleteBranchOnMerge()(*bool) + GetDescription()(*string) + GetGitignoreTemplate()(*string) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetIsTemplate()(*bool) + GetLicenseTemplate()(*string) + GetName()(*string) + GetPrivate()(*bool) + GetTeamId()(*int32) + GetUseSquashPrTitleAsDefault()(*bool) + SetAllowAutoMerge(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetAutoInit(value *bool)() + SetCustomProperties(value ItemReposPostRequestBody_custom_propertiesable)() + SetDeleteBranchOnMerge(value *bool)() + SetDescription(value *string)() + SetGitignoreTemplate(value *string)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetIsTemplate(value *bool)() + SetLicenseTemplate(value *string)() + SetName(value *string)() + SetPrivate(value *bool)() + SetTeamId(value *int32)() + SetUseSquashPrTitleAsDefault(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_repos_post_request_body_custom_properties.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_repos_post_request_body_custom_properties.go new file mode 100644 index 000000000..17425c23e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_repos_post_request_body_custom_properties.go @@ -0,0 +1,52 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemReposPostRequestBody_custom_properties the custom properties for the new repository. The keys are the custom property names, and the values are the corresponding custom property values. +type ItemReposPostRequestBody_custom_properties struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemReposPostRequestBody_custom_properties instantiates a new ItemReposPostRequestBody_custom_properties and sets the default values. +func NewItemReposPostRequestBody_custom_properties()(*ItemReposPostRequestBody_custom_properties) { + m := &ItemReposPostRequestBody_custom_properties{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemReposPostRequestBody_custom_propertiesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemReposPostRequestBody_custom_propertiesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemReposPostRequestBody_custom_properties(), 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 *ItemReposPostRequestBody_custom_properties) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemReposPostRequestBody_custom_properties) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemReposPostRequestBody_custom_properties) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemReposPostRequestBody_custom_properties) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemReposPostRequestBody_custom_propertiesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_repos_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_repos_request_builder.go new file mode 100644 index 000000000..b12f55fe4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_repos_request_builder.go @@ -0,0 +1,111 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i5b3d7c73dda6fbaf3ff58c44b2aabc5d033977f32b78e1754114a1419fe1467c "github.com/octokit/go-sdk/pkg/github/orgs/item/repos" +) + +// ItemReposRequestBuilder builds and executes requests for operations under \orgs\{org}\repos +type ItemReposRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemReposRequestBuilderGetQueryParameters lists repositories for the specified organization.**Note:** In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." +type ItemReposRequestBuilderGetQueryParameters struct { + // The order to sort by. Default: `asc` when using `full_name`, otherwise `desc`. + Direction *i5b3d7c73dda6fbaf3ff58c44b2aabc5d033977f32b78e1754114a1419fe1467c.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The property to sort the results by. + Sort *i5b3d7c73dda6fbaf3ff58c44b2aabc5d033977f32b78e1754114a1419fe1467c.GetSortQueryParameterType `uriparametername:"sort"` + // Specifies the types of repositories you want returned. + Type *i5b3d7c73dda6fbaf3ff58c44b2aabc5d033977f32b78e1754114a1419fe1467c.GetTypeQueryParameterType `uriparametername:"type"` +} +// NewItemReposRequestBuilderInternal instantiates a new ItemReposRequestBuilder and sets the default values. +func NewItemReposRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposRequestBuilder) { + m := &ItemReposRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/repos{?direction*,page*,per_page*,sort*,type*}", pathParameters), + } + return m +} +// NewItemReposRequestBuilder instantiates a new ItemReposRequestBuilder and sets the default values. +func NewItemReposRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemReposRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists repositories for the specified organization.**Note:** In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." +// returns a []MinimalRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#list-organization-repositories +func (m *ItemReposRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReposRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + } + } + return val, nil +} +// Post creates a new repository in the specified organization. The authenticated user must be a member of the organization.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository. +// returns a FullRepositoryable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#create-an-organization-repository +func (m *ItemReposRequestBuilder) Post(ctx context.Context, body ItemReposPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateFullRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable), nil +} +// ToGetRequestInformation lists repositories for the specified organization.**Note:** In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." +// returns a *RequestInformation when successful +func (m *ItemReposRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReposRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a new repository in the specified organization. The authenticated user must be a member of the organization.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository. +// returns a *RequestInformation when successful +func (m *ItemReposRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemReposPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemReposRequestBuilder when successful +func (m *ItemReposRequestBuilder) WithUrl(rawUrl string)(*ItemReposRequestBuilder) { + return NewItemReposRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_item_with_ruleset_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_item_with_ruleset_put_request_body.go new file mode 100644 index 000000000..d7b1aa920 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_item_with_ruleset_put_request_body.go @@ -0,0 +1,222 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemRulesetsItemWithRuleset_PutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The actors that can bypass the rules in this ruleset + bypass_actors []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable + // Conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties. + conditions i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable + // The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). + enforcement *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement + // The name of the ruleset. + name *string + // An array of rules within the ruleset. + rules []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable +} +// NewItemRulesetsItemWithRuleset_PutRequestBody instantiates a new ItemRulesetsItemWithRuleset_PutRequestBody and sets the default values. +func NewItemRulesetsItemWithRuleset_PutRequestBody()(*ItemRulesetsItemWithRuleset_PutRequestBody) { + m := &ItemRulesetsItemWithRuleset_PutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemRulesetsItemWithRuleset_PutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemRulesetsItemWithRuleset_PutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemRulesetsItemWithRuleset_PutRequestBody(), 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 *ItemRulesetsItemWithRuleset_PutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassActors gets the bypass_actors property value. The actors that can bypass the rules in this ruleset +// returns a []RepositoryRulesetBypassActorable when successful +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetBypassActors()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable) { + return m.bypass_actors +} +// GetConditions gets the conditions property value. Conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties. +// returns a OrgRulesetConditionsable when successful +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetConditions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable) { + return m.conditions +} +// GetEnforcement gets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). +// returns a *RepositoryRuleEnforcement when successful +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetEnforcement()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement) { + return m.enforcement +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bypass_actors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRulesetBypassActorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable) + } + } + m.SetBypassActors(res) + } + return nil + } + res["conditions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgRulesetConditionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConditions(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable)) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ParseRepositoryRuleEnforcement) + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val.(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["rules"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRuleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable) + } + } + m.SetRules(res) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the ruleset. +// returns a *string when successful +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetName()(*string) { + return m.name +} +// GetRules gets the rules property value. An array of rules within the ruleset. +// returns a []RepositoryRuleable when successful +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetRules()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable) { + return m.rules +} +// Serialize serializes information the current object +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBypassActors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetBypassActors())) + for i, v := range m.GetBypassActors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("bypass_actors", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("conditions", m.GetConditions()) + if err != nil { + return err + } + } + if m.GetEnforcement() != nil { + cast := (*m.GetEnforcement()).String() + err := writer.WriteStringValue("enforcement", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetRules() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRules())) + for i, v := range m.GetRules() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("rules", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassActors sets the bypass_actors property value. The actors that can bypass the rules in this ruleset +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) SetBypassActors(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable)() { + m.bypass_actors = value +} +// SetConditions sets the conditions property value. Conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties. +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) SetConditions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable)() { + m.conditions = value +} +// SetEnforcement sets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) SetEnforcement(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement)() { + m.enforcement = value +} +// SetName sets the name property value. The name of the ruleset. +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) SetName(value *string)() { + m.name = value +} +// SetRules sets the rules property value. An array of rules within the ruleset. +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) SetRules(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable)() { + m.rules = value +} +type ItemRulesetsItemWithRuleset_PutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassActors()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable) + GetConditions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable) + GetEnforcement()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement) + GetName()(*string) + GetRules()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable) + SetBypassActors(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable)() + SetConditions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable)() + SetEnforcement(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement)() + SetName(value *string)() + SetRules(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_post_request_body.go new file mode 100644 index 000000000..3e3b66fc9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_post_request_body.go @@ -0,0 +1,222 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemRulesetsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The actors that can bypass the rules in this ruleset + bypass_actors []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable + // Conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties. + conditions i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable + // The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). + enforcement *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement + // The name of the ruleset. + name *string + // An array of rules within the ruleset. + rules []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable +} +// NewItemRulesetsPostRequestBody instantiates a new ItemRulesetsPostRequestBody and sets the default values. +func NewItemRulesetsPostRequestBody()(*ItemRulesetsPostRequestBody) { + m := &ItemRulesetsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemRulesetsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemRulesetsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemRulesetsPostRequestBody(), 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 *ItemRulesetsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassActors gets the bypass_actors property value. The actors that can bypass the rules in this ruleset +// returns a []RepositoryRulesetBypassActorable when successful +func (m *ItemRulesetsPostRequestBody) GetBypassActors()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable) { + return m.bypass_actors +} +// GetConditions gets the conditions property value. Conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties. +// returns a OrgRulesetConditionsable when successful +func (m *ItemRulesetsPostRequestBody) GetConditions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable) { + return m.conditions +} +// GetEnforcement gets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). +// returns a *RepositoryRuleEnforcement when successful +func (m *ItemRulesetsPostRequestBody) GetEnforcement()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement) { + return m.enforcement +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemRulesetsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bypass_actors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRulesetBypassActorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable) + } + } + m.SetBypassActors(res) + } + return nil + } + res["conditions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgRulesetConditionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConditions(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable)) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ParseRepositoryRuleEnforcement) + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val.(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["rules"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRuleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable) + } + } + m.SetRules(res) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the ruleset. +// returns a *string when successful +func (m *ItemRulesetsPostRequestBody) GetName()(*string) { + return m.name +} +// GetRules gets the rules property value. An array of rules within the ruleset. +// returns a []RepositoryRuleable when successful +func (m *ItemRulesetsPostRequestBody) GetRules()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable) { + return m.rules +} +// Serialize serializes information the current object +func (m *ItemRulesetsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBypassActors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetBypassActors())) + for i, v := range m.GetBypassActors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("bypass_actors", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("conditions", m.GetConditions()) + if err != nil { + return err + } + } + if m.GetEnforcement() != nil { + cast := (*m.GetEnforcement()).String() + err := writer.WriteStringValue("enforcement", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetRules() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRules())) + for i, v := range m.GetRules() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("rules", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemRulesetsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassActors sets the bypass_actors property value. The actors that can bypass the rules in this ruleset +func (m *ItemRulesetsPostRequestBody) SetBypassActors(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable)() { + m.bypass_actors = value +} +// SetConditions sets the conditions property value. Conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties. +func (m *ItemRulesetsPostRequestBody) SetConditions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable)() { + m.conditions = value +} +// SetEnforcement sets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). +func (m *ItemRulesetsPostRequestBody) SetEnforcement(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement)() { + m.enforcement = value +} +// SetName sets the name property value. The name of the ruleset. +func (m *ItemRulesetsPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetRules sets the rules property value. An array of rules within the ruleset. +func (m *ItemRulesetsPostRequestBody) SetRules(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable)() { + m.rules = value +} +type ItemRulesetsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassActors()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable) + GetConditions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable) + GetEnforcement()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement) + GetName()(*string) + GetRules()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable) + SetBypassActors(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable)() + SetConditions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable)() + SetEnforcement(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement)() + SetName(value *string)() + SetRules(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_request_builder.go new file mode 100644 index 000000000..64f60648b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_request_builder.go @@ -0,0 +1,126 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemRulesetsRequestBuilder builds and executes requests for operations under \orgs\{org}\rulesets +type ItemRulesetsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemRulesetsRequestBuilderGetQueryParameters get all the repository rulesets for an organization. +type ItemRulesetsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRuleset_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.rulesets.item collection +// returns a *ItemRulesetsWithRuleset_ItemRequestBuilder when successful +func (m *ItemRulesetsRequestBuilder) ByRuleset_id(ruleset_id int32)(*ItemRulesetsWithRuleset_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["ruleset_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(ruleset_id), 10) + return NewItemRulesetsWithRuleset_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemRulesetsRequestBuilderInternal instantiates a new ItemRulesetsRequestBuilder and sets the default values. +func NewItemRulesetsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRulesetsRequestBuilder) { + m := &ItemRulesetsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/rulesets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemRulesetsRequestBuilder instantiates a new ItemRulesetsRequestBuilder and sets the default values. +func NewItemRulesetsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRulesetsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemRulesetsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get all the repository rulesets for an organization. +// returns a []RepositoryRulesetable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets +func (m *ItemRulesetsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemRulesetsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRulesetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable) + } + } + return val, nil +} +// Post create a repository ruleset for an organization. +// returns a RepositoryRulesetable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset +func (m *ItemRulesetsRequestBuilder) Post(ctx context.Context, body ItemRulesetsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRulesetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable), nil +} +// RuleSuites the ruleSuites property +// returns a *ItemRulesetsRuleSuitesRequestBuilder when successful +func (m *ItemRulesetsRequestBuilder) RuleSuites()(*ItemRulesetsRuleSuitesRequestBuilder) { + return NewItemRulesetsRuleSuitesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation get all the repository rulesets for an organization. +// returns a *RequestInformation when successful +func (m *ItemRulesetsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemRulesetsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation create a repository ruleset for an organization. +// returns a *RequestInformation when successful +func (m *ItemRulesetsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemRulesetsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemRulesetsRequestBuilder when successful +func (m *ItemRulesetsRequestBuilder) WithUrl(rawUrl string)(*ItemRulesetsRequestBuilder) { + return NewItemRulesetsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_rule_suites_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_rule_suites_request_builder.go new file mode 100644 index 000000000..532f0f153 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_rule_suites_request_builder.go @@ -0,0 +1,93 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + ice77a9476603b5b5bdcf7933e87c368075e96312df44ed011cd574d7f2e817b9 "github.com/octokit/go-sdk/pkg/github/orgs/item/rulesets/rulesuites" +) + +// ItemRulesetsRuleSuitesRequestBuilder builds and executes requests for operations under \orgs\{org}\rulesets\rule-suites +type ItemRulesetsRuleSuitesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemRulesetsRuleSuitesRequestBuilderGetQueryParameters lists suites of rule evaluations at the organization level.For more information, see "[Managing rulesets for repositories in your organization](https://docs.github.com/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets)." +type ItemRulesetsRuleSuitesRequestBuilderGetQueryParameters struct { + // The handle for the GitHub user account to filter on. When specified, only rule evaluations triggered by this actor will be returned. + Actor_name *string `uriparametername:"actor_name"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The name of the repository to filter on. When specified, only rule evaluations from this repository will be returned. + Repository_name *int32 `uriparametername:"repository_name"` + // The rule results to filter on. When specified, only suites with this result will be returned. + Rule_suite_result *ice77a9476603b5b5bdcf7933e87c368075e96312df44ed011cd574d7f2e817b9.GetRule_suite_resultQueryParameterType `uriparametername:"rule_suite_result"` + // The time period to filter by.For example, `day` will filter for rule suites that occurred in the past 24 hours, and `week` will filter for insights that occurred in the past 7 days (168 hours). + Time_period *ice77a9476603b5b5bdcf7933e87c368075e96312df44ed011cd574d7f2e817b9.GetTime_periodQueryParameterType `uriparametername:"time_period"` +} +// ByRule_suite_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.rulesets.ruleSuites.item collection +// returns a *ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder when successful +func (m *ItemRulesetsRuleSuitesRequestBuilder) ByRule_suite_id(rule_suite_id int32)(*ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["rule_suite_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(rule_suite_id), 10) + return NewItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemRulesetsRuleSuitesRequestBuilderInternal instantiates a new ItemRulesetsRuleSuitesRequestBuilder and sets the default values. +func NewItemRulesetsRuleSuitesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRulesetsRuleSuitesRequestBuilder) { + m := &ItemRulesetsRuleSuitesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/rulesets/rule-suites{?actor_name*,page*,per_page*,repository_name*,rule_suite_result*,time_period*}", pathParameters), + } + return m +} +// NewItemRulesetsRuleSuitesRequestBuilder instantiates a new ItemRulesetsRuleSuitesRequestBuilder and sets the default values. +func NewItemRulesetsRuleSuitesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRulesetsRuleSuitesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemRulesetsRuleSuitesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists suites of rule evaluations at the organization level.For more information, see "[Managing rulesets for repositories in your organization](https://docs.github.com/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets)." +// returns a []RuleSuitesable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/rule-suites#list-organization-rule-suites +func (m *ItemRulesetsRuleSuitesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemRulesetsRuleSuitesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RuleSuitesable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRuleSuitesFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RuleSuitesable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RuleSuitesable) + } + } + return val, nil +} +// ToGetRequestInformation lists suites of rule evaluations at the organization level.For more information, see "[Managing rulesets for repositories in your organization](https://docs.github.com/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets)." +// returns a *RequestInformation when successful +func (m *ItemRulesetsRuleSuitesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemRulesetsRuleSuitesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemRulesetsRuleSuitesRequestBuilder when successful +func (m *ItemRulesetsRuleSuitesRequestBuilder) WithUrl(rawUrl string)(*ItemRulesetsRuleSuitesRequestBuilder) { + return NewItemRulesetsRuleSuitesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_rule_suites_with_rule_suite_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_rule_suites_with_rule_suite_item_request_builder.go new file mode 100644 index 000000000..7962dde84 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_rule_suites_with_rule_suite_item_request_builder.go @@ -0,0 +1,63 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\rulesets\rule-suites\{rule_suite_id} +type ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilderInternal instantiates a new ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder and sets the default values. +func NewItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) { + m := &ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/rulesets/rule-suites/{rule_suite_id}", pathParameters), + } + return m +} +// NewItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder instantiates a new ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder and sets the default values. +func NewItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets information about a suite of rule evaluations from within an organization.For more information, see "[Managing rulesets for repositories in your organization](https://docs.github.com/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets)." +// returns a RuleSuiteable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/rule-suites#get-an-organization-rule-suite +func (m *ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RuleSuiteable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRuleSuiteFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RuleSuiteable), nil +} +// ToGetRequestInformation gets information about a suite of rule evaluations from within an organization.For more information, see "[Managing rulesets for repositories in your organization](https://docs.github.com/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets)." +// returns a *RequestInformation when successful +func (m *ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder when successful +func (m *ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) { + return NewItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_with_ruleset_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_with_ruleset_item_request_builder.go new file mode 100644 index 000000000..4056b1071 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_rulesets_with_ruleset_item_request_builder.go @@ -0,0 +1,129 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemRulesetsWithRuleset_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\rulesets\{ruleset_id} +type ItemRulesetsWithRuleset_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemRulesetsWithRuleset_ItemRequestBuilderInternal instantiates a new ItemRulesetsWithRuleset_ItemRequestBuilder and sets the default values. +func NewItemRulesetsWithRuleset_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRulesetsWithRuleset_ItemRequestBuilder) { + m := &ItemRulesetsWithRuleset_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/rulesets/{ruleset_id}", pathParameters), + } + return m +} +// NewItemRulesetsWithRuleset_ItemRequestBuilder instantiates a new ItemRulesetsWithRuleset_ItemRequestBuilder and sets the default values. +func NewItemRulesetsWithRuleset_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRulesetsWithRuleset_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemRulesetsWithRuleset_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a ruleset for an organization. +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset +func (m *ItemRulesetsWithRuleset_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get get a repository ruleset for an organization. +// returns a RepositoryRulesetable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset +func (m *ItemRulesetsWithRuleset_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRulesetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable), nil +} +// Put update a ruleset for an organization. +// returns a RepositoryRulesetable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset +func (m *ItemRulesetsWithRuleset_ItemRequestBuilder) Put(ctx context.Context, body ItemRulesetsItemWithRuleset_PutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRulesetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable), nil +} +// ToDeleteRequestInformation delete a ruleset for an organization. +// returns a *RequestInformation when successful +func (m *ItemRulesetsWithRuleset_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation get a repository ruleset for an organization. +// returns a *RequestInformation when successful +func (m *ItemRulesetsWithRuleset_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation update a ruleset for an organization. +// returns a *RequestInformation when successful +func (m *ItemRulesetsWithRuleset_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemRulesetsItemWithRuleset_PutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemRulesetsWithRuleset_ItemRequestBuilder when successful +func (m *ItemRulesetsWithRuleset_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemRulesetsWithRuleset_ItemRequestBuilder) { + return NewItemRulesetsWithRuleset_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_secret_scanning_alerts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_secret_scanning_alerts_request_builder.go new file mode 100644 index 000000000..873968093 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_secret_scanning_alerts_request_builder.go @@ -0,0 +1,90 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i6bfc00bdb302bcd8be4fd093f881ba8f86d967800ec976c34a78d452c1f335d5 "github.com/octokit/go-sdk/pkg/github/orgs/item/secretscanning/alerts" +) + +// ItemSecretScanningAlertsRequestBuilder builds and executes requests for operations under \orgs\{org}\secret-scanning\alerts +type ItemSecretScanningAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemSecretScanningAlertsRequestBuilderGetQueryParameters lists secret scanning alerts for eligible repositories in an organization, from newest to oldest.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +type ItemSecretScanningAlertsRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *i6bfc00bdb302bcd8be4fd093f881ba8f86d967800ec976c34a78d452c1f335d5.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. + Resolution *string `uriparametername:"resolution"` + // A comma-separated list of secret types to return. By default all secret types are returned.See "[Secret scanning patterns](https://docs.github.com/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)"for a complete list of secret types. + Secret_type *string `uriparametername:"secret_type"` + // The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. + Sort *i6bfc00bdb302bcd8be4fd093f881ba8f86d967800ec976c34a78d452c1f335d5.GetSortQueryParameterType `uriparametername:"sort"` + // Set to `open` or `resolved` to only list secret scanning alerts in a specific state. + State *i6bfc00bdb302bcd8be4fd093f881ba8f86d967800ec976c34a78d452c1f335d5.GetStateQueryParameterType `uriparametername:"state"` + // A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. + Validity *string `uriparametername:"validity"` +} +// NewItemSecretScanningAlertsRequestBuilderInternal instantiates a new ItemSecretScanningAlertsRequestBuilder and sets the default values. +func NewItemSecretScanningAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecretScanningAlertsRequestBuilder) { + m := &ItemSecretScanningAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/secret-scanning/alerts{?after*,before*,direction*,page*,per_page*,resolution*,secret_type*,sort*,state*,validity*}", pathParameters), + } + return m +} +// NewItemSecretScanningAlertsRequestBuilder instantiates a new ItemSecretScanningAlertsRequestBuilder and sets the default values. +func NewItemSecretScanningAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecretScanningAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSecretScanningAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists secret scanning alerts for eligible repositories in an organization, from newest to oldest.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a []OrganizationSecretScanningAlertable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a Alerts503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization +func (m *ItemSecretScanningAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSecretScanningAlertsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationSecretScanningAlertable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAlerts503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationSecretScanningAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationSecretScanningAlertable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationSecretScanningAlertable) + } + } + return val, nil +} +// ToGetRequestInformation lists secret scanning alerts for eligible repositories in an organization, from newest to oldest.The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemSecretScanningAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSecretScanningAlertsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemSecretScanningAlertsRequestBuilder when successful +func (m *ItemSecretScanningAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemSecretScanningAlertsRequestBuilder) { + return NewItemSecretScanningAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_secret_scanning_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_secret_scanning_request_builder.go new file mode 100644 index 000000000..2ffa92c44 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_secret_scanning_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSecretScanningRequestBuilder builds and executes requests for operations under \orgs\{org}\secret-scanning +type ItemSecretScanningRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Alerts the alerts property +// returns a *ItemSecretScanningAlertsRequestBuilder when successful +func (m *ItemSecretScanningRequestBuilder) Alerts()(*ItemSecretScanningAlertsRequestBuilder) { + return NewItemSecretScanningAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemSecretScanningRequestBuilderInternal instantiates a new ItemSecretScanningRequestBuilder and sets the default values. +func NewItemSecretScanningRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecretScanningRequestBuilder) { + m := &ItemSecretScanningRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/secret-scanning", pathParameters), + } + return m +} +// NewItemSecretScanningRequestBuilder instantiates a new ItemSecretScanningRequestBuilder and sets the default values. +func NewItemSecretScanningRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecretScanningRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSecretScanningRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_security_advisories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_security_advisories_request_builder.go new file mode 100644 index 000000000..bd702f73e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_security_advisories_request_builder.go @@ -0,0 +1,82 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i73af498fc508ab66c6d7b9e1987fbbf6febbe066a7dc653ccf219a9638b2bc60 "github.com/octokit/go-sdk/pkg/github/orgs/item/securityadvisories" +) + +// ItemSecurityAdvisoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\security-advisories +type ItemSecurityAdvisoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemSecurityAdvisoriesRequestBuilderGetQueryParameters lists repository security advisories for an organization.The authenticated user must be an owner or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:write` scope to use this endpoint. +type ItemSecurityAdvisoriesRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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)." + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *i73af498fc508ab66c6d7b9e1987fbbf6febbe066a7dc653ccf219a9638b2bc60.GetDirectionQueryParameterType `uriparametername:"direction"` + // The number of advisories to return per page. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The property to sort the results by. + Sort *i73af498fc508ab66c6d7b9e1987fbbf6febbe066a7dc653ccf219a9638b2bc60.GetSortQueryParameterType `uriparametername:"sort"` + // Filter by the state of the repository advisories. Only advisories of this state will be returned. + State *i73af498fc508ab66c6d7b9e1987fbbf6febbe066a7dc653ccf219a9638b2bc60.GetStateQueryParameterType `uriparametername:"state"` +} +// NewItemSecurityAdvisoriesRequestBuilderInternal instantiates a new ItemSecurityAdvisoriesRequestBuilder and sets the default values. +func NewItemSecurityAdvisoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecurityAdvisoriesRequestBuilder) { + m := &ItemSecurityAdvisoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/security-advisories{?after*,before*,direction*,per_page*,sort*,state*}", pathParameters), + } + return m +} +// NewItemSecurityAdvisoriesRequestBuilder instantiates a new ItemSecurityAdvisoriesRequestBuilder and sets the default values. +func NewItemSecurityAdvisoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecurityAdvisoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSecurityAdvisoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists repository security advisories for an organization.The authenticated user must be an owner or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:write` scope to use this endpoint. +// returns a []RepositoryAdvisoryable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization +func (m *ItemSecurityAdvisoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSecurityAdvisoriesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryAdvisoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists repository security advisories for an organization.The authenticated user must be an owner or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:write` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemSecurityAdvisoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSecurityAdvisoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemSecurityAdvisoriesRequestBuilder when successful +func (m *ItemSecurityAdvisoriesRequestBuilder) WithUrl(rawUrl string)(*ItemSecurityAdvisoriesRequestBuilder) { + return NewItemSecurityAdvisoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_security_managers_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_security_managers_request_builder.go new file mode 100644 index 000000000..28636e301 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_security_managers_request_builder.go @@ -0,0 +1,65 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemSecurityManagersRequestBuilder builds and executes requests for operations under \orgs\{org}\security-managers +type ItemSecurityManagersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemSecurityManagersRequestBuilderInternal instantiates a new ItemSecurityManagersRequestBuilder and sets the default values. +func NewItemSecurityManagersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecurityManagersRequestBuilder) { + m := &ItemSecurityManagersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/security-managers", pathParameters), + } + return m +} +// NewItemSecurityManagersRequestBuilder instantiates a new ItemSecurityManagersRequestBuilder and sets the default values. +func NewItemSecurityManagersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecurityManagersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSecurityManagersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists teams that are security managers for an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +// returns a []TeamSimpleable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams +func (m *ItemSecurityManagersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamSimpleFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamSimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamSimpleable) + } + } + return val, nil +} +// Teams the teams property +// returns a *ItemSecurityManagersTeamsRequestBuilder when successful +func (m *ItemSecurityManagersRequestBuilder) Teams()(*ItemSecurityManagersTeamsRequestBuilder) { + return NewItemSecurityManagersTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists teams that are security managers for an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemSecurityManagersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemSecurityManagersRequestBuilder when successful +func (m *ItemSecurityManagersRequestBuilder) WithUrl(rawUrl string)(*ItemSecurityManagersRequestBuilder) { + return NewItemSecurityManagersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_security_managers_teams_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_security_managers_teams_request_builder.go new file mode 100644 index 000000000..c1ed00165 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_security_managers_teams_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSecurityManagersTeamsRequestBuilder builds and executes requests for operations under \orgs\{org}\security-managers\teams +type ItemSecurityManagersTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByTeam_slug gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.securityManagers.teams.item collection +// returns a *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder when successful +func (m *ItemSecurityManagersTeamsRequestBuilder) ByTeam_slug(team_slug string)(*ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if team_slug != "" { + urlTplParams["team_slug"] = team_slug + } + return NewItemSecurityManagersTeamsWithTeam_slugItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemSecurityManagersTeamsRequestBuilderInternal instantiates a new ItemSecurityManagersTeamsRequestBuilder and sets the default values. +func NewItemSecurityManagersTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecurityManagersTeamsRequestBuilder) { + m := &ItemSecurityManagersTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/security-managers/teams", pathParameters), + } + return m +} +// NewItemSecurityManagersTeamsRequestBuilder instantiates a new ItemSecurityManagersTeamsRequestBuilder and sets the default values. +func NewItemSecurityManagersTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecurityManagersTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSecurityManagersTeamsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_security_managers_teams_with_team_slug_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_security_managers_teams_with_team_slug_item_request_builder.go new file mode 100644 index 000000000..8ffe05f67 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_security_managers_teams_with_team_slug_item_request_builder.go @@ -0,0 +1,73 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder builds and executes requests for operations under \orgs\{org}\security-managers\teams\{team_slug} +type ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemSecurityManagersTeamsWithTeam_slugItemRequestBuilderInternal instantiates a new ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder and sets the default values. +func NewItemSecurityManagersTeamsWithTeam_slugItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) { + m := &ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/security-managers/teams/{team_slug}", pathParameters), + } + return m +} +// NewItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder instantiates a new ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder and sets the default values. +func NewItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSecurityManagersTeamsWithTeam_slugItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes the security manager role from a team for an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) team from an organization."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team +func (m *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put adds a team as a security manager for an organization. For more information, see "[Managing security for an organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) for an organization."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team +func (m *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes the security manager role from a team for an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) team from an organization."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToPutRequestInformation adds a team as a security manager for an organization. For more information, see "[Managing security for an organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) for an organization."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder when successful +func (m *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) WithUrl(rawUrl string)(*ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) { + return NewItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_settings_billing_actions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_settings_billing_actions_request_builder.go new file mode 100644 index 000000000..44615f829 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_settings_billing_actions_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemSettingsBillingActionsRequestBuilder builds and executes requests for operations under \orgs\{org}\settings\billing\actions +type ItemSettingsBillingActionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemSettingsBillingActionsRequestBuilderInternal instantiates a new ItemSettingsBillingActionsRequestBuilder and sets the default values. +func NewItemSettingsBillingActionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingActionsRequestBuilder) { + m := &ItemSettingsBillingActionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/settings/billing/actions", pathParameters), + } + return m +} +// NewItemSettingsBillingActionsRequestBuilder instantiates a new ItemSettingsBillingActionsRequestBuilder and sets the default values. +func NewItemSettingsBillingActionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingActionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSettingsBillingActionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the summary of the free and paid GitHub Actions minutes used.Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)".OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. +// returns a ActionsBillingUsageable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization +func (m *ItemSettingsBillingActionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsBillingUsageable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsBillingUsageFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsBillingUsageable), nil +} +// ToGetRequestInformation gets the summary of the free and paid GitHub Actions minutes used.Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)".OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemSettingsBillingActionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemSettingsBillingActionsRequestBuilder when successful +func (m *ItemSettingsBillingActionsRequestBuilder) WithUrl(rawUrl string)(*ItemSettingsBillingActionsRequestBuilder) { + return NewItemSettingsBillingActionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_settings_billing_packages_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_settings_billing_packages_request_builder.go new file mode 100644 index 000000000..a0a865a28 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_settings_billing_packages_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemSettingsBillingPackagesRequestBuilder builds and executes requests for operations under \orgs\{org}\settings\billing\packages +type ItemSettingsBillingPackagesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemSettingsBillingPackagesRequestBuilderInternal instantiates a new ItemSettingsBillingPackagesRequestBuilder and sets the default values. +func NewItemSettingsBillingPackagesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingPackagesRequestBuilder) { + m := &ItemSettingsBillingPackagesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/settings/billing/packages", pathParameters), + } + return m +} +// NewItemSettingsBillingPackagesRequestBuilder instantiates a new ItemSettingsBillingPackagesRequestBuilder and sets the default values. +func NewItemSettingsBillingPackagesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingPackagesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSettingsBillingPackagesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the free and paid storage used for GitHub Packages in gigabytes.Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)."OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. +// returns a PackagesBillingUsageable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization +func (m *ItemSettingsBillingPackagesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackagesBillingUsageable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePackagesBillingUsageFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackagesBillingUsageable), nil +} +// ToGetRequestInformation gets the free and paid storage used for GitHub Packages in gigabytes.Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)."OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemSettingsBillingPackagesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemSettingsBillingPackagesRequestBuilder when successful +func (m *ItemSettingsBillingPackagesRequestBuilder) WithUrl(rawUrl string)(*ItemSettingsBillingPackagesRequestBuilder) { + return NewItemSettingsBillingPackagesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_settings_billing_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_settings_billing_request_builder.go new file mode 100644 index 000000000..f200bfd06 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_settings_billing_request_builder.go @@ -0,0 +1,38 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSettingsBillingRequestBuilder builds and executes requests for operations under \orgs\{org}\settings\billing +type ItemSettingsBillingRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Actions the actions property +// returns a *ItemSettingsBillingActionsRequestBuilder when successful +func (m *ItemSettingsBillingRequestBuilder) Actions()(*ItemSettingsBillingActionsRequestBuilder) { + return NewItemSettingsBillingActionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemSettingsBillingRequestBuilderInternal instantiates a new ItemSettingsBillingRequestBuilder and sets the default values. +func NewItemSettingsBillingRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingRequestBuilder) { + m := &ItemSettingsBillingRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/settings/billing", pathParameters), + } + return m +} +// NewItemSettingsBillingRequestBuilder instantiates a new ItemSettingsBillingRequestBuilder and sets the default values. +func NewItemSettingsBillingRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSettingsBillingRequestBuilderInternal(urlParams, requestAdapter) +} +// Packages the packages property +// returns a *ItemSettingsBillingPackagesRequestBuilder when successful +func (m *ItemSettingsBillingRequestBuilder) Packages()(*ItemSettingsBillingPackagesRequestBuilder) { + return NewItemSettingsBillingPackagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SharedStorage the sharedStorage property +// returns a *ItemSettingsBillingSharedStorageRequestBuilder when successful +func (m *ItemSettingsBillingRequestBuilder) SharedStorage()(*ItemSettingsBillingSharedStorageRequestBuilder) { + return NewItemSettingsBillingSharedStorageRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_settings_billing_shared_storage_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_settings_billing_shared_storage_request_builder.go new file mode 100644 index 000000000..e1518fd07 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_settings_billing_shared_storage_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemSettingsBillingSharedStorageRequestBuilder builds and executes requests for operations under \orgs\{org}\settings\billing\shared-storage +type ItemSettingsBillingSharedStorageRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemSettingsBillingSharedStorageRequestBuilderInternal instantiates a new ItemSettingsBillingSharedStorageRequestBuilder and sets the default values. +func NewItemSettingsBillingSharedStorageRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingSharedStorageRequestBuilder) { + m := &ItemSettingsBillingSharedStorageRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/settings/billing/shared-storage", pathParameters), + } + return m +} +// NewItemSettingsBillingSharedStorageRequestBuilder instantiates a new ItemSettingsBillingSharedStorageRequestBuilder and sets the default values. +func NewItemSettingsBillingSharedStorageRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingSharedStorageRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSettingsBillingSharedStorageRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages.Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)."OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. +// returns a CombinedBillingUsageable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-an-organization +func (m *ItemSettingsBillingSharedStorageRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CombinedBillingUsageable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCombinedBillingUsageFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CombinedBillingUsageable), nil +} +// ToGetRequestInformation gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages.Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)."OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemSettingsBillingSharedStorageRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemSettingsBillingSharedStorageRequestBuilder when successful +func (m *ItemSettingsBillingSharedStorageRequestBuilder) WithUrl(rawUrl string)(*ItemSettingsBillingSharedStorageRequestBuilder) { + return NewItemSettingsBillingSharedStorageRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_settings_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_settings_request_builder.go new file mode 100644 index 000000000..8939a225e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_settings_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSettingsRequestBuilder builds and executes requests for operations under \orgs\{org}\settings +type ItemSettingsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Billing the billing property +// returns a *ItemSettingsBillingRequestBuilder when successful +func (m *ItemSettingsRequestBuilder) Billing()(*ItemSettingsBillingRequestBuilder) { + return NewItemSettingsBillingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemSettingsRequestBuilderInternal instantiates a new ItemSettingsRequestBuilder and sets the default values. +func NewItemSettingsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsRequestBuilder) { + m := &ItemSettingsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/settings", pathParameters), + } + return m +} +// NewItemSettingsRequestBuilder instantiates a new ItemSettingsRequestBuilder and sets the default values. +func NewItemSettingsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSettingsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_team_item_copilot_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_team_item_copilot_request_builder.go new file mode 100644 index 000000000..184e910cf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_team_item_copilot_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemTeamItemCopilotRequestBuilder builds and executes requests for operations under \orgs\{org}\team\{team_slug}\copilot +type ItemTeamItemCopilotRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTeamItemCopilotRequestBuilderInternal instantiates a new ItemTeamItemCopilotRequestBuilder and sets the default values. +func NewItemTeamItemCopilotRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamItemCopilotRequestBuilder) { + m := &ItemTeamItemCopilotRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/team/{team_slug}/copilot", pathParameters), + } + return m +} +// NewItemTeamItemCopilotRequestBuilder instantiates a new ItemTeamItemCopilotRequestBuilder and sets the default values. +func NewItemTeamItemCopilotRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamItemCopilotRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamItemCopilotRequestBuilderInternal(urlParams, requestAdapter) +} +// Usage the usage property +// returns a *ItemTeamItemCopilotUsageRequestBuilder when successful +func (m *ItemTeamItemCopilotRequestBuilder) Usage()(*ItemTeamItemCopilotUsageRequestBuilder) { + return NewItemTeamItemCopilotUsageRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_team_item_copilot_usage_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_team_item_copilot_usage_request_builder.go new file mode 100644 index 000000000..b885199b6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_team_item_copilot_usage_request_builder.go @@ -0,0 +1,81 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemTeamItemCopilotUsageRequestBuilder builds and executes requests for operations under \orgs\{org}\team\{team_slug}\copilot\usage +type ItemTeamItemCopilotUsageRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamItemCopilotUsageRequestBuilderGetQueryParameters **Note**: This endpoint is in beta and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEfor users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.See the response schema tab for detailed metrics definitions.The response contains metrics for the prior 28 days. Usage metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.**Note**: This endpoint will only return results for a given day if the team had five or more members on that day.Copilot Business or Copilot Enterprise organization owners for the organization that contains this team,and owners and billing managers of their parent enterprises, can view Copilot usage metrics for a team.OAuth app tokens and personal access tokens (classic) need the `copilot`, `manage_billing:copilot`, `admin:org`, `admin:enterprise`, or `manage_billing:enterprise` scope to use this endpoint. +type ItemTeamItemCopilotUsageRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + Since *string `uriparametername:"since"` + // Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + Until *string `uriparametername:"until"` +} +// NewItemTeamItemCopilotUsageRequestBuilderInternal instantiates a new ItemTeamItemCopilotUsageRequestBuilder and sets the default values. +func NewItemTeamItemCopilotUsageRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamItemCopilotUsageRequestBuilder) { + m := &ItemTeamItemCopilotUsageRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/team/{team_slug}/copilot/usage{?page*,per_page*,since*,until*}", pathParameters), + } + return m +} +// NewItemTeamItemCopilotUsageRequestBuilder instantiates a new ItemTeamItemCopilotUsageRequestBuilder and sets the default values. +func NewItemTeamItemCopilotUsageRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamItemCopilotUsageRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamItemCopilotUsageRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Note**: This endpoint is in beta and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEfor users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.See the response schema tab for detailed metrics definitions.The response contains metrics for the prior 28 days. Usage metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.**Note**: This endpoint will only return results for a given day if the team had five or more members on that day.Copilot Business or Copilot Enterprise organization owners for the organization that contains this team,and owners and billing managers of their parent enterprises, can view Copilot usage metrics for a team.OAuth app tokens and personal access tokens (classic) need the `copilot`, `manage_billing:copilot`, `admin:org`, `admin:enterprise`, or `manage_billing:enterprise` scope to use this endpoint. +// returns a []CopilotUsageMetricsable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-a-team +func (m *ItemTeamItemCopilotUsageRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamItemCopilotUsageRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCopilotUsageMetricsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsable) + } + } + return val, nil +} +// ToGetRequestInformation **Note**: This endpoint is in beta and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEfor users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.See the response schema tab for detailed metrics definitions.The response contains metrics for the prior 28 days. Usage metrics are processed once per day for the previous day,and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,they must have telemetry enabled in their IDE.**Note**: This endpoint will only return results for a given day if the team had five or more members on that day.Copilot Business or Copilot Enterprise organization owners for the organization that contains this team,and owners and billing managers of their parent enterprises, can view Copilot usage metrics for a team.OAuth app tokens and personal access tokens (classic) need the `copilot`, `manage_billing:copilot`, `admin:org`, `admin:enterprise`, or `manage_billing:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamItemCopilotUsageRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamItemCopilotUsageRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamItemCopilotUsageRequestBuilder when successful +func (m *ItemTeamItemCopilotUsageRequestBuilder) WithUrl(rawUrl string)(*ItemTeamItemCopilotUsageRequestBuilder) { + return NewItemTeamItemCopilotUsageRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_team_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_team_request_builder.go new file mode 100644 index 000000000..173b4f231 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_team_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemTeamRequestBuilder builds and executes requests for operations under \orgs\{org}\team +type ItemTeamRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByTeam_slug gets an item from the github.com/octokit/go-sdk/pkg/github/.orgs.item.team.item collection +// returns a *ItemTeamWithTeam_slugItemRequestBuilder when successful +func (m *ItemTeamRequestBuilder) ByTeam_slug(team_slug string)(*ItemTeamWithTeam_slugItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if team_slug != "" { + urlTplParams["team_slug"] = team_slug + } + return NewItemTeamWithTeam_slugItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamRequestBuilderInternal instantiates a new ItemTeamRequestBuilder and sets the default values. +func NewItemTeamRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamRequestBuilder) { + m := &ItemTeamRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/team", pathParameters), + } + return m +} +// NewItemTeamRequestBuilder instantiates a new ItemTeamRequestBuilder and sets the default values. +func NewItemTeamRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_team_with_team_slug_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_team_with_team_slug_item_request_builder.go new file mode 100644 index 000000000..744397dd0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_team_with_team_slug_item_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemTeamWithTeam_slugItemRequestBuilder builds and executes requests for operations under \orgs\{org}\team\{team_slug} +type ItemTeamWithTeam_slugItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTeamWithTeam_slugItemRequestBuilderInternal instantiates a new ItemTeamWithTeam_slugItemRequestBuilder and sets the default values. +func NewItemTeamWithTeam_slugItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamWithTeam_slugItemRequestBuilder) { + m := &ItemTeamWithTeam_slugItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/team/{team_slug}", pathParameters), + } + return m +} +// NewItemTeamWithTeam_slugItemRequestBuilder instantiates a new ItemTeamWithTeam_slugItemRequestBuilder and sets the default values. +func NewItemTeamWithTeam_slugItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamWithTeam_slugItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamWithTeam_slugItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Copilot the copilot property +// returns a *ItemTeamItemCopilotRequestBuilder when successful +func (m *ItemTeamWithTeam_slugItemRequestBuilder) Copilot()(*ItemTeamItemCopilotRequestBuilder) { + return NewItemTeamItemCopilotRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_post_request_body.go new file mode 100644 index 000000000..10212070e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody instantiates a new ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody()(*ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody) { + m := &ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody(), 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 *ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_request_builder.go new file mode 100644 index 000000000..1bc5bee83 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_request_builder.go @@ -0,0 +1,112 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + iefa3e26ef1cc3fba04de58ff0a613f870c857a429121fb15edb32bc7c39e1c53 "github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/comments/item/reactions" +) + +// ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\discussions\{discussion_number}\comments\{comment_number}\reactions +type ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilderGetQueryParameters list the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +type ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion comment. + Content *iefa3e26ef1cc3fba04de58ff0a613f870c857a429121fb15edb32bc7c39e1c53.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByReaction_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.teams.item.discussions.item.comments.item.reactions.item collection +// returns a *ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) ByReaction_id(reaction_id int32)(*ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["reaction_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(reaction_id), 10) + return NewItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilderInternal instantiates a new ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) { + m := &ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder instantiates a new ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a []Reactionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable) + } + } + return val, nil +} +// Post create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a Reactionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) Post(ctx context.Context, body ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable), nil +} +// ToGetRequestInformation list the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) { + return NewItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_with_reaction_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_with_reaction_item_request_builder.go new file mode 100644 index 000000000..1e9ae37f8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_with_reaction_item_request_builder.go @@ -0,0 +1,51 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\discussions\{discussion_number}\comments\{comment_number}\reactions\{reaction_id} +type ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilderInternal instantiates a new ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder) { + m := &ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}", pathParameters), + } + return m +} +// NewItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder instantiates a new ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete **Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`.Delete a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-comment-reaction +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation **Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`.Delete a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder) { + return NewItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_item_with_comment_number_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_item_with_comment_number_patch_request_body.go new file mode 100644 index 000000000..c43bf70db --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_item_with_comment_number_patch_request_body.go @@ -0,0 +1,80 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The discussion comment's body text. + body *string +} +// NewItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody instantiates a new ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody()(*ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) { + m := &ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody(), 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 *ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The discussion comment's body text. +// returns a *string when successful +func (m *ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The discussion comment's body text. +func (m *ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_post_request_body.go new file mode 100644 index 000000000..adc087395 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_post_request_body.go @@ -0,0 +1,80 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemDiscussionsItemCommentsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The discussion comment's body text. + body *string +} +// NewItemTeamsItemDiscussionsItemCommentsPostRequestBody instantiates a new ItemTeamsItemDiscussionsItemCommentsPostRequestBody and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsPostRequestBody()(*ItemTeamsItemDiscussionsItemCommentsPostRequestBody) { + m := &ItemTeamsItemDiscussionsItemCommentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemDiscussionsItemCommentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemDiscussionsItemCommentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemDiscussionsItemCommentsPostRequestBody(), 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 *ItemTeamsItemDiscussionsItemCommentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The discussion comment's body text. +// returns a *string when successful +func (m *ItemTeamsItemDiscussionsItemCommentsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTeamsItemDiscussionsItemCommentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemTeamsItemDiscussionsItemCommentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemTeamsItemDiscussionsItemCommentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The discussion comment's body text. +func (m *ItemTeamsItemDiscussionsItemCommentsPostRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemTeamsItemDiscussionsItemCommentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_request_builder.go new file mode 100644 index 000000000..f05bd1bf1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_request_builder.go @@ -0,0 +1,112 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + iae5ab5524c281dee4a3db19e9729c3a76291b14b0954b0f842181a85dd4a965e "github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/comments" +) + +// ItemTeamsItemDiscussionsItemCommentsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\discussions\{discussion_number}\comments +type ItemTeamsItemDiscussionsItemCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsItemDiscussionsItemCommentsRequestBuilderGetQueryParameters list all comments on a team discussion.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +type ItemTeamsItemDiscussionsItemCommentsRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *iae5ab5524c281dee4a3db19e9729c3a76291b14b0954b0f842181a85dd4a965e.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByComment_number gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.teams.item.discussions.item.comments.item collection +// returns a *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemCommentsRequestBuilder) ByComment_number(comment_number int32)(*ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["comment_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(comment_number), 10) + return NewItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemDiscussionsItemCommentsRequestBuilderInternal instantiates a new ItemTeamsItemDiscussionsItemCommentsRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemCommentsRequestBuilder) { + m := &ItemTeamsItemDiscussionsItemCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments{?direction*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemTeamsItemDiscussionsItemCommentsRequestBuilder instantiates a new ItemTeamsItemDiscussionsItemCommentsRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemDiscussionsItemCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all comments on a team discussion.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a []TeamDiscussionCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments +func (m *ItemTeamsItemDiscussionsItemCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemDiscussionsItemCommentsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamDiscussionCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable) + } + } + return val, nil +} +// Post creates a new comment on a team discussion.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a TeamDiscussionCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment +func (m *ItemTeamsItemDiscussionsItemCommentsRequestBuilder) Post(ctx context.Context, body ItemTeamsItemDiscussionsItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamDiscussionCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable), nil +} +// ToGetRequestInformation list all comments on a team discussion.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemDiscussionsItemCommentsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a new comment on a team discussion.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemCommentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemTeamsItemDiscussionsItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsItemDiscussionsItemCommentsRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemDiscussionsItemCommentsRequestBuilder) { + return NewItemTeamsItemDiscussionsItemCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_with_comment_number_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_with_comment_number_item_request_builder.go new file mode 100644 index 000000000..e4a52f847 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_comments_with_comment_number_item_request_builder.go @@ -0,0 +1,115 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\discussions\{discussion_number}\comments\{comment_number} +type ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilderInternal instantiates a new ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) { + m := &ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}", pathParameters), + } + return m +} +// NewItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder instantiates a new ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a comment on a team discussion.**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment +func (m *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get get a specific comment on a team discussion.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a TeamDiscussionCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment +func (m *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamDiscussionCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable), nil +} +// Patch edits the body text of a discussion comment.**Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a TeamDiscussionCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment +func (m *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) Patch(ctx context.Context, body ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamDiscussionCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable), nil +} +// Reactions the reactions property +// returns a *ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) Reactions()(*ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) { + return NewItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a comment on a team discussion.**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation get a specific comment on a team discussion.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation edits the body text of a discussion comment.**Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) { + return NewItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_reactions_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_reactions_post_request_body.go new file mode 100644 index 000000000..6efa33848 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemDiscussionsItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemTeamsItemDiscussionsItemReactionsPostRequestBody instantiates a new ItemTeamsItemDiscussionsItemReactionsPostRequestBody and sets the default values. +func NewItemTeamsItemDiscussionsItemReactionsPostRequestBody()(*ItemTeamsItemDiscussionsItemReactionsPostRequestBody) { + m := &ItemTeamsItemDiscussionsItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemDiscussionsItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemDiscussionsItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemDiscussionsItemReactionsPostRequestBody(), 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 *ItemTeamsItemDiscussionsItemReactionsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTeamsItemDiscussionsItemReactionsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemTeamsItemDiscussionsItemReactionsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemTeamsItemDiscussionsItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemTeamsItemDiscussionsItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_reactions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_reactions_request_builder.go new file mode 100644 index 000000000..ed4efe674 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_reactions_request_builder.go @@ -0,0 +1,112 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + iac6fb0a635617f45786d5b56686ceb8e83ee12551475679c06c4ed9039ff1a3f "github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/reactions" +) + +// ItemTeamsItemDiscussionsItemReactionsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\discussions\{discussion_number}\reactions +type ItemTeamsItemDiscussionsItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsItemDiscussionsItemReactionsRequestBuilderGetQueryParameters list the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +type ItemTeamsItemDiscussionsItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion. + Content *iac6fb0a635617f45786d5b56686ceb8e83ee12551475679c06c4ed9039ff1a3f.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByReaction_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.teams.item.discussions.item.reactions.item collection +// returns a *ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemReactionsRequestBuilder) ByReaction_id(reaction_id int32)(*ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["reaction_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(reaction_id), 10) + return NewItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemDiscussionsItemReactionsRequestBuilderInternal instantiates a new ItemTeamsItemDiscussionsItemReactionsRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemReactionsRequestBuilder) { + m := &ItemTeamsItemDiscussionsItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemTeamsItemDiscussionsItemReactionsRequestBuilder instantiates a new ItemTeamsItemDiscussionsItemReactionsRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemDiscussionsItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a []Reactionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion +func (m *ItemTeamsItemDiscussionsItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemDiscussionsItemReactionsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable) + } + } + return val, nil +} +// Post create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).A response with an HTTP `200` status means that you already added the reaction type to this team discussion.**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a Reactionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion +func (m *ItemTeamsItemDiscussionsItemReactionsRequestBuilder) Post(ctx context.Context, body ItemTeamsItemDiscussionsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable), nil +} +// ToGetRequestInformation list the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemDiscussionsItemReactionsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).A response with an HTTP `200` status means that you already added the reaction type to this team discussion.**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemTeamsItemDiscussionsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsItemDiscussionsItemReactionsRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemDiscussionsItemReactionsRequestBuilder) { + return NewItemTeamsItemDiscussionsItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_reactions_with_reaction_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_reactions_with_reaction_item_request_builder.go new file mode 100644 index 000000000..6ba5dcd54 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_reactions_with_reaction_item_request_builder.go @@ -0,0 +1,51 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\discussions\{discussion_number}\reactions\{reaction_id} +type ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilderInternal instantiates a new ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder) { + m := &ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}", pathParameters), + } + return m +} +// NewItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder instantiates a new ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete **Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`.Delete a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#delete-team-discussion-reaction +func (m *ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation **Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`.Delete a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder) { + return NewItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_with_discussion_number_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_with_discussion_number_patch_request_body.go new file mode 100644 index 000000000..b36c827c5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_item_with_discussion_number_patch_request_body.go @@ -0,0 +1,109 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The discussion post's body text. + body *string + // The discussion post's title. + title *string +} +// NewItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody instantiates a new ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody and sets the default values. +func NewItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody()(*ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) { + m := &ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody(), 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 *ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The discussion post's body text. +// returns a *string when successful +func (m *ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetTitle gets the title property value. The discussion post's title. +// returns a *string when successful +func (m *ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The discussion post's body text. +func (m *ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) SetBody(value *string)() { + m.body = value +} +// SetTitle sets the title property value. The discussion post's title. +func (m *ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetTitle()(*string) + SetBody(value *string)() + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_post_request_body.go new file mode 100644 index 000000000..cdc27b361 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_post_request_body.go @@ -0,0 +1,138 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemDiscussionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The discussion post's body text. + body *string + // Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. + private *bool + // The discussion post's title. + title *string +} +// NewItemTeamsItemDiscussionsPostRequestBody instantiates a new ItemTeamsItemDiscussionsPostRequestBody and sets the default values. +func NewItemTeamsItemDiscussionsPostRequestBody()(*ItemTeamsItemDiscussionsPostRequestBody) { + m := &ItemTeamsItemDiscussionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemDiscussionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemDiscussionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemDiscussionsPostRequestBody(), 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 *ItemTeamsItemDiscussionsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The discussion post's body text. +// returns a *string when successful +func (m *ItemTeamsItemDiscussionsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTeamsItemDiscussionsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetPrivate gets the private property value. Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. +// returns a *bool when successful +func (m *ItemTeamsItemDiscussionsPostRequestBody) GetPrivate()(*bool) { + return m.private +} +// GetTitle gets the title property value. The discussion post's title. +// returns a *string when successful +func (m *ItemTeamsItemDiscussionsPostRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemTeamsItemDiscussionsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemTeamsItemDiscussionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The discussion post's body text. +func (m *ItemTeamsItemDiscussionsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetPrivate sets the private property value. Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. +func (m *ItemTeamsItemDiscussionsPostRequestBody) SetPrivate(value *bool)() { + m.private = value +} +// SetTitle sets the title property value. The discussion post's title. +func (m *ItemTeamsItemDiscussionsPostRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemTeamsItemDiscussionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetPrivate()(*bool) + GetTitle()(*string) + SetBody(value *string)() + SetPrivate(value *bool)() + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_request_builder.go new file mode 100644 index 000000000..71775a756 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_request_builder.go @@ -0,0 +1,114 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i32f937b11a61715fd997bf78349df960035ffb33236a68f6136f39076fe893c2 "github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions" +) + +// ItemTeamsItemDiscussionsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\discussions +type ItemTeamsItemDiscussionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsItemDiscussionsRequestBuilderGetQueryParameters list all discussions on a team's page.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +type ItemTeamsItemDiscussionsRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i32f937b11a61715fd997bf78349df960035ffb33236a68f6136f39076fe893c2.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Pinned discussions only filter + Pinned *string `uriparametername:"pinned"` +} +// ByDiscussion_number gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.teams.item.discussions.item collection +// returns a *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsRequestBuilder) ByDiscussion_number(discussion_number int32)(*ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["discussion_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(discussion_number), 10) + return NewItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemDiscussionsRequestBuilderInternal instantiates a new ItemTeamsItemDiscussionsRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsRequestBuilder) { + m := &ItemTeamsItemDiscussionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/discussions{?direction*,page*,per_page*,pinned*}", pathParameters), + } + return m +} +// NewItemTeamsItemDiscussionsRequestBuilder instantiates a new ItemTeamsItemDiscussionsRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemDiscussionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all discussions on a team's page.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a []TeamDiscussionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussions#list-discussions +func (m *ItemTeamsItemDiscussionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemDiscussionsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamDiscussionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable) + } + } + return val, nil +} +// Post creates a new discussion post on a team's page.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a TeamDiscussionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussions#create-a-discussion +func (m *ItemTeamsItemDiscussionsRequestBuilder) Post(ctx context.Context, body ItemTeamsItemDiscussionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamDiscussionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable), nil +} +// ToGetRequestInformation list all discussions on a team's page.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemDiscussionsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a new discussion post on a team's page.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemTeamsItemDiscussionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsItemDiscussionsRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemDiscussionsRequestBuilder) { + return NewItemTeamsItemDiscussionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_with_discussion_number_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_with_discussion_number_item_request_builder.go new file mode 100644 index 000000000..4f55f9453 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_discussions_with_discussion_number_item_request_builder.go @@ -0,0 +1,120 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\discussions\{discussion_number} +type ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Comments the comments property +// returns a *ItemTeamsItemDiscussionsItemCommentsRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) Comments()(*ItemTeamsItemDiscussionsItemCommentsRequestBuilder) { + return NewItemTeamsItemDiscussionsItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilderInternal instantiates a new ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) { + m := &ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}", pathParameters), + } + return m +} +// NewItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder instantiates a new ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a discussion from a team's page.**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussions#delete-a-discussion +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get get a specific discussion on a team's page.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a TeamDiscussionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussions#get-a-discussion +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamDiscussionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable), nil +} +// Patch edits the title and body text of a discussion post. Only the parameters you provide are updated.**Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a TeamDiscussionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussions#update-a-discussion +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) Patch(ctx context.Context, body ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamDiscussionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable), nil +} +// Reactions the reactions property +// returns a *ItemTeamsItemDiscussionsItemReactionsRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) Reactions()(*ItemTeamsItemDiscussionsItemReactionsRequestBuilder) { + return NewItemTeamsItemDiscussionsItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation delete a discussion from a team's page.**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation get a specific discussion on a team's page.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation edits the title and body text of a discussion post. Only the parameters you provide are updated.**Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) { + return NewItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_invitations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_invitations_request_builder.go new file mode 100644 index 000000000..cb48dacaf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_invitations_request_builder.go @@ -0,0 +1,67 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemTeamsItemInvitationsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\invitations +type ItemTeamsItemInvitationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsItemInvitationsRequestBuilderGetQueryParameters the return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/invitations`. +type ItemTeamsItemInvitationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemTeamsItemInvitationsRequestBuilderInternal instantiates a new ItemTeamsItemInvitationsRequestBuilder and sets the default values. +func NewItemTeamsItemInvitationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemInvitationsRequestBuilder) { + m := &ItemTeamsItemInvitationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/invitations{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemTeamsItemInvitationsRequestBuilder instantiates a new ItemTeamsItemInvitationsRequestBuilder and sets the default values. +func NewItemTeamsItemInvitationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemInvitationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemInvitationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get the return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/invitations`. +// returns a []OrganizationInvitationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/members#list-pending-team-invitations +func (m *ItemTeamsItemInvitationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemInvitationsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationInvitationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationInvitationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationInvitationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationInvitationable) + } + } + return val, nil +} +// ToGetRequestInformation the return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/invitations`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemInvitationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemInvitationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsItemInvitationsRequestBuilder when successful +func (m *ItemTeamsItemInvitationsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemInvitationsRequestBuilder) { + return NewItemTeamsItemInvitationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_members_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_members_request_builder.go new file mode 100644 index 000000000..d50282fd0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_members_request_builder.go @@ -0,0 +1,70 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i0dd1a76c81fc0773dd62fbda88dd3b1f98759b2b5b38b48e0269538d619f6668 "github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/members" +) + +// ItemTeamsItemMembersRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\members +type ItemTeamsItemMembersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsItemMembersRequestBuilderGetQueryParameters team members will include the members of child teams.To list members in a team, the team must be visible to the authenticated user. +type ItemTeamsItemMembersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Filters members returned by their role in the team. + Role *i0dd1a76c81fc0773dd62fbda88dd3b1f98759b2b5b38b48e0269538d619f6668.GetRoleQueryParameterType `uriparametername:"role"` +} +// NewItemTeamsItemMembersRequestBuilderInternal instantiates a new ItemTeamsItemMembersRequestBuilder and sets the default values. +func NewItemTeamsItemMembersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemMembersRequestBuilder) { + m := &ItemTeamsItemMembersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/members{?page*,per_page*,role*}", pathParameters), + } + return m +} +// NewItemTeamsItemMembersRequestBuilder instantiates a new ItemTeamsItemMembersRequestBuilder and sets the default values. +func NewItemTeamsItemMembersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemMembersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemMembersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get team members will include the members of child teams.To list members in a team, the team must be visible to the authenticated user. +// returns a []SimpleUserable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/members#list-team-members +func (m *ItemTeamsItemMembersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemMembersRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation team members will include the members of child teams.To list members in a team, the team must be visible to the authenticated user. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemMembersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemMembersRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsItemMembersRequestBuilder when successful +func (m *ItemTeamsItemMembersRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemMembersRequestBuilder) { + return NewItemTeamsItemMembersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_memberships_item_with_username_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_memberships_item_with_username_put_request_body.go new file mode 100644 index 000000000..fa876a479 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_memberships_item_with_username_put_request_body.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemMembershipsItemWithUsernamePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemTeamsItemMembershipsItemWithUsernamePutRequestBody instantiates a new ItemTeamsItemMembershipsItemWithUsernamePutRequestBody and sets the default values. +func NewItemTeamsItemMembershipsItemWithUsernamePutRequestBody()(*ItemTeamsItemMembershipsItemWithUsernamePutRequestBody) { + m := &ItemTeamsItemMembershipsItemWithUsernamePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemMembershipsItemWithUsernamePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemMembershipsItemWithUsernamePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemMembershipsItemWithUsernamePutRequestBody(), 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 *ItemTeamsItemMembershipsItemWithUsernamePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTeamsItemMembershipsItemWithUsernamePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemTeamsItemMembershipsItemWithUsernamePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemTeamsItemMembershipsItemWithUsernamePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemTeamsItemMembershipsItemWithUsernamePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_memberships_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_memberships_request_builder.go new file mode 100644 index 000000000..7d6593bd1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_memberships_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemTeamsItemMembershipsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\memberships +type ItemTeamsItemMembershipsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByUsername gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.teams.item.memberships.item collection +// returns a *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder when successful +func (m *ItemTeamsItemMembershipsRequestBuilder) ByUsername(username string)(*ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemTeamsItemMembershipsWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemMembershipsRequestBuilderInternal instantiates a new ItemTeamsItemMembershipsRequestBuilder and sets the default values. +func NewItemTeamsItemMembershipsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemMembershipsRequestBuilder) { + m := &ItemTeamsItemMembershipsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/memberships", pathParameters), + } + return m +} +// NewItemTeamsItemMembershipsRequestBuilder instantiates a new ItemTeamsItemMembershipsRequestBuilder and sets the default values. +func NewItemTeamsItemMembershipsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemMembershipsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemMembershipsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_memberships_with_username_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_memberships_with_username_item_request_builder.go new file mode 100644 index 000000000..0bb70794b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_memberships_with_username_item_request_builder.go @@ -0,0 +1,110 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemTeamsItemMembershipsWithUsernameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\memberships\{username} +type ItemTeamsItemMembershipsWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTeamsItemMembershipsWithUsernameItemRequestBuilderInternal instantiates a new ItemTeamsItemMembershipsWithUsernameItemRequestBuilder and sets the default values. +func NewItemTeamsItemMembershipsWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) { + m := &ItemTeamsItemMembershipsWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/memberships/{username}", pathParameters), + } + return m +} +// NewItemTeamsItemMembershipsWithUsernameItemRequestBuilder instantiates a new ItemTeamsItemMembershipsWithUsernameItemRequestBuilder and sets the default values. +func NewItemTeamsItemMembershipsWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemMembershipsWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete to remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user +func (m *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get team members will include the members of child teams.To get a user's membership with a team, the team must be visible to the authenticated user.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`.**Note:**The response contains the `state` of the membership and the member's `role`.The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team). +// returns a TeamMembershipable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user +func (m *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamMembershipable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamMembershipFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamMembershipable), nil +} +// Put adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team.If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.**Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`. +// returns a TeamMembershipable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user +func (m *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) Put(ctx context.Context, body ItemTeamsItemMembershipsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamMembershipable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamMembershipFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamMembershipable), nil +} +// ToDeleteRequestInformation to remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation team members will include the members of child teams.To get a user's membership with a team, the team must be visible to the authenticated user.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`.**Note:**The response contains the `state` of the membership and the member's `role`.The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team). +// returns a *RequestInformation when successful +func (m *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team.If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.**Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemTeamsItemMembershipsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder when successful +func (m *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) { + return NewItemTeamsItemMembershipsWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_projects_item_with_project_403_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_projects_item_with_project_403_error.go new file mode 100644 index 000000000..0806159d4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_projects_item_with_project_403_error.go @@ -0,0 +1,117 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemProjectsItemWithProject_403Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewItemTeamsItemProjectsItemWithProject_403Error instantiates a new ItemTeamsItemProjectsItemWithProject_403Error and sets the default values. +func NewItemTeamsItemProjectsItemWithProject_403Error()(*ItemTeamsItemProjectsItemWithProject_403Error) { + m := &ItemTeamsItemProjectsItemWithProject_403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemProjectsItemWithProject_403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemProjectsItemWithProject_403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemProjectsItemWithProject_403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemTeamsItemProjectsItemWithProject_403Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemTeamsItemProjectsItemWithProject_403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ItemTeamsItemProjectsItemWithProject_403Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTeamsItemProjectsItemWithProject_403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ItemTeamsItemProjectsItemWithProject_403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemTeamsItemProjectsItemWithProject_403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ItemTeamsItemProjectsItemWithProject_403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemTeamsItemProjectsItemWithProject_403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *ItemTeamsItemProjectsItemWithProject_403Error) SetMessage(value *string)() { + m.message = value +} +type ItemTeamsItemProjectsItemWithProject_403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_projects_item_with_project_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_projects_item_with_project_put_request_body.go new file mode 100644 index 000000000..9fd0aad83 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_projects_item_with_project_put_request_body.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemProjectsItemWithProject_PutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemTeamsItemProjectsItemWithProject_PutRequestBody instantiates a new ItemTeamsItemProjectsItemWithProject_PutRequestBody and sets the default values. +func NewItemTeamsItemProjectsItemWithProject_PutRequestBody()(*ItemTeamsItemProjectsItemWithProject_PutRequestBody) { + m := &ItemTeamsItemProjectsItemWithProject_PutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemProjectsItemWithProject_PutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemProjectsItemWithProject_PutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemProjectsItemWithProject_PutRequestBody(), 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 *ItemTeamsItemProjectsItemWithProject_PutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTeamsItemProjectsItemWithProject_PutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemTeamsItemProjectsItemWithProject_PutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemTeamsItemProjectsItemWithProject_PutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemTeamsItemProjectsItemWithProject_PutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_projects_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_projects_request_builder.go new file mode 100644 index 000000000..e30451f8e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_projects_request_builder.go @@ -0,0 +1,78 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemTeamsItemProjectsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\projects +type ItemTeamsItemProjectsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsItemProjectsRequestBuilderGetQueryParameters lists the organization projects for a team.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`. +type ItemTeamsItemProjectsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByProject_id gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.teams.item.projects.item collection +// returns a *ItemTeamsItemProjectsWithProject_ItemRequestBuilder when successful +func (m *ItemTeamsItemProjectsRequestBuilder) ByProject_id(project_id int32)(*ItemTeamsItemProjectsWithProject_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["project_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(project_id), 10) + return NewItemTeamsItemProjectsWithProject_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemProjectsRequestBuilderInternal instantiates a new ItemTeamsItemProjectsRequestBuilder and sets the default values. +func NewItemTeamsItemProjectsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemProjectsRequestBuilder) { + m := &ItemTeamsItemProjectsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/projects{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemTeamsItemProjectsRequestBuilder instantiates a new ItemTeamsItemProjectsRequestBuilder and sets the default values. +func NewItemTeamsItemProjectsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemProjectsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemProjectsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the organization projects for a team.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`. +// returns a []TeamProjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#list-team-projects +func (m *ItemTeamsItemProjectsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemProjectsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamProjectable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamProjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamProjectable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamProjectable) + } + } + return val, nil +} +// ToGetRequestInformation lists the organization projects for a team.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemProjectsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemProjectsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsItemProjectsRequestBuilder when successful +func (m *ItemTeamsItemProjectsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemProjectsRequestBuilder) { + return NewItemTeamsItemProjectsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_projects_with_project_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_projects_with_project_item_request_builder.go new file mode 100644 index 000000000..e74c37329 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_projects_with_project_item_request_builder.go @@ -0,0 +1,110 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemTeamsItemProjectsWithProject_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\projects\{project_id} +type ItemTeamsItemProjectsWithProject_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTeamsItemProjectsWithProject_ItemRequestBuilderInternal instantiates a new ItemTeamsItemProjectsWithProject_ItemRequestBuilder and sets the default values. +func NewItemTeamsItemProjectsWithProject_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemProjectsWithProject_ItemRequestBuilder) { + m := &ItemTeamsItemProjectsWithProject_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/projects/{project_id}", pathParameters), + } + return m +} +// NewItemTeamsItemProjectsWithProject_ItemRequestBuilder instantiates a new ItemTeamsItemProjectsWithProject_ItemRequestBuilder and sets the default values. +func NewItemTeamsItemProjectsWithProject_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemProjectsWithProject_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemProjectsWithProject_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. This endpoint removes the project from the team, but does not delete the project.**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}`. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team +func (m *ItemTeamsItemProjectsWithProject_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects/{project_id}`. +// returns a TeamProjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project +func (m *ItemTeamsItemProjectsWithProject_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamProjectable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamProjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamProjectable), nil +} +// Put adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization.**Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`. +// returns a ItemTeamsItemProjectsItemWithProject_403Error error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions +func (m *ItemTeamsItemProjectsWithProject_ItemRequestBuilder) Put(ctx context.Context, body ItemTeamsItemProjectsItemWithProject_PutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": CreateItemTeamsItemProjectsItemWithProject_403ErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. This endpoint removes the project from the team, but does not delete the project.**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemProjectsWithProject_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects/{project_id}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemProjectsWithProject_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization.**Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemProjectsWithProject_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemTeamsItemProjectsItemWithProject_PutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsItemProjectsWithProject_ItemRequestBuilder when successful +func (m *ItemTeamsItemProjectsWithProject_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemProjectsWithProject_ItemRequestBuilder) { + return NewItemTeamsItemProjectsWithProject_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_repos_item_item_with_repo_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_repos_item_item_with_repo_put_request_body.go new file mode 100644 index 000000000..fe8227169 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_repos_item_item_with_repo_put_request_body.go @@ -0,0 +1,80 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemReposItemItemWithRepoPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The permission to grant the team on this repository. We accept the following permissions to be set: `pull`, `triage`, `push`, `maintain`, `admin` and you can also specify a custom repository role name, if the owning organization has defined any. If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. + permission *string +} +// NewItemTeamsItemReposItemItemWithRepoPutRequestBody instantiates a new ItemTeamsItemReposItemItemWithRepoPutRequestBody and sets the default values. +func NewItemTeamsItemReposItemItemWithRepoPutRequestBody()(*ItemTeamsItemReposItemItemWithRepoPutRequestBody) { + m := &ItemTeamsItemReposItemItemWithRepoPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemReposItemItemWithRepoPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemReposItemItemWithRepoPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemReposItemItemWithRepoPutRequestBody(), 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 *ItemTeamsItemReposItemItemWithRepoPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTeamsItemReposItemItemWithRepoPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + return res +} +// GetPermission gets the permission property value. The permission to grant the team on this repository. We accept the following permissions to be set: `pull`, `triage`, `push`, `maintain`, `admin` and you can also specify a custom repository role name, if the owning organization has defined any. If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. +// returns a *string when successful +func (m *ItemTeamsItemReposItemItemWithRepoPutRequestBody) GetPermission()(*string) { + return m.permission +} +// Serialize serializes information the current object +func (m *ItemTeamsItemReposItemItemWithRepoPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("permission", m.GetPermission()) + 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 *ItemTeamsItemReposItemItemWithRepoPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPermission sets the permission property value. The permission to grant the team on this repository. We accept the following permissions to be set: `pull`, `triage`, `push`, `maintain`, `admin` and you can also specify a custom repository role name, if the owning organization has defined any. If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. +func (m *ItemTeamsItemReposItemItemWithRepoPutRequestBody) SetPermission(value *string)() { + m.permission = value +} +type ItemTeamsItemReposItemItemWithRepoPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPermission()(*string) + SetPermission(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_repos_item_with_repo_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_repos_item_with_repo_item_request_builder.go new file mode 100644 index 000000000..d132cf536 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_repos_item_with_repo_item_request_builder.go @@ -0,0 +1,105 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemTeamsItemReposItemWithRepoItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\repos\{owner}\{repo} +type ItemTeamsItemReposItemWithRepoItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTeamsItemReposItemWithRepoItemRequestBuilderInternal instantiates a new ItemTeamsItemReposItemWithRepoItemRequestBuilder and sets the default values. +func NewItemTeamsItemReposItemWithRepoItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemReposItemWithRepoItemRequestBuilder) { + m := &ItemTeamsItemReposItemWithRepoItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}", pathParameters), + } + return m +} +// NewItemTeamsItemReposItemWithRepoItemRequestBuilder instantiates a new ItemTeamsItemReposItemWithRepoItemRequestBuilder and sets the default values. +func NewItemTeamsItemReposItemWithRepoItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemReposItemWithRepoItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemReposItemWithRepoItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete if the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team.**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team +func (m *ItemTeamsItemReposItemWithRepoItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked.You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `application/vnd.github.v3.repository+json` accept header.If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status.If the repository is private, you must have at least `read` permission for that repository, and your token must have the `repo` or `admin:org` scope. Otherwise, you will receive a `404 Not Found` response status.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. +// returns a TeamRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository +func (m *ItemTeamsItemReposItemWithRepoItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamRepositoryable), nil +} +// Put to add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)."**Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.For more information about the permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions +func (m *ItemTeamsItemReposItemWithRepoItemRequestBuilder) Put(ctx context.Context, body ItemTeamsItemReposItemItemWithRepoPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation if the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team.**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemReposItemWithRepoItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked.You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `application/vnd.github.v3.repository+json` accept header.If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status.If the repository is private, you must have at least `read` permission for that repository, and your token must have the `repo` or `admin:org` scope. Otherwise, you will receive a `404 Not Found` response status.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemReposItemWithRepoItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation to add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)."**Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.For more information about the permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". +// returns a *RequestInformation when successful +func (m *ItemTeamsItemReposItemWithRepoItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemTeamsItemReposItemItemWithRepoPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsItemReposItemWithRepoItemRequestBuilder when successful +func (m *ItemTeamsItemReposItemWithRepoItemRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemReposItemWithRepoItemRequestBuilder) { + return NewItemTeamsItemReposItemWithRepoItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_repos_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_repos_request_builder.go new file mode 100644 index 000000000..28b134276 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_repos_request_builder.go @@ -0,0 +1,79 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemTeamsItemReposRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\repos +type ItemTeamsItemReposRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsItemReposRequestBuilderGetQueryParameters lists a team's repositories visible to the authenticated user.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`. +type ItemTeamsItemReposRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByOwner gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.teams.item.repos.item collection +// returns a *ItemTeamsItemReposWithOwnerItemRequestBuilder when successful +func (m *ItemTeamsItemReposRequestBuilder) ByOwner(owner string)(*ItemTeamsItemReposWithOwnerItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if owner != "" { + urlTplParams["owner"] = owner + } + return NewItemTeamsItemReposWithOwnerItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemReposRequestBuilderInternal instantiates a new ItemTeamsItemReposRequestBuilder and sets the default values. +func NewItemTeamsItemReposRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemReposRequestBuilder) { + m := &ItemTeamsItemReposRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/repos{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemTeamsItemReposRequestBuilder instantiates a new ItemTeamsItemReposRequestBuilder and sets the default values. +func NewItemTeamsItemReposRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemReposRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemReposRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists a team's repositories visible to the authenticated user.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`. +// returns a []MinimalRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#list-team-repositories +func (m *ItemTeamsItemReposRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemReposRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists a team's repositories visible to the authenticated user.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemReposRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemReposRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsItemReposRequestBuilder when successful +func (m *ItemTeamsItemReposRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemReposRequestBuilder) { + return NewItemTeamsItemReposRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_repos_with_owner_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_repos_with_owner_item_request_builder.go new file mode 100644 index 000000000..6d3826faa --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_repos_with_owner_item_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemTeamsItemReposWithOwnerItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\repos\{owner} +type ItemTeamsItemReposWithOwnerItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRepo gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.teams.item.repos.item.item collection +// returns a *ItemTeamsItemReposItemWithRepoItemRequestBuilder when successful +func (m *ItemTeamsItemReposWithOwnerItemRequestBuilder) ByRepo(repo string)(*ItemTeamsItemReposItemWithRepoItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if repo != "" { + urlTplParams["repo"] = repo + } + return NewItemTeamsItemReposItemWithRepoItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemReposWithOwnerItemRequestBuilderInternal instantiates a new ItemTeamsItemReposWithOwnerItemRequestBuilder and sets the default values. +func NewItemTeamsItemReposWithOwnerItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemReposWithOwnerItemRequestBuilder) { + m := &ItemTeamsItemReposWithOwnerItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/repos/{owner}", pathParameters), + } + return m +} +// NewItemTeamsItemReposWithOwnerItemRequestBuilder instantiates a new ItemTeamsItemReposWithOwnerItemRequestBuilder and sets the default values. +func NewItemTeamsItemReposWithOwnerItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemReposWithOwnerItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemReposWithOwnerItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_teams_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_teams_request_builder.go new file mode 100644 index 000000000..b5e052410 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_teams_request_builder.go @@ -0,0 +1,67 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemTeamsItemTeamsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\teams +type ItemTeamsItemTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsItemTeamsRequestBuilderGetQueryParameters lists the child teams of the team specified by `{team_slug}`.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`. +type ItemTeamsItemTeamsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemTeamsItemTeamsRequestBuilderInternal instantiates a new ItemTeamsItemTeamsRequestBuilder and sets the default values. +func NewItemTeamsItemTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemTeamsRequestBuilder) { + m := &ItemTeamsItemTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/teams{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemTeamsItemTeamsRequestBuilder instantiates a new ItemTeamsItemTeamsRequestBuilder and sets the default values. +func NewItemTeamsItemTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemTeamsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the child teams of the team specified by `{team_slug}`.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`. +// returns a []Teamable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#list-child-teams +func (m *ItemTeamsItemTeamsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemTeamsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable) + } + } + return val, nil +} +// ToGetRequestInformation lists the child teams of the team specified by `{team_slug}`.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemTeamsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemTeamsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsItemTeamsRequestBuilder when successful +func (m *ItemTeamsItemTeamsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemTeamsRequestBuilder) { + return NewItemTeamsItemTeamsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_with_team_slug_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_with_team_slug_patch_request_body.go new file mode 100644 index 000000000..ec54c7055 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_item_with_team_slug_patch_request_body.go @@ -0,0 +1,138 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemWithTeam_slugPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The description of the team. + description *string + // The name of the team. + name *string + // The ID of a team to set as the parent team. + parent_team_id *int32 +} +// NewItemTeamsItemWithTeam_slugPatchRequestBody instantiates a new ItemTeamsItemWithTeam_slugPatchRequestBody and sets the default values. +func NewItemTeamsItemWithTeam_slugPatchRequestBody()(*ItemTeamsItemWithTeam_slugPatchRequestBody) { + m := &ItemTeamsItemWithTeam_slugPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemWithTeam_slugPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemWithTeam_slugPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemWithTeam_slugPatchRequestBody(), 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 *ItemTeamsItemWithTeam_slugPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description of the team. +// returns a *string when successful +func (m *ItemTeamsItemWithTeam_slugPatchRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTeamsItemWithTeam_slugPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["parent_team_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetParentTeamId(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the team. +// returns a *string when successful +func (m *ItemTeamsItemWithTeam_slugPatchRequestBody) GetName()(*string) { + return m.name +} +// GetParentTeamId gets the parent_team_id property value. The ID of a team to set as the parent team. +// returns a *int32 when successful +func (m *ItemTeamsItemWithTeam_slugPatchRequestBody) GetParentTeamId()(*int32) { + return m.parent_team_id +} +// Serialize serializes information the current object +func (m *ItemTeamsItemWithTeam_slugPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("parent_team_id", m.GetParentTeamId()) + 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 *ItemTeamsItemWithTeam_slugPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description of the team. +func (m *ItemTeamsItemWithTeam_slugPatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetName sets the name property value. The name of the team. +func (m *ItemTeamsItemWithTeam_slugPatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetParentTeamId sets the parent_team_id property value. The ID of a team to set as the parent team. +func (m *ItemTeamsItemWithTeam_slugPatchRequestBody) SetParentTeamId(value *int32)() { + m.parent_team_id = value +} +type ItemTeamsItemWithTeam_slugPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetName()(*string) + GetParentTeamId()(*int32) + SetDescription(value *string)() + SetName(value *string)() + SetParentTeamId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_post_request_body.go new file mode 100644 index 000000000..94e76ead6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_post_request_body.go @@ -0,0 +1,208 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The description of the team. + description *string + // List GitHub IDs for organization members who will become team maintainers. + maintainers []string + // The name of the team. + name *string + // The ID of a team to set as the parent team. + parent_team_id *int32 + // The full name (e.g., "organization-name/repository-name") of repositories to add the team to. + repo_names []string +} +// NewItemTeamsPostRequestBody instantiates a new ItemTeamsPostRequestBody and sets the default values. +func NewItemTeamsPostRequestBody()(*ItemTeamsPostRequestBody) { + m := &ItemTeamsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsPostRequestBody(), 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 *ItemTeamsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description of the team. +// returns a *string when successful +func (m *ItemTeamsPostRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTeamsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["maintainers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetMaintainers(res) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["parent_team_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetParentTeamId(val) + } + return nil + } + res["repo_names"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRepoNames(res) + } + return nil + } + return res +} +// GetMaintainers gets the maintainers property value. List GitHub IDs for organization members who will become team maintainers. +// returns a []string when successful +func (m *ItemTeamsPostRequestBody) GetMaintainers()([]string) { + return m.maintainers +} +// GetName gets the name property value. The name of the team. +// returns a *string when successful +func (m *ItemTeamsPostRequestBody) GetName()(*string) { + return m.name +} +// GetParentTeamId gets the parent_team_id property value. The ID of a team to set as the parent team. +// returns a *int32 when successful +func (m *ItemTeamsPostRequestBody) GetParentTeamId()(*int32) { + return m.parent_team_id +} +// GetRepoNames gets the repo_names property value. The full name (e.g., "organization-name/repository-name") of repositories to add the team to. +// returns a []string when successful +func (m *ItemTeamsPostRequestBody) GetRepoNames()([]string) { + return m.repo_names +} +// Serialize serializes information the current object +func (m *ItemTeamsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + if m.GetMaintainers() != nil { + err := writer.WriteCollectionOfStringValues("maintainers", m.GetMaintainers()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("parent_team_id", m.GetParentTeamId()) + if err != nil { + return err + } + } + if m.GetRepoNames() != nil { + err := writer.WriteCollectionOfStringValues("repo_names", m.GetRepoNames()) + 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 *ItemTeamsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description of the team. +func (m *ItemTeamsPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetMaintainers sets the maintainers property value. List GitHub IDs for organization members who will become team maintainers. +func (m *ItemTeamsPostRequestBody) SetMaintainers(value []string)() { + m.maintainers = value +} +// SetName sets the name property value. The name of the team. +func (m *ItemTeamsPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetParentTeamId sets the parent_team_id property value. The ID of a team to set as the parent team. +func (m *ItemTeamsPostRequestBody) SetParentTeamId(value *int32)() { + m.parent_team_id = value +} +// SetRepoNames sets the repo_names property value. The full name (e.g., "organization-name/repository-name") of repositories to add the team to. +func (m *ItemTeamsPostRequestBody) SetRepoNames(value []string)() { + m.repo_names = value +} +type ItemTeamsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetMaintainers()([]string) + GetName()(*string) + GetParentTeamId()(*int32) + GetRepoNames()([]string) + SetDescription(value *string)() + SetMaintainers(value []string)() + SetName(value *string)() + SetParentTeamId(value *int32)() + SetRepoNames(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_request_builder.go new file mode 100644 index 000000000..114b9034e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_request_builder.go @@ -0,0 +1,120 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemTeamsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams +type ItemTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsRequestBuilderGetQueryParameters lists all teams in an organization that are visible to the authenticated user. +type ItemTeamsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByTeam_slug gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.teams.item collection +// returns a *ItemTeamsWithTeam_slugItemRequestBuilder when successful +func (m *ItemTeamsRequestBuilder) ByTeam_slug(team_slug string)(*ItemTeamsWithTeam_slugItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if team_slug != "" { + urlTplParams["team_slug"] = team_slug + } + return NewItemTeamsWithTeam_slugItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsRequestBuilderInternal instantiates a new ItemTeamsRequestBuilder and sets the default values. +func NewItemTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsRequestBuilder) { + m := &ItemTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemTeamsRequestBuilder instantiates a new ItemTeamsRequestBuilder and sets the default values. +func NewItemTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all teams in an organization that are visible to the authenticated user. +// returns a []Teamable when successful +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#list-teams +func (m *ItemTeamsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable) + } + } + return val, nil +} +// Post to create a team, the authenticated user must be a member or owner of `{org}`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://docs.github.com/articles/setting-team-creation-permissions-in-your-organization)."When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of `maintainers`. For more information, see "[About teams](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/about-teams)". +// returns a TeamFullable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#create-a-team +func (m *ItemTeamsRequestBuilder) Post(ctx context.Context, body ItemTeamsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamFullable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamFullFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamFullable), nil +} +// ToGetRequestInformation lists all teams in an organization that are visible to the authenticated user. +// returns a *RequestInformation when successful +func (m *ItemTeamsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation to create a team, the authenticated user must be a member or owner of `{org}`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://docs.github.com/articles/setting-team-creation-permissions-in-your-organization)."When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of `maintainers`. For more information, see "[About teams](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/about-teams)". +// returns a *RequestInformation when successful +func (m *ItemTeamsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemTeamsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsRequestBuilder when successful +func (m *ItemTeamsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsRequestBuilder) { + return NewItemTeamsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_with_team_slug_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_with_team_slug_item_request_builder.go new file mode 100644 index 000000000..9d2c8cc3b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_teams_with_team_slug_item_request_builder.go @@ -0,0 +1,157 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemTeamsWithTeam_slugItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug} +type ItemTeamsWithTeam_slugItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTeamsWithTeam_slugItemRequestBuilderInternal instantiates a new ItemTeamsWithTeam_slugItemRequestBuilder and sets the default values. +func NewItemTeamsWithTeam_slugItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsWithTeam_slugItemRequestBuilder) { + m := &ItemTeamsWithTeam_slugItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}", pathParameters), + } + return m +} +// NewItemTeamsWithTeam_slugItemRequestBuilder instantiates a new ItemTeamsWithTeam_slugItemRequestBuilder and sets the default values. +func NewItemTeamsWithTeam_slugItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsWithTeam_slugItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsWithTeam_slugItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete to delete a team, the authenticated user must be an organization owner or team maintainer.If you are an organization owner, deleting a parent team will delete all of its child teams as well.**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}`. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#delete-a-team +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Discussions the discussions property +// returns a *ItemTeamsItemDiscussionsRequestBuilder when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Discussions()(*ItemTeamsItemDiscussionsRequestBuilder) { + return NewItemTeamsItemDiscussionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get gets a team using the team's `slug`. To create the `slug`, GitHub replaces special characters in the `name` string, changes all words to lowercase, and replaces spaces with a `-` separator. For example, `"My TEam Näme"` would become `my-team-name`.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}`. +// returns a TeamFullable 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/teams/teams#get-a-team-by-name +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamFullable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamFullFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamFullable), nil +} +// Invitations the invitations property +// returns a *ItemTeamsItemInvitationsRequestBuilder when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Invitations()(*ItemTeamsItemInvitationsRequestBuilder) { + return NewItemTeamsItemInvitationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Members the members property +// returns a *ItemTeamsItemMembersRequestBuilder when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Members()(*ItemTeamsItemMembersRequestBuilder) { + return NewItemTeamsItemMembersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Memberships the memberships property +// returns a *ItemTeamsItemMembershipsRequestBuilder when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Memberships()(*ItemTeamsItemMembershipsRequestBuilder) { + return NewItemTeamsItemMembershipsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch to edit a team, the authenticated user must either be an organization owner or a team maintainer.**Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}`. +// returns a TeamFullable when successful +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#update-a-team +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Patch(ctx context.Context, body ItemTeamsItemWithTeam_slugPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamFullable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamFullFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamFullable), nil +} +// Projects the projects property +// returns a *ItemTeamsItemProjectsRequestBuilder when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Projects()(*ItemTeamsItemProjectsRequestBuilder) { + return NewItemTeamsItemProjectsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repos the repos property +// returns a *ItemTeamsItemReposRequestBuilder when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Repos()(*ItemTeamsItemReposRequestBuilder) { + return NewItemTeamsItemReposRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Teams the teams property +// returns a *ItemTeamsItemTeamsRequestBuilder when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Teams()(*ItemTeamsItemTeamsRequestBuilder) { + return NewItemTeamsItemTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation to delete a team, the authenticated user must be an organization owner or team maintainer.If you are an organization owner, deleting a parent team will delete all of its child teams as well.**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a team using the team's `slug`. To create the `slug`, GitHub replaces special characters in the `name` string, changes all words to lowercase, and replaces spaces with a `-` separator. For example, `"My TEam Näme"` would become `my-team-name`.**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation to edit a team, the authenticated user must either be an organization owner or a team maintainer.**Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemTeamsItemWithTeam_slugPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemTeamsWithTeam_slugItemRequestBuilder when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsWithTeam_slugItemRequestBuilder) { + return NewItemTeamsWithTeam_slugItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_with_org_delete_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_with_org_delete_response.go new file mode 100644 index 000000000..5bb0436af --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_with_org_delete_response.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemWithOrgDeleteResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemWithOrgDeleteResponse instantiates a new ItemWithOrgDeleteResponse and sets the default values. +func NewItemWithOrgDeleteResponse()(*ItemWithOrgDeleteResponse) { + m := &ItemWithOrgDeleteResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemWithOrgDeleteResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemWithOrgDeleteResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemWithOrgDeleteResponse(), 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 *ItemWithOrgDeleteResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemWithOrgDeleteResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemWithOrgDeleteResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemWithOrgDeleteResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemWithOrgDeleteResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_with_org_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_with_org_patch_request_body.go new file mode 100644 index 000000000..fdc8fee25 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_with_org_patch_request_body.go @@ -0,0 +1,834 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemWithOrgPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether GitHub Advanced Security is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + advanced_security_enabled_for_new_repositories *bool + // Billing email address. This address is not publicized. + billing_email *string + // The blog property + blog *string + // The company name. + company *string + // Whether Dependabot alerts is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + dependabot_alerts_enabled_for_new_repositories *bool + // Whether Dependabot security updates is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + dependabot_security_updates_enabled_for_new_repositories *bool + // Whether dependency graph is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + dependency_graph_enabled_for_new_repositories *bool + // The description of the company. The maximum size is 160 characters. + description *string + // The publicly visible email address. + email *string + // Whether an organization can use organization projects. + has_organization_projects *bool + // Whether repositories that belong to the organization can use repository projects. + has_repository_projects *bool + // The location. + location *string + // Whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + members_can_create_internal_repositories *bool + // Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted. + members_can_create_pages *bool + // Whether organization members can create private GitHub Pages sites. Existing published sites will not be impacted. + members_can_create_private_pages *bool + // Whether organization members can create private repositories, which are visible to organization members with permission. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + members_can_create_private_repositories *bool + // Whether organization members can create public GitHub Pages sites. Existing published sites will not be impacted. + members_can_create_public_pages *bool + // Whether organization members can create public repositories, which are visible to anyone. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + members_can_create_public_repositories *bool + // Whether of non-admin organization members can create repositories. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. + members_can_create_repositories *bool + // Whether organization members can fork private organization repositories. + members_can_fork_private_repositories *bool + // The shorthand name of the company. + name *string + // Whether secret scanning is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + secret_scanning_enabled_for_new_repositories *bool + // If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. + secret_scanning_push_protection_custom_link *string + // Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. + secret_scanning_push_protection_custom_link_enabled *bool + // Whether secret scanning push protection is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + secret_scanning_push_protection_enabled_for_new_repositories *bool + // The Twitter username of the company. + twitter_username *string + // Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface. + web_commit_signoff_required *bool +} +// NewItemWithOrgPatchRequestBody instantiates a new ItemWithOrgPatchRequestBody and sets the default values. +func NewItemWithOrgPatchRequestBody()(*ItemWithOrgPatchRequestBody) { + m := &ItemWithOrgPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemWithOrgPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemWithOrgPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemWithOrgPatchRequestBody(), 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 *ItemWithOrgPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvancedSecurityEnabledForNewRepositories gets the advanced_security_enabled_for_new_repositories property value. Whether GitHub Advanced Security is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetAdvancedSecurityEnabledForNewRepositories()(*bool) { + return m.advanced_security_enabled_for_new_repositories +} +// GetBillingEmail gets the billing_email property value. Billing email address. This address is not publicized. +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetBillingEmail()(*string) { + return m.billing_email +} +// GetBlog gets the blog property value. The blog property +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetBlog()(*string) { + return m.blog +} +// GetCompany gets the company property value. The company name. +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetCompany()(*string) { + return m.company +} +// GetDependabotAlertsEnabledForNewRepositories gets the dependabot_alerts_enabled_for_new_repositories property value. Whether Dependabot alerts is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetDependabotAlertsEnabledForNewRepositories()(*bool) { + return m.dependabot_alerts_enabled_for_new_repositories +} +// GetDependabotSecurityUpdatesEnabledForNewRepositories gets the dependabot_security_updates_enabled_for_new_repositories property value. Whether Dependabot security updates is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetDependabotSecurityUpdatesEnabledForNewRepositories()(*bool) { + return m.dependabot_security_updates_enabled_for_new_repositories +} +// GetDependencyGraphEnabledForNewRepositories gets the dependency_graph_enabled_for_new_repositories property value. Whether dependency graph is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetDependencyGraphEnabledForNewRepositories()(*bool) { + return m.dependency_graph_enabled_for_new_repositories +} +// GetDescription gets the description property value. The description of the company. The maximum size is 160 characters. +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetDescription()(*string) { + return m.description +} +// GetEmail gets the email property value. The publicly visible email address. +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemWithOrgPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["advanced_security_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurityEnabledForNewRepositories(val) + } + return nil + } + res["billing_email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBillingEmail(val) + } + return nil + } + res["blog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlog(val) + } + return nil + } + res["company"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompany(val) + } + return nil + } + res["dependabot_alerts_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDependabotAlertsEnabledForNewRepositories(val) + } + return nil + } + res["dependabot_security_updates_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDependabotSecurityUpdatesEnabledForNewRepositories(val) + } + return nil + } + res["dependency_graph_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDependencyGraphEnabledForNewRepositories(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["has_organization_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasOrganizationProjects(val) + } + return nil + } + res["has_repository_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasRepositoryProjects(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["members_can_create_internal_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreateInternalRepositories(val) + } + return nil + } + res["members_can_create_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePages(val) + } + return nil + } + res["members_can_create_private_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePrivatePages(val) + } + return nil + } + res["members_can_create_private_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePrivateRepositories(val) + } + return nil + } + res["members_can_create_public_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePublicPages(val) + } + return nil + } + res["members_can_create_public_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePublicRepositories(val) + } + return nil + } + res["members_can_create_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreateRepositories(val) + } + return nil + } + res["members_can_fork_private_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanForkPrivateRepositories(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["secret_scanning_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningEnabledForNewRepositories(val) + } + return nil + } + res["secret_scanning_push_protection_custom_link"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtectionCustomLink(val) + } + return nil + } + res["secret_scanning_push_protection_custom_link_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtectionCustomLinkEnabled(val) + } + return nil + } + res["secret_scanning_push_protection_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtectionEnabledForNewRepositories(val) + } + return nil + } + res["twitter_username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTwitterUsername(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetHasOrganizationProjects gets the has_organization_projects property value. Whether an organization can use organization projects. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetHasOrganizationProjects()(*bool) { + return m.has_organization_projects +} +// GetHasRepositoryProjects gets the has_repository_projects property value. Whether repositories that belong to the organization can use repository projects. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetHasRepositoryProjects()(*bool) { + return m.has_repository_projects +} +// GetLocation gets the location property value. The location. +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetLocation()(*string) { + return m.location +} +// GetMembersCanCreateInternalRepositories gets the members_can_create_internal_repositories property value. Whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetMembersCanCreateInternalRepositories()(*bool) { + return m.members_can_create_internal_repositories +} +// GetMembersCanCreatePages gets the members_can_create_pages property value. Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetMembersCanCreatePages()(*bool) { + return m.members_can_create_pages +} +// GetMembersCanCreatePrivatePages gets the members_can_create_private_pages property value. Whether organization members can create private GitHub Pages sites. Existing published sites will not be impacted. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetMembersCanCreatePrivatePages()(*bool) { + return m.members_can_create_private_pages +} +// GetMembersCanCreatePrivateRepositories gets the members_can_create_private_repositories property value. Whether organization members can create private repositories, which are visible to organization members with permission. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetMembersCanCreatePrivateRepositories()(*bool) { + return m.members_can_create_private_repositories +} +// GetMembersCanCreatePublicPages gets the members_can_create_public_pages property value. Whether organization members can create public GitHub Pages sites. Existing published sites will not be impacted. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetMembersCanCreatePublicPages()(*bool) { + return m.members_can_create_public_pages +} +// GetMembersCanCreatePublicRepositories gets the members_can_create_public_repositories property value. Whether organization members can create public repositories, which are visible to anyone. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetMembersCanCreatePublicRepositories()(*bool) { + return m.members_can_create_public_repositories +} +// GetMembersCanCreateRepositories gets the members_can_create_repositories property value. Whether of non-admin organization members can create repositories. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetMembersCanCreateRepositories()(*bool) { + return m.members_can_create_repositories +} +// GetMembersCanForkPrivateRepositories gets the members_can_fork_private_repositories property value. Whether organization members can fork private organization repositories. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetMembersCanForkPrivateRepositories()(*bool) { + return m.members_can_fork_private_repositories +} +// GetName gets the name property value. The shorthand name of the company. +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetName()(*string) { + return m.name +} +// GetSecretScanningEnabledForNewRepositories gets the secret_scanning_enabled_for_new_repositories property value. Whether secret scanning is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetSecretScanningEnabledForNewRepositories()(*bool) { + return m.secret_scanning_enabled_for_new_repositories +} +// GetSecretScanningPushProtectionCustomLink gets the secret_scanning_push_protection_custom_link property value. If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetSecretScanningPushProtectionCustomLink()(*string) { + return m.secret_scanning_push_protection_custom_link +} +// GetSecretScanningPushProtectionCustomLinkEnabled gets the secret_scanning_push_protection_custom_link_enabled property value. Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetSecretScanningPushProtectionCustomLinkEnabled()(*bool) { + return m.secret_scanning_push_protection_custom_link_enabled +} +// GetSecretScanningPushProtectionEnabledForNewRepositories gets the secret_scanning_push_protection_enabled_for_new_repositories property value. Whether secret scanning push protection is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetSecretScanningPushProtectionEnabledForNewRepositories()(*bool) { + return m.secret_scanning_push_protection_enabled_for_new_repositories +} +// GetTwitterUsername gets the twitter_username property value. The Twitter username of the company. +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetTwitterUsername()(*string) { + return m.twitter_username +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *ItemWithOrgPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("advanced_security_enabled_for_new_repositories", m.GetAdvancedSecurityEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("billing_email", m.GetBillingEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blog", m.GetBlog()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("company", m.GetCompany()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dependabot_alerts_enabled_for_new_repositories", m.GetDependabotAlertsEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dependabot_security_updates_enabled_for_new_repositories", m.GetDependabotSecurityUpdatesEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dependency_graph_enabled_for_new_repositories", m.GetDependencyGraphEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_organization_projects", m.GetHasOrganizationProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_repository_projects", m.GetHasRepositoryProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_internal_repositories", m.GetMembersCanCreateInternalRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_pages", m.GetMembersCanCreatePages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_private_pages", m.GetMembersCanCreatePrivatePages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_private_repositories", m.GetMembersCanCreatePrivateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_public_pages", m.GetMembersCanCreatePublicPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_public_repositories", m.GetMembersCanCreatePublicRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_repositories", m.GetMembersCanCreateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_fork_private_repositories", m.GetMembersCanForkPrivateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("secret_scanning_enabled_for_new_repositories", m.GetSecretScanningEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret_scanning_push_protection_custom_link", m.GetSecretScanningPushProtectionCustomLink()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("secret_scanning_push_protection_custom_link_enabled", m.GetSecretScanningPushProtectionCustomLinkEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("secret_scanning_push_protection_enabled_for_new_repositories", m.GetSecretScanningPushProtectionEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("twitter_username", m.GetTwitterUsername()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *ItemWithOrgPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvancedSecurityEnabledForNewRepositories sets the advanced_security_enabled_for_new_repositories property value. Whether GitHub Advanced Security is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +func (m *ItemWithOrgPatchRequestBody) SetAdvancedSecurityEnabledForNewRepositories(value *bool)() { + m.advanced_security_enabled_for_new_repositories = value +} +// SetBillingEmail sets the billing_email property value. Billing email address. This address is not publicized. +func (m *ItemWithOrgPatchRequestBody) SetBillingEmail(value *string)() { + m.billing_email = value +} +// SetBlog sets the blog property value. The blog property +func (m *ItemWithOrgPatchRequestBody) SetBlog(value *string)() { + m.blog = value +} +// SetCompany sets the company property value. The company name. +func (m *ItemWithOrgPatchRequestBody) SetCompany(value *string)() { + m.company = value +} +// SetDependabotAlertsEnabledForNewRepositories sets the dependabot_alerts_enabled_for_new_repositories property value. Whether Dependabot alerts is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +func (m *ItemWithOrgPatchRequestBody) SetDependabotAlertsEnabledForNewRepositories(value *bool)() { + m.dependabot_alerts_enabled_for_new_repositories = value +} +// SetDependabotSecurityUpdatesEnabledForNewRepositories sets the dependabot_security_updates_enabled_for_new_repositories property value. Whether Dependabot security updates is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +func (m *ItemWithOrgPatchRequestBody) SetDependabotSecurityUpdatesEnabledForNewRepositories(value *bool)() { + m.dependabot_security_updates_enabled_for_new_repositories = value +} +// SetDependencyGraphEnabledForNewRepositories sets the dependency_graph_enabled_for_new_repositories property value. Whether dependency graph is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +func (m *ItemWithOrgPatchRequestBody) SetDependencyGraphEnabledForNewRepositories(value *bool)() { + m.dependency_graph_enabled_for_new_repositories = value +} +// SetDescription sets the description property value. The description of the company. The maximum size is 160 characters. +func (m *ItemWithOrgPatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetEmail sets the email property value. The publicly visible email address. +func (m *ItemWithOrgPatchRequestBody) SetEmail(value *string)() { + m.email = value +} +// SetHasOrganizationProjects sets the has_organization_projects property value. Whether an organization can use organization projects. +func (m *ItemWithOrgPatchRequestBody) SetHasOrganizationProjects(value *bool)() { + m.has_organization_projects = value +} +// SetHasRepositoryProjects sets the has_repository_projects property value. Whether repositories that belong to the organization can use repository projects. +func (m *ItemWithOrgPatchRequestBody) SetHasRepositoryProjects(value *bool)() { + m.has_repository_projects = value +} +// SetLocation sets the location property value. The location. +func (m *ItemWithOrgPatchRequestBody) SetLocation(value *string)() { + m.location = value +} +// SetMembersCanCreateInternalRepositories sets the members_can_create_internal_repositories property value. Whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. +func (m *ItemWithOrgPatchRequestBody) SetMembersCanCreateInternalRepositories(value *bool)() { + m.members_can_create_internal_repositories = value +} +// SetMembersCanCreatePages sets the members_can_create_pages property value. Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted. +func (m *ItemWithOrgPatchRequestBody) SetMembersCanCreatePages(value *bool)() { + m.members_can_create_pages = value +} +// SetMembersCanCreatePrivatePages sets the members_can_create_private_pages property value. Whether organization members can create private GitHub Pages sites. Existing published sites will not be impacted. +func (m *ItemWithOrgPatchRequestBody) SetMembersCanCreatePrivatePages(value *bool)() { + m.members_can_create_private_pages = value +} +// SetMembersCanCreatePrivateRepositories sets the members_can_create_private_repositories property value. Whether organization members can create private repositories, which are visible to organization members with permission. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. +func (m *ItemWithOrgPatchRequestBody) SetMembersCanCreatePrivateRepositories(value *bool)() { + m.members_can_create_private_repositories = value +} +// SetMembersCanCreatePublicPages sets the members_can_create_public_pages property value. Whether organization members can create public GitHub Pages sites. Existing published sites will not be impacted. +func (m *ItemWithOrgPatchRequestBody) SetMembersCanCreatePublicPages(value *bool)() { + m.members_can_create_public_pages = value +} +// SetMembersCanCreatePublicRepositories sets the members_can_create_public_repositories property value. Whether organization members can create public repositories, which are visible to anyone. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. +func (m *ItemWithOrgPatchRequestBody) SetMembersCanCreatePublicRepositories(value *bool)() { + m.members_can_create_public_repositories = value +} +// SetMembersCanCreateRepositories sets the members_can_create_repositories property value. Whether of non-admin organization members can create repositories. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. +func (m *ItemWithOrgPatchRequestBody) SetMembersCanCreateRepositories(value *bool)() { + m.members_can_create_repositories = value +} +// SetMembersCanForkPrivateRepositories sets the members_can_fork_private_repositories property value. Whether organization members can fork private organization repositories. +func (m *ItemWithOrgPatchRequestBody) SetMembersCanForkPrivateRepositories(value *bool)() { + m.members_can_fork_private_repositories = value +} +// SetName sets the name property value. The shorthand name of the company. +func (m *ItemWithOrgPatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetSecretScanningEnabledForNewRepositories sets the secret_scanning_enabled_for_new_repositories property value. Whether secret scanning is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +func (m *ItemWithOrgPatchRequestBody) SetSecretScanningEnabledForNewRepositories(value *bool)() { + m.secret_scanning_enabled_for_new_repositories = value +} +// SetSecretScanningPushProtectionCustomLink sets the secret_scanning_push_protection_custom_link property value. If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. +func (m *ItemWithOrgPatchRequestBody) SetSecretScanningPushProtectionCustomLink(value *string)() { + m.secret_scanning_push_protection_custom_link = value +} +// SetSecretScanningPushProtectionCustomLinkEnabled sets the secret_scanning_push_protection_custom_link_enabled property value. Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. +func (m *ItemWithOrgPatchRequestBody) SetSecretScanningPushProtectionCustomLinkEnabled(value *bool)() { + m.secret_scanning_push_protection_custom_link_enabled = value +} +// SetSecretScanningPushProtectionEnabledForNewRepositories sets the secret_scanning_push_protection_enabled_for_new_repositories property value. Whether secret scanning push protection is automatically enabled for new repositories.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +func (m *ItemWithOrgPatchRequestBody) SetSecretScanningPushProtectionEnabledForNewRepositories(value *bool)() { + m.secret_scanning_push_protection_enabled_for_new_repositories = value +} +// SetTwitterUsername sets the twitter_username property value. The Twitter username of the company. +func (m *ItemWithOrgPatchRequestBody) SetTwitterUsername(value *string)() { + m.twitter_username = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface. +func (m *ItemWithOrgPatchRequestBody) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type ItemWithOrgPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdvancedSecurityEnabledForNewRepositories()(*bool) + GetBillingEmail()(*string) + GetBlog()(*string) + GetCompany()(*string) + GetDependabotAlertsEnabledForNewRepositories()(*bool) + GetDependabotSecurityUpdatesEnabledForNewRepositories()(*bool) + GetDependencyGraphEnabledForNewRepositories()(*bool) + GetDescription()(*string) + GetEmail()(*string) + GetHasOrganizationProjects()(*bool) + GetHasRepositoryProjects()(*bool) + GetLocation()(*string) + GetMembersCanCreateInternalRepositories()(*bool) + GetMembersCanCreatePages()(*bool) + GetMembersCanCreatePrivatePages()(*bool) + GetMembersCanCreatePrivateRepositories()(*bool) + GetMembersCanCreatePublicPages()(*bool) + GetMembersCanCreatePublicRepositories()(*bool) + GetMembersCanCreateRepositories()(*bool) + GetMembersCanForkPrivateRepositories()(*bool) + GetName()(*string) + GetSecretScanningEnabledForNewRepositories()(*bool) + GetSecretScanningPushProtectionCustomLink()(*string) + GetSecretScanningPushProtectionCustomLinkEnabled()(*bool) + GetSecretScanningPushProtectionEnabledForNewRepositories()(*bool) + GetTwitterUsername()(*string) + GetWebCommitSignoffRequired()(*bool) + SetAdvancedSecurityEnabledForNewRepositories(value *bool)() + SetBillingEmail(value *string)() + SetBlog(value *string)() + SetCompany(value *string)() + SetDependabotAlertsEnabledForNewRepositories(value *bool)() + SetDependabotSecurityUpdatesEnabledForNewRepositories(value *bool)() + SetDependencyGraphEnabledForNewRepositories(value *bool)() + SetDescription(value *string)() + SetEmail(value *string)() + SetHasOrganizationProjects(value *bool)() + SetHasRepositoryProjects(value *bool)() + SetLocation(value *string)() + SetMembersCanCreateInternalRepositories(value *bool)() + SetMembersCanCreatePages(value *bool)() + SetMembersCanCreatePrivatePages(value *bool)() + SetMembersCanCreatePrivateRepositories(value *bool)() + SetMembersCanCreatePublicPages(value *bool)() + SetMembersCanCreatePublicRepositories(value *bool)() + SetMembersCanCreateRepositories(value *bool)() + SetMembersCanForkPrivateRepositories(value *bool)() + SetName(value *string)() + SetSecretScanningEnabledForNewRepositories(value *bool)() + SetSecretScanningPushProtectionCustomLink(value *string)() + SetSecretScanningPushProtectionCustomLinkEnabled(value *bool)() + SetSecretScanningPushProtectionEnabledForNewRepositories(value *bool)() + SetTwitterUsername(value *string)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_with_org_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_with_org_response.go new file mode 100644 index 000000000..784339b40 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_with_org_response.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemWithOrgResponse +// Deprecated: This class is obsolete. Use WithOrgDeleteResponse instead. +type ItemWithOrgResponse struct { + ItemWithOrgDeleteResponse +} +// NewItemWithOrgResponse instantiates a new ItemWithOrgResponse and sets the default values. +func NewItemWithOrgResponse()(*ItemWithOrgResponse) { + m := &ItemWithOrgResponse{ + ItemWithOrgDeleteResponse: *NewItemWithOrgDeleteResponse(), + } + return m +} +// CreateItemWithOrgResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemWithOrgResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemWithOrgResponse(), nil +} +// ItemWithOrgResponseable +// Deprecated: This class is obsolete. Use WithOrgDeleteResponse instead. +type ItemWithOrgResponseable interface { + ItemWithOrgDeleteResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_with_security_product_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_with_security_product_item_request_builder.go new file mode 100644 index 000000000..716ac0902 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/item_with_security_product_item_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemWithSecurity_productItemRequestBuilder builds and executes requests for operations under \orgs\{org}\{security_product} +type ItemWithSecurity_productItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByEnablement gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.item.item collection +// returns a *ItemItemWithEnablementItemRequestBuilder when successful +func (m *ItemWithSecurity_productItemRequestBuilder) ByEnablement(enablement string)(*ItemItemWithEnablementItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if enablement != "" { + urlTplParams["enablement"] = enablement + } + return NewItemItemWithEnablementItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemWithSecurity_productItemRequestBuilderInternal instantiates a new ItemWithSecurity_productItemRequestBuilder and sets the default values. +func NewItemWithSecurity_productItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWithSecurity_productItemRequestBuilder) { + m := &ItemWithSecurity_productItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/{security_product}", pathParameters), + } + return m +} +// NewItemWithSecurity_productItemRequestBuilder instantiates a new ItemWithSecurity_productItemRequestBuilder and sets the default values. +func NewItemWithSecurity_productItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWithSecurity_productItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemWithSecurity_productItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/orgs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/orgs_request_builder.go new file mode 100644 index 000000000..b080e4c93 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/orgs_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// OrgsRequestBuilder builds and executes requests for operations under \orgs +type OrgsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByOrg gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item collection +// returns a *WithOrgItemRequestBuilder when successful +func (m *OrgsRequestBuilder) ByOrg(org string)(*WithOrgItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if org != "" { + urlTplParams["org"] = org + } + return NewWithOrgItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewOrgsRequestBuilderInternal instantiates a new OrgsRequestBuilder and sets the default values. +func NewOrgsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OrgsRequestBuilder) { + m := &OrgsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs", pathParameters), + } + return m +} +// NewOrgsRequestBuilder instantiates a new OrgsRequestBuilder and sets the default values. +func NewOrgsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OrgsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewOrgsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/orgs/with_org_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/with_org_item_request_builder.go new file mode 100644 index 000000000..85556863e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/orgs/with_org_item_request_builder.go @@ -0,0 +1,321 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// WithOrgItemRequestBuilder builds and executes requests for operations under \orgs\{org} +type WithOrgItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Actions the actions property +// returns a *ItemActionsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Actions()(*ItemActionsRequestBuilder) { + return NewItemActionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Attestations the attestations property +// returns a *ItemAttestationsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Attestations()(*ItemAttestationsRequestBuilder) { + return NewItemAttestationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Blocks the blocks property +// returns a *ItemBlocksRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Blocks()(*ItemBlocksRequestBuilder) { + return NewItemBlocksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// BySecurity_product gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.item collection +// returns a *ItemWithSecurity_productItemRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) BySecurity_product(security_product string)(*ItemWithSecurity_productItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if security_product != "" { + urlTplParams["security_product"] = security_product + } + return NewItemWithSecurity_productItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// CodeScanning the codeScanning property +// returns a *ItemCodeScanningRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) CodeScanning()(*ItemCodeScanningRequestBuilder) { + return NewItemCodeScanningRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CodeSecurity the codeSecurity property +// returns a *ItemCodeSecurityRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) CodeSecurity()(*ItemCodeSecurityRequestBuilder) { + return NewItemCodeSecurityRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Codespaces the codespaces property +// returns a *ItemCodespacesRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Codespaces()(*ItemCodespacesRequestBuilder) { + return NewItemCodespacesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewWithOrgItemRequestBuilderInternal instantiates a new WithOrgItemRequestBuilder and sets the default values. +func NewWithOrgItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithOrgItemRequestBuilder) { + m := &WithOrgItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}", pathParameters), + } + return m +} +// NewWithOrgItemRequestBuilder instantiates a new WithOrgItemRequestBuilder and sets the default values. +func NewWithOrgItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithOrgItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithOrgItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Copilot the copilot property +// returns a *ItemCopilotRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Copilot()(*ItemCopilotRequestBuilder) { + return NewItemCopilotRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Delete deletes an organization and all its repositories.The organization login will be unavailable for 90 days after deletion.Please review the Terms of Service regarding account deletion before using this endpoint:https://docs.github.com/site-policy/github-terms/github-terms-of-service +// returns a ItemWithOrgDeleteResponseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/orgs#delete-an-organization +func (m *WithOrgItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemWithOrgDeleteResponseable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemWithOrgDeleteResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemWithOrgDeleteResponseable), nil +} +// Dependabot the dependabot property +// returns a *ItemDependabotRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Dependabot()(*ItemDependabotRequestBuilder) { + return NewItemDependabotRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Docker the docker property +// returns a *ItemDockerRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Docker()(*ItemDockerRequestBuilder) { + return NewItemDockerRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Events the events property +// returns a *ItemEventsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Events()(*ItemEventsRequestBuilder) { + return NewItemEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Failed_invitations the failed_invitations property +// returns a *ItemFailed_invitationsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Failed_invitations()(*ItemFailed_invitationsRequestBuilder) { + return NewItemFailed_invitationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get gets information about an organization.When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/).To see the full details about an organization, the authenticated user must be an organization owner.The values returned by this endpoint are set by the "Update an organization" endpoint. If your organization set a default security configuration (beta), the following values retrieved from the "Update an organization" endpoint have been overwritten by that configuration:- advanced_security_enabled_for_new_repositories- dependabot_alerts_enabled_for_new_repositories- dependabot_security_updates_enabled_for_new_repositories- dependency_graph_enabled_for_new_repositories- secret_scanning_enabled_for_new_repositories- secret_scanning_push_protection_enabled_for_new_repositoriesFor more information on security configurations, see "[Enabling security features at scale](https://docs.github.com/code-security/securing-your-organization/introduction-to-securing-your-organization-at-scale/about-enabling-security-features-at-scale)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to see the full details about an organization.To see information about an organization's GitHub plan, GitHub Apps need the `Organization plan` permission. +// returns a OrganizationFullable 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/orgs/orgs#get-an-organization +func (m *WithOrgItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationFullable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationFullFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationFullable), nil +} +// Hooks the hooks property +// returns a *ItemHooksRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Hooks()(*ItemHooksRequestBuilder) { + return NewItemHooksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Installation the installation property +// returns a *ItemInstallationRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Installation()(*ItemInstallationRequestBuilder) { + return NewItemInstallationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Installations the installations property +// returns a *ItemInstallationsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Installations()(*ItemInstallationsRequestBuilder) { + return NewItemInstallationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// InteractionLimits the interactionLimits property +// returns a *ItemInteractionLimitsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) InteractionLimits()(*ItemInteractionLimitsRequestBuilder) { + return NewItemInteractionLimitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Invitations the invitations property +// returns a *ItemInvitationsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Invitations()(*ItemInvitationsRequestBuilder) { + return NewItemInvitationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Issues the issues property +// returns a *ItemIssuesRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Issues()(*ItemIssuesRequestBuilder) { + return NewItemIssuesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Members the members property +// returns a *ItemMembersRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Members()(*ItemMembersRequestBuilder) { + return NewItemMembersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Memberships the memberships property +// returns a *ItemMembershipsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Memberships()(*ItemMembershipsRequestBuilder) { + return NewItemMembershipsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Migrations the migrations property +// returns a *ItemMigrationsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Migrations()(*ItemMigrationsRequestBuilder) { + return NewItemMigrationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// OrganizationFineGrainedPermissions the organizationFineGrainedPermissions property +// returns a *ItemOrganizationFineGrainedPermissionsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) OrganizationFineGrainedPermissions()(*ItemOrganizationFineGrainedPermissionsRequestBuilder) { + return NewItemOrganizationFineGrainedPermissionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// OrganizationRoles the organizationRoles property +// returns a *ItemOrganizationRolesRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) OrganizationRoles()(*ItemOrganizationRolesRequestBuilder) { + return NewItemOrganizationRolesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Outside_collaborators the outside_collaborators property +// returns a *ItemOutside_collaboratorsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Outside_collaborators()(*ItemOutside_collaboratorsRequestBuilder) { + return NewItemOutside_collaboratorsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Packages the packages property +// returns a *ItemPackagesRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Packages()(*ItemPackagesRequestBuilder) { + return NewItemPackagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch **Parameter Deprecation Notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes).Updates the organization's profile and member privileges.With security configurations (beta), your organization can choose a default security configuration which will automatically apply a set of security enablement settings to new repositories in your organization based on their visibility. For targeted repositories, the following attributes will be overridden by the default security configuration:- advanced_security_enabled_for_new_repositories- dependabot_alerts_enabled_for_new_repositories- dependabot_security_updates_enabled_for_new_repositories- dependency_graph_enabled_for_new_repositories- secret_scanning_enabled_for_new_repositories- secret_scanning_push_protection_enabled_for_new_repositoriesFor more information on setting a default security configuration, see "[Enabling security features at scale](https://docs.github.com/code-security/securing-your-organization/introduction-to-securing-your-organization-at-scale/about-enabling-security-features-at-scale)."The authenticated user must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint. +// returns a OrganizationFullable when successful +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/orgs#update-an-organization +func (m *WithOrgItemRequestBuilder) Patch(ctx context.Context, body ItemWithOrgPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationFullable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationFullFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationFullable), nil +} +// PersonalAccessTokenRequests the personalAccessTokenRequests property +// returns a *ItemPersonalAccessTokenRequestsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) PersonalAccessTokenRequests()(*ItemPersonalAccessTokenRequestsRequestBuilder) { + return NewItemPersonalAccessTokenRequestsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// PersonalAccessTokens the personalAccessTokens property +// returns a *ItemPersonalAccessTokensRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) PersonalAccessTokens()(*ItemPersonalAccessTokensRequestBuilder) { + return NewItemPersonalAccessTokensRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Projects the projects property +// returns a *ItemProjectsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Projects()(*ItemProjectsRequestBuilder) { + return NewItemProjectsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Properties the properties property +// returns a *ItemPropertiesRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Properties()(*ItemPropertiesRequestBuilder) { + return NewItemPropertiesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Public_members the public_members property +// returns a *ItemPublic_membersRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Public_members()(*ItemPublic_membersRequestBuilder) { + return NewItemPublic_membersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repos the repos property +// returns a *ItemReposRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Repos()(*ItemReposRequestBuilder) { + return NewItemReposRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rulesets the rulesets property +// returns a *ItemRulesetsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Rulesets()(*ItemRulesetsRequestBuilder) { + return NewItemRulesetsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SecretScanning the secretScanning property +// returns a *ItemSecretScanningRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) SecretScanning()(*ItemSecretScanningRequestBuilder) { + return NewItemSecretScanningRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SecurityAdvisories the securityAdvisories property +// returns a *ItemSecurityAdvisoriesRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) SecurityAdvisories()(*ItemSecurityAdvisoriesRequestBuilder) { + return NewItemSecurityAdvisoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SecurityManagers the securityManagers property +// returns a *ItemSecurityManagersRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) SecurityManagers()(*ItemSecurityManagersRequestBuilder) { + return NewItemSecurityManagersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Settings the settings property +// returns a *ItemSettingsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Settings()(*ItemSettingsRequestBuilder) { + return NewItemSettingsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Teams the teams property +// returns a *ItemTeamsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Teams()(*ItemTeamsRequestBuilder) { + return NewItemTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes an organization and all its repositories.The organization login will be unavailable for 90 days after deletion.Please review the Terms of Service regarding account deletion before using this endpoint:https://docs.github.com/site-policy/github-terms/github-terms-of-service +// returns a *RequestInformation when successful +func (m *WithOrgItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets information about an organization.When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/).To see the full details about an organization, the authenticated user must be an organization owner.The values returned by this endpoint are set by the "Update an organization" endpoint. If your organization set a default security configuration (beta), the following values retrieved from the "Update an organization" endpoint have been overwritten by that configuration:- advanced_security_enabled_for_new_repositories- dependabot_alerts_enabled_for_new_repositories- dependabot_security_updates_enabled_for_new_repositories- dependency_graph_enabled_for_new_repositories- secret_scanning_enabled_for_new_repositories- secret_scanning_push_protection_enabled_for_new_repositoriesFor more information on security configurations, see "[Enabling security features at scale](https://docs.github.com/code-security/securing-your-organization/introduction-to-securing-your-organization-at-scale/about-enabling-security-features-at-scale)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to see the full details about an organization.To see information about an organization's GitHub plan, GitHub Apps need the `Organization plan` permission. +// returns a *RequestInformation when successful +func (m *WithOrgItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation **Parameter Deprecation Notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes).Updates the organization's profile and member privileges.With security configurations (beta), your organization can choose a default security configuration which will automatically apply a set of security enablement settings to new repositories in your organization based on their visibility. For targeted repositories, the following attributes will be overridden by the default security configuration:- advanced_security_enabled_for_new_repositories- dependabot_alerts_enabled_for_new_repositories- dependabot_security_updates_enabled_for_new_repositories- dependency_graph_enabled_for_new_repositories- secret_scanning_enabled_for_new_repositories- secret_scanning_push_protection_enabled_for_new_repositoriesFor more information on setting a default security configuration, see "[Enabling security features at scale](https://docs.github.com/code-security/securing-your-organization/introduction-to-securing-your-organization-at-scale/about-enabling-security-features-at-scale)."The authenticated user must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *WithOrgItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemWithOrgPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *WithOrgItemRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) WithUrl(rawUrl string)(*WithOrgItemRequestBuilder) { + return NewWithOrgItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns/item/cards/get_archived_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns/item/cards/get_archived_state_query_parameter_type.go new file mode 100644 index 000000000..cf17922e8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns/item/cards/get_archived_state_query_parameter_type.go @@ -0,0 +1,39 @@ +package cards +import ( + "errors" +) +type GetArchived_stateQueryParameterType int + +const ( + ALL_GETARCHIVED_STATEQUERYPARAMETERTYPE GetArchived_stateQueryParameterType = iota + ARCHIVED_GETARCHIVED_STATEQUERYPARAMETERTYPE + NOT_ARCHIVED_GETARCHIVED_STATEQUERYPARAMETERTYPE +) + +func (i GetArchived_stateQueryParameterType) String() string { + return []string{"all", "archived", "not_archived"}[i] +} +func ParseGetArchived_stateQueryParameterType(v string) (any, error) { + result := ALL_GETARCHIVED_STATEQUERYPARAMETERTYPE + switch v { + case "all": + result = ALL_GETARCHIVED_STATEQUERYPARAMETERTYPE + case "archived": + result = ARCHIVED_GETARCHIVED_STATEQUERYPARAMETERTYPE + case "not_archived": + result = NOT_ARCHIVED_GETARCHIVED_STATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetArchived_stateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetArchived_stateQueryParameterType(values []GetArchived_stateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetArchived_stateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves403_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves403_error.go new file mode 100644 index 000000000..19ed6200f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves403_error.go @@ -0,0 +1,158 @@ +package projects + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsCardsItemMoves403Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The documentation_url property + documentation_url *string + // The errors property + errors []ColumnsCardsItemMoves403Error_errorsable + // The message property + message *string +} +// NewColumnsCardsItemMoves403Error instantiates a new ColumnsCardsItemMoves403Error and sets the default values. +func NewColumnsCardsItemMoves403Error()(*ColumnsCardsItemMoves403Error) { + m := &ColumnsCardsItemMoves403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsCardsItemMoves403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsCardsItemMoves403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsCardsItemMoves403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ColumnsCardsItemMoves403Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ColumnsCardsItemMoves403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ColumnsCardsItemMoves403Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetErrors gets the errors property value. The errors property +// returns a []ColumnsCardsItemMoves403Error_errorsable when successful +func (m *ColumnsCardsItemMoves403Error) GetErrors()([]ColumnsCardsItemMoves403Error_errorsable) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsCardsItemMoves403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateColumnsCardsItemMoves403Error_errorsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ColumnsCardsItemMoves403Error_errorsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ColumnsCardsItemMoves403Error_errorsable) + } + } + m.SetErrors(res) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ColumnsCardsItemMoves403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ColumnsCardsItemMoves403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + if m.GetErrors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetErrors())) + for i, v := range m.GetErrors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("errors", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ColumnsCardsItemMoves403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ColumnsCardsItemMoves403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetErrors sets the errors property value. The errors property +func (m *ColumnsCardsItemMoves403Error) SetErrors(value []ColumnsCardsItemMoves403Error_errorsable)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *ColumnsCardsItemMoves403Error) SetMessage(value *string)() { + m.message = value +} +type ColumnsCardsItemMoves403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetErrors()([]ColumnsCardsItemMoves403Error_errorsable) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetErrors(value []ColumnsCardsItemMoves403Error_errorsable)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves403_error_errors.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves403_error_errors.go new file mode 100644 index 000000000..a4a3d665a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves403_error_errors.go @@ -0,0 +1,167 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsCardsItemMoves403Error_errors struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The field property + field *string + // The message property + message *string + // The resource property + resource *string +} +// NewColumnsCardsItemMoves403Error_errors instantiates a new ColumnsCardsItemMoves403Error_errors and sets the default values. +func NewColumnsCardsItemMoves403Error_errors()(*ColumnsCardsItemMoves403Error_errors) { + m := &ColumnsCardsItemMoves403Error_errors{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsCardsItemMoves403Error_errorsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsCardsItemMoves403Error_errorsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsCardsItemMoves403Error_errors(), 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 *ColumnsCardsItemMoves403Error_errors) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *ColumnsCardsItemMoves403Error_errors) GetCode()(*string) { + return m.code +} +// GetField gets the field property value. The field property +// returns a *string when successful +func (m *ColumnsCardsItemMoves403Error_errors) GetField()(*string) { + return m.field +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsCardsItemMoves403Error_errors) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["field"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetField(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["resource"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResource(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ColumnsCardsItemMoves403Error_errors) GetMessage()(*string) { + return m.message +} +// GetResource gets the resource property value. The resource property +// returns a *string when successful +func (m *ColumnsCardsItemMoves403Error_errors) GetResource()(*string) { + return m.resource +} +// Serialize serializes information the current object +func (m *ColumnsCardsItemMoves403Error_errors) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("field", m.GetField()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("resource", m.GetResource()) + 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 *ColumnsCardsItemMoves403Error_errors) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *ColumnsCardsItemMoves403Error_errors) SetCode(value *string)() { + m.code = value +} +// SetField sets the field property value. The field property +func (m *ColumnsCardsItemMoves403Error_errors) SetField(value *string)() { + m.field = value +} +// SetMessage sets the message property value. The message property +func (m *ColumnsCardsItemMoves403Error_errors) SetMessage(value *string)() { + m.message = value +} +// SetResource sets the resource property value. The resource property +func (m *ColumnsCardsItemMoves403Error_errors) SetResource(value *string)() { + m.resource = value +} +type ColumnsCardsItemMoves403Error_errorsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetField()(*string) + GetMessage()(*string) + GetResource()(*string) + SetCode(value *string)() + SetField(value *string)() + SetMessage(value *string)() + SetResource(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves503_error.go new file mode 100644 index 000000000..e8e956b15 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves503_error.go @@ -0,0 +1,187 @@ +package projects + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsCardsItemMoves503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The errors property + errors []ColumnsCardsItemMoves503Error_errorsable + // The message property + message *string +} +// NewColumnsCardsItemMoves503Error instantiates a new ColumnsCardsItemMoves503Error and sets the default values. +func NewColumnsCardsItemMoves503Error()(*ColumnsCardsItemMoves503Error) { + m := &ColumnsCardsItemMoves503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsCardsItemMoves503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsCardsItemMoves503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsCardsItemMoves503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ColumnsCardsItemMoves503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ColumnsCardsItemMoves503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *ColumnsCardsItemMoves503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ColumnsCardsItemMoves503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetErrors gets the errors property value. The errors property +// returns a []ColumnsCardsItemMoves503Error_errorsable when successful +func (m *ColumnsCardsItemMoves503Error) GetErrors()([]ColumnsCardsItemMoves503Error_errorsable) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsCardsItemMoves503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateColumnsCardsItemMoves503Error_errorsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ColumnsCardsItemMoves503Error_errorsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ColumnsCardsItemMoves503Error_errorsable) + } + } + m.SetErrors(res) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ColumnsCardsItemMoves503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ColumnsCardsItemMoves503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + if m.GetErrors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetErrors())) + for i, v := range m.GetErrors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("errors", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ColumnsCardsItemMoves503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *ColumnsCardsItemMoves503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ColumnsCardsItemMoves503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetErrors sets the errors property value. The errors property +func (m *ColumnsCardsItemMoves503Error) SetErrors(value []ColumnsCardsItemMoves503Error_errorsable)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *ColumnsCardsItemMoves503Error) SetMessage(value *string)() { + m.message = value +} +type ColumnsCardsItemMoves503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetErrors()([]ColumnsCardsItemMoves503Error_errorsable) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetErrors(value []ColumnsCardsItemMoves503Error_errorsable)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves503_error_errors.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves503_error_errors.go new file mode 100644 index 000000000..fde626e4e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves503_error_errors.go @@ -0,0 +1,109 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsCardsItemMoves503Error_errors struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The message property + message *string +} +// NewColumnsCardsItemMoves503Error_errors instantiates a new ColumnsCardsItemMoves503Error_errors and sets the default values. +func NewColumnsCardsItemMoves503Error_errors()(*ColumnsCardsItemMoves503Error_errors) { + m := &ColumnsCardsItemMoves503Error_errors{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsCardsItemMoves503Error_errorsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsCardsItemMoves503Error_errorsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsCardsItemMoves503Error_errors(), 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 *ColumnsCardsItemMoves503Error_errors) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *ColumnsCardsItemMoves503Error_errors) GetCode()(*string) { + return m.code +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsCardsItemMoves503Error_errors) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ColumnsCardsItemMoves503Error_errors) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ColumnsCardsItemMoves503Error_errors) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ColumnsCardsItemMoves503Error_errors) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *ColumnsCardsItemMoves503Error_errors) SetCode(value *string)() { + m.code = value +} +// SetMessage sets the message property value. The message property +func (m *ColumnsCardsItemMoves503Error_errors) SetMessage(value *string)() { + m.message = value +} +type ColumnsCardsItemMoves503Error_errorsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves_post_request_body.go new file mode 100644 index 000000000..5d29836c6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves_post_request_body.go @@ -0,0 +1,109 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsCardsItemMovesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The unique identifier of the column the card should be moved to + column_id *int32 + // The position of the card in a column. Can be one of: `top`, `bottom`, or `after:` to place after the specified card. + position *string +} +// NewColumnsCardsItemMovesPostRequestBody instantiates a new ColumnsCardsItemMovesPostRequestBody and sets the default values. +func NewColumnsCardsItemMovesPostRequestBody()(*ColumnsCardsItemMovesPostRequestBody) { + m := &ColumnsCardsItemMovesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsCardsItemMovesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsCardsItemMovesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsCardsItemMovesPostRequestBody(), 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 *ColumnsCardsItemMovesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColumnId gets the column_id property value. The unique identifier of the column the card should be moved to +// returns a *int32 when successful +func (m *ColumnsCardsItemMovesPostRequestBody) GetColumnId()(*int32) { + return m.column_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsCardsItemMovesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["column_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetColumnId(val) + } + return nil + } + res["position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPosition(val) + } + return nil + } + return res +} +// GetPosition gets the position property value. The position of the card in a column. Can be one of: `top`, `bottom`, or `after:` to place after the specified card. +// returns a *string when successful +func (m *ColumnsCardsItemMovesPostRequestBody) GetPosition()(*string) { + return m.position +} +// Serialize serializes information the current object +func (m *ColumnsCardsItemMovesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("column_id", m.GetColumnId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("position", m.GetPosition()) + 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 *ColumnsCardsItemMovesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColumnId sets the column_id property value. The unique identifier of the column the card should be moved to +func (m *ColumnsCardsItemMovesPostRequestBody) SetColumnId(value *int32)() { + m.column_id = value +} +// SetPosition sets the position property value. The position of the card in a column. Can be one of: `top`, `bottom`, or `after:` to place after the specified card. +func (m *ColumnsCardsItemMovesPostRequestBody) SetPosition(value *string)() { + m.position = value +} +type ColumnsCardsItemMovesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColumnId()(*int32) + GetPosition()(*string) + SetColumnId(value *int32)() + SetPosition(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves_post_response.go new file mode 100644 index 000000000..2e5c6378a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves_post_response.go @@ -0,0 +1,32 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsCardsItemMovesPostResponse struct { +} +// NewColumnsCardsItemMovesPostResponse instantiates a new ColumnsCardsItemMovesPostResponse and sets the default values. +func NewColumnsCardsItemMovesPostResponse()(*ColumnsCardsItemMovesPostResponse) { + m := &ColumnsCardsItemMovesPostResponse{ + } + return m +} +// CreateColumnsCardsItemMovesPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsCardsItemMovesPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsCardsItemMovesPostResponse(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsCardsItemMovesPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ColumnsCardsItemMovesPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +type ColumnsCardsItemMovesPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves_request_builder.go new file mode 100644 index 000000000..44658fc53 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves_request_builder.go @@ -0,0 +1,70 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ColumnsCardsItemMovesRequestBuilder builds and executes requests for operations under \projects\columns\cards\{card_id}\moves +type ColumnsCardsItemMovesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewColumnsCardsItemMovesRequestBuilderInternal instantiates a new ColumnsCardsItemMovesRequestBuilder and sets the default values. +func NewColumnsCardsItemMovesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsCardsItemMovesRequestBuilder) { + m := &ColumnsCardsItemMovesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/columns/cards/{card_id}/moves", pathParameters), + } + return m +} +// NewColumnsCardsItemMovesRequestBuilder instantiates a new ColumnsCardsItemMovesRequestBuilder and sets the default values. +func NewColumnsCardsItemMovesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsCardsItemMovesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewColumnsCardsItemMovesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post move a project card +// returns a ColumnsCardsItemMovesPostResponseable when successful +// returns a BasicError error when the service returns a 401 status code +// returns a ColumnsCardsItemMoves403Error error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a ColumnsCardsItemMoves503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/projects/cards#move-a-project-card +func (m *ColumnsCardsItemMovesRequestBuilder) Post(ctx context.Context, body ColumnsCardsItemMovesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ColumnsCardsItemMovesPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": CreateColumnsCardsItemMoves403ErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "503": CreateColumnsCardsItemMoves503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateColumnsCardsItemMovesPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ColumnsCardsItemMovesPostResponseable), nil +} +// returns a *RequestInformation when successful +func (m *ColumnsCardsItemMovesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ColumnsCardsItemMovesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ColumnsCardsItemMovesRequestBuilder when successful +func (m *ColumnsCardsItemMovesRequestBuilder) WithUrl(rawUrl string)(*ColumnsCardsItemMovesRequestBuilder) { + return NewColumnsCardsItemMovesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves_response.go new file mode 100644 index 000000000..00e10c7a6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_moves_response.go @@ -0,0 +1,28 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ColumnsCardsItemMovesResponse +// Deprecated: This class is obsolete. Use movesPostResponse instead. +type ColumnsCardsItemMovesResponse struct { + ColumnsCardsItemMovesPostResponse +} +// NewColumnsCardsItemMovesResponse instantiates a new ColumnsCardsItemMovesResponse and sets the default values. +func NewColumnsCardsItemMovesResponse()(*ColumnsCardsItemMovesResponse) { + m := &ColumnsCardsItemMovesResponse{ + ColumnsCardsItemMovesPostResponse: *NewColumnsCardsItemMovesPostResponse(), + } + return m +} +// CreateColumnsCardsItemMovesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateColumnsCardsItemMovesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsCardsItemMovesResponse(), nil +} +// ColumnsCardsItemMovesResponseable +// Deprecated: This class is obsolete. Use movesPostResponse instead. +type ColumnsCardsItemMovesResponseable interface { + ColumnsCardsItemMovesPostResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_with_card_403_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_with_card_403_error.go new file mode 100644 index 000000000..569b0a030 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_with_card_403_error.go @@ -0,0 +1,152 @@ +package projects + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsCardsItemWithCard_403Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The documentation_url property + documentation_url *string + // The errors property + errors []string + // The message property + message *string +} +// NewColumnsCardsItemWithCard_403Error instantiates a new ColumnsCardsItemWithCard_403Error and sets the default values. +func NewColumnsCardsItemWithCard_403Error()(*ColumnsCardsItemWithCard_403Error) { + m := &ColumnsCardsItemWithCard_403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsCardsItemWithCard_403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsCardsItemWithCard_403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsCardsItemWithCard_403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ColumnsCardsItemWithCard_403Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ColumnsCardsItemWithCard_403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ColumnsCardsItemWithCard_403Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetErrors gets the errors property value. The errors property +// returns a []string when successful +func (m *ColumnsCardsItemWithCard_403Error) GetErrors()([]string) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsCardsItemWithCard_403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetErrors(res) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ColumnsCardsItemWithCard_403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ColumnsCardsItemWithCard_403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + if m.GetErrors() != nil { + err := writer.WriteCollectionOfStringValues("errors", m.GetErrors()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ColumnsCardsItemWithCard_403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ColumnsCardsItemWithCard_403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetErrors sets the errors property value. The errors property +func (m *ColumnsCardsItemWithCard_403Error) SetErrors(value []string)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *ColumnsCardsItemWithCard_403Error) SetMessage(value *string)() { + m.message = value +} +type ColumnsCardsItemWithCard_403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetErrors()([]string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetErrors(value []string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_with_card_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_with_card_patch_request_body.go new file mode 100644 index 000000000..d95f11443 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_item_with_card_patch_request_body.go @@ -0,0 +1,109 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsCardsItemWithCard_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether or not the card is archived + archived *bool + // The project card's note + note *string +} +// NewColumnsCardsItemWithCard_PatchRequestBody instantiates a new ColumnsCardsItemWithCard_PatchRequestBody and sets the default values. +func NewColumnsCardsItemWithCard_PatchRequestBody()(*ColumnsCardsItemWithCard_PatchRequestBody) { + m := &ColumnsCardsItemWithCard_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsCardsItemWithCard_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsCardsItemWithCard_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsCardsItemWithCard_PatchRequestBody(), 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 *ColumnsCardsItemWithCard_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArchived gets the archived property value. Whether or not the card is archived +// returns a *bool when successful +func (m *ColumnsCardsItemWithCard_PatchRequestBody) GetArchived()(*bool) { + return m.archived +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsCardsItemWithCard_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["note"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNote(val) + } + return nil + } + return res +} +// GetNote gets the note property value. The project card's note +// returns a *string when successful +func (m *ColumnsCardsItemWithCard_PatchRequestBody) GetNote()(*string) { + return m.note +} +// Serialize serializes information the current object +func (m *ColumnsCardsItemWithCard_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("note", m.GetNote()) + 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 *ColumnsCardsItemWithCard_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArchived sets the archived property value. Whether or not the card is archived +func (m *ColumnsCardsItemWithCard_PatchRequestBody) SetArchived(value *bool)() { + m.archived = value +} +// SetNote sets the note property value. The project card's note +func (m *ColumnsCardsItemWithCard_PatchRequestBody) SetNote(value *string)() { + m.note = value +} +type ColumnsCardsItemWithCard_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArchived()(*bool) + GetNote()(*string) + SetArchived(value *bool)() + SetNote(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_request_builder.go new file mode 100644 index 000000000..af3db5a2c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_request_builder.go @@ -0,0 +1,34 @@ +package projects + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ColumnsCardsRequestBuilder builds and executes requests for operations under \projects\columns\cards +type ColumnsCardsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByCard_id gets an item from the github.com/octokit/go-sdk/pkg/github.projects.columns.cards.item collection +// returns a *ColumnsCardsWithCard_ItemRequestBuilder when successful +func (m *ColumnsCardsRequestBuilder) ByCard_id(card_id int32)(*ColumnsCardsWithCard_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["card_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(card_id), 10) + return NewColumnsCardsWithCard_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewColumnsCardsRequestBuilderInternal instantiates a new ColumnsCardsRequestBuilder and sets the default values. +func NewColumnsCardsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsCardsRequestBuilder) { + m := &ColumnsCardsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/columns/cards", pathParameters), + } + return m +} +// NewColumnsCardsRequestBuilder instantiates a new ColumnsCardsRequestBuilder and sets the default values. +func NewColumnsCardsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsCardsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewColumnsCardsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_with_card_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_with_card_item_request_builder.go new file mode 100644 index 000000000..6ee3a3639 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_cards_with_card_item_request_builder.go @@ -0,0 +1,141 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ColumnsCardsWithCard_ItemRequestBuilder builds and executes requests for operations under \projects\columns\cards\{card_id} +type ColumnsCardsWithCard_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewColumnsCardsWithCard_ItemRequestBuilderInternal instantiates a new ColumnsCardsWithCard_ItemRequestBuilder and sets the default values. +func NewColumnsCardsWithCard_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsCardsWithCard_ItemRequestBuilder) { + m := &ColumnsCardsWithCard_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/columns/cards/{card_id}", pathParameters), + } + return m +} +// NewColumnsCardsWithCard_ItemRequestBuilder instantiates a new ColumnsCardsWithCard_ItemRequestBuilder and sets the default values. +func NewColumnsCardsWithCard_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsCardsWithCard_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewColumnsCardsWithCard_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a project card +// returns a BasicError error when the service returns a 401 status code +// returns a ColumnsCardsItemWithCard_403Error error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/projects/cards#delete-a-project-card +func (m *ColumnsCardsWithCard_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": CreateColumnsCardsItemWithCard_403ErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets information about a project card. +// returns a ProjectCardable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/projects/cards#get-a-project-card +func (m *ColumnsCardsWithCard_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectCardable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProjectCardFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectCardable), nil +} +// Moves the moves property +// returns a *ColumnsCardsItemMovesRequestBuilder when successful +func (m *ColumnsCardsWithCard_ItemRequestBuilder) Moves()(*ColumnsCardsItemMovesRequestBuilder) { + return NewColumnsCardsItemMovesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch update an existing project card +// returns a ProjectCardable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/projects/cards#update-an-existing-project-card +func (m *ColumnsCardsWithCard_ItemRequestBuilder) Patch(ctx context.Context, body ColumnsCardsItemWithCard_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectCardable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProjectCardFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectCardable), nil +} +// ToDeleteRequestInformation deletes a project card +// returns a *RequestInformation when successful +func (m *ColumnsCardsWithCard_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets information about a project card. +// returns a *RequestInformation when successful +func (m *ColumnsCardsWithCard_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *ColumnsCardsWithCard_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ColumnsCardsItemWithCard_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ColumnsCardsWithCard_ItemRequestBuilder when successful +func (m *ColumnsCardsWithCard_ItemRequestBuilder) WithUrl(rawUrl string)(*ColumnsCardsWithCard_ItemRequestBuilder) { + return NewColumnsCardsWithCard_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_cards_post_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_cards_post_request_body_member1.go new file mode 100644 index 000000000..75070557a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_cards_post_request_body_member1.go @@ -0,0 +1,80 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsItemCardsPostRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The project card's note + note *string +} +// NewColumnsItemCardsPostRequestBodyMember1 instantiates a new ColumnsItemCardsPostRequestBodyMember1 and sets the default values. +func NewColumnsItemCardsPostRequestBodyMember1()(*ColumnsItemCardsPostRequestBodyMember1) { + m := &ColumnsItemCardsPostRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsItemCardsPostRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsItemCardsPostRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsItemCardsPostRequestBodyMember1(), 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 *ColumnsItemCardsPostRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsItemCardsPostRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["note"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNote(val) + } + return nil + } + return res +} +// GetNote gets the note property value. The project card's note +// returns a *string when successful +func (m *ColumnsItemCardsPostRequestBodyMember1) GetNote()(*string) { + return m.note +} +// Serialize serializes information the current object +func (m *ColumnsItemCardsPostRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("note", m.GetNote()) + 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 *ColumnsItemCardsPostRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNote sets the note property value. The project card's note +func (m *ColumnsItemCardsPostRequestBodyMember1) SetNote(value *string)() { + m.note = value +} +type ColumnsItemCardsPostRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNote()(*string) + SetNote(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_cards_post_request_body_member2.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_cards_post_request_body_member2.go new file mode 100644 index 000000000..78f5d7865 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_cards_post_request_body_member2.go @@ -0,0 +1,109 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsItemCardsPostRequestBodyMember2 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The unique identifier of the content associated with the card + content_id *int32 + // The piece of content associated with the card + content_type *string +} +// NewColumnsItemCardsPostRequestBodyMember2 instantiates a new ColumnsItemCardsPostRequestBodyMember2 and sets the default values. +func NewColumnsItemCardsPostRequestBodyMember2()(*ColumnsItemCardsPostRequestBodyMember2) { + m := &ColumnsItemCardsPostRequestBodyMember2{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsItemCardsPostRequestBodyMember2FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsItemCardsPostRequestBodyMember2FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsItemCardsPostRequestBodyMember2(), 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 *ColumnsItemCardsPostRequestBodyMember2) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentId gets the content_id property value. The unique identifier of the content associated with the card +// returns a *int32 when successful +func (m *ColumnsItemCardsPostRequestBodyMember2) GetContentId()(*int32) { + return m.content_id +} +// GetContentType gets the content_type property value. The piece of content associated with the card +// returns a *string when successful +func (m *ColumnsItemCardsPostRequestBodyMember2) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsItemCardsPostRequestBodyMember2) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetContentId(val) + } + return nil + } + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ColumnsItemCardsPostRequestBodyMember2) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("content_id", m.GetContentId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + 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 *ColumnsItemCardsPostRequestBodyMember2) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentId sets the content_id property value. The unique identifier of the content associated with the card +func (m *ColumnsItemCardsPostRequestBodyMember2) SetContentId(value *int32)() { + m.content_id = value +} +// SetContentType sets the content_type property value. The piece of content associated with the card +func (m *ColumnsItemCardsPostRequestBodyMember2) SetContentType(value *string)() { + m.content_type = value +} +type ColumnsItemCardsPostRequestBodyMember2able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentId()(*int32) + GetContentType()(*string) + SetContentId(value *int32)() + SetContentType(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_cards_project_card503_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_cards_project_card503_error.go new file mode 100644 index 000000000..6b7083df2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_cards_project_card503_error.go @@ -0,0 +1,187 @@ +package projects + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsItemCardsProjectCard503Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The documentation_url property + documentation_url *string + // The errors property + errors []ColumnsItemCardsProjectCard503Error_errorsable + // The message property + message *string +} +// NewColumnsItemCardsProjectCard503Error instantiates a new ColumnsItemCardsProjectCard503Error and sets the default values. +func NewColumnsItemCardsProjectCard503Error()(*ColumnsItemCardsProjectCard503Error) { + m := &ColumnsItemCardsProjectCard503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsItemCardsProjectCard503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsItemCardsProjectCard503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsItemCardsProjectCard503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ColumnsItemCardsProjectCard503Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ColumnsItemCardsProjectCard503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *ColumnsItemCardsProjectCard503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ColumnsItemCardsProjectCard503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetErrors gets the errors property value. The errors property +// returns a []ColumnsItemCardsProjectCard503Error_errorsable when successful +func (m *ColumnsItemCardsProjectCard503Error) GetErrors()([]ColumnsItemCardsProjectCard503Error_errorsable) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsItemCardsProjectCard503Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateColumnsItemCardsProjectCard503Error_errorsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ColumnsItemCardsProjectCard503Error_errorsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ColumnsItemCardsProjectCard503Error_errorsable) + } + } + m.SetErrors(res) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ColumnsItemCardsProjectCard503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ColumnsItemCardsProjectCard503Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + if m.GetErrors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetErrors())) + for i, v := range m.GetErrors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("errors", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ColumnsItemCardsProjectCard503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *ColumnsItemCardsProjectCard503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ColumnsItemCardsProjectCard503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetErrors sets the errors property value. The errors property +func (m *ColumnsItemCardsProjectCard503Error) SetErrors(value []ColumnsItemCardsProjectCard503Error_errorsable)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *ColumnsItemCardsProjectCard503Error) SetMessage(value *string)() { + m.message = value +} +type ColumnsItemCardsProjectCard503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetErrors()([]ColumnsItemCardsProjectCard503Error_errorsable) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetErrors(value []ColumnsItemCardsProjectCard503Error_errorsable)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_cards_project_card503_error_errors.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_cards_project_card503_error_errors.go new file mode 100644 index 000000000..e0e18865c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_cards_project_card503_error_errors.go @@ -0,0 +1,109 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsItemCardsProjectCard503Error_errors struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The code property + code *string + // The message property + message *string +} +// NewColumnsItemCardsProjectCard503Error_errors instantiates a new ColumnsItemCardsProjectCard503Error_errors and sets the default values. +func NewColumnsItemCardsProjectCard503Error_errors()(*ColumnsItemCardsProjectCard503Error_errors) { + m := &ColumnsItemCardsProjectCard503Error_errors{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsItemCardsProjectCard503Error_errorsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsItemCardsProjectCard503Error_errorsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsItemCardsProjectCard503Error_errors(), 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 *ColumnsItemCardsProjectCard503Error_errors) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *ColumnsItemCardsProjectCard503Error_errors) GetCode()(*string) { + return m.code +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsItemCardsProjectCard503Error_errors) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ColumnsItemCardsProjectCard503Error_errors) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ColumnsItemCardsProjectCard503Error_errors) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ColumnsItemCardsProjectCard503Error_errors) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *ColumnsItemCardsProjectCard503Error_errors) SetCode(value *string)() { + m.code = value +} +// SetMessage sets the message property value. The message property +func (m *ColumnsItemCardsProjectCard503Error_errors) SetMessage(value *string)() { + m.message = value +} +type ColumnsItemCardsProjectCard503Error_errorsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_cards_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_cards_request_builder.go new file mode 100644 index 000000000..97fa2daae --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_cards_request_builder.go @@ -0,0 +1,234 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + iaecb1d9ce8f039d73681b50025b6b1a10860720b981e5b38dba5e4bcaf58ea7c "github.com/octokit/go-sdk/pkg/github/projects/columns/item/cards" +) + +// ColumnsItemCardsRequestBuilder builds and executes requests for operations under \projects\columns\{column_id}\cards +type ColumnsItemCardsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// CardsPostRequestBody composed type wrapper for classes ColumnsItemCardsPostRequestBodyMember1able, ColumnsItemCardsPostRequestBodyMember2able +type CardsPostRequestBody struct { + // Composed type representation for type ColumnsItemCardsPostRequestBodyMember1able + cardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1 ColumnsItemCardsPostRequestBodyMember1able + // Composed type representation for type ColumnsItemCardsPostRequestBodyMember2able + cardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2 ColumnsItemCardsPostRequestBodyMember2able + // Composed type representation for type ColumnsItemCardsPostRequestBodyMember1able + columnsItemCardsPostRequestBodyMember1 ColumnsItemCardsPostRequestBodyMember1able + // Composed type representation for type ColumnsItemCardsPostRequestBodyMember2able + columnsItemCardsPostRequestBodyMember2 ColumnsItemCardsPostRequestBodyMember2able +} +// NewCardsPostRequestBody instantiates a new CardsPostRequestBody and sets the default values. +func NewCardsPostRequestBody()(*CardsPostRequestBody) { + m := &CardsPostRequestBody{ + } + return m +} +// CreateCardsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCardsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewCardsPostRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + return result, nil +} +// GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1 gets the ColumnsItemCardsPostRequestBodyMember1 property value. Composed type representation for type ColumnsItemCardsPostRequestBodyMember1able +// returns a ColumnsItemCardsPostRequestBodyMember1able when successful +func (m *CardsPostRequestBody) GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1()(ColumnsItemCardsPostRequestBodyMember1able) { + return m.cardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1 +} +// GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2 gets the ColumnsItemCardsPostRequestBodyMember2 property value. Composed type representation for type ColumnsItemCardsPostRequestBodyMember2able +// returns a ColumnsItemCardsPostRequestBodyMember2able when successful +func (m *CardsPostRequestBody) GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2()(ColumnsItemCardsPostRequestBodyMember2able) { + return m.cardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2 +} +// GetColumnsItemCardsPostRequestBodyMember1 gets the ColumnsItemCardsPostRequestBodyMember1 property value. Composed type representation for type ColumnsItemCardsPostRequestBodyMember1able +// returns a ColumnsItemCardsPostRequestBodyMember1able when successful +func (m *CardsPostRequestBody) GetColumnsItemCardsPostRequestBodyMember1()(ColumnsItemCardsPostRequestBodyMember1able) { + return m.columnsItemCardsPostRequestBodyMember1 +} +// GetColumnsItemCardsPostRequestBodyMember2 gets the ColumnsItemCardsPostRequestBodyMember2 property value. Composed type representation for type ColumnsItemCardsPostRequestBodyMember2able +// returns a ColumnsItemCardsPostRequestBodyMember2able when successful +func (m *CardsPostRequestBody) GetColumnsItemCardsPostRequestBodyMember2()(ColumnsItemCardsPostRequestBodyMember2able) { + return m.columnsItemCardsPostRequestBodyMember2 +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CardsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *CardsPostRequestBody) GetIsComposedType()(bool) { + return true +} +// Serialize serializes information the current object +func (m *CardsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2()) + if err != nil { + return err + } + } else if m.GetColumnsItemCardsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetColumnsItemCardsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetColumnsItemCardsPostRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetColumnsItemCardsPostRequestBodyMember2()) + if err != nil { + return err + } + } + return nil +} +// SetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1 sets the ColumnsItemCardsPostRequestBodyMember1 property value. Composed type representation for type ColumnsItemCardsPostRequestBodyMember1able +func (m *CardsPostRequestBody) SetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1(value ColumnsItemCardsPostRequestBodyMember1able)() { + m.cardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1 = value +} +// SetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2 sets the ColumnsItemCardsPostRequestBodyMember2 property value. Composed type representation for type ColumnsItemCardsPostRequestBodyMember2able +func (m *CardsPostRequestBody) SetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2(value ColumnsItemCardsPostRequestBodyMember2able)() { + m.cardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2 = value +} +// SetColumnsItemCardsPostRequestBodyMember1 sets the ColumnsItemCardsPostRequestBodyMember1 property value. Composed type representation for type ColumnsItemCardsPostRequestBodyMember1able +func (m *CardsPostRequestBody) SetColumnsItemCardsPostRequestBodyMember1(value ColumnsItemCardsPostRequestBodyMember1able)() { + m.columnsItemCardsPostRequestBodyMember1 = value +} +// SetColumnsItemCardsPostRequestBodyMember2 sets the ColumnsItemCardsPostRequestBodyMember2 property value. Composed type representation for type ColumnsItemCardsPostRequestBodyMember2able +func (m *CardsPostRequestBody) SetColumnsItemCardsPostRequestBodyMember2(value ColumnsItemCardsPostRequestBodyMember2able)() { + m.columnsItemCardsPostRequestBodyMember2 = value +} +// ColumnsItemCardsRequestBuilderGetQueryParameters lists the project cards in a project. +type ColumnsItemCardsRequestBuilderGetQueryParameters struct { + // Filters the project cards that are returned by the card's state. + Archived_state *iaecb1d9ce8f039d73681b50025b6b1a10860720b981e5b38dba5e4bcaf58ea7c.GetArchived_stateQueryParameterType `uriparametername:"archived_state"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +type CardsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1()(ColumnsItemCardsPostRequestBodyMember1able) + GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2()(ColumnsItemCardsPostRequestBodyMember2able) + GetColumnsItemCardsPostRequestBodyMember1()(ColumnsItemCardsPostRequestBodyMember1able) + GetColumnsItemCardsPostRequestBodyMember2()(ColumnsItemCardsPostRequestBodyMember2able) + SetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1(value ColumnsItemCardsPostRequestBodyMember1able)() + SetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2(value ColumnsItemCardsPostRequestBodyMember2able)() + SetColumnsItemCardsPostRequestBodyMember1(value ColumnsItemCardsPostRequestBodyMember1able)() + SetColumnsItemCardsPostRequestBodyMember2(value ColumnsItemCardsPostRequestBodyMember2able)() +} +// NewColumnsItemCardsRequestBuilderInternal instantiates a new ColumnsItemCardsRequestBuilder and sets the default values. +func NewColumnsItemCardsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsItemCardsRequestBuilder) { + m := &ColumnsItemCardsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/columns/{column_id}/cards{?archived_state*,page*,per_page*}", pathParameters), + } + return m +} +// NewColumnsItemCardsRequestBuilder instantiates a new ColumnsItemCardsRequestBuilder and sets the default values. +func NewColumnsItemCardsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsItemCardsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewColumnsItemCardsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the project cards in a project. +// returns a []ProjectCardable 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/projects/cards#list-project-cards +func (m *ColumnsItemCardsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ColumnsItemCardsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectCardable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProjectCardFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectCardable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectCardable) + } + } + return val, nil +} +// Post create a project card +// returns a ProjectCardable 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 +// returns a ColumnsItemCardsProjectCard503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/projects/cards#create-a-project-card +func (m *ColumnsItemCardsRequestBuilder) Post(ctx context.Context, body CardsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectCardable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": CreateColumnsItemCardsProjectCard503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProjectCardFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectCardable), nil +} +// ToGetRequestInformation lists the project cards in a project. +// returns a *RequestInformation when successful +func (m *ColumnsItemCardsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ColumnsItemCardsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *ColumnsItemCardsRequestBuilder) ToPostRequestInformation(ctx context.Context, body CardsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ColumnsItemCardsRequestBuilder when successful +func (m *ColumnsItemCardsRequestBuilder) WithUrl(rawUrl string)(*ColumnsItemCardsRequestBuilder) { + return NewColumnsItemCardsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_moves_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_moves_post_request_body.go new file mode 100644 index 000000000..ec742605b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_moves_post_request_body.go @@ -0,0 +1,80 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsItemMovesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The position of the column in a project. Can be one of: `first`, `last`, or `after:` to place after the specified column. + position *string +} +// NewColumnsItemMovesPostRequestBody instantiates a new ColumnsItemMovesPostRequestBody and sets the default values. +func NewColumnsItemMovesPostRequestBody()(*ColumnsItemMovesPostRequestBody) { + m := &ColumnsItemMovesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsItemMovesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsItemMovesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsItemMovesPostRequestBody(), 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 *ColumnsItemMovesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsItemMovesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPosition(val) + } + return nil + } + return res +} +// GetPosition gets the position property value. The position of the column in a project. Can be one of: `first`, `last`, or `after:` to place after the specified column. +// returns a *string when successful +func (m *ColumnsItemMovesPostRequestBody) GetPosition()(*string) { + return m.position +} +// Serialize serializes information the current object +func (m *ColumnsItemMovesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("position", m.GetPosition()) + 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 *ColumnsItemMovesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPosition sets the position property value. The position of the column in a project. Can be one of: `first`, `last`, or `after:` to place after the specified column. +func (m *ColumnsItemMovesPostRequestBody) SetPosition(value *string)() { + m.position = value +} +type ColumnsItemMovesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPosition()(*string) + SetPosition(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_moves_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_moves_post_response.go new file mode 100644 index 000000000..62f06636f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_moves_post_response.go @@ -0,0 +1,32 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsItemMovesPostResponse struct { +} +// NewColumnsItemMovesPostResponse instantiates a new ColumnsItemMovesPostResponse and sets the default values. +func NewColumnsItemMovesPostResponse()(*ColumnsItemMovesPostResponse) { + m := &ColumnsItemMovesPostResponse{ + } + return m +} +// CreateColumnsItemMovesPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsItemMovesPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsItemMovesPostResponse(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsItemMovesPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ColumnsItemMovesPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +type ColumnsItemMovesPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_moves_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_moves_request_builder.go new file mode 100644 index 000000000..b9e14527f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_moves_request_builder.go @@ -0,0 +1,68 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ColumnsItemMovesRequestBuilder builds and executes requests for operations under \projects\columns\{column_id}\moves +type ColumnsItemMovesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewColumnsItemMovesRequestBuilderInternal instantiates a new ColumnsItemMovesRequestBuilder and sets the default values. +func NewColumnsItemMovesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsItemMovesRequestBuilder) { + m := &ColumnsItemMovesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/columns/{column_id}/moves", pathParameters), + } + return m +} +// NewColumnsItemMovesRequestBuilder instantiates a new ColumnsItemMovesRequestBuilder and sets the default values. +func NewColumnsItemMovesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsItemMovesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewColumnsItemMovesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post move a project column +// returns a ColumnsItemMovesPostResponseable 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 +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/projects/columns#move-a-project-column +func (m *ColumnsItemMovesRequestBuilder) Post(ctx context.Context, body ColumnsItemMovesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ColumnsItemMovesPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateColumnsItemMovesPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ColumnsItemMovesPostResponseable), nil +} +// returns a *RequestInformation when successful +func (m *ColumnsItemMovesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ColumnsItemMovesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ColumnsItemMovesRequestBuilder when successful +func (m *ColumnsItemMovesRequestBuilder) WithUrl(rawUrl string)(*ColumnsItemMovesRequestBuilder) { + return NewColumnsItemMovesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_moves_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_moves_response.go new file mode 100644 index 000000000..cb2dffb2a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_moves_response.go @@ -0,0 +1,28 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ColumnsItemMovesResponse +// Deprecated: This class is obsolete. Use movesPostResponse instead. +type ColumnsItemMovesResponse struct { + ColumnsItemMovesPostResponse +} +// NewColumnsItemMovesResponse instantiates a new ColumnsItemMovesResponse and sets the default values. +func NewColumnsItemMovesResponse()(*ColumnsItemMovesResponse) { + m := &ColumnsItemMovesResponse{ + ColumnsItemMovesPostResponse: *NewColumnsItemMovesPostResponse(), + } + return m +} +// CreateColumnsItemMovesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateColumnsItemMovesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsItemMovesResponse(), nil +} +// ColumnsItemMovesResponseable +// Deprecated: This class is obsolete. Use movesPostResponse instead. +type ColumnsItemMovesResponseable interface { + ColumnsItemMovesPostResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_with_column_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_with_column_patch_request_body.go new file mode 100644 index 000000000..ebd123d29 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_item_with_column_patch_request_body.go @@ -0,0 +1,80 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsItemWithColumn_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Name of the project column + name *string +} +// NewColumnsItemWithColumn_PatchRequestBody instantiates a new ColumnsItemWithColumn_PatchRequestBody and sets the default values. +func NewColumnsItemWithColumn_PatchRequestBody()(*ColumnsItemWithColumn_PatchRequestBody) { + m := &ColumnsItemWithColumn_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsItemWithColumn_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsItemWithColumn_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsItemWithColumn_PatchRequestBody(), 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 *ColumnsItemWithColumn_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsItemWithColumn_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. Name of the project column +// returns a *string when successful +func (m *ColumnsItemWithColumn_PatchRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ColumnsItemWithColumn_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ColumnsItemWithColumn_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. Name of the project column +func (m *ColumnsItemWithColumn_PatchRequestBody) SetName(value *string)() { + m.name = value +} +type ColumnsItemWithColumn_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_request_builder.go new file mode 100644 index 000000000..0cc311c6f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_request_builder.go @@ -0,0 +1,39 @@ +package projects + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ColumnsRequestBuilder builds and executes requests for operations under \projects\columns +type ColumnsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByColumn_id gets an item from the github.com/octokit/go-sdk/pkg/github.projects.columns.item collection +// returns a *ColumnsWithColumn_ItemRequestBuilder when successful +func (m *ColumnsRequestBuilder) ByColumn_id(column_id int32)(*ColumnsWithColumn_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["column_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(column_id), 10) + return NewColumnsWithColumn_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// Cards the cards property +// returns a *ColumnsCardsRequestBuilder when successful +func (m *ColumnsRequestBuilder) Cards()(*ColumnsCardsRequestBuilder) { + return NewColumnsCardsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewColumnsRequestBuilderInternal instantiates a new ColumnsRequestBuilder and sets the default values. +func NewColumnsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsRequestBuilder) { + m := &ColumnsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/columns", pathParameters), + } + return m +} +// NewColumnsRequestBuilder instantiates a new ColumnsRequestBuilder and sets the default values. +func NewColumnsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewColumnsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_with_column_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_with_column_item_request_builder.go new file mode 100644 index 000000000..87642e9a4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/columns_with_column_item_request_builder.go @@ -0,0 +1,140 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ColumnsWithColumn_ItemRequestBuilder builds and executes requests for operations under \projects\columns\{column_id} +type ColumnsWithColumn_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Cards the cards property +// returns a *ColumnsItemCardsRequestBuilder when successful +func (m *ColumnsWithColumn_ItemRequestBuilder) Cards()(*ColumnsItemCardsRequestBuilder) { + return NewColumnsItemCardsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewColumnsWithColumn_ItemRequestBuilderInternal instantiates a new ColumnsWithColumn_ItemRequestBuilder and sets the default values. +func NewColumnsWithColumn_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsWithColumn_ItemRequestBuilder) { + m := &ColumnsWithColumn_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/columns/{column_id}", pathParameters), + } + return m +} +// NewColumnsWithColumn_ItemRequestBuilder instantiates a new ColumnsWithColumn_ItemRequestBuilder and sets the default values. +func NewColumnsWithColumn_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsWithColumn_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewColumnsWithColumn_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a project column. +// 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/projects/columns#delete-a-project-column +func (m *ColumnsWithColumn_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets information about a project column. +// returns a ProjectColumnable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/projects/columns#get-a-project-column +func (m *ColumnsWithColumn_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectColumnable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProjectColumnFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectColumnable), nil +} +// Moves the moves property +// returns a *ColumnsItemMovesRequestBuilder when successful +func (m *ColumnsWithColumn_ItemRequestBuilder) Moves()(*ColumnsItemMovesRequestBuilder) { + return NewColumnsItemMovesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch update an existing project column +// returns a ProjectColumnable 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/projects/columns#update-an-existing-project-column +func (m *ColumnsWithColumn_ItemRequestBuilder) Patch(ctx context.Context, body ColumnsItemWithColumn_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectColumnable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProjectColumnFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectColumnable), nil +} +// ToDeleteRequestInformation deletes a project column. +// returns a *RequestInformation when successful +func (m *ColumnsWithColumn_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets information about a project column. +// returns a *RequestInformation when successful +func (m *ColumnsWithColumn_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *ColumnsWithColumn_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ColumnsItemWithColumn_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ColumnsWithColumn_ItemRequestBuilder when successful +func (m *ColumnsWithColumn_ItemRequestBuilder) WithUrl(rawUrl string)(*ColumnsWithColumn_ItemRequestBuilder) { + return NewColumnsWithColumn_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/item/collaborators/get_affiliation_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item/collaborators/get_affiliation_query_parameter_type.go new file mode 100644 index 000000000..6d93c8ba7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item/collaborators/get_affiliation_query_parameter_type.go @@ -0,0 +1,39 @@ +package collaborators +import ( + "errors" +) +type GetAffiliationQueryParameterType int + +const ( + OUTSIDE_GETAFFILIATIONQUERYPARAMETERTYPE GetAffiliationQueryParameterType = iota + DIRECT_GETAFFILIATIONQUERYPARAMETERTYPE + ALL_GETAFFILIATIONQUERYPARAMETERTYPE +) + +func (i GetAffiliationQueryParameterType) String() string { + return []string{"outside", "direct", "all"}[i] +} +func ParseGetAffiliationQueryParameterType(v string) (any, error) { + result := OUTSIDE_GETAFFILIATIONQUERYPARAMETERTYPE + switch v { + case "outside": + result = OUTSIDE_GETAFFILIATIONQUERYPARAMETERTYPE + case "direct": + result = DIRECT_GETAFFILIATIONQUERYPARAMETERTYPE + case "all": + result = ALL_GETAFFILIATIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetAffiliationQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetAffiliationQueryParameterType(values []GetAffiliationQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetAffiliationQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_collaborators_item_permission_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_collaborators_item_permission_request_builder.go new file mode 100644 index 000000000..d67f369bc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_collaborators_item_permission_request_builder.go @@ -0,0 +1,67 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCollaboratorsItemPermissionRequestBuilder builds and executes requests for operations under \projects\{project_id}\collaborators\{username}\permission +type ItemCollaboratorsItemPermissionRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCollaboratorsItemPermissionRequestBuilderInternal instantiates a new ItemCollaboratorsItemPermissionRequestBuilder and sets the default values. +func NewItemCollaboratorsItemPermissionRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCollaboratorsItemPermissionRequestBuilder) { + m := &ItemCollaboratorsItemPermissionRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/{project_id}/collaborators/{username}/permission", pathParameters), + } + return m +} +// NewItemCollaboratorsItemPermissionRequestBuilder instantiates a new ItemCollaboratorsItemPermissionRequestBuilder and sets the default values. +func NewItemCollaboratorsItemPermissionRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCollaboratorsItemPermissionRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCollaboratorsItemPermissionRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the collaborator's permission level for an organization project. Possible values for the `permission` key: `admin`, `write`, `read`, `none`. You must be an organization owner or a project `admin` to review a user's permission level. +// returns a ProjectCollaboratorPermissionable 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 +// 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] +// +// [API method documentation]: https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user +func (m *ItemCollaboratorsItemPermissionRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectCollaboratorPermissionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProjectCollaboratorPermissionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectCollaboratorPermissionable), nil +} +// ToGetRequestInformation returns the collaborator's permission level for an organization project. Possible values for the `permission` key: `admin`, `write`, `read`, `none`. You must be an organization owner or a project `admin` to review a user's permission level. +// returns a *RequestInformation when successful +func (m *ItemCollaboratorsItemPermissionRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCollaboratorsItemPermissionRequestBuilder when successful +func (m *ItemCollaboratorsItemPermissionRequestBuilder) WithUrl(rawUrl string)(*ItemCollaboratorsItemPermissionRequestBuilder) { + return NewItemCollaboratorsItemPermissionRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_collaborators_item_with_username_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_collaborators_item_with_username_put_request_body.go new file mode 100644 index 000000000..52163f61d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_collaborators_item_with_username_put_request_body.go @@ -0,0 +1,51 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCollaboratorsItemWithUsernamePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemCollaboratorsItemWithUsernamePutRequestBody instantiates a new ItemCollaboratorsItemWithUsernamePutRequestBody and sets the default values. +func NewItemCollaboratorsItemWithUsernamePutRequestBody()(*ItemCollaboratorsItemWithUsernamePutRequestBody) { + m := &ItemCollaboratorsItemWithUsernamePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCollaboratorsItemWithUsernamePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCollaboratorsItemWithUsernamePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCollaboratorsItemWithUsernamePutRequestBody(), 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 *ItemCollaboratorsItemWithUsernamePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCollaboratorsItemWithUsernamePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemCollaboratorsItemWithUsernamePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemCollaboratorsItemWithUsernamePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemCollaboratorsItemWithUsernamePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_collaborators_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_collaborators_request_builder.go new file mode 100644 index 000000000..062973043 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_collaborators_request_builder.go @@ -0,0 +1,92 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i9278c50c134ed2203c081269c8e0d5b023412eaec35c331232e99d24d73fec75 "github.com/octokit/go-sdk/pkg/github/projects/item/collaborators" +) + +// ItemCollaboratorsRequestBuilder builds and executes requests for operations under \projects\{project_id}\collaborators +type ItemCollaboratorsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCollaboratorsRequestBuilderGetQueryParameters lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project `admin` to list collaborators. +type ItemCollaboratorsRequestBuilderGetQueryParameters struct { + // Filters the collaborators by their affiliation. `outside` means outside collaborators of a project that are not a member of the project's organization. `direct` means collaborators with permissions to a project, regardless of organization membership status. `all` means all collaborators the authenticated user can see. + Affiliation *i9278c50c134ed2203c081269c8e0d5b023412eaec35c331232e99d24d73fec75.GetAffiliationQueryParameterType `uriparametername:"affiliation"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk/pkg/github.projects.item.collaborators.item collection +// returns a *ItemCollaboratorsWithUsernameItemRequestBuilder when successful +func (m *ItemCollaboratorsRequestBuilder) ByUsername(username string)(*ItemCollaboratorsWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemCollaboratorsWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCollaboratorsRequestBuilderInternal instantiates a new ItemCollaboratorsRequestBuilder and sets the default values. +func NewItemCollaboratorsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCollaboratorsRequestBuilder) { + m := &ItemCollaboratorsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/{project_id}/collaborators{?affiliation*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemCollaboratorsRequestBuilder instantiates a new ItemCollaboratorsRequestBuilder and sets the default values. +func NewItemCollaboratorsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCollaboratorsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCollaboratorsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project `admin` to list collaborators. +// returns a []SimpleUserable 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 +// 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] +// +// [API method documentation]: https://docs.github.com/rest/projects/collaborators#list-project-collaborators +func (m *ItemCollaboratorsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCollaboratorsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project `admin` to list collaborators. +// returns a *RequestInformation when successful +func (m *ItemCollaboratorsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCollaboratorsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCollaboratorsRequestBuilder when successful +func (m *ItemCollaboratorsRequestBuilder) WithUrl(rawUrl string)(*ItemCollaboratorsRequestBuilder) { + return NewItemCollaboratorsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_collaborators_with_username_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_collaborators_with_username_item_request_builder.go new file mode 100644 index 000000000..f65328ec1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_collaborators_with_username_item_request_builder.go @@ -0,0 +1,105 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCollaboratorsWithUsernameItemRequestBuilder builds and executes requests for operations under \projects\{project_id}\collaborators\{username} +type ItemCollaboratorsWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCollaboratorsWithUsernameItemRequestBuilderInternal instantiates a new ItemCollaboratorsWithUsernameItemRequestBuilder and sets the default values. +func NewItemCollaboratorsWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCollaboratorsWithUsernameItemRequestBuilder) { + m := &ItemCollaboratorsWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/{project_id}/collaborators/{username}", pathParameters), + } + return m +} +// NewItemCollaboratorsWithUsernameItemRequestBuilder instantiates a new ItemCollaboratorsWithUsernameItemRequestBuilder and sets the default values. +func NewItemCollaboratorsWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCollaboratorsWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCollaboratorsWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a collaborator from an organization project. You must be an organization owner or a project `admin` to remove a collaborator. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator +func (m *ItemCollaboratorsWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Permission the permission property +// returns a *ItemCollaboratorsItemPermissionRequestBuilder when successful +func (m *ItemCollaboratorsWithUsernameItemRequestBuilder) Permission()(*ItemCollaboratorsItemPermissionRequestBuilder) { + return NewItemCollaboratorsItemPermissionRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Put adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project `admin` to add a collaborator. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/projects/collaborators#add-project-collaborator +func (m *ItemCollaboratorsWithUsernameItemRequestBuilder) Put(ctx context.Context, body ItemCollaboratorsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a collaborator from an organization project. You must be an organization owner or a project `admin` to remove a collaborator. +// returns a *RequestInformation when successful +func (m *ItemCollaboratorsWithUsernameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project `admin` to add a collaborator. +// returns a *RequestInformation when successful +func (m *ItemCollaboratorsWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemCollaboratorsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCollaboratorsWithUsernameItemRequestBuilder when successful +func (m *ItemCollaboratorsWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemCollaboratorsWithUsernameItemRequestBuilder) { + return NewItemCollaboratorsWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_columns_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_columns_post_request_body.go new file mode 100644 index 000000000..929139128 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_columns_post_request_body.go @@ -0,0 +1,80 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemColumnsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Name of the project column + name *string +} +// NewItemColumnsPostRequestBody instantiates a new ItemColumnsPostRequestBody and sets the default values. +func NewItemColumnsPostRequestBody()(*ItemColumnsPostRequestBody) { + m := &ItemColumnsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemColumnsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemColumnsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemColumnsPostRequestBody(), 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 *ItemColumnsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemColumnsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. Name of the project column +// returns a *string when successful +func (m *ItemColumnsPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemColumnsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemColumnsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. Name of the project column +func (m *ItemColumnsPostRequestBody) SetName(value *string)() { + m.name = value +} +type ItemColumnsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_columns_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_columns_request_builder.go new file mode 100644 index 000000000..bcb6df3cb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_columns_request_builder.go @@ -0,0 +1,112 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemColumnsRequestBuilder builds and executes requests for operations under \projects\{project_id}\columns +type ItemColumnsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemColumnsRequestBuilderGetQueryParameters lists the project columns in a project. +type ItemColumnsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemColumnsRequestBuilderInternal instantiates a new ItemColumnsRequestBuilder and sets the default values. +func NewItemColumnsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemColumnsRequestBuilder) { + m := &ItemColumnsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/{project_id}/columns{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemColumnsRequestBuilder instantiates a new ItemColumnsRequestBuilder and sets the default values. +func NewItemColumnsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemColumnsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemColumnsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the project columns in a project. +// returns a []ProjectColumnable 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/projects/columns#list-project-columns +func (m *ItemColumnsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemColumnsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectColumnable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProjectColumnFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectColumnable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectColumnable) + } + } + return val, nil +} +// Post creates a new project column. +// returns a ProjectColumnable 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 +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/projects/columns#create-a-project-column +func (m *ItemColumnsRequestBuilder) Post(ctx context.Context, body ItemColumnsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectColumnable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProjectColumnFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProjectColumnable), nil +} +// ToGetRequestInformation lists the project columns in a project. +// returns a *RequestInformation when successful +func (m *ItemColumnsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemColumnsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a new project column. +// returns a *RequestInformation when successful +func (m *ItemColumnsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemColumnsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemColumnsRequestBuilder when successful +func (m *ItemColumnsRequestBuilder) WithUrl(rawUrl string)(*ItemColumnsRequestBuilder) { + return NewItemColumnsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_project403_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_project403_error.go new file mode 100644 index 000000000..20954ab37 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_project403_error.go @@ -0,0 +1,152 @@ +package projects + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemProject403Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The documentation_url property + documentation_url *string + // The errors property + errors []string + // The message property + message *string +} +// NewItemProject403Error instantiates a new ItemProject403Error and sets the default values. +func NewItemProject403Error()(*ItemProject403Error) { + m := &ItemProject403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemProject403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemProject403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemProject403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemProject403Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemProject403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ItemProject403Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetErrors gets the errors property value. The errors property +// returns a []string when successful +func (m *ItemProject403Error) GetErrors()([]string) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemProject403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetErrors(res) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ItemProject403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemProject403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + if m.GetErrors() != nil { + err := writer.WriteCollectionOfStringValues("errors", m.GetErrors()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ItemProject403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemProject403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetErrors sets the errors property value. The errors property +func (m *ItemProject403Error) SetErrors(value []string)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *ItemProject403Error) SetMessage(value *string)() { + m.message = value +} +type ItemProject403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetErrors()([]string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetErrors(value []string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_with_project_403_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_with_project_403_error.go new file mode 100644 index 000000000..94e53c878 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_with_project_403_error.go @@ -0,0 +1,152 @@ +package projects + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemWithProject_403Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The documentation_url property + documentation_url *string + // The errors property + errors []string + // The message property + message *string +} +// NewItemWithProject_403Error instantiates a new ItemWithProject_403Error and sets the default values. +func NewItemWithProject_403Error()(*ItemWithProject_403Error) { + m := &ItemWithProject_403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemWithProject_403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemWithProject_403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemWithProject_403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemWithProject_403Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemWithProject_403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ItemWithProject_403Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetErrors gets the errors property value. The errors property +// returns a []string when successful +func (m *ItemWithProject_403Error) GetErrors()([]string) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemWithProject_403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetErrors(res) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ItemWithProject_403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemWithProject_403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + if m.GetErrors() != nil { + err := writer.WriteCollectionOfStringValues("errors", m.GetErrors()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ItemWithProject_403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemWithProject_403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetErrors sets the errors property value. The errors property +func (m *ItemWithProject_403Error) SetErrors(value []string)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *ItemWithProject_403Error) SetMessage(value *string)() { + m.message = value +} +type ItemWithProject_403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetErrors()([]string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetErrors(value []string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_with_project_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_with_project_patch_request_body.go new file mode 100644 index 000000000..140a19bf0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/item_with_project_patch_request_body.go @@ -0,0 +1,167 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemWithProject_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Body of the project + body *string + // Name of the project + name *string + // Whether or not this project can be seen by everyone. + private *bool + // State of the project; either 'open' or 'closed' + state *string +} +// NewItemWithProject_PatchRequestBody instantiates a new ItemWithProject_PatchRequestBody and sets the default values. +func NewItemWithProject_PatchRequestBody()(*ItemWithProject_PatchRequestBody) { + m := &ItemWithProject_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemWithProject_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemWithProject_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemWithProject_PatchRequestBody(), 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 *ItemWithProject_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. Body of the project +// returns a *string when successful +func (m *ItemWithProject_PatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemWithProject_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + return res +} +// GetName gets the name property value. Name of the project +// returns a *string when successful +func (m *ItemWithProject_PatchRequestBody) GetName()(*string) { + return m.name +} +// GetPrivate gets the private property value. Whether or not this project can be seen by everyone. +// returns a *bool when successful +func (m *ItemWithProject_PatchRequestBody) GetPrivate()(*bool) { + return m.private +} +// GetState gets the state property value. State of the project; either 'open' or 'closed' +// returns a *string when successful +func (m *ItemWithProject_PatchRequestBody) GetState()(*string) { + return m.state +} +// Serialize serializes information the current object +func (m *ItemWithProject_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + 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 *ItemWithProject_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. Body of the project +func (m *ItemWithProject_PatchRequestBody) SetBody(value *string)() { + m.body = value +} +// SetName sets the name property value. Name of the project +func (m *ItemWithProject_PatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetPrivate sets the private property value. Whether or not this project can be seen by everyone. +func (m *ItemWithProject_PatchRequestBody) SetPrivate(value *bool)() { + m.private = value +} +// SetState sets the state property value. State of the project; either 'open' or 'closed' +func (m *ItemWithProject_PatchRequestBody) SetState(value *string)() { + m.state = value +} +type ItemWithProject_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetName()(*string) + GetPrivate()(*bool) + GetState()(*string) + SetBody(value *string)() + SetName(value *string)() + SetPrivate(value *bool)() + SetState(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/projects_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/projects_request_builder.go new file mode 100644 index 000000000..a8cb788df --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/projects_request_builder.go @@ -0,0 +1,39 @@ +package projects + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ProjectsRequestBuilder builds and executes requests for operations under \projects +type ProjectsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByProject_id gets an item from the github.com/octokit/go-sdk/pkg/github.projects.item collection +// returns a *WithProject_ItemRequestBuilder when successful +func (m *ProjectsRequestBuilder) ByProject_id(project_id int32)(*WithProject_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["project_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(project_id), 10) + return NewWithProject_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// Columns the columns property +// returns a *ColumnsRequestBuilder when successful +func (m *ProjectsRequestBuilder) Columns()(*ColumnsRequestBuilder) { + return NewColumnsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewProjectsRequestBuilderInternal instantiates a new ProjectsRequestBuilder and sets the default values. +func NewProjectsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ProjectsRequestBuilder) { + m := &ProjectsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects", pathParameters), + } + return m +} +// NewProjectsRequestBuilder instantiates a new ProjectsRequestBuilder and sets the default values. +func NewProjectsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ProjectsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewProjectsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/projects/with_project_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/projects/with_project_item_request_builder.go new file mode 100644 index 000000000..0ca490812 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/projects/with_project_item_request_builder.go @@ -0,0 +1,147 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// WithProject_ItemRequestBuilder builds and executes requests for operations under \projects\{project_id} +type WithProject_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Collaborators the collaborators property +// returns a *ItemCollaboratorsRequestBuilder when successful +func (m *WithProject_ItemRequestBuilder) Collaborators()(*ItemCollaboratorsRequestBuilder) { + return NewItemCollaboratorsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Columns the columns property +// returns a *ItemColumnsRequestBuilder when successful +func (m *WithProject_ItemRequestBuilder) Columns()(*ItemColumnsRequestBuilder) { + return NewItemColumnsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewWithProject_ItemRequestBuilderInternal instantiates a new WithProject_ItemRequestBuilder and sets the default values. +func NewWithProject_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithProject_ItemRequestBuilder) { + m := &WithProject_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/{project_id}", pathParameters), + } + return m +} +// NewWithProject_ItemRequestBuilder instantiates a new WithProject_ItemRequestBuilder and sets the default values. +func NewWithProject_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithProject_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithProject_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a project board. Returns a `404 Not Found` status if projects are disabled. +// returns a BasicError error when the service returns a 401 status code +// returns a ItemWithProject_403Error error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/projects/projects#delete-a-project +func (m *WithProject_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": CreateItemWithProject_403ErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a project by its `id`. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a Projectable 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/projects/projects#get-a-project +func (m *WithProject_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable), nil +} +// Patch updates a project board's information. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a Projectable when successful +// returns a BasicError error when the service returns a 401 status code +// returns a ItemProject403Error error when the service returns a 403 status code +// returns a BasicError error when the service returns a 410 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/projects/projects#update-a-project +func (m *WithProject_ItemRequestBuilder) Patch(ctx context.Context, body ItemWithProject_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": CreateItemProject403ErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable), nil +} +// ToDeleteRequestInformation deletes a project board. Returns a `404 Not Found` status if projects are disabled. +// returns a *RequestInformation when successful +func (m *WithProject_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets a project by its `id`. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a *RequestInformation when successful +func (m *WithProject_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates a project board's information. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a *RequestInformation when successful +func (m *WithProject_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemWithProject_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *WithProject_ItemRequestBuilder when successful +func (m *WithProject_ItemRequestBuilder) WithUrl(rawUrl string)(*WithProject_ItemRequestBuilder) { + return NewWithProject_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/rate_limit/rate_limit_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/rate_limit/rate_limit_request_builder.go new file mode 100644 index 000000000..eaa8259be --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/rate_limit/rate_limit_request_builder.go @@ -0,0 +1,61 @@ +package rate_limit + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// Rate_limitRequestBuilder builds and executes requests for operations under \rate_limit +type Rate_limitRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewRate_limitRequestBuilderInternal instantiates a new Rate_limitRequestBuilder and sets the default values. +func NewRate_limitRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Rate_limitRequestBuilder) { + m := &Rate_limitRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/rate_limit", pathParameters), + } + return m +} +// NewRate_limitRequestBuilder instantiates a new Rate_limitRequestBuilder and sets the default values. +func NewRate_limitRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Rate_limitRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewRate_limitRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Note:** Accessing this endpoint does not count against your REST API rate limit.Some categories of endpoints have custom rate limits that are separate from the rate limit governing the other REST API endpoints. For this reason, the API response categorizes your rate limit. Under `resources`, you'll see objects relating to different categories:* The `core` object provides your rate limit status for all non-search-related resources in the REST API.* The `search` object provides your rate limit status for the REST API for searching (excluding code searches). For more information, see "[Search](https://docs.github.com/rest/search/search)."* The `code_search` object provides your rate limit status for the REST API for searching code. For more information, see "[Search code](https://docs.github.com/rest/search/search#search-code)."* The `graphql` object provides your rate limit status for the GraphQL API. For more information, see "[Resource limitations](https://docs.github.com/graphql/overview/resource-limitations#rate-limit)."* The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)."* The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)."* The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)."* The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)."* The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)."**Note:** The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. +// returns a RateLimitOverviewable 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/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user +func (m *Rate_limitRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RateLimitOverviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRateLimitOverviewFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RateLimitOverviewable), nil +} +// ToGetRequestInformation **Note:** Accessing this endpoint does not count against your REST API rate limit.Some categories of endpoints have custom rate limits that are separate from the rate limit governing the other REST API endpoints. For this reason, the API response categorizes your rate limit. Under `resources`, you'll see objects relating to different categories:* The `core` object provides your rate limit status for all non-search-related resources in the REST API.* The `search` object provides your rate limit status for the REST API for searching (excluding code searches). For more information, see "[Search](https://docs.github.com/rest/search/search)."* The `code_search` object provides your rate limit status for the REST API for searching code. For more information, see "[Search code](https://docs.github.com/rest/search/search#search-code)."* The `graphql` object provides your rate limit status for the GraphQL API. For more information, see "[Resource limitations](https://docs.github.com/graphql/overview/resource-limitations#rate-limit)."* The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)."* The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)."* The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)."* The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)."* The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)."**Note:** The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. +// returns a *RequestInformation when successful +func (m *Rate_limitRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *Rate_limitRequestBuilder when successful +func (m *Rate_limitRequestBuilder) WithUrl(rawUrl string)(*Rate_limitRequestBuilder) { + return NewRate_limitRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/caches/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/caches/get_direction_query_parameter_type.go new file mode 100644 index 000000000..816d21f47 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/caches/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package caches +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/caches/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/caches/get_sort_query_parameter_type.go new file mode 100644 index 000000000..f259bd0b4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/caches/get_sort_query_parameter_type.go @@ -0,0 +1,39 @@ +package caches +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_AT_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + LAST_ACCESSED_AT_GETSORTQUERYPARAMETERTYPE + SIZE_IN_BYTES_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created_at", "last_accessed_at", "size_in_bytes"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_AT_GETSORTQUERYPARAMETERTYPE + switch v { + case "created_at": + result = CREATED_AT_GETSORTQUERYPARAMETERTYPE + case "last_accessed_at": + result = LAST_ACCESSED_AT_GETSORTQUERYPARAMETERTYPE + case "size_in_bytes": + result = SIZE_IN_BYTES_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/runs/get_status_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/runs/get_status_query_parameter_type.go new file mode 100644 index 000000000..651b8b5c6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/runs/get_status_query_parameter_type.go @@ -0,0 +1,72 @@ +package runs +import ( + "errors" +) +type GetStatusQueryParameterType int + +const ( + COMPLETED_GETSTATUSQUERYPARAMETERTYPE GetStatusQueryParameterType = iota + ACTION_REQUIRED_GETSTATUSQUERYPARAMETERTYPE + CANCELLED_GETSTATUSQUERYPARAMETERTYPE + FAILURE_GETSTATUSQUERYPARAMETERTYPE + NEUTRAL_GETSTATUSQUERYPARAMETERTYPE + SKIPPED_GETSTATUSQUERYPARAMETERTYPE + STALE_GETSTATUSQUERYPARAMETERTYPE + SUCCESS_GETSTATUSQUERYPARAMETERTYPE + TIMED_OUT_GETSTATUSQUERYPARAMETERTYPE + IN_PROGRESS_GETSTATUSQUERYPARAMETERTYPE + QUEUED_GETSTATUSQUERYPARAMETERTYPE + REQUESTED_GETSTATUSQUERYPARAMETERTYPE + WAITING_GETSTATUSQUERYPARAMETERTYPE + PENDING_GETSTATUSQUERYPARAMETERTYPE +) + +func (i GetStatusQueryParameterType) String() string { + return []string{"completed", "action_required", "cancelled", "failure", "neutral", "skipped", "stale", "success", "timed_out", "in_progress", "queued", "requested", "waiting", "pending"}[i] +} +func ParseGetStatusQueryParameterType(v string) (any, error) { + result := COMPLETED_GETSTATUSQUERYPARAMETERTYPE + switch v { + case "completed": + result = COMPLETED_GETSTATUSQUERYPARAMETERTYPE + case "action_required": + result = ACTION_REQUIRED_GETSTATUSQUERYPARAMETERTYPE + case "cancelled": + result = CANCELLED_GETSTATUSQUERYPARAMETERTYPE + case "failure": + result = FAILURE_GETSTATUSQUERYPARAMETERTYPE + case "neutral": + result = NEUTRAL_GETSTATUSQUERYPARAMETERTYPE + case "skipped": + result = SKIPPED_GETSTATUSQUERYPARAMETERTYPE + case "stale": + result = STALE_GETSTATUSQUERYPARAMETERTYPE + case "success": + result = SUCCESS_GETSTATUSQUERYPARAMETERTYPE + case "timed_out": + result = TIMED_OUT_GETSTATUSQUERYPARAMETERTYPE + case "in_progress": + result = IN_PROGRESS_GETSTATUSQUERYPARAMETERTYPE + case "queued": + result = QUEUED_GETSTATUSQUERYPARAMETERTYPE + case "requested": + result = REQUESTED_GETSTATUSQUERYPARAMETERTYPE + case "waiting": + result = WAITING_GETSTATUSQUERYPARAMETERTYPE + case "pending": + result = PENDING_GETSTATUSQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStatusQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStatusQueryParameterType(values []GetStatusQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStatusQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/runs/item/jobs/get_filter_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/runs/item/jobs/get_filter_query_parameter_type.go new file mode 100644 index 000000000..e943e7ed5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/runs/item/jobs/get_filter_query_parameter_type.go @@ -0,0 +1,36 @@ +package jobs +import ( + "errors" +) +type GetFilterQueryParameterType int + +const ( + LATEST_GETFILTERQUERYPARAMETERTYPE GetFilterQueryParameterType = iota + ALL_GETFILTERQUERYPARAMETERTYPE +) + +func (i GetFilterQueryParameterType) String() string { + return []string{"latest", "all"}[i] +} +func ParseGetFilterQueryParameterType(v string) (any, error) { + result := LATEST_GETFILTERQUERYPARAMETERTYPE + switch v { + case "latest": + result = LATEST_GETFILTERQUERYPARAMETERTYPE + case "all": + result = ALL_GETFILTERQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetFilterQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetFilterQueryParameterType(values []GetFilterQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetFilterQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/workflows/item/runs/get_status_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/workflows/item/runs/get_status_query_parameter_type.go new file mode 100644 index 000000000..651b8b5c6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/workflows/item/runs/get_status_query_parameter_type.go @@ -0,0 +1,72 @@ +package runs +import ( + "errors" +) +type GetStatusQueryParameterType int + +const ( + COMPLETED_GETSTATUSQUERYPARAMETERTYPE GetStatusQueryParameterType = iota + ACTION_REQUIRED_GETSTATUSQUERYPARAMETERTYPE + CANCELLED_GETSTATUSQUERYPARAMETERTYPE + FAILURE_GETSTATUSQUERYPARAMETERTYPE + NEUTRAL_GETSTATUSQUERYPARAMETERTYPE + SKIPPED_GETSTATUSQUERYPARAMETERTYPE + STALE_GETSTATUSQUERYPARAMETERTYPE + SUCCESS_GETSTATUSQUERYPARAMETERTYPE + TIMED_OUT_GETSTATUSQUERYPARAMETERTYPE + IN_PROGRESS_GETSTATUSQUERYPARAMETERTYPE + QUEUED_GETSTATUSQUERYPARAMETERTYPE + REQUESTED_GETSTATUSQUERYPARAMETERTYPE + WAITING_GETSTATUSQUERYPARAMETERTYPE + PENDING_GETSTATUSQUERYPARAMETERTYPE +) + +func (i GetStatusQueryParameterType) String() string { + return []string{"completed", "action_required", "cancelled", "failure", "neutral", "skipped", "stale", "success", "timed_out", "in_progress", "queued", "requested", "waiting", "pending"}[i] +} +func ParseGetStatusQueryParameterType(v string) (any, error) { + result := COMPLETED_GETSTATUSQUERYPARAMETERTYPE + switch v { + case "completed": + result = COMPLETED_GETSTATUSQUERYPARAMETERTYPE + case "action_required": + result = ACTION_REQUIRED_GETSTATUSQUERYPARAMETERTYPE + case "cancelled": + result = CANCELLED_GETSTATUSQUERYPARAMETERTYPE + case "failure": + result = FAILURE_GETSTATUSQUERYPARAMETERTYPE + case "neutral": + result = NEUTRAL_GETSTATUSQUERYPARAMETERTYPE + case "skipped": + result = SKIPPED_GETSTATUSQUERYPARAMETERTYPE + case "stale": + result = STALE_GETSTATUSQUERYPARAMETERTYPE + case "success": + result = SUCCESS_GETSTATUSQUERYPARAMETERTYPE + case "timed_out": + result = TIMED_OUT_GETSTATUSQUERYPARAMETERTYPE + case "in_progress": + result = IN_PROGRESS_GETSTATUSQUERYPARAMETERTYPE + case "queued": + result = QUEUED_GETSTATUSQUERYPARAMETERTYPE + case "requested": + result = REQUESTED_GETSTATUSQUERYPARAMETERTYPE + case "waiting": + result = WAITING_GETSTATUSQUERYPARAMETERTYPE + case "pending": + result = PENDING_GETSTATUSQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStatusQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStatusQueryParameterType(values []GetStatusQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStatusQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/activity/get_activity_type_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/activity/get_activity_type_query_parameter_type.go new file mode 100644 index 000000000..ac8a49ac7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/activity/get_activity_type_query_parameter_type.go @@ -0,0 +1,48 @@ +package activity +import ( + "errors" +) +type GetActivity_typeQueryParameterType int + +const ( + PUSH_GETACTIVITY_TYPEQUERYPARAMETERTYPE GetActivity_typeQueryParameterType = iota + FORCE_PUSH_GETACTIVITY_TYPEQUERYPARAMETERTYPE + BRANCH_CREATION_GETACTIVITY_TYPEQUERYPARAMETERTYPE + BRANCH_DELETION_GETACTIVITY_TYPEQUERYPARAMETERTYPE + PR_MERGE_GETACTIVITY_TYPEQUERYPARAMETERTYPE + MERGE_QUEUE_MERGE_GETACTIVITY_TYPEQUERYPARAMETERTYPE +) + +func (i GetActivity_typeQueryParameterType) String() string { + return []string{"push", "force_push", "branch_creation", "branch_deletion", "pr_merge", "merge_queue_merge"}[i] +} +func ParseGetActivity_typeQueryParameterType(v string) (any, error) { + result := PUSH_GETACTIVITY_TYPEQUERYPARAMETERTYPE + switch v { + case "push": + result = PUSH_GETACTIVITY_TYPEQUERYPARAMETERTYPE + case "force_push": + result = FORCE_PUSH_GETACTIVITY_TYPEQUERYPARAMETERTYPE + case "branch_creation": + result = BRANCH_CREATION_GETACTIVITY_TYPEQUERYPARAMETERTYPE + case "branch_deletion": + result = BRANCH_DELETION_GETACTIVITY_TYPEQUERYPARAMETERTYPE + case "pr_merge": + result = PR_MERGE_GETACTIVITY_TYPEQUERYPARAMETERTYPE + case "merge_queue_merge": + result = MERGE_QUEUE_MERGE_GETACTIVITY_TYPEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetActivity_typeQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetActivity_typeQueryParameterType(values []GetActivity_typeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetActivity_typeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/activity/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/activity/get_direction_query_parameter_type.go new file mode 100644 index 000000000..bac81da91 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/activity/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package activity +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/activity/get_time_period_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/activity/get_time_period_query_parameter_type.go new file mode 100644 index 000000000..abb4d65bc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/activity/get_time_period_query_parameter_type.go @@ -0,0 +1,45 @@ +package activity +import ( + "errors" +) +type GetTime_periodQueryParameterType int + +const ( + DAY_GETTIME_PERIODQUERYPARAMETERTYPE GetTime_periodQueryParameterType = iota + WEEK_GETTIME_PERIODQUERYPARAMETERTYPE + MONTH_GETTIME_PERIODQUERYPARAMETERTYPE + QUARTER_GETTIME_PERIODQUERYPARAMETERTYPE + YEAR_GETTIME_PERIODQUERYPARAMETERTYPE +) + +func (i GetTime_periodQueryParameterType) String() string { + return []string{"day", "week", "month", "quarter", "year"}[i] +} +func ParseGetTime_periodQueryParameterType(v string) (any, error) { + result := DAY_GETTIME_PERIODQUERYPARAMETERTYPE + switch v { + case "day": + result = DAY_GETTIME_PERIODQUERYPARAMETERTYPE + case "week": + result = WEEK_GETTIME_PERIODQUERYPARAMETERTYPE + case "month": + result = MONTH_GETTIME_PERIODQUERYPARAMETERTYPE + case "quarter": + result = QUARTER_GETTIME_PERIODQUERYPARAMETERTYPE + case "year": + result = YEAR_GETTIME_PERIODQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetTime_periodQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetTime_periodQueryParameterType(values []GetTime_periodQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetTime_periodQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/checksuites/item/checkruns/get_filter_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/checksuites/item/checkruns/get_filter_query_parameter_type.go new file mode 100644 index 000000000..f6486461d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/checksuites/item/checkruns/get_filter_query_parameter_type.go @@ -0,0 +1,36 @@ +package checkruns +import ( + "errors" +) +type GetFilterQueryParameterType int + +const ( + LATEST_GETFILTERQUERYPARAMETERTYPE GetFilterQueryParameterType = iota + ALL_GETFILTERQUERYPARAMETERTYPE +) + +func (i GetFilterQueryParameterType) String() string { + return []string{"latest", "all"}[i] +} +func ParseGetFilterQueryParameterType(v string) (any, error) { + result := LATEST_GETFILTERQUERYPARAMETERTYPE + switch v { + case "latest": + result = LATEST_GETFILTERQUERYPARAMETERTYPE + case "all": + result = ALL_GETFILTERQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetFilterQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetFilterQueryParameterType(values []GetFilterQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetFilterQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/checksuites/item/checkruns/get_status_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/checksuites/item/checkruns/get_status_query_parameter_type.go new file mode 100644 index 000000000..9bc3caba5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/checksuites/item/checkruns/get_status_query_parameter_type.go @@ -0,0 +1,39 @@ +package checkruns +import ( + "errors" +) +type GetStatusQueryParameterType int + +const ( + QUEUED_GETSTATUSQUERYPARAMETERTYPE GetStatusQueryParameterType = iota + IN_PROGRESS_GETSTATUSQUERYPARAMETERTYPE + COMPLETED_GETSTATUSQUERYPARAMETERTYPE +) + +func (i GetStatusQueryParameterType) String() string { + return []string{"queued", "in_progress", "completed"}[i] +} +func ParseGetStatusQueryParameterType(v string) (any, error) { + result := QUEUED_GETSTATUSQUERYPARAMETERTYPE + switch v { + case "queued": + result = QUEUED_GETSTATUSQUERYPARAMETERTYPE + case "in_progress": + result = IN_PROGRESS_GETSTATUSQUERYPARAMETERTYPE + case "completed": + result = COMPLETED_GETSTATUSQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStatusQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStatusQueryParameterType(values []GetStatusQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStatusQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/codescanning/alerts/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/codescanning/alerts/get_direction_query_parameter_type.go new file mode 100644 index 000000000..70606a8da --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/codescanning/alerts/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/codescanning/alerts/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/codescanning/alerts/get_sort_query_parameter_type.go new file mode 100644 index 000000000..bc094eda5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/codescanning/alerts/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/codescanning/analyses/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/codescanning/analyses/get_direction_query_parameter_type.go new file mode 100644 index 000000000..f7f659c0b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/codescanning/analyses/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package analyses +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/codescanning/analyses/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/codescanning/analyses/get_sort_query_parameter_type.go new file mode 100644 index 000000000..c937f78d1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/codescanning/analyses/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package analyses +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/collaborators/get_affiliation_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/collaborators/get_affiliation_query_parameter_type.go new file mode 100644 index 000000000..6d93c8ba7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/collaborators/get_affiliation_query_parameter_type.go @@ -0,0 +1,39 @@ +package collaborators +import ( + "errors" +) +type GetAffiliationQueryParameterType int + +const ( + OUTSIDE_GETAFFILIATIONQUERYPARAMETERTYPE GetAffiliationQueryParameterType = iota + DIRECT_GETAFFILIATIONQUERYPARAMETERTYPE + ALL_GETAFFILIATIONQUERYPARAMETERTYPE +) + +func (i GetAffiliationQueryParameterType) String() string { + return []string{"outside", "direct", "all"}[i] +} +func ParseGetAffiliationQueryParameterType(v string) (any, error) { + result := OUTSIDE_GETAFFILIATIONQUERYPARAMETERTYPE + switch v { + case "outside": + result = OUTSIDE_GETAFFILIATIONQUERYPARAMETERTYPE + case "direct": + result = DIRECT_GETAFFILIATIONQUERYPARAMETERTYPE + case "all": + result = ALL_GETAFFILIATIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetAffiliationQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetAffiliationQueryParameterType(values []GetAffiliationQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetAffiliationQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/collaborators/get_permission_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/collaborators/get_permission_query_parameter_type.go new file mode 100644 index 000000000..d53dfc64b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/collaborators/get_permission_query_parameter_type.go @@ -0,0 +1,45 @@ +package collaborators +import ( + "errors" +) +type GetPermissionQueryParameterType int + +const ( + PULL_GETPERMISSIONQUERYPARAMETERTYPE GetPermissionQueryParameterType = iota + TRIAGE_GETPERMISSIONQUERYPARAMETERTYPE + PUSH_GETPERMISSIONQUERYPARAMETERTYPE + MAINTAIN_GETPERMISSIONQUERYPARAMETERTYPE + ADMIN_GETPERMISSIONQUERYPARAMETERTYPE +) + +func (i GetPermissionQueryParameterType) String() string { + return []string{"pull", "triage", "push", "maintain", "admin"}[i] +} +func ParseGetPermissionQueryParameterType(v string) (any, error) { + result := PULL_GETPERMISSIONQUERYPARAMETERTYPE + switch v { + case "pull": + result = PULL_GETPERMISSIONQUERYPARAMETERTYPE + case "triage": + result = TRIAGE_GETPERMISSIONQUERYPARAMETERTYPE + case "push": + result = PUSH_GETPERMISSIONQUERYPARAMETERTYPE + case "maintain": + result = MAINTAIN_GETPERMISSIONQUERYPARAMETERTYPE + case "admin": + result = ADMIN_GETPERMISSIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetPermissionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetPermissionQueryParameterType(values []GetPermissionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetPermissionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/comments/item/reactions/get_content_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/comments/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 000000000..7aef65a2e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/comments/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,54 @@ +package reactions +import ( + "errors" +) +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + MINUS_1_GETCONTENTQUERYPARAMETERTYPE + LAUGH_GETCONTENTQUERYPARAMETERTYPE + CONFUSED_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "-1": + result = MINUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "confused": + result = CONFUSED_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetContentQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/comments/item/reactions/reactions_post_request_body_content.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/comments/item/reactions/reactions_post_request_body_content.go new file mode 100644 index 000000000..e4c89a194 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/comments/item/reactions/reactions_post_request_body_content.go @@ -0,0 +1,55 @@ +package reactions +import ( + "errors" +) +// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the commit comment. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "-1": + result = MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "confused": + result = CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return 0, errors.New("Unknown ReactionsPostRequestBody_content value: " + v) + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/commits/item/checkruns/get_filter_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/commits/item/checkruns/get_filter_query_parameter_type.go new file mode 100644 index 000000000..f6486461d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/commits/item/checkruns/get_filter_query_parameter_type.go @@ -0,0 +1,36 @@ +package checkruns +import ( + "errors" +) +type GetFilterQueryParameterType int + +const ( + LATEST_GETFILTERQUERYPARAMETERTYPE GetFilterQueryParameterType = iota + ALL_GETFILTERQUERYPARAMETERTYPE +) + +func (i GetFilterQueryParameterType) String() string { + return []string{"latest", "all"}[i] +} +func ParseGetFilterQueryParameterType(v string) (any, error) { + result := LATEST_GETFILTERQUERYPARAMETERTYPE + switch v { + case "latest": + result = LATEST_GETFILTERQUERYPARAMETERTYPE + case "all": + result = ALL_GETFILTERQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetFilterQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetFilterQueryParameterType(values []GetFilterQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetFilterQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/commits/item/checkruns/get_status_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/commits/item/checkruns/get_status_query_parameter_type.go new file mode 100644 index 000000000..9bc3caba5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/commits/item/checkruns/get_status_query_parameter_type.go @@ -0,0 +1,39 @@ +package checkruns +import ( + "errors" +) +type GetStatusQueryParameterType int + +const ( + QUEUED_GETSTATUSQUERYPARAMETERTYPE GetStatusQueryParameterType = iota + IN_PROGRESS_GETSTATUSQUERYPARAMETERTYPE + COMPLETED_GETSTATUSQUERYPARAMETERTYPE +) + +func (i GetStatusQueryParameterType) String() string { + return []string{"queued", "in_progress", "completed"}[i] +} +func ParseGetStatusQueryParameterType(v string) (any, error) { + result := QUEUED_GETSTATUSQUERYPARAMETERTYPE + switch v { + case "queued": + result = QUEUED_GETSTATUSQUERYPARAMETERTYPE + case "in_progress": + result = IN_PROGRESS_GETSTATUSQUERYPARAMETERTYPE + case "completed": + result = COMPLETED_GETSTATUSQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStatusQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStatusQueryParameterType(values []GetStatusQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStatusQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/dependabot/alerts/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/dependabot/alerts/get_direction_query_parameter_type.go new file mode 100644 index 000000000..70606a8da --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/dependabot/alerts/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/dependabot/alerts/get_scope_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/dependabot/alerts/get_scope_query_parameter_type.go new file mode 100644 index 000000000..906bdb78d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/dependabot/alerts/get_scope_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetScopeQueryParameterType int + +const ( + DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE GetScopeQueryParameterType = iota + RUNTIME_GETSCOPEQUERYPARAMETERTYPE +) + +func (i GetScopeQueryParameterType) String() string { + return []string{"development", "runtime"}[i] +} +func ParseGetScopeQueryParameterType(v string) (any, error) { + result := DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE + switch v { + case "development": + result = DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE + case "runtime": + result = RUNTIME_GETSCOPEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetScopeQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetScopeQueryParameterType(values []GetScopeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetScopeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/dependabot/alerts/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/dependabot/alerts/get_sort_query_parameter_type.go new file mode 100644 index 000000000..bc094eda5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/dependabot/alerts/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/forks/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/forks/get_sort_query_parameter_type.go new file mode 100644 index 000000000..238f6740d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/forks/get_sort_query_parameter_type.go @@ -0,0 +1,42 @@ +package forks +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + NEWEST_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + OLDEST_GETSORTQUERYPARAMETERTYPE + STARGAZERS_GETSORTQUERYPARAMETERTYPE + WATCHERS_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"newest", "oldest", "stargazers", "watchers"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := NEWEST_GETSORTQUERYPARAMETERTYPE + switch v { + case "newest": + result = NEWEST_GETSORTQUERYPARAMETERTYPE + case "oldest": + result = OLDEST_GETSORTQUERYPARAMETERTYPE + case "stargazers": + result = STARGAZERS_GETSORTQUERYPARAMETERTYPE + case "watchers": + result = WATCHERS_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/comments/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/comments/get_direction_query_parameter_type.go new file mode 100644 index 000000000..ac2550630 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/comments/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package comments +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/comments/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/comments/get_sort_query_parameter_type.go new file mode 100644 index 000000000..4ccff65f1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/comments/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package comments +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/comments/item/reactions/get_content_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/comments/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 000000000..7aef65a2e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/comments/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,54 @@ +package reactions +import ( + "errors" +) +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + MINUS_1_GETCONTENTQUERYPARAMETERTYPE + LAUGH_GETCONTENTQUERYPARAMETERTYPE + CONFUSED_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "-1": + result = MINUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "confused": + result = CONFUSED_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetContentQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/comments/item/reactions/reactions_post_request_body_content.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/comments/item/reactions/reactions_post_request_body_content.go new file mode 100644 index 000000000..a3fa55332 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/comments/item/reactions/reactions_post_request_body_content.go @@ -0,0 +1,55 @@ +package reactions +import ( + "errors" +) +// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the issue comment. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "-1": + result = MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "confused": + result = CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return 0, errors.New("Unknown ReactionsPostRequestBody_content value: " + v) + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/get_direction_query_parameter_type.go new file mode 100644 index 000000000..6aca6ecb9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package issues +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/get_sort_query_parameter_type.go new file mode 100644 index 000000000..ba962acfb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/get_sort_query_parameter_type.go @@ -0,0 +1,39 @@ +package issues +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + COMMENTS_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "comments"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "comments": + result = COMMENTS_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/get_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/get_state_query_parameter_type.go new file mode 100644 index 000000000..554151074 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/get_state_query_parameter_type.go @@ -0,0 +1,39 @@ +package issues +import ( + "errors" +) +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/item/reactions/get_content_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 000000000..7aef65a2e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,54 @@ +package reactions +import ( + "errors" +) +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + MINUS_1_GETCONTENTQUERYPARAMETERTYPE + LAUGH_GETCONTENTQUERYPARAMETERTYPE + CONFUSED_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "-1": + result = MINUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "confused": + result = CONFUSED_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetContentQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/item/reactions/reactions_post_request_body_content.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/item/reactions/reactions_post_request_body_content.go new file mode 100644 index 000000000..e37c3b8bc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/item/reactions/reactions_post_request_body_content.go @@ -0,0 +1,55 @@ +package reactions +import ( + "errors" +) +// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the issue. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "-1": + result = MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "confused": + result = CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return 0, errors.New("Unknown ReactionsPostRequestBody_content value: " + v) + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/milestones/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/milestones/get_direction_query_parameter_type.go new file mode 100644 index 000000000..b041b3a56 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/milestones/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package milestones +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/milestones/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/milestones/get_sort_query_parameter_type.go new file mode 100644 index 000000000..4d6907753 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/milestones/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package milestones +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + DUE_ON_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + COMPLETENESS_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"due_on", "completeness"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := DUE_ON_GETSORTQUERYPARAMETERTYPE + switch v { + case "due_on": + result = DUE_ON_GETSORTQUERYPARAMETERTYPE + case "completeness": + result = COMPLETENESS_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/milestones/get_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/milestones/get_state_query_parameter_type.go new file mode 100644 index 000000000..11bfb7198 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/milestones/get_state_query_parameter_type.go @@ -0,0 +1,39 @@ +package milestones +import ( + "errors" +) +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/milestones/milestones_post_request_body_state.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/milestones/milestones_post_request_body_state.go new file mode 100644 index 000000000..09bc8540f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/milestones/milestones_post_request_body_state.go @@ -0,0 +1,37 @@ +package milestones +import ( + "errors" +) +// The state of the milestone. Either `open` or `closed`. +type MilestonesPostRequestBody_state int + +const ( + OPEN_MILESTONESPOSTREQUESTBODY_STATE MilestonesPostRequestBody_state = iota + CLOSED_MILESTONESPOSTREQUESTBODY_STATE +) + +func (i MilestonesPostRequestBody_state) String() string { + return []string{"open", "closed"}[i] +} +func ParseMilestonesPostRequestBody_state(v string) (any, error) { + result := OPEN_MILESTONESPOSTREQUESTBODY_STATE + switch v { + case "open": + result = OPEN_MILESTONESPOSTREQUESTBODY_STATE + case "closed": + result = CLOSED_MILESTONESPOSTREQUESTBODY_STATE + default: + return 0, errors.New("Unknown MilestonesPostRequestBody_state value: " + v) + } + return &result, nil +} +func SerializeMilestonesPostRequestBody_state(values []MilestonesPostRequestBody_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i MilestonesPostRequestBody_state) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/projects/get_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/projects/get_state_query_parameter_type.go new file mode 100644 index 000000000..985374b5e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/projects/get_state_query_parameter_type.go @@ -0,0 +1,39 @@ +package projects +import ( + "errors" +) +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/comments/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/comments/get_direction_query_parameter_type.go new file mode 100644 index 000000000..ac2550630 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/comments/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package comments +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/comments/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/comments/get_sort_query_parameter_type.go new file mode 100644 index 000000000..d29bef7c6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/comments/get_sort_query_parameter_type.go @@ -0,0 +1,39 @@ +package comments +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + CREATED_AT_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "created_at"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "created_at": + result = CREATED_AT_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/comments/item/reactions/get_content_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/comments/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 000000000..7aef65a2e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/comments/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,54 @@ +package reactions +import ( + "errors" +) +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + MINUS_1_GETCONTENTQUERYPARAMETERTYPE + LAUGH_GETCONTENTQUERYPARAMETERTYPE + CONFUSED_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "-1": + result = MINUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "confused": + result = CONFUSED_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetContentQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/comments/item/reactions/reactions_post_request_body_content.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/comments/item/reactions/reactions_post_request_body_content.go new file mode 100644 index 000000000..60537c680 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/comments/item/reactions/reactions_post_request_body_content.go @@ -0,0 +1,55 @@ +package reactions +import ( + "errors" +) +// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the pull request review comment. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "-1": + result = MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "confused": + result = CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return 0, errors.New("Unknown ReactionsPostRequestBody_content value: " + v) + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/get_direction_query_parameter_type.go new file mode 100644 index 000000000..f9e2cd95d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package pulls +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/get_sort_query_parameter_type.go new file mode 100644 index 000000000..527753249 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/get_sort_query_parameter_type.go @@ -0,0 +1,42 @@ +package pulls +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + POPULARITY_GETSORTQUERYPARAMETERTYPE + LONGRUNNING_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "popularity", "long-running"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "popularity": + result = POPULARITY_GETSORTQUERYPARAMETERTYPE + case "long-running": + result = LONGRUNNING_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/get_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/get_state_query_parameter_type.go new file mode 100644 index 000000000..b23e03189 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/get_state_query_parameter_type.go @@ -0,0 +1,39 @@ +package pulls +import ( + "errors" +) +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_side.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_side.go new file mode 100644 index 000000000..57e4170bf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_side.go @@ -0,0 +1,37 @@ +package comments +import ( + "errors" +) +// In a split diff view, the side of the diff that the pull request's changes appear on. Can be `LEFT` or `RIGHT`. Use `LEFT` for deletions that appear in red. Use `RIGHT` for additions that appear in green or unchanged lines that appear in white and are shown for context. For a multi-line comment, side represents whether the last line of the comment range is a deletion or addition. For more information, see "[Diff view options](https://docs.github.com/articles/about-comparing-branches-in-pull-requests#diff-view-options)" in the GitHub Help documentation. +type CommentsPostRequestBody_side int + +const ( + LEFT_COMMENTSPOSTREQUESTBODY_SIDE CommentsPostRequestBody_side = iota + RIGHT_COMMENTSPOSTREQUESTBODY_SIDE +) + +func (i CommentsPostRequestBody_side) String() string { + return []string{"LEFT", "RIGHT"}[i] +} +func ParseCommentsPostRequestBody_side(v string) (any, error) { + result := LEFT_COMMENTSPOSTREQUESTBODY_SIDE + switch v { + case "LEFT": + result = LEFT_COMMENTSPOSTREQUESTBODY_SIDE + case "RIGHT": + result = RIGHT_COMMENTSPOSTREQUESTBODY_SIDE + default: + return 0, errors.New("Unknown CommentsPostRequestBody_side value: " + v) + } + return &result, nil +} +func SerializeCommentsPostRequestBody_side(values []CommentsPostRequestBody_side) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CommentsPostRequestBody_side) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_start_side.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_start_side.go new file mode 100644 index 000000000..09c2c0058 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_start_side.go @@ -0,0 +1,40 @@ +package comments +import ( + "errors" +) +// **Required when using multi-line comments unless using `in_reply_to`**. The `start_side` is the starting side of the diff that the comment applies to. Can be `LEFT` or `RIGHT`. To learn more about multi-line comments, see "[Commenting on a pull request](https://docs.github.com/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. See `side` in this table for additional context. +type CommentsPostRequestBody_start_side int + +const ( + LEFT_COMMENTSPOSTREQUESTBODY_START_SIDE CommentsPostRequestBody_start_side = iota + RIGHT_COMMENTSPOSTREQUESTBODY_START_SIDE + SIDE_COMMENTSPOSTREQUESTBODY_START_SIDE +) + +func (i CommentsPostRequestBody_start_side) String() string { + return []string{"LEFT", "RIGHT", "side"}[i] +} +func ParseCommentsPostRequestBody_start_side(v string) (any, error) { + result := LEFT_COMMENTSPOSTREQUESTBODY_START_SIDE + switch v { + case "LEFT": + result = LEFT_COMMENTSPOSTREQUESTBODY_START_SIDE + case "RIGHT": + result = RIGHT_COMMENTSPOSTREQUESTBODY_START_SIDE + case "side": + result = SIDE_COMMENTSPOSTREQUESTBODY_START_SIDE + default: + return 0, errors.New("Unknown CommentsPostRequestBody_start_side value: " + v) + } + return &result, nil +} +func SerializeCommentsPostRequestBody_start_side(values []CommentsPostRequestBody_start_side) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CommentsPostRequestBody_start_side) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_subject_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_subject_type.go new file mode 100644 index 000000000..b7b643a29 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_subject_type.go @@ -0,0 +1,37 @@ +package comments +import ( + "errors" +) +// The level at which the comment is targeted. +type CommentsPostRequestBody_subject_type int + +const ( + LINE_COMMENTSPOSTREQUESTBODY_SUBJECT_TYPE CommentsPostRequestBody_subject_type = iota + FILE_COMMENTSPOSTREQUESTBODY_SUBJECT_TYPE +) + +func (i CommentsPostRequestBody_subject_type) String() string { + return []string{"line", "file"}[i] +} +func ParseCommentsPostRequestBody_subject_type(v string) (any, error) { + result := LINE_COMMENTSPOSTREQUESTBODY_SUBJECT_TYPE + switch v { + case "line": + result = LINE_COMMENTSPOSTREQUESTBODY_SUBJECT_TYPE + case "file": + result = FILE_COMMENTSPOSTREQUESTBODY_SUBJECT_TYPE + default: + return 0, errors.New("Unknown CommentsPostRequestBody_subject_type value: " + v) + } + return &result, nil +} +func SerializeCommentsPostRequestBody_subject_type(values []CommentsPostRequestBody_subject_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CommentsPostRequestBody_subject_type) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/item/comments/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/item/comments/get_direction_query_parameter_type.go new file mode 100644 index 000000000..ac2550630 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/item/comments/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package comments +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/item/comments/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/item/comments/get_sort_query_parameter_type.go new file mode 100644 index 000000000..4ccff65f1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/item/comments/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package comments +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/releases/item/reactions/get_content_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/releases/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 000000000..5405ea222 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/releases/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,48 @@ +package reactions +import ( + "errors" +) +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + LAUGH_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "laugh", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetContentQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/releases/item/reactions/reactions_post_request_body_content.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/releases/item/reactions/reactions_post_request_body_content.go new file mode 100644 index 000000000..d58288b1b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/releases/item/reactions/reactions_post_request_body_content.go @@ -0,0 +1,49 @@ +package reactions +import ( + "errors" +) +// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the release. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "laugh", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return 0, errors.New("Unknown ReactionsPostRequestBody_content value: " + v) + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/rulesets/rulesuites/get_rule_suite_result_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/rulesets/rulesuites/get_rule_suite_result_query_parameter_type.go new file mode 100644 index 000000000..91a669a60 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/rulesets/rulesuites/get_rule_suite_result_query_parameter_type.go @@ -0,0 +1,42 @@ +package rulesuites +import ( + "errors" +) +type GetRule_suite_resultQueryParameterType int + +const ( + PASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE GetRule_suite_resultQueryParameterType = iota + FAIL_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + BYPASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + ALL_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE +) + +func (i GetRule_suite_resultQueryParameterType) String() string { + return []string{"pass", "fail", "bypass", "all"}[i] +} +func ParseGetRule_suite_resultQueryParameterType(v string) (any, error) { + result := PASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + switch v { + case "pass": + result = PASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + case "fail": + result = FAIL_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + case "bypass": + result = BYPASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + case "all": + result = ALL_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetRule_suite_resultQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetRule_suite_resultQueryParameterType(values []GetRule_suite_resultQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetRule_suite_resultQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/rulesets/rulesuites/get_time_period_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/rulesets/rulesuites/get_time_period_query_parameter_type.go new file mode 100644 index 000000000..82dfab2d3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/rulesets/rulesuites/get_time_period_query_parameter_type.go @@ -0,0 +1,42 @@ +package rulesuites +import ( + "errors" +) +type GetTime_periodQueryParameterType int + +const ( + HOUR_GETTIME_PERIODQUERYPARAMETERTYPE GetTime_periodQueryParameterType = iota + DAY_GETTIME_PERIODQUERYPARAMETERTYPE + WEEK_GETTIME_PERIODQUERYPARAMETERTYPE + MONTH_GETTIME_PERIODQUERYPARAMETERTYPE +) + +func (i GetTime_periodQueryParameterType) String() string { + return []string{"hour", "day", "week", "month"}[i] +} +func ParseGetTime_periodQueryParameterType(v string) (any, error) { + result := HOUR_GETTIME_PERIODQUERYPARAMETERTYPE + switch v { + case "hour": + result = HOUR_GETTIME_PERIODQUERYPARAMETERTYPE + case "day": + result = DAY_GETTIME_PERIODQUERYPARAMETERTYPE + case "week": + result = WEEK_GETTIME_PERIODQUERYPARAMETERTYPE + case "month": + result = MONTH_GETTIME_PERIODQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetTime_periodQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetTime_periodQueryParameterType(values []GetTime_periodQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetTime_periodQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/secretscanning/alerts/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/secretscanning/alerts/get_direction_query_parameter_type.go new file mode 100644 index 000000000..70606a8da --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/secretscanning/alerts/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/secretscanning/alerts/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/secretscanning/alerts/get_sort_query_parameter_type.go new file mode 100644 index 000000000..bc094eda5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/secretscanning/alerts/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/secretscanning/alerts/get_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/secretscanning/alerts/get_state_query_parameter_type.go new file mode 100644 index 000000000..382957f5c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/secretscanning/alerts/get_state_query_parameter_type.go @@ -0,0 +1,36 @@ +package alerts +import ( + "errors" +) +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + RESOLVED_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "resolved"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "resolved": + result = RESOLVED_GETSTATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/securityadvisories/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/securityadvisories/get_direction_query_parameter_type.go new file mode 100644 index 000000000..41aa1584f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/securityadvisories/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package securityadvisories +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/securityadvisories/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/securityadvisories/get_sort_query_parameter_type.go new file mode 100644 index 000000000..93822450e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/securityadvisories/get_sort_query_parameter_type.go @@ -0,0 +1,39 @@ +package securityadvisories +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + PUBLISHED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "published"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "published": + result = PUBLISHED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/securityadvisories/get_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/securityadvisories/get_state_query_parameter_type.go new file mode 100644 index 000000000..4f106c12b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/securityadvisories/get_state_query_parameter_type.go @@ -0,0 +1,42 @@ +package securityadvisories +import ( + "errors" +) +type GetStateQueryParameterType int + +const ( + TRIAGE_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + DRAFT_GETSTATEQUERYPARAMETERTYPE + PUBLISHED_GETSTATEQUERYPARAMETERTYPE + CLOSED_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"triage", "draft", "published", "closed"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := TRIAGE_GETSTATEQUERYPARAMETERTYPE + switch v { + case "triage": + result = TRIAGE_GETSTATEQUERYPARAMETERTYPE + case "draft": + result = DRAFT_GETSTATEQUERYPARAMETERTYPE + case "published": + result = PUBLISHED_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/traffic/clones/get_per_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/traffic/clones/get_per_query_parameter_type.go new file mode 100644 index 000000000..d69029ae7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/traffic/clones/get_per_query_parameter_type.go @@ -0,0 +1,36 @@ +package clones +import ( + "errors" +) +type GetPerQueryParameterType int + +const ( + DAY_GETPERQUERYPARAMETERTYPE GetPerQueryParameterType = iota + WEEK_GETPERQUERYPARAMETERTYPE +) + +func (i GetPerQueryParameterType) String() string { + return []string{"day", "week"}[i] +} +func ParseGetPerQueryParameterType(v string) (any, error) { + result := DAY_GETPERQUERYPARAMETERTYPE + switch v { + case "day": + result = DAY_GETPERQUERYPARAMETERTYPE + case "week": + result = WEEK_GETPERQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetPerQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetPerQueryParameterType(values []GetPerQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetPerQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/traffic/views/get_per_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/traffic/views/get_per_query_parameter_type.go new file mode 100644 index 000000000..4816ad8f3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item/item/traffic/views/get_per_query_parameter_type.go @@ -0,0 +1,36 @@ +package views +import ( + "errors" +) +type GetPerQueryParameterType int + +const ( + DAY_GETPERQUERYPARAMETERTYPE GetPerQueryParameterType = iota + WEEK_GETPERQUERYPARAMETERTYPE +) + +func (i GetPerQueryParameterType) String() string { + return []string{"day", "week"}[i] +} +func ParseGetPerQueryParameterType(v string) (any, error) { + result := DAY_GETPERQUERYPARAMETERTYPE + switch v { + case "day": + result = DAY_GETPERQUERYPARAMETERTYPE + case "week": + result = WEEK_GETPERQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetPerQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetPerQueryParameterType(values []GetPerQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetPerQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_artifacts_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_artifacts_get_response.go new file mode 100644 index 000000000..eed263c6d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_artifacts_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsArtifactsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The artifacts property + artifacts []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Artifactable + // The total_count property + total_count *int32 +} +// NewItemItemActionsArtifactsGetResponse instantiates a new ItemItemActionsArtifactsGetResponse and sets the default values. +func NewItemItemActionsArtifactsGetResponse()(*ItemItemActionsArtifactsGetResponse) { + m := &ItemItemActionsArtifactsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsArtifactsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsArtifactsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsArtifactsGetResponse(), 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 *ItemItemActionsArtifactsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArtifacts gets the artifacts property value. The artifacts property +// returns a []Artifactable when successful +func (m *ItemItemActionsArtifactsGetResponse) GetArtifacts()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Artifactable) { + return m.artifacts +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsArtifactsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["artifacts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateArtifactFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Artifactable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Artifactable) + } + } + m.SetArtifacts(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsArtifactsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsArtifactsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetArtifacts() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetArtifacts())) + for i, v := range m.GetArtifacts() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("artifacts", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsArtifactsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArtifacts sets the artifacts property value. The artifacts property +func (m *ItemItemActionsArtifactsGetResponse) SetArtifacts(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Artifactable)() { + m.artifacts = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsArtifactsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsArtifactsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArtifacts()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Artifactable) + GetTotalCount()(*int32) + SetArtifacts(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Artifactable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_artifacts_item_with_archive_format_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_artifacts_item_with_archive_format_item_request_builder.go new file mode 100644 index 000000000..6e4b80dd3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_artifacts_item_with_archive_format_item_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\artifacts\{artifact_id}\{archive_format} +type ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilderInternal instantiates a new ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder and sets the default values. +func NewItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder) { + m := &ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/artifacts/{artifact_id}/{archive_format}", pathParameters), + } + return m +} +// NewItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder instantiates a new ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder and sets the default values. +func NewItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = 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 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])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + 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 +func (m *ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder when successful +func (m *ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder) { + return NewItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_artifacts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_artifacts_request_builder.go new file mode 100644 index 000000000..0427fc428 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_artifacts_request_builder.go @@ -0,0 +1,76 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsArtifactsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\artifacts +type ItemItemActionsArtifactsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsArtifactsRequestBuilderGetQueryParameters lists all artifacts for a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemActionsArtifactsRequestBuilderGetQueryParameters struct { + // The name field of an artifact. When specified, only artifacts with this name will be returned. + Name *string `uriparametername:"name"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByArtifact_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.actions.artifacts.item collection +// returns a *ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder when successful +func (m *ItemItemActionsArtifactsRequestBuilder) ByArtifact_id(artifact_id int32)(*ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["artifact_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(artifact_id), 10) + return NewItemItemActionsArtifactsWithArtifact_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsArtifactsRequestBuilderInternal instantiates a new ItemItemActionsArtifactsRequestBuilder and sets the default values. +func NewItemItemActionsArtifactsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsArtifactsRequestBuilder) { + m := &ItemItemActionsArtifactsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/artifacts{?name*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsArtifactsRequestBuilder instantiates a new ItemItemActionsArtifactsRequestBuilder and sets the default values. +func NewItemItemActionsArtifactsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsArtifactsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsArtifactsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all artifacts for a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemActionsArtifactsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository +func (m *ItemItemActionsArtifactsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsArtifactsRequestBuilderGetQueryParameters])(ItemItemActionsArtifactsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsArtifactsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsArtifactsGetResponseable), nil +} +// ToGetRequestInformation lists all artifacts for a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsArtifactsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsArtifactsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsArtifactsRequestBuilder when successful +func (m *ItemItemActionsArtifactsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsArtifactsRequestBuilder) { + return NewItemItemActionsArtifactsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_artifacts_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_artifacts_response.go new file mode 100644 index 000000000..b72f5f250 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_artifacts_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsArtifactsResponse +// Deprecated: This class is obsolete. Use artifactsGetResponse instead. +type ItemItemActionsArtifactsResponse struct { + ItemItemActionsArtifactsGetResponse +} +// NewItemItemActionsArtifactsResponse instantiates a new ItemItemActionsArtifactsResponse and sets the default values. +func NewItemItemActionsArtifactsResponse()(*ItemItemActionsArtifactsResponse) { + m := &ItemItemActionsArtifactsResponse{ + ItemItemActionsArtifactsGetResponse: *NewItemItemActionsArtifactsGetResponse(), + } + return m +} +// CreateItemItemActionsArtifactsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemActionsArtifactsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsArtifactsResponse(), nil +} +// ItemItemActionsArtifactsResponseable +// Deprecated: This class is obsolete. Use artifactsGetResponse instead. +type ItemItemActionsArtifactsResponseable interface { + ItemItemActionsArtifactsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_artifacts_with_artifact_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_artifacts_with_artifact_item_request_builder.go new file mode 100644 index 000000000..e95843012 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_artifacts_with_artifact_item_request_builder.go @@ -0,0 +1,91 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\artifacts\{artifact_id} +type ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByArchive_format gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.actions.artifacts.item.item collection +// returns a *ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder when successful +func (m *ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) ByArchive_format(archive_format string)(*ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if archive_format != "" { + urlTplParams["archive_format"] = archive_format + } + return NewItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsArtifactsWithArtifact_ItemRequestBuilderInternal instantiates a new ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder and sets the default values. +func NewItemItemActionsArtifactsWithArtifact_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) { + m := &ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/artifacts/{artifact_id}", pathParameters), + } + return m +} +// NewItemItemActionsArtifactsWithArtifact_ItemRequestBuilder instantiates a new ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder and sets the default values. +func NewItemItemActionsArtifactsWithArtifact_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsArtifactsWithArtifact_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes an artifact for a workflow run.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/artifacts#delete-an-artifact +func (m *ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a specific artifact for a workflow run.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 Artifactable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/artifacts#get-an-artifact +func (m *ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Artifactable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateArtifactFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Artifactable), nil +} +// ToDeleteRequestInformation deletes an artifact for a workflow run.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a specific artifact for a workflow run.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder when successful +func (m *ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) { + return NewItemItemActionsArtifactsWithArtifact_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_cache_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_cache_request_builder.go new file mode 100644 index 000000000..dfbae8277 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_cache_request_builder.go @@ -0,0 +1,28 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsCacheRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\cache +type ItemItemActionsCacheRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsCacheRequestBuilderInternal instantiates a new ItemItemActionsCacheRequestBuilder and sets the default values. +func NewItemItemActionsCacheRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCacheRequestBuilder) { + m := &ItemItemActionsCacheRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/cache", pathParameters), + } + return m +} +// NewItemItemActionsCacheRequestBuilder instantiates a new ItemItemActionsCacheRequestBuilder and sets the default values. +func NewItemItemActionsCacheRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCacheRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsCacheRequestBuilderInternal(urlParams, requestAdapter) +} +// Usage the usage property +// returns a *ItemItemActionsCacheUsageRequestBuilder when successful +func (m *ItemItemActionsCacheRequestBuilder) Usage()(*ItemItemActionsCacheUsageRequestBuilder) { + return NewItemItemActionsCacheUsageRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_cache_usage_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_cache_usage_request_builder.go new file mode 100644 index 000000000..cb9c74c1f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_cache_usage_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsCacheUsageRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\cache\usage +type ItemItemActionsCacheUsageRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsCacheUsageRequestBuilderInternal instantiates a new ItemItemActionsCacheUsageRequestBuilder and sets the default values. +func NewItemItemActionsCacheUsageRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCacheUsageRequestBuilder) { + m := &ItemItemActionsCacheUsageRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/cache/usage", pathParameters), + } + return m +} +// NewItemItemActionsCacheUsageRequestBuilder instantiates a new ItemItemActionsCacheUsageRequestBuilder and sets the default values. +func NewItemItemActionsCacheUsageRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCacheUsageRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsCacheUsageRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets GitHub Actions cache usage for a repository.The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.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 ActionsCacheUsageByRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository +func (m *ItemItemActionsCacheUsageRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsCacheUsageByRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsCacheUsageByRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsCacheUsageByRepositoryable), nil +} +// ToGetRequestInformation gets GitHub Actions cache usage for a repository.The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsCacheUsageRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsCacheUsageRequestBuilder when successful +func (m *ItemItemActionsCacheUsageRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsCacheUsageRequestBuilder) { + return NewItemItemActionsCacheUsageRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_caches_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_caches_request_builder.go new file mode 100644 index 000000000..9971e2cf2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_caches_request_builder.go @@ -0,0 +1,118 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i3a298556069ace403d8f25ad8fc9a71cfb502c817e6b3784c90f44e6250cae51 "github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/caches" +) + +// ItemItemActionsCachesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\caches +type ItemItemActionsCachesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsCachesRequestBuilderDeleteQueryParameters deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemActionsCachesRequestBuilderDeleteQueryParameters struct { + // A key for identifying the cache. + Key *string `uriparametername:"key"` + // The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. + Ref *string `uriparametername:"ref"` +} +// ItemItemActionsCachesRequestBuilderGetQueryParameters lists the GitHub Actions caches for a repository.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemActionsCachesRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i3a298556069ace403d8f25ad8fc9a71cfb502c817e6b3784c90f44e6250cae51.GetDirectionQueryParameterType `uriparametername:"direction"` + // An explicit key or prefix for identifying the cache + Key *string `uriparametername:"key"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. + Ref *string `uriparametername:"ref"` + // The property to sort the results by. `created_at` means when the cache was created. `last_accessed_at` means when the cache was last accessed. `size_in_bytes` is the size of the cache in bytes. + Sort *i3a298556069ace403d8f25ad8fc9a71cfb502c817e6b3784c90f44e6250cae51.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByCache_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.actions.caches.item collection +// returns a *ItemItemActionsCachesWithCache_ItemRequestBuilder when successful +func (m *ItemItemActionsCachesRequestBuilder) ByCache_id(cache_id int32)(*ItemItemActionsCachesWithCache_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["cache_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(cache_id), 10) + return NewItemItemActionsCachesWithCache_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsCachesRequestBuilderInternal instantiates a new ItemItemActionsCachesRequestBuilder and sets the default values. +func NewItemItemActionsCachesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCachesRequestBuilder) { + m := &ItemItemActionsCachesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/caches{?direction*,key*,page*,per_page*,ref*,sort*}", pathParameters), + } + return m +} +// NewItemItemActionsCachesRequestBuilder instantiates a new ItemItemActionsCachesRequestBuilder and sets the default values. +func NewItemItemActionsCachesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCachesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsCachesRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsCacheListable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key +func (m *ItemItemActionsCachesRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsCachesRequestBuilderDeleteQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsCacheListable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsCacheListFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsCacheListable), nil +} +// Get lists the GitHub Actions caches for a repository.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsCacheListable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository +func (m *ItemItemActionsCachesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsCachesRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsCacheListable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsCacheListFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsCacheListable), nil +} +// ToDeleteRequestInformation deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsCachesRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsCachesRequestBuilderDeleteQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/caches?key={key}{&ref*}", m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation lists the GitHub Actions caches for a repository.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsCachesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsCachesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsCachesRequestBuilder when successful +func (m *ItemItemActionsCachesRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsCachesRequestBuilder) { + return NewItemItemActionsCachesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_caches_with_cache_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_caches_with_cache_item_request_builder.go new file mode 100644 index 000000000..1b44ead76 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_caches_with_cache_item_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsCachesWithCache_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\caches\{cache_id} +type ItemItemActionsCachesWithCache_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsCachesWithCache_ItemRequestBuilderInternal instantiates a new ItemItemActionsCachesWithCache_ItemRequestBuilder and sets the default values. +func NewItemItemActionsCachesWithCache_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCachesWithCache_ItemRequestBuilder) { + m := &ItemItemActionsCachesWithCache_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/caches/{cache_id}", pathParameters), + } + return m +} +// NewItemItemActionsCachesWithCache_ItemRequestBuilder instantiates a new ItemItemActionsCachesWithCache_ItemRequestBuilder and sets the default values. +func NewItemItemActionsCachesWithCache_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCachesWithCache_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsCachesWithCache_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a GitHub Actions cache for a repository, using a cache ID.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id +func (m *ItemItemActionsCachesWithCache_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation deletes a GitHub Actions cache for a repository, using a cache ID.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsCachesWithCache_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsCachesWithCache_ItemRequestBuilder when successful +func (m *ItemItemActionsCachesWithCache_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsCachesWithCache_ItemRequestBuilder) { + return NewItemItemActionsCachesWithCache_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_jobs_item_logs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_jobs_item_logs_request_builder.go new file mode 100644 index 000000000..ed5e38e4a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_jobs_item_logs_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsJobsItemLogsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\jobs\{job_id}\logs +type ItemItemActionsJobsItemLogsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsJobsItemLogsRequestBuilderInternal instantiates a new ItemItemActionsJobsItemLogsRequestBuilder and sets the default values. +func NewItemItemActionsJobsItemLogsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsJobsItemLogsRequestBuilder) { + m := &ItemItemActionsJobsItemLogsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/jobs/{job_id}/logs", pathParameters), + } + return m +} +// NewItemItemActionsJobsItemLogsRequestBuilder instantiates a new ItemItemActionsJobsItemLogsRequestBuilder and sets the default values. +func NewItemItemActionsJobsItemLogsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsJobsItemLogsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + 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. +// [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])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + 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 +func (m *ItemItemActionsJobsItemLogsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsJobsItemLogsRequestBuilder when successful +func (m *ItemItemActionsJobsItemLogsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsJobsItemLogsRequestBuilder) { + return NewItemItemActionsJobsItemLogsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_jobs_item_rerun_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_jobs_item_rerun_post_request_body.go new file mode 100644 index 000000000..317ac7a35 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_jobs_item_rerun_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsJobsItemRerunPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether to enable debug logging for the re-run. + enable_debug_logging *bool +} +// NewItemItemActionsJobsItemRerunPostRequestBody instantiates a new ItemItemActionsJobsItemRerunPostRequestBody and sets the default values. +func NewItemItemActionsJobsItemRerunPostRequestBody()(*ItemItemActionsJobsItemRerunPostRequestBody) { + m := &ItemItemActionsJobsItemRerunPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsJobsItemRerunPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsJobsItemRerunPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsJobsItemRerunPostRequestBody(), 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 *ItemItemActionsJobsItemRerunPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnableDebugLogging gets the enable_debug_logging property value. Whether to enable debug logging for the re-run. +// returns a *bool when successful +func (m *ItemItemActionsJobsItemRerunPostRequestBody) GetEnableDebugLogging()(*bool) { + return m.enable_debug_logging +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsJobsItemRerunPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enable_debug_logging"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnableDebugLogging(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemActionsJobsItemRerunPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enable_debug_logging", m.GetEnableDebugLogging()) + 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 *ItemItemActionsJobsItemRerunPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnableDebugLogging sets the enable_debug_logging property value. Whether to enable debug logging for the re-run. +func (m *ItemItemActionsJobsItemRerunPostRequestBody) SetEnableDebugLogging(value *bool)() { + m.enable_debug_logging = value +} +type ItemItemActionsJobsItemRerunPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnableDebugLogging()(*bool) + SetEnableDebugLogging(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_jobs_item_rerun_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_jobs_item_rerun_request_builder.go new file mode 100644 index 000000000..fc595b5b9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_jobs_item_rerun_request_builder.go @@ -0,0 +1,65 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsJobsItemRerunRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\jobs\{job_id}\rerun +type ItemItemActionsJobsItemRerunRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsJobsItemRerunRequestBuilderInternal instantiates a new ItemItemActionsJobsItemRerunRequestBuilder and sets the default values. +func NewItemItemActionsJobsItemRerunRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsJobsItemRerunRequestBuilder) { + m := &ItemItemActionsJobsItemRerunRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/jobs/{job_id}/rerun", pathParameters), + } + return m +} +// NewItemItemActionsJobsItemRerunRequestBuilder instantiates a new ItemItemActionsJobsItemRerunRequestBuilder and sets the default values. +func NewItemItemActionsJobsItemRerunRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsJobsItemRerunRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsJobsItemRerunRequestBuilderInternal(urlParams, requestAdapter) +} +// Post re-run a job and its dependent jobs in a workflow run.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run +func (m *ItemItemActionsJobsItemRerunRequestBuilder) Post(ctx context.Context, body ItemItemActionsJobsItemRerunPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToPostRequestInformation re-run a job and its dependent jobs in a workflow run.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsJobsItemRerunRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemActionsJobsItemRerunPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsJobsItemRerunRequestBuilder when successful +func (m *ItemItemActionsJobsItemRerunRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsJobsItemRerunRequestBuilder) { + return NewItemItemActionsJobsItemRerunRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_jobs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_jobs_request_builder.go new file mode 100644 index 000000000..1716dc5ef --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_jobs_request_builder.go @@ -0,0 +1,34 @@ +package repos + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsJobsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\jobs +type ItemItemActionsJobsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByJob_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.actions.jobs.item collection +// returns a *ItemItemActionsJobsWithJob_ItemRequestBuilder when successful +func (m *ItemItemActionsJobsRequestBuilder) ByJob_id(job_id int32)(*ItemItemActionsJobsWithJob_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["job_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(job_id), 10) + return NewItemItemActionsJobsWithJob_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsJobsRequestBuilderInternal instantiates a new ItemItemActionsJobsRequestBuilder and sets the default values. +func NewItemItemActionsJobsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsJobsRequestBuilder) { + m := &ItemItemActionsJobsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/jobs", pathParameters), + } + return m +} +// NewItemItemActionsJobsRequestBuilder instantiates a new ItemItemActionsJobsRequestBuilder and sets the default values. +func NewItemItemActionsJobsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsJobsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsJobsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_jobs_with_job_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_jobs_with_job_item_request_builder.go new file mode 100644 index 000000000..8dee16ecc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_jobs_with_job_item_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsJobsWithJob_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\jobs\{job_id} +type ItemItemActionsJobsWithJob_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsJobsWithJob_ItemRequestBuilderInternal instantiates a new ItemItemActionsJobsWithJob_ItemRequestBuilder and sets the default values. +func NewItemItemActionsJobsWithJob_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsJobsWithJob_ItemRequestBuilder) { + m := &ItemItemActionsJobsWithJob_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/jobs/{job_id}", pathParameters), + } + return m +} +// NewItemItemActionsJobsWithJob_ItemRequestBuilder instantiates a new ItemItemActionsJobsWithJob_ItemRequestBuilder and sets the default values. +func NewItemItemActionsJobsWithJob_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsJobsWithJob_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsJobsWithJob_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a specific job in a workflow run.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 Jobable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run +func (m *ItemItemActionsJobsWithJob_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Jobable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateJobFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Jobable), nil +} +// Logs the logs property +// returns a *ItemItemActionsJobsItemLogsRequestBuilder when successful +func (m *ItemItemActionsJobsWithJob_ItemRequestBuilder) Logs()(*ItemItemActionsJobsItemLogsRequestBuilder) { + return NewItemItemActionsJobsItemLogsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rerun the rerun property +// returns a *ItemItemActionsJobsItemRerunRequestBuilder when successful +func (m *ItemItemActionsJobsWithJob_ItemRequestBuilder) Rerun()(*ItemItemActionsJobsItemRerunRequestBuilder) { + return NewItemItemActionsJobsItemRerunRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation gets a specific job in a workflow run.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsJobsWithJob_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsJobsWithJob_ItemRequestBuilder when successful +func (m *ItemItemActionsJobsWithJob_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsJobsWithJob_ItemRequestBuilder) { + return NewItemItemActionsJobsWithJob_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_oidc_customization_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_oidc_customization_request_builder.go new file mode 100644 index 000000000..add4b8647 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_oidc_customization_request_builder.go @@ -0,0 +1,28 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsOidcCustomizationRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\oidc\customization +type ItemItemActionsOidcCustomizationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsOidcCustomizationRequestBuilderInternal instantiates a new ItemItemActionsOidcCustomizationRequestBuilder and sets the default values. +func NewItemItemActionsOidcCustomizationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOidcCustomizationRequestBuilder) { + m := &ItemItemActionsOidcCustomizationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/oidc/customization", pathParameters), + } + return m +} +// NewItemItemActionsOidcCustomizationRequestBuilder instantiates a new ItemItemActionsOidcCustomizationRequestBuilder and sets the default values. +func NewItemItemActionsOidcCustomizationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOidcCustomizationRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsOidcCustomizationRequestBuilderInternal(urlParams, requestAdapter) +} +// Sub the sub property +// returns a *ItemItemActionsOidcCustomizationSubRequestBuilder when successful +func (m *ItemItemActionsOidcCustomizationRequestBuilder) Sub()(*ItemItemActionsOidcCustomizationSubRequestBuilder) { + return NewItemItemActionsOidcCustomizationSubRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_oidc_customization_sub_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_oidc_customization_sub_put_request_body.go new file mode 100644 index 000000000..bc19ea6a1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_oidc_customization_sub_put_request_body.go @@ -0,0 +1,116 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsOidcCustomizationSubPutRequestBody actions OIDC subject customization for a repository +type ItemItemActionsOidcCustomizationSubPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. + include_claim_keys []string + // Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. + use_default *bool +} +// NewItemItemActionsOidcCustomizationSubPutRequestBody instantiates a new ItemItemActionsOidcCustomizationSubPutRequestBody and sets the default values. +func NewItemItemActionsOidcCustomizationSubPutRequestBody()(*ItemItemActionsOidcCustomizationSubPutRequestBody) { + m := &ItemItemActionsOidcCustomizationSubPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsOidcCustomizationSubPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsOidcCustomizationSubPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsOidcCustomizationSubPutRequestBody(), 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 *ItemItemActionsOidcCustomizationSubPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsOidcCustomizationSubPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["include_claim_keys"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetIncludeClaimKeys(res) + } + return nil + } + res["use_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseDefault(val) + } + return nil + } + return res +} +// GetIncludeClaimKeys gets the include_claim_keys property value. Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. +// returns a []string when successful +func (m *ItemItemActionsOidcCustomizationSubPutRequestBody) GetIncludeClaimKeys()([]string) { + return m.include_claim_keys +} +// GetUseDefault gets the use_default property value. Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. +// returns a *bool when successful +func (m *ItemItemActionsOidcCustomizationSubPutRequestBody) GetUseDefault()(*bool) { + return m.use_default +} +// Serialize serializes information the current object +func (m *ItemItemActionsOidcCustomizationSubPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIncludeClaimKeys() != nil { + err := writer.WriteCollectionOfStringValues("include_claim_keys", m.GetIncludeClaimKeys()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_default", m.GetUseDefault()) + 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 *ItemItemActionsOidcCustomizationSubPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncludeClaimKeys sets the include_claim_keys property value. Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. +func (m *ItemItemActionsOidcCustomizationSubPutRequestBody) SetIncludeClaimKeys(value []string)() { + m.include_claim_keys = value +} +// SetUseDefault sets the use_default property value. Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. +func (m *ItemItemActionsOidcCustomizationSubPutRequestBody) SetUseDefault(value *bool)() { + m.use_default = value +} +type ItemItemActionsOidcCustomizationSubPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncludeClaimKeys()([]string) + GetUseDefault()(*bool) + SetIncludeClaimKeys(value []string)() + SetUseDefault(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_oidc_customization_sub_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_oidc_customization_sub_request_builder.go new file mode 100644 index 000000000..003d677f9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_oidc_customization_sub_request_builder.go @@ -0,0 +1,102 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsOidcCustomizationSubRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\oidc\customization\sub +type ItemItemActionsOidcCustomizationSubRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsOidcCustomizationSubRequestBuilderInternal instantiates a new ItemItemActionsOidcCustomizationSubRequestBuilder and sets the default values. +func NewItemItemActionsOidcCustomizationSubRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOidcCustomizationSubRequestBuilder) { + m := &ItemItemActionsOidcCustomizationSubRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/oidc/customization/sub", pathParameters), + } + return m +} +// NewItemItemActionsOidcCustomizationSubRequestBuilder instantiates a new ItemItemActionsOidcCustomizationSubRequestBuilder and sets the default values. +func NewItemItemActionsOidcCustomizationSubRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOidcCustomizationSubRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsOidcCustomizationSubRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the customization template for an OpenID Connect (OIDC) subject claim.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a OidcCustomSubRepoable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository +func (m *ItemItemActionsOidcCustomizationSubRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OidcCustomSubRepoable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOidcCustomSubRepoFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OidcCustomSubRepoable), nil +} +// Put sets the customization template and `opt-in` or `opt-out` flag for an OpenID Connect (OIDC) subject claim for a repository.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository +func (m *ItemItemActionsOidcCustomizationSubRequestBuilder) Put(ctx context.Context, body ItemItemActionsOidcCustomizationSubPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToGetRequestInformation gets the customization template for an OpenID Connect (OIDC) subject claim.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsOidcCustomizationSubRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation sets the customization template and `opt-in` or `opt-out` flag for an OpenID Connect (OIDC) subject claim for a repository.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsOidcCustomizationSubRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemActionsOidcCustomizationSubPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsOidcCustomizationSubRequestBuilder when successful +func (m *ItemItemActionsOidcCustomizationSubRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsOidcCustomizationSubRequestBuilder) { + return NewItemItemActionsOidcCustomizationSubRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_oidc_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_oidc_request_builder.go new file mode 100644 index 000000000..c98d18aef --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_oidc_request_builder.go @@ -0,0 +1,28 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsOidcRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\oidc +type ItemItemActionsOidcRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsOidcRequestBuilderInternal instantiates a new ItemItemActionsOidcRequestBuilder and sets the default values. +func NewItemItemActionsOidcRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOidcRequestBuilder) { + m := &ItemItemActionsOidcRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/oidc", pathParameters), + } + return m +} +// NewItemItemActionsOidcRequestBuilder instantiates a new ItemItemActionsOidcRequestBuilder and sets the default values. +func NewItemItemActionsOidcRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOidcRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsOidcRequestBuilderInternal(urlParams, requestAdapter) +} +// Customization the customization property +// returns a *ItemItemActionsOidcCustomizationRequestBuilder when successful +func (m *ItemItemActionsOidcRequestBuilder) Customization()(*ItemItemActionsOidcCustomizationRequestBuilder) { + return NewItemItemActionsOidcCustomizationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_secrets_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_secrets_get_response.go new file mode 100644 index 000000000..3fd429741 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_secrets_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsOrganizationSecretsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The secrets property + secrets []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable + // The total_count property + total_count *int32 +} +// NewItemItemActionsOrganizationSecretsGetResponse instantiates a new ItemItemActionsOrganizationSecretsGetResponse and sets the default values. +func NewItemItemActionsOrganizationSecretsGetResponse()(*ItemItemActionsOrganizationSecretsGetResponse) { + m := &ItemItemActionsOrganizationSecretsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsOrganizationSecretsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsOrganizationSecretsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsOrganizationSecretsGetResponse(), 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 *ItemItemActionsOrganizationSecretsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsOrganizationSecretsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsSecretFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable) + } + } + m.SetSecrets(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetSecrets gets the secrets property value. The secrets property +// returns a []ActionsSecretable when successful +func (m *ItemItemActionsOrganizationSecretsGetResponse) GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable) { + return m.secrets +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsOrganizationSecretsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsOrganizationSecretsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecrets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSecrets())) + for i, v := range m.GetSecrets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("secrets", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsOrganizationSecretsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSecrets sets the secrets property value. The secrets property +func (m *ItemItemActionsOrganizationSecretsGetResponse) SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable)() { + m.secrets = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsOrganizationSecretsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsOrganizationSecretsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable) + GetTotalCount()(*int32) + SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_secrets_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_secrets_request_builder.go new file mode 100644 index 000000000..d407b5db7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_secrets_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsOrganizationSecretsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\organization-secrets +type ItemItemActionsOrganizationSecretsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsOrganizationSecretsRequestBuilderGetQueryParameters lists all organization secrets shared with a repository without revealing their encryptedvalues.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemActionsOrganizationSecretsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemActionsOrganizationSecretsRequestBuilderInternal instantiates a new ItemItemActionsOrganizationSecretsRequestBuilder and sets the default values. +func NewItemItemActionsOrganizationSecretsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOrganizationSecretsRequestBuilder) { + m := &ItemItemActionsOrganizationSecretsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/organization-secrets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsOrganizationSecretsRequestBuilder instantiates a new ItemItemActionsOrganizationSecretsRequestBuilder and sets the default values. +func NewItemItemActionsOrganizationSecretsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOrganizationSecretsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsOrganizationSecretsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all organization secrets shared with a repository without revealing their encryptedvalues.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsOrganizationSecretsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#list-repository-organization-secrets +func (m *ItemItemActionsOrganizationSecretsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsOrganizationSecretsRequestBuilderGetQueryParameters])(ItemItemActionsOrganizationSecretsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsOrganizationSecretsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsOrganizationSecretsGetResponseable), nil +} +// ToGetRequestInformation lists all organization secrets shared with a repository without revealing their encryptedvalues.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsOrganizationSecretsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsOrganizationSecretsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsOrganizationSecretsRequestBuilder when successful +func (m *ItemItemActionsOrganizationSecretsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsOrganizationSecretsRequestBuilder) { + return NewItemItemActionsOrganizationSecretsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_secrets_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_secrets_response.go new file mode 100644 index 000000000..494c7e8a2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_secrets_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsOrganizationSecretsResponse +// Deprecated: This class is obsolete. Use organizationSecretsGetResponse instead. +type ItemItemActionsOrganizationSecretsResponse struct { + ItemItemActionsOrganizationSecretsGetResponse +} +// NewItemItemActionsOrganizationSecretsResponse instantiates a new ItemItemActionsOrganizationSecretsResponse and sets the default values. +func NewItemItemActionsOrganizationSecretsResponse()(*ItemItemActionsOrganizationSecretsResponse) { + m := &ItemItemActionsOrganizationSecretsResponse{ + ItemItemActionsOrganizationSecretsGetResponse: *NewItemItemActionsOrganizationSecretsGetResponse(), + } + return m +} +// CreateItemItemActionsOrganizationSecretsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemActionsOrganizationSecretsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsOrganizationSecretsResponse(), nil +} +// ItemItemActionsOrganizationSecretsResponseable +// Deprecated: This class is obsolete. Use organizationSecretsGetResponse instead. +type ItemItemActionsOrganizationSecretsResponseable interface { + ItemItemActionsOrganizationSecretsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_variables_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_variables_get_response.go new file mode 100644 index 000000000..c6af173ba --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_variables_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsOrganizationVariablesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The total_count property + total_count *int32 + // The variables property + variables []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable +} +// NewItemItemActionsOrganizationVariablesGetResponse instantiates a new ItemItemActionsOrganizationVariablesGetResponse and sets the default values. +func NewItemItemActionsOrganizationVariablesGetResponse()(*ItemItemActionsOrganizationVariablesGetResponse) { + m := &ItemItemActionsOrganizationVariablesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsOrganizationVariablesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsOrganizationVariablesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsOrganizationVariablesGetResponse(), 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 *ItemItemActionsOrganizationVariablesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsOrganizationVariablesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + res["variables"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsVariableFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable) + } + } + m.SetVariables(res) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsOrganizationVariablesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// GetVariables gets the variables property value. The variables property +// returns a []ActionsVariableable when successful +func (m *ItemItemActionsOrganizationVariablesGetResponse) GetVariables()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable) { + return m.variables +} +// Serialize serializes information the current object +func (m *ItemItemActionsOrganizationVariablesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + if m.GetVariables() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVariables())) + for i, v := range m.GetVariables() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("variables", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsOrganizationVariablesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsOrganizationVariablesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetVariables sets the variables property value. The variables property +func (m *ItemItemActionsOrganizationVariablesGetResponse) SetVariables(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable)() { + m.variables = value +} +type ItemItemActionsOrganizationVariablesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalCount()(*int32) + GetVariables()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable) + SetTotalCount(value *int32)() + SetVariables(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_variables_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_variables_request_builder.go new file mode 100644 index 000000000..f7bfc0ab9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_variables_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsOrganizationVariablesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\organization-variables +type ItemItemActionsOrganizationVariablesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsOrganizationVariablesRequestBuilderGetQueryParameters lists all organization variables shared with a repository.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemActionsOrganizationVariablesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 30). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemActionsOrganizationVariablesRequestBuilderInternal instantiates a new ItemItemActionsOrganizationVariablesRequestBuilder and sets the default values. +func NewItemItemActionsOrganizationVariablesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOrganizationVariablesRequestBuilder) { + m := &ItemItemActionsOrganizationVariablesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/organization-variables{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsOrganizationVariablesRequestBuilder instantiates a new ItemItemActionsOrganizationVariablesRequestBuilder and sets the default values. +func NewItemItemActionsOrganizationVariablesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOrganizationVariablesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsOrganizationVariablesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all organization variables shared with a repository.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsOrganizationVariablesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#list-repository-organization-variables +func (m *ItemItemActionsOrganizationVariablesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsOrganizationVariablesRequestBuilderGetQueryParameters])(ItemItemActionsOrganizationVariablesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsOrganizationVariablesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsOrganizationVariablesGetResponseable), nil +} +// ToGetRequestInformation lists all organization variables shared with a repository.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsOrganizationVariablesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsOrganizationVariablesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsOrganizationVariablesRequestBuilder when successful +func (m *ItemItemActionsOrganizationVariablesRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsOrganizationVariablesRequestBuilder) { + return NewItemItemActionsOrganizationVariablesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_variables_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_variables_response.go new file mode 100644 index 000000000..c2df12664 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_organization_variables_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsOrganizationVariablesResponse +// Deprecated: This class is obsolete. Use organizationVariablesGetResponse instead. +type ItemItemActionsOrganizationVariablesResponse struct { + ItemItemActionsOrganizationVariablesGetResponse +} +// NewItemItemActionsOrganizationVariablesResponse instantiates a new ItemItemActionsOrganizationVariablesResponse and sets the default values. +func NewItemItemActionsOrganizationVariablesResponse()(*ItemItemActionsOrganizationVariablesResponse) { + m := &ItemItemActionsOrganizationVariablesResponse{ + ItemItemActionsOrganizationVariablesGetResponse: *NewItemItemActionsOrganizationVariablesGetResponse(), + } + return m +} +// CreateItemItemActionsOrganizationVariablesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemActionsOrganizationVariablesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsOrganizationVariablesResponse(), nil +} +// ItemItemActionsOrganizationVariablesResponseable +// Deprecated: This class is obsolete. Use organizationVariablesGetResponse instead. +type ItemItemActionsOrganizationVariablesResponseable interface { + ItemItemActionsOrganizationVariablesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_permissions_access_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_permissions_access_request_builder.go new file mode 100644 index 000000000..4961a1c42 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_permissions_access_request_builder.go @@ -0,0 +1,83 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsPermissionsAccessRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\permissions\access +type ItemItemActionsPermissionsAccessRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsPermissionsAccessRequestBuilderInternal instantiates a new ItemItemActionsPermissionsAccessRequestBuilder and sets the default values. +func NewItemItemActionsPermissionsAccessRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsPermissionsAccessRequestBuilder) { + m := &ItemItemActionsPermissionsAccessRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/permissions/access", pathParameters), + } + return m +} +// NewItemItemActionsPermissionsAccessRequestBuilder instantiates a new ItemItemActionsPermissionsAccessRequestBuilder and sets the default values. +func NewItemItemActionsPermissionsAccessRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsPermissionsAccessRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsPermissionsAccessRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository.This endpoint only applies to private repositories.For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsWorkflowAccessToRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository +func (m *ItemItemActionsPermissionsAccessRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsWorkflowAccessToRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsWorkflowAccessToRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsWorkflowAccessToRepositoryable), nil +} +// Put sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository.This endpoint only applies to private repositories.For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)".OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository +func (m *ItemItemActionsPermissionsAccessRequestBuilder) Put(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsWorkflowAccessToRepositoryable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository.This endpoint only applies to private repositories.For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsPermissionsAccessRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository.This endpoint only applies to private repositories.For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)".OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsPermissionsAccessRequestBuilder) ToPutRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsWorkflowAccessToRepositoryable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsPermissionsAccessRequestBuilder when successful +func (m *ItemItemActionsPermissionsAccessRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsPermissionsAccessRequestBuilder) { + return NewItemItemActionsPermissionsAccessRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_permissions_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_permissions_put_request_body.go new file mode 100644 index 000000000..3eab33d5c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_permissions_put_request_body.go @@ -0,0 +1,111 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsPermissionsPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The permissions policy that controls the actions and reusable workflows that are allowed to run. + allowed_actions *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AllowedActions + // Whether GitHub Actions is enabled on the repository. + enabled *bool +} +// NewItemItemActionsPermissionsPutRequestBody instantiates a new ItemItemActionsPermissionsPutRequestBody and sets the default values. +func NewItemItemActionsPermissionsPutRequestBody()(*ItemItemActionsPermissionsPutRequestBody) { + m := &ItemItemActionsPermissionsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsPermissionsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsPermissionsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsPermissionsPutRequestBody(), 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 *ItemItemActionsPermissionsPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowedActions gets the allowed_actions property value. The permissions policy that controls the actions and reusable workflows that are allowed to run. +// returns a *AllowedActions when successful +func (m *ItemItemActionsPermissionsPutRequestBody) GetAllowedActions()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AllowedActions) { + return m.allowed_actions +} +// GetEnabled gets the enabled property value. Whether GitHub Actions is enabled on the repository. +// returns a *bool when successful +func (m *ItemItemActionsPermissionsPutRequestBody) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsPermissionsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allowed_actions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ParseAllowedActions) + if err != nil { + return err + } + if val != nil { + m.SetAllowedActions(val.(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AllowedActions)) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemActionsPermissionsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAllowedActions() != nil { + cast := (*m.GetAllowedActions()).String() + err := writer.WriteStringValue("allowed_actions", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsPermissionsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowedActions sets the allowed_actions property value. The permissions policy that controls the actions and reusable workflows that are allowed to run. +func (m *ItemItemActionsPermissionsPutRequestBody) SetAllowedActions(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AllowedActions)() { + m.allowed_actions = value +} +// SetEnabled sets the enabled property value. Whether GitHub Actions is enabled on the repository. +func (m *ItemItemActionsPermissionsPutRequestBody) SetEnabled(value *bool)() { + m.enabled = value +} +type ItemItemActionsPermissionsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowedActions()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AllowedActions) + GetEnabled()(*bool) + SetAllowedActions(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AllowedActions)() + SetEnabled(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_permissions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_permissions_request_builder.go new file mode 100644 index 000000000..fe1de8cc0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_permissions_request_builder.go @@ -0,0 +1,98 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsPermissionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\permissions +type ItemItemActionsPermissionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Access the access property +// returns a *ItemItemActionsPermissionsAccessRequestBuilder when successful +func (m *ItemItemActionsPermissionsRequestBuilder) Access()(*ItemItemActionsPermissionsAccessRequestBuilder) { + return NewItemItemActionsPermissionsAccessRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsPermissionsRequestBuilderInternal instantiates a new ItemItemActionsPermissionsRequestBuilder and sets the default values. +func NewItemItemActionsPermissionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsPermissionsRequestBuilder) { + m := &ItemItemActionsPermissionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/permissions", pathParameters), + } + return m +} +// NewItemItemActionsPermissionsRequestBuilder instantiates a new ItemItemActionsPermissionsRequestBuilder and sets the default values. +func NewItemItemActionsPermissionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsPermissionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsPermissionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions and reusable workflows allowed to run in the repository.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsRepositoryPermissionsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository +func (m *ItemItemActionsPermissionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsRepositoryPermissionsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsRepositoryPermissionsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsRepositoryPermissionsable), nil +} +// Put sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository +func (m *ItemItemActionsPermissionsRequestBuilder) Put(ctx context.Context, body ItemItemActionsPermissionsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// SelectedActions the selectedActions property +// returns a *ItemItemActionsPermissionsSelectedActionsRequestBuilder when successful +func (m *ItemItemActionsPermissionsRequestBuilder) SelectedActions()(*ItemItemActionsPermissionsSelectedActionsRequestBuilder) { + return NewItemItemActionsPermissionsSelectedActionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions and reusable workflows allowed to run in the repository.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsPermissionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsPermissionsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemActionsPermissionsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsPermissionsRequestBuilder when successful +func (m *ItemItemActionsPermissionsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsPermissionsRequestBuilder) { + return NewItemItemActionsPermissionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} +// Workflow the workflow property +// returns a *ItemItemActionsPermissionsWorkflowRequestBuilder when successful +func (m *ItemItemActionsPermissionsRequestBuilder) Workflow()(*ItemItemActionsPermissionsWorkflowRequestBuilder) { + return NewItemItemActionsPermissionsWorkflowRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_permissions_selected_actions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_permissions_selected_actions_request_builder.go new file mode 100644 index 000000000..da8a91a4f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_permissions_selected_actions_request_builder.go @@ -0,0 +1,83 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsPermissionsSelectedActionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\permissions\selected-actions +type ItemItemActionsPermissionsSelectedActionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsPermissionsSelectedActionsRequestBuilderInternal instantiates a new ItemItemActionsPermissionsSelectedActionsRequestBuilder and sets the default values. +func NewItemItemActionsPermissionsSelectedActionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsPermissionsSelectedActionsRequestBuilder) { + m := &ItemItemActionsPermissionsSelectedActionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/permissions/selected-actions", pathParameters), + } + return m +} +// NewItemItemActionsPermissionsSelectedActionsRequestBuilder instantiates a new ItemItemActionsPermissionsSelectedActionsRequestBuilder and sets the default values. +func NewItemItemActionsPermissionsSelectedActionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsPermissionsSelectedActionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsPermissionsSelectedActionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the settings for selected actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)."OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a SelectedActionsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository +func (m *ItemItemActionsPermissionsSelectedActionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SelectedActionsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSelectedActionsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SelectedActionsable), nil +} +// Put sets the actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository +func (m *ItemItemActionsPermissionsSelectedActionsRequestBuilder) Put(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SelectedActionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets the settings for selected actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)."OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsPermissionsSelectedActionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation sets the actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsPermissionsSelectedActionsRequestBuilder) ToPutRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SelectedActionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsPermissionsSelectedActionsRequestBuilder when successful +func (m *ItemItemActionsPermissionsSelectedActionsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsPermissionsSelectedActionsRequestBuilder) { + return NewItemItemActionsPermissionsSelectedActionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_permissions_workflow_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_permissions_workflow_request_builder.go new file mode 100644 index 000000000..ff26cb02b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_permissions_workflow_request_builder.go @@ -0,0 +1,83 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsPermissionsWorkflowRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\permissions\workflow +type ItemItemActionsPermissionsWorkflowRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsPermissionsWorkflowRequestBuilderInternal instantiates a new ItemItemActionsPermissionsWorkflowRequestBuilder and sets the default values. +func NewItemItemActionsPermissionsWorkflowRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsPermissionsWorkflowRequestBuilder) { + m := &ItemItemActionsPermissionsWorkflowRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/permissions/workflow", pathParameters), + } + return m +} +// NewItemItemActionsPermissionsWorkflowRequestBuilder instantiates a new ItemItemActionsPermissionsWorkflowRequestBuilder and sets the default values. +func NewItemItemActionsPermissionsWorkflowRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsPermissionsWorkflowRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsPermissionsWorkflowRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository,as well as if GitHub Actions can submit approving pull request reviews.For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)."OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsGetDefaultWorkflowPermissionsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-a-repository +func (m *ItemItemActionsPermissionsWorkflowRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsGetDefaultWorkflowPermissionsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsGetDefaultWorkflowPermissionsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsGetDefaultWorkflowPermissionsable), nil +} +// Put sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository, and sets if GitHub Actionscan submit approving pull request reviews.For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-a-repository +func (m *ItemItemActionsPermissionsWorkflowRequestBuilder) Put(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSetDefaultWorkflowPermissionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository,as well as if GitHub Actions can submit approving pull request reviews.For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)."OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsPermissionsWorkflowRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository, and sets if GitHub Actionscan submit approving pull request reviews.For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsPermissionsWorkflowRequestBuilder) ToPutRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSetDefaultWorkflowPermissionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsPermissionsWorkflowRequestBuilder when successful +func (m *ItemItemActionsPermissionsWorkflowRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsPermissionsWorkflowRequestBuilder) { + return NewItemItemActionsPermissionsWorkflowRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_request_builder.go new file mode 100644 index 000000000..4c44cdde4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_request_builder.go @@ -0,0 +1,88 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions +type ItemItemActionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Artifacts the artifacts property +// returns a *ItemItemActionsArtifactsRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Artifacts()(*ItemItemActionsArtifactsRequestBuilder) { + return NewItemItemActionsArtifactsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Cache the cache property +// returns a *ItemItemActionsCacheRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Cache()(*ItemItemActionsCacheRequestBuilder) { + return NewItemItemActionsCacheRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Caches the caches property +// returns a *ItemItemActionsCachesRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Caches()(*ItemItemActionsCachesRequestBuilder) { + return NewItemItemActionsCachesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsRequestBuilderInternal instantiates a new ItemItemActionsRequestBuilder and sets the default values. +func NewItemItemActionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRequestBuilder) { + m := &ItemItemActionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions", pathParameters), + } + return m +} +// NewItemItemActionsRequestBuilder instantiates a new ItemItemActionsRequestBuilder and sets the default values. +func NewItemItemActionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Jobs the jobs property +// returns a *ItemItemActionsJobsRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Jobs()(*ItemItemActionsJobsRequestBuilder) { + return NewItemItemActionsJobsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Oidc the oidc property +// returns a *ItemItemActionsOidcRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Oidc()(*ItemItemActionsOidcRequestBuilder) { + return NewItemItemActionsOidcRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// OrganizationSecrets the organizationSecrets property +// returns a *ItemItemActionsOrganizationSecretsRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) OrganizationSecrets()(*ItemItemActionsOrganizationSecretsRequestBuilder) { + return NewItemItemActionsOrganizationSecretsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// OrganizationVariables the organizationVariables property +// returns a *ItemItemActionsOrganizationVariablesRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) OrganizationVariables()(*ItemItemActionsOrganizationVariablesRequestBuilder) { + return NewItemItemActionsOrganizationVariablesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Permissions the permissions property +// returns a *ItemItemActionsPermissionsRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Permissions()(*ItemItemActionsPermissionsRequestBuilder) { + return NewItemItemActionsPermissionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Runners the runners property +// returns a *ItemItemActionsRunnersRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Runners()(*ItemItemActionsRunnersRequestBuilder) { + return NewItemItemActionsRunnersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Runs the runs property +// returns a *ItemItemActionsRunsRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Runs()(*ItemItemActionsRunsRequestBuilder) { + return NewItemItemActionsRunsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Secrets the secrets property +// returns a *ItemItemActionsSecretsRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Secrets()(*ItemItemActionsSecretsRequestBuilder) { + return NewItemItemActionsSecretsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Variables the variables property +// returns a *ItemItemActionsVariablesRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Variables()(*ItemItemActionsVariablesRequestBuilder) { + return NewItemItemActionsVariablesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Workflows the workflows property +// returns a *ItemItemActionsWorkflowsRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Workflows()(*ItemItemActionsWorkflowsRequestBuilder) { + return NewItemItemActionsWorkflowsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_downloads_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_downloads_request_builder.go new file mode 100644 index 000000000..9509c8ee9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_downloads_request_builder.go @@ -0,0 +1,60 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunnersDownloadsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runners\downloads +type ItemItemActionsRunnersDownloadsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunnersDownloadsRequestBuilderInternal instantiates a new ItemItemActionsRunnersDownloadsRequestBuilder and sets the default values. +func NewItemItemActionsRunnersDownloadsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersDownloadsRequestBuilder) { + m := &ItemItemActionsRunnersDownloadsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runners/downloads", pathParameters), + } + return m +} +// NewItemItemActionsRunnersDownloadsRequestBuilder instantiates a new ItemItemActionsRunnersDownloadsRequestBuilder and sets the default values. +func NewItemItemActionsRunnersDownloadsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersDownloadsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunnersDownloadsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists binaries for the runner application that you can download and run.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a []RunnerApplicationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository +func (m *ItemItemActionsRunnersDownloadsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerApplicationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerApplicationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerApplicationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerApplicationable) + } + } + return val, nil +} +// ToGetRequestInformation lists binaries for the runner application that you can download and run.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersDownloadsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunnersDownloadsRequestBuilder when successful +func (m *ItemItemActionsRunnersDownloadsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunnersDownloadsRequestBuilder) { + return NewItemItemActionsRunnersDownloadsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_generate_jitconfig_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_generate_jitconfig_post_request_body.go new file mode 100644 index 000000000..bad5059ae --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_generate_jitconfig_post_request_body.go @@ -0,0 +1,175 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsRunnersGenerateJitconfigPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. + labels []string + // The name of the new runner. + name *string + // The ID of the runner group to register the runner to. + runner_group_id *int32 + // The working directory to be used for job execution, relative to the runner install directory. + work_folder *string +} +// NewItemItemActionsRunnersGenerateJitconfigPostRequestBody instantiates a new ItemItemActionsRunnersGenerateJitconfigPostRequestBody and sets the default values. +func NewItemItemActionsRunnersGenerateJitconfigPostRequestBody()(*ItemItemActionsRunnersGenerateJitconfigPostRequestBody) { + m := &ItemItemActionsRunnersGenerateJitconfigPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + work_folderValue := "_work" + m.SetWorkFolder(&work_folderValue) + return m +} +// CreateItemItemActionsRunnersGenerateJitconfigPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersGenerateJitconfigPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersGenerateJitconfigPostRequestBody(), 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 *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetLabels(res) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["runner_group_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunnerGroupId(val) + } + return nil + } + res["work_folder"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWorkFolder(val) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. +// returns a []string when successful +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) GetLabels()([]string) { + return m.labels +} +// GetName gets the name property value. The name of the new runner. +// returns a *string when successful +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) GetName()(*string) { + return m.name +} +// GetRunnerGroupId gets the runner_group_id property value. The ID of the runner group to register the runner to. +// returns a *int32 when successful +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) GetRunnerGroupId()(*int32) { + return m.runner_group_id +} +// GetWorkFolder gets the work_folder property value. The working directory to be used for job execution, relative to the runner install directory. +// returns a *string when successful +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) GetWorkFolder()(*string) { + return m.work_folder +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("runner_group_id", m.GetRunnerGroupId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("work_folder", m.GetWorkFolder()) + 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 *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) SetLabels(value []string)() { + m.labels = value +} +// SetName sets the name property value. The name of the new runner. +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetRunnerGroupId sets the runner_group_id property value. The ID of the runner group to register the runner to. +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) SetRunnerGroupId(value *int32)() { + m.runner_group_id = value +} +// SetWorkFolder sets the work_folder property value. The working directory to be used for job execution, relative to the runner install directory. +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) SetWorkFolder(value *string)() { + m.work_folder = value +} +type ItemItemActionsRunnersGenerateJitconfigPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + GetName()(*string) + GetRunnerGroupId()(*int32) + GetWorkFolder()(*string) + SetLabels(value []string)() + SetName(value *string)() + SetRunnerGroupId(value *int32)() + SetWorkFolder(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_generate_jitconfig_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_generate_jitconfig_post_response.go new file mode 100644 index 000000000..f500b2f94 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_generate_jitconfig_post_response.go @@ -0,0 +1,110 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsRunnersGenerateJitconfigPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The base64 encoded runner configuration. + encoded_jit_config *string + // A self hosted runner + runner i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable +} +// NewItemItemActionsRunnersGenerateJitconfigPostResponse instantiates a new ItemItemActionsRunnersGenerateJitconfigPostResponse and sets the default values. +func NewItemItemActionsRunnersGenerateJitconfigPostResponse()(*ItemItemActionsRunnersGenerateJitconfigPostResponse) { + m := &ItemItemActionsRunnersGenerateJitconfigPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersGenerateJitconfigPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersGenerateJitconfigPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersGenerateJitconfigPostResponse(), 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 *ItemItemActionsRunnersGenerateJitconfigPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncodedJitConfig gets the encoded_jit_config property value. The base64 encoded runner configuration. +// returns a *string when successful +func (m *ItemItemActionsRunnersGenerateJitconfigPostResponse) GetEncodedJitConfig()(*string) { + return m.encoded_jit_config +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunnersGenerateJitconfigPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["encoded_jit_config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncodedJitConfig(val) + } + return nil + } + res["runner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRunner(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable)) + } + return nil + } + return res +} +// GetRunner gets the runner property value. A self hosted runner +// returns a Runnerable when successful +func (m *ItemItemActionsRunnersGenerateJitconfigPostResponse) GetRunner()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable) { + return m.runner +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersGenerateJitconfigPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("encoded_jit_config", m.GetEncodedJitConfig()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("runner", m.GetRunner()) + 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 *ItemItemActionsRunnersGenerateJitconfigPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncodedJitConfig sets the encoded_jit_config property value. The base64 encoded runner configuration. +func (m *ItemItemActionsRunnersGenerateJitconfigPostResponse) SetEncodedJitConfig(value *string)() { + m.encoded_jit_config = value +} +// SetRunner sets the runner property value. A self hosted runner +func (m *ItemItemActionsRunnersGenerateJitconfigPostResponse) SetRunner(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable)() { + m.runner = value +} +type ItemItemActionsRunnersGenerateJitconfigPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncodedJitConfig()(*string) + GetRunner()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable) + SetEncodedJitConfig(value *string)() + SetRunner(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_generate_jitconfig_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_generate_jitconfig_request_builder.go new file mode 100644 index 000000000..c8383d28f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_generate_jitconfig_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunnersGenerateJitconfigRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runners\generate-jitconfig +type ItemItemActionsRunnersGenerateJitconfigRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunnersGenerateJitconfigRequestBuilderInternal instantiates a new ItemItemActionsRunnersGenerateJitconfigRequestBuilder and sets the default values. +func NewItemItemActionsRunnersGenerateJitconfigRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersGenerateJitconfigRequestBuilder) { + m := &ItemItemActionsRunnersGenerateJitconfigRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runners/generate-jitconfig", pathParameters), + } + return m +} +// NewItemItemActionsRunnersGenerateJitconfigRequestBuilder instantiates a new ItemItemActionsRunnersGenerateJitconfigRequestBuilder and sets the default values. +func NewItemItemActionsRunnersGenerateJitconfigRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersGenerateJitconfigRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunnersGenerateJitconfigRequestBuilderInternal(urlParams, requestAdapter) +} +// Post generates a configuration that can be passed to the runner application at startup.The authenticated user must have admin access to the repository.OAuth tokens and personal access tokens (classic) need the`repo` scope to use this endpoint. +// returns a ItemItemActionsRunnersGenerateJitconfigPostResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository +func (m *ItemItemActionsRunnersGenerateJitconfigRequestBuilder) Post(ctx context.Context, body ItemItemActionsRunnersGenerateJitconfigPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemActionsRunnersGenerateJitconfigPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunnersGenerateJitconfigPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunnersGenerateJitconfigPostResponseable), nil +} +// ToPostRequestInformation generates a configuration that can be passed to the runner application at startup.The authenticated user must have admin access to the repository.OAuth tokens and personal access tokens (classic) need the`repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersGenerateJitconfigRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemActionsRunnersGenerateJitconfigPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunnersGenerateJitconfigRequestBuilder when successful +func (m *ItemItemActionsRunnersGenerateJitconfigRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunnersGenerateJitconfigRequestBuilder) { + return NewItemItemActionsRunnersGenerateJitconfigRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_generate_jitconfig_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_generate_jitconfig_response.go new file mode 100644 index 000000000..d8a21e262 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_generate_jitconfig_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsRunnersGenerateJitconfigResponse +// Deprecated: This class is obsolete. Use generateJitconfigPostResponse instead. +type ItemItemActionsRunnersGenerateJitconfigResponse struct { + ItemItemActionsRunnersGenerateJitconfigPostResponse +} +// NewItemItemActionsRunnersGenerateJitconfigResponse instantiates a new ItemItemActionsRunnersGenerateJitconfigResponse and sets the default values. +func NewItemItemActionsRunnersGenerateJitconfigResponse()(*ItemItemActionsRunnersGenerateJitconfigResponse) { + m := &ItemItemActionsRunnersGenerateJitconfigResponse{ + ItemItemActionsRunnersGenerateJitconfigPostResponse: *NewItemItemActionsRunnersGenerateJitconfigPostResponse(), + } + return m +} +// CreateItemItemActionsRunnersGenerateJitconfigResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemActionsRunnersGenerateJitconfigResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersGenerateJitconfigResponse(), nil +} +// ItemItemActionsRunnersGenerateJitconfigResponseable +// Deprecated: This class is obsolete. Use generateJitconfigPostResponse instead. +type ItemItemActionsRunnersGenerateJitconfigResponseable interface { + ItemItemActionsRunnersGenerateJitconfigPostResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_get_response.go new file mode 100644 index 000000000..51ef1d23b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsRunnersGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The runners property + runners []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunnersGetResponse instantiates a new ItemItemActionsRunnersGetResponse and sets the default values. +func NewItemItemActionsRunnersGetResponse()(*ItemItemActionsRunnersGetResponse) { + m := &ItemItemActionsRunnersGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersGetResponse(), 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 *ItemItemActionsRunnersGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunnersGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["runners"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable) + } + } + m.SetRunners(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRunners gets the runners property value. The runners property +// returns a []Runnerable when successful +func (m *ItemItemActionsRunnersGetResponse) GetRunners()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable) { + return m.runners +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunnersGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRunners() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRunners())) + for i, v := range m.GetRunners() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("runners", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsRunnersGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRunners sets the runners property value. The runners property +func (m *ItemItemActionsRunnersGetResponse) SetRunners(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable)() { + m.runners = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunnersGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunnersGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRunners()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable) + GetTotalCount()(*int32) + SetRunners(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_delete_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_delete_response.go new file mode 100644 index 000000000..7294e974b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_delete_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsRunnersItemLabelsDeleteResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The labels property + labels []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunnersItemLabelsDeleteResponse instantiates a new ItemItemActionsRunnersItemLabelsDeleteResponse and sets the default values. +func NewItemItemActionsRunnersItemLabelsDeleteResponse()(*ItemItemActionsRunnersItemLabelsDeleteResponse) { + m := &ItemItemActionsRunnersItemLabelsDeleteResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersItemLabelsDeleteResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersItemLabelsDeleteResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersItemLabelsDeleteResponse(), 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 *ItemItemActionsRunnersItemLabelsDeleteResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunnersItemLabelsDeleteResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + } + } + m.SetLabels(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemItemActionsRunnersItemLabelsDeleteResponse) GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunnersItemLabelsDeleteResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersItemLabelsDeleteResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsRunnersItemLabelsDeleteResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemItemActionsRunnersItemLabelsDeleteResponse) SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunnersItemLabelsDeleteResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunnersItemLabelsDeleteResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_get_response.go new file mode 100644 index 000000000..0f8048d6d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsRunnersItemLabelsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The labels property + labels []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunnersItemLabelsGetResponse instantiates a new ItemItemActionsRunnersItemLabelsGetResponse and sets the default values. +func NewItemItemActionsRunnersItemLabelsGetResponse()(*ItemItemActionsRunnersItemLabelsGetResponse) { + m := &ItemItemActionsRunnersItemLabelsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersItemLabelsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersItemLabelsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersItemLabelsGetResponse(), 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 *ItemItemActionsRunnersItemLabelsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunnersItemLabelsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + } + } + m.SetLabels(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemItemActionsRunnersItemLabelsGetResponse) GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunnersItemLabelsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersItemLabelsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsRunnersItemLabelsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemItemActionsRunnersItemLabelsGetResponse) SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunnersItemLabelsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunnersItemLabelsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_item_with_name_delete_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_item_with_name_delete_response.go new file mode 100644 index 000000000..0f6eb89d1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_item_with_name_delete_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The labels property + labels []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse instantiates a new ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse and sets the default values. +func NewItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse()(*ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) { + m := &ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersItemLabelsItemWithNameDeleteResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersItemLabelsItemWithNameDeleteResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse(), 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 *ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + } + } + m.SetLabels(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_item_with_name_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_item_with_name_response.go new file mode 100644 index 000000000..40d5a2d1f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_item_with_name_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsRunnersItemLabelsItemWithNameResponse +// Deprecated: This class is obsolete. Use WithNameDeleteResponse instead. +type ItemItemActionsRunnersItemLabelsItemWithNameResponse struct { + ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse +} +// NewItemItemActionsRunnersItemLabelsItemWithNameResponse instantiates a new ItemItemActionsRunnersItemLabelsItemWithNameResponse and sets the default values. +func NewItemItemActionsRunnersItemLabelsItemWithNameResponse()(*ItemItemActionsRunnersItemLabelsItemWithNameResponse) { + m := &ItemItemActionsRunnersItemLabelsItemWithNameResponse{ + ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse: *NewItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse(), + } + return m +} +// CreateItemItemActionsRunnersItemLabelsItemWithNameResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemActionsRunnersItemLabelsItemWithNameResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersItemLabelsItemWithNameResponse(), nil +} +// ItemItemActionsRunnersItemLabelsItemWithNameResponseable +// Deprecated: This class is obsolete. Use WithNameDeleteResponse instead. +type ItemItemActionsRunnersItemLabelsItemWithNameResponseable interface { + ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_post_request_body.go new file mode 100644 index 000000000..ea0e0ffc1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_post_request_body.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsRunnersItemLabelsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The names of the custom labels to add to the runner. + labels []string +} +// NewItemItemActionsRunnersItemLabelsPostRequestBody instantiates a new ItemItemActionsRunnersItemLabelsPostRequestBody and sets the default values. +func NewItemItemActionsRunnersItemLabelsPostRequestBody()(*ItemItemActionsRunnersItemLabelsPostRequestBody) { + m := &ItemItemActionsRunnersItemLabelsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersItemLabelsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersItemLabelsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersItemLabelsPostRequestBody(), 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 *ItemItemActionsRunnersItemLabelsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunnersItemLabelsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the custom labels to add to the runner. +// returns a []string when successful +func (m *ItemItemActionsRunnersItemLabelsPostRequestBody) GetLabels()([]string) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersItemLabelsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + 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 *ItemItemActionsRunnersItemLabelsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the custom labels to add to the runner. +func (m *ItemItemActionsRunnersItemLabelsPostRequestBody) SetLabels(value []string)() { + m.labels = value +} +type ItemItemActionsRunnersItemLabelsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + SetLabels(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_post_response.go new file mode 100644 index 000000000..a48e319e4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_post_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsRunnersItemLabelsPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The labels property + labels []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunnersItemLabelsPostResponse instantiates a new ItemItemActionsRunnersItemLabelsPostResponse and sets the default values. +func NewItemItemActionsRunnersItemLabelsPostResponse()(*ItemItemActionsRunnersItemLabelsPostResponse) { + m := &ItemItemActionsRunnersItemLabelsPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersItemLabelsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersItemLabelsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersItemLabelsPostResponse(), 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 *ItemItemActionsRunnersItemLabelsPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunnersItemLabelsPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + } + } + m.SetLabels(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemItemActionsRunnersItemLabelsPostResponse) GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunnersItemLabelsPostResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersItemLabelsPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsRunnersItemLabelsPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemItemActionsRunnersItemLabelsPostResponse) SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunnersItemLabelsPostResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunnersItemLabelsPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_put_request_body.go new file mode 100644 index 000000000..561447124 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_put_request_body.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsRunnersItemLabelsPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. + labels []string +} +// NewItemItemActionsRunnersItemLabelsPutRequestBody instantiates a new ItemItemActionsRunnersItemLabelsPutRequestBody and sets the default values. +func NewItemItemActionsRunnersItemLabelsPutRequestBody()(*ItemItemActionsRunnersItemLabelsPutRequestBody) { + m := &ItemItemActionsRunnersItemLabelsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersItemLabelsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersItemLabelsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersItemLabelsPutRequestBody(), 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 *ItemItemActionsRunnersItemLabelsPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunnersItemLabelsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. +// returns a []string when successful +func (m *ItemItemActionsRunnersItemLabelsPutRequestBody) GetLabels()([]string) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersItemLabelsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + 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 *ItemItemActionsRunnersItemLabelsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. +func (m *ItemItemActionsRunnersItemLabelsPutRequestBody) SetLabels(value []string)() { + m.labels = value +} +type ItemItemActionsRunnersItemLabelsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + SetLabels(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_put_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_put_response.go new file mode 100644 index 000000000..203a1049b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_put_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsRunnersItemLabelsPutResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The labels property + labels []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunnersItemLabelsPutResponse instantiates a new ItemItemActionsRunnersItemLabelsPutResponse and sets the default values. +func NewItemItemActionsRunnersItemLabelsPutResponse()(*ItemItemActionsRunnersItemLabelsPutResponse) { + m := &ItemItemActionsRunnersItemLabelsPutResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersItemLabelsPutResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersItemLabelsPutResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersItemLabelsPutResponse(), 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 *ItemItemActionsRunnersItemLabelsPutResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunnersItemLabelsPutResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + } + } + m.SetLabels(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemItemActionsRunnersItemLabelsPutResponse) GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunnersItemLabelsPutResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersItemLabelsPutResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsRunnersItemLabelsPutResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemItemActionsRunnersItemLabelsPutResponse) SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunnersItemLabelsPutResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunnersItemLabelsPutResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_request_builder.go new file mode 100644 index 000000000..0e3805bc6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_request_builder.go @@ -0,0 +1,178 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunnersItemLabelsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runners\{runner_id}\labels +type ItemItemActionsRunnersItemLabelsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByName gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.actions.runners.item.labels.item collection +// returns a *ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) ByName(name string)(*ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewItemItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsRunnersItemLabelsRequestBuilderInternal instantiates a new ItemItemActionsRunnersItemLabelsRequestBuilder and sets the default values. +func NewItemItemActionsRunnersItemLabelsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersItemLabelsRequestBuilder) { + m := &ItemItemActionsRunnersItemLabelsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runners/{runner_id}/labels", pathParameters), + } + return m +} +// NewItemItemActionsRunnersItemLabelsRequestBuilder instantiates a new ItemItemActionsRunnersItemLabelsRequestBuilder and sets the default values. +func NewItemItemActionsRunnersItemLabelsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersItemLabelsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunnersItemLabelsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete remove all custom labels from a self-hosted runner configured in arepository. Returns the remaining read-only labels from the runner.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsRunnersItemLabelsDeleteResponseable 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/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-a-repository +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemActionsRunnersItemLabelsDeleteResponseable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunnersItemLabelsDeleteResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunnersItemLabelsDeleteResponseable), nil +} +// Get lists all labels for a self-hosted runner configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsRunnersItemLabelsGetResponseable 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/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-a-repository +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemActionsRunnersItemLabelsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunnersItemLabelsGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunnersItemLabelsGetResponseable), nil +} +// Post adds custom labels to a self-hosted runner configured in a repository.Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsRunnersItemLabelsPostResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-a-repository +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) Post(ctx context.Context, body ItemItemActionsRunnersItemLabelsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemActionsRunnersItemLabelsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunnersItemLabelsPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunnersItemLabelsPostResponseable), nil +} +// Put remove all previous custom labels and set the new custom labels for a specificself-hosted runner configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsRunnersItemLabelsPutResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-a-repository +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) Put(ctx context.Context, body ItemItemActionsRunnersItemLabelsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemActionsRunnersItemLabelsPutResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunnersItemLabelsPutResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunnersItemLabelsPutResponseable), nil +} +// ToDeleteRequestInformation remove all custom labels from a self-hosted runner configured in arepository. Returns the remaining read-only labels from the runner.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation lists all labels for a self-hosted runner configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation adds custom labels to a self-hosted runner configured in a repository.Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemActionsRunnersItemLabelsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPutRequestInformation remove all previous custom labels and set the new custom labels for a specificself-hosted runner configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemActionsRunnersItemLabelsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunnersItemLabelsRequestBuilder when successful +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunnersItemLabelsRequestBuilder) { + return NewItemItemActionsRunnersItemLabelsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_response.go new file mode 100644 index 000000000..6f3cf3777 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsRunnersItemLabelsResponse +// Deprecated: This class is obsolete. Use labelsGetResponse instead. +type ItemItemActionsRunnersItemLabelsResponse struct { + ItemItemActionsRunnersItemLabelsGetResponse +} +// NewItemItemActionsRunnersItemLabelsResponse instantiates a new ItemItemActionsRunnersItemLabelsResponse and sets the default values. +func NewItemItemActionsRunnersItemLabelsResponse()(*ItemItemActionsRunnersItemLabelsResponse) { + m := &ItemItemActionsRunnersItemLabelsResponse{ + ItemItemActionsRunnersItemLabelsGetResponse: *NewItemItemActionsRunnersItemLabelsGetResponse(), + } + return m +} +// CreateItemItemActionsRunnersItemLabelsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemActionsRunnersItemLabelsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersItemLabelsResponse(), nil +} +// ItemItemActionsRunnersItemLabelsResponseable +// Deprecated: This class is obsolete. Use labelsGetResponse instead. +type ItemItemActionsRunnersItemLabelsResponseable interface { + ItemItemActionsRunnersItemLabelsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_with_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_with_name_item_request_builder.go new file mode 100644 index 000000000..fe9cfa1c8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_item_labels_with_name_item_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runners\{runner_id}\labels\{name} +type ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal instantiates a new ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + m := &ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runners/{runner_id}/labels/{name}", pathParameters), + } + return m +} +// NewItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder instantiates a new ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete remove a custom label from a self-hosted runner configuredin a repository. Returns the remaining labels from the runner.This endpoint returns a `404 Not Found` status if the custom label is notpresent on the runner.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-a-repository +func (m *ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponseable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunnersItemLabelsItemWithNameDeleteResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponseable), nil +} +// ToDeleteRequestInformation remove a custom label from a self-hosted runner configuredin a repository. Returns the remaining labels from the runner.This endpoint returns a `404 Not Found` status if the custom label is notpresent on the runner.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + return NewItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_registration_token_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_registration_token_request_builder.go new file mode 100644 index 000000000..5c475f7d2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_registration_token_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunnersRegistrationTokenRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runners\registration-token +type ItemItemActionsRunnersRegistrationTokenRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunnersRegistrationTokenRequestBuilderInternal instantiates a new ItemItemActionsRunnersRegistrationTokenRequestBuilder and sets the default values. +func NewItemItemActionsRunnersRegistrationTokenRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersRegistrationTokenRequestBuilder) { + m := &ItemItemActionsRunnersRegistrationTokenRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runners/registration-token", pathParameters), + } + return m +} +// NewItemItemActionsRunnersRegistrationTokenRequestBuilder instantiates a new ItemItemActionsRunnersRegistrationTokenRequestBuilder and sets the default values. +func NewItemItemActionsRunnersRegistrationTokenRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersRegistrationTokenRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunnersRegistrationTokenRequestBuilderInternal(urlParams, requestAdapter) +} +// Post returns a token that you can pass to the `config` script. The token expires after one hour.For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner:```./config.sh --url https://github.com/octo-org --token TOKEN```Authenticated users must have admin access to the repository to use this endpoint.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a AuthenticationTokenable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository +func (m *ItemItemActionsRunnersRegistrationTokenRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AuthenticationTokenable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAuthenticationTokenFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AuthenticationTokenable), nil +} +// ToPostRequestInformation returns a token that you can pass to the `config` script. The token expires after one hour.For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner:```./config.sh --url https://github.com/octo-org --token TOKEN```Authenticated users must have admin access to the repository to use this endpoint.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersRegistrationTokenRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunnersRegistrationTokenRequestBuilder when successful +func (m *ItemItemActionsRunnersRegistrationTokenRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunnersRegistrationTokenRequestBuilder) { + return NewItemItemActionsRunnersRegistrationTokenRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_remove_token_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_remove_token_request_builder.go new file mode 100644 index 000000000..fc8840e3d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_remove_token_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunnersRemoveTokenRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runners\remove-token +type ItemItemActionsRunnersRemoveTokenRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunnersRemoveTokenRequestBuilderInternal instantiates a new ItemItemActionsRunnersRemoveTokenRequestBuilder and sets the default values. +func NewItemItemActionsRunnersRemoveTokenRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersRemoveTokenRequestBuilder) { + m := &ItemItemActionsRunnersRemoveTokenRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runners/remove-token", pathParameters), + } + return m +} +// NewItemItemActionsRunnersRemoveTokenRequestBuilder instantiates a new ItemItemActionsRunnersRemoveTokenRequestBuilder and sets the default values. +func NewItemItemActionsRunnersRemoveTokenRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersRemoveTokenRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunnersRemoveTokenRequestBuilderInternal(urlParams, requestAdapter) +} +// Post returns a token that you can pass to the `config` script to remove a self-hosted runner from an repository. The token expires after one hour.For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization:```./config.sh remove --token TOKEN```Authenticated users must have admin access to the repository to use this endpoint.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a AuthenticationTokenable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository +func (m *ItemItemActionsRunnersRemoveTokenRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AuthenticationTokenable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAuthenticationTokenFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.AuthenticationTokenable), nil +} +// ToPostRequestInformation returns a token that you can pass to the `config` script to remove a self-hosted runner from an repository. The token expires after one hour.For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization:```./config.sh remove --token TOKEN```Authenticated users must have admin access to the repository to use this endpoint.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersRemoveTokenRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunnersRemoveTokenRequestBuilder when successful +func (m *ItemItemActionsRunnersRemoveTokenRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunnersRemoveTokenRequestBuilder) { + return NewItemItemActionsRunnersRemoveTokenRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_request_builder.go new file mode 100644 index 000000000..3c3d9abe6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_request_builder.go @@ -0,0 +1,96 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsRunnersRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runners +type ItemItemActionsRunnersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsRunnersRequestBuilderGetQueryParameters lists all self-hosted runners configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemActionsRunnersRequestBuilderGetQueryParameters struct { + // The name of a self-hosted runner. + Name *string `uriparametername:"name"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRunner_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.actions.runners.item collection +// returns a *ItemItemActionsRunnersWithRunner_ItemRequestBuilder when successful +func (m *ItemItemActionsRunnersRequestBuilder) ByRunner_id(runner_id int32)(*ItemItemActionsRunnersWithRunner_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["runner_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(runner_id), 10) + return NewItemItemActionsRunnersWithRunner_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsRunnersRequestBuilderInternal instantiates a new ItemItemActionsRunnersRequestBuilder and sets the default values. +func NewItemItemActionsRunnersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersRequestBuilder) { + m := &ItemItemActionsRunnersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runners{?name*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsRunnersRequestBuilder instantiates a new ItemItemActionsRunnersRequestBuilder and sets the default values. +func NewItemItemActionsRunnersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunnersRequestBuilderInternal(urlParams, requestAdapter) +} +// Downloads the downloads property +// returns a *ItemItemActionsRunnersDownloadsRequestBuilder when successful +func (m *ItemItemActionsRunnersRequestBuilder) Downloads()(*ItemItemActionsRunnersDownloadsRequestBuilder) { + return NewItemItemActionsRunnersDownloadsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// GenerateJitconfig the generateJitconfig property +// returns a *ItemItemActionsRunnersGenerateJitconfigRequestBuilder when successful +func (m *ItemItemActionsRunnersRequestBuilder) GenerateJitconfig()(*ItemItemActionsRunnersGenerateJitconfigRequestBuilder) { + return NewItemItemActionsRunnersGenerateJitconfigRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get lists all self-hosted runners configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsRunnersGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository +func (m *ItemItemActionsRunnersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunnersRequestBuilderGetQueryParameters])(ItemItemActionsRunnersGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunnersGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunnersGetResponseable), nil +} +// RegistrationToken the registrationToken property +// returns a *ItemItemActionsRunnersRegistrationTokenRequestBuilder when successful +func (m *ItemItemActionsRunnersRequestBuilder) RegistrationToken()(*ItemItemActionsRunnersRegistrationTokenRequestBuilder) { + return NewItemItemActionsRunnersRegistrationTokenRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// RemoveToken the removeToken property +// returns a *ItemItemActionsRunnersRemoveTokenRequestBuilder when successful +func (m *ItemItemActionsRunnersRequestBuilder) RemoveToken()(*ItemItemActionsRunnersRemoveTokenRequestBuilder) { + return NewItemItemActionsRunnersRemoveTokenRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all self-hosted runners configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunnersRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunnersRequestBuilder when successful +func (m *ItemItemActionsRunnersRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunnersRequestBuilder) { + return NewItemItemActionsRunnersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_response.go new file mode 100644 index 000000000..44399414c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsRunnersResponse +// Deprecated: This class is obsolete. Use runnersGetResponse instead. +type ItemItemActionsRunnersResponse struct { + ItemItemActionsRunnersGetResponse +} +// NewItemItemActionsRunnersResponse instantiates a new ItemItemActionsRunnersResponse and sets the default values. +func NewItemItemActionsRunnersResponse()(*ItemItemActionsRunnersResponse) { + m := &ItemItemActionsRunnersResponse{ + ItemItemActionsRunnersGetResponse: *NewItemItemActionsRunnersGetResponse(), + } + return m +} +// CreateItemItemActionsRunnersResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemActionsRunnersResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersResponse(), nil +} +// ItemItemActionsRunnersResponseable +// Deprecated: This class is obsolete. Use runnersGetResponse instead. +type ItemItemActionsRunnersResponseable interface { + ItemItemActionsRunnersGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_with_runner_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_with_runner_item_request_builder.go new file mode 100644 index 000000000..52732f479 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runners_with_runner_item_request_builder.go @@ -0,0 +1,84 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunnersWithRunner_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runners\{runner_id} +type ItemItemActionsRunnersWithRunner_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunnersWithRunner_ItemRequestBuilderInternal instantiates a new ItemItemActionsRunnersWithRunner_ItemRequestBuilder and sets the default values. +func NewItemItemActionsRunnersWithRunner_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersWithRunner_ItemRequestBuilder) { + m := &ItemItemActionsRunnersWithRunner_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runners/{runner_id}", pathParameters), + } + return m +} +// NewItemItemActionsRunnersWithRunner_ItemRequestBuilder instantiates a new ItemItemActionsRunnersWithRunner_ItemRequestBuilder and sets the default values. +func NewItemItemActionsRunnersWithRunner_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersWithRunner_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunnersWithRunner_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.Authenticated users must have admin access to the repository to use this endpoint.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository +func (m *ItemItemActionsRunnersWithRunner_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a specific self-hosted runner configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a Runnerable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository +func (m *ItemItemActionsRunnersWithRunner_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRunnerFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Runnerable), nil +} +// Labels the labels property +// returns a *ItemItemActionsRunnersItemLabelsRequestBuilder when successful +func (m *ItemItemActionsRunnersWithRunner_ItemRequestBuilder) Labels()(*ItemItemActionsRunnersItemLabelsRequestBuilder) { + return NewItemItemActionsRunnersItemLabelsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.Authenticated users must have admin access to the repository to use this endpoint.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersWithRunner_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a specific self-hosted runner configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersWithRunner_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunnersWithRunner_ItemRequestBuilder when successful +func (m *ItemItemActionsRunnersWithRunner_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunnersWithRunner_ItemRequestBuilder) { + return NewItemItemActionsRunnersWithRunner_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_get_response.go new file mode 100644 index 000000000..066ea33a6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsRunsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The total_count property + total_count *int32 + // The workflow_runs property + workflow_runs []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable +} +// NewItemItemActionsRunsGetResponse instantiates a new ItemItemActionsRunsGetResponse and sets the default values. +func NewItemItemActionsRunsGetResponse()(*ItemItemActionsRunsGetResponse) { + m := &ItemItemActionsRunsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsGetResponse(), 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 *ItemItemActionsRunsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + res["workflow_runs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWorkflowRunFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable) + } + } + m.SetWorkflowRuns(res) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// GetWorkflowRuns gets the workflow_runs property value. The workflow_runs property +// returns a []WorkflowRunable when successful +func (m *ItemItemActionsRunsGetResponse) GetWorkflowRuns()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable) { + return m.workflow_runs +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + if m.GetWorkflowRuns() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetWorkflowRuns())) + for i, v := range m.GetWorkflowRuns() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("workflow_runs", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsRunsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetWorkflowRuns sets the workflow_runs property value. The workflow_runs property +func (m *ItemItemActionsRunsGetResponse) SetWorkflowRuns(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable)() { + m.workflow_runs = value +} +type ItemItemActionsRunsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalCount()(*int32) + GetWorkflowRuns()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable) + SetTotalCount(value *int32)() + SetWorkflowRuns(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_approvals_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_approvals_request_builder.go new file mode 100644 index 000000000..1f806e00d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_approvals_request_builder.go @@ -0,0 +1,60 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunsItemApprovalsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\approvals +type ItemItemActionsRunsItemApprovalsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemApprovalsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemApprovalsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemApprovalsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemApprovalsRequestBuilder) { + m := &ItemItemActionsRunsItemApprovalsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/approvals", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemApprovalsRequestBuilder instantiates a new ItemItemActionsRunsItemApprovalsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemApprovalsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemApprovalsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemApprovalsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a []EnvironmentApprovalsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#get-the-review-history-for-a-workflow-run +func (m *ItemItemActionsRunsItemApprovalsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EnvironmentApprovalsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEnvironmentApprovalsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EnvironmentApprovalsable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EnvironmentApprovalsable) + } + } + return val, nil +} +// ToGetRequestInformation anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemApprovalsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunsItemApprovalsRequestBuilder when successful +func (m *ItemItemActionsRunsItemApprovalsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemApprovalsRequestBuilder) { + return NewItemItemActionsRunsItemApprovalsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_approve_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_approve_request_builder.go new file mode 100644 index 000000000..da37e8608 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_approve_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunsItemApproveRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\approve +type ItemItemActionsRunsItemApproveRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemApproveRequestBuilderInternal instantiates a new ItemItemActionsRunsItemApproveRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemApproveRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemApproveRequestBuilder) { + m := &ItemItemActionsRunsItemApproveRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/approve", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemApproveRequestBuilder instantiates a new ItemItemActionsRunsItemApproveRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemApproveRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemApproveRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemApproveRequestBuilderInternal(urlParams, requestAdapter) +} +// Post approves a workflow run for a pull request from a public fork of a first time contributor. For more information, see ["Approving workflow runs from public forks](https://docs.github.com/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks)."OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#approve-a-workflow-run-for-a-fork-pull-request +func (m *ItemItemActionsRunsItemApproveRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToPostRequestInformation approves a workflow run for a pull request from a public fork of a first time contributor. For more information, see ["Approving workflow runs from public forks](https://docs.github.com/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks)."OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemApproveRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunsItemApproveRequestBuilder when successful +func (m *ItemItemActionsRunsItemApproveRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemApproveRequestBuilder) { + return NewItemItemActionsRunsItemApproveRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_artifacts_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_artifacts_get_response.go new file mode 100644 index 000000000..33774e3c0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_artifacts_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsRunsItemArtifactsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The artifacts property + artifacts []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Artifactable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunsItemArtifactsGetResponse instantiates a new ItemItemActionsRunsItemArtifactsGetResponse and sets the default values. +func NewItemItemActionsRunsItemArtifactsGetResponse()(*ItemItemActionsRunsItemArtifactsGetResponse) { + m := &ItemItemActionsRunsItemArtifactsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunsItemArtifactsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunsItemArtifactsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsItemArtifactsGetResponse(), 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 *ItemItemActionsRunsItemArtifactsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArtifacts gets the artifacts property value. The artifacts property +// returns a []Artifactable when successful +func (m *ItemItemActionsRunsItemArtifactsGetResponse) GetArtifacts()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Artifactable) { + return m.artifacts +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunsItemArtifactsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["artifacts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateArtifactFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Artifactable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Artifactable) + } + } + m.SetArtifacts(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunsItemArtifactsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunsItemArtifactsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetArtifacts() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetArtifacts())) + for i, v := range m.GetArtifacts() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("artifacts", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsRunsItemArtifactsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArtifacts sets the artifacts property value. The artifacts property +func (m *ItemItemActionsRunsItemArtifactsGetResponse) SetArtifacts(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Artifactable)() { + m.artifacts = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunsItemArtifactsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunsItemArtifactsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArtifacts()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Artifactable) + GetTotalCount()(*int32) + SetArtifacts(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Artifactable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_artifacts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_artifacts_request_builder.go new file mode 100644 index 000000000..2fc0c7f44 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_artifacts_request_builder.go @@ -0,0 +1,65 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsRunsItemArtifactsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\artifacts +type ItemItemActionsRunsItemArtifactsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsRunsItemArtifactsRequestBuilderGetQueryParameters lists artifacts for a workflow run.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemActionsRunsItemArtifactsRequestBuilderGetQueryParameters struct { + // The name field of an artifact. When specified, only artifacts with this name will be returned. + Name *string `uriparametername:"name"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemActionsRunsItemArtifactsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemArtifactsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemArtifactsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemArtifactsRequestBuilder) { + m := &ItemItemActionsRunsItemArtifactsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/artifacts{?name*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemArtifactsRequestBuilder instantiates a new ItemItemActionsRunsItemArtifactsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemArtifactsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemArtifactsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemArtifactsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists artifacts for a workflow run.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemActionsRunsItemArtifactsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/artifacts#list-workflow-run-artifacts +func (m *ItemItemActionsRunsItemArtifactsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsItemArtifactsRequestBuilderGetQueryParameters])(ItemItemActionsRunsItemArtifactsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunsItemArtifactsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunsItemArtifactsGetResponseable), nil +} +// ToGetRequestInformation lists artifacts for a workflow run.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemArtifactsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsItemArtifactsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunsItemArtifactsRequestBuilder when successful +func (m *ItemItemActionsRunsItemArtifactsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemArtifactsRequestBuilder) { + return NewItemItemActionsRunsItemArtifactsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_artifacts_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_artifacts_response.go new file mode 100644 index 000000000..1f8ac6269 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_artifacts_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsRunsItemArtifactsResponse +// Deprecated: This class is obsolete. Use artifactsGetResponse instead. +type ItemItemActionsRunsItemArtifactsResponse struct { + ItemItemActionsRunsItemArtifactsGetResponse +} +// NewItemItemActionsRunsItemArtifactsResponse instantiates a new ItemItemActionsRunsItemArtifactsResponse and sets the default values. +func NewItemItemActionsRunsItemArtifactsResponse()(*ItemItemActionsRunsItemArtifactsResponse) { + m := &ItemItemActionsRunsItemArtifactsResponse{ + ItemItemActionsRunsItemArtifactsGetResponse: *NewItemItemActionsRunsItemArtifactsGetResponse(), + } + return m +} +// CreateItemItemActionsRunsItemArtifactsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemActionsRunsItemArtifactsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsItemArtifactsResponse(), nil +} +// ItemItemActionsRunsItemArtifactsResponseable +// Deprecated: This class is obsolete. Use artifactsGetResponse instead. +type ItemItemActionsRunsItemArtifactsResponseable interface { + ItemItemActionsRunsItemArtifactsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_item_jobs_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_item_jobs_get_response.go new file mode 100644 index 000000000..b268375dc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_item_jobs_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsRunsItemAttemptsItemJobsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The jobs property + jobs []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Jobable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunsItemAttemptsItemJobsGetResponse instantiates a new ItemItemActionsRunsItemAttemptsItemJobsGetResponse and sets the default values. +func NewItemItemActionsRunsItemAttemptsItemJobsGetResponse()(*ItemItemActionsRunsItemAttemptsItemJobsGetResponse) { + m := &ItemItemActionsRunsItemAttemptsItemJobsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunsItemAttemptsItemJobsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunsItemAttemptsItemJobsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsItemAttemptsItemJobsGetResponse(), 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 *ItemItemActionsRunsItemAttemptsItemJobsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunsItemAttemptsItemJobsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["jobs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateJobFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Jobable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Jobable) + } + } + m.SetJobs(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetJobs gets the jobs property value. The jobs property +// returns a []Jobable when successful +func (m *ItemItemActionsRunsItemAttemptsItemJobsGetResponse) GetJobs()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Jobable) { + return m.jobs +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunsItemAttemptsItemJobsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunsItemAttemptsItemJobsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetJobs() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetJobs())) + for i, v := range m.GetJobs() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("jobs", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsRunsItemAttemptsItemJobsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetJobs sets the jobs property value. The jobs property +func (m *ItemItemActionsRunsItemAttemptsItemJobsGetResponse) SetJobs(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Jobable)() { + m.jobs = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunsItemAttemptsItemJobsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunsItemAttemptsItemJobsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetJobs()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Jobable) + GetTotalCount()(*int32) + SetJobs(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Jobable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_item_jobs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_item_jobs_request_builder.go new file mode 100644 index 000000000..bbac8adfa --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_item_jobs_request_builder.go @@ -0,0 +1,68 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\attempts\{attempt_number}\jobs +type ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsRunsItemAttemptsItemJobsRequestBuilderGetQueryParameters lists jobs for a specific workflow run attempt. You can use parameters to narrow the list of results. For more informationabout using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemActionsRunsItemAttemptsItemJobsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemActionsRunsItemAttemptsItemJobsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemAttemptsItemJobsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder) { + m := &ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/attempts/{attempt_number}/jobs{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemAttemptsItemJobsRequestBuilder instantiates a new ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemAttemptsItemJobsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemAttemptsItemJobsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists jobs for a specific workflow run attempt. You can use parameters to narrow the list of results. For more informationabout using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemActionsRunsItemAttemptsItemJobsGetResponseable 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/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt +func (m *ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsItemAttemptsItemJobsRequestBuilderGetQueryParameters])(ItemItemActionsRunsItemAttemptsItemJobsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunsItemAttemptsItemJobsGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunsItemAttemptsItemJobsGetResponseable), nil +} +// ToGetRequestInformation lists jobs for a specific workflow run attempt. You can use parameters to narrow the list of results. For more informationabout using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsItemAttemptsItemJobsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder when successful +func (m *ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder) { + return NewItemItemActionsRunsItemAttemptsItemJobsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_item_jobs_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_item_jobs_response.go new file mode 100644 index 000000000..a4389d74f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_item_jobs_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsRunsItemAttemptsItemJobsResponse +// Deprecated: This class is obsolete. Use jobsGetResponse instead. +type ItemItemActionsRunsItemAttemptsItemJobsResponse struct { + ItemItemActionsRunsItemAttemptsItemJobsGetResponse +} +// NewItemItemActionsRunsItemAttemptsItemJobsResponse instantiates a new ItemItemActionsRunsItemAttemptsItemJobsResponse and sets the default values. +func NewItemItemActionsRunsItemAttemptsItemJobsResponse()(*ItemItemActionsRunsItemAttemptsItemJobsResponse) { + m := &ItemItemActionsRunsItemAttemptsItemJobsResponse{ + ItemItemActionsRunsItemAttemptsItemJobsGetResponse: *NewItemItemActionsRunsItemAttemptsItemJobsGetResponse(), + } + return m +} +// CreateItemItemActionsRunsItemAttemptsItemJobsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemActionsRunsItemAttemptsItemJobsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsItemAttemptsItemJobsResponse(), nil +} +// ItemItemActionsRunsItemAttemptsItemJobsResponseable +// Deprecated: This class is obsolete. Use jobsGetResponse instead. +type ItemItemActionsRunsItemAttemptsItemJobsResponseable interface { + ItemItemActionsRunsItemAttemptsItemJobsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_item_logs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_item_logs_request_builder.go new file mode 100644 index 000000000..efb7801e7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_item_logs_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\attempts\{attempt_number}\logs +type ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemAttemptsItemLogsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemAttemptsItemLogsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder) { + m := &ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/attempts/{attempt_number}/logs", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemAttemptsItemLogsRequestBuilder instantiates a new ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemAttemptsItemLogsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + 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. +// [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])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + 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 +func (m *ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder when successful +func (m *ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder) { + return NewItemItemActionsRunsItemAttemptsItemLogsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_request_builder.go new file mode 100644 index 000000000..cf8b9cb9c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_request_builder.go @@ -0,0 +1,34 @@ +package repos + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsRunsItemAttemptsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\attempts +type ItemItemActionsRunsItemAttemptsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByAttempt_number gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.actions.runs.item.attempts.item collection +// returns a *ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder when successful +func (m *ItemItemActionsRunsItemAttemptsRequestBuilder) ByAttempt_number(attempt_number int32)(*ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["attempt_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(attempt_number), 10) + return NewItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsRunsItemAttemptsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemAttemptsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemAttemptsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemAttemptsRequestBuilder) { + m := &ItemItemActionsRunsItemAttemptsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/attempts", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemAttemptsRequestBuilder instantiates a new ItemItemActionsRunsItemAttemptsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemAttemptsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemAttemptsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemAttemptsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_with_attempt_number_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_with_attempt_number_item_request_builder.go new file mode 100644 index 000000000..251497466 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_attempts_with_attempt_number_item_request_builder.go @@ -0,0 +1,72 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\attempts\{attempt_number} +type ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilderGetQueryParameters gets a specific workflow run attempt.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilderGetQueryParameters struct { + // If `true` pull requests are omitted from the response (empty array). + Exclude_pull_requests *bool `uriparametername:"exclude_pull_requests"` +} +// NewItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilderInternal instantiates a new ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) { + m := &ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/attempts/{attempt_number}{?exclude_pull_requests*}", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder instantiates a new ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a specific workflow run attempt.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a WorkflowRunable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt +func (m *ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWorkflowRunFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable), nil +} +// Jobs the jobs property +// returns a *ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder when successful +func (m *ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) Jobs()(*ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder) { + return NewItemItemActionsRunsItemAttemptsItemJobsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Logs the logs property +// returns a *ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder when successful +func (m *ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) Logs()(*ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder) { + return NewItemItemActionsRunsItemAttemptsItemLogsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation gets a specific workflow run attempt.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder when successful +func (m *ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) { + return NewItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_cancel_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_cancel_request_builder.go new file mode 100644 index 000000000..ce35e55c1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_cancel_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunsItemCancelRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\cancel +type ItemItemActionsRunsItemCancelRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemCancelRequestBuilderInternal instantiates a new ItemItemActionsRunsItemCancelRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemCancelRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemCancelRequestBuilder) { + m := &ItemItemActionsRunsItemCancelRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/cancel", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemCancelRequestBuilder instantiates a new ItemItemActionsRunsItemCancelRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemCancelRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemCancelRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemCancelRequestBuilderInternal(urlParams, requestAdapter) +} +// Post cancels a workflow run using its `id`.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run +func (m *ItemItemActionsRunsItemCancelRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToPostRequestInformation cancels a workflow run using its `id`.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemCancelRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunsItemCancelRequestBuilder when successful +func (m *ItemItemActionsRunsItemCancelRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemCancelRequestBuilder) { + return NewItemItemActionsRunsItemCancelRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_deployment_protection_rule_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_deployment_protection_rule_request_builder.go new file mode 100644 index 000000000..7ca65a4c8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_deployment_protection_rule_request_builder.go @@ -0,0 +1,193 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\deployment_protection_rule +type ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Deployment_protection_rulePostRequestBody composed type wrapper for classes i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable +type Deployment_protection_rulePostRequestBody struct { + // Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable + deployment_protection_rulePostRequestBodyReviewCustomGatesCommentRequired i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable + // Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable + deployment_protection_rulePostRequestBodyReviewCustomGatesStateRequired i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable + // Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable + reviewCustomGatesCommentRequired i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable + // Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable + reviewCustomGatesStateRequired i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable +} +// NewDeployment_protection_rulePostRequestBody instantiates a new Deployment_protection_rulePostRequestBody and sets the default values. +func NewDeployment_protection_rulePostRequestBody()(*Deployment_protection_rulePostRequestBody) { + m := &Deployment_protection_rulePostRequestBody{ + } + return m +} +// CreateDeployment_protection_rulePostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeployment_protection_rulePostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewDeployment_protection_rulePostRequestBody() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReviewCustomGatesCommentRequiredFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable); ok { + result.SetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired(cast) + } + } else if val, err := parseNode.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReviewCustomGatesStateRequiredFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable); ok { + result.SetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired(cast) + } + } else if val, err := parseNode.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReviewCustomGatesCommentRequiredFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable); ok { + result.SetReviewCustomGatesCommentRequired(cast) + } + } else if val, err := parseNode.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReviewCustomGatesStateRequiredFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable); ok { + result.SetReviewCustomGatesStateRequired(cast) + } + } + } + return result, nil +} +// GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired gets the reviewCustomGatesCommentRequired property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable +// returns a ReviewCustomGatesCommentRequiredable when successful +func (m *Deployment_protection_rulePostRequestBody) GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable) { + return m.deployment_protection_rulePostRequestBodyReviewCustomGatesCommentRequired +} +// GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired gets the reviewCustomGatesStateRequired property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable +// returns a ReviewCustomGatesStateRequiredable when successful +func (m *Deployment_protection_rulePostRequestBody) GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable) { + return m.deployment_protection_rulePostRequestBodyReviewCustomGatesStateRequired +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Deployment_protection_rulePostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *Deployment_protection_rulePostRequestBody) GetIsComposedType()(bool) { + return true +} +// GetReviewCustomGatesCommentRequired gets the reviewCustomGatesCommentRequired property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable +// returns a ReviewCustomGatesCommentRequiredable when successful +func (m *Deployment_protection_rulePostRequestBody) GetReviewCustomGatesCommentRequired()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable) { + return m.reviewCustomGatesCommentRequired +} +// GetReviewCustomGatesStateRequired gets the reviewCustomGatesStateRequired property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable +// returns a ReviewCustomGatesStateRequiredable when successful +func (m *Deployment_protection_rulePostRequestBody) GetReviewCustomGatesStateRequired()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable) { + return m.reviewCustomGatesStateRequired +} +// Serialize serializes information the current object +func (m *Deployment_protection_rulePostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired() != nil { + err := writer.WriteObjectValue("", m.GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired()) + if err != nil { + return err + } + } else if m.GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired() != nil { + err := writer.WriteObjectValue("", m.GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired()) + if err != nil { + return err + } + } else if m.GetReviewCustomGatesCommentRequired() != nil { + err := writer.WriteObjectValue("", m.GetReviewCustomGatesCommentRequired()) + if err != nil { + return err + } + } else if m.GetReviewCustomGatesStateRequired() != nil { + err := writer.WriteObjectValue("", m.GetReviewCustomGatesStateRequired()) + if err != nil { + return err + } + } + return nil +} +// SetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired sets the reviewCustomGatesCommentRequired property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable +func (m *Deployment_protection_rulePostRequestBody) SetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable)() { + m.deployment_protection_rulePostRequestBodyReviewCustomGatesCommentRequired = value +} +// SetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired sets the reviewCustomGatesStateRequired property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable +func (m *Deployment_protection_rulePostRequestBody) SetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable)() { + m.deployment_protection_rulePostRequestBodyReviewCustomGatesStateRequired = value +} +// SetReviewCustomGatesCommentRequired sets the reviewCustomGatesCommentRequired property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable +func (m *Deployment_protection_rulePostRequestBody) SetReviewCustomGatesCommentRequired(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable)() { + m.reviewCustomGatesCommentRequired = value +} +// SetReviewCustomGatesStateRequired sets the reviewCustomGatesStateRequired property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable +func (m *Deployment_protection_rulePostRequestBody) SetReviewCustomGatesStateRequired(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable)() { + m.reviewCustomGatesStateRequired = value +} +type Deployment_protection_rulePostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable) + GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable) + GetReviewCustomGatesCommentRequired()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable) + GetReviewCustomGatesStateRequired()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable) + SetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable)() + SetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable)() + SetReviewCustomGatesCommentRequired(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesCommentRequiredable)() + SetReviewCustomGatesStateRequired(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCustomGatesStateRequiredable)() +} +// NewItemItemActionsRunsItemDeployment_protection_ruleRequestBuilderInternal instantiates a new ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemDeployment_protection_ruleRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder) { + m := &ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/deployment_protection_rule", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder instantiates a new ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemDeployment_protection_ruleRequestBuilderInternal(urlParams, requestAdapter) +} +// Post approve or reject custom deployment protection rules provided by a GitHub App for a workflow run. For more information, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."**Note:** GitHub Apps can only review their own custom deployment protection rules.To approve or reject pending deployments that are waiting for review from a specific person or team, see [`POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments`](/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run +func (m *ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder) Post(ctx context.Context, body Deployment_protection_rulePostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation approve or reject custom deployment protection rules provided by a GitHub App for a workflow run. For more information, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."**Note:** GitHub Apps can only review their own custom deployment protection rules.To approve or reject pending deployments that are waiting for review from a specific person or team, see [`POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments`](/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder) ToPostRequestInformation(ctx context.Context, body Deployment_protection_rulePostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder when successful +func (m *ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder) { + return NewItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_force_cancel_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_force_cancel_request_builder.go new file mode 100644 index 000000000..db33ac6a4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_force_cancel_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunsItemForceCancelRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\force-cancel +type ItemItemActionsRunsItemForceCancelRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemForceCancelRequestBuilderInternal instantiates a new ItemItemActionsRunsItemForceCancelRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemForceCancelRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemForceCancelRequestBuilder) { + m := &ItemItemActionsRunsItemForceCancelRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/force-cancel", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemForceCancelRequestBuilder instantiates a new ItemItemActionsRunsItemForceCancelRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemForceCancelRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemForceCancelRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemForceCancelRequestBuilderInternal(urlParams, requestAdapter) +} +// Post cancels a workflow run and bypasses conditions that would otherwise cause a workflow execution to continue, such as an `always()` condition on a job.You should only use this endpoint to cancel a workflow run when the workflow run is not responding to [`POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel`](/rest/actions/workflow-runs#cancel-a-workflow-run).OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#force-cancel-a-workflow-run +func (m *ItemItemActionsRunsItemForceCancelRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToPostRequestInformation cancels a workflow run and bypasses conditions that would otherwise cause a workflow execution to continue, such as an `always()` condition on a job.You should only use this endpoint to cancel a workflow run when the workflow run is not responding to [`POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel`](/rest/actions/workflow-runs#cancel-a-workflow-run).OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemForceCancelRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunsItemForceCancelRequestBuilder when successful +func (m *ItemItemActionsRunsItemForceCancelRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemForceCancelRequestBuilder) { + return NewItemItemActionsRunsItemForceCancelRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_jobs_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_jobs_get_response.go new file mode 100644 index 000000000..5b7a62872 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_jobs_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsRunsItemJobsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The jobs property + jobs []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Jobable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunsItemJobsGetResponse instantiates a new ItemItemActionsRunsItemJobsGetResponse and sets the default values. +func NewItemItemActionsRunsItemJobsGetResponse()(*ItemItemActionsRunsItemJobsGetResponse) { + m := &ItemItemActionsRunsItemJobsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunsItemJobsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunsItemJobsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsItemJobsGetResponse(), 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 *ItemItemActionsRunsItemJobsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunsItemJobsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["jobs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateJobFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Jobable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Jobable) + } + } + m.SetJobs(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetJobs gets the jobs property value. The jobs property +// returns a []Jobable when successful +func (m *ItemItemActionsRunsItemJobsGetResponse) GetJobs()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Jobable) { + return m.jobs +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunsItemJobsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunsItemJobsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetJobs() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetJobs())) + for i, v := range m.GetJobs() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("jobs", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsRunsItemJobsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetJobs sets the jobs property value. The jobs property +func (m *ItemItemActionsRunsItemJobsGetResponse) SetJobs(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Jobable)() { + m.jobs = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunsItemJobsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunsItemJobsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetJobs()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Jobable) + GetTotalCount()(*int32) + SetJobs(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Jobable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_jobs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_jobs_request_builder.go new file mode 100644 index 000000000..9c63dba98 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_jobs_request_builder.go @@ -0,0 +1,66 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i08b4bf52b4de47221f213f980c03d04a2d7557c63c7158cc63f99ebaac398e57 "github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/runs/item/jobs" +) + +// ItemItemActionsRunsItemJobsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\jobs +type ItemItemActionsRunsItemJobsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsRunsItemJobsRequestBuilderGetQueryParameters lists jobs for a workflow run. You can use parameters to narrow the list of results. For more informationabout using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemActionsRunsItemJobsRequestBuilderGetQueryParameters struct { + // Filters jobs by their `completed_at` timestamp. `latest` returns jobs from the most recent execution of the workflow run. `all` returns all jobs for a workflow run, including from old executions of the workflow run. + Filter *i08b4bf52b4de47221f213f980c03d04a2d7557c63c7158cc63f99ebaac398e57.GetFilterQueryParameterType `uriparametername:"filter"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemActionsRunsItemJobsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemJobsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemJobsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemJobsRequestBuilder) { + m := &ItemItemActionsRunsItemJobsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/jobs{?filter*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemJobsRequestBuilder instantiates a new ItemItemActionsRunsItemJobsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemJobsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemJobsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemJobsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists jobs for a workflow run. You can use parameters to narrow the list of results. For more informationabout using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemActionsRunsItemJobsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run +func (m *ItemItemActionsRunsItemJobsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsItemJobsRequestBuilderGetQueryParameters])(ItemItemActionsRunsItemJobsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunsItemJobsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunsItemJobsGetResponseable), nil +} +// ToGetRequestInformation lists jobs for a workflow run. You can use parameters to narrow the list of results. For more informationabout using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemJobsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsItemJobsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunsItemJobsRequestBuilder when successful +func (m *ItemItemActionsRunsItemJobsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemJobsRequestBuilder) { + return NewItemItemActionsRunsItemJobsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_jobs_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_jobs_response.go new file mode 100644 index 000000000..91b13816c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_jobs_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsRunsItemJobsResponse +// Deprecated: This class is obsolete. Use jobsGetResponse instead. +type ItemItemActionsRunsItemJobsResponse struct { + ItemItemActionsRunsItemJobsGetResponse +} +// NewItemItemActionsRunsItemJobsResponse instantiates a new ItemItemActionsRunsItemJobsResponse and sets the default values. +func NewItemItemActionsRunsItemJobsResponse()(*ItemItemActionsRunsItemJobsResponse) { + m := &ItemItemActionsRunsItemJobsResponse{ + ItemItemActionsRunsItemJobsGetResponse: *NewItemItemActionsRunsItemJobsGetResponse(), + } + return m +} +// CreateItemItemActionsRunsItemJobsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemActionsRunsItemJobsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsItemJobsResponse(), nil +} +// ItemItemActionsRunsItemJobsResponseable +// Deprecated: This class is obsolete. Use jobsGetResponse instead. +type ItemItemActionsRunsItemJobsResponseable interface { + ItemItemActionsRunsItemJobsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_logs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_logs_request_builder.go new file mode 100644 index 000000000..16ea12deb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_logs_request_builder.go @@ -0,0 +1,81 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunsItemLogsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\logs +type ItemItemActionsRunsItemLogsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemLogsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemLogsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemLogsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemLogsRequestBuilder) { + m := &ItemItemActionsRunsItemLogsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/logs", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemLogsRequestBuilder instantiates a new ItemItemActionsRunsItemLogsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemLogsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemLogsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemLogsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes all logs for a workflow run.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs +func (m *ItemItemActionsRunsItemLogsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + 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. +// [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])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + 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 +func (m *ItemItemActionsRunsItemLogsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation 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 *RequestInformation when successful +func (m *ItemItemActionsRunsItemLogsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunsItemLogsRequestBuilder when successful +func (m *ItemItemActionsRunsItemLogsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemLogsRequestBuilder) { + return NewItemItemActionsRunsItemLogsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_pending_deployments_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_pending_deployments_post_request_body.go new file mode 100644 index 000000000..bac444570 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_pending_deployments_post_request_body.go @@ -0,0 +1,115 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsRunsItemPending_deploymentsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A comment to accompany the deployment review + comment *string + // The list of environment ids to approve or reject + environment_ids []int32 +} +// NewItemItemActionsRunsItemPending_deploymentsPostRequestBody instantiates a new ItemItemActionsRunsItemPending_deploymentsPostRequestBody and sets the default values. +func NewItemItemActionsRunsItemPending_deploymentsPostRequestBody()(*ItemItemActionsRunsItemPending_deploymentsPostRequestBody) { + m := &ItemItemActionsRunsItemPending_deploymentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunsItemPending_deploymentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunsItemPending_deploymentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsItemPending_deploymentsPostRequestBody(), 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 *ItemItemActionsRunsItemPending_deploymentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComment gets the comment property value. A comment to accompany the deployment review +// returns a *string when successful +func (m *ItemItemActionsRunsItemPending_deploymentsPostRequestBody) GetComment()(*string) { + return m.comment +} +// GetEnvironmentIds gets the environment_ids property value. The list of environment ids to approve or reject +// returns a []int32 when successful +func (m *ItemItemActionsRunsItemPending_deploymentsPostRequestBody) GetEnvironmentIds()([]int32) { + return m.environment_ids +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunsItemPending_deploymentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetComment(val) + } + return nil + } + res["environment_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetEnvironmentIds(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunsItemPending_deploymentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("comment", m.GetComment()) + if err != nil { + return err + } + } + if m.GetEnvironmentIds() != nil { + err := writer.WriteCollectionOfInt32Values("environment_ids", m.GetEnvironmentIds()) + 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 *ItemItemActionsRunsItemPending_deploymentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComment sets the comment property value. A comment to accompany the deployment review +func (m *ItemItemActionsRunsItemPending_deploymentsPostRequestBody) SetComment(value *string)() { + m.comment = value +} +// SetEnvironmentIds sets the environment_ids property value. The list of environment ids to approve or reject +func (m *ItemItemActionsRunsItemPending_deploymentsPostRequestBody) SetEnvironmentIds(value []int32)() { + m.environment_ids = value +} +type ItemItemActionsRunsItemPending_deploymentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComment()(*string) + GetEnvironmentIds()([]int32) + SetComment(value *string)() + SetEnvironmentIds(value []int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_pending_deployments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_pending_deployments_request_builder.go new file mode 100644 index 000000000..093d728fe --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_pending_deployments_request_builder.go @@ -0,0 +1,94 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunsItemPending_deploymentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\pending_deployments +type ItemItemActionsRunsItemPending_deploymentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemPending_deploymentsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemPending_deploymentsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemPending_deploymentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemPending_deploymentsRequestBuilder) { + m := &ItemItemActionsRunsItemPending_deploymentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/pending_deployments", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemPending_deploymentsRequestBuilder instantiates a new ItemItemActionsRunsItemPending_deploymentsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemPending_deploymentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemPending_deploymentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemPending_deploymentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get all deployment environments for a workflow run that are waiting for protection rules to pass.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 []PendingDeploymentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run +func (m *ItemItemActionsRunsItemPending_deploymentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PendingDeploymentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePendingDeploymentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PendingDeploymentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PendingDeploymentable) + } + } + return val, nil +} +// Post approve or reject pending deployments that are waiting on approval by a required reviewer.Required reviewers with read access to the repository contents and deployments can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a []Deploymentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run +func (m *ItemItemActionsRunsItemPending_deploymentsRequestBuilder) Post(ctx context.Context, body ItemItemActionsRunsItemPending_deploymentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Deploymentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeploymentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Deploymentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Deploymentable) + } + } + return val, nil +} +// ToGetRequestInformation get all deployment environments for a workflow run that are waiting for protection rules to pass.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemPending_deploymentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation approve or reject pending deployments that are waiting on approval by a required reviewer.Required reviewers with read access to the repository contents and deployments can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemPending_deploymentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemActionsRunsItemPending_deploymentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunsItemPending_deploymentsRequestBuilder when successful +func (m *ItemItemActionsRunsItemPending_deploymentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemPending_deploymentsRequestBuilder) { + return NewItemItemActionsRunsItemPending_deploymentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_rerun_failed_jobs_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_rerun_failed_jobs_post_request_body.go new file mode 100644 index 000000000..ca2e596d1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_rerun_failed_jobs_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsRunsItemRerunFailedJobsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether to enable debug logging for the re-run. + enable_debug_logging *bool +} +// NewItemItemActionsRunsItemRerunFailedJobsPostRequestBody instantiates a new ItemItemActionsRunsItemRerunFailedJobsPostRequestBody and sets the default values. +func NewItemItemActionsRunsItemRerunFailedJobsPostRequestBody()(*ItemItemActionsRunsItemRerunFailedJobsPostRequestBody) { + m := &ItemItemActionsRunsItemRerunFailedJobsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunsItemRerunFailedJobsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunsItemRerunFailedJobsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsItemRerunFailedJobsPostRequestBody(), 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 *ItemItemActionsRunsItemRerunFailedJobsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnableDebugLogging gets the enable_debug_logging property value. Whether to enable debug logging for the re-run. +// returns a *bool when successful +func (m *ItemItemActionsRunsItemRerunFailedJobsPostRequestBody) GetEnableDebugLogging()(*bool) { + return m.enable_debug_logging +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunsItemRerunFailedJobsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enable_debug_logging"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnableDebugLogging(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunsItemRerunFailedJobsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enable_debug_logging", m.GetEnableDebugLogging()) + 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 *ItemItemActionsRunsItemRerunFailedJobsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnableDebugLogging sets the enable_debug_logging property value. Whether to enable debug logging for the re-run. +func (m *ItemItemActionsRunsItemRerunFailedJobsPostRequestBody) SetEnableDebugLogging(value *bool)() { + m.enable_debug_logging = value +} +type ItemItemActionsRunsItemRerunFailedJobsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnableDebugLogging()(*bool) + SetEnableDebugLogging(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_rerun_failed_jobs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_rerun_failed_jobs_request_builder.go new file mode 100644 index 000000000..388f86eaf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_rerun_failed_jobs_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunsItemRerunFailedJobsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\rerun-failed-jobs +type ItemItemActionsRunsItemRerunFailedJobsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemRerunFailedJobsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemRerunFailedJobsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemRerunFailedJobsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemRerunFailedJobsRequestBuilder) { + m := &ItemItemActionsRunsItemRerunFailedJobsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/rerun-failed-jobs", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemRerunFailedJobsRequestBuilder instantiates a new ItemItemActionsRunsItemRerunFailedJobsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemRerunFailedJobsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemRerunFailedJobsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemRerunFailedJobsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post re-run all of the failed jobs and their dependent jobs in a workflow run using the `id` of the workflow run.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run +func (m *ItemItemActionsRunsItemRerunFailedJobsRequestBuilder) Post(ctx context.Context, body ItemItemActionsRunsItemRerunFailedJobsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToPostRequestInformation re-run all of the failed jobs and their dependent jobs in a workflow run using the `id` of the workflow run.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemRerunFailedJobsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemActionsRunsItemRerunFailedJobsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunsItemRerunFailedJobsRequestBuilder when successful +func (m *ItemItemActionsRunsItemRerunFailedJobsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemRerunFailedJobsRequestBuilder) { + return NewItemItemActionsRunsItemRerunFailedJobsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_rerun_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_rerun_post_request_body.go new file mode 100644 index 000000000..2522f36cb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_rerun_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsRunsItemRerunPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether to enable debug logging for the re-run. + enable_debug_logging *bool +} +// NewItemItemActionsRunsItemRerunPostRequestBody instantiates a new ItemItemActionsRunsItemRerunPostRequestBody and sets the default values. +func NewItemItemActionsRunsItemRerunPostRequestBody()(*ItemItemActionsRunsItemRerunPostRequestBody) { + m := &ItemItemActionsRunsItemRerunPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunsItemRerunPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunsItemRerunPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsItemRerunPostRequestBody(), 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 *ItemItemActionsRunsItemRerunPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnableDebugLogging gets the enable_debug_logging property value. Whether to enable debug logging for the re-run. +// returns a *bool when successful +func (m *ItemItemActionsRunsItemRerunPostRequestBody) GetEnableDebugLogging()(*bool) { + return m.enable_debug_logging +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunsItemRerunPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enable_debug_logging"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnableDebugLogging(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunsItemRerunPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enable_debug_logging", m.GetEnableDebugLogging()) + 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 *ItemItemActionsRunsItemRerunPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnableDebugLogging sets the enable_debug_logging property value. Whether to enable debug logging for the re-run. +func (m *ItemItemActionsRunsItemRerunPostRequestBody) SetEnableDebugLogging(value *bool)() { + m.enable_debug_logging = value +} +type ItemItemActionsRunsItemRerunPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnableDebugLogging()(*bool) + SetEnableDebugLogging(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_rerun_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_rerun_request_builder.go new file mode 100644 index 000000000..ee4ac10aa --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_rerun_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunsItemRerunRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\rerun +type ItemItemActionsRunsItemRerunRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemRerunRequestBuilderInternal instantiates a new ItemItemActionsRunsItemRerunRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemRerunRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemRerunRequestBuilder) { + m := &ItemItemActionsRunsItemRerunRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/rerun", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemRerunRequestBuilder instantiates a new ItemItemActionsRunsItemRerunRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemRerunRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemRerunRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemRerunRequestBuilderInternal(urlParams, requestAdapter) +} +// Post re-runs your workflow run using its `id`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow +func (m *ItemItemActionsRunsItemRerunRequestBuilder) Post(ctx context.Context, body ItemItemActionsRunsItemRerunPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToPostRequestInformation re-runs your workflow run using its `id`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemRerunRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemActionsRunsItemRerunPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunsItemRerunRequestBuilder when successful +func (m *ItemItemActionsRunsItemRerunRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemRerunRequestBuilder) { + return NewItemItemActionsRunsItemRerunRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_timing_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_timing_request_builder.go new file mode 100644 index 000000000..255a832de --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_item_timing_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunsItemTimingRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\timing +type ItemItemActionsRunsItemTimingRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemTimingRequestBuilderInternal instantiates a new ItemItemActionsRunsItemTimingRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemTimingRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemTimingRequestBuilder) { + m := &ItemItemActionsRunsItemTimingRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/timing", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemTimingRequestBuilder instantiates a new ItemItemActionsRunsItemTimingRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemTimingRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemTimingRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemTimingRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)".Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a WorkflowRunUsageable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage +func (m *ItemItemActionsRunsItemTimingRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunUsageable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWorkflowRunUsageFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunUsageable), nil +} +// ToGetRequestInformation gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)".Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemTimingRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunsItemTimingRequestBuilder when successful +func (m *ItemItemActionsRunsItemTimingRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemTimingRequestBuilder) { + return NewItemItemActionsRunsItemTimingRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_request_builder.go new file mode 100644 index 000000000..2f127dd43 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_request_builder.go @@ -0,0 +1,92 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ib50fd1a31f59a50cad835d1bac105bcca1f781f781bbe17e66a476cfdf7485c8 "github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/runs" +) + +// ItemItemActionsRunsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs +type ItemItemActionsRunsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsRunsRequestBuilderGetQueryParameters lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.This API will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. +type ItemItemActionsRunsRequestBuilderGetQueryParameters struct { + // Returns someone's workflow runs. Use the login for the user who created the `push` associated with the check suite or workflow run. + Actor *string `uriparametername:"actor"` + // Returns workflow runs associated with a branch. Use the name of the branch of the `push`. + Branch *string `uriparametername:"branch"` + // Returns workflow runs with the `check_suite_id` that you specify. + Check_suite_id *int32 `uriparametername:"check_suite_id"` + // Returns workflow runs created within the given date-time range. For more information on the syntax, see "[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)." + Created *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"created"` + // Returns workflow run triggered by the event you specify. For example, `push`, `pull_request` or `issue`. For more information, see "[Events that trigger workflows](https://docs.github.com/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." + Event *string `uriparametername:"event"` + // If `true` pull requests are omitted from the response (empty array). + Exclude_pull_requests *bool `uriparametername:"exclude_pull_requests"` + // Only returns workflow runs that are associated with the specified `head_sha`. + Head_sha *string `uriparametername:"head_sha"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Returns workflow runs with the check run `status` or `conclusion` that you specify. For example, a conclusion can be `success` or a status can be `in_progress`. Only GitHub Actions can set a status of `waiting`, `pending`, or `requested`. + Status *ib50fd1a31f59a50cad835d1bac105bcca1f781f781bbe17e66a476cfdf7485c8.GetStatusQueryParameterType `uriparametername:"status"` +} +// ByRun_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.actions.runs.item collection +// returns a *ItemItemActionsRunsWithRun_ItemRequestBuilder when successful +func (m *ItemItemActionsRunsRequestBuilder) ByRun_id(run_id int32)(*ItemItemActionsRunsWithRun_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["run_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(run_id), 10) + return NewItemItemActionsRunsWithRun_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsRunsRequestBuilderInternal instantiates a new ItemItemActionsRunsRequestBuilder and sets the default values. +func NewItemItemActionsRunsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsRequestBuilder) { + m := &ItemItemActionsRunsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs{?actor*,branch*,check_suite_id*,created*,event*,exclude_pull_requests*,head_sha*,page*,per_page*,status*}", pathParameters), + } + return m +} +// NewItemItemActionsRunsRequestBuilder instantiates a new ItemItemActionsRunsRequestBuilder and sets the default values. +func NewItemItemActionsRunsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.This API will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. +// returns a ItemItemActionsRunsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository +func (m *ItemItemActionsRunsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsRequestBuilderGetQueryParameters])(ItemItemActionsRunsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunsGetResponseable), nil +} +// ToGetRequestInformation lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.This API will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunsRequestBuilder when successful +func (m *ItemItemActionsRunsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsRequestBuilder) { + return NewItemItemActionsRunsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_response.go new file mode 100644 index 000000000..d9bbfc641 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsRunsResponse +// Deprecated: This class is obsolete. Use runsGetResponse instead. +type ItemItemActionsRunsResponse struct { + ItemItemActionsRunsGetResponse +} +// NewItemItemActionsRunsResponse instantiates a new ItemItemActionsRunsResponse and sets the default values. +func NewItemItemActionsRunsResponse()(*ItemItemActionsRunsResponse) { + m := &ItemItemActionsRunsResponse{ + ItemItemActionsRunsGetResponse: *NewItemItemActionsRunsGetResponse(), + } + return m +} +// CreateItemItemActionsRunsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemActionsRunsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsResponse(), nil +} +// ItemItemActionsRunsResponseable +// Deprecated: This class is obsolete. Use runsGetResponse instead. +type ItemItemActionsRunsResponseable interface { + ItemItemActionsRunsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_with_run_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_with_run_item_request_builder.go new file mode 100644 index 000000000..5159216f7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_runs_with_run_item_request_builder.go @@ -0,0 +1,149 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsRunsWithRun_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id} +type ItemItemActionsRunsWithRun_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsRunsWithRun_ItemRequestBuilderGetQueryParameters gets a specific workflow run.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemActionsRunsWithRun_ItemRequestBuilderGetQueryParameters struct { + // If `true` pull requests are omitted from the response (empty array). + Exclude_pull_requests *bool `uriparametername:"exclude_pull_requests"` +} +// Approvals the approvals property +// returns a *ItemItemActionsRunsItemApprovalsRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Approvals()(*ItemItemActionsRunsItemApprovalsRequestBuilder) { + return NewItemItemActionsRunsItemApprovalsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Approve the approve property +// returns a *ItemItemActionsRunsItemApproveRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Approve()(*ItemItemActionsRunsItemApproveRequestBuilder) { + return NewItemItemActionsRunsItemApproveRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Artifacts the artifacts property +// returns a *ItemItemActionsRunsItemArtifactsRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Artifacts()(*ItemItemActionsRunsItemArtifactsRequestBuilder) { + return NewItemItemActionsRunsItemArtifactsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Attempts the attempts property +// returns a *ItemItemActionsRunsItemAttemptsRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Attempts()(*ItemItemActionsRunsItemAttemptsRequestBuilder) { + return NewItemItemActionsRunsItemAttemptsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Cancel the cancel property +// returns a *ItemItemActionsRunsItemCancelRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Cancel()(*ItemItemActionsRunsItemCancelRequestBuilder) { + return NewItemItemActionsRunsItemCancelRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsRunsWithRun_ItemRequestBuilderInternal instantiates a new ItemItemActionsRunsWithRun_ItemRequestBuilder and sets the default values. +func NewItemItemActionsRunsWithRun_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsWithRun_ItemRequestBuilder) { + m := &ItemItemActionsRunsWithRun_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}{?exclude_pull_requests*}", pathParameters), + } + return m +} +// NewItemItemActionsRunsWithRun_ItemRequestBuilder instantiates a new ItemItemActionsRunsWithRun_ItemRequestBuilder and sets the default values. +func NewItemItemActionsRunsWithRun_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsWithRun_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsWithRun_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a specific workflow run.Anyone with write 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. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Deployment_protection_rule the deployment_protection_rule property +// returns a *ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Deployment_protection_rule()(*ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder) { + return NewItemItemActionsRunsItemDeployment_protection_ruleRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ForceCancel the forceCancel property +// returns a *ItemItemActionsRunsItemForceCancelRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) ForceCancel()(*ItemItemActionsRunsItemForceCancelRequestBuilder) { + return NewItemItemActionsRunsItemForceCancelRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get gets a specific workflow run.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a WorkflowRunable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsWithRun_ItemRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWorkflowRunFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable), nil +} +// Jobs the jobs property +// returns a *ItemItemActionsRunsItemJobsRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Jobs()(*ItemItemActionsRunsItemJobsRequestBuilder) { + return NewItemItemActionsRunsItemJobsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Logs the logs property +// returns a *ItemItemActionsRunsItemLogsRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Logs()(*ItemItemActionsRunsItemLogsRequestBuilder) { + return NewItemItemActionsRunsItemLogsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Pending_deployments the pending_deployments property +// returns a *ItemItemActionsRunsItemPending_deploymentsRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Pending_deployments()(*ItemItemActionsRunsItemPending_deploymentsRequestBuilder) { + return NewItemItemActionsRunsItemPending_deploymentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rerun the rerun property +// returns a *ItemItemActionsRunsItemRerunRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Rerun()(*ItemItemActionsRunsItemRerunRequestBuilder) { + return NewItemItemActionsRunsItemRerunRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// RerunFailedJobs the rerunFailedJobs property +// returns a *ItemItemActionsRunsItemRerunFailedJobsRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) RerunFailedJobs()(*ItemItemActionsRunsItemRerunFailedJobsRequestBuilder) { + return NewItemItemActionsRunsItemRerunFailedJobsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Timing the timing property +// returns a *ItemItemActionsRunsItemTimingRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Timing()(*ItemItemActionsRunsItemTimingRequestBuilder) { + return NewItemItemActionsRunsItemTimingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a specific workflow run.Anyone with write access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a specific workflow run.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsWithRun_ItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunsWithRun_ItemRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsWithRun_ItemRequestBuilder) { + return NewItemItemActionsRunsWithRun_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_get_response.go new file mode 100644 index 000000000..c5e47ba5f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsSecretsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The secrets property + secrets []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable + // The total_count property + total_count *int32 +} +// NewItemItemActionsSecretsGetResponse instantiates a new ItemItemActionsSecretsGetResponse and sets the default values. +func NewItemItemActionsSecretsGetResponse()(*ItemItemActionsSecretsGetResponse) { + m := &ItemItemActionsSecretsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsSecretsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsSecretsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsSecretsGetResponse(), 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 *ItemItemActionsSecretsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsSecretsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsSecretFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable) + } + } + m.SetSecrets(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetSecrets gets the secrets property value. The secrets property +// returns a []ActionsSecretable when successful +func (m *ItemItemActionsSecretsGetResponse) GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable) { + return m.secrets +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsSecretsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsSecretsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecrets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSecrets())) + for i, v := range m.GetSecrets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("secrets", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsSecretsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSecrets sets the secrets property value. The secrets property +func (m *ItemItemActionsSecretsGetResponse) SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable)() { + m.secrets = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsSecretsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsSecretsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable) + GetTotalCount()(*int32) + SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_item_with_secret_name_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_item_with_secret_name_put_request_body.go new file mode 100644 index 000000000..ba9e5085b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_item_with_secret_name_put_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsSecretsItemWithSecret_namePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/actions/secrets#get-a-repository-public-key) endpoint. + encrypted_value *string + // ID of the key you used to encrypt the secret. + key_id *string +} +// NewItemItemActionsSecretsItemWithSecret_namePutRequestBody instantiates a new ItemItemActionsSecretsItemWithSecret_namePutRequestBody and sets the default values. +func NewItemItemActionsSecretsItemWithSecret_namePutRequestBody()(*ItemItemActionsSecretsItemWithSecret_namePutRequestBody) { + m := &ItemItemActionsSecretsItemWithSecret_namePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsSecretsItemWithSecret_namePutRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemItemActionsSecretsItemWithSecret_namePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncryptedValue gets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/actions/secrets#get-a-repository-public-key) endpoint. +// returns a *string when successful +func (m *ItemItemActionsSecretsItemWithSecret_namePutRequestBody) GetEncryptedValue()(*string) { + return m.encrypted_value +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsSecretsItemWithSecret_namePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["encrypted_value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncryptedValue(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + return res +} +// GetKeyId gets the key_id property value. ID of the key you used to encrypt the secret. +// returns a *string when successful +func (m *ItemItemActionsSecretsItemWithSecret_namePutRequestBody) GetKeyId()(*string) { + return m.key_id +} +// Serialize serializes information the current object +func (m *ItemItemActionsSecretsItemWithSecret_namePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("encrypted_value", m.GetEncryptedValue()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsSecretsItemWithSecret_namePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncryptedValue sets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/actions/secrets#get-a-repository-public-key) endpoint. +func (m *ItemItemActionsSecretsItemWithSecret_namePutRequestBody) SetEncryptedValue(value *string)() { + m.encrypted_value = value +} +// SetKeyId sets the key_id property value. ID of the key you used to encrypt the secret. +func (m *ItemItemActionsSecretsItemWithSecret_namePutRequestBody) SetKeyId(value *string)() { + m.key_id = value +} +type ItemItemActionsSecretsItemWithSecret_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncryptedValue()(*string) + GetKeyId()(*string) + SetEncryptedValue(value *string)() + SetKeyId(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_public_key_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_public_key_request_builder.go new file mode 100644 index 000000000..5e7d9e05b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_public_key_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsSecretsPublicKeyRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\secrets\public-key +type ItemItemActionsSecretsPublicKeyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsSecretsPublicKeyRequestBuilderInternal instantiates a new ItemItemActionsSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemItemActionsSecretsPublicKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsSecretsPublicKeyRequestBuilder) { + m := &ItemItemActionsSecretsPublicKeyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/secrets/public-key", pathParameters), + } + return m +} +// NewItemItemActionsSecretsPublicKeyRequestBuilder instantiates a new ItemItemActionsSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemItemActionsSecretsPublicKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsSecretsPublicKeyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsSecretsPublicKeyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsPublicKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key +func (m *ItemItemActionsSecretsPublicKeyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsPublicKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsPublicKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsPublicKeyable), nil +} +// ToGetRequestInformation gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsSecretsPublicKeyRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsSecretsPublicKeyRequestBuilder when successful +func (m *ItemItemActionsSecretsPublicKeyRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsSecretsPublicKeyRequestBuilder) { + return NewItemItemActionsSecretsPublicKeyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_request_builder.go new file mode 100644 index 000000000..7c480a282 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_request_builder.go @@ -0,0 +1,80 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsSecretsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\secrets +type ItemItemActionsSecretsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsSecretsRequestBuilderGetQueryParameters lists all secrets available in a repository without revealing their encryptedvalues.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemActionsSecretsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// BySecret_name gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.actions.secrets.item collection +// returns a *ItemItemActionsSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemItemActionsSecretsRequestBuilder) BySecret_name(secret_name string)(*ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if secret_name != "" { + urlTplParams["secret_name"] = secret_name + } + return NewItemItemActionsSecretsWithSecret_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsSecretsRequestBuilderInternal instantiates a new ItemItemActionsSecretsRequestBuilder and sets the default values. +func NewItemItemActionsSecretsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsSecretsRequestBuilder) { + m := &ItemItemActionsSecretsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/secrets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsSecretsRequestBuilder instantiates a new ItemItemActionsSecretsRequestBuilder and sets the default values. +func NewItemItemActionsSecretsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsSecretsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsSecretsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all secrets available in a repository without revealing their encryptedvalues.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsSecretsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#list-repository-secrets +func (m *ItemItemActionsSecretsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsSecretsRequestBuilderGetQueryParameters])(ItemItemActionsSecretsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsSecretsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsSecretsGetResponseable), nil +} +// PublicKey the publicKey property +// returns a *ItemItemActionsSecretsPublicKeyRequestBuilder when successful +func (m *ItemItemActionsSecretsRequestBuilder) PublicKey()(*ItemItemActionsSecretsPublicKeyRequestBuilder) { + return NewItemItemActionsSecretsPublicKeyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all secrets available in a repository without revealing their encryptedvalues.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsSecretsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsSecretsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsSecretsRequestBuilder when successful +func (m *ItemItemActionsSecretsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsSecretsRequestBuilder) { + return NewItemItemActionsSecretsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_response.go new file mode 100644 index 000000000..cb0576f30 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsSecretsResponse +// Deprecated: This class is obsolete. Use secretsGetResponse instead. +type ItemItemActionsSecretsResponse struct { + ItemItemActionsSecretsGetResponse +} +// NewItemItemActionsSecretsResponse instantiates a new ItemItemActionsSecretsResponse and sets the default values. +func NewItemItemActionsSecretsResponse()(*ItemItemActionsSecretsResponse) { + m := &ItemItemActionsSecretsResponse{ + ItemItemActionsSecretsGetResponse: *NewItemItemActionsSecretsGetResponse(), + } + return m +} +// CreateItemItemActionsSecretsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemActionsSecretsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsSecretsResponse(), nil +} +// ItemItemActionsSecretsResponseable +// Deprecated: This class is obsolete. Use secretsGetResponse instead. +type ItemItemActionsSecretsResponseable interface { + ItemItemActionsSecretsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_with_secret_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_with_secret_name_item_request_builder.go new file mode 100644 index 000000000..07b7a0fed --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_secrets_with_secret_name_item_request_builder.go @@ -0,0 +1,110 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsSecretsWithSecret_nameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\secrets\{secret_name} +type ItemItemActionsSecretsWithSecret_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsSecretsWithSecret_nameItemRequestBuilderInternal instantiates a new ItemItemActionsSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemItemActionsSecretsWithSecret_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) { + m := &ItemItemActionsSecretsWithSecret_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/secrets/{secret_name}", pathParameters), + } + return m +} +// NewItemItemActionsSecretsWithSecret_nameItemRequestBuilder instantiates a new ItemItemActionsSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemItemActionsSecretsWithSecret_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsSecretsWithSecret_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a secret in a repository using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret +func (m *ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a single repository secret without revealing its encrypted value.The authenticated user must have collaborator access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsSecretable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#get-a-repository-secret +func (m *ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsSecretFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable), nil +} +// Put creates or updates a repository secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret +func (m *ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) Put(ctx context.Context, body ItemItemActionsSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToDeleteRequestInformation deletes a secret in a repository using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a single repository secret without revealing its encrypted value.The authenticated user must have collaborator access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation creates or updates a repository secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemActionsSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) { + return NewItemItemActionsSecretsWithSecret_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_get_response.go new file mode 100644 index 000000000..99b40d3ee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsVariablesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The total_count property + total_count *int32 + // The variables property + variables []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable +} +// NewItemItemActionsVariablesGetResponse instantiates a new ItemItemActionsVariablesGetResponse and sets the default values. +func NewItemItemActionsVariablesGetResponse()(*ItemItemActionsVariablesGetResponse) { + m := &ItemItemActionsVariablesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsVariablesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsVariablesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsVariablesGetResponse(), 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 *ItemItemActionsVariablesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsVariablesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + res["variables"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsVariableFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable) + } + } + m.SetVariables(res) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsVariablesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// GetVariables gets the variables property value. The variables property +// returns a []ActionsVariableable when successful +func (m *ItemItemActionsVariablesGetResponse) GetVariables()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable) { + return m.variables +} +// Serialize serializes information the current object +func (m *ItemItemActionsVariablesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + if m.GetVariables() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVariables())) + for i, v := range m.GetVariables() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("variables", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsVariablesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsVariablesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetVariables sets the variables property value. The variables property +func (m *ItemItemActionsVariablesGetResponse) SetVariables(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable)() { + m.variables = value +} +type ItemItemActionsVariablesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalCount()(*int32) + GetVariables()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable) + SetTotalCount(value *int32)() + SetVariables(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_item_with_name_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_item_with_name_patch_request_body.go new file mode 100644 index 000000000..748b2d118 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_item_with_name_patch_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsVariablesItemWithNamePatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name of the variable. + name *string + // The value of the variable. + value *string +} +// NewItemItemActionsVariablesItemWithNamePatchRequestBody instantiates a new ItemItemActionsVariablesItemWithNamePatchRequestBody and sets the default values. +func NewItemItemActionsVariablesItemWithNamePatchRequestBody()(*ItemItemActionsVariablesItemWithNamePatchRequestBody) { + m := &ItemItemActionsVariablesItemWithNamePatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsVariablesItemWithNamePatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsVariablesItemWithNamePatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsVariablesItemWithNamePatchRequestBody(), 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 *ItemItemActionsVariablesItemWithNamePatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsVariablesItemWithNamePatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ItemItemActionsVariablesItemWithNamePatchRequestBody) GetName()(*string) { + return m.name +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ItemItemActionsVariablesItemWithNamePatchRequestBody) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ItemItemActionsVariablesItemWithNamePatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsVariablesItemWithNamePatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name of the variable. +func (m *ItemItemActionsVariablesItemWithNamePatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ItemItemActionsVariablesItemWithNamePatchRequestBody) SetValue(value *string)() { + m.value = value +} +type ItemItemActionsVariablesItemWithNamePatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetValue()(*string) + SetName(value *string)() + SetValue(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_post_request_body.go new file mode 100644 index 000000000..d1b4f5da9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_post_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsVariablesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name of the variable. + name *string + // The value of the variable. + value *string +} +// NewItemItemActionsVariablesPostRequestBody instantiates a new ItemItemActionsVariablesPostRequestBody and sets the default values. +func NewItemItemActionsVariablesPostRequestBody()(*ItemItemActionsVariablesPostRequestBody) { + m := &ItemItemActionsVariablesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsVariablesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsVariablesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsVariablesPostRequestBody(), 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 *ItemItemActionsVariablesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsVariablesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ItemItemActionsVariablesPostRequestBody) GetName()(*string) { + return m.name +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ItemItemActionsVariablesPostRequestBody) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ItemItemActionsVariablesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsVariablesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name of the variable. +func (m *ItemItemActionsVariablesPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ItemItemActionsVariablesPostRequestBody) SetValue(value *string)() { + m.value = value +} +type ItemItemActionsVariablesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetValue()(*string) + SetName(value *string)() + SetValue(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_request_builder.go new file mode 100644 index 000000000..5fd1dc22c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_request_builder.go @@ -0,0 +1,107 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsVariablesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\variables +type ItemItemActionsVariablesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsVariablesRequestBuilderGetQueryParameters lists all repository variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemActionsVariablesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 30). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByName gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.actions.variables.item collection +// returns a *ItemItemActionsVariablesWithNameItemRequestBuilder when successful +func (m *ItemItemActionsVariablesRequestBuilder) ByName(name string)(*ItemItemActionsVariablesWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewItemItemActionsVariablesWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsVariablesRequestBuilderInternal instantiates a new ItemItemActionsVariablesRequestBuilder and sets the default values. +func NewItemItemActionsVariablesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsVariablesRequestBuilder) { + m := &ItemItemActionsVariablesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/variables{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsVariablesRequestBuilder instantiates a new ItemItemActionsVariablesRequestBuilder and sets the default values. +func NewItemItemActionsVariablesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsVariablesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsVariablesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all repository variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsVariablesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#list-repository-variables +func (m *ItemItemActionsVariablesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsVariablesRequestBuilderGetQueryParameters])(ItemItemActionsVariablesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsVariablesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsVariablesGetResponseable), nil +} +// Post creates a repository variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#create-a-repository-variable +func (m *ItemItemActionsVariablesRequestBuilder) Post(ctx context.Context, body ItemItemActionsVariablesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToGetRequestInformation lists all repository variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsVariablesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsVariablesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a repository variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsVariablesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemActionsVariablesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsVariablesRequestBuilder when successful +func (m *ItemItemActionsVariablesRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsVariablesRequestBuilder) { + return NewItemItemActionsVariablesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_response.go new file mode 100644 index 000000000..c425e0a58 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsVariablesResponse +// Deprecated: This class is obsolete. Use variablesGetResponse instead. +type ItemItemActionsVariablesResponse struct { + ItemItemActionsVariablesGetResponse +} +// NewItemItemActionsVariablesResponse instantiates a new ItemItemActionsVariablesResponse and sets the default values. +func NewItemItemActionsVariablesResponse()(*ItemItemActionsVariablesResponse) { + m := &ItemItemActionsVariablesResponse{ + ItemItemActionsVariablesGetResponse: *NewItemItemActionsVariablesGetResponse(), + } + return m +} +// CreateItemItemActionsVariablesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemActionsVariablesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsVariablesResponse(), nil +} +// ItemItemActionsVariablesResponseable +// Deprecated: This class is obsolete. Use variablesGetResponse instead. +type ItemItemActionsVariablesResponseable interface { + ItemItemActionsVariablesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_with_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_with_name_item_request_builder.go new file mode 100644 index 000000000..65510a2b3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_variables_with_name_item_request_builder.go @@ -0,0 +1,105 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsVariablesWithNameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\variables\{name} +type ItemItemActionsVariablesWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsVariablesWithNameItemRequestBuilderInternal instantiates a new ItemItemActionsVariablesWithNameItemRequestBuilder and sets the default values. +func NewItemItemActionsVariablesWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsVariablesWithNameItemRequestBuilder) { + m := &ItemItemActionsVariablesWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/variables/{name}", pathParameters), + } + return m +} +// NewItemItemActionsVariablesWithNameItemRequestBuilder instantiates a new ItemItemActionsVariablesWithNameItemRequestBuilder and sets the default values. +func NewItemItemActionsVariablesWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsVariablesWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsVariablesWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a repository variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#delete-a-repository-variable +func (m *ItemItemActionsVariablesWithNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a specific variable in a repository.The authenticated user must have collaborator access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsVariableable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#get-a-repository-variable +func (m *ItemItemActionsVariablesWithNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsVariableFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable), nil +} +// Patch updates a repository variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#update-a-repository-variable +func (m *ItemItemActionsVariablesWithNameItemRequestBuilder) Patch(ctx context.Context, body ItemItemActionsVariablesItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation deletes a repository variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsVariablesWithNameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a specific variable in a repository.The authenticated user must have collaborator access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsVariablesWithNameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates a repository variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsVariablesWithNameItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemActionsVariablesItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsVariablesWithNameItemRequestBuilder when successful +func (m *ItemItemActionsVariablesWithNameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsVariablesWithNameItemRequestBuilder) { + return NewItemItemActionsVariablesWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_get_response.go new file mode 100644 index 000000000..dd0a0cf00 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsWorkflowsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The total_count property + total_count *int32 + // The workflows property + workflows []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Workflowable +} +// NewItemItemActionsWorkflowsGetResponse instantiates a new ItemItemActionsWorkflowsGetResponse and sets the default values. +func NewItemItemActionsWorkflowsGetResponse()(*ItemItemActionsWorkflowsGetResponse) { + m := &ItemItemActionsWorkflowsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsWorkflowsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsWorkflowsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsWorkflowsGetResponse(), 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 *ItemItemActionsWorkflowsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsWorkflowsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + res["workflows"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWorkflowFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Workflowable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Workflowable) + } + } + m.SetWorkflows(res) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsWorkflowsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// GetWorkflows gets the workflows property value. The workflows property +// returns a []Workflowable when successful +func (m *ItemItemActionsWorkflowsGetResponse) GetWorkflows()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Workflowable) { + return m.workflows +} +// Serialize serializes information the current object +func (m *ItemItemActionsWorkflowsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + if m.GetWorkflows() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetWorkflows())) + for i, v := range m.GetWorkflows() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("workflows", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsWorkflowsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsWorkflowsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetWorkflows sets the workflows property value. The workflows property +func (m *ItemItemActionsWorkflowsGetResponse) SetWorkflows(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Workflowable)() { + m.workflows = value +} +type ItemItemActionsWorkflowsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalCount()(*int32) + GetWorkflows()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Workflowable) + SetTotalCount(value *int32)() + SetWorkflows(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Workflowable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_disable_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_disable_request_builder.go new file mode 100644 index 000000000..2c16ae012 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_disable_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsWorkflowsItemDisableRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\workflows\{workflow_id}\disable +type ItemItemActionsWorkflowsItemDisableRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsWorkflowsItemDisableRequestBuilderInternal instantiates a new ItemItemActionsWorkflowsItemDisableRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemDisableRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemDisableRequestBuilder) { + m := &ItemItemActionsWorkflowsItemDisableRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/workflows/{workflow_id}/disable", pathParameters), + } + return m +} +// NewItemItemActionsWorkflowsItemDisableRequestBuilder instantiates a new ItemItemActionsWorkflowsItemDisableRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemDisableRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemDisableRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsWorkflowsItemDisableRequestBuilderInternal(urlParams, requestAdapter) +} +// Put disables a workflow and sets the `state` of the workflow to `disabled_manually`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflows#disable-a-workflow +func (m *ItemItemActionsWorkflowsItemDisableRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToPutRequestInformation disables a workflow and sets the `state` of the workflow to `disabled_manually`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsWorkflowsItemDisableRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsWorkflowsItemDisableRequestBuilder when successful +func (m *ItemItemActionsWorkflowsItemDisableRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsWorkflowsItemDisableRequestBuilder) { + return NewItemItemActionsWorkflowsItemDisableRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_dispatches_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_dispatches_post_request_body.go new file mode 100644 index 000000000..d156f3a7f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_dispatches_post_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsWorkflowsItemDispatchesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when `inputs` are omitted. + inputs ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsable + // The git reference for the workflow. The reference can be a branch or tag name. + ref *string +} +// NewItemItemActionsWorkflowsItemDispatchesPostRequestBody instantiates a new ItemItemActionsWorkflowsItemDispatchesPostRequestBody and sets the default values. +func NewItemItemActionsWorkflowsItemDispatchesPostRequestBody()(*ItemItemActionsWorkflowsItemDispatchesPostRequestBody) { + m := &ItemItemActionsWorkflowsItemDispatchesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsWorkflowsItemDispatchesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsWorkflowsItemDispatchesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsWorkflowsItemDispatchesPostRequestBody(), 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 *ItemItemActionsWorkflowsItemDispatchesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsWorkflowsItemDispatchesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["inputs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInputs(val.(ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsable)) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + return res +} +// GetInputs gets the inputs property value. Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when `inputs` are omitted. +// returns a ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsable when successful +func (m *ItemItemActionsWorkflowsItemDispatchesPostRequestBody) GetInputs()(ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsable) { + return m.inputs +} +// GetRef gets the ref property value. The git reference for the workflow. The reference can be a branch or tag name. +// returns a *string when successful +func (m *ItemItemActionsWorkflowsItemDispatchesPostRequestBody) GetRef()(*string) { + return m.ref +} +// Serialize serializes information the current object +func (m *ItemItemActionsWorkflowsItemDispatchesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("inputs", m.GetInputs()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + 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 *ItemItemActionsWorkflowsItemDispatchesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetInputs sets the inputs property value. Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when `inputs` are omitted. +func (m *ItemItemActionsWorkflowsItemDispatchesPostRequestBody) SetInputs(value ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsable)() { + m.inputs = value +} +// SetRef sets the ref property value. The git reference for the workflow. The reference can be a branch or tag name. +func (m *ItemItemActionsWorkflowsItemDispatchesPostRequestBody) SetRef(value *string)() { + m.ref = value +} +type ItemItemActionsWorkflowsItemDispatchesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInputs()(ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsable) + GetRef()(*string) + SetInputs(value ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsable)() + SetRef(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_dispatches_post_request_body_inputs.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_dispatches_post_request_body_inputs.go new file mode 100644 index 000000000..29ed3ceb1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_dispatches_post_request_body_inputs.go @@ -0,0 +1,52 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when `inputs` are omitted. +type ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs instantiates a new ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs and sets the default values. +func NewItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs()(*ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs) { + m := &ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs(), 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 *ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_dispatches_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_dispatches_request_builder.go new file mode 100644 index 000000000..1d4f12a36 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_dispatches_request_builder.go @@ -0,0 +1,55 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsWorkflowsItemDispatchesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\workflows\{workflow_id}\dispatches +type ItemItemActionsWorkflowsItemDispatchesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsWorkflowsItemDispatchesRequestBuilderInternal instantiates a new ItemItemActionsWorkflowsItemDispatchesRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemDispatchesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemDispatchesRequestBuilder) { + m := &ItemItemActionsWorkflowsItemDispatchesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/workflows/{workflow_id}/dispatches", pathParameters), + } + return m +} +// NewItemItemActionsWorkflowsItemDispatchesRequestBuilder instantiates a new ItemItemActionsWorkflowsItemDispatchesRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemDispatchesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemDispatchesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsWorkflowsItemDispatchesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post you can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.You must configure your GitHub Actions workflow to run when the [`workflow_dispatch` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The `inputs` are configured in the workflow file. For more information about how to configure the `workflow_dispatch` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)."OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event +func (m *ItemItemActionsWorkflowsItemDispatchesRequestBuilder) Post(ctx context.Context, body ItemItemActionsWorkflowsItemDispatchesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation you can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.You must configure your GitHub Actions workflow to run when the [`workflow_dispatch` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The `inputs` are configured in the workflow file. For more information about how to configure the `workflow_dispatch` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)."OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsWorkflowsItemDispatchesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemActionsWorkflowsItemDispatchesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsWorkflowsItemDispatchesRequestBuilder when successful +func (m *ItemItemActionsWorkflowsItemDispatchesRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsWorkflowsItemDispatchesRequestBuilder) { + return NewItemItemActionsWorkflowsItemDispatchesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_enable_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_enable_request_builder.go new file mode 100644 index 000000000..37fd5a7da --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_enable_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsWorkflowsItemEnableRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\workflows\{workflow_id}\enable +type ItemItemActionsWorkflowsItemEnableRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsWorkflowsItemEnableRequestBuilderInternal instantiates a new ItemItemActionsWorkflowsItemEnableRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemEnableRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemEnableRequestBuilder) { + m := &ItemItemActionsWorkflowsItemEnableRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/workflows/{workflow_id}/enable", pathParameters), + } + return m +} +// NewItemItemActionsWorkflowsItemEnableRequestBuilder instantiates a new ItemItemActionsWorkflowsItemEnableRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemEnableRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemEnableRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsWorkflowsItemEnableRequestBuilderInternal(urlParams, requestAdapter) +} +// Put enables a workflow and sets the `state` of the workflow to `active`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflows#enable-a-workflow +func (m *ItemItemActionsWorkflowsItemEnableRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToPutRequestInformation enables a workflow and sets the `state` of the workflow to `active`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsWorkflowsItemEnableRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsWorkflowsItemEnableRequestBuilder when successful +func (m *ItemItemActionsWorkflowsItemEnableRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsWorkflowsItemEnableRequestBuilder) { + return NewItemItemActionsWorkflowsItemEnableRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_runs_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_runs_get_response.go new file mode 100644 index 000000000..6e5545d4f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_runs_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemActionsWorkflowsItemRunsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The total_count property + total_count *int32 + // The workflow_runs property + workflow_runs []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable +} +// NewItemItemActionsWorkflowsItemRunsGetResponse instantiates a new ItemItemActionsWorkflowsItemRunsGetResponse and sets the default values. +func NewItemItemActionsWorkflowsItemRunsGetResponse()(*ItemItemActionsWorkflowsItemRunsGetResponse) { + m := &ItemItemActionsWorkflowsItemRunsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsWorkflowsItemRunsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsWorkflowsItemRunsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsWorkflowsItemRunsGetResponse(), 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 *ItemItemActionsWorkflowsItemRunsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsWorkflowsItemRunsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + res["workflow_runs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWorkflowRunFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable) + } + } + m.SetWorkflowRuns(res) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsWorkflowsItemRunsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// GetWorkflowRuns gets the workflow_runs property value. The workflow_runs property +// returns a []WorkflowRunable when successful +func (m *ItemItemActionsWorkflowsItemRunsGetResponse) GetWorkflowRuns()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable) { + return m.workflow_runs +} +// Serialize serializes information the current object +func (m *ItemItemActionsWorkflowsItemRunsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + if m.GetWorkflowRuns() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetWorkflowRuns())) + for i, v := range m.GetWorkflowRuns() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("workflow_runs", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemActionsWorkflowsItemRunsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsWorkflowsItemRunsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetWorkflowRuns sets the workflow_runs property value. The workflow_runs property +func (m *ItemItemActionsWorkflowsItemRunsGetResponse) SetWorkflowRuns(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable)() { + m.workflow_runs = value +} +type ItemItemActionsWorkflowsItemRunsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalCount()(*int32) + GetWorkflowRuns()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable) + SetTotalCount(value *int32)() + SetWorkflowRuns(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowRunable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_runs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_runs_request_builder.go new file mode 100644 index 000000000..9cae1954d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_runs_request_builder.go @@ -0,0 +1,81 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ia77747759b3f91e25296248277ed17f00dd8b68db982a03262ffc61b4720274c "github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/workflows/item/runs" +) + +// ItemItemActionsWorkflowsItemRunsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\workflows\{workflow_id}\runs +type ItemItemActionsWorkflowsItemRunsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsWorkflowsItemRunsRequestBuilderGetQueryParameters list all workflow runs for a workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpointOAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemActionsWorkflowsItemRunsRequestBuilderGetQueryParameters struct { + // Returns someone's workflow runs. Use the login for the user who created the `push` associated with the check suite or workflow run. + Actor *string `uriparametername:"actor"` + // Returns workflow runs associated with a branch. Use the name of the branch of the `push`. + Branch *string `uriparametername:"branch"` + // Returns workflow runs with the `check_suite_id` that you specify. + Check_suite_id *int32 `uriparametername:"check_suite_id"` + // Returns workflow runs created within the given date-time range. For more information on the syntax, see "[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)." + Created *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"created"` + // Returns workflow run triggered by the event you specify. For example, `push`, `pull_request` or `issue`. For more information, see "[Events that trigger workflows](https://docs.github.com/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." + Event *string `uriparametername:"event"` + // If `true` pull requests are omitted from the response (empty array). + Exclude_pull_requests *bool `uriparametername:"exclude_pull_requests"` + // Only returns workflow runs that are associated with the specified `head_sha`. + Head_sha *string `uriparametername:"head_sha"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Returns workflow runs with the check run `status` or `conclusion` that you specify. For example, a conclusion can be `success` or a status can be `in_progress`. Only GitHub Actions can set a status of `waiting`, `pending`, or `requested`. + Status *ia77747759b3f91e25296248277ed17f00dd8b68db982a03262ffc61b4720274c.GetStatusQueryParameterType `uriparametername:"status"` +} +// NewItemItemActionsWorkflowsItemRunsRequestBuilderInternal instantiates a new ItemItemActionsWorkflowsItemRunsRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemRunsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemRunsRequestBuilder) { + m := &ItemItemActionsWorkflowsItemRunsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/workflows/{workflow_id}/runs{?actor*,branch*,check_suite_id*,created*,event*,exclude_pull_requests*,head_sha*,page*,per_page*,status*}", pathParameters), + } + return m +} +// NewItemItemActionsWorkflowsItemRunsRequestBuilder instantiates a new ItemItemActionsWorkflowsItemRunsRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemRunsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemRunsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsWorkflowsItemRunsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all workflow runs for a workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpointOAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemActionsWorkflowsItemRunsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow +func (m *ItemItemActionsWorkflowsItemRunsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsWorkflowsItemRunsRequestBuilderGetQueryParameters])(ItemItemActionsWorkflowsItemRunsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsWorkflowsItemRunsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsWorkflowsItemRunsGetResponseable), nil +} +// ToGetRequestInformation list all workflow runs for a workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpointOAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsWorkflowsItemRunsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsWorkflowsItemRunsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsWorkflowsItemRunsRequestBuilder when successful +func (m *ItemItemActionsWorkflowsItemRunsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsWorkflowsItemRunsRequestBuilder) { + return NewItemItemActionsWorkflowsItemRunsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_runs_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_runs_response.go new file mode 100644 index 000000000..b29f62084 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_runs_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsWorkflowsItemRunsResponse +// Deprecated: This class is obsolete. Use runsGetResponse instead. +type ItemItemActionsWorkflowsItemRunsResponse struct { + ItemItemActionsWorkflowsItemRunsGetResponse +} +// NewItemItemActionsWorkflowsItemRunsResponse instantiates a new ItemItemActionsWorkflowsItemRunsResponse and sets the default values. +func NewItemItemActionsWorkflowsItemRunsResponse()(*ItemItemActionsWorkflowsItemRunsResponse) { + m := &ItemItemActionsWorkflowsItemRunsResponse{ + ItemItemActionsWorkflowsItemRunsGetResponse: *NewItemItemActionsWorkflowsItemRunsGetResponse(), + } + return m +} +// CreateItemItemActionsWorkflowsItemRunsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemActionsWorkflowsItemRunsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsWorkflowsItemRunsResponse(), nil +} +// ItemItemActionsWorkflowsItemRunsResponseable +// Deprecated: This class is obsolete. Use runsGetResponse instead. +type ItemItemActionsWorkflowsItemRunsResponseable interface { + ItemItemActionsWorkflowsItemRunsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_timing_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_timing_request_builder.go new file mode 100644 index 000000000..0de1722c1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_item_timing_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsWorkflowsItemTimingRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\workflows\{workflow_id}\timing +type ItemItemActionsWorkflowsItemTimingRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsWorkflowsItemTimingRequestBuilderInternal instantiates a new ItemItemActionsWorkflowsItemTimingRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemTimingRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemTimingRequestBuilder) { + m := &ItemItemActionsWorkflowsItemTimingRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/workflows/{workflow_id}/timing", pathParameters), + } + return m +} +// NewItemItemActionsWorkflowsItemTimingRequestBuilder instantiates a new ItemItemActionsWorkflowsItemTimingRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemTimingRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemTimingRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsWorkflowsItemTimingRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)".You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a WorkflowUsageable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflows#get-workflow-usage +func (m *ItemItemActionsWorkflowsItemTimingRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowUsageable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWorkflowUsageFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WorkflowUsageable), nil +} +// ToGetRequestInformation gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)".You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsWorkflowsItemTimingRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsWorkflowsItemTimingRequestBuilder when successful +func (m *ItemItemActionsWorkflowsItemTimingRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsWorkflowsItemTimingRequestBuilder) { + return NewItemItemActionsWorkflowsItemTimingRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_request_builder.go new file mode 100644 index 000000000..df3ec0382 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_request_builder.go @@ -0,0 +1,74 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsWorkflowsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\workflows +type ItemItemActionsWorkflowsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsWorkflowsRequestBuilderGetQueryParameters lists the workflows in a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemActionsWorkflowsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByWorkflow_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.actions.workflows.item collection +// returns a *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder when successful +func (m *ItemItemActionsWorkflowsRequestBuilder) ByWorkflow_id(workflow_id int32)(*ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["workflow_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(workflow_id), 10) + return NewItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsWorkflowsRequestBuilderInternal instantiates a new ItemItemActionsWorkflowsRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsRequestBuilder) { + m := &ItemItemActionsWorkflowsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/workflows{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsWorkflowsRequestBuilder instantiates a new ItemItemActionsWorkflowsRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsWorkflowsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the workflows in a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemActionsWorkflowsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflows#list-repository-workflows +func (m *ItemItemActionsWorkflowsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsWorkflowsRequestBuilderGetQueryParameters])(ItemItemActionsWorkflowsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsWorkflowsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsWorkflowsGetResponseable), nil +} +// ToGetRequestInformation lists the workflows in a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsWorkflowsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsWorkflowsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsWorkflowsRequestBuilder when successful +func (m *ItemItemActionsWorkflowsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsWorkflowsRequestBuilder) { + return NewItemItemActionsWorkflowsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_response.go new file mode 100644 index 000000000..74971b96b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsWorkflowsResponse +// Deprecated: This class is obsolete. Use workflowsGetResponse instead. +type ItemItemActionsWorkflowsResponse struct { + ItemItemActionsWorkflowsGetResponse +} +// NewItemItemActionsWorkflowsResponse instantiates a new ItemItemActionsWorkflowsResponse and sets the default values. +func NewItemItemActionsWorkflowsResponse()(*ItemItemActionsWorkflowsResponse) { + m := &ItemItemActionsWorkflowsResponse{ + ItemItemActionsWorkflowsGetResponse: *NewItemItemActionsWorkflowsGetResponse(), + } + return m +} +// CreateItemItemActionsWorkflowsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemActionsWorkflowsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsWorkflowsResponse(), nil +} +// ItemItemActionsWorkflowsResponseable +// Deprecated: This class is obsolete. Use workflowsGetResponse instead. +type ItemItemActionsWorkflowsResponseable interface { + ItemItemActionsWorkflowsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_with_workflow_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_with_workflow_item_request_builder.go new file mode 100644 index 000000000..d52d9260d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_actions_workflows_with_workflow_item_request_builder.go @@ -0,0 +1,82 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\workflows\{workflow_id} +type ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilderInternal instantiates a new ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) { + m := &ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/workflows/{workflow_id}", pathParameters), + } + return m +} +// NewItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder instantiates a new ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Disable the disable property +// returns a *ItemItemActionsWorkflowsItemDisableRequestBuilder when successful +func (m *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) Disable()(*ItemItemActionsWorkflowsItemDisableRequestBuilder) { + return NewItemItemActionsWorkflowsItemDisableRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Dispatches the dispatches property +// returns a *ItemItemActionsWorkflowsItemDispatchesRequestBuilder when successful +func (m *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) Dispatches()(*ItemItemActionsWorkflowsItemDispatchesRequestBuilder) { + return NewItemItemActionsWorkflowsItemDispatchesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Enable the enable property +// returns a *ItemItemActionsWorkflowsItemEnableRequestBuilder when successful +func (m *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) Enable()(*ItemItemActionsWorkflowsItemEnableRequestBuilder) { + return NewItemItemActionsWorkflowsItemEnableRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get gets a specific workflow. You can replace `workflow_id` with the workflowfile name. For example, you could use `main.yaml`.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a Workflowable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/workflows#get-a-workflow +func (m *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Workflowable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWorkflowFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Workflowable), nil +} +// Runs the runs property +// returns a *ItemItemActionsWorkflowsItemRunsRequestBuilder when successful +func (m *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) Runs()(*ItemItemActionsWorkflowsItemRunsRequestBuilder) { + return NewItemItemActionsWorkflowsItemRunsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Timing the timing property +// returns a *ItemItemActionsWorkflowsItemTimingRequestBuilder when successful +func (m *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) Timing()(*ItemItemActionsWorkflowsItemTimingRequestBuilder) { + return NewItemItemActionsWorkflowsItemTimingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation gets a specific workflow. You can replace `workflow_id` with the workflowfile name. For example, you could use `main.yaml`.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder when successful +func (m *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) { + return NewItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_activity_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_activity_request_builder.go new file mode 100644 index 000000000..25b3aaf75 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_activity_request_builder.go @@ -0,0 +1,84 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + ia4d3c00087c8cd3d0487630fd16ea548b5ca8c46c90d4b6d272efa6624a02bb6 "github.com/octokit/go-sdk/pkg/github/repos/item/item/activity" +) + +// ItemItemActivityRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\activity +type ItemItemActivityRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActivityRequestBuilderGetQueryParameters lists a detailed history of changes to a repository, such as pushes, merges, force pushes, and branch changes, and associates these changes with commits and users.For more information about viewing repository activity,see "[Viewing activity and data for your repository](https://docs.github.com/repositories/viewing-activity-and-data-for-your-repository)." +type ItemItemActivityRequestBuilderGetQueryParameters struct { + // The activity type to filter by.For example, you can choose to filter by "force_push", to see all force pushes to the repository. + Activity_type *ia4d3c00087c8cd3d0487630fd16ea548b5ca8c46c90d4b6d272efa6624a02bb6.GetActivity_typeQueryParameterType `uriparametername:"activity_type"` + // The GitHub username to use to filter by the actor who performed the activity. + Actor *string `uriparametername:"actor"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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)." + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *ia4d3c00087c8cd3d0487630fd16ea548b5ca8c46c90d4b6d272efa6624a02bb6.GetDirectionQueryParameterType `uriparametername:"direction"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The Git reference for the activities you want to list.The `ref` for a branch can be formatted either as `refs/heads/BRANCH_NAME` or `BRANCH_NAME`, where `BRANCH_NAME` is the name of your branch. + Ref *string `uriparametername:"ref"` + // The time period to filter by.For example, `day` will filter for activity that occurred in the past 24 hours, and `week` will filter for activity that occurred in the past 7 days (168 hours). + Time_period *ia4d3c00087c8cd3d0487630fd16ea548b5ca8c46c90d4b6d272efa6624a02bb6.GetTime_periodQueryParameterType `uriparametername:"time_period"` +} +// NewItemItemActivityRequestBuilderInternal instantiates a new ItemItemActivityRequestBuilder and sets the default values. +func NewItemItemActivityRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActivityRequestBuilder) { + m := &ItemItemActivityRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/activity{?activity_type*,actor*,after*,before*,direction*,per_page*,ref*,time_period*}", pathParameters), + } + return m +} +// NewItemItemActivityRequestBuilder instantiates a new ItemItemActivityRequestBuilder and sets the default values. +func NewItemItemActivityRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActivityRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActivityRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists a detailed history of changes to a repository, such as pushes, merges, force pushes, and branch changes, and associates these changes with commits and users.For more information about viewing repository activity,see "[Viewing activity and data for your repository](https://docs.github.com/repositories/viewing-activity-and-data-for-your-repository)." +// returns a []Activityable when successful +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#list-repository-activities +func (m *ItemItemActivityRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActivityRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Activityable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActivityFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Activityable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Activityable) + } + } + return val, nil +} +// ToGetRequestInformation lists a detailed history of changes to a repository, such as pushes, merges, force pushes, and branch changes, and associates these changes with commits and users.For more information about viewing repository activity,see "[Viewing activity and data for your repository](https://docs.github.com/repositories/viewing-activity-and-data-for-your-repository)." +// returns a *RequestInformation when successful +func (m *ItemItemActivityRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActivityRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActivityRequestBuilder when successful +func (m *ItemItemActivityRequestBuilder) WithUrl(rawUrl string)(*ItemItemActivityRequestBuilder) { + return NewItemItemActivityRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_assignees_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_assignees_request_builder.go new file mode 100644 index 000000000..77e812c2a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_assignees_request_builder.go @@ -0,0 +1,83 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemAssigneesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\assignees +type ItemItemAssigneesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemAssigneesRequestBuilderGetQueryParameters lists the [available assignees](https://docs.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. +type ItemItemAssigneesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByAssignee gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.assignees.item collection +// returns a *ItemItemAssigneesWithAssigneeItemRequestBuilder when successful +func (m *ItemItemAssigneesRequestBuilder) ByAssignee(assignee string)(*ItemItemAssigneesWithAssigneeItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if assignee != "" { + urlTplParams["assignee"] = assignee + } + return NewItemItemAssigneesWithAssigneeItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemAssigneesRequestBuilderInternal instantiates a new ItemItemAssigneesRequestBuilder and sets the default values. +func NewItemItemAssigneesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAssigneesRequestBuilder) { + m := &ItemItemAssigneesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/assignees{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemAssigneesRequestBuilder instantiates a new ItemItemAssigneesRequestBuilder and sets the default values. +func NewItemItemAssigneesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAssigneesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemAssigneesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the [available assignees](https://docs.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. +// returns a []SimpleUserable 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/issues/assignees#list-assignees +func (m *ItemItemAssigneesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemAssigneesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation lists the [available assignees](https://docs.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. +// returns a *RequestInformation when successful +func (m *ItemItemAssigneesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemAssigneesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemAssigneesRequestBuilder when successful +func (m *ItemItemAssigneesRequestBuilder) WithUrl(rawUrl string)(*ItemItemAssigneesRequestBuilder) { + return NewItemItemAssigneesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_assignees_with_assignee_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_assignees_with_assignee_item_request_builder.go new file mode 100644 index 000000000..c72290c3a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_assignees_with_assignee_item_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemAssigneesWithAssigneeItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\assignees\{assignee} +type ItemItemAssigneesWithAssigneeItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemAssigneesWithAssigneeItemRequestBuilderInternal instantiates a new ItemItemAssigneesWithAssigneeItemRequestBuilder and sets the default values. +func NewItemItemAssigneesWithAssigneeItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAssigneesWithAssigneeItemRequestBuilder) { + m := &ItemItemAssigneesWithAssigneeItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/assignees/{assignee}", pathParameters), + } + return m +} +// NewItemItemAssigneesWithAssigneeItemRequestBuilder instantiates a new ItemItemAssigneesWithAssigneeItemRequestBuilder and sets the default values. +func NewItemItemAssigneesWithAssigneeItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAssigneesWithAssigneeItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemAssigneesWithAssigneeItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get checks if a user has permission to be assigned to an issue in this repository.If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned.Otherwise a `404` status code is returned. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned +func (m *ItemItemAssigneesWithAssigneeItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation checks if a user has permission to be assigned to an issue in this repository.If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned.Otherwise a `404` status code is returned. +// returns a *RequestInformation when successful +func (m *ItemItemAssigneesWithAssigneeItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemAssigneesWithAssigneeItemRequestBuilder when successful +func (m *ItemItemAssigneesWithAssigneeItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemAssigneesWithAssigneeItemRequestBuilder) { + return NewItemItemAssigneesWithAssigneeItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_item_with_subject_digest_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_item_with_subject_digest_get_response.go new file mode 100644 index 000000000..820ff3a2a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_item_with_subject_digest_get_response.go @@ -0,0 +1,92 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemAttestationsItemWithSubject_digestGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The attestations property + attestations []ItemItemAttestationsItemWithSubject_digestGetResponse_attestationsable +} +// NewItemItemAttestationsItemWithSubject_digestGetResponse instantiates a new ItemItemAttestationsItemWithSubject_digestGetResponse and sets the default values. +func NewItemItemAttestationsItemWithSubject_digestGetResponse()(*ItemItemAttestationsItemWithSubject_digestGetResponse) { + m := &ItemItemAttestationsItemWithSubject_digestGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemAttestationsItemWithSubject_digestGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemAttestationsItemWithSubject_digestGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemAttestationsItemWithSubject_digestGetResponse(), 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 *ItemItemAttestationsItemWithSubject_digestGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAttestations gets the attestations property value. The attestations property +// returns a []ItemItemAttestationsItemWithSubject_digestGetResponse_attestationsable when successful +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse) GetAttestations()([]ItemItemAttestationsItemWithSubject_digestGetResponse_attestationsable) { + return m.attestations +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["attestations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemAttestationsItemWithSubject_digestGetResponse_attestationsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemAttestationsItemWithSubject_digestGetResponse_attestationsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemAttestationsItemWithSubject_digestGetResponse_attestationsable) + } + } + m.SetAttestations(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAttestations() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAttestations())) + for i, v := range m.GetAttestations() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("attestations", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAttestations sets the attestations property value. The attestations property +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse) SetAttestations(value []ItemItemAttestationsItemWithSubject_digestGetResponse_attestationsable)() { + m.attestations = value +} +type ItemItemAttestationsItemWithSubject_digestGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAttestations()([]ItemItemAttestationsItemWithSubject_digestGetResponse_attestationsable) + SetAttestations(value []ItemItemAttestationsItemWithSubject_digestGetResponse_attestationsable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_item_with_subject_digest_get_response_attestations.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_item_with_subject_digest_get_response_attestations.go new file mode 100644 index 000000000..71b36e3b1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_item_with_subject_digest_get_response_attestations.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemAttestationsItemWithSubject_digestGetResponse_attestations struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The attestation's Sigstore Bundle.Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. + bundle ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable + // The repository_id property + repository_id *int32 +} +// NewItemItemAttestationsItemWithSubject_digestGetResponse_attestations instantiates a new ItemItemAttestationsItemWithSubject_digestGetResponse_attestations and sets the default values. +func NewItemItemAttestationsItemWithSubject_digestGetResponse_attestations()(*ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) { + m := &ItemItemAttestationsItemWithSubject_digestGetResponse_attestations{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemAttestationsItemWithSubject_digestGetResponse_attestationsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemAttestationsItemWithSubject_digestGetResponse_attestationsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemAttestationsItemWithSubject_digestGetResponse_attestations(), 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 *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBundle gets the bundle property value. The attestation's Sigstore Bundle.Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. +// returns a ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable when successful +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) GetBundle()(ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable) { + return m.bundle +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bundle"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBundle(val.(ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable)) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + return res +} +// GetRepositoryId gets the repository_id property value. The repository_id property +// returns a *int32 when successful +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) GetRepositoryId()(*int32) { + return m.repository_id +} +// Serialize serializes information the current object +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("bundle", m.GetBundle()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + 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 *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBundle sets the bundle property value. The attestation's Sigstore Bundle.Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) SetBundle(value ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable)() { + m.bundle = value +} +// SetRepositoryId sets the repository_id property value. The repository_id property +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) SetRepositoryId(value *int32)() { + m.repository_id = value +} +type ItemItemAttestationsItemWithSubject_digestGetResponse_attestationsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBundle()(ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable) + GetRepositoryId()(*int32) + SetBundle(value ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable)() + SetRepositoryId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_item_with_subject_digest_get_response_attestations_bundle.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_item_with_subject_digest_get_response_attestations_bundle.go new file mode 100644 index 000000000..608b20c5b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_item_with_subject_digest_get_response_attestations_bundle.go @@ -0,0 +1,139 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle the attestation's Sigstore Bundle.Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. +type ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The dsseEnvelope property + dsseEnvelope ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeable + // The mediaType property + mediaType *string + // The verificationMaterial property + verificationMaterial ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialable +} +// NewItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle instantiates a new ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle and sets the default values. +func NewItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle()(*ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) { + m := &ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle(), 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 *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDsseEnvelope gets the dsseEnvelope property value. The dsseEnvelope property +// returns a ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeable when successful +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) GetDsseEnvelope()(ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeable) { + return m.dsseEnvelope +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["dsseEnvelope"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDsseEnvelope(val.(ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeable)) + } + return nil + } + res["mediaType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMediaType(val) + } + return nil + } + res["verificationMaterial"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerificationMaterial(val.(ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialable)) + } + return nil + } + return res +} +// GetMediaType gets the mediaType property value. The mediaType property +// returns a *string when successful +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) GetMediaType()(*string) { + return m.mediaType +} +// GetVerificationMaterial gets the verificationMaterial property value. The verificationMaterial property +// returns a ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialable when successful +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) GetVerificationMaterial()(ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialable) { + return m.verificationMaterial +} +// Serialize serializes information the current object +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("dsseEnvelope", m.GetDsseEnvelope()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mediaType", m.GetMediaType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("verificationMaterial", m.GetVerificationMaterial()) + 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 *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDsseEnvelope sets the dsseEnvelope property value. The dsseEnvelope property +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) SetDsseEnvelope(value ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeable)() { + m.dsseEnvelope = value +} +// SetMediaType sets the mediaType property value. The mediaType property +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) SetMediaType(value *string)() { + m.mediaType = value +} +// SetVerificationMaterial sets the verificationMaterial property value. The verificationMaterial property +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle) SetVerificationMaterial(value ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialable)() { + m.verificationMaterial = value +} +type ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDsseEnvelope()(ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeable) + GetMediaType()(*string) + GetVerificationMaterial()(ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialable) + SetDsseEnvelope(value ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeable)() + SetMediaType(value *string)() + SetVerificationMaterial(value ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_item_with_subject_digest_get_response_attestations_bundle_dsse_envelope.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_item_with_subject_digest_get_response_attestations_bundle_dsse_envelope.go new file mode 100644 index 000000000..d482d9ab0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_item_with_subject_digest_get_response_attestations_bundle_dsse_envelope.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope instantiates a new ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope and sets the default values. +func NewItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope()(*ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope) { + m := &ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope(), 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 *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelope) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_dsseEnvelopeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_item_with_subject_digest_get_response_attestations_bundle_verification_material.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_item_with_subject_digest_get_response_attestations_bundle_verification_material.go new file mode 100644 index 000000000..a526c65c2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_item_with_subject_digest_get_response_attestations_bundle_verification_material.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial instantiates a new ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial and sets the default values. +func NewItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial()(*ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial) { + m := &ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial(), 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 *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterial) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundle_verificationMaterialable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_post_request_body.go new file mode 100644 index 000000000..988c27028 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemAttestationsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The attestation's Sigstore Bundle.Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. + bundle ItemItemAttestationsPostRequestBody_bundleable +} +// NewItemItemAttestationsPostRequestBody instantiates a new ItemItemAttestationsPostRequestBody and sets the default values. +func NewItemItemAttestationsPostRequestBody()(*ItemItemAttestationsPostRequestBody) { + m := &ItemItemAttestationsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemAttestationsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemAttestationsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemAttestationsPostRequestBody(), 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 *ItemItemAttestationsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBundle gets the bundle property value. The attestation's Sigstore Bundle.Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. +// returns a ItemItemAttestationsPostRequestBody_bundleable when successful +func (m *ItemItemAttestationsPostRequestBody) GetBundle()(ItemItemAttestationsPostRequestBody_bundleable) { + return m.bundle +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemAttestationsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bundle"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemAttestationsPostRequestBody_bundleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBundle(val.(ItemItemAttestationsPostRequestBody_bundleable)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemAttestationsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("bundle", m.GetBundle()) + 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 *ItemItemAttestationsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBundle sets the bundle property value. The attestation's Sigstore Bundle.Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. +func (m *ItemItemAttestationsPostRequestBody) SetBundle(value ItemItemAttestationsPostRequestBody_bundleable)() { + m.bundle = value +} +type ItemItemAttestationsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBundle()(ItemItemAttestationsPostRequestBody_bundleable) + SetBundle(value ItemItemAttestationsPostRequestBody_bundleable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_post_request_body_bundle.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_post_request_body_bundle.go new file mode 100644 index 000000000..2ff5fd5e3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_post_request_body_bundle.go @@ -0,0 +1,139 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemAttestationsPostRequestBody_bundle the attestation's Sigstore Bundle.Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. +type ItemItemAttestationsPostRequestBody_bundle struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The dsseEnvelope property + dsseEnvelope ItemItemAttestationsPostRequestBody_bundle_dsseEnvelopeable + // The mediaType property + mediaType *string + // The verificationMaterial property + verificationMaterial ItemItemAttestationsPostRequestBody_bundle_verificationMaterialable +} +// NewItemItemAttestationsPostRequestBody_bundle instantiates a new ItemItemAttestationsPostRequestBody_bundle and sets the default values. +func NewItemItemAttestationsPostRequestBody_bundle()(*ItemItemAttestationsPostRequestBody_bundle) { + m := &ItemItemAttestationsPostRequestBody_bundle{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemAttestationsPostRequestBody_bundleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemAttestationsPostRequestBody_bundleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemAttestationsPostRequestBody_bundle(), 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 *ItemItemAttestationsPostRequestBody_bundle) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDsseEnvelope gets the dsseEnvelope property value. The dsseEnvelope property +// returns a ItemItemAttestationsPostRequestBody_bundle_dsseEnvelopeable when successful +func (m *ItemItemAttestationsPostRequestBody_bundle) GetDsseEnvelope()(ItemItemAttestationsPostRequestBody_bundle_dsseEnvelopeable) { + return m.dsseEnvelope +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemAttestationsPostRequestBody_bundle) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["dsseEnvelope"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemAttestationsPostRequestBody_bundle_dsseEnvelopeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDsseEnvelope(val.(ItemItemAttestationsPostRequestBody_bundle_dsseEnvelopeable)) + } + return nil + } + res["mediaType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMediaType(val) + } + return nil + } + res["verificationMaterial"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemAttestationsPostRequestBody_bundle_verificationMaterialFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerificationMaterial(val.(ItemItemAttestationsPostRequestBody_bundle_verificationMaterialable)) + } + return nil + } + return res +} +// GetMediaType gets the mediaType property value. The mediaType property +// returns a *string when successful +func (m *ItemItemAttestationsPostRequestBody_bundle) GetMediaType()(*string) { + return m.mediaType +} +// GetVerificationMaterial gets the verificationMaterial property value. The verificationMaterial property +// returns a ItemItemAttestationsPostRequestBody_bundle_verificationMaterialable when successful +func (m *ItemItemAttestationsPostRequestBody_bundle) GetVerificationMaterial()(ItemItemAttestationsPostRequestBody_bundle_verificationMaterialable) { + return m.verificationMaterial +} +// Serialize serializes information the current object +func (m *ItemItemAttestationsPostRequestBody_bundle) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("dsseEnvelope", m.GetDsseEnvelope()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mediaType", m.GetMediaType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("verificationMaterial", m.GetVerificationMaterial()) + 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 *ItemItemAttestationsPostRequestBody_bundle) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDsseEnvelope sets the dsseEnvelope property value. The dsseEnvelope property +func (m *ItemItemAttestationsPostRequestBody_bundle) SetDsseEnvelope(value ItemItemAttestationsPostRequestBody_bundle_dsseEnvelopeable)() { + m.dsseEnvelope = value +} +// SetMediaType sets the mediaType property value. The mediaType property +func (m *ItemItemAttestationsPostRequestBody_bundle) SetMediaType(value *string)() { + m.mediaType = value +} +// SetVerificationMaterial sets the verificationMaterial property value. The verificationMaterial property +func (m *ItemItemAttestationsPostRequestBody_bundle) SetVerificationMaterial(value ItemItemAttestationsPostRequestBody_bundle_verificationMaterialable)() { + m.verificationMaterial = value +} +type ItemItemAttestationsPostRequestBody_bundleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDsseEnvelope()(ItemItemAttestationsPostRequestBody_bundle_dsseEnvelopeable) + GetMediaType()(*string) + GetVerificationMaterial()(ItemItemAttestationsPostRequestBody_bundle_verificationMaterialable) + SetDsseEnvelope(value ItemItemAttestationsPostRequestBody_bundle_dsseEnvelopeable)() + SetMediaType(value *string)() + SetVerificationMaterial(value ItemItemAttestationsPostRequestBody_bundle_verificationMaterialable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_post_request_body_bundle_dsse_envelope.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_post_request_body_bundle_dsse_envelope.go new file mode 100644 index 000000000..87a4c25b8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_post_request_body_bundle_dsse_envelope.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemAttestationsPostRequestBody_bundle_dsseEnvelope struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemAttestationsPostRequestBody_bundle_dsseEnvelope instantiates a new ItemItemAttestationsPostRequestBody_bundle_dsseEnvelope and sets the default values. +func NewItemItemAttestationsPostRequestBody_bundle_dsseEnvelope()(*ItemItemAttestationsPostRequestBody_bundle_dsseEnvelope) { + m := &ItemItemAttestationsPostRequestBody_bundle_dsseEnvelope{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemAttestationsPostRequestBody_bundle_dsseEnvelopeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemAttestationsPostRequestBody_bundle_dsseEnvelopeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemAttestationsPostRequestBody_bundle_dsseEnvelope(), 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 *ItemItemAttestationsPostRequestBody_bundle_dsseEnvelope) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemAttestationsPostRequestBody_bundle_dsseEnvelope) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemAttestationsPostRequestBody_bundle_dsseEnvelope) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemAttestationsPostRequestBody_bundle_dsseEnvelope) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemAttestationsPostRequestBody_bundle_dsseEnvelopeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_post_request_body_bundle_verification_material.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_post_request_body_bundle_verification_material.go new file mode 100644 index 000000000..dcc88ceda --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_post_request_body_bundle_verification_material.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemAttestationsPostRequestBody_bundle_verificationMaterial struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemAttestationsPostRequestBody_bundle_verificationMaterial instantiates a new ItemItemAttestationsPostRequestBody_bundle_verificationMaterial and sets the default values. +func NewItemItemAttestationsPostRequestBody_bundle_verificationMaterial()(*ItemItemAttestationsPostRequestBody_bundle_verificationMaterial) { + m := &ItemItemAttestationsPostRequestBody_bundle_verificationMaterial{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemAttestationsPostRequestBody_bundle_verificationMaterialFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemAttestationsPostRequestBody_bundle_verificationMaterialFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemAttestationsPostRequestBody_bundle_verificationMaterial(), 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 *ItemItemAttestationsPostRequestBody_bundle_verificationMaterial) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemAttestationsPostRequestBody_bundle_verificationMaterial) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemAttestationsPostRequestBody_bundle_verificationMaterial) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemAttestationsPostRequestBody_bundle_verificationMaterial) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemAttestationsPostRequestBody_bundle_verificationMaterialable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_post_response.go new file mode 100644 index 000000000..e97c4a5a4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_post_response.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemAttestationsPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The ID of the attestation. + id *int32 +} +// NewItemItemAttestationsPostResponse instantiates a new ItemItemAttestationsPostResponse and sets the default values. +func NewItemItemAttestationsPostResponse()(*ItemItemAttestationsPostResponse) { + m := &ItemItemAttestationsPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemAttestationsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemAttestationsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemAttestationsPostResponse(), 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 *ItemItemAttestationsPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemAttestationsPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + return res +} +// GetId gets the id property value. The ID of the attestation. +// returns a *int32 when successful +func (m *ItemItemAttestationsPostResponse) GetId()(*int32) { + return m.id +} +// Serialize serializes information the current object +func (m *ItemItemAttestationsPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + 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 *ItemItemAttestationsPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The ID of the attestation. +func (m *ItemItemAttestationsPostResponse) SetId(value *int32)() { + m.id = value +} +type ItemItemAttestationsPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + SetId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_request_builder.go new file mode 100644 index 000000000..7e4a29732 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_request_builder.go @@ -0,0 +1,79 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemAttestationsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\attestations +type ItemItemAttestationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// BySubject_digest gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.attestations.item collection +// returns a *ItemItemAttestationsWithSubject_digestItemRequestBuilder when successful +func (m *ItemItemAttestationsRequestBuilder) BySubject_digest(subject_digest string)(*ItemItemAttestationsWithSubject_digestItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if subject_digest != "" { + urlTplParams["subject_digest"] = subject_digest + } + return NewItemItemAttestationsWithSubject_digestItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemAttestationsRequestBuilderInternal instantiates a new ItemItemAttestationsRequestBuilder and sets the default values. +func NewItemItemAttestationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAttestationsRequestBuilder) { + m := &ItemItemAttestationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/attestations", pathParameters), + } + return m +} +// NewItemItemAttestationsRequestBuilder instantiates a new ItemItemAttestationsRequestBuilder and sets the default values. +func NewItemItemAttestationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAttestationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemAttestationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post store an artifact attestation and associate it with a repository.The authenticated user must have write permission to the repository and, if using a fine-grained access token the `attestations:write` permission is required.Artifact attestations are meant to be created using the [attest action](https://github.com/actions/attest). For amore information, see our guide on [using artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). +// returns a ItemItemAttestationsPostResponseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#create-an-attestation +func (m *ItemItemAttestationsRequestBuilder) Post(ctx context.Context, body ItemItemAttestationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemAttestationsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemAttestationsPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemAttestationsPostResponseable), nil +} +// ToPostRequestInformation store an artifact attestation and associate it with a repository.The authenticated user must have write permission to the repository and, if using a fine-grained access token the `attestations:write` permission is required.Artifact attestations are meant to be created using the [attest action](https://github.com/actions/attest). For amore information, see our guide on [using artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). +// returns a *RequestInformation when successful +func (m *ItemItemAttestationsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemAttestationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemAttestationsRequestBuilder when successful +func (m *ItemItemAttestationsRequestBuilder) WithUrl(rawUrl string)(*ItemItemAttestationsRequestBuilder) { + return NewItemItemAttestationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_with_subject_digest_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_with_subject_digest_item_request_builder.go new file mode 100644 index 000000000..f74c474ab --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_attestations_with_subject_digest_item_request_builder.go @@ -0,0 +1,65 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemAttestationsWithSubject_digestItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\attestations\{subject_digest} +type ItemItemAttestationsWithSubject_digestItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemAttestationsWithSubject_digestItemRequestBuilderGetQueryParameters list a collection of artifact attestations with a given subject digest that are associated with a repository.The authenticated user making the request must have read access to the repository. In addition, when using a fine-grained access token the `attestations:read` permission is required.**Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). +type ItemItemAttestationsWithSubject_digestItemRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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)." + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + Before *string `uriparametername:"before"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemAttestationsWithSubject_digestItemRequestBuilderInternal instantiates a new ItemItemAttestationsWithSubject_digestItemRequestBuilder and sets the default values. +func NewItemItemAttestationsWithSubject_digestItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAttestationsWithSubject_digestItemRequestBuilder) { + m := &ItemItemAttestationsWithSubject_digestItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/attestations/{subject_digest}{?after*,before*,per_page*}", pathParameters), + } + return m +} +// NewItemItemAttestationsWithSubject_digestItemRequestBuilder instantiates a new ItemItemAttestationsWithSubject_digestItemRequestBuilder and sets the default values. +func NewItemItemAttestationsWithSubject_digestItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAttestationsWithSubject_digestItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemAttestationsWithSubject_digestItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list a collection of artifact attestations with a given subject digest that are associated with a repository.The authenticated user making the request must have read access to the repository. In addition, when using a fine-grained access token the `attestations:read` permission is required.**Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). +// returns a ItemItemAttestationsItemWithSubject_digestGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#list-attestations +func (m *ItemItemAttestationsWithSubject_digestItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemAttestationsWithSubject_digestItemRequestBuilderGetQueryParameters])(ItemItemAttestationsItemWithSubject_digestGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemAttestationsItemWithSubject_digestGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemAttestationsItemWithSubject_digestGetResponseable), nil +} +// ToGetRequestInformation list a collection of artifact attestations with a given subject digest that are associated with a repository.The authenticated user making the request must have read access to the repository. In addition, when using a fine-grained access token the `attestations:read` permission is required.**Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). +// returns a *RequestInformation when successful +func (m *ItemItemAttestationsWithSubject_digestItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemAttestationsWithSubject_digestItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemAttestationsWithSubject_digestItemRequestBuilder when successful +func (m *ItemItemAttestationsWithSubject_digestItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemAttestationsWithSubject_digestItemRequestBuilder) { + return NewItemItemAttestationsWithSubject_digestItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_autolinks_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_autolinks_post_request_body.go new file mode 100644 index 000000000..bf822bd5b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_autolinks_post_request_body.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemAutolinksPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether this autolink reference matches alphanumeric characters. If true, the `` parameter of the `url_template` matches alphanumeric characters `A-Z` (case insensitive), `0-9`, and `-`. If false, this autolink reference only matches numeric characters. + is_alphanumeric *bool + // This prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit. + key_prefix *string + // The URL must contain `` for the reference number. `` matches different characters depending on the value of `is_alphanumeric`. + url_template *string +} +// NewItemItemAutolinksPostRequestBody instantiates a new ItemItemAutolinksPostRequestBody and sets the default values. +func NewItemItemAutolinksPostRequestBody()(*ItemItemAutolinksPostRequestBody) { + m := &ItemItemAutolinksPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemAutolinksPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemAutolinksPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemAutolinksPostRequestBody(), 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 *ItemItemAutolinksPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemAutolinksPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["is_alphanumeric"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsAlphanumeric(val) + } + return nil + } + res["key_prefix"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyPrefix(val) + } + return nil + } + res["url_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrlTemplate(val) + } + return nil + } + return res +} +// GetIsAlphanumeric gets the is_alphanumeric property value. Whether this autolink reference matches alphanumeric characters. If true, the `` parameter of the `url_template` matches alphanumeric characters `A-Z` (case insensitive), `0-9`, and `-`. If false, this autolink reference only matches numeric characters. +// returns a *bool when successful +func (m *ItemItemAutolinksPostRequestBody) GetIsAlphanumeric()(*bool) { + return m.is_alphanumeric +} +// GetKeyPrefix gets the key_prefix property value. This prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit. +// returns a *string when successful +func (m *ItemItemAutolinksPostRequestBody) GetKeyPrefix()(*string) { + return m.key_prefix +} +// GetUrlTemplate gets the url_template property value. The URL must contain `` for the reference number. `` matches different characters depending on the value of `is_alphanumeric`. +// returns a *string when successful +func (m *ItemItemAutolinksPostRequestBody) GetUrlTemplate()(*string) { + return m.url_template +} +// Serialize serializes information the current object +func (m *ItemItemAutolinksPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("is_alphanumeric", m.GetIsAlphanumeric()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_prefix", m.GetKeyPrefix()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url_template", m.GetUrlTemplate()) + 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 *ItemItemAutolinksPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIsAlphanumeric sets the is_alphanumeric property value. Whether this autolink reference matches alphanumeric characters. If true, the `` parameter of the `url_template` matches alphanumeric characters `A-Z` (case insensitive), `0-9`, and `-`. If false, this autolink reference only matches numeric characters. +func (m *ItemItemAutolinksPostRequestBody) SetIsAlphanumeric(value *bool)() { + m.is_alphanumeric = value +} +// SetKeyPrefix sets the key_prefix property value. This prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit. +func (m *ItemItemAutolinksPostRequestBody) SetKeyPrefix(value *string)() { + m.key_prefix = value +} +// SetUrlTemplate sets the url_template property value. The URL must contain `` for the reference number. `` matches different characters depending on the value of `is_alphanumeric`. +func (m *ItemItemAutolinksPostRequestBody) SetUrlTemplate(value *string)() { + m.url_template = value +} +type ItemItemAutolinksPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIsAlphanumeric()(*bool) + GetKeyPrefix()(*string) + GetUrlTemplate()(*string) + SetIsAlphanumeric(value *bool)() + SetKeyPrefix(value *string)() + SetUrlTemplate(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_autolinks_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_autolinks_request_builder.go new file mode 100644 index 000000000..71b932bd0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_autolinks_request_builder.go @@ -0,0 +1,106 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemAutolinksRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\autolinks +type ItemItemAutolinksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByAutolink_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.autolinks.item collection +// returns a *ItemItemAutolinksWithAutolink_ItemRequestBuilder when successful +func (m *ItemItemAutolinksRequestBuilder) ByAutolink_id(autolink_id int32)(*ItemItemAutolinksWithAutolink_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["autolink_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(autolink_id), 10) + return NewItemItemAutolinksWithAutolink_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemAutolinksRequestBuilderInternal instantiates a new ItemItemAutolinksRequestBuilder and sets the default values. +func NewItemItemAutolinksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAutolinksRequestBuilder) { + m := &ItemItemAutolinksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/autolinks", pathParameters), + } + return m +} +// NewItemItemAutolinksRequestBuilder instantiates a new ItemItemAutolinksRequestBuilder and sets the default values. +func NewItemItemAutolinksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAutolinksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemAutolinksRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets all autolinks that are configured for a repository.Information about autolinks are only available to repository administrators. +// returns a []Autolinkable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/autolinks#get-all-autolinks-of-a-repository +func (m *ItemItemAutolinksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Autolinkable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAutolinkFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Autolinkable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Autolinkable) + } + } + return val, nil +} +// Post users with admin access to the repository can create an autolink. +// returns a Autolinkable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository +func (m *ItemItemAutolinksRequestBuilder) Post(ctx context.Context, body ItemItemAutolinksPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Autolinkable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAutolinkFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Autolinkable), nil +} +// ToGetRequestInformation gets all autolinks that are configured for a repository.Information about autolinks are only available to repository administrators. +// returns a *RequestInformation when successful +func (m *ItemItemAutolinksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation users with admin access to the repository can create an autolink. +// returns a *RequestInformation when successful +func (m *ItemItemAutolinksRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemAutolinksPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemAutolinksRequestBuilder when successful +func (m *ItemItemAutolinksRequestBuilder) WithUrl(rawUrl string)(*ItemItemAutolinksRequestBuilder) { + return NewItemItemAutolinksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_autolinks_with_autolink_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_autolinks_with_autolink_item_request_builder.go new file mode 100644 index 000000000..192e0a727 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_autolinks_with_autolink_item_request_builder.go @@ -0,0 +1,88 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemAutolinksWithAutolink_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\autolinks\{autolink_id} +type ItemItemAutolinksWithAutolink_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemAutolinksWithAutolink_ItemRequestBuilderInternal instantiates a new ItemItemAutolinksWithAutolink_ItemRequestBuilder and sets the default values. +func NewItemItemAutolinksWithAutolink_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAutolinksWithAutolink_ItemRequestBuilder) { + m := &ItemItemAutolinksWithAutolink_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/autolinks/{autolink_id}", pathParameters), + } + return m +} +// NewItemItemAutolinksWithAutolink_ItemRequestBuilder instantiates a new ItemItemAutolinksWithAutolink_ItemRequestBuilder and sets the default values. +func NewItemItemAutolinksWithAutolink_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAutolinksWithAutolink_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemAutolinksWithAutolink_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete this deletes a single autolink reference by ID that was configured for the given repository.Information about autolinks are only available to repository administrators. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository +func (m *ItemItemAutolinksWithAutolink_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get this returns a single autolink reference by ID that was configured for the given repository.Information about autolinks are only available to repository administrators. +// returns a Autolinkable 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/repos/autolinks#get-an-autolink-reference-of-a-repository +func (m *ItemItemAutolinksWithAutolink_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Autolinkable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAutolinkFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Autolinkable), nil +} +// ToDeleteRequestInformation this deletes a single autolink reference by ID that was configured for the given repository.Information about autolinks are only available to repository administrators. +// returns a *RequestInformation when successful +func (m *ItemItemAutolinksWithAutolink_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation this returns a single autolink reference by ID that was configured for the given repository.Information about autolinks are only available to repository administrators. +// returns a *RequestInformation when successful +func (m *ItemItemAutolinksWithAutolink_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemAutolinksWithAutolink_ItemRequestBuilder when successful +func (m *ItemItemAutolinksWithAutolink_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemAutolinksWithAutolink_ItemRequestBuilder) { + return NewItemItemAutolinksWithAutolink_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_automated_security_fixes_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_automated_security_fixes_request_builder.go new file mode 100644 index 000000000..35e4fc862 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_automated_security_fixes_request_builder.go @@ -0,0 +1,101 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemAutomatedSecurityFixesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\automated-security-fixes +type ItemItemAutomatedSecurityFixesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemAutomatedSecurityFixesRequestBuilderInternal instantiates a new ItemItemAutomatedSecurityFixesRequestBuilder and sets the default values. +func NewItemItemAutomatedSecurityFixesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAutomatedSecurityFixesRequestBuilder) { + m := &ItemItemAutomatedSecurityFixesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/automated-security-fixes", pathParameters), + } + return m +} +// NewItemItemAutomatedSecurityFixesRequestBuilder instantiates a new ItemItemAutomatedSecurityFixesRequestBuilder and sets the default values. +func NewItemItemAutomatedSecurityFixesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAutomatedSecurityFixesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemAutomatedSecurityFixesRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes +func (m *ItemItemAutomatedSecurityFixesRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get shows whether automated security fixes are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". +// returns a CheckAutomatedSecurityFixesable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#check-if-automated-security-fixes-are-enabled-for-a-repository +func (m *ItemItemAutomatedSecurityFixesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckAutomatedSecurityFixesable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCheckAutomatedSecurityFixesFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckAutomatedSecurityFixesable), nil +} +// Put enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes +func (m *ItemItemAutomatedSecurityFixesRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". +// returns a *RequestInformation when successful +func (m *ItemItemAutomatedSecurityFixesRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation shows whether automated security fixes are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". +// returns a *RequestInformation when successful +func (m *ItemItemAutomatedSecurityFixesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". +// returns a *RequestInformation when successful +func (m *ItemItemAutomatedSecurityFixesRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemAutomatedSecurityFixesRequestBuilder when successful +func (m *ItemItemAutomatedSecurityFixesRequestBuilder) WithUrl(rawUrl string)(*ItemItemAutomatedSecurityFixesRequestBuilder) { + return NewItemItemAutomatedSecurityFixesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_enforce_admins_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_enforce_admins_request_builder.go new file mode 100644 index 000000000..f804a8dbc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_enforce_admins_request_builder.go @@ -0,0 +1,111 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\enforce_admins +type ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemBranchesItemProtectionEnforce_adminsRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionEnforce_adminsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) { + m := &ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/enforce_admins", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionEnforce_adminsRequestBuilder instantiates a new ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionEnforce_adminsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionEnforce_adminsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection +func (m *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a ProtectedBranchAdminEnforcedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection +func (m *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProtectedBranchAdminEnforcedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProtectedBranchAdminEnforcedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProtectedBranchAdminEnforcedable), nil +} +// Post protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. +// returns a ProtectedBranchAdminEnforcedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection +func (m *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProtectedBranchAdminEnforcedable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProtectedBranchAdminEnforcedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProtectedBranchAdminEnforcedable), nil +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) { + return NewItemItemBranchesItemProtectionEnforce_adminsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body.go new file mode 100644 index 000000000..af23427a7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body.go @@ -0,0 +1,370 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Allows deletion of the protected branch by anyone with write access to the repository. Set to `false` to prevent deletion of the protected branch. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://docs.github.com/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation. + allow_deletions *bool + // Permits force pushes to the protected branch by anyone with write access to the repository. Set to `true` to allow force pushes. Set to `false` or `null` to block force pushes. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://docs.github.com/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation." + allow_force_pushes *bool + // Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. Default: `false`. + allow_fork_syncing *bool + // If set to `true`, the `restrictions` branch protection settings which limits who can push will also block pushes which create new branches, unless the push is initiated by a user, team, or app which has the ability to push. Set to `true` to restrict new branch creation. Default: `false`. + block_creations *bool + // Enforce all configured restrictions for administrators. Set to `true` to enforce required status checks for repository administrators. Set to `null` to disable. + enforce_admins *bool + // Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. Default: `false`. + lock_branch *bool + // Requires all conversations on code to be resolved before a pull request can be merged into a branch that matches this rule. Set to `false` to disable. Default: `false`. + required_conversation_resolution *bool + // Enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch. Set to `true` to enforce a linear commit history. Set to `false` to disable a linear commit Git history. Your repository must allow squash merging or rebase merging before you can enable a linear commit history. Default: `false`. For more information, see "[Requiring a linear commit history](https://docs.github.com/github/administering-a-repository/requiring-a-linear-commit-history)" in the GitHub Help documentation. + required_linear_history *bool + // Require at least one approving review on a pull request, before merging. Set to `null` to disable. + required_pull_request_reviews ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsable + // Require status checks to pass before merging. Set to `null` to disable. + required_status_checks ItemItemBranchesItemProtectionPutRequestBody_required_status_checksable + // Restrict who can push to the protected branch. User, app, and team `restrictions` are only available for organization-owned repositories. Set to `null` to disable. + restrictions ItemItemBranchesItemProtectionPutRequestBody_restrictionsable +} +// NewItemItemBranchesItemProtectionPutRequestBody instantiates a new ItemItemBranchesItemProtectionPutRequestBody and sets the default values. +func NewItemItemBranchesItemProtectionPutRequestBody()(*ItemItemBranchesItemProtectionPutRequestBody) { + m := &ItemItemBranchesItemProtectionPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionPutRequestBody(), 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 *ItemItemBranchesItemProtectionPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowDeletions gets the allow_deletions property value. Allows deletion of the protected branch by anyone with write access to the repository. Set to `false` to prevent deletion of the protected branch. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://docs.github.com/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetAllowDeletions()(*bool) { + return m.allow_deletions +} +// GetAllowForcePushes gets the allow_force_pushes property value. Permits force pushes to the protected branch by anyone with write access to the repository. Set to `true` to allow force pushes. Set to `false` or `null` to block force pushes. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://docs.github.com/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation." +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetAllowForcePushes()(*bool) { + return m.allow_force_pushes +} +// GetAllowForkSyncing gets the allow_fork_syncing property value. Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. Default: `false`. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetAllowForkSyncing()(*bool) { + return m.allow_fork_syncing +} +// GetBlockCreations gets the block_creations property value. If set to `true`, the `restrictions` branch protection settings which limits who can push will also block pushes which create new branches, unless the push is initiated by a user, team, or app which has the ability to push. Set to `true` to restrict new branch creation. Default: `false`. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetBlockCreations()(*bool) { + return m.block_creations +} +// GetEnforceAdmins gets the enforce_admins property value. Enforce all configured restrictions for administrators. Set to `true` to enforce required status checks for repository administrators. Set to `null` to disable. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetEnforceAdmins()(*bool) { + return m.enforce_admins +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_deletions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowDeletions(val) + } + return nil + } + res["allow_force_pushes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForcePushes(val) + } + return nil + } + res["allow_fork_syncing"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForkSyncing(val) + } + return nil + } + res["block_creations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetBlockCreations(val) + } + return nil + } + res["enforce_admins"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnforceAdmins(val) + } + return nil + } + res["lock_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLockBranch(val) + } + return nil + } + res["required_conversation_resolution"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequiredConversationResolution(val) + } + return nil + } + res["required_linear_history"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequiredLinearHistory(val) + } + return nil + } + res["required_pull_request_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredPullRequestReviews(val.(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsable)) + } + return nil + } + res["required_status_checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemBranchesItemProtectionPutRequestBody_required_status_checksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredStatusChecks(val.(ItemItemBranchesItemProtectionPutRequestBody_required_status_checksable)) + } + return nil + } + res["restrictions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemBranchesItemProtectionPutRequestBody_restrictionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRestrictions(val.(ItemItemBranchesItemProtectionPutRequestBody_restrictionsable)) + } + return nil + } + return res +} +// GetLockBranch gets the lock_branch property value. Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. Default: `false`. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetLockBranch()(*bool) { + return m.lock_branch +} +// GetRequiredConversationResolution gets the required_conversation_resolution property value. Requires all conversations on code to be resolved before a pull request can be merged into a branch that matches this rule. Set to `false` to disable. Default: `false`. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetRequiredConversationResolution()(*bool) { + return m.required_conversation_resolution +} +// GetRequiredLinearHistory gets the required_linear_history property value. Enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch. Set to `true` to enforce a linear commit history. Set to `false` to disable a linear commit Git history. Your repository must allow squash merging or rebase merging before you can enable a linear commit history. Default: `false`. For more information, see "[Requiring a linear commit history](https://docs.github.com/github/administering-a-repository/requiring-a-linear-commit-history)" in the GitHub Help documentation. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetRequiredLinearHistory()(*bool) { + return m.required_linear_history +} +// GetRequiredPullRequestReviews gets the required_pull_request_reviews property value. Require at least one approving review on a pull request, before merging. Set to `null` to disable. +// returns a ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsable when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetRequiredPullRequestReviews()(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsable) { + return m.required_pull_request_reviews +} +// GetRequiredStatusChecks gets the required_status_checks property value. Require status checks to pass before merging. Set to `null` to disable. +// returns a ItemItemBranchesItemProtectionPutRequestBody_required_status_checksable when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetRequiredStatusChecks()(ItemItemBranchesItemProtectionPutRequestBody_required_status_checksable) { + return m.required_status_checks +} +// GetRestrictions gets the restrictions property value. Restrict who can push to the protected branch. User, app, and team `restrictions` are only available for organization-owned repositories. Set to `null` to disable. +// returns a ItemItemBranchesItemProtectionPutRequestBody_restrictionsable when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetRestrictions()(ItemItemBranchesItemProtectionPutRequestBody_restrictionsable) { + return m.restrictions +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_deletions", m.GetAllowDeletions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_force_pushes", m.GetAllowForcePushes()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_fork_syncing", m.GetAllowForkSyncing()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("block_creations", m.GetBlockCreations()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enforce_admins", m.GetEnforceAdmins()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("lock_branch", m.GetLockBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("required_conversation_resolution", m.GetRequiredConversationResolution()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("required_linear_history", m.GetRequiredLinearHistory()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_pull_request_reviews", m.GetRequiredPullRequestReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_status_checks", m.GetRequiredStatusChecks()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("restrictions", m.GetRestrictions()) + 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 *ItemItemBranchesItemProtectionPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowDeletions sets the allow_deletions property value. Allows deletion of the protected branch by anyone with write access to the repository. Set to `false` to prevent deletion of the protected branch. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://docs.github.com/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetAllowDeletions(value *bool)() { + m.allow_deletions = value +} +// SetAllowForcePushes sets the allow_force_pushes property value. Permits force pushes to the protected branch by anyone with write access to the repository. Set to `true` to allow force pushes. Set to `false` or `null` to block force pushes. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://docs.github.com/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation." +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetAllowForcePushes(value *bool)() { + m.allow_force_pushes = value +} +// SetAllowForkSyncing sets the allow_fork_syncing property value. Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. Default: `false`. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetAllowForkSyncing(value *bool)() { + m.allow_fork_syncing = value +} +// SetBlockCreations sets the block_creations property value. If set to `true`, the `restrictions` branch protection settings which limits who can push will also block pushes which create new branches, unless the push is initiated by a user, team, or app which has the ability to push. Set to `true` to restrict new branch creation. Default: `false`. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetBlockCreations(value *bool)() { + m.block_creations = value +} +// SetEnforceAdmins sets the enforce_admins property value. Enforce all configured restrictions for administrators. Set to `true` to enforce required status checks for repository administrators. Set to `null` to disable. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetEnforceAdmins(value *bool)() { + m.enforce_admins = value +} +// SetLockBranch sets the lock_branch property value. Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. Default: `false`. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetLockBranch(value *bool)() { + m.lock_branch = value +} +// SetRequiredConversationResolution sets the required_conversation_resolution property value. Requires all conversations on code to be resolved before a pull request can be merged into a branch that matches this rule. Set to `false` to disable. Default: `false`. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetRequiredConversationResolution(value *bool)() { + m.required_conversation_resolution = value +} +// SetRequiredLinearHistory sets the required_linear_history property value. Enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch. Set to `true` to enforce a linear commit history. Set to `false` to disable a linear commit Git history. Your repository must allow squash merging or rebase merging before you can enable a linear commit history. Default: `false`. For more information, see "[Requiring a linear commit history](https://docs.github.com/github/administering-a-repository/requiring-a-linear-commit-history)" in the GitHub Help documentation. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetRequiredLinearHistory(value *bool)() { + m.required_linear_history = value +} +// SetRequiredPullRequestReviews sets the required_pull_request_reviews property value. Require at least one approving review on a pull request, before merging. Set to `null` to disable. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetRequiredPullRequestReviews(value ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsable)() { + m.required_pull_request_reviews = value +} +// SetRequiredStatusChecks sets the required_status_checks property value. Require status checks to pass before merging. Set to `null` to disable. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetRequiredStatusChecks(value ItemItemBranchesItemProtectionPutRequestBody_required_status_checksable)() { + m.required_status_checks = value +} +// SetRestrictions sets the restrictions property value. Restrict who can push to the protected branch. User, app, and team `restrictions` are only available for organization-owned repositories. Set to `null` to disable. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetRestrictions(value ItemItemBranchesItemProtectionPutRequestBody_restrictionsable)() { + m.restrictions = value +} +type ItemItemBranchesItemProtectionPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowDeletions()(*bool) + GetAllowForcePushes()(*bool) + GetAllowForkSyncing()(*bool) + GetBlockCreations()(*bool) + GetEnforceAdmins()(*bool) + GetLockBranch()(*bool) + GetRequiredConversationResolution()(*bool) + GetRequiredLinearHistory()(*bool) + GetRequiredPullRequestReviews()(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsable) + GetRequiredStatusChecks()(ItemItemBranchesItemProtectionPutRequestBody_required_status_checksable) + GetRestrictions()(ItemItemBranchesItemProtectionPutRequestBody_restrictionsable) + SetAllowDeletions(value *bool)() + SetAllowForcePushes(value *bool)() + SetAllowForkSyncing(value *bool)() + SetBlockCreations(value *bool)() + SetEnforceAdmins(value *bool)() + SetLockBranch(value *bool)() + SetRequiredConversationResolution(value *bool)() + SetRequiredLinearHistory(value *bool)() + SetRequiredPullRequestReviews(value ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsable)() + SetRequiredStatusChecks(value ItemItemBranchesItemProtectionPutRequestBody_required_status_checksable)() + SetRestrictions(value ItemItemBranchesItemProtectionPutRequestBody_restrictionsable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_required_pull_request_reviews.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_required_pull_request_reviews.go new file mode 100644 index 000000000..759f77200 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_required_pull_request_reviews.go @@ -0,0 +1,226 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews require at least one approving review on a pull request, before merging. Set to `null` to disable. +type ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Allow specific users, teams, or apps to bypass pull request requirements. + bypass_pull_request_allowances ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesable + // Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit. + dismiss_stale_reviews *bool + // Specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. + dismissal_restrictions ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsable + // Blocks merging pull requests until [code owners](https://docs.github.com/articles/about-code-owners/) review them. + require_code_owner_reviews *bool + // Whether the most recent push must be approved by someone other than the person who pushed it. Default: `false`. + require_last_push_approval *bool + // Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6 or 0 to not require reviewers. + required_approving_review_count *int32 +} +// NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews instantiates a new ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews and sets the default values. +func NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews()(*ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) { + m := &ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews(), 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 *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassPullRequestAllowances gets the bypass_pull_request_allowances property value. Allow specific users, teams, or apps to bypass pull request requirements. +// returns a ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesable when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) GetBypassPullRequestAllowances()(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesable) { + return m.bypass_pull_request_allowances +} +// GetDismissalRestrictions gets the dismissal_restrictions property value. Specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. +// returns a ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsable when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) GetDismissalRestrictions()(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsable) { + return m.dismissal_restrictions +} +// GetDismissStaleReviews gets the dismiss_stale_reviews property value. Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) GetDismissStaleReviews()(*bool) { + return m.dismiss_stale_reviews +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bypass_pull_request_allowances"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBypassPullRequestAllowances(val.(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesable)) + } + return nil + } + res["dismiss_stale_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissStaleReviews(val) + } + return nil + } + res["dismissal_restrictions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissalRestrictions(val.(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsable)) + } + return nil + } + res["require_code_owner_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireCodeOwnerReviews(val) + } + return nil + } + res["require_last_push_approval"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireLastPushApproval(val) + } + return nil + } + res["required_approving_review_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRequiredApprovingReviewCount(val) + } + return nil + } + return res +} +// GetRequireCodeOwnerReviews gets the require_code_owner_reviews property value. Blocks merging pull requests until [code owners](https://docs.github.com/articles/about-code-owners/) review them. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) GetRequireCodeOwnerReviews()(*bool) { + return m.require_code_owner_reviews +} +// GetRequiredApprovingReviewCount gets the required_approving_review_count property value. Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6 or 0 to not require reviewers. +// returns a *int32 when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) GetRequiredApprovingReviewCount()(*int32) { + return m.required_approving_review_count +} +// GetRequireLastPushApproval gets the require_last_push_approval property value. Whether the most recent push must be approved by someone other than the person who pushed it. Default: `false`. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) GetRequireLastPushApproval()(*bool) { + return m.require_last_push_approval +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("bypass_pull_request_allowances", m.GetBypassPullRequestAllowances()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("dismissal_restrictions", m.GetDismissalRestrictions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dismiss_stale_reviews", m.GetDismissStaleReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("required_approving_review_count", m.GetRequiredApprovingReviewCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_code_owner_reviews", m.GetRequireCodeOwnerReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_last_push_approval", m.GetRequireLastPushApproval()) + 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 *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassPullRequestAllowances sets the bypass_pull_request_allowances property value. Allow specific users, teams, or apps to bypass pull request requirements. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) SetBypassPullRequestAllowances(value ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesable)() { + m.bypass_pull_request_allowances = value +} +// SetDismissalRestrictions sets the dismissal_restrictions property value. Specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) SetDismissalRestrictions(value ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsable)() { + m.dismissal_restrictions = value +} +// SetDismissStaleReviews sets the dismiss_stale_reviews property value. Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) SetDismissStaleReviews(value *bool)() { + m.dismiss_stale_reviews = value +} +// SetRequireCodeOwnerReviews sets the require_code_owner_reviews property value. Blocks merging pull requests until [code owners](https://docs.github.com/articles/about-code-owners/) review them. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) SetRequireCodeOwnerReviews(value *bool)() { + m.require_code_owner_reviews = value +} +// SetRequiredApprovingReviewCount sets the required_approving_review_count property value. Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6 or 0 to not require reviewers. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) SetRequiredApprovingReviewCount(value *int32)() { + m.required_approving_review_count = value +} +// SetRequireLastPushApproval sets the require_last_push_approval property value. Whether the most recent push must be approved by someone other than the person who pushed it. Default: `false`. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) SetRequireLastPushApproval(value *bool)() { + m.require_last_push_approval = value +} +type ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassPullRequestAllowances()(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesable) + GetDismissalRestrictions()(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsable) + GetDismissStaleReviews()(*bool) + GetRequireCodeOwnerReviews()(*bool) + GetRequiredApprovingReviewCount()(*int32) + GetRequireLastPushApproval()(*bool) + SetBypassPullRequestAllowances(value ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesable)() + SetDismissalRestrictions(value ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsable)() + SetDismissStaleReviews(value *bool)() + SetRequireCodeOwnerReviews(value *bool)() + SetRequiredApprovingReviewCount(value *int32)() + SetRequireLastPushApproval(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_required_pull_request_reviews_bypass_pull_request_allowances.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_required_pull_request_reviews_bypass_pull_request_allowances.go new file mode 100644 index 000000000..82fb60123 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_required_pull_request_reviews_bypass_pull_request_allowances.go @@ -0,0 +1,157 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances allow specific users, teams, or apps to bypass pull request requirements. +type ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The list of app `slug`s allowed to bypass pull request requirements. + apps []string + // The list of team `slug`s allowed to bypass pull request requirements. + teams []string + // The list of user `login`s allowed to bypass pull request requirements. + users []string +} +// NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances instantiates a new ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances and sets the default values. +func NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances()(*ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) { + m := &ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances(), 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 *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The list of app `slug`s allowed to bypass pull request requirements. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) GetApps()([]string) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetApps(res) + } + return nil + } + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTeams(res) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetUsers(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The list of team `slug`s allowed to bypass pull request requirements. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) GetTeams()([]string) { + return m.teams +} +// GetUsers gets the users property value. The list of user `login`s allowed to bypass pull request requirements. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) GetUsers()([]string) { + return m.users +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + err := writer.WriteCollectionOfStringValues("apps", m.GetApps()) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + err := writer.WriteCollectionOfStringValues("teams", m.GetTeams()) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + err := writer.WriteCollectionOfStringValues("users", m.GetUsers()) + 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 *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The list of app `slug`s allowed to bypass pull request requirements. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) SetApps(value []string)() { + m.apps = value +} +// SetTeams sets the teams property value. The list of team `slug`s allowed to bypass pull request requirements. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) SetTeams(value []string)() { + m.teams = value +} +// SetUsers sets the users property value. The list of user `login`s allowed to bypass pull request requirements. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) SetUsers(value []string)() { + m.users = value +} +type ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]string) + GetTeams()([]string) + GetUsers()([]string) + SetApps(value []string)() + SetTeams(value []string)() + SetUsers(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_required_pull_request_reviews_dismissal_restrictions.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_required_pull_request_reviews_dismissal_restrictions.go new file mode 100644 index 000000000..4ca543e72 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_required_pull_request_reviews_dismissal_restrictions.go @@ -0,0 +1,157 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. +type ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The list of app `slug`s with dismissal access + apps []string + // The list of team `slug`s with dismissal access + teams []string + // The list of user `login`s with dismissal access + users []string +} +// NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions instantiates a new ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions and sets the default values. +func NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions()(*ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) { + m := &ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions(), 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 *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The list of app `slug`s with dismissal access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) GetApps()([]string) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetApps(res) + } + return nil + } + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTeams(res) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetUsers(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The list of team `slug`s with dismissal access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) GetTeams()([]string) { + return m.teams +} +// GetUsers gets the users property value. The list of user `login`s with dismissal access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) GetUsers()([]string) { + return m.users +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + err := writer.WriteCollectionOfStringValues("apps", m.GetApps()) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + err := writer.WriteCollectionOfStringValues("teams", m.GetTeams()) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + err := writer.WriteCollectionOfStringValues("users", m.GetUsers()) + 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 *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The list of app `slug`s with dismissal access +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) SetApps(value []string)() { + m.apps = value +} +// SetTeams sets the teams property value. The list of team `slug`s with dismissal access +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) SetTeams(value []string)() { + m.teams = value +} +// SetUsers sets the users property value. The list of user `login`s with dismissal access +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) SetUsers(value []string)() { + m.users = value +} +type ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]string) + GetTeams()([]string) + GetUsers()([]string) + SetApps(value []string)() + SetTeams(value []string)() + SetUsers(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_required_status_checks.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_required_status_checks.go new file mode 100644 index 000000000..9fd190f69 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_required_status_checks.go @@ -0,0 +1,160 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemBranchesItemProtectionPutRequestBody_required_status_checks require status checks to pass before merging. Set to `null` to disable. +type ItemItemBranchesItemProtectionPutRequestBody_required_status_checks struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The list of status checks to require in order to merge into this branch. + checks []ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable + // **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. + // Deprecated: + contexts []string + // Require branches to be up to date before merging. + strict *bool +} +// NewItemItemBranchesItemProtectionPutRequestBody_required_status_checks instantiates a new ItemItemBranchesItemProtectionPutRequestBody_required_status_checks and sets the default values. +func NewItemItemBranchesItemProtectionPutRequestBody_required_status_checks()(*ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) { + m := &ItemItemBranchesItemProtectionPutRequestBody_required_status_checks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionPutRequestBody_required_status_checksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionPutRequestBody_required_status_checksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionPutRequestBody_required_status_checks(), 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 *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChecks gets the checks property value. The list of status checks to require in order to merge into this branch. +// returns a []ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) GetChecks()([]ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable) { + return m.checks +} +// GetContexts gets the contexts property value. **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. +// Deprecated: +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) GetContexts()([]string) { + return m.contexts +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable) + } + } + m.SetChecks(res) + } + return nil + } + res["contexts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetContexts(res) + } + return nil + } + res["strict"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetStrict(val) + } + return nil + } + return res +} +// GetStrict gets the strict property value. Require branches to be up to date before merging. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) GetStrict()(*bool) { + return m.strict +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetChecks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetChecks())) + for i, v := range m.GetChecks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("checks", cast) + if err != nil { + return err + } + } + if m.GetContexts() != nil { + err := writer.WriteCollectionOfStringValues("contexts", m.GetContexts()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("strict", m.GetStrict()) + 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 *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChecks sets the checks property value. The list of status checks to require in order to merge into this branch. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) SetChecks(value []ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable)() { + m.checks = value +} +// SetContexts sets the contexts property value. **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. +// Deprecated: +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) SetContexts(value []string)() { + m.contexts = value +} +// SetStrict sets the strict property value. Require branches to be up to date before merging. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) SetStrict(value *bool)() { + m.strict = value +} +type ItemItemBranchesItemProtectionPutRequestBody_required_status_checksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChecks()([]ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable) + GetContexts()([]string) + GetStrict()(*bool) + SetChecks(value []ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable)() + SetContexts(value []string)() + SetStrict(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_required_status_checks_checks.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_required_status_checks_checks.go new file mode 100644 index 000000000..dfa7b90ad --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_required_status_checks_checks.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The ID of the GitHub App that must provide this check. Omit this field to automatically select the GitHub App that has recently provided this check, or any app if it was not set by a GitHub App. Pass -1 to explicitly allow any app to set the status. + app_id *int32 + // The name of the required check + context *string +} +// NewItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks instantiates a new ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks and sets the default values. +func NewItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks()(*ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) { + m := &ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks(), 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 *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAppId gets the app_id property value. The ID of the GitHub App that must provide this check. Omit this field to automatically select the GitHub App that has recently provided this check, or any app if it was not set by a GitHub App. Pass -1 to explicitly allow any app to set the status. +// returns a *int32 when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) GetAppId()(*int32) { + return m.app_id +} +// GetContext gets the context property value. The name of the required check +// returns a *string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) GetContext()(*string) { + return m.context +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("app_id", m.GetAppId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("context", m.GetContext()) + 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 *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAppId sets the app_id property value. The ID of the GitHub App that must provide this check. Omit this field to automatically select the GitHub App that has recently provided this check, or any app if it was not set by a GitHub App. Pass -1 to explicitly allow any app to set the status. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) SetAppId(value *int32)() { + m.app_id = value +} +// SetContext sets the context property value. The name of the required check +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) SetContext(value *string)() { + m.context = value +} +type ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppId()(*int32) + GetContext()(*string) + SetAppId(value *int32)() + SetContext(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_restrictions.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_restrictions.go new file mode 100644 index 000000000..04b9e9378 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_put_request_body_restrictions.go @@ -0,0 +1,157 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemBranchesItemProtectionPutRequestBody_restrictions restrict who can push to the protected branch. User, app, and team `restrictions` are only available for organization-owned repositories. Set to `null` to disable. +type ItemItemBranchesItemProtectionPutRequestBody_restrictions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The list of app `slug`s with push access + apps []string + // The list of team `slug`s with push access + teams []string + // The list of user `login`s with push access + users []string +} +// NewItemItemBranchesItemProtectionPutRequestBody_restrictions instantiates a new ItemItemBranchesItemProtectionPutRequestBody_restrictions and sets the default values. +func NewItemItemBranchesItemProtectionPutRequestBody_restrictions()(*ItemItemBranchesItemProtectionPutRequestBody_restrictions) { + m := &ItemItemBranchesItemProtectionPutRequestBody_restrictions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionPutRequestBody_restrictionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionPutRequestBody_restrictionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionPutRequestBody_restrictions(), 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 *ItemItemBranchesItemProtectionPutRequestBody_restrictions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The list of app `slug`s with push access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_restrictions) GetApps()([]string) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_restrictions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetApps(res) + } + return nil + } + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTeams(res) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetUsers(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The list of team `slug`s with push access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_restrictions) GetTeams()([]string) { + return m.teams +} +// GetUsers gets the users property value. The list of user `login`s with push access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_restrictions) GetUsers()([]string) { + return m.users +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionPutRequestBody_restrictions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + err := writer.WriteCollectionOfStringValues("apps", m.GetApps()) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + err := writer.WriteCollectionOfStringValues("teams", m.GetTeams()) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + err := writer.WriteCollectionOfStringValues("users", m.GetUsers()) + 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 *ItemItemBranchesItemProtectionPutRequestBody_restrictions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The list of app `slug`s with push access +func (m *ItemItemBranchesItemProtectionPutRequestBody_restrictions) SetApps(value []string)() { + m.apps = value +} +// SetTeams sets the teams property value. The list of team `slug`s with push access +func (m *ItemItemBranchesItemProtectionPutRequestBody_restrictions) SetTeams(value []string)() { + m.teams = value +} +// SetUsers sets the users property value. The list of user `login`s with push access +func (m *ItemItemBranchesItemProtectionPutRequestBody_restrictions) SetUsers(value []string)() { + m.users = value +} +type ItemItemBranchesItemProtectionPutRequestBody_restrictionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]string) + GetTeams()([]string) + GetUsers()([]string) + SetApps(value []string)() + SetTeams(value []string)() + SetUsers(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_request_builder.go new file mode 100644 index 000000000..54de8ead4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_request_builder.go @@ -0,0 +1,152 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection +type ItemItemBranchesItemProtectionRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemBranchesItemProtectionRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequestBuilder) { + m := &ItemItemBranchesItemProtectionRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRequestBuilder instantiates a new ItemItemBranchesItemProtectionRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection +func (m *ItemItemBranchesItemProtectionRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Enforce_admins the enforce_admins property +// returns a *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) Enforce_admins()(*ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) { + return NewItemItemBranchesItemProtectionEnforce_adminsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a BranchProtectionable 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/branches/branch-protection#get-branch-protection +func (m *ItemItemBranchesItemProtectionRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BranchProtectionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBranchProtectionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BranchProtectionable), nil +} +// Put protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Protecting a branch requires admin or owner permissions to the repository.**Note**: Passing new arrays of `users` and `teams` replaces their previous values.**Note**: The list of users, apps, and teams in total is limited to 100 items. +// returns a ProtectedBranchable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#update-branch-protection +func (m *ItemItemBranchesItemProtectionRequestBuilder) Put(ctx context.Context, body ItemItemBranchesItemProtectionPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProtectedBranchable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProtectedBranchFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProtectedBranchable), nil +} +// Required_pull_request_reviews the required_pull_request_reviews property +// returns a *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) Required_pull_request_reviews()(*ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) { + return NewItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Required_signatures the required_signatures property +// returns a *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) Required_signatures()(*ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) { + return NewItemItemBranchesItemProtectionRequired_signaturesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Required_status_checks the required_status_checks property +// returns a *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) Required_status_checks()(*ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) { + return NewItemItemBranchesItemProtectionRequired_status_checksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Restrictions the restrictions property +// returns a *ItemItemBranchesItemProtectionRestrictionsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) Restrictions()(*ItemItemBranchesItemProtectionRestrictionsRequestBuilder) { + return NewItemItemBranchesItemProtectionRestrictionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Protecting a branch requires admin or owner permissions to the repository.**Note**: Passing new arrays of `users` and `teams` replaces their previous values.**Note**: The list of users, apps, and teams in total is limited to 100 items. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemBranchesItemProtectionPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemBranchesItemProtectionRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRequestBuilder) { + return NewItemItemBranchesItemProtectionRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_pull_request_reviews_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_pull_request_reviews_patch_request_body.go new file mode 100644 index 000000000..48060db63 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_pull_request_reviews_patch_request_body.go @@ -0,0 +1,225 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Allow specific users, teams, or apps to bypass pull request requirements. + bypass_pull_request_allowances ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesable + // Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit. + dismiss_stale_reviews *bool + // Specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. + dismissal_restrictions ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsable + // Blocks merging pull requests until [code owners](https://docs.github.com/articles/about-code-owners/) have reviewed. + require_code_owner_reviews *bool + // Whether the most recent push must be approved by someone other than the person who pushed it. Default: `false` + require_last_push_approval *bool + // Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6 or 0 to not require reviewers. + required_approving_review_count *int32 +} +// NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody instantiates a new ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody and sets the default values. +func NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody()(*ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) { + m := &ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody(), 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 *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassPullRequestAllowances gets the bypass_pull_request_allowances property value. Allow specific users, teams, or apps to bypass pull request requirements. +// returns a ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesable when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) GetBypassPullRequestAllowances()(ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesable) { + return m.bypass_pull_request_allowances +} +// GetDismissalRestrictions gets the dismissal_restrictions property value. Specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. +// returns a ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsable when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) GetDismissalRestrictions()(ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsable) { + return m.dismissal_restrictions +} +// GetDismissStaleReviews gets the dismiss_stale_reviews property value. Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) GetDismissStaleReviews()(*bool) { + return m.dismiss_stale_reviews +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bypass_pull_request_allowances"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBypassPullRequestAllowances(val.(ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesable)) + } + return nil + } + res["dismiss_stale_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissStaleReviews(val) + } + return nil + } + res["dismissal_restrictions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissalRestrictions(val.(ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsable)) + } + return nil + } + res["require_code_owner_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireCodeOwnerReviews(val) + } + return nil + } + res["require_last_push_approval"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireLastPushApproval(val) + } + return nil + } + res["required_approving_review_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRequiredApprovingReviewCount(val) + } + return nil + } + return res +} +// GetRequireCodeOwnerReviews gets the require_code_owner_reviews property value. Blocks merging pull requests until [code owners](https://docs.github.com/articles/about-code-owners/) have reviewed. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) GetRequireCodeOwnerReviews()(*bool) { + return m.require_code_owner_reviews +} +// GetRequiredApprovingReviewCount gets the required_approving_review_count property value. Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6 or 0 to not require reviewers. +// returns a *int32 when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) GetRequiredApprovingReviewCount()(*int32) { + return m.required_approving_review_count +} +// GetRequireLastPushApproval gets the require_last_push_approval property value. Whether the most recent push must be approved by someone other than the person who pushed it. Default: `false` +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) GetRequireLastPushApproval()(*bool) { + return m.require_last_push_approval +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("bypass_pull_request_allowances", m.GetBypassPullRequestAllowances()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("dismissal_restrictions", m.GetDismissalRestrictions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dismiss_stale_reviews", m.GetDismissStaleReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("required_approving_review_count", m.GetRequiredApprovingReviewCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_code_owner_reviews", m.GetRequireCodeOwnerReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_last_push_approval", m.GetRequireLastPushApproval()) + 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 *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassPullRequestAllowances sets the bypass_pull_request_allowances property value. Allow specific users, teams, or apps to bypass pull request requirements. +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) SetBypassPullRequestAllowances(value ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesable)() { + m.bypass_pull_request_allowances = value +} +// SetDismissalRestrictions sets the dismissal_restrictions property value. Specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) SetDismissalRestrictions(value ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsable)() { + m.dismissal_restrictions = value +} +// SetDismissStaleReviews sets the dismiss_stale_reviews property value. Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit. +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) SetDismissStaleReviews(value *bool)() { + m.dismiss_stale_reviews = value +} +// SetRequireCodeOwnerReviews sets the require_code_owner_reviews property value. Blocks merging pull requests until [code owners](https://docs.github.com/articles/about-code-owners/) have reviewed. +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) SetRequireCodeOwnerReviews(value *bool)() { + m.require_code_owner_reviews = value +} +// SetRequiredApprovingReviewCount sets the required_approving_review_count property value. Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6 or 0 to not require reviewers. +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) SetRequiredApprovingReviewCount(value *int32)() { + m.required_approving_review_count = value +} +// SetRequireLastPushApproval sets the require_last_push_approval property value. Whether the most recent push must be approved by someone other than the person who pushed it. Default: `false` +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) SetRequireLastPushApproval(value *bool)() { + m.require_last_push_approval = value +} +type ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassPullRequestAllowances()(ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesable) + GetDismissalRestrictions()(ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsable) + GetDismissStaleReviews()(*bool) + GetRequireCodeOwnerReviews()(*bool) + GetRequiredApprovingReviewCount()(*int32) + GetRequireLastPushApproval()(*bool) + SetBypassPullRequestAllowances(value ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesable)() + SetDismissalRestrictions(value ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsable)() + SetDismissStaleReviews(value *bool)() + SetRequireCodeOwnerReviews(value *bool)() + SetRequiredApprovingReviewCount(value *int32)() + SetRequireLastPushApproval(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_pull_request_reviews_patch_request_body_bypass_pull_request_allowances.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_pull_request_reviews_patch_request_body_bypass_pull_request_allowances.go new file mode 100644 index 000000000..90425c0fd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_pull_request_reviews_patch_request_body_bypass_pull_request_allowances.go @@ -0,0 +1,157 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances allow specific users, teams, or apps to bypass pull request requirements. +type ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The list of app `slug`s allowed to bypass pull request requirements. + apps []string + // The list of team `slug`s allowed to bypass pull request requirements. + teams []string + // The list of user `login`s allowed to bypass pull request requirements. + users []string +} +// NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances instantiates a new ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances and sets the default values. +func NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances()(*ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) { + m := &ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances(), 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 *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The list of app `slug`s allowed to bypass pull request requirements. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) GetApps()([]string) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetApps(res) + } + return nil + } + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTeams(res) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetUsers(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The list of team `slug`s allowed to bypass pull request requirements. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) GetTeams()([]string) { + return m.teams +} +// GetUsers gets the users property value. The list of user `login`s allowed to bypass pull request requirements. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) GetUsers()([]string) { + return m.users +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + err := writer.WriteCollectionOfStringValues("apps", m.GetApps()) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + err := writer.WriteCollectionOfStringValues("teams", m.GetTeams()) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + err := writer.WriteCollectionOfStringValues("users", m.GetUsers()) + 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 *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The list of app `slug`s allowed to bypass pull request requirements. +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) SetApps(value []string)() { + m.apps = value +} +// SetTeams sets the teams property value. The list of team `slug`s allowed to bypass pull request requirements. +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) SetTeams(value []string)() { + m.teams = value +} +// SetUsers sets the users property value. The list of user `login`s allowed to bypass pull request requirements. +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) SetUsers(value []string)() { + m.users = value +} +type ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]string) + GetTeams()([]string) + GetUsers()([]string) + SetApps(value []string)() + SetTeams(value []string)() + SetUsers(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_pull_request_reviews_patch_request_body_dismissal_restrictions.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_pull_request_reviews_patch_request_body_dismissal_restrictions.go new file mode 100644 index 000000000..23d5bc3d3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_pull_request_reviews_patch_request_body_dismissal_restrictions.go @@ -0,0 +1,157 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. +type ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The list of app `slug`s with dismissal access + apps []string + // The list of team `slug`s with dismissal access + teams []string + // The list of user `login`s with dismissal access + users []string +} +// NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions instantiates a new ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions and sets the default values. +func NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions()(*ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) { + m := &ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions(), 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 *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The list of app `slug`s with dismissal access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) GetApps()([]string) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetApps(res) + } + return nil + } + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTeams(res) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetUsers(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The list of team `slug`s with dismissal access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) GetTeams()([]string) { + return m.teams +} +// GetUsers gets the users property value. The list of user `login`s with dismissal access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) GetUsers()([]string) { + return m.users +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + err := writer.WriteCollectionOfStringValues("apps", m.GetApps()) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + err := writer.WriteCollectionOfStringValues("teams", m.GetTeams()) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + err := writer.WriteCollectionOfStringValues("users", m.GetUsers()) + 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 *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The list of app `slug`s with dismissal access +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) SetApps(value []string)() { + m.apps = value +} +// SetTeams sets the teams property value. The list of team `slug`s with dismissal access +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) SetTeams(value []string)() { + m.teams = value +} +// SetUsers sets the users property value. The list of user `login`s with dismissal access +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) SetUsers(value []string)() { + m.users = value +} +type ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]string) + GetTeams()([]string) + GetUsers()([]string) + SetApps(value []string)() + SetTeams(value []string)() + SetUsers(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_pull_request_reviews_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_pull_request_reviews_request_builder.go new file mode 100644 index 000000000..6e801f65f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_pull_request_reviews_request_builder.go @@ -0,0 +1,119 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\required_pull_request_reviews +type ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) { + m := &ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/required_pull_request_reviews", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder instantiates a new ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a ProtectedBranchPullRequestReviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProtectedBranchPullRequestReviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProtectedBranchPullRequestReviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProtectedBranchPullRequestReviewable), nil +} +// Patch protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled.**Note**: Passing new arrays of `users` and `teams` replaces their previous values. +// returns a ProtectedBranchPullRequestReviewable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) Patch(ctx context.Context, body ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProtectedBranchPullRequestReviewable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProtectedBranchPullRequestReviewFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProtectedBranchPullRequestReviewable), nil +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled.**Note**: Passing new arrays of `users` and `teams` replaces their previous values. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) { + return NewItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_signatures_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_signatures_request_builder.go new file mode 100644 index 000000000..9bbdf9b61 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_signatures_request_builder.go @@ -0,0 +1,119 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\required_signatures +type ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemBranchesItemProtectionRequired_signaturesRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequired_signaturesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) { + m := &ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/required_signatures", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRequired_signaturesRequestBuilder instantiates a new ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequired_signaturesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRequired_signaturesRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection +func (m *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of `true` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://docs.github.com/articles/signing-commits-with-gpg) in GitHub Help.**Note**: You must enable branch protection to require signed commits. +// returns a ProtectedBranchAdminEnforcedable 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/branches/branch-protection#get-commit-signature-protection +func (m *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProtectedBranchAdminEnforcedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProtectedBranchAdminEnforcedFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProtectedBranchAdminEnforcedable), nil +} +// Post protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits. +// returns a ProtectedBranchAdminEnforcedable 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/branches/branch-protection#create-commit-signature-protection +func (m *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProtectedBranchAdminEnforcedable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProtectedBranchAdminEnforcedFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ProtectedBranchAdminEnforcedable), nil +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of `true` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://docs.github.com/articles/signing-commits-with-gpg) in GitHub Help.**Note**: You must enable branch protection to require signed commits. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) { + return NewItemItemBranchesItemProtectionRequired_signaturesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_contexts_delete_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_contexts_delete_request_body_member1.go new file mode 100644 index 000000000..bc27734ae --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_contexts_delete_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name of the status checks + contexts []string +} +// NewItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1()(*ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContexts gets the contexts property value. The name of the status checks +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1) GetContexts()([]string) { + return m.contexts +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["contexts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetContexts(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContexts() != nil { + err := writer.WriteCollectionOfStringValues("contexts", m.GetContexts()) + 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 *ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContexts sets the contexts property value. The name of the status checks +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1) SetContexts(value []string)() { + m.contexts = value +} +type ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContexts()([]string) + SetContexts(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_contexts_post_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_contexts_post_request_body_member1.go new file mode 100644 index 000000000..cb99264cd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_contexts_post_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name of the status checks + contexts []string +} +// NewItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1()(*ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContexts gets the contexts property value. The name of the status checks +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1) GetContexts()([]string) { + return m.contexts +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["contexts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetContexts(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContexts() != nil { + err := writer.WriteCollectionOfStringValues("contexts", m.GetContexts()) + 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 *ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContexts sets the contexts property value. The name of the status checks +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1) SetContexts(value []string)() { + m.contexts = value +} +type ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContexts()([]string) + SetContexts(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_contexts_put_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_contexts_put_request_body_member1.go new file mode 100644 index 000000000..d0a5e69f5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_contexts_put_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name of the status checks + contexts []string +} +// NewItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1()(*ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContexts gets the contexts property value. The name of the status checks +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1) GetContexts()([]string) { + return m.contexts +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["contexts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetContexts(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContexts() != nil { + err := writer.WriteCollectionOfStringValues("contexts", m.GetContexts()) + 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 *ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContexts sets the contexts property value. The name of the status checks +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1) SetContexts(value []string)() { + m.contexts = value +} +type ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContexts()([]string) + SetContexts(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_contexts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_contexts_request_builder.go new file mode 100644 index 000000000..87785124f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_contexts_request_builder.go @@ -0,0 +1,577 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\required_status_checks\contexts +type ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ContextsDeleteRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able, string +type ContextsDeleteRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able + contextsDeleteRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able + // Composed type representation for type string + contextsDeleteRequestBodyString *string + // Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able + itemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able + // Composed type representation for type string + string *string +} +// NewContextsDeleteRequestBody instantiates a new ContextsDeleteRequestBody and sets the default values. +func NewContextsDeleteRequestBody()(*ContextsDeleteRequestBody) { + m := &ContextsDeleteRequestBody{ + } + return m +} +// CreateContextsDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContextsDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewContextsDeleteRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetContextsDeleteRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetContextsDeleteRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1 gets the ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able when successful +func (m *ContextsDeleteRequestBody) GetContextsDeleteRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able) { + return m.contextsDeleteRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 +} +// GetContextsDeleteRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ContextsDeleteRequestBody) GetContextsDeleteRequestBodyString()(*string) { + return m.contextsDeleteRequestBodyString +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContextsDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *ContextsDeleteRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1 gets the ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able when successful +func (m *ContextsDeleteRequestBody) GetItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ContextsDeleteRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ContextsDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContextsDeleteRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetContextsDeleteRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetContextsDeleteRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetContextsDeleteRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetContextsDeleteRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1 sets the ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able +func (m *ContextsDeleteRequestBody) SetContextsDeleteRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able)() { + m.contextsDeleteRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 = value +} +// SetContextsDeleteRequestBodyString sets the string property value. Composed type representation for type string +func (m *ContextsDeleteRequestBody) SetContextsDeleteRequestBodyString(value *string)() { + m.contextsDeleteRequestBodyString = value +} +// SetItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1 sets the ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able +func (m *ContextsDeleteRequestBody) SetItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ContextsDeleteRequestBody) SetString(value *string)() { + m.string = value +} +// ContextsPostRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able, string +type ContextsPostRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able + contextsPostRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able + // Composed type representation for type string + contextsPostRequestBodyString *string + // Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able + itemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able + // Composed type representation for type string + string *string +} +// NewContextsPostRequestBody instantiates a new ContextsPostRequestBody and sets the default values. +func NewContextsPostRequestBody()(*ContextsPostRequestBody) { + m := &ContextsPostRequestBody{ + } + return m +} +// CreateContextsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContextsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewContextsPostRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetContextsPostRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetContextsPostRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1 gets the ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able when successful +func (m *ContextsPostRequestBody) GetContextsPostRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able) { + return m.contextsPostRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 +} +// GetContextsPostRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ContextsPostRequestBody) GetContextsPostRequestBodyString()(*string) { + return m.contextsPostRequestBodyString +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContextsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *ContextsPostRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1 gets the ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able when successful +func (m *ContextsPostRequestBody) GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ContextsPostRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ContextsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContextsPostRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetContextsPostRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetContextsPostRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetContextsPostRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetContextsPostRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1 sets the ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able +func (m *ContextsPostRequestBody) SetContextsPostRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able)() { + m.contextsPostRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 = value +} +// SetContextsPostRequestBodyString sets the string property value. Composed type representation for type string +func (m *ContextsPostRequestBody) SetContextsPostRequestBodyString(value *string)() { + m.contextsPostRequestBodyString = value +} +// SetItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1 sets the ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able +func (m *ContextsPostRequestBody) SetItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ContextsPostRequestBody) SetString(value *string)() { + m.string = value +} +// ContextsPutRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able, string +type ContextsPutRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able + contextsPutRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able + // Composed type representation for type string + contextsPutRequestBodyString *string + // Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able + itemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able + // Composed type representation for type string + string *string +} +// NewContextsPutRequestBody instantiates a new ContextsPutRequestBody and sets the default values. +func NewContextsPutRequestBody()(*ContextsPutRequestBody) { + m := &ContextsPutRequestBody{ + } + return m +} +// CreateContextsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContextsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewContextsPutRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetContextsPutRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetContextsPutRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1 gets the ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able when successful +func (m *ContextsPutRequestBody) GetContextsPutRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able) { + return m.contextsPutRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 +} +// GetContextsPutRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ContextsPutRequestBody) GetContextsPutRequestBodyString()(*string) { + return m.contextsPutRequestBodyString +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContextsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *ContextsPutRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1 gets the ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able when successful +func (m *ContextsPutRequestBody) GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ContextsPutRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ContextsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContextsPutRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetContextsPutRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetContextsPutRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetContextsPutRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetContextsPutRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1 sets the ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able +func (m *ContextsPutRequestBody) SetContextsPutRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able)() { + m.contextsPutRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 = value +} +// SetContextsPutRequestBodyString sets the string property value. Composed type representation for type string +func (m *ContextsPutRequestBody) SetContextsPutRequestBodyString(value *string)() { + m.contextsPutRequestBodyString = value +} +// SetItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1 sets the ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able +func (m *ContextsPutRequestBody) SetItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ContextsPutRequestBody) SetString(value *string)() { + m.string = value +} +type ContextsDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContextsDeleteRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able) + GetContextsDeleteRequestBodyString()(*string) + GetItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able) + GetString()(*string) + SetContextsDeleteRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able)() + SetContextsDeleteRequestBodyString(value *string)() + SetItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able)() + SetString(value *string)() +} +type ContextsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContextsPostRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able) + GetContextsPostRequestBodyString()(*string) + GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able) + GetString()(*string) + SetContextsPostRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able)() + SetContextsPostRequestBodyString(value *string)() + SetItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able)() + SetString(value *string)() +} +type ContextsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContextsPutRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able) + GetContextsPutRequestBodyString()(*string) + GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able) + GetString()(*string) + SetContextsPutRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able)() + SetContextsPutRequestBodyString(value *string)() + SetItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able)() + SetString(value *string)() +} +// NewItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) { + m := &ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/required_status_checks/contexts", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder instantiates a new ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a []string 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#remove-status-check-contexts +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) Delete(ctx context.Context, body ContextsDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]string, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitiveCollection(ctx, requestInfo, "string", errorMapping) + if err != nil { + return nil, err + } + val := make([]string, len(res)) + for i, v := range res { + if v != nil { + val[i] = *(v.(*string)) + } + } + return val, nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a []string 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/branches/branch-protection#get-all-status-check-contexts +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]string, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitiveCollection(ctx, requestInfo, "string", errorMapping) + if err != nil { + return nil, err + } + val := make([]string, len(res)) + for i, v := range res { + if v != nil { + val[i] = *(v.(*string)) + } + } + return val, nil +} +// Post protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a []string when successful +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#add-status-check-contexts +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) Post(ctx context.Context, body ContextsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]string, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitiveCollection(ctx, requestInfo, "string", errorMapping) + if err != nil { + return nil, err + } + val := make([]string, len(res)) + for i, v := range res { + if v != nil { + val[i] = *(v.(*string)) + } + } + return val, nil +} +// Put protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a []string 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#set-status-check-contexts +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) Put(ctx context.Context, body ContextsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]string, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitiveCollection(ctx, requestInfo, "string", errorMapping) + if err != nil { + return nil, err + } + val := make([]string, len(res)) + for i, v := range res { + if v != nil { + val[i] = *(v.(*string)) + } + } + return val, nil +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ContextsDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ContextsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPutRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ContextsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) { + return NewItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_patch_request_body.go new file mode 100644 index 000000000..8e17ff989 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_patch_request_body.go @@ -0,0 +1,159 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The list of status checks to require in order to merge into this branch. + checks []ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable + // **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. + // Deprecated: + contexts []string + // Require branches to be up to date before merging. + strict *bool +} +// NewItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody instantiates a new ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody()(*ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) { + m := &ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRequired_status_checksPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRequired_status_checksPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody(), 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 *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChecks gets the checks property value. The list of status checks to require in order to merge into this branch. +// returns a []ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) GetChecks()([]ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable) { + return m.checks +} +// GetContexts gets the contexts property value. **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. +// Deprecated: +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) GetContexts()([]string) { + return m.contexts +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable) + } + } + m.SetChecks(res) + } + return nil + } + res["contexts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetContexts(res) + } + return nil + } + res["strict"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetStrict(val) + } + return nil + } + return res +} +// GetStrict gets the strict property value. Require branches to be up to date before merging. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) GetStrict()(*bool) { + return m.strict +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetChecks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetChecks())) + for i, v := range m.GetChecks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("checks", cast) + if err != nil { + return err + } + } + if m.GetContexts() != nil { + err := writer.WriteCollectionOfStringValues("contexts", m.GetContexts()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("strict", m.GetStrict()) + 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 *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChecks sets the checks property value. The list of status checks to require in order to merge into this branch. +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) SetChecks(value []ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable)() { + m.checks = value +} +// SetContexts sets the contexts property value. **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. +// Deprecated: +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) SetContexts(value []string)() { + m.contexts = value +} +// SetStrict sets the strict property value. Require branches to be up to date before merging. +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) SetStrict(value *bool)() { + m.strict = value +} +type ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChecks()([]ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable) + GetContexts()([]string) + GetStrict()(*bool) + SetChecks(value []ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable)() + SetContexts(value []string)() + SetStrict(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_patch_request_body_checks.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_patch_request_body_checks.go new file mode 100644 index 000000000..c7e1a36a7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_patch_request_body_checks.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The ID of the GitHub App that must provide this check. Omit this field to automatically select the GitHub App that has recently provided this check, or any app if it was not set by a GitHub App. Pass -1 to explicitly allow any app to set the status. + app_id *int32 + // The name of the required check + context *string +} +// NewItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks instantiates a new ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks()(*ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) { + m := &ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks(), 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 *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAppId gets the app_id property value. The ID of the GitHub App that must provide this check. Omit this field to automatically select the GitHub App that has recently provided this check, or any app if it was not set by a GitHub App. Pass -1 to explicitly allow any app to set the status. +// returns a *int32 when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) GetAppId()(*int32) { + return m.app_id +} +// GetContext gets the context property value. The name of the required check +// returns a *string when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) GetContext()(*string) { + return m.context +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("app_id", m.GetAppId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("context", m.GetContext()) + 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 *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAppId sets the app_id property value. The ID of the GitHub App that must provide this check. Omit this field to automatically select the GitHub App that has recently provided this check, or any app if it was not set by a GitHub App. Pass -1 to explicitly allow any app to set the status. +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) SetAppId(value *int32)() { + m.app_id = value +} +// SetContext sets the context property value. The name of the required check +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) SetContext(value *string)() { + m.context = value +} +type ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppId()(*int32) + GetContext()(*string) + SetAppId(value *int32)() + SetContext(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_request_builder.go new file mode 100644 index 000000000..31d91b9a5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_required_status_checks_request_builder.go @@ -0,0 +1,125 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\required_status_checks +type ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemBranchesItemProtectionRequired_status_checksRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) { + m := &ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/required_status_checks", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRequired_status_checksRequestBuilder instantiates a new ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRequired_status_checksRequestBuilderInternal(urlParams, requestAdapter) +} +// Contexts the contexts property +// returns a *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) Contexts()(*ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) { + return NewItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection +func (m *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a StatusCheckPolicyable 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/branches/branch-protection#get-status-checks-protection +func (m *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.StatusCheckPolicyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateStatusCheckPolicyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.StatusCheckPolicyable), nil +} +// Patch protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled. +// returns a StatusCheckPolicyable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection +func (m *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) Patch(ctx context.Context, body ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.StatusCheckPolicyable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateStatusCheckPolicyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.StatusCheckPolicyable), nil +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) { + return NewItemItemBranchesItemProtectionRequired_status_checksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_delete_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_delete_request_body_member1.go new file mode 100644 index 000000000..5ce1f77b2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_delete_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. + apps []string +} +// NewItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1) GetApps()([]string) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetApps(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + err := writer.WriteCollectionOfStringValues("apps", m.GetApps()) + 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 *ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. +func (m *ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1) SetApps(value []string)() { + m.apps = value +} +type ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]string) + SetApps(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_post_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_post_request_body_member1.go new file mode 100644 index 000000000..a099409bd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_post_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. + apps []string +} +// NewItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1) GetApps()([]string) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetApps(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + err := writer.WriteCollectionOfStringValues("apps", m.GetApps()) + 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 *ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. +func (m *ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1) SetApps(value []string)() { + m.apps = value +} +type ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]string) + SetApps(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_put_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_put_request_body_member1.go new file mode 100644 index 000000000..0e1ebc43e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_put_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. + apps []string +} +// NewItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1) GetApps()([]string) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetApps(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + err := writer.WriteCollectionOfStringValues("apps", m.GetApps()) + 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 *ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. +func (m *ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1) SetApps(value []string)() { + m.apps = value +} +type ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]string) + SetApps(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_request_builder.go new file mode 100644 index 000000000..cae6efd92 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_request_builder.go @@ -0,0 +1,569 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\restrictions\apps +type ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// AppsDeleteRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able, string +type AppsDeleteRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able + appsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able + // Composed type representation for type string + appsDeleteRequestBodyString *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able + // Composed type representation for type string + string *string +} +// NewAppsDeleteRequestBody instantiates a new AppsDeleteRequestBody and sets the default values. +func NewAppsDeleteRequestBody()(*AppsDeleteRequestBody) { + m := &AppsDeleteRequestBody{ + } + return m +} +// CreateAppsDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAppsDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewAppsDeleteRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetAppsDeleteRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetAppsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able when successful +func (m *AppsDeleteRequestBody) GetAppsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able) { + return m.appsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 +} +// GetAppsDeleteRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *AppsDeleteRequestBody) GetAppsDeleteRequestBodyString()(*string) { + return m.appsDeleteRequestBodyString +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AppsDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *AppsDeleteRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able when successful +func (m *AppsDeleteRequestBody) GetItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *AppsDeleteRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *AppsDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAppsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetAppsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetAppsDeleteRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetAppsDeleteRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetAppsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able +func (m *AppsDeleteRequestBody) SetAppsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able)() { + m.appsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 = value +} +// SetAppsDeleteRequestBodyString sets the string property value. Composed type representation for type string +func (m *AppsDeleteRequestBody) SetAppsDeleteRequestBodyString(value *string)() { + m.appsDeleteRequestBodyString = value +} +// SetItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able +func (m *AppsDeleteRequestBody) SetItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *AppsDeleteRequestBody) SetString(value *string)() { + m.string = value +} +// AppsPostRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able, string +type AppsPostRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able + appsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able + // Composed type representation for type string + appsPostRequestBodyString *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able + // Composed type representation for type string + string *string +} +// NewAppsPostRequestBody instantiates a new AppsPostRequestBody and sets the default values. +func NewAppsPostRequestBody()(*AppsPostRequestBody) { + m := &AppsPostRequestBody{ + } + return m +} +// CreateAppsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAppsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewAppsPostRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetAppsPostRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetAppsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able when successful +func (m *AppsPostRequestBody) GetAppsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able) { + return m.appsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 +} +// GetAppsPostRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *AppsPostRequestBody) GetAppsPostRequestBodyString()(*string) { + return m.appsPostRequestBodyString +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AppsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *AppsPostRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able when successful +func (m *AppsPostRequestBody) GetItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *AppsPostRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *AppsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAppsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetAppsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetAppsPostRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetAppsPostRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetAppsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able +func (m *AppsPostRequestBody) SetAppsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able)() { + m.appsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 = value +} +// SetAppsPostRequestBodyString sets the string property value. Composed type representation for type string +func (m *AppsPostRequestBody) SetAppsPostRequestBodyString(value *string)() { + m.appsPostRequestBodyString = value +} +// SetItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able +func (m *AppsPostRequestBody) SetItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *AppsPostRequestBody) SetString(value *string)() { + m.string = value +} +// AppsPutRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able, string +type AppsPutRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able + appsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able + // Composed type representation for type string + appsPutRequestBodyString *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able + // Composed type representation for type string + string *string +} +// NewAppsPutRequestBody instantiates a new AppsPutRequestBody and sets the default values. +func NewAppsPutRequestBody()(*AppsPutRequestBody) { + m := &AppsPutRequestBody{ + } + return m +} +// CreateAppsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAppsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewAppsPutRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetAppsPutRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetAppsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able when successful +func (m *AppsPutRequestBody) GetAppsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able) { + return m.appsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 +} +// GetAppsPutRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *AppsPutRequestBody) GetAppsPutRequestBodyString()(*string) { + return m.appsPutRequestBodyString +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AppsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *AppsPutRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able when successful +func (m *AppsPutRequestBody) GetItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *AppsPutRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *AppsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAppsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetAppsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetAppsPutRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetAppsPutRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetAppsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able +func (m *AppsPutRequestBody) SetAppsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able)() { + m.appsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 = value +} +// SetAppsPutRequestBodyString sets the string property value. Composed type representation for type string +func (m *AppsPutRequestBody) SetAppsPutRequestBodyString(value *string)() { + m.appsPutRequestBodyString = value +} +// SetItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able +func (m *AppsPutRequestBody) SetItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *AppsPutRequestBody) SetString(value *string)() { + m.string = value +} +type AppsDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able) + GetAppsDeleteRequestBodyString()(*string) + GetItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able) + GetString()(*string) + SetAppsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able)() + SetAppsDeleteRequestBodyString(value *string)() + SetItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able)() + SetString(value *string)() +} +type AppsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able) + GetAppsPostRequestBodyString()(*string) + GetItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able) + GetString()(*string) + SetAppsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able)() + SetAppsPostRequestBodyString(value *string)() + SetItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able)() + SetString(value *string)() +} +type AppsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able) + GetAppsPutRequestBodyString()(*string) + GetItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able) + GetString()(*string) + SetAppsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able)() + SetAppsPutRequestBodyString(value *string)() + SetItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able)() + SetString(value *string)() +} +// NewItemItemBranchesItemProtectionRestrictionsAppsRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsAppsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) { + m := &ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/restrictions/apps", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder instantiates a new ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRestrictionsAppsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Removes the ability of an app to push to this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch. +// returns a []Integrationable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) Delete(ctx context.Context, body AppsDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integrationable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIntegrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integrationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integrationable) + } + } + return val, nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists the GitHub Apps that have push access to this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch. +// returns a []Integrationable 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/branches/branch-protection#get-apps-with-access-to-the-protected-branch +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integrationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIntegrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integrationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integrationable) + } + } + return val, nil +} +// Post protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Grants the specified apps push access for this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch. +// returns a []Integrationable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) Post(ctx context.Context, body AppsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integrationable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIntegrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integrationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integrationable) + } + } + return val, nil +} +// Put protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch. +// returns a []Integrationable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) Put(ctx context.Context, body AppsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integrationable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIntegrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integrationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Integrationable) + } + } + return val, nil +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Removes the ability of an app to push to this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body AppsDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists the GitHub Apps that have push access to this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Grants the specified apps push access for this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) ToPostRequestInformation(ctx context.Context, body AppsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPutRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) ToPutRequestInformation(ctx context.Context, body AppsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) { + return NewItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_request_builder.go new file mode 100644 index 000000000..67ae5e277 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_request_builder.go @@ -0,0 +1,98 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRestrictionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\restrictions +type ItemItemBranchesItemProtectionRestrictionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Apps the apps property +// returns a *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRestrictionsRequestBuilder) Apps()(*ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) { + return NewItemItemBranchesItemProtectionRestrictionsAppsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemBranchesItemProtectionRestrictionsRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRestrictionsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRestrictionsRequestBuilder) { + m := &ItemItemBranchesItemProtectionRestrictionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/restrictions", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRestrictionsRequestBuilder instantiates a new ItemItemBranchesItemProtectionRestrictionsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRestrictionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRestrictionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Disables the ability to restrict who can push to this branch. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#delete-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists who has access to this protected branch.**Note**: Users, apps, and teams `restrictions` are only available for organization-owned repositories. +// returns a BranchRestrictionPolicyable 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/branches/branch-protection#get-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BranchRestrictionPolicyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBranchRestrictionPolicyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BranchRestrictionPolicyable), nil +} +// Teams the teams property +// returns a *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRestrictionsRequestBuilder) Teams()(*ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) { + return NewItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Disables the ability to restrict who can push to this branch. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists who has access to this protected branch.**Note**: Users, apps, and teams `restrictions` are only available for organization-owned repositories. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// Users the users property +// returns a *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRestrictionsRequestBuilder) Users()(*ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) { + return NewItemItemBranchesItemProtectionRestrictionsUsersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemBranchesItemProtectionRestrictionsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRestrictionsRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRestrictionsRequestBuilder) { + return NewItemItemBranchesItemProtectionRestrictionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_delete_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_delete_request_body_member1.go new file mode 100644 index 000000000..a507a82da --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_delete_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The slug values for teams + teams []string +} +// NewItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTeams(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The slug values for teams +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1) GetTeams()([]string) { + return m.teams +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTeams() != nil { + err := writer.WriteCollectionOfStringValues("teams", m.GetTeams()) + 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 *ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTeams sets the teams property value. The slug values for teams +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1) SetTeams(value []string)() { + m.teams = value +} +type ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTeams()([]string) + SetTeams(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_post_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_post_request_body_member1.go new file mode 100644 index 000000000..68bec9b12 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_post_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The slug values for teams + teams []string +} +// NewItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTeams(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The slug values for teams +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1) GetTeams()([]string) { + return m.teams +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTeams() != nil { + err := writer.WriteCollectionOfStringValues("teams", m.GetTeams()) + 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 *ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTeams sets the teams property value. The slug values for teams +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1) SetTeams(value []string)() { + m.teams = value +} +type ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTeams()([]string) + SetTeams(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_put_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_put_request_body_member1.go new file mode 100644 index 000000000..dace748a1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_put_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The slug values for teams + teams []string +} +// NewItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTeams(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The slug values for teams +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1) GetTeams()([]string) { + return m.teams +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTeams() != nil { + err := writer.WriteCollectionOfStringValues("teams", m.GetTeams()) + 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 *ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTeams sets the teams property value. The slug values for teams +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1) SetTeams(value []string)() { + m.teams = value +} +type ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTeams()([]string) + SetTeams(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_request_builder.go new file mode 100644 index 000000000..b888d42da --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_request_builder.go @@ -0,0 +1,569 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\restrictions\teams +type ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// TeamsDeleteRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able, string +type TeamsDeleteRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able + // Composed type representation for type string + string *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able + teamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able + // Composed type representation for type string + teamsDeleteRequestBodyString *string +} +// NewTeamsDeleteRequestBody instantiates a new TeamsDeleteRequestBody and sets the default values. +func NewTeamsDeleteRequestBody()(*TeamsDeleteRequestBody) { + m := &TeamsDeleteRequestBody{ + } + return m +} +// CreateTeamsDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamsDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewTeamsDeleteRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetTeamsDeleteRequestBodyString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamsDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *TeamsDeleteRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able when successful +func (m *TeamsDeleteRequestBody) GetItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *TeamsDeleteRequestBody) GetString()(*string) { + return m.string +} +// GetTeamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able when successful +func (m *TeamsDeleteRequestBody) GetTeamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able) { + return m.teamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 +} +// GetTeamsDeleteRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *TeamsDeleteRequestBody) GetTeamsDeleteRequestBodyString()(*string) { + return m.teamsDeleteRequestBodyString +} +// Serialize serializes information the current object +func (m *TeamsDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetTeamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetTeamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetTeamsDeleteRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetTeamsDeleteRequestBodyString()) + if err != nil { + return err + } + } + return nil +} +// SetItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able +func (m *TeamsDeleteRequestBody) SetItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *TeamsDeleteRequestBody) SetString(value *string)() { + m.string = value +} +// SetTeamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able +func (m *TeamsDeleteRequestBody) SetTeamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able)() { + m.teamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 = value +} +// SetTeamsDeleteRequestBodyString sets the string property value. Composed type representation for type string +func (m *TeamsDeleteRequestBody) SetTeamsDeleteRequestBodyString(value *string)() { + m.teamsDeleteRequestBodyString = value +} +// TeamsPostRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able, string +type TeamsPostRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able + // Composed type representation for type string + string *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able + teamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able + // Composed type representation for type string + teamsPostRequestBodyString *string +} +// NewTeamsPostRequestBody instantiates a new TeamsPostRequestBody and sets the default values. +func NewTeamsPostRequestBody()(*TeamsPostRequestBody) { + m := &TeamsPostRequestBody{ + } + return m +} +// CreateTeamsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewTeamsPostRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetTeamsPostRequestBodyString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *TeamsPostRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able when successful +func (m *TeamsPostRequestBody) GetItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *TeamsPostRequestBody) GetString()(*string) { + return m.string +} +// GetTeamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able when successful +func (m *TeamsPostRequestBody) GetTeamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able) { + return m.teamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 +} +// GetTeamsPostRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *TeamsPostRequestBody) GetTeamsPostRequestBodyString()(*string) { + return m.teamsPostRequestBodyString +} +// Serialize serializes information the current object +func (m *TeamsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetTeamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetTeamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetTeamsPostRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetTeamsPostRequestBodyString()) + if err != nil { + return err + } + } + return nil +} +// SetItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able +func (m *TeamsPostRequestBody) SetItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *TeamsPostRequestBody) SetString(value *string)() { + m.string = value +} +// SetTeamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able +func (m *TeamsPostRequestBody) SetTeamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able)() { + m.teamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 = value +} +// SetTeamsPostRequestBodyString sets the string property value. Composed type representation for type string +func (m *TeamsPostRequestBody) SetTeamsPostRequestBodyString(value *string)() { + m.teamsPostRequestBodyString = value +} +// TeamsPutRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able, string +type TeamsPutRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able + // Composed type representation for type string + string *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able + teamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able + // Composed type representation for type string + teamsPutRequestBodyString *string +} +// NewTeamsPutRequestBody instantiates a new TeamsPutRequestBody and sets the default values. +func NewTeamsPutRequestBody()(*TeamsPutRequestBody) { + m := &TeamsPutRequestBody{ + } + return m +} +// CreateTeamsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewTeamsPutRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetTeamsPutRequestBodyString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *TeamsPutRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able when successful +func (m *TeamsPutRequestBody) GetItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *TeamsPutRequestBody) GetString()(*string) { + return m.string +} +// GetTeamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able when successful +func (m *TeamsPutRequestBody) GetTeamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able) { + return m.teamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 +} +// GetTeamsPutRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *TeamsPutRequestBody) GetTeamsPutRequestBodyString()(*string) { + return m.teamsPutRequestBodyString +} +// Serialize serializes information the current object +func (m *TeamsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetTeamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetTeamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetTeamsPutRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetTeamsPutRequestBodyString()) + if err != nil { + return err + } + } + return nil +} +// SetItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able +func (m *TeamsPutRequestBody) SetItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *TeamsPutRequestBody) SetString(value *string)() { + m.string = value +} +// SetTeamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able +func (m *TeamsPutRequestBody) SetTeamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able)() { + m.teamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 = value +} +// SetTeamsPutRequestBodyString sets the string property value. Composed type representation for type string +func (m *TeamsPutRequestBody) SetTeamsPutRequestBodyString(value *string)() { + m.teamsPutRequestBodyString = value +} +type TeamsDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able) + GetString()(*string) + GetTeamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able) + GetTeamsDeleteRequestBodyString()(*string) + SetItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able)() + SetString(value *string)() + SetTeamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able)() + SetTeamsDeleteRequestBodyString(value *string)() +} +type TeamsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able) + GetString()(*string) + GetTeamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able) + GetTeamsPostRequestBodyString()(*string) + SetItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able)() + SetString(value *string)() + SetTeamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able)() + SetTeamsPostRequestBodyString(value *string)() +} +type TeamsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able) + GetString()(*string) + GetTeamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able) + GetTeamsPutRequestBodyString()(*string) + SetItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able)() + SetString(value *string)() + SetTeamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able)() + SetTeamsPutRequestBodyString(value *string)() +} +// NewItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) { + m := &ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/restrictions/teams", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder instantiates a new ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Removes the ability of a team to push to this branch. You can also remove push access for child teams. +// returns a []Teamable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) Delete(ctx context.Context, body TeamsDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable) + } + } + return val, nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists the teams who have push access to this branch. The list includes child teams. +// returns a []Teamable 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/branches/branch-protection#get-teams-with-access-to-the-protected-branch +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable) + } + } + return val, nil +} +// Post protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Grants the specified teams push access for this branch. You can also give push access to child teams. +// returns a []Teamable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) Post(ctx context.Context, body TeamsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable) + } + } + return val, nil +} +// Put protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams. +// returns a []Teamable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) Put(ctx context.Context, body TeamsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable) + } + } + return val, nil +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Removes the ability of a team to push to this branch. You can also remove push access for child teams. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body TeamsDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists the teams who have push access to this branch. The list includes child teams. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Grants the specified teams push access for this branch. You can also give push access to child teams. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) ToPostRequestInformation(ctx context.Context, body TeamsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPutRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) ToPutRequestInformation(ctx context.Context, body TeamsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) { + return NewItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_users_delete_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_users_delete_request_body_member1.go new file mode 100644 index 000000000..9f01a921b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_users_delete_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The username for users + users []string +} +// NewItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetUsers(res) + } + return nil + } + return res +} +// GetUsers gets the users property value. The username for users +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1) GetUsers()([]string) { + return m.users +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetUsers() != nil { + err := writer.WriteCollectionOfStringValues("users", m.GetUsers()) + 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 *ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetUsers sets the users property value. The username for users +func (m *ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1) SetUsers(value []string)() { + m.users = value +} +type ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetUsers()([]string) + SetUsers(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_users_post_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_users_post_request_body_member1.go new file mode 100644 index 000000000..7f7e50e89 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_users_post_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The username for users + users []string +} +// NewItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetUsers(res) + } + return nil + } + return res +} +// GetUsers gets the users property value. The username for users +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1) GetUsers()([]string) { + return m.users +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetUsers() != nil { + err := writer.WriteCollectionOfStringValues("users", m.GetUsers()) + 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 *ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetUsers sets the users property value. The username for users +func (m *ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1) SetUsers(value []string)() { + m.users = value +} +type ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetUsers()([]string) + SetUsers(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_users_put_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_users_put_request_body_member1.go new file mode 100644 index 000000000..b809f506c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_users_put_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The username for users + users []string +} +// NewItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetUsers(res) + } + return nil + } + return res +} +// GetUsers gets the users property value. The username for users +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1) GetUsers()([]string) { + return m.users +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetUsers() != nil { + err := writer.WriteCollectionOfStringValues("users", m.GetUsers()) + 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 *ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetUsers sets the users property value. The username for users +func (m *ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1) SetUsers(value []string)() { + m.users = value +} +type ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetUsers()([]string) + SetUsers(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_users_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_users_request_builder.go new file mode 100644 index 000000000..d59603ece --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_protection_restrictions_users_request_builder.go @@ -0,0 +1,569 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\restrictions\users +type ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// UsersDeleteRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able, string +type UsersDeleteRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able + // Composed type representation for type string + string *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able + usersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able + // Composed type representation for type string + usersDeleteRequestBodyString *string +} +// NewUsersDeleteRequestBody instantiates a new UsersDeleteRequestBody and sets the default values. +func NewUsersDeleteRequestBody()(*UsersDeleteRequestBody) { + m := &UsersDeleteRequestBody{ + } + return m +} +// CreateUsersDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsersDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewUsersDeleteRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetUsersDeleteRequestBodyString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UsersDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *UsersDeleteRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able when successful +func (m *UsersDeleteRequestBody) GetItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *UsersDeleteRequestBody) GetString()(*string) { + return m.string +} +// GetUsersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able when successful +func (m *UsersDeleteRequestBody) GetUsersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able) { + return m.usersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 +} +// GetUsersDeleteRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *UsersDeleteRequestBody) GetUsersDeleteRequestBodyString()(*string) { + return m.usersDeleteRequestBodyString +} +// Serialize serializes information the current object +func (m *UsersDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetUsersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetUsersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetUsersDeleteRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetUsersDeleteRequestBodyString()) + if err != nil { + return err + } + } + return nil +} +// SetItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able +func (m *UsersDeleteRequestBody) SetItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *UsersDeleteRequestBody) SetString(value *string)() { + m.string = value +} +// SetUsersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able +func (m *UsersDeleteRequestBody) SetUsersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able)() { + m.usersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 = value +} +// SetUsersDeleteRequestBodyString sets the string property value. Composed type representation for type string +func (m *UsersDeleteRequestBody) SetUsersDeleteRequestBodyString(value *string)() { + m.usersDeleteRequestBodyString = value +} +// UsersPostRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able, string +type UsersPostRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able + // Composed type representation for type string + string *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able + usersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able + // Composed type representation for type string + usersPostRequestBodyString *string +} +// NewUsersPostRequestBody instantiates a new UsersPostRequestBody and sets the default values. +func NewUsersPostRequestBody()(*UsersPostRequestBody) { + m := &UsersPostRequestBody{ + } + return m +} +// CreateUsersPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsersPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewUsersPostRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetUsersPostRequestBodyString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UsersPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *UsersPostRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able when successful +func (m *UsersPostRequestBody) GetItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *UsersPostRequestBody) GetString()(*string) { + return m.string +} +// GetUsersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able when successful +func (m *UsersPostRequestBody) GetUsersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able) { + return m.usersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 +} +// GetUsersPostRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *UsersPostRequestBody) GetUsersPostRequestBodyString()(*string) { + return m.usersPostRequestBodyString +} +// Serialize serializes information the current object +func (m *UsersPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetUsersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetUsersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetUsersPostRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetUsersPostRequestBodyString()) + if err != nil { + return err + } + } + return nil +} +// SetItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able +func (m *UsersPostRequestBody) SetItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *UsersPostRequestBody) SetString(value *string)() { + m.string = value +} +// SetUsersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able +func (m *UsersPostRequestBody) SetUsersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able)() { + m.usersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 = value +} +// SetUsersPostRequestBodyString sets the string property value. Composed type representation for type string +func (m *UsersPostRequestBody) SetUsersPostRequestBodyString(value *string)() { + m.usersPostRequestBodyString = value +} +// UsersPutRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able, string +type UsersPutRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able + // Composed type representation for type string + string *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able + usersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able + // Composed type representation for type string + usersPutRequestBodyString *string +} +// NewUsersPutRequestBody instantiates a new UsersPutRequestBody and sets the default values. +func NewUsersPutRequestBody()(*UsersPutRequestBody) { + m := &UsersPutRequestBody{ + } + return m +} +// CreateUsersPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsersPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewUsersPutRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetUsersPutRequestBodyString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UsersPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *UsersPutRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able when successful +func (m *UsersPutRequestBody) GetItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *UsersPutRequestBody) GetString()(*string) { + return m.string +} +// GetUsersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able when successful +func (m *UsersPutRequestBody) GetUsersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able) { + return m.usersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 +} +// GetUsersPutRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *UsersPutRequestBody) GetUsersPutRequestBodyString()(*string) { + return m.usersPutRequestBodyString +} +// Serialize serializes information the current object +func (m *UsersPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetUsersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetUsersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetUsersPutRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetUsersPutRequestBodyString()) + if err != nil { + return err + } + } + return nil +} +// SetItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able +func (m *UsersPutRequestBody) SetItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *UsersPutRequestBody) SetString(value *string)() { + m.string = value +} +// SetUsersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able +func (m *UsersPutRequestBody) SetUsersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able)() { + m.usersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 = value +} +// SetUsersPutRequestBodyString sets the string property value. Composed type representation for type string +func (m *UsersPutRequestBody) SetUsersPutRequestBodyString(value *string)() { + m.usersPutRequestBodyString = value +} +type UsersDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able) + GetString()(*string) + GetUsersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able) + GetUsersDeleteRequestBodyString()(*string) + SetItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able)() + SetString(value *string)() + SetUsersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able)() + SetUsersDeleteRequestBodyString(value *string)() +} +type UsersPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able) + GetString()(*string) + GetUsersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able) + GetUsersPostRequestBodyString()(*string) + SetItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able)() + SetString(value *string)() + SetUsersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able)() + SetUsersPostRequestBodyString(value *string)() +} +type UsersPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able) + GetString()(*string) + GetUsersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able) + GetUsersPutRequestBodyString()(*string) + SetItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able)() + SetString(value *string)() + SetUsersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able)() + SetUsersPutRequestBodyString(value *string)() +} +// NewItemItemBranchesItemProtectionRestrictionsUsersRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsUsersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) { + m := &ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/restrictions/users", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder instantiates a new ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRestrictionsUsersRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Removes the ability of a user to push to this branch.| Type | Description || ------- | --------------------------------------------------------------------------------------------------------------------------------------------- || `array` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | +// returns a []SimpleUserable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) Delete(ctx context.Context, body UsersDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists the people who have push access to this branch. +// returns a []SimpleUserable 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/branches/branch-protection#get-users-with-access-to-the-protected-branch +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// Post protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Grants the specified people push access for this branch.| Type | Description || ------- | ----------------------------------------------------------------------------------------------------------------------------- || `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | +// returns a []SimpleUserable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) Post(ctx context.Context, body UsersPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// Put protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people.| Type | Description || ------- | ----------------------------------------------------------------------------------------------------------------------------- || `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | +// returns a []SimpleUserable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) Put(ctx context.Context, body UsersPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Removes the ability of a user to push to this branch.| Type | Description || ------- | --------------------------------------------------------------------------------------------------------------------------------------------- || `array` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body UsersDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists the people who have push access to this branch. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Grants the specified people push access for this branch.| Type | Description || ------- | ----------------------------------------------------------------------------------------------------------------------------- || `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) ToPostRequestInformation(ctx context.Context, body UsersPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPutRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people.| Type | Description || ------- | ----------------------------------------------------------------------------------------------------------------------------- || `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) ToPutRequestInformation(ctx context.Context, body UsersPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) { + return NewItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_rename_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_rename_post_request_body.go new file mode 100644 index 000000000..07dfc1ca1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_rename_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemRenamePostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The new name of the branch. + new_name *string +} +// NewItemItemBranchesItemRenamePostRequestBody instantiates a new ItemItemBranchesItemRenamePostRequestBody and sets the default values. +func NewItemItemBranchesItemRenamePostRequestBody()(*ItemItemBranchesItemRenamePostRequestBody) { + m := &ItemItemBranchesItemRenamePostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemRenamePostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemRenamePostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemRenamePostRequestBody(), 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 *ItemItemBranchesItemRenamePostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemRenamePostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["new_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNewName(val) + } + return nil + } + return res +} +// GetNewName gets the new_name property value. The new name of the branch. +// returns a *string when successful +func (m *ItemItemBranchesItemRenamePostRequestBody) GetNewName()(*string) { + return m.new_name +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemRenamePostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("new_name", m.GetNewName()) + 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 *ItemItemBranchesItemRenamePostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNewName sets the new_name property value. The new name of the branch. +func (m *ItemItemBranchesItemRenamePostRequestBody) SetNewName(value *string)() { + m.new_name = value +} +type ItemItemBranchesItemRenamePostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNewName()(*string) + SetNewName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_rename_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_rename_request_builder.go new file mode 100644 index 000000000..08f3b0ea1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_item_rename_request_builder.go @@ -0,0 +1,69 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemBranchesItemRenameRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\rename +type ItemItemBranchesItemRenameRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemBranchesItemRenameRequestBuilderInternal instantiates a new ItemItemBranchesItemRenameRequestBuilder and sets the default values. +func NewItemItemBranchesItemRenameRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemRenameRequestBuilder) { + m := &ItemItemBranchesItemRenameRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/rename", pathParameters), + } + return m +} +// NewItemItemBranchesItemRenameRequestBuilder instantiates a new ItemItemBranchesItemRenameRequestBuilder and sets the default values. +func NewItemItemBranchesItemRenameRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemRenameRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemRenameRequestBuilderInternal(urlParams, requestAdapter) +} +// Post renames a branch in a repository.**Note:** Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)".The authenticated user must have push access to the branch. If the branch is the default branch, the authenticated user must also have admin or owner permissions.In order to rename the default branch, fine-grained access tokens also need the `administration:write` repository permission. +// returns a BranchWithProtectionable when successful +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/branches/branches#rename-a-branch +func (m *ItemItemBranchesItemRenameRequestBuilder) Post(ctx context.Context, body ItemItemBranchesItemRenamePostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BranchWithProtectionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBranchWithProtectionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BranchWithProtectionable), nil +} +// ToPostRequestInformation renames a branch in a repository.**Note:** Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)".The authenticated user must have push access to the branch. If the branch is the default branch, the authenticated user must also have admin or owner permissions.In order to rename the default branch, fine-grained access tokens also need the `administration:write` repository permission. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemRenameRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemBranchesItemRenamePostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemBranchesItemRenameRequestBuilder when successful +func (m *ItemItemBranchesItemRenameRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemRenameRequestBuilder) { + return NewItemItemBranchesItemRenameRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_request_builder.go new file mode 100644 index 000000000..e617d67c4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_request_builder.go @@ -0,0 +1,84 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemBranchesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches +type ItemItemBranchesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemBranchesRequestBuilderGetQueryParameters list branches +type ItemItemBranchesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Setting to `true` returns only branches protected by branch protections or rulesets. When set to `false`, only unprotected branches are returned. Omitting this parameter returns all branches. + Protected *bool `uriparametername:"protected"` +} +// ByBranch gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.branches.item collection +// returns a *ItemItemBranchesWithBranchItemRequestBuilder when successful +func (m *ItemItemBranchesRequestBuilder) ByBranch(branch string)(*ItemItemBranchesWithBranchItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if branch != "" { + urlTplParams["branch"] = branch + } + return NewItemItemBranchesWithBranchItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemBranchesRequestBuilderInternal instantiates a new ItemItemBranchesRequestBuilder and sets the default values. +func NewItemItemBranchesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesRequestBuilder) { + m := &ItemItemBranchesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches{?page*,per_page*,protected*}", pathParameters), + } + return m +} +// NewItemItemBranchesRequestBuilder instantiates a new ItemItemBranchesRequestBuilder and sets the default values. +func NewItemItemBranchesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list branches +// returns a []ShortBranchable 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/branches/branches#list-branches +func (m *ItemItemBranchesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemBranchesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ShortBranchable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateShortBranchFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ShortBranchable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ShortBranchable) + } + } + return val, nil +} +// returns a *RequestInformation when successful +func (m *ItemItemBranchesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemBranchesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemBranchesRequestBuilder when successful +func (m *ItemItemBranchesRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesRequestBuilder) { + return NewItemItemBranchesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_with_branch_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_with_branch_item_request_builder.go new file mode 100644 index 000000000..c57caaa93 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_branches_with_branch_item_request_builder.go @@ -0,0 +1,70 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemBranchesWithBranchItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch} +type ItemItemBranchesWithBranchItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemBranchesWithBranchItemRequestBuilderInternal instantiates a new ItemItemBranchesWithBranchItemRequestBuilder and sets the default values. +func NewItemItemBranchesWithBranchItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesWithBranchItemRequestBuilder) { + m := &ItemItemBranchesWithBranchItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}", pathParameters), + } + return m +} +// NewItemItemBranchesWithBranchItemRequestBuilder instantiates a new ItemItemBranchesWithBranchItemRequestBuilder and sets the default values. +func NewItemItemBranchesWithBranchItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesWithBranchItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesWithBranchItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get a branch +// returns a BranchWithProtectionable 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/branches/branches#get-a-branch +func (m *ItemItemBranchesWithBranchItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BranchWithProtectionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBranchWithProtectionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BranchWithProtectionable), nil +} +// Protection the protection property +// returns a *ItemItemBranchesItemProtectionRequestBuilder when successful +func (m *ItemItemBranchesWithBranchItemRequestBuilder) Protection()(*ItemItemBranchesItemProtectionRequestBuilder) { + return NewItemItemBranchesItemProtectionRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rename the rename property +// returns a *ItemItemBranchesItemRenameRequestBuilder when successful +func (m *ItemItemBranchesWithBranchItemRequestBuilder) Rename()(*ItemItemBranchesItemRenameRequestBuilder) { + return NewItemItemBranchesItemRenameRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// returns a *RequestInformation when successful +func (m *ItemItemBranchesWithBranchItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemBranchesWithBranchItemRequestBuilder when successful +func (m *ItemItemBranchesWithBranchItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesWithBranchItemRequestBuilder) { + return NewItemItemBranchesWithBranchItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_item_annotations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_item_annotations_request_builder.go new file mode 100644 index 000000000..bb34c3540 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_item_annotations_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCheckRunsItemAnnotationsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-runs\{check_run_id}\annotations +type ItemItemCheckRunsItemAnnotationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCheckRunsItemAnnotationsRequestBuilderGetQueryParameters lists annotations for a check run using the annotation `id`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +type ItemItemCheckRunsItemAnnotationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemCheckRunsItemAnnotationsRequestBuilderInternal instantiates a new ItemItemCheckRunsItemAnnotationsRequestBuilder and sets the default values. +func NewItemItemCheckRunsItemAnnotationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckRunsItemAnnotationsRequestBuilder) { + m := &ItemItemCheckRunsItemAnnotationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-runs/{check_run_id}/annotations{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCheckRunsItemAnnotationsRequestBuilder instantiates a new ItemItemCheckRunsItemAnnotationsRequestBuilder and sets the default values. +func NewItemItemCheckRunsItemAnnotationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckRunsItemAnnotationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckRunsItemAnnotationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists annotations for a check run using the annotation `id`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a []CheckAnnotationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/checks/runs#list-check-run-annotations +func (m *ItemItemCheckRunsItemAnnotationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCheckRunsItemAnnotationsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckAnnotationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCheckAnnotationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckAnnotationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckAnnotationable) + } + } + return val, nil +} +// ToGetRequestInformation lists annotations for a check run using the annotation `id`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemCheckRunsItemAnnotationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCheckRunsItemAnnotationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCheckRunsItemAnnotationsRequestBuilder when successful +func (m *ItemItemCheckRunsItemAnnotationsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckRunsItemAnnotationsRequestBuilder) { + return NewItemItemCheckRunsItemAnnotationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_item_rerequest_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_item_rerequest_request_builder.go new file mode 100644 index 000000000..9f10ed621 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_item_rerequest_request_builder.go @@ -0,0 +1,65 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCheckRunsItemRerequestRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-runs\{check_run_id}\rerequest +type ItemItemCheckRunsItemRerequestRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCheckRunsItemRerequestRequestBuilderInternal instantiates a new ItemItemCheckRunsItemRerequestRequestBuilder and sets the default values. +func NewItemItemCheckRunsItemRerequestRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckRunsItemRerequestRequestBuilder) { + m := &ItemItemCheckRunsItemRerequestRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-runs/{check_run_id}/rerequest", pathParameters), + } + return m +} +// NewItemItemCheckRunsItemRerequestRequestBuilder instantiates a new ItemItemCheckRunsItemRerequestRequestBuilder and sets the default values. +func NewItemItemCheckRunsItemRerequestRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckRunsItemRerequestRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckRunsItemRerequestRequestBuilderInternal(urlParams, requestAdapter) +} +// Post triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the [`check_run` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) event with the action `rerequested`. When a check run is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared.For more information about how to re-run GitHub Actions jobs, see "[Re-run a job from a workflow run](https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run)".OAuth apps and personal access tokens (classic) cannot use this endpoint. +// returns a EmptyObjectable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/checks/runs#rerequest-a-check-run +func (m *ItemItemCheckRunsItemRerequestRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToPostRequestInformation triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the [`check_run` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) event with the action `rerequested`. When a check run is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared.For more information about how to re-run GitHub Actions jobs, see "[Re-run a job from a workflow run](https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run)".OAuth apps and personal access tokens (classic) cannot use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCheckRunsItemRerequestRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCheckRunsItemRerequestRequestBuilder when successful +func (m *ItemItemCheckRunsItemRerequestRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckRunsItemRerequestRequestBuilder) { + return NewItemItemCheckRunsItemRerequestRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_item_with_check_run_patch_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_item_with_check_run_patch_request_body_member1.go new file mode 100644 index 000000000..ccd030e1b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_item_with_check_run_patch_request_body_member1.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 instantiates a new ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 and sets the default values. +func NewItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1()(*ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1) { + m := &ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1(), 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 *ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_item_with_check_run_patch_request_body_member2.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_item_with_check_run_patch_request_body_member2.go new file mode 100644 index 000000000..7eb9c5544 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_item_with_check_run_patch_request_body_member2.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 instantiates a new ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 and sets the default values. +func NewItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2()(*ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2) { + m := &ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2(), 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 *ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_post_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_post_request_body_member1.go new file mode 100644 index 000000000..ad3b692d0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_post_request_body_member1.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCheckRunsPostRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemCheckRunsPostRequestBodyMember1 instantiates a new ItemItemCheckRunsPostRequestBodyMember1 and sets the default values. +func NewItemItemCheckRunsPostRequestBodyMember1()(*ItemItemCheckRunsPostRequestBodyMember1) { + m := &ItemItemCheckRunsPostRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCheckRunsPostRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCheckRunsPostRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCheckRunsPostRequestBodyMember1(), 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 *ItemItemCheckRunsPostRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCheckRunsPostRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemCheckRunsPostRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemCheckRunsPostRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemCheckRunsPostRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_post_request_body_member2.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_post_request_body_member2.go new file mode 100644 index 000000000..d49165328 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_post_request_body_member2.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCheckRunsPostRequestBodyMember2 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemCheckRunsPostRequestBodyMember2 instantiates a new ItemItemCheckRunsPostRequestBodyMember2 and sets the default values. +func NewItemItemCheckRunsPostRequestBodyMember2()(*ItemItemCheckRunsPostRequestBodyMember2) { + m := &ItemItemCheckRunsPostRequestBodyMember2{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCheckRunsPostRequestBodyMember2FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCheckRunsPostRequestBodyMember2FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCheckRunsPostRequestBodyMember2(), 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 *ItemItemCheckRunsPostRequestBodyMember2) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCheckRunsPostRequestBodyMember2) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemCheckRunsPostRequestBodyMember2) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemCheckRunsPostRequestBodyMember2) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemCheckRunsPostRequestBodyMember2able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_request_builder.go new file mode 100644 index 000000000..b99300f93 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_request_builder.go @@ -0,0 +1,192 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCheckRunsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-runs +type ItemItemCheckRunsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// CheckRunsPostRequestBody composed type wrapper for classes ItemItemCheckRunsPostRequestBodyMember1able, ItemItemCheckRunsPostRequestBodyMember2able +type CheckRunsPostRequestBody struct { + // Composed type representation for type ItemItemCheckRunsPostRequestBodyMember1able + checkRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1 ItemItemCheckRunsPostRequestBodyMember1able + // Composed type representation for type ItemItemCheckRunsPostRequestBodyMember2able + checkRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2 ItemItemCheckRunsPostRequestBodyMember2able + // Composed type representation for type ItemItemCheckRunsPostRequestBodyMember1able + itemItemCheckRunsPostRequestBodyMember1 ItemItemCheckRunsPostRequestBodyMember1able + // Composed type representation for type ItemItemCheckRunsPostRequestBodyMember2able + itemItemCheckRunsPostRequestBodyMember2 ItemItemCheckRunsPostRequestBodyMember2able +} +// NewCheckRunsPostRequestBody instantiates a new CheckRunsPostRequestBody and sets the default values. +func NewCheckRunsPostRequestBody()(*CheckRunsPostRequestBody) { + m := &CheckRunsPostRequestBody{ + } + return m +} +// CreateCheckRunsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckRunsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewCheckRunsPostRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + return result, nil +} +// GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1 gets the ItemItemCheckRunsPostRequestBodyMember1 property value. Composed type representation for type ItemItemCheckRunsPostRequestBodyMember1able +// returns a ItemItemCheckRunsPostRequestBodyMember1able when successful +func (m *CheckRunsPostRequestBody) GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1()(ItemItemCheckRunsPostRequestBodyMember1able) { + return m.checkRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1 +} +// GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2 gets the ItemItemCheckRunsPostRequestBodyMember2 property value. Composed type representation for type ItemItemCheckRunsPostRequestBodyMember2able +// returns a ItemItemCheckRunsPostRequestBodyMember2able when successful +func (m *CheckRunsPostRequestBody) GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2()(ItemItemCheckRunsPostRequestBodyMember2able) { + return m.checkRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2 +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CheckRunsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *CheckRunsPostRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemCheckRunsPostRequestBodyMember1 gets the ItemItemCheckRunsPostRequestBodyMember1 property value. Composed type representation for type ItemItemCheckRunsPostRequestBodyMember1able +// returns a ItemItemCheckRunsPostRequestBodyMember1able when successful +func (m *CheckRunsPostRequestBody) GetItemItemCheckRunsPostRequestBodyMember1()(ItemItemCheckRunsPostRequestBodyMember1able) { + return m.itemItemCheckRunsPostRequestBodyMember1 +} +// GetItemItemCheckRunsPostRequestBodyMember2 gets the ItemItemCheckRunsPostRequestBodyMember2 property value. Composed type representation for type ItemItemCheckRunsPostRequestBodyMember2able +// returns a ItemItemCheckRunsPostRequestBodyMember2able when successful +func (m *CheckRunsPostRequestBody) GetItemItemCheckRunsPostRequestBodyMember2()(ItemItemCheckRunsPostRequestBodyMember2able) { + return m.itemItemCheckRunsPostRequestBodyMember2 +} +// Serialize serializes information the current object +func (m *CheckRunsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2()) + if err != nil { + return err + } + } else if m.GetItemItemCheckRunsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemCheckRunsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemCheckRunsPostRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetItemItemCheckRunsPostRequestBodyMember2()) + if err != nil { + return err + } + } + return nil +} +// SetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1 sets the ItemItemCheckRunsPostRequestBodyMember1 property value. Composed type representation for type ItemItemCheckRunsPostRequestBodyMember1able +func (m *CheckRunsPostRequestBody) SetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1(value ItemItemCheckRunsPostRequestBodyMember1able)() { + m.checkRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1 = value +} +// SetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2 sets the ItemItemCheckRunsPostRequestBodyMember2 property value. Composed type representation for type ItemItemCheckRunsPostRequestBodyMember2able +func (m *CheckRunsPostRequestBody) SetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2(value ItemItemCheckRunsPostRequestBodyMember2able)() { + m.checkRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2 = value +} +// SetItemItemCheckRunsPostRequestBodyMember1 sets the ItemItemCheckRunsPostRequestBodyMember1 property value. Composed type representation for type ItemItemCheckRunsPostRequestBodyMember1able +func (m *CheckRunsPostRequestBody) SetItemItemCheckRunsPostRequestBodyMember1(value ItemItemCheckRunsPostRequestBodyMember1able)() { + m.itemItemCheckRunsPostRequestBodyMember1 = value +} +// SetItemItemCheckRunsPostRequestBodyMember2 sets the ItemItemCheckRunsPostRequestBodyMember2 property value. Composed type representation for type ItemItemCheckRunsPostRequestBodyMember2able +func (m *CheckRunsPostRequestBody) SetItemItemCheckRunsPostRequestBodyMember2(value ItemItemCheckRunsPostRequestBodyMember2able)() { + m.itemItemCheckRunsPostRequestBodyMember2 = value +} +type CheckRunsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1()(ItemItemCheckRunsPostRequestBodyMember1able) + GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2()(ItemItemCheckRunsPostRequestBodyMember2able) + GetItemItemCheckRunsPostRequestBodyMember1()(ItemItemCheckRunsPostRequestBodyMember1able) + GetItemItemCheckRunsPostRequestBodyMember2()(ItemItemCheckRunsPostRequestBodyMember2able) + SetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1(value ItemItemCheckRunsPostRequestBodyMember1able)() + SetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2(value ItemItemCheckRunsPostRequestBodyMember2able)() + SetItemItemCheckRunsPostRequestBodyMember1(value ItemItemCheckRunsPostRequestBodyMember1able)() + SetItemItemCheckRunsPostRequestBodyMember2(value ItemItemCheckRunsPostRequestBodyMember2able)() +} +// ByCheck_run_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.checkRuns.item collection +// returns a *ItemItemCheckRunsWithCheck_run_ItemRequestBuilder when successful +func (m *ItemItemCheckRunsRequestBuilder) ByCheck_run_id(check_run_id int32)(*ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["check_run_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(check_run_id), 10) + return NewItemItemCheckRunsWithCheck_run_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCheckRunsRequestBuilderInternal instantiates a new ItemItemCheckRunsRequestBuilder and sets the default values. +func NewItemItemCheckRunsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckRunsRequestBuilder) { + m := &ItemItemCheckRunsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-runs", pathParameters), + } + return m +} +// NewItemItemCheckRunsRequestBuilder instantiates a new ItemItemCheckRunsRequestBuilder and sets the default values. +func NewItemItemCheckRunsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckRunsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckRunsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates a new check run for a specific commit in a repository.To create a check run, you must use a GitHub App. OAuth apps and authenticated users are not able to create a check suite.In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs.**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. +// returns a CheckRunable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/checks/runs#create-a-check-run +func (m *ItemItemCheckRunsRequestBuilder) Post(ctx context.Context, body CheckRunsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCheckRunFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable), nil +} +// ToPostRequestInformation creates a new check run for a specific commit in a repository.To create a check run, you must use a GitHub App. OAuth apps and authenticated users are not able to create a check suite.In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs.**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. +// returns a *RequestInformation when successful +func (m *ItemItemCheckRunsRequestBuilder) ToPostRequestInformation(ctx context.Context, body CheckRunsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCheckRunsRequestBuilder when successful +func (m *ItemItemCheckRunsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckRunsRequestBuilder) { + return NewItemItemCheckRunsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_with_check_run_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_with_check_run_item_request_builder.go new file mode 100644 index 000000000..e27ee358a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_runs_with_check_run_item_request_builder.go @@ -0,0 +1,235 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCheckRunsWithCheck_run_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-runs\{check_run_id} +type ItemItemCheckRunsWithCheck_run_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// WithCheck_run_PatchRequestBody composed type wrapper for classes ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able, ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able +type WithCheck_run_PatchRequestBody struct { + // Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able + itemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able + // Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able + itemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able + // Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able + withCheck_run_PatchRequestBodyItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able + // Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able + withCheck_run_PatchRequestBodyItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able +} +// NewWithCheck_run_PatchRequestBody instantiates a new WithCheck_run_PatchRequestBody and sets the default values. +func NewWithCheck_run_PatchRequestBody()(*WithCheck_run_PatchRequestBody) { + m := &WithCheck_run_PatchRequestBody{ + } + return m +} +// CreateWithCheck_run_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWithCheck_run_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewWithCheck_run_PatchRequestBody() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able); ok { + result.SetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able); ok { + result.SetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able); ok { + result.SetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able); ok { + result.SetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2(cast) + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WithCheck_run_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *WithCheck_run_PatchRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1 gets the ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 property value. Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able +// returns a ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able when successful +func (m *WithCheck_run_PatchRequestBody) GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1()(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able) { + return m.itemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 +} +// GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2 gets the ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 property value. Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able +// returns a ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able when successful +func (m *WithCheck_run_PatchRequestBody) GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2()(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able) { + return m.itemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 +} +// GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1 gets the ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 property value. Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able +// returns a ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able when successful +func (m *WithCheck_run_PatchRequestBody) GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1()(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able) { + return m.withCheck_run_PatchRequestBodyItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 +} +// GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2 gets the ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 property value. Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able +// returns a ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able when successful +func (m *WithCheck_run_PatchRequestBody) GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2()(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able) { + return m.withCheck_run_PatchRequestBodyItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 +} +// Serialize serializes information the current object +func (m *WithCheck_run_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2()) + if err != nil { + return err + } + } else if m.GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2()) + if err != nil { + return err + } + } + return nil +} +// SetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1 sets the ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 property value. Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able +func (m *WithCheck_run_PatchRequestBody) SetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1(value ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able)() { + m.itemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 = value +} +// SetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2 sets the ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 property value. Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able +func (m *WithCheck_run_PatchRequestBody) SetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2(value ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able)() { + m.itemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 = value +} +// SetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1 sets the ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 property value. Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able +func (m *WithCheck_run_PatchRequestBody) SetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1(value ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able)() { + m.withCheck_run_PatchRequestBodyItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 = value +} +// SetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2 sets the ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 property value. Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able +func (m *WithCheck_run_PatchRequestBody) SetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2(value ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able)() { + m.withCheck_run_PatchRequestBodyItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 = value +} +type WithCheck_run_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1()(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able) + GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2()(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able) + GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1()(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able) + GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2()(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able) + SetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1(value ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able)() + SetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2(value ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able)() + SetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1(value ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able)() + SetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2(value ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able)() +} +// Annotations the annotations property +// returns a *ItemItemCheckRunsItemAnnotationsRequestBuilder when successful +func (m *ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) Annotations()(*ItemItemCheckRunsItemAnnotationsRequestBuilder) { + return NewItemItemCheckRunsItemAnnotationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCheckRunsWithCheck_run_ItemRequestBuilderInternal instantiates a new ItemItemCheckRunsWithCheck_run_ItemRequestBuilder and sets the default values. +func NewItemItemCheckRunsWithCheck_run_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) { + m := &ItemItemCheckRunsWithCheck_run_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-runs/{check_run_id}", pathParameters), + } + return m +} +// NewItemItemCheckRunsWithCheck_run_ItemRequestBuilder instantiates a new ItemItemCheckRunsWithCheck_run_ItemRequestBuilder and sets the default values. +func NewItemItemCheckRunsWithCheck_run_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckRunsWithCheck_run_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a single check run using its `id`.**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a CheckRunable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/checks/runs#get-a-check-run +func (m *ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCheckRunFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable), nil +} +// Patch updates a check run for a specific commit in a repository.**Note:** The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.OAuth apps and personal access tokens (classic) cannot use this endpoint. +// returns a CheckRunable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/checks/runs#update-a-check-run +func (m *ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) Patch(ctx context.Context, body WithCheck_run_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCheckRunFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable), nil +} +// Rerequest the rerequest property +// returns a *ItemItemCheckRunsItemRerequestRequestBuilder when successful +func (m *ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) Rerequest()(*ItemItemCheckRunsItemRerequestRequestBuilder) { + return NewItemItemCheckRunsItemRerequestRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation gets a single check run using its `id`.**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates a check run for a specific commit in a repository.**Note:** The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.OAuth apps and personal access tokens (classic) cannot use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body WithCheck_run_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCheckRunsWithCheck_run_ItemRequestBuilder when successful +func (m *ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) { + return NewItemItemCheckRunsWithCheck_run_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_item_check_runs_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_item_check_runs_get_response.go new file mode 100644 index 000000000..95d46fc36 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_item_check_runs_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemCheckSuitesItemCheckRunsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The check_runs property + check_runs []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable + // The total_count property + total_count *int32 +} +// NewItemItemCheckSuitesItemCheckRunsGetResponse instantiates a new ItemItemCheckSuitesItemCheckRunsGetResponse and sets the default values. +func NewItemItemCheckSuitesItemCheckRunsGetResponse()(*ItemItemCheckSuitesItemCheckRunsGetResponse) { + m := &ItemItemCheckSuitesItemCheckRunsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCheckSuitesItemCheckRunsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCheckSuitesItemCheckRunsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCheckSuitesItemCheckRunsGetResponse(), 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 *ItemItemCheckSuitesItemCheckRunsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCheckRuns gets the check_runs property value. The check_runs property +// returns a []CheckRunable when successful +func (m *ItemItemCheckSuitesItemCheckRunsGetResponse) GetCheckRuns()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable) { + return m.check_runs +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCheckSuitesItemCheckRunsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["check_runs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCheckRunFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable) + } + } + m.SetCheckRuns(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemCheckSuitesItemCheckRunsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemCheckSuitesItemCheckRunsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCheckRuns() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCheckRuns())) + for i, v := range m.GetCheckRuns() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("check_runs", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemCheckSuitesItemCheckRunsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCheckRuns sets the check_runs property value. The check_runs property +func (m *ItemItemCheckSuitesItemCheckRunsGetResponse) SetCheckRuns(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable)() { + m.check_runs = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemCheckSuitesItemCheckRunsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemCheckSuitesItemCheckRunsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCheckRuns()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable) + GetTotalCount()(*int32) + SetCheckRuns(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_item_check_runs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_item_check_runs_request_builder.go new file mode 100644 index 000000000..d09f2f50d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_item_check_runs_request_builder.go @@ -0,0 +1,70 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i81721daf4afe64f77b2b79b27ec44ce9325b9e20e6f9737c000fdcbda4772f33 "github.com/octokit/go-sdk/pkg/github/repos/item/item/checksuites/item/checkruns" +) + +// ItemItemCheckSuitesItemCheckRunsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-suites\{check_suite_id}\check-runs +type ItemItemCheckSuitesItemCheckRunsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCheckSuitesItemCheckRunsRequestBuilderGetQueryParameters lists check runs for a check suite using its `id`.**Note:** The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +type ItemItemCheckSuitesItemCheckRunsRequestBuilderGetQueryParameters struct { + // Returns check runs with the specified `name`. + Check_name *string `uriparametername:"check_name"` + // Filters check runs by their `completed_at` timestamp. `latest` returns the most recent check runs. + Filter *i81721daf4afe64f77b2b79b27ec44ce9325b9e20e6f9737c000fdcbda4772f33.GetFilterQueryParameterType `uriparametername:"filter"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Returns check runs with the specified `status`. + Status *i81721daf4afe64f77b2b79b27ec44ce9325b9e20e6f9737c000fdcbda4772f33.GetStatusQueryParameterType `uriparametername:"status"` +} +// NewItemItemCheckSuitesItemCheckRunsRequestBuilderInternal instantiates a new ItemItemCheckSuitesItemCheckRunsRequestBuilder and sets the default values. +func NewItemItemCheckSuitesItemCheckRunsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesItemCheckRunsRequestBuilder) { + m := &ItemItemCheckSuitesItemCheckRunsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-suites/{check_suite_id}/check-runs{?check_name*,filter*,page*,per_page*,status*}", pathParameters), + } + return m +} +// NewItemItemCheckSuitesItemCheckRunsRequestBuilder instantiates a new ItemItemCheckSuitesItemCheckRunsRequestBuilder and sets the default values. +func NewItemItemCheckSuitesItemCheckRunsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesItemCheckRunsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckSuitesItemCheckRunsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists check runs for a check suite using its `id`.**Note:** The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a ItemItemCheckSuitesItemCheckRunsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite +func (m *ItemItemCheckSuitesItemCheckRunsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCheckSuitesItemCheckRunsRequestBuilderGetQueryParameters])(ItemItemCheckSuitesItemCheckRunsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemCheckSuitesItemCheckRunsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemCheckSuitesItemCheckRunsGetResponseable), nil +} +// ToGetRequestInformation lists check runs for a check suite using its `id`.**Note:** The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemCheckSuitesItemCheckRunsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCheckSuitesItemCheckRunsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCheckSuitesItemCheckRunsRequestBuilder when successful +func (m *ItemItemCheckSuitesItemCheckRunsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckSuitesItemCheckRunsRequestBuilder) { + return NewItemItemCheckSuitesItemCheckRunsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_item_check_runs_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_item_check_runs_response.go new file mode 100644 index 000000000..923c1f6f3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_item_check_runs_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemCheckSuitesItemCheckRunsResponse +// Deprecated: This class is obsolete. Use checkRunsGetResponse instead. +type ItemItemCheckSuitesItemCheckRunsResponse struct { + ItemItemCheckSuitesItemCheckRunsGetResponse +} +// NewItemItemCheckSuitesItemCheckRunsResponse instantiates a new ItemItemCheckSuitesItemCheckRunsResponse and sets the default values. +func NewItemItemCheckSuitesItemCheckRunsResponse()(*ItemItemCheckSuitesItemCheckRunsResponse) { + m := &ItemItemCheckSuitesItemCheckRunsResponse{ + ItemItemCheckSuitesItemCheckRunsGetResponse: *NewItemItemCheckSuitesItemCheckRunsGetResponse(), + } + return m +} +// CreateItemItemCheckSuitesItemCheckRunsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemCheckSuitesItemCheckRunsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCheckSuitesItemCheckRunsResponse(), nil +} +// ItemItemCheckSuitesItemCheckRunsResponseable +// Deprecated: This class is obsolete. Use checkRunsGetResponse instead. +type ItemItemCheckSuitesItemCheckRunsResponseable interface { + ItemItemCheckSuitesItemCheckRunsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_item_rerequest_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_item_rerequest_request_builder.go new file mode 100644 index 000000000..3b46beabd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_item_rerequest_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCheckSuitesItemRerequestRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-suites\{check_suite_id}\rerequest +type ItemItemCheckSuitesItemRerequestRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCheckSuitesItemRerequestRequestBuilderInternal instantiates a new ItemItemCheckSuitesItemRerequestRequestBuilder and sets the default values. +func NewItemItemCheckSuitesItemRerequestRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesItemRerequestRequestBuilder) { + m := &ItemItemCheckSuitesItemRerequestRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-suites/{check_suite_id}/rerequest", pathParameters), + } + return m +} +// NewItemItemCheckSuitesItemRerequestRequestBuilder instantiates a new ItemItemCheckSuitesItemRerequestRequestBuilder and sets the default values. +func NewItemItemCheckSuitesItemRerequestRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesItemRerequestRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckSuitesItemRerequestRequestBuilderInternal(urlParams, requestAdapter) +} +// Post triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared.OAuth apps and personal access tokens (classic) cannot use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite +func (m *ItemItemCheckSuitesItemRerequestRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToPostRequestInformation triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared.OAuth apps and personal access tokens (classic) cannot use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCheckSuitesItemRerequestRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCheckSuitesItemRerequestRequestBuilder when successful +func (m *ItemItemCheckSuitesItemRerequestRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckSuitesItemRerequestRequestBuilder) { + return NewItemItemCheckSuitesItemRerequestRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_post_request_body.go new file mode 100644 index 000000000..8af87abf6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCheckSuitesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The sha of the head commit. + head_sha *string +} +// NewItemItemCheckSuitesPostRequestBody instantiates a new ItemItemCheckSuitesPostRequestBody and sets the default values. +func NewItemItemCheckSuitesPostRequestBody()(*ItemItemCheckSuitesPostRequestBody) { + m := &ItemItemCheckSuitesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCheckSuitesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCheckSuitesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCheckSuitesPostRequestBody(), 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 *ItemItemCheckSuitesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCheckSuitesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["head_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadSha(val) + } + return nil + } + return res +} +// GetHeadSha gets the head_sha property value. The sha of the head commit. +// returns a *string when successful +func (m *ItemItemCheckSuitesPostRequestBody) GetHeadSha()(*string) { + return m.head_sha +} +// Serialize serializes information the current object +func (m *ItemItemCheckSuitesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("head_sha", m.GetHeadSha()) + 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 *ItemItemCheckSuitesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHeadSha sets the head_sha property value. The sha of the head commit. +func (m *ItemItemCheckSuitesPostRequestBody) SetHeadSha(value *string)() { + m.head_sha = value +} +type ItemItemCheckSuitesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHeadSha()(*string) + SetHeadSha(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_preferences_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_preferences_patch_request_body.go new file mode 100644 index 000000000..54ecfbe4a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_preferences_patch_request_body.go @@ -0,0 +1,92 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCheckSuitesPreferencesPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default. + auto_trigger_checks []ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable +} +// NewItemItemCheckSuitesPreferencesPatchRequestBody instantiates a new ItemItemCheckSuitesPreferencesPatchRequestBody and sets the default values. +func NewItemItemCheckSuitesPreferencesPatchRequestBody()(*ItemItemCheckSuitesPreferencesPatchRequestBody) { + m := &ItemItemCheckSuitesPreferencesPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCheckSuitesPreferencesPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCheckSuitesPreferencesPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCheckSuitesPreferencesPatchRequestBody(), 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 *ItemItemCheckSuitesPreferencesPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAutoTriggerChecks gets the auto_trigger_checks property value. Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default. +// returns a []ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable when successful +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody) GetAutoTriggerChecks()([]ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable) { + return m.auto_trigger_checks +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["auto_trigger_checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable) + } + } + m.SetAutoTriggerChecks(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAutoTriggerChecks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAutoTriggerChecks())) + for i, v := range m.GetAutoTriggerChecks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("auto_trigger_checks", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAutoTriggerChecks sets the auto_trigger_checks property value. Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default. +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody) SetAutoTriggerChecks(value []ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable)() { + m.auto_trigger_checks = value +} +type ItemItemCheckSuitesPreferencesPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAutoTriggerChecks()([]ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable) + SetAutoTriggerChecks(value []ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_preferences_patch_request_body_auto_trigger_checks.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_preferences_patch_request_body_auto_trigger_checks.go new file mode 100644 index 000000000..5586afad0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_preferences_patch_request_body_auto_trigger_checks.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The `id` of the GitHub App. + app_id *int32 + // Set to `true` to enable automatic creation of CheckSuite events upon pushes to the repository, or `false` to disable them. + setting *bool +} +// NewItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks instantiates a new ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks and sets the default values. +func NewItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks()(*ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) { + m := &ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks(), 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 *ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAppId gets the app_id property value. The `id` of the GitHub App. +// returns a *int32 when successful +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) GetAppId()(*int32) { + return m.app_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSetting(val) + } + return nil + } + return res +} +// GetSetting gets the setting property value. Set to `true` to enable automatic creation of CheckSuite events upon pushes to the repository, or `false` to disable them. +// returns a *bool when successful +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) GetSetting()(*bool) { + return m.setting +} +// Serialize serializes information the current object +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("app_id", m.GetAppId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("setting", m.GetSetting()) + 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 *ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAppId sets the app_id property value. The `id` of the GitHub App. +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) SetAppId(value *int32)() { + m.app_id = value +} +// SetSetting sets the setting property value. Set to `true` to enable automatic creation of CheckSuite events upon pushes to the repository, or `false` to disable them. +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) SetSetting(value *bool)() { + m.setting = value +} +type ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppId()(*int32) + GetSetting()(*bool) + SetAppId(value *int32)() + SetSetting(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_preferences_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_preferences_request_builder.go new file mode 100644 index 000000000..8e7cbd3a0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_preferences_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCheckSuitesPreferencesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-suites\preferences +type ItemItemCheckSuitesPreferencesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCheckSuitesPreferencesRequestBuilderInternal instantiates a new ItemItemCheckSuitesPreferencesRequestBuilder and sets the default values. +func NewItemItemCheckSuitesPreferencesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesPreferencesRequestBuilder) { + m := &ItemItemCheckSuitesPreferencesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-suites/preferences", pathParameters), + } + return m +} +// NewItemItemCheckSuitesPreferencesRequestBuilder instantiates a new ItemItemCheckSuitesPreferencesRequestBuilder and sets the default values. +func NewItemItemCheckSuitesPreferencesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesPreferencesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckSuitesPreferencesRequestBuilderInternal(urlParams, requestAdapter) +} +// Patch changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/rest/checks/suites#create-a-check-suite).You must have admin permissions in the repository to set preferences for check suites. +// returns a CheckSuitePreferenceable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites +func (m *ItemItemCheckSuitesPreferencesRequestBuilder) Patch(ctx context.Context, body ItemItemCheckSuitesPreferencesPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckSuitePreferenceable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCheckSuitePreferenceFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckSuitePreferenceable), nil +} +// ToPatchRequestInformation changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/rest/checks/suites#create-a-check-suite).You must have admin permissions in the repository to set preferences for check suites. +// returns a *RequestInformation when successful +func (m *ItemItemCheckSuitesPreferencesRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemCheckSuitesPreferencesPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCheckSuitesPreferencesRequestBuilder when successful +func (m *ItemItemCheckSuitesPreferencesRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckSuitesPreferencesRequestBuilder) { + return NewItemItemCheckSuitesPreferencesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_request_builder.go new file mode 100644 index 000000000..9f9b2544e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_request_builder.go @@ -0,0 +1,77 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCheckSuitesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-suites +type ItemItemCheckSuitesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByCheck_suite_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.checkSuites.item collection +// returns a *ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder when successful +func (m *ItemItemCheckSuitesRequestBuilder) ByCheck_suite_id(check_suite_id int32)(*ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["check_suite_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(check_suite_id), 10) + return NewItemItemCheckSuitesWithCheck_suite_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCheckSuitesRequestBuilderInternal instantiates a new ItemItemCheckSuitesRequestBuilder and sets the default values. +func NewItemItemCheckSuitesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesRequestBuilder) { + m := &ItemItemCheckSuitesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-suites", pathParameters), + } + return m +} +// NewItemItemCheckSuitesRequestBuilder instantiates a new ItemItemCheckSuitesRequestBuilder and sets the default values. +func NewItemItemCheckSuitesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckSuitesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates a check suite manually. By default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/checks/runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites)".**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.OAuth apps and personal access tokens (classic) cannot use this endpoint. +// returns a CheckSuiteable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/checks/suites#create-a-check-suite +func (m *ItemItemCheckSuitesRequestBuilder) Post(ctx context.Context, body ItemItemCheckSuitesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckSuiteable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCheckSuiteFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckSuiteable), nil +} +// Preferences the preferences property +// returns a *ItemItemCheckSuitesPreferencesRequestBuilder when successful +func (m *ItemItemCheckSuitesRequestBuilder) Preferences()(*ItemItemCheckSuitesPreferencesRequestBuilder) { + return NewItemItemCheckSuitesPreferencesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToPostRequestInformation creates a check suite manually. By default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/checks/runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites)".**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.OAuth apps and personal access tokens (classic) cannot use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCheckSuitesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemCheckSuitesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCheckSuitesRequestBuilder when successful +func (m *ItemItemCheckSuitesRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckSuitesRequestBuilder) { + return NewItemItemCheckSuitesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_with_check_suite_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_with_check_suite_item_request_builder.go new file mode 100644 index 000000000..3c36e8605 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_check_suites_with_check_suite_item_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-suites\{check_suite_id} +type ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// CheckRuns the checkRuns property +// returns a *ItemItemCheckSuitesItemCheckRunsRequestBuilder when successful +func (m *ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder) CheckRuns()(*ItemItemCheckSuitesItemCheckRunsRequestBuilder) { + return NewItemItemCheckSuitesItemCheckRunsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCheckSuitesWithCheck_suite_ItemRequestBuilderInternal instantiates a new ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder and sets the default values. +func NewItemItemCheckSuitesWithCheck_suite_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder) { + m := &ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-suites/{check_suite_id}", pathParameters), + } + return m +} +// NewItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder instantiates a new ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder and sets the default values. +func NewItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckSuitesWithCheck_suite_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a single check suite using its `id`.**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a CheckSuiteable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/checks/suites#get-a-check-suite +func (m *ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckSuiteable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCheckSuiteFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckSuiteable), nil +} +// Rerequest the rerequest property +// returns a *ItemItemCheckSuitesItemRerequestRequestBuilder when successful +func (m *ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder) Rerequest()(*ItemItemCheckSuitesItemRerequestRequestBuilder) { + return NewItemItemCheckSuitesItemRerequestRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation gets a single check suite using its `id`.**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder when successful +func (m *ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder) { + return NewItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_alerts_item_instances_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_alerts_item_instances_request_builder.go new file mode 100644 index 000000000..bc668a473 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_alerts_item_instances_request_builder.go @@ -0,0 +1,77 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodeScanningAlertsItemInstancesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\alerts\{alert_number}\instances +type ItemItemCodeScanningAlertsItemInstancesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCodeScanningAlertsItemInstancesRequestBuilderGetQueryParameters lists all instances of the specified code scanning alert.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +type ItemItemCodeScanningAlertsItemInstancesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The Git reference for the results you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. + Ref *string `uriparametername:"ref"` +} +// NewItemItemCodeScanningAlertsItemInstancesRequestBuilderInternal instantiates a new ItemItemCodeScanningAlertsItemInstancesRequestBuilder and sets the default values. +func NewItemItemCodeScanningAlertsItemInstancesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAlertsItemInstancesRequestBuilder) { + m := &ItemItemCodeScanningAlertsItemInstancesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/alerts/{alert_number}/instances{?page*,per_page*,ref*}", pathParameters), + } + return m +} +// NewItemItemCodeScanningAlertsItemInstancesRequestBuilder instantiates a new ItemItemCodeScanningAlertsItemInstancesRequestBuilder and sets the default values. +func NewItemItemCodeScanningAlertsItemInstancesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAlertsItemInstancesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningAlertsItemInstancesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all instances of the specified code scanning alert.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a []CodeScanningAlertInstanceable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a Instances503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert +func (m *ItemItemCodeScanningAlertsItemInstancesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeScanningAlertsItemInstancesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertInstanceable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateInstances503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningAlertInstanceFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertInstanceable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertInstanceable) + } + } + return val, nil +} +// ToGetRequestInformation lists all instances of the specified code scanning alert.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningAlertsItemInstancesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeScanningAlertsItemInstancesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodeScanningAlertsItemInstancesRequestBuilder when successful +func (m *ItemItemCodeScanningAlertsItemInstancesRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningAlertsItemInstancesRequestBuilder) { + return NewItemItemCodeScanningAlertsItemInstancesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_alerts_item_with_alert_number_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_alerts_item_with_alert_number_patch_request_body.go new file mode 100644 index 000000000..2d40862fb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_alerts_item_with_alert_number_patch_request_body.go @@ -0,0 +1,141 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The dismissal comment associated with the dismissal of the alert. + dismissed_comment *string + // **Required when the state is dismissed.** The reason for dismissing or closing the alert. + dismissed_reason *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertDismissedReason + // Sets the state of the code scanning alert. You must provide `dismissed_reason` when you set the state to `dismissed`. + state *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertSetState +} +// NewItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody instantiates a new ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody and sets the default values. +func NewItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody()(*ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) { + m := &ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody(), 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 *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDismissedComment gets the dismissed_comment property value. The dismissal comment associated with the dismissal of the alert. +// returns a *string when successful +func (m *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) GetDismissedComment()(*string) { + return m.dismissed_comment +} +// GetDismissedReason gets the dismissed_reason property value. **Required when the state is dismissed.** The reason for dismissing or closing the alert. +// returns a *CodeScanningAlertDismissedReason when successful +func (m *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) GetDismissedReason()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertDismissedReason) { + return m.dismissed_reason +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["dismissed_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedComment(val) + } + return nil + } + res["dismissed_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ParseCodeScanningAlertDismissedReason) + if err != nil { + return err + } + if val != nil { + m.SetDismissedReason(val.(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertDismissedReason)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ParseCodeScanningAlertSetState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertSetState)) + } + return nil + } + return res +} +// GetState gets the state property value. Sets the state of the code scanning alert. You must provide `dismissed_reason` when you set the state to `dismissed`. +// returns a *CodeScanningAlertSetState when successful +func (m *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) GetState()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertSetState) { + return m.state +} +// Serialize serializes information the current object +func (m *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("dismissed_comment", m.GetDismissedComment()) + if err != nil { + return err + } + } + if m.GetDismissedReason() != nil { + cast := (*m.GetDismissedReason()).String() + err := writer.WriteStringValue("dismissed_reason", &cast) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDismissedComment sets the dismissed_comment property value. The dismissal comment associated with the dismissal of the alert. +func (m *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) SetDismissedComment(value *string)() { + m.dismissed_comment = value +} +// SetDismissedReason sets the dismissed_reason property value. **Required when the state is dismissed.** The reason for dismissing or closing the alert. +func (m *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) SetDismissedReason(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertDismissedReason)() { + m.dismissed_reason = value +} +// SetState sets the state property value. Sets the state of the code scanning alert. You must provide `dismissed_reason` when you set the state to `dismissed`. +func (m *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) SetState(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertSetState)() { + m.state = value +} +type ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDismissedComment()(*string) + GetDismissedReason()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertDismissedReason) + GetState()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertSetState) + SetDismissedComment(value *string)() + SetDismissedReason(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertDismissedReason)() + SetState(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertSetState)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_alerts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_alerts_request_builder.go new file mode 100644 index 000000000..1bcb50bb4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_alerts_request_builder.go @@ -0,0 +1,101 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + id6219ca61a285d774ef018a9a4ff7bdb0938800fad8b8d12f8b2e59ee8d18fcd "github.com/octokit/go-sdk/pkg/github/repos/item/item/codescanning/alerts" +) + +// ItemItemCodeScanningAlertsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\alerts +type ItemItemCodeScanningAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCodeScanningAlertsRequestBuilderGetQueryParameters lists code scanning alerts.The response includes a `most_recent_instance` object.This provides details of the most recent instance of this alertfor the default branch (or for the specified Git reference if you used `ref` in the request).OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +type ItemItemCodeScanningAlertsRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *id6219ca61a285d774ef018a9a4ff7bdb0938800fad8b8d12f8b2e59ee8d18fcd.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The Git reference for the results you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. + Ref *string `uriparametername:"ref"` + // If specified, only code scanning alerts with this severity will be returned. + Severity *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertSeverity `uriparametername:"severity"` + // The property by which to sort the results. + Sort *id6219ca61a285d774ef018a9a4ff7bdb0938800fad8b8d12f8b2e59ee8d18fcd.GetSortQueryParameterType `uriparametername:"sort"` + // If specified, only code scanning alerts with this state will be returned. + State *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertStateQuery `uriparametername:"state"` + // The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both. + Tool_guid *string `uriparametername:"tool_guid"` + // The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both. + Tool_name *string `uriparametername:"tool_name"` +} +// ByAlert_number gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.codeScanning.alerts.item collection +// returns a *ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder when successful +func (m *ItemItemCodeScanningAlertsRequestBuilder) ByAlert_number(alert_number int32)(*ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["alert_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(alert_number), 10) + return NewItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCodeScanningAlertsRequestBuilderInternal instantiates a new ItemItemCodeScanningAlertsRequestBuilder and sets the default values. +func NewItemItemCodeScanningAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAlertsRequestBuilder) { + m := &ItemItemCodeScanningAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/alerts{?direction*,page*,per_page*,ref*,severity*,sort*,state*,tool_guid*,tool_name*}", pathParameters), + } + return m +} +// NewItemItemCodeScanningAlertsRequestBuilder instantiates a new ItemItemCodeScanningAlertsRequestBuilder and sets the default values. +func NewItemItemCodeScanningAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists code scanning alerts.The response includes a `most_recent_instance` object.This provides details of the most recent instance of this alertfor the default branch (or for the specified Git reference if you used `ref` in the request).OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a []CodeScanningAlertItemsable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a Alerts503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository +func (m *ItemItemCodeScanningAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeScanningAlertsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertItemsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAlerts503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningAlertItemsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertItemsable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertItemsable) + } + } + return val, nil +} +// ToGetRequestInformation lists code scanning alerts.The response includes a `most_recent_instance` object.This provides details of the most recent instance of this alertfor the default branch (or for the specified Git reference if you used `ref` in the request).OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeScanningAlertsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodeScanningAlertsRequestBuilder when successful +func (m *ItemItemCodeScanningAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningAlertsRequestBuilder) { + return NewItemItemCodeScanningAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_alerts_with_alert_number_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_alerts_with_alert_number_item_request_builder.go new file mode 100644 index 000000000..628feae39 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_alerts_with_alert_number_item_request_builder.go @@ -0,0 +1,109 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\alerts\{alert_number} +type ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilderInternal instantiates a new ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) { + m := &ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/alerts/{alert_number}", pathParameters), + } + return m +} +// NewItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder instantiates a new ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a single code scanning alert.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a CodeScanningAlertable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a CodeScanningAlert503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert +func (m *ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningAlert503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertable), nil +} +// Instances the instances property +// returns a *ItemItemCodeScanningAlertsItemInstancesRequestBuilder when successful +func (m *ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) Instances()(*ItemItemCodeScanningAlertsItemInstancesRequestBuilder) { + return NewItemItemCodeScanningAlertsItemInstancesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch updates the status of a single code scanning alert.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a CodeScanningAlertable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a CodeScanningAlert503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert +func (m *ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) Patch(ctx context.Context, body ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningAlert503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAlertable), nil +} +// ToGetRequestInformation gets a single code scanning alert.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates the status of a single code scanning alert.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder when successful +func (m *ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) { + return NewItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_analyses_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_analyses_request_builder.go new file mode 100644 index 000000000..fbb18621c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_analyses_request_builder.go @@ -0,0 +1,99 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + ic8ccce7f7df3354ee09c704fd2c3c7a95354f442dcd3fefc8778b101a690d643 "github.com/octokit/go-sdk/pkg/github/repos/item/item/codescanning/analyses" +) + +// ItemItemCodeScanningAnalysesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\analyses +type ItemItemCodeScanningAnalysesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCodeScanningAnalysesRequestBuilderGetQueryParameters lists the details of all code scanning analyses for a repository,starting with the most recent.The response is paginated and you can use the `page` and `per_page` parametersto list the analyses you're interested in.By default 30 analyses are listed per page.The `rules_count` field in the response give the number of rulesthat were run in the analysis.For very old analyses this data is not available,and `0` is returned in this field.**Deprecation notice**:The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +type ItemItemCodeScanningAnalysesRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *ic8ccce7f7df3354ee09c704fd2c3c7a95354f442dcd3fefc8778b101a690d643.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The Git reference for the analyses you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. + Ref *string `uriparametername:"ref"` + // Filter analyses belonging to the same SARIF upload. + Sarif_id *string `uriparametername:"sarif_id"` + // The property by which to sort the results. + Sort *ic8ccce7f7df3354ee09c704fd2c3c7a95354f442dcd3fefc8778b101a690d643.GetSortQueryParameterType `uriparametername:"sort"` + // The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both. + Tool_guid *string `uriparametername:"tool_guid"` + // The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both. + Tool_name *string `uriparametername:"tool_name"` +} +// ByAnalysis_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.codeScanning.analyses.item collection +// returns a *ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder when successful +func (m *ItemItemCodeScanningAnalysesRequestBuilder) ByAnalysis_id(analysis_id int32)(*ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["analysis_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(analysis_id), 10) + return NewItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCodeScanningAnalysesRequestBuilderInternal instantiates a new ItemItemCodeScanningAnalysesRequestBuilder and sets the default values. +func NewItemItemCodeScanningAnalysesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAnalysesRequestBuilder) { + m := &ItemItemCodeScanningAnalysesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/analyses{?direction*,page*,per_page*,ref*,sarif_id*,sort*,tool_guid*,tool_name*}", pathParameters), + } + return m +} +// NewItemItemCodeScanningAnalysesRequestBuilder instantiates a new ItemItemCodeScanningAnalysesRequestBuilder and sets the default values. +func NewItemItemCodeScanningAnalysesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAnalysesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningAnalysesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the details of all code scanning analyses for a repository,starting with the most recent.The response is paginated and you can use the `page` and `per_page` parametersto list the analyses you're interested in.By default 30 analyses are listed per page.The `rules_count` field in the response give the number of rulesthat were run in the analysis.For very old analyses this data is not available,and `0` is returned in this field.**Deprecation notice**:The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a []CodeScanningAnalysisable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a Analyses503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository +func (m *ItemItemCodeScanningAnalysesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeScanningAnalysesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAnalysisable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAnalyses503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningAnalysisFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAnalysisable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAnalysisable) + } + } + return val, nil +} +// ToGetRequestInformation lists the details of all code scanning analyses for a repository,starting with the most recent.The response is paginated and you can use the `page` and `per_page` parametersto list the analyses you're interested in.By default 30 analyses are listed per page.The `rules_count` field in the response give the number of rulesthat were run in the analysis.For very old analyses this data is not available,and `0` is returned in this field.**Deprecation notice**:The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningAnalysesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeScanningAnalysesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodeScanningAnalysesRequestBuilder when successful +func (m *ItemItemCodeScanningAnalysesRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningAnalysesRequestBuilder) { + return NewItemItemCodeScanningAnalysesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_analyses_with_analysis_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_analyses_with_analysis_item_request_builder.go new file mode 100644 index 000000000..1c9c81487 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_analyses_with_analysis_item_request_builder.go @@ -0,0 +1,107 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\analyses\{analysis_id} +type ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilderDeleteQueryParameters deletes a specified code scanning analysis from a repository.You can delete one analysis at a time.To delete a series of analyses, start with the most recent analysis and work backwards.Conceptually, the process is similar to the undo function in a text editor.When you list the analyses for a repository,one or more will be identified as deletable in the response:```"deletable": true```An analysis is deletable when it's the most recent in a set of analyses.Typically, a repository will have multiple sets of analysesfor each enabled code scanning tool,where a set is determined by a unique combination of analysis values:* `ref`* `tool`* `category`If you attempt to delete an analysis that is not the most recent in a set,you'll get a 400 response with the message:```Analysis specified is not deletable.```The response from a successful `DELETE` operation provides you withtwo alternative URLs for deleting the next analysis in the set:`next_analysis_url` and `confirm_delete_url`.Use the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysisin a set. This is a useful option if you want to preserve at least one analysisfor the specified tool in your repository.Use the `confirm_delete_url` URL if you are content to remove all analyses for a tool.When you delete the last analysis in a set, the value of `next_analysis_url` and `confirm_delete_url`in the 200 response is `null`.As an example of the deletion process,let's imagine that you added a workflow that configured a particular code scanning toolto analyze the code in a repository. This tool has added 15 analyses:10 on the default branch, and another 5 on a topic branch.You therefore have two separate sets of analyses for this tool.You've now decided that you want to remove all of the analyses for the tool.To do this you must make 15 separate deletion requests.To start, you must find an analysis that's identified as deletable.Each set of analyses always has one that's identified as deletable.Having found the deletable analysis for one of the two sets,delete this analysis and then continue deleting the next analysis in the set until they're all deleted.Then repeat the process for the second set.The procedure therefore consists of a nested loop:**Outer loop**:* List the analyses for the repository, filtered by tool.* Parse this list to find a deletable analysis. If found: **Inner loop**: * Delete the identified analysis. * Parse the response for the value of `confirm_delete_url` and, if found, use this in the next iteration.The above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `confirm_delete_url` value. Alternatively, you could use the `next_analysis_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +type ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilderDeleteQueryParameters struct { + // Allow deletion if the specified analysis is the last in a set. If you attempt to delete the final analysis in a set without setting this parameter to `true`, you'll get a 400 response with the message: `Analysis is last of its type and deletion may result in the loss of historical alert data. Please specify confirm_delete.` + Confirm_delete *string `uriparametername:"confirm_delete"` +} +// NewItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilderInternal instantiates a new ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder) { + m := &ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/analyses/{analysis_id}{?confirm_delete*}", pathParameters), + } + return m +} +// NewItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder instantiates a new ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a specified code scanning analysis from a repository.You can delete one analysis at a time.To delete a series of analyses, start with the most recent analysis and work backwards.Conceptually, the process is similar to the undo function in a text editor.When you list the analyses for a repository,one or more will be identified as deletable in the response:```"deletable": true```An analysis is deletable when it's the most recent in a set of analyses.Typically, a repository will have multiple sets of analysesfor each enabled code scanning tool,where a set is determined by a unique combination of analysis values:* `ref`* `tool`* `category`If you attempt to delete an analysis that is not the most recent in a set,you'll get a 400 response with the message:```Analysis specified is not deletable.```The response from a successful `DELETE` operation provides you withtwo alternative URLs for deleting the next analysis in the set:`next_analysis_url` and `confirm_delete_url`.Use the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysisin a set. This is a useful option if you want to preserve at least one analysisfor the specified tool in your repository.Use the `confirm_delete_url` URL if you are content to remove all analyses for a tool.When you delete the last analysis in a set, the value of `next_analysis_url` and `confirm_delete_url`in the 200 response is `null`.As an example of the deletion process,let's imagine that you added a workflow that configured a particular code scanning toolto analyze the code in a repository. This tool has added 15 analyses:10 on the default branch, and another 5 on a topic branch.You therefore have two separate sets of analyses for this tool.You've now decided that you want to remove all of the analyses for the tool.To do this you must make 15 separate deletion requests.To start, you must find an analysis that's identified as deletable.Each set of analyses always has one that's identified as deletable.Having found the deletable analysis for one of the two sets,delete this analysis and then continue deleting the next analysis in the set until they're all deleted.Then repeat the process for the second set.The procedure therefore consists of a nested loop:**Outer loop**:* List the analyses for the repository, filtered by tool.* Parse this list to find a deletable analysis. If found: **Inner loop**: * Delete the identified analysis. * Parse the response for the value of `confirm_delete_url` and, if found, use this in the next iteration.The above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `confirm_delete_url` value. Alternatively, you could use the `next_analysis_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a CodeScanningAnalysisDeletionable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a CodeScanningAnalysisDeletion503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository +func (m *ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilderDeleteQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAnalysisDeletionable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningAnalysisDeletion503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningAnalysisDeletionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAnalysisDeletionable), nil +} +// Get gets a specified code scanning analysis for a repository.The default JSON response contains fields that describe the analysis.This includes the Git reference and commit SHA to which the analysis relates,the datetime of the analysis, the name of the code scanning tool,and the number of alerts.The `rules_count` field in the default response give the number of rulesthat were run in the analysis.For very old analyses this data is not available,and `0` is returned in this field.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/sarif+json`**: Instead of returning a summary of the analysis, this endpoint returns a subset of the analysis data that was uploaded. The data is formatted as [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). It also returns additional data such as the `github/alertNumber` and `github/alertUrl` properties.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a CodeScanningAnalysisable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a CodeScanningAnalysis503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository +func (m *ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAnalysisable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningAnalysis503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningAnalysisFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAnalysisable), nil +} +// ToDeleteRequestInformation deletes a specified code scanning analysis from a repository.You can delete one analysis at a time.To delete a series of analyses, start with the most recent analysis and work backwards.Conceptually, the process is similar to the undo function in a text editor.When you list the analyses for a repository,one or more will be identified as deletable in the response:```"deletable": true```An analysis is deletable when it's the most recent in a set of analyses.Typically, a repository will have multiple sets of analysesfor each enabled code scanning tool,where a set is determined by a unique combination of analysis values:* `ref`* `tool`* `category`If you attempt to delete an analysis that is not the most recent in a set,you'll get a 400 response with the message:```Analysis specified is not deletable.```The response from a successful `DELETE` operation provides you withtwo alternative URLs for deleting the next analysis in the set:`next_analysis_url` and `confirm_delete_url`.Use the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysisin a set. This is a useful option if you want to preserve at least one analysisfor the specified tool in your repository.Use the `confirm_delete_url` URL if you are content to remove all analyses for a tool.When you delete the last analysis in a set, the value of `next_analysis_url` and `confirm_delete_url`in the 200 response is `null`.As an example of the deletion process,let's imagine that you added a workflow that configured a particular code scanning toolto analyze the code in a repository. This tool has added 15 analyses:10 on the default branch, and another 5 on a topic branch.You therefore have two separate sets of analyses for this tool.You've now decided that you want to remove all of the analyses for the tool.To do this you must make 15 separate deletion requests.To start, you must find an analysis that's identified as deletable.Each set of analyses always has one that's identified as deletable.Having found the deletable analysis for one of the two sets,delete this analysis and then continue deleting the next analysis in the set until they're all deleted.Then repeat the process for the second set.The procedure therefore consists of a nested loop:**Outer loop**:* List the analyses for the repository, filtered by tool.* Parse this list to find a deletable analysis. If found: **Inner loop**: * Delete the identified analysis. * Parse the response for the value of `confirm_delete_url` and, if found, use this in the next iteration.The above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `confirm_delete_url` value. Alternatively, you could use the `next_analysis_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilderDeleteQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets a specified code scanning analysis for a repository.The default JSON response contains fields that describe the analysis.This includes the Git reference and commit SHA to which the analysis relates,the datetime of the analysis, the name of the code scanning tool,and the number of alerts.The `rules_count` field in the default response give the number of rulesthat were run in the analysis.For very old analyses this data is not available,and `0` is returned in this field.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/sarif+json`**: Instead of returning a summary of the analysis, this endpoint returns a subset of the analysis data that was uploaded. The data is formatted as [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). It also returns additional data such as the `github/alertNumber` and `github/alertUrl` properties.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder when successful +func (m *ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder) { + return NewItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_databases_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_databases_request_builder.go new file mode 100644 index 000000000..7b6fc312d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_databases_request_builder.go @@ -0,0 +1,80 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodeScanningCodeqlDatabasesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\codeql\databases +type ItemItemCodeScanningCodeqlDatabasesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByLanguage gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.codeScanning.codeql.databases.item collection +// returns a *ItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilder when successful +func (m *ItemItemCodeScanningCodeqlDatabasesRequestBuilder) ByLanguage(language string)(*ItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if language != "" { + urlTplParams["language"] = language + } + return NewItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCodeScanningCodeqlDatabasesRequestBuilderInternal instantiates a new ItemItemCodeScanningCodeqlDatabasesRequestBuilder and sets the default values. +func NewItemItemCodeScanningCodeqlDatabasesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningCodeqlDatabasesRequestBuilder) { + m := &ItemItemCodeScanningCodeqlDatabasesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/codeql/databases", pathParameters), + } + return m +} +// NewItemItemCodeScanningCodeqlDatabasesRequestBuilder instantiates a new ItemItemCodeScanningCodeqlDatabasesRequestBuilder and sets the default values. +func NewItemItemCodeScanningCodeqlDatabasesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningCodeqlDatabasesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningCodeqlDatabasesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the CodeQL databases that are available in a repository.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a []CodeScanningCodeqlDatabaseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a Databases503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository +func (m *ItemItemCodeScanningCodeqlDatabasesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningCodeqlDatabaseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDatabases503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningCodeqlDatabaseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningCodeqlDatabaseable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningCodeqlDatabaseable) + } + } + return val, nil +} +// ToGetRequestInformation lists the CodeQL databases that are available in a repository.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningCodeqlDatabasesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodeScanningCodeqlDatabasesRequestBuilder when successful +func (m *ItemItemCodeScanningCodeqlDatabasesRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningCodeqlDatabasesRequestBuilder) { + return NewItemItemCodeScanningCodeqlDatabasesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_databases_with_language_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_databases_with_language_item_request_builder.go new file mode 100644 index 000000000..9654cc218 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_databases_with_language_item_request_builder.go @@ -0,0 +1,65 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\codeql\databases\{language} +type ItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilderInternal instantiates a new ItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilder) { + m := &ItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/codeql/databases/{language}", pathParameters), + } + return m +} +// NewItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilder instantiates a new ItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a CodeQL database for a language in a repository.By default this endpoint returns JSON metadata about the CodeQL database. Todownload the CodeQL database binary content, set the `Accept` header of the requestto [`application/zip`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types), and make sureyour HTTP client is configured to follow redirects or use the `Location` headerto make a second request to get the redirect URL.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a CodeScanningCodeqlDatabaseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a CodeScanningCodeqlDatabase503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository +func (m *ItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningCodeqlDatabaseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningCodeqlDatabase503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningCodeqlDatabaseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningCodeqlDatabaseable), nil +} +// ToGetRequestInformation gets a CodeQL database for a language in a repository.By default this endpoint returns JSON metadata about the CodeQL database. Todownload the CodeQL database binary content, set the `Accept` header of the requestto [`application/zip`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types), and make sureyour HTTP client is configured to follow redirects or use the `Location` headerto make a second request to get the redirect URL.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilder when successful +func (m *ItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilder) { + return NewItemItemCodeScanningCodeqlDatabasesWithLanguageItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_request_builder.go new file mode 100644 index 000000000..3f287a49b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_request_builder.go @@ -0,0 +1,33 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemCodeScanningCodeqlRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\codeql +type ItemItemCodeScanningCodeqlRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCodeScanningCodeqlRequestBuilderInternal instantiates a new ItemItemCodeScanningCodeqlRequestBuilder and sets the default values. +func NewItemItemCodeScanningCodeqlRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningCodeqlRequestBuilder) { + m := &ItemItemCodeScanningCodeqlRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/codeql", pathParameters), + } + return m +} +// NewItemItemCodeScanningCodeqlRequestBuilder instantiates a new ItemItemCodeScanningCodeqlRequestBuilder and sets the default values. +func NewItemItemCodeScanningCodeqlRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningCodeqlRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningCodeqlRequestBuilderInternal(urlParams, requestAdapter) +} +// Databases the databases property +// returns a *ItemItemCodeScanningCodeqlDatabasesRequestBuilder when successful +func (m *ItemItemCodeScanningCodeqlRequestBuilder) Databases()(*ItemItemCodeScanningCodeqlDatabasesRequestBuilder) { + return NewItemItemCodeScanningCodeqlDatabasesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// VariantAnalyses the variantAnalyses property +// returns a *ItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder when successful +func (m *ItemItemCodeScanningCodeqlRequestBuilder) VariantAnalyses()(*ItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder) { + return NewItemItemCodeScanningCodeqlVariantAnalysesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_item_repos_item_with_repo_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_item_repos_item_with_repo_name_item_request_builder.go new file mode 100644 index 000000000..b509f15f1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_item_repos_item_with_repo_name_item_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\codeql\variant-analyses\{codeql_variant_analysis_id}\repos\{repo_owner}\{repo_name} +type ItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilderInternal instantiates a new ItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilder) { + m := &ItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}", pathParameters), + } + return m +} +// NewItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilder instantiates a new ItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the analysis status of a repository in a CodeQL variant analysis.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a CodeScanningVariantAnalysisRepoTaskable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a CodeScanningVariantAnalysisRepoTask503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#get-the-analysis-status-of-a-repository-in-a-codeql-variant-analysis +func (m *ItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningVariantAnalysisRepoTaskable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningVariantAnalysisRepoTask503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningVariantAnalysisRepoTaskFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningVariantAnalysisRepoTaskable), nil +} +// ToGetRequestInformation gets the analysis status of a repository in a CodeQL variant analysis.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilder when successful +func (m *ItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilder) { + return NewItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_item_repos_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_item_repos_request_builder.go new file mode 100644 index 000000000..85c55fb7e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_item_repos_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemCodeScanningCodeqlVariantAnalysesItemReposRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\codeql\variant-analyses\{codeql_variant_analysis_id}\repos +type ItemItemCodeScanningCodeqlVariantAnalysesItemReposRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRepo_owner gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.codeScanning.codeql.variantAnalyses.item.repos.item collection +// returns a *ItemItemCodeScanningCodeqlVariantAnalysesItemReposWithRepo_ownerItemRequestBuilder when successful +func (m *ItemItemCodeScanningCodeqlVariantAnalysesItemReposRequestBuilder) ByRepo_owner(repo_owner string)(*ItemItemCodeScanningCodeqlVariantAnalysesItemReposWithRepo_ownerItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if repo_owner != "" { + urlTplParams["repo_owner"] = repo_owner + } + return NewItemItemCodeScanningCodeqlVariantAnalysesItemReposWithRepo_ownerItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCodeScanningCodeqlVariantAnalysesItemReposRequestBuilderInternal instantiates a new ItemItemCodeScanningCodeqlVariantAnalysesItemReposRequestBuilder and sets the default values. +func NewItemItemCodeScanningCodeqlVariantAnalysesItemReposRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningCodeqlVariantAnalysesItemReposRequestBuilder) { + m := &ItemItemCodeScanningCodeqlVariantAnalysesItemReposRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos", pathParameters), + } + return m +} +// NewItemItemCodeScanningCodeqlVariantAnalysesItemReposRequestBuilder instantiates a new ItemItemCodeScanningCodeqlVariantAnalysesItemReposRequestBuilder and sets the default values. +func NewItemItemCodeScanningCodeqlVariantAnalysesItemReposRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningCodeqlVariantAnalysesItemReposRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningCodeqlVariantAnalysesItemReposRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_item_repos_with_repo_owner_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_item_repos_with_repo_owner_item_request_builder.go new file mode 100644 index 000000000..a47f66a7b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_item_repos_with_repo_owner_item_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemCodeScanningCodeqlVariantAnalysesItemReposWithRepo_ownerItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\codeql\variant-analyses\{codeql_variant_analysis_id}\repos\{repo_owner} +type ItemItemCodeScanningCodeqlVariantAnalysesItemReposWithRepo_ownerItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRepo_name gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.codeScanning.codeql.variantAnalyses.item.repos.item.item collection +// returns a *ItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilder when successful +func (m *ItemItemCodeScanningCodeqlVariantAnalysesItemReposWithRepo_ownerItemRequestBuilder) ByRepo_name(repo_name string)(*ItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if repo_name != "" { + urlTplParams["repo_name"] = repo_name + } + return NewItemItemCodeScanningCodeqlVariantAnalysesItemReposItemWithRepo_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCodeScanningCodeqlVariantAnalysesItemReposWithRepo_ownerItemRequestBuilderInternal instantiates a new ItemItemCodeScanningCodeqlVariantAnalysesItemReposWithRepo_ownerItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningCodeqlVariantAnalysesItemReposWithRepo_ownerItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningCodeqlVariantAnalysesItemReposWithRepo_ownerItemRequestBuilder) { + m := &ItemItemCodeScanningCodeqlVariantAnalysesItemReposWithRepo_ownerItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}", pathParameters), + } + return m +} +// NewItemItemCodeScanningCodeqlVariantAnalysesItemReposWithRepo_ownerItemRequestBuilder instantiates a new ItemItemCodeScanningCodeqlVariantAnalysesItemReposWithRepo_ownerItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningCodeqlVariantAnalysesItemReposWithRepo_ownerItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningCodeqlVariantAnalysesItemReposWithRepo_ownerItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningCodeqlVariantAnalysesItemReposWithRepo_ownerItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_post_request_body.go new file mode 100644 index 000000000..640c0dc05 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_post_request_body.go @@ -0,0 +1,197 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody struct { + // The language targeted by the CodeQL query + language *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningVariantAnalysisLanguage + // A Base64-encoded tarball containing a CodeQL query and all its dependencies + query_pack *string + // List of repository names (in the form `owner/repo-name`) to run the query against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required. + repositories []string + // List of repository lists to run the query against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required. + repository_lists []string + // List of organization or user names whose repositories the query should be run against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required. + repository_owners []string +} +// NewItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody instantiates a new ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody and sets the default values. +func NewItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody()(*ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody) { + m := &ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody{ + } + return m +} +// CreateItemItemCodeScanningCodeqlVariantAnalysesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCodeScanningCodeqlVariantAnalysesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ParseCodeScanningVariantAnalysisLanguage) + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val.(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningVariantAnalysisLanguage)) + } + return nil + } + res["query_pack"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetQueryPack(val) + } + return nil + } + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRepositories(res) + } + return nil + } + res["repository_lists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRepositoryLists(res) + } + return nil + } + res["repository_owners"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRepositoryOwners(res) + } + return nil + } + return res +} +// GetLanguage gets the language property value. The language targeted by the CodeQL query +// returns a *CodeScanningVariantAnalysisLanguage when successful +func (m *ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody) GetLanguage()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningVariantAnalysisLanguage) { + return m.language +} +// GetQueryPack gets the query_pack property value. A Base64-encoded tarball containing a CodeQL query and all its dependencies +// returns a *string when successful +func (m *ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody) GetQueryPack()(*string) { + return m.query_pack +} +// GetRepositories gets the repositories property value. List of repository names (in the form `owner/repo-name`) to run the query against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required. +// returns a []string when successful +func (m *ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody) GetRepositories()([]string) { + return m.repositories +} +// GetRepositoryLists gets the repository_lists property value. List of repository lists to run the query against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required. +// returns a []string when successful +func (m *ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody) GetRepositoryLists()([]string) { + return m.repository_lists +} +// GetRepositoryOwners gets the repository_owners property value. List of organization or user names whose repositories the query should be run against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required. +// returns a []string when successful +func (m *ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody) GetRepositoryOwners()([]string) { + return m.repository_owners +} +// Serialize serializes information the current object +func (m *ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLanguage() != nil { + cast := (*m.GetLanguage()).String() + err := writer.WriteStringValue("language", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("query_pack", m.GetQueryPack()) + if err != nil { + return err + } + } + if m.GetRepositories() != nil { + err := writer.WriteCollectionOfStringValues("repositories", m.GetRepositories()) + if err != nil { + return err + } + } + if m.GetRepositoryLists() != nil { + err := writer.WriteCollectionOfStringValues("repository_lists", m.GetRepositoryLists()) + if err != nil { + return err + } + } + if m.GetRepositoryOwners() != nil { + err := writer.WriteCollectionOfStringValues("repository_owners", m.GetRepositoryOwners()) + if err != nil { + return err + } + } + return nil +} +// SetLanguage sets the language property value. The language targeted by the CodeQL query +func (m *ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody) SetLanguage(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningVariantAnalysisLanguage)() { + m.language = value +} +// SetQueryPack sets the query_pack property value. A Base64-encoded tarball containing a CodeQL query and all its dependencies +func (m *ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody) SetQueryPack(value *string)() { + m.query_pack = value +} +// SetRepositories sets the repositories property value. List of repository names (in the form `owner/repo-name`) to run the query against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required. +func (m *ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody) SetRepositories(value []string)() { + m.repositories = value +} +// SetRepositoryLists sets the repository_lists property value. List of repository lists to run the query against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required. +func (m *ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody) SetRepositoryLists(value []string)() { + m.repository_lists = value +} +// SetRepositoryOwners sets the repository_owners property value. List of organization or user names whose repositories the query should be run against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required. +func (m *ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBody) SetRepositoryOwners(value []string)() { + m.repository_owners = value +} +type ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLanguage()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningVariantAnalysisLanguage) + GetQueryPack()(*string) + GetRepositories()([]string) + GetRepositoryLists()([]string) + GetRepositoryOwners()([]string) + SetLanguage(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningVariantAnalysisLanguage)() + SetQueryPack(value *string)() + SetRepositories(value []string)() + SetRepositoryLists(value []string)() + SetRepositoryOwners(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_request_builder.go new file mode 100644 index 000000000..b4444c119 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_request_builder.go @@ -0,0 +1,80 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\codeql\variant-analyses +type ItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByCodeql_variant_analysis_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.codeScanning.codeql.variantAnalyses.item collection +// returns a *ItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder when successful +func (m *ItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder) ByCodeql_variant_analysis_id(codeql_variant_analysis_id int32)(*ItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["codeql_variant_analysis_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(codeql_variant_analysis_id), 10) + return NewItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCodeScanningCodeqlVariantAnalysesRequestBuilderInternal instantiates a new ItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder and sets the default values. +func NewItemItemCodeScanningCodeqlVariantAnalysesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder) { + m := &ItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/codeql/variant-analyses", pathParameters), + } + return m +} +// NewItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder instantiates a new ItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder and sets the default values. +func NewItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningCodeqlVariantAnalysesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates a new CodeQL variant analysis, which will run a CodeQL query against one or more repositories.Get started by learning more about [running CodeQL queries at scale with Multi-Repository Variant Analysis](https://docs.github.com/code-security/codeql-for-vs-code/getting-started-with-codeql-for-vs-code/running-codeql-queries-at-scale-with-multi-repository-variant-analysis).Use the `owner` and `repo` parameters in the URL to specify the controller repository thatwill be used for running GitHub Actions workflows and storing the results of the CodeQL variant analysis.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a CodeScanningVariantAnalysisable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 422 status code +// returns a CodeScanningVariantAnalysis503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#create-a-codeql-variant-analysis +func (m *ItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder) Post(ctx context.Context, body ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningVariantAnalysisable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningVariantAnalysis503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningVariantAnalysisFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningVariantAnalysisable), nil +} +// ToPostRequestInformation creates a new CodeQL variant analysis, which will run a CodeQL query against one or more repositories.Get started by learning more about [running CodeQL queries at scale with Multi-Repository Variant Analysis](https://docs.github.com/code-security/codeql-for-vs-code/getting-started-with-codeql-for-vs-code/running-codeql-queries-at-scale-with-multi-repository-variant-analysis).Use the `owner` and `repo` parameters in the URL to specify the controller repository thatwill be used for running GitHub Actions workflows and storing the results of the CodeQL variant analysis.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemCodeScanningCodeqlVariantAnalysesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder when successful +func (m *ItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder) { + return NewItemItemCodeScanningCodeqlVariantAnalysesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_with_codeql_variant_analysis_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_with_codeql_variant_analysis_item_request_builder.go new file mode 100644 index 000000000..ab0b60b89 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_codeql_variant_analyses_with_codeql_variant_analysis_item_request_builder.go @@ -0,0 +1,68 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\codeql\variant-analyses\{codeql_variant_analysis_id} +type ItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilderInternal instantiates a new ItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder) { + m := &ItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}", pathParameters), + } + return m +} +// NewItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder instantiates a new ItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the summary of a CodeQL variant analysis.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a CodeScanningVariantAnalysisable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a CodeScanningVariantAnalysis503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#get-the-summary-of-a-codeql-variant-analysis +func (m *ItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningVariantAnalysisable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningVariantAnalysis503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningVariantAnalysisFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningVariantAnalysisable), nil +} +// Repos the repos property +// returns a *ItemItemCodeScanningCodeqlVariantAnalysesItemReposRequestBuilder when successful +func (m *ItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder) Repos()(*ItemItemCodeScanningCodeqlVariantAnalysesItemReposRequestBuilder) { + return NewItemItemCodeScanningCodeqlVariantAnalysesItemReposRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation gets the summary of a CodeQL variant analysis.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder when successful +func (m *ItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder) { + return NewItemItemCodeScanningCodeqlVariantAnalysesWithCodeql_variant_analysis_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_default_setup_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_default_setup_request_builder.go new file mode 100644 index 000000000..33b850c21 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_default_setup_request_builder.go @@ -0,0 +1,106 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodeScanningDefaultSetupRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\default-setup +type ItemItemCodeScanningDefaultSetupRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCodeScanningDefaultSetupRequestBuilderInternal instantiates a new ItemItemCodeScanningDefaultSetupRequestBuilder and sets the default values. +func NewItemItemCodeScanningDefaultSetupRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningDefaultSetupRequestBuilder) { + m := &ItemItemCodeScanningDefaultSetupRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/default-setup", pathParameters), + } + return m +} +// NewItemItemCodeScanningDefaultSetupRequestBuilder instantiates a new ItemItemCodeScanningDefaultSetupRequestBuilder and sets the default values. +func NewItemItemCodeScanningDefaultSetupRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningDefaultSetupRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningDefaultSetupRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a code scanning default setup configuration.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a CodeScanningDefaultSetupable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a CodeScanningDefaultSetup503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration +func (m *ItemItemCodeScanningDefaultSetupRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningDefaultSetupable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningDefaultSetup503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningDefaultSetupFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningDefaultSetupable), nil +} +// Patch updates a code scanning default setup configuration.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a EmptyObjectable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a EmptyObject503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration +func (m *ItemItemCodeScanningDefaultSetupRequestBuilder) Patch(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningDefaultSetupUpdateable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObject503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToGetRequestInformation gets a code scanning default setup configuration.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningDefaultSetupRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates a code scanning default setup configuration.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningDefaultSetupRequestBuilder) ToPatchRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningDefaultSetupUpdateable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodeScanningDefaultSetupRequestBuilder when successful +func (m *ItemItemCodeScanningDefaultSetupRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningDefaultSetupRequestBuilder) { + return NewItemItemCodeScanningDefaultSetupRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_request_builder.go new file mode 100644 index 000000000..0cbc1bae1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_request_builder.go @@ -0,0 +1,48 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemCodeScanningRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning +type ItemItemCodeScanningRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Alerts the alerts property +// returns a *ItemItemCodeScanningAlertsRequestBuilder when successful +func (m *ItemItemCodeScanningRequestBuilder) Alerts()(*ItemItemCodeScanningAlertsRequestBuilder) { + return NewItemItemCodeScanningAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Analyses the analyses property +// returns a *ItemItemCodeScanningAnalysesRequestBuilder when successful +func (m *ItemItemCodeScanningRequestBuilder) Analyses()(*ItemItemCodeScanningAnalysesRequestBuilder) { + return NewItemItemCodeScanningAnalysesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Codeql the codeql property +// returns a *ItemItemCodeScanningCodeqlRequestBuilder when successful +func (m *ItemItemCodeScanningRequestBuilder) Codeql()(*ItemItemCodeScanningCodeqlRequestBuilder) { + return NewItemItemCodeScanningCodeqlRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCodeScanningRequestBuilderInternal instantiates a new ItemItemCodeScanningRequestBuilder and sets the default values. +func NewItemItemCodeScanningRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningRequestBuilder) { + m := &ItemItemCodeScanningRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning", pathParameters), + } + return m +} +// NewItemItemCodeScanningRequestBuilder instantiates a new ItemItemCodeScanningRequestBuilder and sets the default values. +func NewItemItemCodeScanningRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningRequestBuilderInternal(urlParams, requestAdapter) +} +// DefaultSetup the defaultSetup property +// returns a *ItemItemCodeScanningDefaultSetupRequestBuilder when successful +func (m *ItemItemCodeScanningRequestBuilder) DefaultSetup()(*ItemItemCodeScanningDefaultSetupRequestBuilder) { + return NewItemItemCodeScanningDefaultSetupRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Sarifs the sarifs property +// returns a *ItemItemCodeScanningSarifsRequestBuilder when successful +func (m *ItemItemCodeScanningRequestBuilder) Sarifs()(*ItemItemCodeScanningSarifsRequestBuilder) { + return NewItemItemCodeScanningSarifsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_sarifs_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_sarifs_post_request_body.go new file mode 100644 index 000000000..467f9bcb3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_sarifs_post_request_body.go @@ -0,0 +1,236 @@ +package repos + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCodeScanningSarifsPostRequestBody struct { + // The base directory used in the analysis, as it appears in the SARIF file.This property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository. + checkout_uri *string + // The SHA of the commit to which the analysis you are uploading relates. + commit_sha *string + // The full Git reference, formatted as `refs/heads/`,`refs/tags/`, `refs/pull//merge`, or `refs/pull//head`. + ref *string + // A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [`gzip`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. For more information, see "[SARIF support for code scanning](https://docs.github.com/code-security/secure-coding/sarif-support-for-code-scanning)." + sarif *string + // The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + started_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the tool used to generate the code scanning analysis. If this parameter is not used, the tool name defaults to "API". If the uploaded SARIF contains a tool GUID, this will be available for filtering using the `tool_guid` parameter of operations such as `GET /repos/{owner}/{repo}/code-scanning/alerts`. + tool_name *string + // Whether the SARIF file will be validated according to the code scanning specifications.This parameter is intended to help integrators ensure that the uploaded SARIF files are correctly rendered by code scanning. + validate *bool +} +// NewItemItemCodeScanningSarifsPostRequestBody instantiates a new ItemItemCodeScanningSarifsPostRequestBody and sets the default values. +func NewItemItemCodeScanningSarifsPostRequestBody()(*ItemItemCodeScanningSarifsPostRequestBody) { + m := &ItemItemCodeScanningSarifsPostRequestBody{ + } + return m +} +// CreateItemItemCodeScanningSarifsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCodeScanningSarifsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodeScanningSarifsPostRequestBody(), nil +} +// GetCheckoutUri gets the checkout_uri property value. The base directory used in the analysis, as it appears in the SARIF file.This property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository. +// returns a *string when successful +func (m *ItemItemCodeScanningSarifsPostRequestBody) GetCheckoutUri()(*string) { + return m.checkout_uri +} +// GetCommitSha gets the commit_sha property value. The SHA of the commit to which the analysis you are uploading relates. +// returns a *string when successful +func (m *ItemItemCodeScanningSarifsPostRequestBody) GetCommitSha()(*string) { + return m.commit_sha +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCodeScanningSarifsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["checkout_uri"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCheckoutUri(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["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["sarif"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSarif(val) + } + return nil + } + res["started_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetStartedAt(val) + } + return nil + } + res["tool_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetToolName(val) + } + return nil + } + res["validate"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetValidate(val) + } + return nil + } + return res +} +// GetRef gets the ref property value. The full Git reference, formatted as `refs/heads/`,`refs/tags/`, `refs/pull//merge`, or `refs/pull//head`. +// returns a *string when successful +func (m *ItemItemCodeScanningSarifsPostRequestBody) GetRef()(*string) { + return m.ref +} +// GetSarif gets the sarif property value. A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [`gzip`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. For more information, see "[SARIF support for code scanning](https://docs.github.com/code-security/secure-coding/sarif-support-for-code-scanning)." +// returns a *string when successful +func (m *ItemItemCodeScanningSarifsPostRequestBody) GetSarif()(*string) { + return m.sarif +} +// GetStartedAt gets the started_at property value. The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *ItemItemCodeScanningSarifsPostRequestBody) GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.started_at +} +// GetToolName gets the tool_name property value. The name of the tool used to generate the code scanning analysis. If this parameter is not used, the tool name defaults to "API". If the uploaded SARIF contains a tool GUID, this will be available for filtering using the `tool_guid` parameter of operations such as `GET /repos/{owner}/{repo}/code-scanning/alerts`. +// returns a *string when successful +func (m *ItemItemCodeScanningSarifsPostRequestBody) GetToolName()(*string) { + return m.tool_name +} +// GetValidate gets the validate property value. Whether the SARIF file will be validated according to the code scanning specifications.This parameter is intended to help integrators ensure that the uploaded SARIF files are correctly rendered by code scanning. +// returns a *bool when successful +func (m *ItemItemCodeScanningSarifsPostRequestBody) GetValidate()(*bool) { + return m.validate +} +// Serialize serializes information the current object +func (m *ItemItemCodeScanningSarifsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("checkout_uri", m.GetCheckoutUri()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_sha", m.GetCommitSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sarif", m.GetSarif()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("started_at", m.GetStartedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tool_name", m.GetToolName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("validate", m.GetValidate()) + if err != nil { + return err + } + } + return nil +} +// SetCheckoutUri sets the checkout_uri property value. The base directory used in the analysis, as it appears in the SARIF file.This property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository. +func (m *ItemItemCodeScanningSarifsPostRequestBody) SetCheckoutUri(value *string)() { + m.checkout_uri = value +} +// SetCommitSha sets the commit_sha property value. The SHA of the commit to which the analysis you are uploading relates. +func (m *ItemItemCodeScanningSarifsPostRequestBody) SetCommitSha(value *string)() { + m.commit_sha = value +} +// SetRef sets the ref property value. The full Git reference, formatted as `refs/heads/`,`refs/tags/`, `refs/pull//merge`, or `refs/pull//head`. +func (m *ItemItemCodeScanningSarifsPostRequestBody) SetRef(value *string)() { + m.ref = value +} +// SetSarif sets the sarif property value. A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [`gzip`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. For more information, see "[SARIF support for code scanning](https://docs.github.com/code-security/secure-coding/sarif-support-for-code-scanning)." +func (m *ItemItemCodeScanningSarifsPostRequestBody) SetSarif(value *string)() { + m.sarif = value +} +// SetStartedAt sets the started_at property value. The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *ItemItemCodeScanningSarifsPostRequestBody) SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.started_at = value +} +// SetToolName sets the tool_name property value. The name of the tool used to generate the code scanning analysis. If this parameter is not used, the tool name defaults to "API". If the uploaded SARIF contains a tool GUID, this will be available for filtering using the `tool_guid` parameter of operations such as `GET /repos/{owner}/{repo}/code-scanning/alerts`. +func (m *ItemItemCodeScanningSarifsPostRequestBody) SetToolName(value *string)() { + m.tool_name = value +} +// SetValidate sets the validate property value. Whether the SARIF file will be validated according to the code scanning specifications.This parameter is intended to help integrators ensure that the uploaded SARIF files are correctly rendered by code scanning. +func (m *ItemItemCodeScanningSarifsPostRequestBody) SetValidate(value *bool)() { + m.validate = value +} +type ItemItemCodeScanningSarifsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCheckoutUri()(*string) + GetCommitSha()(*string) + GetRef()(*string) + GetSarif()(*string) + GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetToolName()(*string) + GetValidate()(*bool) + SetCheckoutUri(value *string)() + SetCommitSha(value *string)() + SetRef(value *string)() + SetSarif(value *string)() + SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetToolName(value *string)() + SetValidate(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_sarifs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_sarifs_request_builder.go new file mode 100644 index 000000000..303194cb7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_sarifs_request_builder.go @@ -0,0 +1,81 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodeScanningSarifsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\sarifs +type ItemItemCodeScanningSarifsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// BySarif_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.codeScanning.sarifs.item collection +// returns a *ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder when successful +func (m *ItemItemCodeScanningSarifsRequestBuilder) BySarif_id(sarif_id string)(*ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if sarif_id != "" { + urlTplParams["sarif_id"] = sarif_id + } + return NewItemItemCodeScanningSarifsWithSarif_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCodeScanningSarifsRequestBuilderInternal instantiates a new ItemItemCodeScanningSarifsRequestBuilder and sets the default values. +func NewItemItemCodeScanningSarifsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningSarifsRequestBuilder) { + m := &ItemItemCodeScanningSarifsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/sarifs", pathParameters), + } + return m +} +// NewItemItemCodeScanningSarifsRequestBuilder instantiates a new ItemItemCodeScanningSarifsRequestBuilder and sets the default values. +func NewItemItemCodeScanningSarifsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningSarifsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningSarifsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. For troubleshooting information, see "[Troubleshooting SARIF uploads](https://docs.github.com/code-security/code-scanning/troubleshooting-sarif)."There are two places where you can upload code scanning results. - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see "[Triaging code scanning alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests)." - If you upload to a branch, for example `--ref refs/heads/my-branch`, then the results appear in the **Security** tab for your repository. For more information, see "[Managing code scanning alerts for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository)."You must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example:```gzip -c analysis-data.sarif | base64 -w0```SARIF upload supports a maximum number of entries per the following data objects, and an analysis will be rejected if any of these objects is above its maximum value. For some objects, there are additional values over which the entries will be ignored while keeping the most important entries whenever applicable.To get the most out of your analysis when it includes data above the supported limits, try to optimize the analysis configuration. For example, for the CodeQL tool, identify and remove the most noisy queries. For more information, see "[SARIF results exceed one or more limits](https://docs.github.com/code-security/code-scanning/troubleshooting-sarif/results-exceed-limit)."| **SARIF data** | **Maximum values** | **Additional limits** ||----------------------------------|:------------------:|----------------------------------------------------------------------------------|| Runs per file | 20 | || Results per run | 25,000 | Only the top 5,000 results will be included, prioritized by severity. || Rules per run | 25,000 | || Tool extensions per run | 100 | || Thread Flow Locations per result | 10,000 | Only the top 1,000 Thread Flow Locations will be included, using prioritization. || Location per result | 1,000 | Only 100 locations will be included. || Tags per rule | 20 | Only 10 tags will be included. |The `202 Accepted` response includes an `id` value.You can use this ID to check the status of the upload by using it in the `/sarifs/{sarif_id}` endpoint.For more information, see "[Get information about a SARIF upload](/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload)."OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.This endpoint is limited to 1,000 requests per hour for each user or app installation calling it. +// returns a CodeScanningSarifsReceiptable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a CodeScanningSarifsReceipt503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data +func (m *ItemItemCodeScanningSarifsRequestBuilder) Post(ctx context.Context, body ItemItemCodeScanningSarifsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningSarifsReceiptable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningSarifsReceipt503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningSarifsReceiptFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningSarifsReceiptable), nil +} +// ToPostRequestInformation uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. For troubleshooting information, see "[Troubleshooting SARIF uploads](https://docs.github.com/code-security/code-scanning/troubleshooting-sarif)."There are two places where you can upload code scanning results. - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see "[Triaging code scanning alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests)." - If you upload to a branch, for example `--ref refs/heads/my-branch`, then the results appear in the **Security** tab for your repository. For more information, see "[Managing code scanning alerts for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository)."You must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example:```gzip -c analysis-data.sarif | base64 -w0```SARIF upload supports a maximum number of entries per the following data objects, and an analysis will be rejected if any of these objects is above its maximum value. For some objects, there are additional values over which the entries will be ignored while keeping the most important entries whenever applicable.To get the most out of your analysis when it includes data above the supported limits, try to optimize the analysis configuration. For example, for the CodeQL tool, identify and remove the most noisy queries. For more information, see "[SARIF results exceed one or more limits](https://docs.github.com/code-security/code-scanning/troubleshooting-sarif/results-exceed-limit)."| **SARIF data** | **Maximum values** | **Additional limits** ||----------------------------------|:------------------:|----------------------------------------------------------------------------------|| Runs per file | 20 | || Results per run | 25,000 | Only the top 5,000 results will be included, prioritized by severity. || Rules per run | 25,000 | || Tool extensions per run | 100 | || Thread Flow Locations per result | 10,000 | Only the top 1,000 Thread Flow Locations will be included, using prioritization. || Location per result | 1,000 | Only 100 locations will be included. || Tags per rule | 20 | Only 10 tags will be included. |The `202 Accepted` response includes an `id` value.You can use this ID to check the status of the upload by using it in the `/sarifs/{sarif_id}` endpoint.For more information, see "[Get information about a SARIF upload](/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload)."OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.This endpoint is limited to 1,000 requests per hour for each user or app installation calling it. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningSarifsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemCodeScanningSarifsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodeScanningSarifsRequestBuilder when successful +func (m *ItemItemCodeScanningSarifsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningSarifsRequestBuilder) { + return NewItemItemCodeScanningSarifsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_sarifs_with_sarif_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_sarifs_with_sarif_item_request_builder.go new file mode 100644 index 000000000..9c9924ea4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_code_scanning_sarifs_with_sarif_item_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\sarifs\{sarif_id} +type ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCodeScanningSarifsWithSarif_ItemRequestBuilderInternal instantiates a new ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningSarifsWithSarif_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder) { + m := &ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/sarifs/{sarif_id}", pathParameters), + } + return m +} +// NewItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder instantiates a new ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningSarifsWithSarif_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see "[Get a code scanning analysis for a repository](/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository)."OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a CodeScanningSarifsStatusable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a CodeScanningSarifsStatus503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload +func (m *ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningSarifsStatusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningSarifsStatus503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningSarifsStatusFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningSarifsStatusable), nil +} +// ToGetRequestInformation gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see "[Get a code scanning analysis for a repository](/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository)."OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder when successful +func (m *ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder) { + return NewItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codeowners_errors_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codeowners_errors_request_builder.go new file mode 100644 index 000000000..a08612de8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codeowners_errors_request_builder.go @@ -0,0 +1,62 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodeownersErrorsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\codeowners\errors +type ItemItemCodeownersErrorsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCodeownersErrorsRequestBuilderGetQueryParameters list any syntax errors that are detected in the CODEOWNERSfile.For more information about the correct CODEOWNERS syntax,see "[About code owners](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners)." +type ItemItemCodeownersErrorsRequestBuilderGetQueryParameters struct { + // A branch, tag or commit name used to determine which version of the CODEOWNERS file to use. Default: the repository's default branch (e.g. `main`) + Ref *string `uriparametername:"ref"` +} +// NewItemItemCodeownersErrorsRequestBuilderInternal instantiates a new ItemItemCodeownersErrorsRequestBuilder and sets the default values. +func NewItemItemCodeownersErrorsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeownersErrorsRequestBuilder) { + m := &ItemItemCodeownersErrorsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/codeowners/errors{?ref*}", pathParameters), + } + return m +} +// NewItemItemCodeownersErrorsRequestBuilder instantiates a new ItemItemCodeownersErrorsRequestBuilder and sets the default values. +func NewItemItemCodeownersErrorsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeownersErrorsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeownersErrorsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list any syntax errors that are detected in the CODEOWNERSfile.For more information about the correct CODEOWNERS syntax,see "[About code owners](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners)." +// returns a CodeownersErrorsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#list-codeowners-errors +func (m *ItemItemCodeownersErrorsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeownersErrorsRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeownersErrorsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeownersErrorsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeownersErrorsable), nil +} +// ToGetRequestInformation list any syntax errors that are detected in the CODEOWNERSfile.For more information about the correct CODEOWNERS syntax,see "[About code owners](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners)." +// returns a *RequestInformation when successful +func (m *ItemItemCodeownersErrorsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeownersErrorsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodeownersErrorsRequestBuilder when successful +func (m *ItemItemCodeownersErrorsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeownersErrorsRequestBuilder) { + return NewItemItemCodeownersErrorsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codeowners_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codeowners_request_builder.go new file mode 100644 index 000000000..e9a545c20 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codeowners_request_builder.go @@ -0,0 +1,28 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemCodeownersRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\codeowners +type ItemItemCodeownersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCodeownersRequestBuilderInternal instantiates a new ItemItemCodeownersRequestBuilder and sets the default values. +func NewItemItemCodeownersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeownersRequestBuilder) { + m := &ItemItemCodeownersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/codeowners", pathParameters), + } + return m +} +// NewItemItemCodeownersRequestBuilder instantiates a new ItemItemCodeownersRequestBuilder and sets the default values. +func NewItemItemCodeownersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeownersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeownersRequestBuilderInternal(urlParams, requestAdapter) +} +// Errors the errors property +// returns a *ItemItemCodeownersErrorsRequestBuilder when successful +func (m *ItemItemCodeownersRequestBuilder) Errors()(*ItemItemCodeownersErrorsRequestBuilder) { + return NewItemItemCodeownersErrorsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_devcontainers_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_devcontainers_get_response.go new file mode 100644 index 000000000..33914b06c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_devcontainers_get_response.go @@ -0,0 +1,121 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCodespacesDevcontainersGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The devcontainers property + devcontainers []ItemItemCodespacesDevcontainersGetResponse_devcontainersable + // The total_count property + total_count *int32 +} +// NewItemItemCodespacesDevcontainersGetResponse instantiates a new ItemItemCodespacesDevcontainersGetResponse and sets the default values. +func NewItemItemCodespacesDevcontainersGetResponse()(*ItemItemCodespacesDevcontainersGetResponse) { + m := &ItemItemCodespacesDevcontainersGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCodespacesDevcontainersGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCodespacesDevcontainersGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodespacesDevcontainersGetResponse(), 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 *ItemItemCodespacesDevcontainersGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDevcontainers gets the devcontainers property value. The devcontainers property +// returns a []ItemItemCodespacesDevcontainersGetResponse_devcontainersable when successful +func (m *ItemItemCodespacesDevcontainersGetResponse) GetDevcontainers()([]ItemItemCodespacesDevcontainersGetResponse_devcontainersable) { + return m.devcontainers +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCodespacesDevcontainersGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["devcontainers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemCodespacesDevcontainersGetResponse_devcontainersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemCodespacesDevcontainersGetResponse_devcontainersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemCodespacesDevcontainersGetResponse_devcontainersable) + } + } + m.SetDevcontainers(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemCodespacesDevcontainersGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemCodespacesDevcontainersGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetDevcontainers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetDevcontainers())) + for i, v := range m.GetDevcontainers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("devcontainers", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemCodespacesDevcontainersGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDevcontainers sets the devcontainers property value. The devcontainers property +func (m *ItemItemCodespacesDevcontainersGetResponse) SetDevcontainers(value []ItemItemCodespacesDevcontainersGetResponse_devcontainersable)() { + m.devcontainers = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemCodespacesDevcontainersGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemCodespacesDevcontainersGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDevcontainers()([]ItemItemCodespacesDevcontainersGetResponse_devcontainersable) + GetTotalCount()(*int32) + SetDevcontainers(value []ItemItemCodespacesDevcontainersGetResponse_devcontainersable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_devcontainers_get_response_devcontainers.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_devcontainers_get_response_devcontainers.go new file mode 100644 index 000000000..d8e682869 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_devcontainers_get_response_devcontainers.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCodespacesDevcontainersGetResponse_devcontainers struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The display_name property + display_name *string + // The name property + name *string + // The path property + path *string +} +// NewItemItemCodespacesDevcontainersGetResponse_devcontainers instantiates a new ItemItemCodespacesDevcontainersGetResponse_devcontainers and sets the default values. +func NewItemItemCodespacesDevcontainersGetResponse_devcontainers()(*ItemItemCodespacesDevcontainersGetResponse_devcontainers) { + m := &ItemItemCodespacesDevcontainersGetResponse_devcontainers{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCodespacesDevcontainersGetResponse_devcontainersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCodespacesDevcontainersGetResponse_devcontainersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodespacesDevcontainersGetResponse_devcontainers(), 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 *ItemItemCodespacesDevcontainersGetResponse_devcontainers) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDisplayName gets the display_name property value. The display_name property +// returns a *string when successful +func (m *ItemItemCodespacesDevcontainersGetResponse_devcontainers) GetDisplayName()(*string) { + return m.display_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCodespacesDevcontainersGetResponse_devcontainers) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["display_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *ItemItemCodespacesDevcontainersGetResponse_devcontainers) GetName()(*string) { + return m.name +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *ItemItemCodespacesDevcontainersGetResponse_devcontainers) GetPath()(*string) { + return m.path +} +// Serialize serializes information the current object +func (m *ItemItemCodespacesDevcontainersGetResponse_devcontainers) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("display_name", m.GetDisplayName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + 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 *ItemItemCodespacesDevcontainersGetResponse_devcontainers) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDisplayName sets the display_name property value. The display_name property +func (m *ItemItemCodespacesDevcontainersGetResponse_devcontainers) SetDisplayName(value *string)() { + m.display_name = value +} +// SetName sets the name property value. The name property +func (m *ItemItemCodespacesDevcontainersGetResponse_devcontainers) SetName(value *string)() { + m.name = value +} +// SetPath sets the path property value. The path property +func (m *ItemItemCodespacesDevcontainersGetResponse_devcontainers) SetPath(value *string)() { + m.path = value +} +type ItemItemCodespacesDevcontainersGetResponse_devcontainersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDisplayName()(*string) + GetName()(*string) + GetPath()(*string) + SetDisplayName(value *string)() + SetName(value *string)() + SetPath(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_devcontainers_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_devcontainers_request_builder.go new file mode 100644 index 000000000..f10c3a5f8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_devcontainers_request_builder.go @@ -0,0 +1,76 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodespacesDevcontainersRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\codespaces\devcontainers +type ItemItemCodespacesDevcontainersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCodespacesDevcontainersRequestBuilderGetQueryParameters lists the devcontainer.json files associated with a specified repository and the authenticated user. These filesspecify launchpoint configurations for codespaces created within the repository.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +type ItemItemCodespacesDevcontainersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemCodespacesDevcontainersRequestBuilderInternal instantiates a new ItemItemCodespacesDevcontainersRequestBuilder and sets the default values. +func NewItemItemCodespacesDevcontainersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodespacesDevcontainersRequestBuilder) { + m := &ItemItemCodespacesDevcontainersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/codespaces/devcontainers{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCodespacesDevcontainersRequestBuilder instantiates a new ItemItemCodespacesDevcontainersRequestBuilder and sets the default values. +func NewItemItemCodespacesDevcontainersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodespacesDevcontainersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodespacesDevcontainersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the devcontainer.json files associated with a specified repository and the authenticated user. These filesspecify launchpoint configurations for codespaces created within the repository.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a ItemItemCodespacesDevcontainersGetResponseable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/codespaces#list-devcontainer-configurations-in-a-repository-for-the-authenticated-user +func (m *ItemItemCodespacesDevcontainersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodespacesDevcontainersRequestBuilderGetQueryParameters])(ItemItemCodespacesDevcontainersGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemCodespacesDevcontainersGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemCodespacesDevcontainersGetResponseable), nil +} +// ToGetRequestInformation lists the devcontainer.json files associated with a specified repository and the authenticated user. These filesspecify launchpoint configurations for codespaces created within the repository.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCodespacesDevcontainersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodespacesDevcontainersRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodespacesDevcontainersRequestBuilder when successful +func (m *ItemItemCodespacesDevcontainersRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodespacesDevcontainersRequestBuilder) { + return NewItemItemCodespacesDevcontainersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_devcontainers_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_devcontainers_response.go new file mode 100644 index 000000000..3f60054a1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_devcontainers_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemCodespacesDevcontainersResponse +// Deprecated: This class is obsolete. Use devcontainersGetResponse instead. +type ItemItemCodespacesDevcontainersResponse struct { + ItemItemCodespacesDevcontainersGetResponse +} +// NewItemItemCodespacesDevcontainersResponse instantiates a new ItemItemCodespacesDevcontainersResponse and sets the default values. +func NewItemItemCodespacesDevcontainersResponse()(*ItemItemCodespacesDevcontainersResponse) { + m := &ItemItemCodespacesDevcontainersResponse{ + ItemItemCodespacesDevcontainersGetResponse: *NewItemItemCodespacesDevcontainersGetResponse(), + } + return m +} +// CreateItemItemCodespacesDevcontainersResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemCodespacesDevcontainersResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodespacesDevcontainersResponse(), nil +} +// ItemItemCodespacesDevcontainersResponseable +// Deprecated: This class is obsolete. Use devcontainersGetResponse instead. +type ItemItemCodespacesDevcontainersResponseable interface { + ItemItemCodespacesDevcontainersGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_get_response.go new file mode 100644 index 000000000..6ebdb783d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemCodespacesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The codespaces property + codespaces []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable + // The total_count property + total_count *int32 +} +// NewItemItemCodespacesGetResponse instantiates a new ItemItemCodespacesGetResponse and sets the default values. +func NewItemItemCodespacesGetResponse()(*ItemItemCodespacesGetResponse) { + m := &ItemItemCodespacesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCodespacesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCodespacesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodespacesGetResponse(), 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 *ItemItemCodespacesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCodespaces gets the codespaces property value. The codespaces property +// returns a []Codespaceable when successful +func (m *ItemItemCodespacesGetResponse) GetCodespaces()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable) { + return m.codespaces +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCodespacesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["codespaces"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespaceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable) + } + } + m.SetCodespaces(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemCodespacesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemCodespacesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCodespaces() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCodespaces())) + for i, v := range m.GetCodespaces() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("codespaces", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemCodespacesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCodespaces sets the codespaces property value. The codespaces property +func (m *ItemItemCodespacesGetResponse) SetCodespaces(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable)() { + m.codespaces = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemCodespacesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemCodespacesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCodespaces()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable) + GetTotalCount()(*int32) + SetCodespaces(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_machines_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_machines_get_response.go new file mode 100644 index 000000000..77fa8d31c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_machines_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemCodespacesMachinesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The machines property + machines []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceMachineable + // The total_count property + total_count *int32 +} +// NewItemItemCodespacesMachinesGetResponse instantiates a new ItemItemCodespacesMachinesGetResponse and sets the default values. +func NewItemItemCodespacesMachinesGetResponse()(*ItemItemCodespacesMachinesGetResponse) { + m := &ItemItemCodespacesMachinesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCodespacesMachinesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCodespacesMachinesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodespacesMachinesGetResponse(), 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 *ItemItemCodespacesMachinesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCodespacesMachinesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["machines"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespaceMachineFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceMachineable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceMachineable) + } + } + m.SetMachines(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetMachines gets the machines property value. The machines property +// returns a []CodespaceMachineable when successful +func (m *ItemItemCodespacesMachinesGetResponse) GetMachines()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceMachineable) { + return m.machines +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemCodespacesMachinesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemCodespacesMachinesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetMachines() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMachines())) + for i, v := range m.GetMachines() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("machines", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemCodespacesMachinesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMachines sets the machines property value. The machines property +func (m *ItemItemCodespacesMachinesGetResponse) SetMachines(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceMachineable)() { + m.machines = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemCodespacesMachinesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemCodespacesMachinesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMachines()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceMachineable) + GetTotalCount()(*int32) + SetMachines(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceMachineable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_machines_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_machines_request_builder.go new file mode 100644 index 000000000..5b9141b0b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_machines_request_builder.go @@ -0,0 +1,76 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodespacesMachinesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\codespaces\machines +type ItemItemCodespacesMachinesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCodespacesMachinesRequestBuilderGetQueryParameters list the machine types available for a given repository based on its configuration.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +type ItemItemCodespacesMachinesRequestBuilderGetQueryParameters struct { + // IP for location auto-detection when proxying a request + Client_ip *string `uriparametername:"client_ip"` + // The location to check for available machines. Assigned by IP if not provided. + Location *string `uriparametername:"location"` + // The branch or commit to check for prebuild availability and devcontainer restrictions. + Ref *string `uriparametername:"ref"` +} +// NewItemItemCodespacesMachinesRequestBuilderInternal instantiates a new ItemItemCodespacesMachinesRequestBuilder and sets the default values. +func NewItemItemCodespacesMachinesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodespacesMachinesRequestBuilder) { + m := &ItemItemCodespacesMachinesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/codespaces/machines{?client_ip*,location*,ref*}", pathParameters), + } + return m +} +// NewItemItemCodespacesMachinesRequestBuilder instantiates a new ItemItemCodespacesMachinesRequestBuilder and sets the default values. +func NewItemItemCodespacesMachinesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodespacesMachinesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodespacesMachinesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the machine types available for a given repository based on its configuration.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a ItemItemCodespacesMachinesGetResponseable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/machines#list-available-machine-types-for-a-repository +func (m *ItemItemCodespacesMachinesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodespacesMachinesRequestBuilderGetQueryParameters])(ItemItemCodespacesMachinesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemCodespacesMachinesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemCodespacesMachinesGetResponseable), nil +} +// ToGetRequestInformation list the machine types available for a given repository based on its configuration.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCodespacesMachinesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodespacesMachinesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodespacesMachinesRequestBuilder when successful +func (m *ItemItemCodespacesMachinesRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodespacesMachinesRequestBuilder) { + return NewItemItemCodespacesMachinesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_machines_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_machines_response.go new file mode 100644 index 000000000..32626b2db --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_machines_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemCodespacesMachinesResponse +// Deprecated: This class is obsolete. Use machinesGetResponse instead. +type ItemItemCodespacesMachinesResponse struct { + ItemItemCodespacesMachinesGetResponse +} +// NewItemItemCodespacesMachinesResponse instantiates a new ItemItemCodespacesMachinesResponse and sets the default values. +func NewItemItemCodespacesMachinesResponse()(*ItemItemCodespacesMachinesResponse) { + m := &ItemItemCodespacesMachinesResponse{ + ItemItemCodespacesMachinesGetResponse: *NewItemItemCodespacesMachinesGetResponse(), + } + return m +} +// CreateItemItemCodespacesMachinesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemCodespacesMachinesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodespacesMachinesResponse(), nil +} +// ItemItemCodespacesMachinesResponseable +// Deprecated: This class is obsolete. Use machinesGetResponse instead. +type ItemItemCodespacesMachinesResponseable interface { + ItemItemCodespacesMachinesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_new_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_new_get_response.go new file mode 100644 index 000000000..da60994d4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_new_get_response.go @@ -0,0 +1,110 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemCodespacesNewGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + billable_owner i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable + // The defaults property + defaults ItemItemCodespacesNewGetResponse_defaultsable +} +// NewItemItemCodespacesNewGetResponse instantiates a new ItemItemCodespacesNewGetResponse and sets the default values. +func NewItemItemCodespacesNewGetResponse()(*ItemItemCodespacesNewGetResponse) { + m := &ItemItemCodespacesNewGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCodespacesNewGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCodespacesNewGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodespacesNewGetResponse(), 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 *ItemItemCodespacesNewGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBillableOwner gets the billable_owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *ItemItemCodespacesNewGetResponse) GetBillableOwner()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) { + return m.billable_owner +} +// GetDefaults gets the defaults property value. The defaults property +// returns a ItemItemCodespacesNewGetResponse_defaultsable when successful +func (m *ItemItemCodespacesNewGetResponse) GetDefaults()(ItemItemCodespacesNewGetResponse_defaultsable) { + return m.defaults +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCodespacesNewGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["billable_owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBillableOwner(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable)) + } + return nil + } + res["defaults"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemCodespacesNewGetResponse_defaultsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDefaults(val.(ItemItemCodespacesNewGetResponse_defaultsable)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemCodespacesNewGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("billable_owner", m.GetBillableOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("defaults", m.GetDefaults()) + 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 *ItemItemCodespacesNewGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBillableOwner sets the billable_owner property value. A GitHub user. +func (m *ItemItemCodespacesNewGetResponse) SetBillableOwner(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable)() { + m.billable_owner = value +} +// SetDefaults sets the defaults property value. The defaults property +func (m *ItemItemCodespacesNewGetResponse) SetDefaults(value ItemItemCodespacesNewGetResponse_defaultsable)() { + m.defaults = value +} +type ItemItemCodespacesNewGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBillableOwner()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + GetDefaults()(ItemItemCodespacesNewGetResponse_defaultsable) + SetBillableOwner(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable)() + SetDefaults(value ItemItemCodespacesNewGetResponse_defaultsable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_new_get_response_defaults.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_new_get_response_defaults.go new file mode 100644 index 000000000..5ed7834e7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_new_get_response_defaults.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCodespacesNewGetResponse_defaults struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The devcontainer_path property + devcontainer_path *string + // The location property + location *string +} +// NewItemItemCodespacesNewGetResponse_defaults instantiates a new ItemItemCodespacesNewGetResponse_defaults and sets the default values. +func NewItemItemCodespacesNewGetResponse_defaults()(*ItemItemCodespacesNewGetResponse_defaults) { + m := &ItemItemCodespacesNewGetResponse_defaults{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCodespacesNewGetResponse_defaultsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCodespacesNewGetResponse_defaultsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodespacesNewGetResponse_defaults(), 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 *ItemItemCodespacesNewGetResponse_defaults) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDevcontainerPath gets the devcontainer_path property value. The devcontainer_path property +// returns a *string when successful +func (m *ItemItemCodespacesNewGetResponse_defaults) GetDevcontainerPath()(*string) { + return m.devcontainer_path +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCodespacesNewGetResponse_defaults) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["devcontainer_path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDevcontainerPath(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + return res +} +// GetLocation gets the location property value. The location property +// returns a *string when successful +func (m *ItemItemCodespacesNewGetResponse_defaults) GetLocation()(*string) { + return m.location +} +// Serialize serializes information the current object +func (m *ItemItemCodespacesNewGetResponse_defaults) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("devcontainer_path", m.GetDevcontainerPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + 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 *ItemItemCodespacesNewGetResponse_defaults) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDevcontainerPath sets the devcontainer_path property value. The devcontainer_path property +func (m *ItemItemCodespacesNewGetResponse_defaults) SetDevcontainerPath(value *string)() { + m.devcontainer_path = value +} +// SetLocation sets the location property value. The location property +func (m *ItemItemCodespacesNewGetResponse_defaults) SetLocation(value *string)() { + m.location = value +} +type ItemItemCodespacesNewGetResponse_defaultsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDevcontainerPath()(*string) + GetLocation()(*string) + SetDevcontainerPath(value *string)() + SetLocation(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_new_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_new_request_builder.go new file mode 100644 index 000000000..205371711 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_new_request_builder.go @@ -0,0 +1,72 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodespacesNewRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\codespaces\new +type ItemItemCodespacesNewRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCodespacesNewRequestBuilderGetQueryParameters gets the default attributes for codespaces created by the user with the repository.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +type ItemItemCodespacesNewRequestBuilderGetQueryParameters struct { + // An alternative IP for default location auto-detection, such as when proxying a request. + Client_ip *string `uriparametername:"client_ip"` + // The branch or commit to check for a default devcontainer path. If not specified, the default branch will be checked. + Ref *string `uriparametername:"ref"` +} +// NewItemItemCodespacesNewRequestBuilderInternal instantiates a new ItemItemCodespacesNewRequestBuilder and sets the default values. +func NewItemItemCodespacesNewRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodespacesNewRequestBuilder) { + m := &ItemItemCodespacesNewRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/codespaces/new{?client_ip*,ref*}", pathParameters), + } + return m +} +// NewItemItemCodespacesNewRequestBuilder instantiates a new ItemItemCodespacesNewRequestBuilder and sets the default values. +func NewItemItemCodespacesNewRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodespacesNewRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodespacesNewRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the default attributes for codespaces created by the user with the repository.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a ItemItemCodespacesNewGetResponseable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/codespaces#get-default-attributes-for-a-codespace +func (m *ItemItemCodespacesNewRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodespacesNewRequestBuilderGetQueryParameters])(ItemItemCodespacesNewGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemCodespacesNewGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemCodespacesNewGetResponseable), nil +} +// ToGetRequestInformation gets the default attributes for codespaces created by the user with the repository.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCodespacesNewRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodespacesNewRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodespacesNewRequestBuilder when successful +func (m *ItemItemCodespacesNewRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodespacesNewRequestBuilder) { + return NewItemItemCodespacesNewRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_new_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_new_response.go new file mode 100644 index 000000000..2b7101ee3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_new_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemCodespacesNewResponse +// Deprecated: This class is obsolete. Use newGetResponse instead. +type ItemItemCodespacesNewResponse struct { + ItemItemCodespacesNewGetResponse +} +// NewItemItemCodespacesNewResponse instantiates a new ItemItemCodespacesNewResponse and sets the default values. +func NewItemItemCodespacesNewResponse()(*ItemItemCodespacesNewResponse) { + m := &ItemItemCodespacesNewResponse{ + ItemItemCodespacesNewGetResponse: *NewItemItemCodespacesNewGetResponse(), + } + return m +} +// CreateItemItemCodespacesNewResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemCodespacesNewResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodespacesNewResponse(), nil +} +// ItemItemCodespacesNewResponseable +// Deprecated: This class is obsolete. Use newGetResponse instead. +type ItemItemCodespacesNewResponseable interface { + ItemItemCodespacesNewGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_permissions_check_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_permissions_check_request_builder.go new file mode 100644 index 000000000..444711244 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_permissions_check_request_builder.go @@ -0,0 +1,76 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodespacesPermissions_checkRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\codespaces\permissions_check +type ItemItemCodespacesPermissions_checkRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCodespacesPermissions_checkRequestBuilderGetQueryParameters checks whether the permissions defined by a given devcontainer configuration have been accepted by the authenticated user.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +type ItemItemCodespacesPermissions_checkRequestBuilderGetQueryParameters struct { + // Path to the devcontainer.json configuration to use for the permission check. + Devcontainer_path *string `uriparametername:"devcontainer_path"` + // The git reference that points to the location of the devcontainer configuration to use for the permission check. The value of `ref` will typically be a branch name (`heads/BRANCH_NAME`). For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. + Ref *string `uriparametername:"ref"` +} +// NewItemItemCodespacesPermissions_checkRequestBuilderInternal instantiates a new ItemItemCodespacesPermissions_checkRequestBuilder and sets the default values. +func NewItemItemCodespacesPermissions_checkRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodespacesPermissions_checkRequestBuilder) { + m := &ItemItemCodespacesPermissions_checkRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/codespaces/permissions_check?devcontainer_path={devcontainer_path}&ref={ref}", pathParameters), + } + return m +} +// NewItemItemCodespacesPermissions_checkRequestBuilder instantiates a new ItemItemCodespacesPermissions_checkRequestBuilder and sets the default values. +func NewItemItemCodespacesPermissions_checkRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodespacesPermissions_checkRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodespacesPermissions_checkRequestBuilderInternal(urlParams, requestAdapter) +} +// Get checks whether the permissions defined by a given devcontainer configuration have been accepted by the authenticated user.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a CodespacesPermissionsCheckForDevcontainerable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a CodespacesPermissionsCheckForDevcontainer503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/codespaces#check-if-permissions-defined-by-a-devcontainer-have-been-accepted-by-the-authenticated-user +func (m *ItemItemCodespacesPermissions_checkRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodespacesPermissions_checkRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesPermissionsCheckForDevcontainerable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespacesPermissionsCheckForDevcontainer503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespacesPermissionsCheckForDevcontainerFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesPermissionsCheckForDevcontainerable), nil +} +// ToGetRequestInformation checks whether the permissions defined by a given devcontainer configuration have been accepted by the authenticated user.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCodespacesPermissions_checkRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodespacesPermissions_checkRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodespacesPermissions_checkRequestBuilder when successful +func (m *ItemItemCodespacesPermissions_checkRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodespacesPermissions_checkRequestBuilder) { + return NewItemItemCodespacesPermissions_checkRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_post_request_body.go new file mode 100644 index 000000000..cba3e3614 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_post_request_body.go @@ -0,0 +1,341 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCodespacesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // IP for location auto-detection when proxying a request + client_ip *string + // Path to devcontainer.json config to use for this codespace + devcontainer_path *string + // Display name for this codespace + display_name *string + // Time in minutes before codespace stops from inactivity + idle_timeout_minutes *int32 + // The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. + location *string + // Machine type to use for this codespace + machine *string + // Whether to authorize requested permissions from devcontainer.json + multi_repo_permissions_opt_out *bool + // Git ref (typically a branch name) for this codespace + ref *string + // Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days). + retention_period_minutes *int32 + // Working directory for this codespace + working_directory *string +} +// NewItemItemCodespacesPostRequestBody instantiates a new ItemItemCodespacesPostRequestBody and sets the default values. +func NewItemItemCodespacesPostRequestBody()(*ItemItemCodespacesPostRequestBody) { + m := &ItemItemCodespacesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCodespacesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCodespacesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodespacesPostRequestBody(), 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 *ItemItemCodespacesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientIp gets the client_ip property value. IP for location auto-detection when proxying a request +// returns a *string when successful +func (m *ItemItemCodespacesPostRequestBody) GetClientIp()(*string) { + return m.client_ip +} +// GetDevcontainerPath gets the devcontainer_path property value. Path to devcontainer.json config to use for this codespace +// returns a *string when successful +func (m *ItemItemCodespacesPostRequestBody) GetDevcontainerPath()(*string) { + return m.devcontainer_path +} +// GetDisplayName gets the display_name property value. Display name for this codespace +// returns a *string when successful +func (m *ItemItemCodespacesPostRequestBody) GetDisplayName()(*string) { + return m.display_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCodespacesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_ip"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientIp(val) + } + return nil + } + res["devcontainer_path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDevcontainerPath(val) + } + return nil + } + res["display_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["idle_timeout_minutes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetIdleTimeoutMinutes(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["machine"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMachine(val) + } + return nil + } + res["multi_repo_permissions_opt_out"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMultiRepoPermissionsOptOut(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["retention_period_minutes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRetentionPeriodMinutes(val) + } + return nil + } + res["working_directory"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWorkingDirectory(val) + } + return nil + } + return res +} +// GetIdleTimeoutMinutes gets the idle_timeout_minutes property value. Time in minutes before codespace stops from inactivity +// returns a *int32 when successful +func (m *ItemItemCodespacesPostRequestBody) GetIdleTimeoutMinutes()(*int32) { + return m.idle_timeout_minutes +} +// GetLocation gets the location property value. The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. +// returns a *string when successful +func (m *ItemItemCodespacesPostRequestBody) GetLocation()(*string) { + return m.location +} +// GetMachine gets the machine property value. Machine type to use for this codespace +// returns a *string when successful +func (m *ItemItemCodespacesPostRequestBody) GetMachine()(*string) { + return m.machine +} +// GetMultiRepoPermissionsOptOut gets the multi_repo_permissions_opt_out property value. Whether to authorize requested permissions from devcontainer.json +// returns a *bool when successful +func (m *ItemItemCodespacesPostRequestBody) GetMultiRepoPermissionsOptOut()(*bool) { + return m.multi_repo_permissions_opt_out +} +// GetRef gets the ref property value. Git ref (typically a branch name) for this codespace +// returns a *string when successful +func (m *ItemItemCodespacesPostRequestBody) GetRef()(*string) { + return m.ref +} +// GetRetentionPeriodMinutes gets the retention_period_minutes property value. Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days). +// returns a *int32 when successful +func (m *ItemItemCodespacesPostRequestBody) GetRetentionPeriodMinutes()(*int32) { + return m.retention_period_minutes +} +// GetWorkingDirectory gets the working_directory property value. Working directory for this codespace +// returns a *string when successful +func (m *ItemItemCodespacesPostRequestBody) GetWorkingDirectory()(*string) { + return m.working_directory +} +// Serialize serializes information the current object +func (m *ItemItemCodespacesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("client_ip", m.GetClientIp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("devcontainer_path", m.GetDevcontainerPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("display_name", m.GetDisplayName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("idle_timeout_minutes", m.GetIdleTimeoutMinutes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("machine", m.GetMachine()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("multi_repo_permissions_opt_out", m.GetMultiRepoPermissionsOptOut()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("retention_period_minutes", m.GetRetentionPeriodMinutes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("working_directory", m.GetWorkingDirectory()) + 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 *ItemItemCodespacesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientIp sets the client_ip property value. IP for location auto-detection when proxying a request +func (m *ItemItemCodespacesPostRequestBody) SetClientIp(value *string)() { + m.client_ip = value +} +// SetDevcontainerPath sets the devcontainer_path property value. Path to devcontainer.json config to use for this codespace +func (m *ItemItemCodespacesPostRequestBody) SetDevcontainerPath(value *string)() { + m.devcontainer_path = value +} +// SetDisplayName sets the display_name property value. Display name for this codespace +func (m *ItemItemCodespacesPostRequestBody) SetDisplayName(value *string)() { + m.display_name = value +} +// SetIdleTimeoutMinutes sets the idle_timeout_minutes property value. Time in minutes before codespace stops from inactivity +func (m *ItemItemCodespacesPostRequestBody) SetIdleTimeoutMinutes(value *int32)() { + m.idle_timeout_minutes = value +} +// SetLocation sets the location property value. The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. +func (m *ItemItemCodespacesPostRequestBody) SetLocation(value *string)() { + m.location = value +} +// SetMachine sets the machine property value. Machine type to use for this codespace +func (m *ItemItemCodespacesPostRequestBody) SetMachine(value *string)() { + m.machine = value +} +// SetMultiRepoPermissionsOptOut sets the multi_repo_permissions_opt_out property value. Whether to authorize requested permissions from devcontainer.json +func (m *ItemItemCodespacesPostRequestBody) SetMultiRepoPermissionsOptOut(value *bool)() { + m.multi_repo_permissions_opt_out = value +} +// SetRef sets the ref property value. Git ref (typically a branch name) for this codespace +func (m *ItemItemCodespacesPostRequestBody) SetRef(value *string)() { + m.ref = value +} +// SetRetentionPeriodMinutes sets the retention_period_minutes property value. Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days). +func (m *ItemItemCodespacesPostRequestBody) SetRetentionPeriodMinutes(value *int32)() { + m.retention_period_minutes = value +} +// SetWorkingDirectory sets the working_directory property value. Working directory for this codespace +func (m *ItemItemCodespacesPostRequestBody) SetWorkingDirectory(value *string)() { + m.working_directory = value +} +type ItemItemCodespacesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientIp()(*string) + GetDevcontainerPath()(*string) + GetDisplayName()(*string) + GetIdleTimeoutMinutes()(*int32) + GetLocation()(*string) + GetMachine()(*string) + GetMultiRepoPermissionsOptOut()(*bool) + GetRef()(*string) + GetRetentionPeriodMinutes()(*int32) + GetWorkingDirectory()(*string) + SetClientIp(value *string)() + SetDevcontainerPath(value *string)() + SetDisplayName(value *string)() + SetIdleTimeoutMinutes(value *int32)() + SetLocation(value *string)() + SetMachine(value *string)() + SetMultiRepoPermissionsOptOut(value *bool)() + SetRef(value *string)() + SetRetentionPeriodMinutes(value *int32)() + SetWorkingDirectory(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_request_builder.go new file mode 100644 index 000000000..6acc3b2e6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_request_builder.go @@ -0,0 +1,142 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodespacesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\codespaces +type ItemItemCodespacesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCodespacesRequestBuilderGetQueryParameters lists the codespaces associated to a specified repository and the authenticated user.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +type ItemItemCodespacesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemCodespacesRequestBuilderInternal instantiates a new ItemItemCodespacesRequestBuilder and sets the default values. +func NewItemItemCodespacesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodespacesRequestBuilder) { + m := &ItemItemCodespacesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/codespaces{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCodespacesRequestBuilder instantiates a new ItemItemCodespacesRequestBuilder and sets the default values. +func NewItemItemCodespacesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodespacesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodespacesRequestBuilderInternal(urlParams, requestAdapter) +} +// Devcontainers the devcontainers property +// returns a *ItemItemCodespacesDevcontainersRequestBuilder when successful +func (m *ItemItemCodespacesRequestBuilder) Devcontainers()(*ItemItemCodespacesDevcontainersRequestBuilder) { + return NewItemItemCodespacesDevcontainersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get lists the codespaces associated to a specified repository and the authenticated user.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a ItemItemCodespacesGetResponseable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user +func (m *ItemItemCodespacesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodespacesRequestBuilderGetQueryParameters])(ItemItemCodespacesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemCodespacesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemCodespacesGetResponseable), nil +} +// Machines the machines property +// returns a *ItemItemCodespacesMachinesRequestBuilder when successful +func (m *ItemItemCodespacesRequestBuilder) Machines()(*ItemItemCodespacesMachinesRequestBuilder) { + return NewItemItemCodespacesMachinesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// New the new property +// returns a *ItemItemCodespacesNewRequestBuilder when successful +func (m *ItemItemCodespacesRequestBuilder) New()(*ItemItemCodespacesNewRequestBuilder) { + return NewItemItemCodespacesNewRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Permissions_check the permissions_check property +// returns a *ItemItemCodespacesPermissions_checkRequestBuilder when successful +func (m *ItemItemCodespacesRequestBuilder) Permissions_check()(*ItemItemCodespacesPermissions_checkRequestBuilder) { + return NewItemItemCodespacesPermissions_checkRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Post creates a codespace owned by the authenticated user in the specified repository.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a Codespaceable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a Codespace503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-in-a-repository +func (m *ItemItemCodespacesRequestBuilder) Post(ctx context.Context, body ItemItemCodespacesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespace503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespaceFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable), nil +} +// Secrets the secrets property +// returns a *ItemItemCodespacesSecretsRequestBuilder when successful +func (m *ItemItemCodespacesRequestBuilder) Secrets()(*ItemItemCodespacesSecretsRequestBuilder) { + return NewItemItemCodespacesSecretsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists the codespaces associated to a specified repository and the authenticated user.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCodespacesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodespacesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a codespace owned by the authenticated user in the specified repository.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCodespacesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemCodespacesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodespacesRequestBuilder when successful +func (m *ItemItemCodespacesRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodespacesRequestBuilder) { + return NewItemItemCodespacesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_response.go new file mode 100644 index 000000000..02a5a3f20 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemCodespacesResponse +// Deprecated: This class is obsolete. Use codespacesGetResponse instead. +type ItemItemCodespacesResponse struct { + ItemItemCodespacesGetResponse +} +// NewItemItemCodespacesResponse instantiates a new ItemItemCodespacesResponse and sets the default values. +func NewItemItemCodespacesResponse()(*ItemItemCodespacesResponse) { + m := &ItemItemCodespacesResponse{ + ItemItemCodespacesGetResponse: *NewItemItemCodespacesGetResponse(), + } + return m +} +// CreateItemItemCodespacesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemCodespacesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodespacesResponse(), nil +} +// ItemItemCodespacesResponseable +// Deprecated: This class is obsolete. Use codespacesGetResponse instead. +type ItemItemCodespacesResponseable interface { + ItemItemCodespacesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_get_response.go new file mode 100644 index 000000000..32eb3cab2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemCodespacesSecretsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The secrets property + secrets []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepoCodespacesSecretable + // The total_count property + total_count *int32 +} +// NewItemItemCodespacesSecretsGetResponse instantiates a new ItemItemCodespacesSecretsGetResponse and sets the default values. +func NewItemItemCodespacesSecretsGetResponse()(*ItemItemCodespacesSecretsGetResponse) { + m := &ItemItemCodespacesSecretsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCodespacesSecretsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCodespacesSecretsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodespacesSecretsGetResponse(), 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 *ItemItemCodespacesSecretsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCodespacesSecretsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepoCodespacesSecretFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepoCodespacesSecretable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepoCodespacesSecretable) + } + } + m.SetSecrets(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetSecrets gets the secrets property value. The secrets property +// returns a []RepoCodespacesSecretable when successful +func (m *ItemItemCodespacesSecretsGetResponse) GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepoCodespacesSecretable) { + return m.secrets +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemCodespacesSecretsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemCodespacesSecretsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecrets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSecrets())) + for i, v := range m.GetSecrets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("secrets", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemCodespacesSecretsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSecrets sets the secrets property value. The secrets property +func (m *ItemItemCodespacesSecretsGetResponse) SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepoCodespacesSecretable)() { + m.secrets = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemCodespacesSecretsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemCodespacesSecretsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepoCodespacesSecretable) + GetTotalCount()(*int32) + SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepoCodespacesSecretable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_item_with_secret_name_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_item_with_secret_name_put_request_body.go new file mode 100644 index 000000000..690a3010b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_item_with_secret_name_put_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCodespacesSecretsItemWithSecret_namePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-public-key) endpoint. + encrypted_value *string + // ID of the key you used to encrypt the secret. + key_id *string +} +// NewItemItemCodespacesSecretsItemWithSecret_namePutRequestBody instantiates a new ItemItemCodespacesSecretsItemWithSecret_namePutRequestBody and sets the default values. +func NewItemItemCodespacesSecretsItemWithSecret_namePutRequestBody()(*ItemItemCodespacesSecretsItemWithSecret_namePutRequestBody) { + m := &ItemItemCodespacesSecretsItemWithSecret_namePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCodespacesSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCodespacesSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodespacesSecretsItemWithSecret_namePutRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemItemCodespacesSecretsItemWithSecret_namePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncryptedValue gets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-public-key) endpoint. +// returns a *string when successful +func (m *ItemItemCodespacesSecretsItemWithSecret_namePutRequestBody) GetEncryptedValue()(*string) { + return m.encrypted_value +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCodespacesSecretsItemWithSecret_namePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["encrypted_value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncryptedValue(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + return res +} +// GetKeyId gets the key_id property value. ID of the key you used to encrypt the secret. +// returns a *string when successful +func (m *ItemItemCodespacesSecretsItemWithSecret_namePutRequestBody) GetKeyId()(*string) { + return m.key_id +} +// Serialize serializes information the current object +func (m *ItemItemCodespacesSecretsItemWithSecret_namePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("encrypted_value", m.GetEncryptedValue()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemCodespacesSecretsItemWithSecret_namePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncryptedValue sets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-public-key) endpoint. +func (m *ItemItemCodespacesSecretsItemWithSecret_namePutRequestBody) SetEncryptedValue(value *string)() { + m.encrypted_value = value +} +// SetKeyId sets the key_id property value. ID of the key you used to encrypt the secret. +func (m *ItemItemCodespacesSecretsItemWithSecret_namePutRequestBody) SetKeyId(value *string)() { + m.key_id = value +} +type ItemItemCodespacesSecretsItemWithSecret_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncryptedValue()(*string) + GetKeyId()(*string) + SetEncryptedValue(value *string)() + SetKeyId(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_public_key_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_public_key_request_builder.go new file mode 100644 index 000000000..a56792d40 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_public_key_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodespacesSecretsPublicKeyRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\codespaces\secrets\public-key +type ItemItemCodespacesSecretsPublicKeyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCodespacesSecretsPublicKeyRequestBuilderInternal instantiates a new ItemItemCodespacesSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemItemCodespacesSecretsPublicKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodespacesSecretsPublicKeyRequestBuilder) { + m := &ItemItemCodespacesSecretsPublicKeyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/codespaces/secrets/public-key", pathParameters), + } + return m +} +// NewItemItemCodespacesSecretsPublicKeyRequestBuilder instantiates a new ItemItemCodespacesSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemItemCodespacesSecretsPublicKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodespacesSecretsPublicKeyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodespacesSecretsPublicKeyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a CodespacesPublicKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-public-key +func (m *ItemItemCodespacesSecretsPublicKeyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesPublicKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespacesPublicKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesPublicKeyable), nil +} +// ToGetRequestInformation gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCodespacesSecretsPublicKeyRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodespacesSecretsPublicKeyRequestBuilder when successful +func (m *ItemItemCodespacesSecretsPublicKeyRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodespacesSecretsPublicKeyRequestBuilder) { + return NewItemItemCodespacesSecretsPublicKeyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_request_builder.go new file mode 100644 index 000000000..ffab9a3f7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_request_builder.go @@ -0,0 +1,80 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemCodespacesSecretsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\codespaces\secrets +type ItemItemCodespacesSecretsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCodespacesSecretsRequestBuilderGetQueryParameters lists all development environment secrets available in a repository without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemCodespacesSecretsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// BySecret_name gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.codespaces.secrets.item collection +// returns a *ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemItemCodespacesSecretsRequestBuilder) BySecret_name(secret_name string)(*ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if secret_name != "" { + urlTplParams["secret_name"] = secret_name + } + return NewItemItemCodespacesSecretsWithSecret_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCodespacesSecretsRequestBuilderInternal instantiates a new ItemItemCodespacesSecretsRequestBuilder and sets the default values. +func NewItemItemCodespacesSecretsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodespacesSecretsRequestBuilder) { + m := &ItemItemCodespacesSecretsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/codespaces/secrets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCodespacesSecretsRequestBuilder instantiates a new ItemItemCodespacesSecretsRequestBuilder and sets the default values. +func NewItemItemCodespacesSecretsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodespacesSecretsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodespacesSecretsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all development environment secrets available in a repository without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemCodespacesSecretsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/repository-secrets#list-repository-secrets +func (m *ItemItemCodespacesSecretsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodespacesSecretsRequestBuilderGetQueryParameters])(ItemItemCodespacesSecretsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemCodespacesSecretsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemCodespacesSecretsGetResponseable), nil +} +// PublicKey the publicKey property +// returns a *ItemItemCodespacesSecretsPublicKeyRequestBuilder when successful +func (m *ItemItemCodespacesSecretsRequestBuilder) PublicKey()(*ItemItemCodespacesSecretsPublicKeyRequestBuilder) { + return NewItemItemCodespacesSecretsPublicKeyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all development environment secrets available in a repository without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCodespacesSecretsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodespacesSecretsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodespacesSecretsRequestBuilder when successful +func (m *ItemItemCodespacesSecretsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodespacesSecretsRequestBuilder) { + return NewItemItemCodespacesSecretsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_response.go new file mode 100644 index 000000000..29dbe97d6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemCodespacesSecretsResponse +// Deprecated: This class is obsolete. Use secretsGetResponse instead. +type ItemItemCodespacesSecretsResponse struct { + ItemItemCodespacesSecretsGetResponse +} +// NewItemItemCodespacesSecretsResponse instantiates a new ItemItemCodespacesSecretsResponse and sets the default values. +func NewItemItemCodespacesSecretsResponse()(*ItemItemCodespacesSecretsResponse) { + m := &ItemItemCodespacesSecretsResponse{ + ItemItemCodespacesSecretsGetResponse: *NewItemItemCodespacesSecretsGetResponse(), + } + return m +} +// CreateItemItemCodespacesSecretsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemCodespacesSecretsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodespacesSecretsResponse(), nil +} +// ItemItemCodespacesSecretsResponseable +// Deprecated: This class is obsolete. Use secretsGetResponse instead. +type ItemItemCodespacesSecretsResponseable interface { + ItemItemCodespacesSecretsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_with_secret_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_with_secret_name_item_request_builder.go new file mode 100644 index 000000000..9ef718eb4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_codespaces_secrets_with_secret_name_item_request_builder.go @@ -0,0 +1,110 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\codespaces\secrets\{secret_name} +type ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCodespacesSecretsWithSecret_nameItemRequestBuilderInternal instantiates a new ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemItemCodespacesSecretsWithSecret_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder) { + m := &ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/codespaces/secrets/{secret_name}", pathParameters), + } + return m +} +// NewItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder instantiates a new ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodespacesSecretsWithSecret_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a development environment secret in a repository using the secret name.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/repository-secrets#delete-a-repository-secret +func (m *ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a single repository development environment secret without revealing its encrypted value.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a RepoCodespacesSecretable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-secret +func (m *ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepoCodespacesSecretable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepoCodespacesSecretFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepoCodespacesSecretable), nil +} +// Put creates or updates a repository development environment secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/repository-secrets#create-or-update-a-repository-secret +func (m *ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder) Put(ctx context.Context, body ItemItemCodespacesSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToDeleteRequestInformation deletes a development environment secret in a repository using the secret name.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a single repository development environment secret without revealing its encrypted value.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation creates or updates a repository development environment secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemCodespacesSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder) { + return NewItemItemCodespacesSecretsWithSecret_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_collaborators_item_permission_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_collaborators_item_permission_request_builder.go new file mode 100644 index 000000000..cd37d1f08 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_collaborators_item_permission_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCollaboratorsItemPermissionRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\collaborators\{username}\permission +type ItemItemCollaboratorsItemPermissionRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCollaboratorsItemPermissionRequestBuilderInternal instantiates a new ItemItemCollaboratorsItemPermissionRequestBuilder and sets the default values. +func NewItemItemCollaboratorsItemPermissionRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCollaboratorsItemPermissionRequestBuilder) { + m := &ItemItemCollaboratorsItemPermissionRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/collaborators/{username}/permission", pathParameters), + } + return m +} +// NewItemItemCollaboratorsItemPermissionRequestBuilder instantiates a new ItemItemCollaboratorsItemPermissionRequestBuilder and sets the default values. +func NewItemItemCollaboratorsItemPermissionRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCollaboratorsItemPermissionRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCollaboratorsItemPermissionRequestBuilderInternal(urlParams, requestAdapter) +} +// Get checks the repository permission of a collaborator. The possible repositorypermissions are `admin`, `write`, `read`, and `none`.*Note*: The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the`maintain` role is mapped to `write` and the `triage` role is mapped to `read`. To determine the role assigned to thecollaborator, see the `role_name` attribute, which will provide the full role name, including custom roles. The`permissions` hash can also be used to determine which base level of access the collaborator has to the repository. +// returns a RepositoryCollaboratorPermissionable 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/collaborators/collaborators#get-repository-permissions-for-a-user +func (m *ItemItemCollaboratorsItemPermissionRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryCollaboratorPermissionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryCollaboratorPermissionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryCollaboratorPermissionable), nil +} +// ToGetRequestInformation checks the repository permission of a collaborator. The possible repositorypermissions are `admin`, `write`, `read`, and `none`.*Note*: The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the`maintain` role is mapped to `write` and the `triage` role is mapped to `read`. To determine the role assigned to thecollaborator, see the `role_name` attribute, which will provide the full role name, including custom roles. The`permissions` hash can also be used to determine which base level of access the collaborator has to the repository. +// returns a *RequestInformation when successful +func (m *ItemItemCollaboratorsItemPermissionRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCollaboratorsItemPermissionRequestBuilder when successful +func (m *ItemItemCollaboratorsItemPermissionRequestBuilder) WithUrl(rawUrl string)(*ItemItemCollaboratorsItemPermissionRequestBuilder) { + return NewItemItemCollaboratorsItemPermissionRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_collaborators_item_with_username_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_collaborators_item_with_username_put_request_body.go new file mode 100644 index 000000000..b2e9f1d5b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_collaborators_item_with_username_put_request_body.go @@ -0,0 +1,82 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCollaboratorsItemWithUsernamePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The permission to grant the collaborator. **Only valid on organization-owned repositories.** We accept the following permissions to be set: `pull`, `triage`, `push`, `maintain`, `admin` and you can also specify a custom repository role name, if the owning organization has defined any. + permission *string +} +// NewItemItemCollaboratorsItemWithUsernamePutRequestBody instantiates a new ItemItemCollaboratorsItemWithUsernamePutRequestBody and sets the default values. +func NewItemItemCollaboratorsItemWithUsernamePutRequestBody()(*ItemItemCollaboratorsItemWithUsernamePutRequestBody) { + m := &ItemItemCollaboratorsItemWithUsernamePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + permissionValue := "push" + m.SetPermission(&permissionValue) + return m +} +// CreateItemItemCollaboratorsItemWithUsernamePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCollaboratorsItemWithUsernamePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCollaboratorsItemWithUsernamePutRequestBody(), 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 *ItemItemCollaboratorsItemWithUsernamePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCollaboratorsItemWithUsernamePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + return res +} +// GetPermission gets the permission property value. The permission to grant the collaborator. **Only valid on organization-owned repositories.** We accept the following permissions to be set: `pull`, `triage`, `push`, `maintain`, `admin` and you can also specify a custom repository role name, if the owning organization has defined any. +// returns a *string when successful +func (m *ItemItemCollaboratorsItemWithUsernamePutRequestBody) GetPermission()(*string) { + return m.permission +} +// Serialize serializes information the current object +func (m *ItemItemCollaboratorsItemWithUsernamePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("permission", m.GetPermission()) + 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 *ItemItemCollaboratorsItemWithUsernamePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPermission sets the permission property value. The permission to grant the collaborator. **Only valid on organization-owned repositories.** We accept the following permissions to be set: `pull`, `triage`, `push`, `maintain`, `admin` and you can also specify a custom repository role name, if the owning organization has defined any. +func (m *ItemItemCollaboratorsItemWithUsernamePutRequestBody) SetPermission(value *string)() { + m.permission = value +} +type ItemItemCollaboratorsItemWithUsernamePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPermission()(*string) + SetPermission(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_collaborators_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_collaborators_request_builder.go new file mode 100644 index 000000000..79fafb223 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_collaborators_request_builder.go @@ -0,0 +1,88 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + ief3bd7d40cba4706c2c0a30c6789d312e44d4a4ae592e9c24c47ec933ab6cd48 "github.com/octokit/go-sdk/pkg/github/repos/item/item/collaborators" +) + +// ItemItemCollaboratorsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\collaborators +type ItemItemCollaboratorsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCollaboratorsRequestBuilderGetQueryParameters for organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.Organization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint.Team members will include the members of child teams.The authenticated user must have push access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. +type ItemItemCollaboratorsRequestBuilderGetQueryParameters struct { + // Filter collaborators returned by their affiliation. `outside` means all outside collaborators of an organization-owned repository. `direct` means all collaborators with permissions to an organization-owned repository, regardless of organization membership status. `all` means all collaborators the authenticated user can see. + Affiliation *ief3bd7d40cba4706c2c0a30c6789d312e44d4a4ae592e9c24c47ec933ab6cd48.GetAffiliationQueryParameterType `uriparametername:"affiliation"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Filter collaborators by the permissions they have on the repository. If not specified, all collaborators will be returned. + Permission *ief3bd7d40cba4706c2c0a30c6789d312e44d4a4ae592e9c24c47ec933ab6cd48.GetPermissionQueryParameterType `uriparametername:"permission"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.collaborators.item collection +// returns a *ItemItemCollaboratorsWithUsernameItemRequestBuilder when successful +func (m *ItemItemCollaboratorsRequestBuilder) ByUsername(username string)(*ItemItemCollaboratorsWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemItemCollaboratorsWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCollaboratorsRequestBuilderInternal instantiates a new ItemItemCollaboratorsRequestBuilder and sets the default values. +func NewItemItemCollaboratorsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCollaboratorsRequestBuilder) { + m := &ItemItemCollaboratorsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/collaborators{?affiliation*,page*,per_page*,permission*}", pathParameters), + } + return m +} +// NewItemItemCollaboratorsRequestBuilder instantiates a new ItemItemCollaboratorsRequestBuilder and sets the default values. +func NewItemItemCollaboratorsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCollaboratorsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCollaboratorsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get for organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.Organization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint.Team members will include the members of child teams.The authenticated user must have push access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. +// returns a []Collaboratorable 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/collaborators/collaborators#list-repository-collaborators +func (m *ItemItemCollaboratorsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCollaboratorsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Collaboratorable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCollaboratorFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Collaboratorable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Collaboratorable) + } + } + return val, nil +} +// ToGetRequestInformation for organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.Organization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint.Team members will include the members of child teams.The authenticated user must have push access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCollaboratorsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCollaboratorsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCollaboratorsRequestBuilder when successful +func (m *ItemItemCollaboratorsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCollaboratorsRequestBuilder) { + return NewItemItemCollaboratorsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_collaborators_with_username_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_collaborators_with_username_item_request_builder.go new file mode 100644 index 000000000..1a374bd81 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_collaborators_with_username_item_request_builder.go @@ -0,0 +1,123 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCollaboratorsWithUsernameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\collaborators\{username} +type ItemItemCollaboratorsWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCollaboratorsWithUsernameItemRequestBuilderInternal instantiates a new ItemItemCollaboratorsWithUsernameItemRequestBuilder and sets the default values. +func NewItemItemCollaboratorsWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCollaboratorsWithUsernameItemRequestBuilder) { + m := &ItemItemCollaboratorsWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/collaborators/{username}", pathParameters), + } + return m +} +// NewItemItemCollaboratorsWithUsernameItemRequestBuilder instantiates a new ItemItemCollaboratorsWithUsernameItemRequestBuilder and sets the default values. +func NewItemItemCollaboratorsWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCollaboratorsWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCollaboratorsWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a collaborator from a repository.To use this endpoint, the authenticated user must either be an administrator of the repository or target themselves for removal.This endpoint also:- Cancels any outstanding invitations- Unasigns the user from any issues- Removes access to organization projects if the user is not an organization member and is not a collaborator on any other organization repositories.- Unstars the repository- Updates access permissions to packagesRemoving a user as a collaborator has the following effects on forks: - If the user had access to a fork through their membership to this repository, the user will also be removed from the fork. - If the user had their own fork of the repository, the fork will be deleted. - If the user still has read access to the repository, open pull requests by this user from a fork will be denied.**Note**: A user can still have access to the repository through organization permissions like base repository permissions.Although the API responds immediately, the additional permission updates might take some extra time to complete in the background.For more information on fork permissions, see "[About permissions and visibility of forks](https://docs.github.com/pull-requests/collaborating-with-pull-requests/working-with-forks/about-permissions-and-visibility-of-forks)". +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator +func (m *ItemItemCollaboratorsWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get for organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.Team members will include the members of child teams.The authenticated user must have push access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator +func (m *ItemItemCollaboratorsWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Permission the permission property +// returns a *ItemItemCollaboratorsItemPermissionRequestBuilder when successful +func (m *ItemItemCollaboratorsWithUsernameItemRequestBuilder) Permission()(*ItemItemCollaboratorsItemPermissionRequestBuilder) { + return NewItemItemCollaboratorsItemPermissionRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Put this endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."Adding an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)."For more information on permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the permission being given must be equal to or higher than the org base permission. Otherwise, the request will fail with:```Cannot assign {member} permission of {role name}```Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)."The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [API](https://docs.github.com/rest/collaborators/invitations).**Updating an existing collaborator's permission level**The endpoint can also be used to change the permissions of an existing collaborator without first removing and re-adding the collaborator. To change the permissions, use the same endpoint and pass a different `permission` parameter. The response will be a `204`, with no other indication that the permission level changed.**Rate limits**You are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository. +// returns a RepositoryInvitationable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator +func (m *ItemItemCollaboratorsWithUsernameItemRequestBuilder) Put(ctx context.Context, body ItemItemCollaboratorsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryInvitationable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryInvitationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryInvitationable), nil +} +// ToDeleteRequestInformation removes a collaborator from a repository.To use this endpoint, the authenticated user must either be an administrator of the repository or target themselves for removal.This endpoint also:- Cancels any outstanding invitations- Unasigns the user from any issues- Removes access to organization projects if the user is not an organization member and is not a collaborator on any other organization repositories.- Unstars the repository- Updates access permissions to packagesRemoving a user as a collaborator has the following effects on forks: - If the user had access to a fork through their membership to this repository, the user will also be removed from the fork. - If the user had their own fork of the repository, the fork will be deleted. - If the user still has read access to the repository, open pull requests by this user from a fork will be denied.**Note**: A user can still have access to the repository through organization permissions like base repository permissions.Although the API responds immediately, the additional permission updates might take some extra time to complete in the background.For more information on fork permissions, see "[About permissions and visibility of forks](https://docs.github.com/pull-requests/collaborating-with-pull-requests/working-with-forks/about-permissions-and-visibility-of-forks)". +// returns a *RequestInformation when successful +func (m *ItemItemCollaboratorsWithUsernameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation for organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.Team members will include the members of child teams.The authenticated user must have push access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCollaboratorsWithUsernameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToPutRequestInformation this endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."Adding an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)."For more information on permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the permission being given must be equal to or higher than the org base permission. Otherwise, the request will fail with:```Cannot assign {member} permission of {role name}```Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)."The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [API](https://docs.github.com/rest/collaborators/invitations).**Updating an existing collaborator's permission level**The endpoint can also be used to change the permissions of an existing collaborator without first removing and re-adding the collaborator. To change the permissions, use the same endpoint and pass a different `permission` parameter. The response will be a `204`, with no other indication that the permission level changed.**Rate limits**You are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository. +// returns a *RequestInformation when successful +func (m *ItemItemCollaboratorsWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemCollaboratorsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCollaboratorsWithUsernameItemRequestBuilder when successful +func (m *ItemItemCollaboratorsWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCollaboratorsWithUsernameItemRequestBuilder) { + return NewItemItemCollaboratorsWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_item_reactions_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_item_reactions_post_request_body.go new file mode 100644 index 000000000..be6052cb0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCommentsItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemCommentsItemReactionsPostRequestBody instantiates a new ItemItemCommentsItemReactionsPostRequestBody and sets the default values. +func NewItemItemCommentsItemReactionsPostRequestBody()(*ItemItemCommentsItemReactionsPostRequestBody) { + m := &ItemItemCommentsItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCommentsItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCommentsItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCommentsItemReactionsPostRequestBody(), 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 *ItemItemCommentsItemReactionsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCommentsItemReactionsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemCommentsItemReactionsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemCommentsItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemCommentsItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_item_reactions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_item_reactions_request_builder.go new file mode 100644 index 000000000..09154f950 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_item_reactions_request_builder.go @@ -0,0 +1,120 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + ie55802deee9fe37434e0511ab82c6a68c6bd8afe7d7998398c82c7391430d662 "github.com/octokit/go-sdk/pkg/github/repos/item/item/comments/item/reactions" +) + +// ItemItemCommentsItemReactionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\comments\{comment_id}\reactions +type ItemItemCommentsItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommentsItemReactionsRequestBuilderGetQueryParameters list the reactions to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). +type ItemItemCommentsItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a commit comment. + Content *ie55802deee9fe37434e0511ab82c6a68c6bd8afe7d7998398c82c7391430d662.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByReaction_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.comments.item.reactions.item collection +// returns a *ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemCommentsItemReactionsRequestBuilder) ByReaction_id(reaction_id int32)(*ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["reaction_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(reaction_id), 10) + return NewItemItemCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCommentsItemReactionsRequestBuilderInternal instantiates a new ItemItemCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemItemCommentsItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommentsItemReactionsRequestBuilder) { + m := &ItemItemCommentsItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/comments/{comment_id}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommentsItemReactionsRequestBuilder instantiates a new ItemItemCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemItemCommentsItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommentsItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommentsItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the reactions to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). +// returns a []Reactionable 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/reactions/reactions#list-reactions-for-a-commit-comment +func (m *ItemItemCommentsItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommentsItemReactionsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable) + } + } + return val, nil +} +// Post create a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). A response with an HTTP `200` status means that you already added the reaction type to this commit comment. +// returns a Reactionable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment +func (m *ItemItemCommentsItemReactionsRequestBuilder) Post(ctx context.Context, body ItemItemCommentsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable), nil +} +// ToGetRequestInformation list the reactions to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). +// returns a *RequestInformation when successful +func (m *ItemItemCommentsItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommentsItemReactionsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation create a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). A response with an HTTP `200` status means that you already added the reaction type to this commit comment. +// returns a *RequestInformation when successful +func (m *ItemItemCommentsItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemCommentsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCommentsItemReactionsRequestBuilder when successful +func (m *ItemItemCommentsItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommentsItemReactionsRequestBuilder) { + return NewItemItemCommentsItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_item_reactions_with_reaction_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_item_reactions_with_reaction_item_request_builder.go new file mode 100644 index 000000000..4e5cb1971 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_item_reactions_with_reaction_item_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\comments\{comment_id}\reactions\{reaction_id} +type ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCommentsItemReactionsWithReaction_ItemRequestBuilderInternal instantiates a new ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder) { + m := &ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/comments/{comment_id}/reactions/{reaction_id}", pathParameters), + } + return m +} +// NewItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder instantiates a new ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`.Delete a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction +func (m *ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`.Delete a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). +// returns a *RequestInformation when successful +func (m *ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder) { + return NewItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_item_with_comment_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_item_with_comment_patch_request_body.go new file mode 100644 index 000000000..b4fd24088 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_item_with_comment_patch_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCommentsItemWithComment_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The contents of the comment + body *string +} +// NewItemItemCommentsItemWithComment_PatchRequestBody instantiates a new ItemItemCommentsItemWithComment_PatchRequestBody and sets the default values. +func NewItemItemCommentsItemWithComment_PatchRequestBody()(*ItemItemCommentsItemWithComment_PatchRequestBody) { + m := &ItemItemCommentsItemWithComment_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCommentsItemWithComment_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCommentsItemWithComment_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCommentsItemWithComment_PatchRequestBody(), 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 *ItemItemCommentsItemWithComment_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The contents of the comment +// returns a *string when successful +func (m *ItemItemCommentsItemWithComment_PatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCommentsItemWithComment_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemCommentsItemWithComment_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemItemCommentsItemWithComment_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The contents of the comment +func (m *ItemItemCommentsItemWithComment_PatchRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemItemCommentsItemWithComment_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_request_builder.go new file mode 100644 index 000000000..b087422e1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_request_builder.go @@ -0,0 +1,78 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCommentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\comments +type ItemItemCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommentsRequestBuilderGetQueryParameters lists the commit comments for a specified repository. Comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemCommentsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByComment_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.comments.item collection +// returns a *ItemItemCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemItemCommentsRequestBuilder) ByComment_id(comment_id int32)(*ItemItemCommentsWithComment_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["comment_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(comment_id), 10) + return NewItemItemCommentsWithComment_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCommentsRequestBuilderInternal instantiates a new ItemItemCommentsRequestBuilder and sets the default values. +func NewItemItemCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommentsRequestBuilder) { + m := &ItemItemCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/comments{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommentsRequestBuilder instantiates a new ItemItemCommentsRequestBuilder and sets the default values. +func NewItemItemCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the commit comments for a specified repository. Comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []CommitCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository +func (m *ItemItemCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommentsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommitCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitCommentable) + } + } + return val, nil +} +// ToGetRequestInformation lists the commit comments for a specified repository. Comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommentsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCommentsRequestBuilder when successful +func (m *ItemItemCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommentsRequestBuilder) { + return NewItemItemCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_with_comment_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_with_comment_item_request_builder.go new file mode 100644 index 000000000..b7570647b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_comments_with_comment_item_request_builder.go @@ -0,0 +1,127 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCommentsWithComment_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\comments\{comment_id} +type ItemItemCommentsWithComment_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCommentsWithComment_ItemRequestBuilderInternal instantiates a new ItemItemCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemItemCommentsWithComment_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommentsWithComment_ItemRequestBuilder) { + m := &ItemItemCommentsWithComment_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/comments/{comment_id}", pathParameters), + } + return m +} +// NewItemItemCommentsWithComment_ItemRequestBuilder instantiates a new ItemItemCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemItemCommentsWithComment_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommentsWithComment_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommentsWithComment_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a commit comment +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/commits/comments#delete-a-commit-comment +func (m *ItemItemCommentsWithComment_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a specified commit comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a CommitCommentable 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/commits/comments#get-a-commit-comment +func (m *ItemItemCommentsWithComment_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommitCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitCommentable), nil +} +// Patch updates the contents of a specified commit comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a CommitCommentable 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/commits/comments#update-a-commit-comment +func (m *ItemItemCommentsWithComment_ItemRequestBuilder) Patch(ctx context.Context, body ItemItemCommentsItemWithComment_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitCommentable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommitCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitCommentable), nil +} +// Reactions the reactions property +// returns a *ItemItemCommentsItemReactionsRequestBuilder when successful +func (m *ItemItemCommentsWithComment_ItemRequestBuilder) Reactions()(*ItemItemCommentsItemReactionsRequestBuilder) { + return NewItemItemCommentsItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// returns a *RequestInformation when successful +func (m *ItemItemCommentsWithComment_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets a specified commit comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemCommentsWithComment_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates the contents of a specified commit comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemCommentsWithComment_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemCommentsItemWithComment_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemItemCommentsWithComment_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommentsWithComment_ItemRequestBuilder) { + return NewItemItemCommentsWithComment_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_commit_sha_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_commit_sha_item_request_builder.go new file mode 100644 index 000000000..0f3a597a4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_commit_sha_item_request_builder.go @@ -0,0 +1,111 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCommitsCommit_shaItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits\{commit_sha-id} +type ItemItemCommitsCommit_shaItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsCommit_shaItemRequestBuilderGetQueryParameters returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint.**Note:** If there are more than 300 files in the commit diff and the default JSON media type is requested, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." Pagination query parameters are not supported for these media types.- **`application/vnd.github.diff`**: Returns the diff of the commit. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.sha`**: Returns the commit's SHA-1 hash. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +type ItemItemCommitsCommit_shaItemRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// BranchesWhereHead the branchesWhereHead property +// returns a *ItemItemCommitsItemBranchesWhereHeadRequestBuilder when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) BranchesWhereHead()(*ItemItemCommitsItemBranchesWhereHeadRequestBuilder) { + return NewItemItemCommitsItemBranchesWhereHeadRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CheckRuns the checkRuns property +// returns a *ItemItemCommitsItemCheckRunsRequestBuilder when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) CheckRuns()(*ItemItemCommitsItemCheckRunsRequestBuilder) { + return NewItemItemCommitsItemCheckRunsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CheckSuites the checkSuites property +// returns a *ItemItemCommitsItemCheckSuitesRequestBuilder when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) CheckSuites()(*ItemItemCommitsItemCheckSuitesRequestBuilder) { + return NewItemItemCommitsItemCheckSuitesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +// returns a *ItemItemCommitsItemCommentsRequestBuilder when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) Comments()(*ItemItemCommitsItemCommentsRequestBuilder) { + return NewItemItemCommitsItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCommitsCommit_shaItemRequestBuilderInternal instantiates a new ItemItemCommitsCommit_shaItemRequestBuilder and sets the default values. +func NewItemItemCommitsCommit_shaItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsCommit_shaItemRequestBuilder) { + m := &ItemItemCommitsCommit_shaItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits/{commit_sha%2Did}{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommitsCommit_shaItemRequestBuilder instantiates a new ItemItemCommitsCommit_shaItemRequestBuilder and sets the default values. +func NewItemItemCommitsCommit_shaItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsCommit_shaItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsCommit_shaItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint.**Note:** If there are more than 300 files in the commit diff and the default JSON media type is requested, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." Pagination query parameters are not supported for these media types.- **`application/vnd.github.diff`**: Returns the diff of the commit. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.sha`**: Returns the commit's SHA-1 hash. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a Commitable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a BasicError error when the service returns a 500 status code +// returns a Commit503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/commits/commits#get-a-commit +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsCommit_shaItemRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Commitable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommit503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Commitable), nil +} +// Pulls the pulls property +// returns a *ItemItemCommitsItemPullsRequestBuilder when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) Pulls()(*ItemItemCommitsItemPullsRequestBuilder) { + return NewItemItemCommitsItemPullsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Status the status property +// returns a *ItemItemCommitsItemStatusRequestBuilder when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) Status()(*ItemItemCommitsItemStatusRequestBuilder) { + return NewItemItemCommitsItemStatusRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Statuses the statuses property +// returns a *ItemItemCommitsItemStatusesRequestBuilder when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) Statuses()(*ItemItemCommitsItemStatusesRequestBuilder) { + return NewItemItemCommitsItemStatusesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint.**Note:** If there are more than 300 files in the commit diff and the default JSON media type is requested, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." Pagination query parameters are not supported for these media types.- **`application/vnd.github.diff`**: Returns the diff of the commit. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.sha`**: Returns the commit's SHA-1 hash. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a *RequestInformation when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsCommit_shaItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCommitsCommit_shaItemRequestBuilder when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsCommit_shaItemRequestBuilder) { + return NewItemItemCommitsCommit_shaItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_commits_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_commits_item_request_builder.go new file mode 100644 index 000000000..a99752ec7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_commits_item_request_builder.go @@ -0,0 +1,109 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCommitsCommitsItemRequestBuilder builds and executes requests for operations under \repos\{repos-id}\{Owner-id}\commits\{commits-id} +type ItemItemCommitsCommitsItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsCommitsItemRequestBuilderGetQueryParameters returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint.**Note:** If there are more than 300 files in the commit diff and the default JSON media type is requested, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." Pagination query parameters are not supported for these media types.- **`application/vnd.github.diff`**: Returns the diff of the commit. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.sha`**: Returns the commit's SHA-1 hash. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +type ItemItemCommitsCommitsItemRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// BranchesWhereHead the branchesWhereHead property +// returns a *ItemItemCommitsItemBranchesWhereHeadRequestBuilder when successful +func (m *ItemItemCommitsCommitsItemRequestBuilder) BranchesWhereHead()(*ItemItemCommitsItemBranchesWhereHeadRequestBuilder) { + return NewItemItemCommitsItemBranchesWhereHeadRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CheckRuns the checkRuns property +// returns a *ItemItemCommitsItemCheckRunsRequestBuilder when successful +func (m *ItemItemCommitsCommitsItemRequestBuilder) CheckRuns()(*ItemItemCommitsItemCheckRunsRequestBuilder) { + return NewItemItemCommitsItemCheckRunsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CheckSuites the checkSuites property +// returns a *ItemItemCommitsItemCheckSuitesRequestBuilder when successful +func (m *ItemItemCommitsCommitsItemRequestBuilder) CheckSuites()(*ItemItemCommitsItemCheckSuitesRequestBuilder) { + return NewItemItemCommitsItemCheckSuitesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +// returns a *ItemItemCommitsItemCommentsRequestBuilder when successful +func (m *ItemItemCommitsCommitsItemRequestBuilder) Comments()(*ItemItemCommitsItemCommentsRequestBuilder) { + return NewItemItemCommitsItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCommitsCommitsItemRequestBuilderInternal instantiates a new ItemItemCommitsCommitsItemRequestBuilder and sets the default values. +func NewItemItemCommitsCommitsItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsCommitsItemRequestBuilder) { + m := &ItemItemCommitsCommitsItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{repos%2Did}/{Owner%2Did}/commits/{commits%2Did}{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommitsCommitsItemRequestBuilder instantiates a new ItemItemCommitsCommitsItemRequestBuilder and sets the default values. +func NewItemItemCommitsCommitsItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsCommitsItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsCommitsItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint.**Note:** If there are more than 300 files in the commit diff and the default JSON media type is requested, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." Pagination query parameters are not supported for these media types.- **`application/vnd.github.diff`**: Returns the diff of the commit. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.sha`**: Returns the commit's SHA-1 hash. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a Commitable 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 +// returns a BasicError error when the service returns a 500 status code +// returns a Commit503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/commits/commits#get-a-commit +func (m *ItemItemCommitsCommitsItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsCommitsItemRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Commitable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommit503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Commitable), nil +} +// Pulls the pulls property +// returns a *ItemItemCommitsItemPullsRequestBuilder when successful +func (m *ItemItemCommitsCommitsItemRequestBuilder) Pulls()(*ItemItemCommitsItemPullsRequestBuilder) { + return NewItemItemCommitsItemPullsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Status the status property +// returns a *ItemItemCommitsItemStatusRequestBuilder when successful +func (m *ItemItemCommitsCommitsItemRequestBuilder) Status()(*ItemItemCommitsItemStatusRequestBuilder) { + return NewItemItemCommitsItemStatusRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Statuses the statuses property +// returns a *ItemItemCommitsItemStatusesRequestBuilder when successful +func (m *ItemItemCommitsCommitsItemRequestBuilder) Statuses()(*ItemItemCommitsItemStatusesRequestBuilder) { + return NewItemItemCommitsItemStatusesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint.**Note:** If there are more than 300 files in the commit diff and the default JSON media type is requested, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." Pagination query parameters are not supported for these media types.- **`application/vnd.github.diff`**: Returns the diff of the commit. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.sha`**: Returns the commit's SHA-1 hash. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a *RequestInformation when successful +func (m *ItemItemCommitsCommitsItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsCommitsItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCommitsCommitsItemRequestBuilder when successful +func (m *ItemItemCommitsCommitsItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsCommitsItemRequestBuilder) { + return NewItemItemCommitsCommitsItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_branches_where_head_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_branches_where_head_request_builder.go new file mode 100644 index 000000000..f3789f72a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_branches_where_head_request_builder.go @@ -0,0 +1,66 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCommitsItemBranchesWhereHeadRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits\{commit_sha-id}\branches-where-head +type ItemItemCommitsItemBranchesWhereHeadRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCommitsItemBranchesWhereHeadRequestBuilderInternal instantiates a new ItemItemCommitsItemBranchesWhereHeadRequestBuilder and sets the default values. +func NewItemItemCommitsItemBranchesWhereHeadRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemBranchesWhereHeadRequestBuilder) { + m := &ItemItemCommitsItemBranchesWhereHeadRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits/{commit_sha%2Did}/branches-where-head", pathParameters), + } + return m +} +// NewItemItemCommitsItemBranchesWhereHeadRequestBuilder instantiates a new ItemItemCommitsItemBranchesWhereHeadRequestBuilder and sets the default values. +func NewItemItemCommitsItemBranchesWhereHeadRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemBranchesWhereHeadRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsItemBranchesWhereHeadRequestBuilderInternal(urlParams, requestAdapter) +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. +// returns a []BranchShortable when successful +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit +func (m *ItemItemCommitsItemBranchesWhereHeadRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BranchShortable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBranchShortFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BranchShortable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BranchShortable) + } + } + return val, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. +// returns a *RequestInformation when successful +func (m *ItemItemCommitsItemBranchesWhereHeadRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCommitsItemBranchesWhereHeadRequestBuilder when successful +func (m *ItemItemCommitsItemBranchesWhereHeadRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsItemBranchesWhereHeadRequestBuilder) { + return NewItemItemCommitsItemBranchesWhereHeadRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_runs_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_runs_get_response.go new file mode 100644 index 000000000..7920b4927 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_runs_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemCommitsItemCheckRunsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The check_runs property + check_runs []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable + // The total_count property + total_count *int32 +} +// NewItemItemCommitsItemCheckRunsGetResponse instantiates a new ItemItemCommitsItemCheckRunsGetResponse and sets the default values. +func NewItemItemCommitsItemCheckRunsGetResponse()(*ItemItemCommitsItemCheckRunsGetResponse) { + m := &ItemItemCommitsItemCheckRunsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCommitsItemCheckRunsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCommitsItemCheckRunsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCommitsItemCheckRunsGetResponse(), 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 *ItemItemCommitsItemCheckRunsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCheckRuns gets the check_runs property value. The check_runs property +// returns a []CheckRunable when successful +func (m *ItemItemCommitsItemCheckRunsGetResponse) GetCheckRuns()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable) { + return m.check_runs +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCommitsItemCheckRunsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["check_runs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCheckRunFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable) + } + } + m.SetCheckRuns(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemCommitsItemCheckRunsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemCommitsItemCheckRunsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCheckRuns() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCheckRuns())) + for i, v := range m.GetCheckRuns() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("check_runs", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemCommitsItemCheckRunsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCheckRuns sets the check_runs property value. The check_runs property +func (m *ItemItemCommitsItemCheckRunsGetResponse) SetCheckRuns(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable)() { + m.check_runs = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemCommitsItemCheckRunsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemCommitsItemCheckRunsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCheckRuns()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable) + GetTotalCount()(*int32) + SetCheckRuns(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckRunable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_runs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_runs_request_builder.go new file mode 100644 index 000000000..d6bc4670a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_runs_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ifb385791f8cac3dd5aa968a1ebb84b55fed8efbc21a8f661021ab21ba709ef32 "github.com/octokit/go-sdk/pkg/github/repos/item/item/commits/item/checkruns" +) + +// ItemItemCommitsItemCheckRunsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits\{commit_sha-id}\check-runs +type ItemItemCommitsItemCheckRunsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsItemCheckRunsRequestBuilderGetQueryParameters lists check runs for a commit ref. The `ref` can be a SHA, branch name, or a tag name.**Note:** The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.If there are more than 1000 check suites on a single git reference, this endpoint will limit check runs to the 1000 most recent check suites. To iterate over all possible check runs, use the [List check suites for a Git reference](https://docs.github.com/rest/reference/checks#list-check-suites-for-a-git-reference) endpoint and provide the `check_suite_id` parameter to the [List check runs in a check suite](https://docs.github.com/rest/reference/checks#list-check-runs-in-a-check-suite) endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +type ItemItemCommitsItemCheckRunsRequestBuilderGetQueryParameters struct { + App_id *int32 `uriparametername:"app_id"` + // Returns check runs with the specified `name`. + Check_name *string `uriparametername:"check_name"` + // Filters check runs by their `completed_at` timestamp. `latest` returns the most recent check runs. + Filter *ifb385791f8cac3dd5aa968a1ebb84b55fed8efbc21a8f661021ab21ba709ef32.GetFilterQueryParameterType `uriparametername:"filter"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Returns check runs with the specified `status`. + Status *ifb385791f8cac3dd5aa968a1ebb84b55fed8efbc21a8f661021ab21ba709ef32.GetStatusQueryParameterType `uriparametername:"status"` +} +// NewItemItemCommitsItemCheckRunsRequestBuilderInternal instantiates a new ItemItemCommitsItemCheckRunsRequestBuilder and sets the default values. +func NewItemItemCommitsItemCheckRunsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemCheckRunsRequestBuilder) { + m := &ItemItemCommitsItemCheckRunsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits/{commit_sha%2Did}/check-runs{?app_id*,check_name*,filter*,page*,per_page*,status*}", pathParameters), + } + return m +} +// NewItemItemCommitsItemCheckRunsRequestBuilder instantiates a new ItemItemCommitsItemCheckRunsRequestBuilder and sets the default values. +func NewItemItemCommitsItemCheckRunsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemCheckRunsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsItemCheckRunsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists check runs for a commit ref. The `ref` can be a SHA, branch name, or a tag name.**Note:** The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.If there are more than 1000 check suites on a single git reference, this endpoint will limit check runs to the 1000 most recent check suites. To iterate over all possible check runs, use the [List check suites for a Git reference](https://docs.github.com/rest/reference/checks#list-check-suites-for-a-git-reference) endpoint and provide the `check_suite_id` parameter to the [List check runs in a check suite](https://docs.github.com/rest/reference/checks#list-check-runs-in-a-check-suite) endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a ItemItemCommitsItemCheckRunsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference +func (m *ItemItemCommitsItemCheckRunsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemCheckRunsRequestBuilderGetQueryParameters])(ItemItemCommitsItemCheckRunsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemCommitsItemCheckRunsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemCommitsItemCheckRunsGetResponseable), nil +} +// ToGetRequestInformation lists check runs for a commit ref. The `ref` can be a SHA, branch name, or a tag name.**Note:** The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.If there are more than 1000 check suites on a single git reference, this endpoint will limit check runs to the 1000 most recent check suites. To iterate over all possible check runs, use the [List check suites for a Git reference](https://docs.github.com/rest/reference/checks#list-check-suites-for-a-git-reference) endpoint and provide the `check_suite_id` parameter to the [List check runs in a check suite](https://docs.github.com/rest/reference/checks#list-check-runs-in-a-check-suite) endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemCommitsItemCheckRunsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemCheckRunsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCommitsItemCheckRunsRequestBuilder when successful +func (m *ItemItemCommitsItemCheckRunsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsItemCheckRunsRequestBuilder) { + return NewItemItemCommitsItemCheckRunsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_runs_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_runs_response.go new file mode 100644 index 000000000..f501d5f77 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_runs_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemCommitsItemCheckRunsResponse +// Deprecated: This class is obsolete. Use checkRunsGetResponse instead. +type ItemItemCommitsItemCheckRunsResponse struct { + ItemItemCommitsItemCheckRunsGetResponse +} +// NewItemItemCommitsItemCheckRunsResponse instantiates a new ItemItemCommitsItemCheckRunsResponse and sets the default values. +func NewItemItemCommitsItemCheckRunsResponse()(*ItemItemCommitsItemCheckRunsResponse) { + m := &ItemItemCommitsItemCheckRunsResponse{ + ItemItemCommitsItemCheckRunsGetResponse: *NewItemItemCommitsItemCheckRunsGetResponse(), + } + return m +} +// CreateItemItemCommitsItemCheckRunsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemCommitsItemCheckRunsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCommitsItemCheckRunsResponse(), nil +} +// ItemItemCommitsItemCheckRunsResponseable +// Deprecated: This class is obsolete. Use checkRunsGetResponse instead. +type ItemItemCommitsItemCheckRunsResponseable interface { + ItemItemCommitsItemCheckRunsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_suites_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_suites_get_response.go new file mode 100644 index 000000000..de34100d7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_suites_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemCommitsItemCheckSuitesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The check_suites property + check_suites []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckSuiteable + // The total_count property + total_count *int32 +} +// NewItemItemCommitsItemCheckSuitesGetResponse instantiates a new ItemItemCommitsItemCheckSuitesGetResponse and sets the default values. +func NewItemItemCommitsItemCheckSuitesGetResponse()(*ItemItemCommitsItemCheckSuitesGetResponse) { + m := &ItemItemCommitsItemCheckSuitesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCommitsItemCheckSuitesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCommitsItemCheckSuitesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCommitsItemCheckSuitesGetResponse(), 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 *ItemItemCommitsItemCheckSuitesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCheckSuites gets the check_suites property value. The check_suites property +// returns a []CheckSuiteable when successful +func (m *ItemItemCommitsItemCheckSuitesGetResponse) GetCheckSuites()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckSuiteable) { + return m.check_suites +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCommitsItemCheckSuitesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["check_suites"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCheckSuiteFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckSuiteable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckSuiteable) + } + } + m.SetCheckSuites(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemCommitsItemCheckSuitesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemCommitsItemCheckSuitesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCheckSuites() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCheckSuites())) + for i, v := range m.GetCheckSuites() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("check_suites", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemCommitsItemCheckSuitesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCheckSuites sets the check_suites property value. The check_suites property +func (m *ItemItemCommitsItemCheckSuitesGetResponse) SetCheckSuites(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckSuiteable)() { + m.check_suites = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemCommitsItemCheckSuitesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemCommitsItemCheckSuitesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCheckSuites()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckSuiteable) + GetTotalCount()(*int32) + SetCheckSuites(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CheckSuiteable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_suites_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_suites_request_builder.go new file mode 100644 index 000000000..f30eee3e9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_suites_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemCommitsItemCheckSuitesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits\{commit_sha-id}\check-suites +type ItemItemCommitsItemCheckSuitesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsItemCheckSuitesRequestBuilderGetQueryParameters lists check suites for a commit `ref`. The `ref` can be a SHA, branch name, or a tag name.**Note:** The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +type ItemItemCommitsItemCheckSuitesRequestBuilderGetQueryParameters struct { + // Filters check suites by GitHub App `id`. + App_id *int32 `uriparametername:"app_id"` + // Returns check runs with the specified `name`. + Check_name *string `uriparametername:"check_name"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemCommitsItemCheckSuitesRequestBuilderInternal instantiates a new ItemItemCommitsItemCheckSuitesRequestBuilder and sets the default values. +func NewItemItemCommitsItemCheckSuitesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemCheckSuitesRequestBuilder) { + m := &ItemItemCommitsItemCheckSuitesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits/{commit_sha%2Did}/check-suites{?app_id*,check_name*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommitsItemCheckSuitesRequestBuilder instantiates a new ItemItemCommitsItemCheckSuitesRequestBuilder and sets the default values. +func NewItemItemCommitsItemCheckSuitesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemCheckSuitesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsItemCheckSuitesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists check suites for a commit `ref`. The `ref` can be a SHA, branch name, or a tag name.**Note:** The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a ItemItemCommitsItemCheckSuitesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference +func (m *ItemItemCommitsItemCheckSuitesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemCheckSuitesRequestBuilderGetQueryParameters])(ItemItemCommitsItemCheckSuitesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemCommitsItemCheckSuitesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemCommitsItemCheckSuitesGetResponseable), nil +} +// ToGetRequestInformation lists check suites for a commit `ref`. The `ref` can be a SHA, branch name, or a tag name.**Note:** The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemCommitsItemCheckSuitesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemCheckSuitesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCommitsItemCheckSuitesRequestBuilder when successful +func (m *ItemItemCommitsItemCheckSuitesRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsItemCheckSuitesRequestBuilder) { + return NewItemItemCommitsItemCheckSuitesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_suites_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_suites_response.go new file mode 100644 index 000000000..e60241626 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_check_suites_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemCommitsItemCheckSuitesResponse +// Deprecated: This class is obsolete. Use checkSuitesGetResponse instead. +type ItemItemCommitsItemCheckSuitesResponse struct { + ItemItemCommitsItemCheckSuitesGetResponse +} +// NewItemItemCommitsItemCheckSuitesResponse instantiates a new ItemItemCommitsItemCheckSuitesResponse and sets the default values. +func NewItemItemCommitsItemCheckSuitesResponse()(*ItemItemCommitsItemCheckSuitesResponse) { + m := &ItemItemCommitsItemCheckSuitesResponse{ + ItemItemCommitsItemCheckSuitesGetResponse: *NewItemItemCommitsItemCheckSuitesGetResponse(), + } + return m +} +// CreateItemItemCommitsItemCheckSuitesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemCommitsItemCheckSuitesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCommitsItemCheckSuitesResponse(), nil +} +// ItemItemCommitsItemCheckSuitesResponseable +// Deprecated: This class is obsolete. Use checkSuitesGetResponse instead. +type ItemItemCommitsItemCheckSuitesResponseable interface { + ItemItemCommitsItemCheckSuitesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_comments_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_comments_post_request_body.go new file mode 100644 index 000000000..ed36957b0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_comments_post_request_body.go @@ -0,0 +1,167 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCommitsItemCommentsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The contents of the comment. + body *string + // **Deprecated**. Use **position** parameter instead. Line number in the file to comment on. + line *int32 + // Relative path of the file to comment on. + path *string + // Line index in the diff to comment on. + position *int32 +} +// NewItemItemCommitsItemCommentsPostRequestBody instantiates a new ItemItemCommitsItemCommentsPostRequestBody and sets the default values. +func NewItemItemCommitsItemCommentsPostRequestBody()(*ItemItemCommitsItemCommentsPostRequestBody) { + m := &ItemItemCommitsItemCommentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCommitsItemCommentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCommitsItemCommentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCommitsItemCommentsPostRequestBody(), 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 *ItemItemCommitsItemCommentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The contents of the comment. +// returns a *string when successful +func (m *ItemItemCommitsItemCommentsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCommitsItemCommentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLine(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["position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPosition(val) + } + return nil + } + return res +} +// GetLine gets the line property value. **Deprecated**. Use **position** parameter instead. Line number in the file to comment on. +// returns a *int32 when successful +func (m *ItemItemCommitsItemCommentsPostRequestBody) GetLine()(*int32) { + return m.line +} +// GetPath gets the path property value. Relative path of the file to comment on. +// returns a *string when successful +func (m *ItemItemCommitsItemCommentsPostRequestBody) GetPath()(*string) { + return m.path +} +// GetPosition gets the position property value. Line index in the diff to comment on. +// returns a *int32 when successful +func (m *ItemItemCommitsItemCommentsPostRequestBody) GetPosition()(*int32) { + return m.position +} +// Serialize serializes information the current object +func (m *ItemItemCommitsItemCommentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("line", m.GetLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("position", m.GetPosition()) + 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 *ItemItemCommitsItemCommentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The contents of the comment. +func (m *ItemItemCommitsItemCommentsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetLine sets the line property value. **Deprecated**. Use **position** parameter instead. Line number in the file to comment on. +func (m *ItemItemCommitsItemCommentsPostRequestBody) SetLine(value *int32)() { + m.line = value +} +// SetPath sets the path property value. Relative path of the file to comment on. +func (m *ItemItemCommitsItemCommentsPostRequestBody) SetPath(value *string)() { + m.path = value +} +// SetPosition sets the position property value. Line index in the diff to comment on. +func (m *ItemItemCommitsItemCommentsPostRequestBody) SetPosition(value *int32)() { + m.position = value +} +type ItemItemCommitsItemCommentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetLine()(*int32) + GetPath()(*string) + GetPosition()(*int32) + SetBody(value *string)() + SetLine(value *int32)() + SetPath(value *string)() + SetPosition(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_comments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_comments_request_builder.go new file mode 100644 index 000000000..eaf14794b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_comments_request_builder.go @@ -0,0 +1,104 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCommitsItemCommentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits\{commit_sha-id}\comments +type ItemItemCommitsItemCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsItemCommentsRequestBuilderGetQueryParameters lists the comments for a specified commit.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemCommitsItemCommentsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemCommitsItemCommentsRequestBuilderInternal instantiates a new ItemItemCommitsItemCommentsRequestBuilder and sets the default values. +func NewItemItemCommitsItemCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemCommentsRequestBuilder) { + m := &ItemItemCommitsItemCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits/{commit_sha%2Did}/comments{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommitsItemCommentsRequestBuilder instantiates a new ItemItemCommitsItemCommentsRequestBuilder and sets the default values. +func NewItemItemCommitsItemCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsItemCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the comments for a specified commit.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []CommitCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/commits/comments#list-commit-comments +func (m *ItemItemCommitsItemCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemCommentsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommitCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitCommentable) + } + } + return val, nil +} +// Post create a comment for a commit using its `:commit_sha`.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a CommitCommentable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/commits/comments#create-a-commit-comment +func (m *ItemItemCommitsItemCommentsRequestBuilder) Post(ctx context.Context, body ItemItemCommitsItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitCommentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommitCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitCommentable), nil +} +// ToGetRequestInformation lists the comments for a specified commit.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemCommitsItemCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemCommentsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation create a comment for a commit using its `:commit_sha`.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemCommitsItemCommentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemCommitsItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCommitsItemCommentsRequestBuilder when successful +func (m *ItemItemCommitsItemCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsItemCommentsRequestBuilder) { + return NewItemItemCommitsItemCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_pulls_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_pulls_request_builder.go new file mode 100644 index 000000000..470806584 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_pulls_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCommitsItemPullsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits\{commit_sha-id}\pulls +type ItemItemCommitsItemPullsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsItemPullsRequestBuilderGetQueryParameters lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, will only return open pull requests associated with the commit.To list the open or merged pull requests associated with a branch, you can set the `commit_sha` parameter to the branch name. +type ItemItemCommitsItemPullsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemCommitsItemPullsRequestBuilderInternal instantiates a new ItemItemCommitsItemPullsRequestBuilder and sets the default values. +func NewItemItemCommitsItemPullsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemPullsRequestBuilder) { + m := &ItemItemCommitsItemPullsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits/{commit_sha%2Did}/pulls{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommitsItemPullsRequestBuilder instantiates a new ItemItemCommitsItemPullsRequestBuilder and sets the default values. +func NewItemItemCommitsItemPullsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemPullsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsItemPullsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, will only return open pull requests associated with the commit.To list the open or merged pull requests associated with a branch, you can set the `commit_sha` parameter to the branch name. +// returns a []PullRequestSimpleable when successful +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit +func (m *ItemItemCommitsItemPullsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemPullsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestSimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestSimpleable) + } + } + return val, nil +} +// ToGetRequestInformation lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, will only return open pull requests associated with the commit.To list the open or merged pull requests associated with a branch, you can set the `commit_sha` parameter to the branch name. +// returns a *RequestInformation when successful +func (m *ItemItemCommitsItemPullsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemPullsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCommitsItemPullsRequestBuilder when successful +func (m *ItemItemCommitsItemPullsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsItemPullsRequestBuilder) { + return NewItemItemCommitsItemPullsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_status_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_status_request_builder.go new file mode 100644 index 000000000..8a7dd0946 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_status_request_builder.go @@ -0,0 +1,68 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCommitsItemStatusRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits\{commit_sha-id}\status +type ItemItemCommitsItemStatusRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsItemStatusRequestBuilderGetQueryParameters users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name.Additionally, a combined `state` is returned. The `state` is one of:* **failure** if any of the contexts report as `error` or `failure`* **pending** if there are no statuses or a context is `pending`* **success** if the latest status for all contexts is `success` +type ItemItemCommitsItemStatusRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemCommitsItemStatusRequestBuilderInternal instantiates a new ItemItemCommitsItemStatusRequestBuilder and sets the default values. +func NewItemItemCommitsItemStatusRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemStatusRequestBuilder) { + m := &ItemItemCommitsItemStatusRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits/{commit_sha%2Did}/status{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommitsItemStatusRequestBuilder instantiates a new ItemItemCommitsItemStatusRequestBuilder and sets the default values. +func NewItemItemCommitsItemStatusRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemStatusRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsItemStatusRequestBuilderInternal(urlParams, requestAdapter) +} +// Get users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name.Additionally, a combined `state` is returned. The `state` is one of:* **failure** if any of the contexts report as `error` or `failure`* **pending** if there are no statuses or a context is `pending`* **success** if the latest status for all contexts is `success` +// returns a CombinedCommitStatusable 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/commits/statuses#get-the-combined-status-for-a-specific-reference +func (m *ItemItemCommitsItemStatusRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemStatusRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CombinedCommitStatusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCombinedCommitStatusFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CombinedCommitStatusable), nil +} +// ToGetRequestInformation users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name.Additionally, a combined `state` is returned. The `state` is one of:* **failure** if any of the contexts report as `error` or `failure`* **pending** if there are no statuses or a context is `pending`* **success** if the latest status for all contexts is `success` +// returns a *RequestInformation when successful +func (m *ItemItemCommitsItemStatusRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemStatusRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCommitsItemStatusRequestBuilder when successful +func (m *ItemItemCommitsItemStatusRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsItemStatusRequestBuilder) { + return NewItemItemCommitsItemStatusRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_statuses_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_statuses_request_builder.go new file mode 100644 index 000000000..7eb684960 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_item_statuses_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCommitsItemStatusesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits\{commit_sha-id}\statuses +type ItemItemCommitsItemStatusesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsItemStatusesRequestBuilderGetQueryParameters users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one.This resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`. +type ItemItemCommitsItemStatusesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemCommitsItemStatusesRequestBuilderInternal instantiates a new ItemItemCommitsItemStatusesRequestBuilder and sets the default values. +func NewItemItemCommitsItemStatusesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemStatusesRequestBuilder) { + m := &ItemItemCommitsItemStatusesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits/{commit_sha%2Did}/statuses{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommitsItemStatusesRequestBuilder instantiates a new ItemItemCommitsItemStatusesRequestBuilder and sets the default values. +func NewItemItemCommitsItemStatusesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemStatusesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsItemStatusesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one.This resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`. +// returns a []Statusable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference +func (m *ItemItemCommitsItemStatusesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemStatusesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Statusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateStatusFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Statusable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Statusable) + } + } + return val, nil +} +// ToGetRequestInformation users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one.This resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`. +// returns a *RequestInformation when successful +func (m *ItemItemCommitsItemStatusesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemStatusesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCommitsItemStatusesRequestBuilder when successful +func (m *ItemItemCommitsItemStatusesRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsItemStatusesRequestBuilder) { + return NewItemItemCommitsItemStatusesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_request_builder.go new file mode 100644 index 000000000..821a41c30 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_request_builder.go @@ -0,0 +1,102 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCommitsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits +type ItemItemCommitsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsRequestBuilderGetQueryParameters **Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +type ItemItemCommitsRequestBuilderGetQueryParameters struct { + // GitHub username or email address to use to filter by commit author. + Author *string `uriparametername:"author"` + // GitHub username or email address to use to filter by commit committer. + Committer *string `uriparametername:"committer"` + // 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"` + // Only commits containing this file path will be returned. + Path *string `uriparametername:"path"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // SHA or branch to start listing commits from. Default: the repository’s default branch (usually `main`). + Sha *string `uriparametername:"sha"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Due to limitations of Git, timestamps must be between 1970-01-01 and 2099-12-31 (inclusive) or unexpected results may be returned. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + // Only commits before this date will be returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Due to limitations of Git, timestamps must be between 1970-01-01 and 2099-12-31 (inclusive) or unexpected results may be returned. + Until *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"until"` +} +// ByCommit_shaId gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.commits.item collection +// returns a *ItemItemCommitsCommit_shaItemRequestBuilder when successful +func (m *ItemItemCommitsRequestBuilder) ByCommit_shaId(commit_shaId string)(*ItemItemCommitsCommit_shaItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if commit_shaId != "" { + urlTplParams["commit_sha%2Did"] = commit_shaId + } + return NewItemItemCommitsCommit_shaItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCommitsRequestBuilderInternal instantiates a new ItemItemCommitsRequestBuilder and sets the default values. +func NewItemItemCommitsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsRequestBuilder) { + m := &ItemItemCommitsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits{?author*,committer*,page*,path*,per_page*,sha*,since*,until*}", pathParameters), + } + return m +} +// NewItemItemCommitsRequestBuilder instantiates a new ItemItemCommitsRequestBuilder and sets the default values. +func NewItemItemCommitsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a []Commitable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/commits/commits#list-commits +func (m *ItemItemCommitsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Commitable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Commitable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Commitable) + } + } + return val, nil +} +// ToGetRequestInformation **Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a *RequestInformation when successful +func (m *ItemItemCommitsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCommitsRequestBuilder when successful +func (m *ItemItemCommitsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsRequestBuilder) { + return NewItemItemCommitsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_with_commit_sha_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_with_commit_sha_item_request_builder.go new file mode 100644 index 000000000..c117dcd89 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_commits_with_commit_sha_item_request_builder.go @@ -0,0 +1,110 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCommitsWithCommit_shaItemRequestBuilder builds and executes requests for operations under \repos\{repos-id}\{Owner-id}\commits\{commits-id} +type ItemItemCommitsWithCommit_shaItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsWithCommit_shaItemRequestBuilderGetQueryParameters returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint.**Note:** If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.You can pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch `diff` and `patch` formats. Diffs with binary data will have no `patch` property.To return only the SHA-1 hash of the commit reference, you can provide the `sha` custom [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) in the `Accept` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +type ItemItemCommitsWithCommit_shaItemRequestBuilderGetQueryParameters struct { + // Page number of the results to fetch. + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). + Per_page *int32 `uriparametername:"per_page"` +} +// ItemItemCommitsWithCommit_shaItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemItemCommitsWithCommit_shaItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemItemCommitsWithCommit_shaItemRequestBuilderGetQueryParameters +} +// BranchesWhereHead the branchesWhereHead property +func (m *ItemItemCommitsWithCommit_shaItemRequestBuilder) BranchesWhereHead()(*ItemItemCommitsItemBranchesWhereHeadRequestBuilder) { + return NewItemItemCommitsItemBranchesWhereHeadRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CheckRuns the checkRuns property +func (m *ItemItemCommitsWithCommit_shaItemRequestBuilder) CheckRuns()(*ItemItemCommitsItemCheckRunsRequestBuilder) { + return NewItemItemCommitsItemCheckRunsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CheckSuites the checkSuites property +func (m *ItemItemCommitsWithCommit_shaItemRequestBuilder) CheckSuites()(*ItemItemCommitsItemCheckSuitesRequestBuilder) { + return NewItemItemCommitsItemCheckSuitesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +func (m *ItemItemCommitsWithCommit_shaItemRequestBuilder) Comments()(*ItemItemCommitsItemCommentsRequestBuilder) { + return NewItemItemCommitsItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCommitsWithCommit_shaItemRequestBuilderInternal instantiates a new WithCommit_shaItemRequestBuilder and sets the default values. +func NewItemItemCommitsWithCommit_shaItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsWithCommit_shaItemRequestBuilder) { + m := &ItemItemCommitsWithCommit_shaItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{repos%2Did}/{Owner%2Did}/commits/{commits%2Did}{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommitsWithCommit_shaItemRequestBuilder instantiates a new WithCommit_shaItemRequestBuilder and sets the default values. +func NewItemItemCommitsWithCommit_shaItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsWithCommit_shaItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsWithCommit_shaItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint.**Note:** If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.You can pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch `diff` and `patch` formats. Diffs with binary data will have no `patch` property.To return only the SHA-1 hash of the commit reference, you can provide the `sha` custom [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) in the `Accept` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/commits/commits#get-a-commit +func (m *ItemItemCommitsWithCommit_shaItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemItemCommitsWithCommit_shaItemRequestBuilderGetRequestConfiguration)(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Commitable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommit503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Commitable), nil +} +// Pulls the pulls property +func (m *ItemItemCommitsWithCommit_shaItemRequestBuilder) Pulls()(*ItemItemCommitsItemPullsRequestBuilder) { + return NewItemItemCommitsItemPullsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Status the status property +func (m *ItemItemCommitsWithCommit_shaItemRequestBuilder) Status()(*ItemItemCommitsItemStatusRequestBuilder) { + return NewItemItemCommitsItemStatusRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Statuses the statuses property +func (m *ItemItemCommitsWithCommit_shaItemRequestBuilder) Statuses()(*ItemItemCommitsItemStatusesRequestBuilder) { + return NewItemItemCommitsItemStatusesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint.**Note:** If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.You can pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch `diff` and `patch` formats. Diffs with binary data will have no `patch` property.To return only the SHA-1 hash of the commit reference, you can provide the `sha` custom [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) in the `Accept` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +func (m *ItemItemCommitsWithCommit_shaItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemItemCommitsWithCommit_shaItemRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +func (m *ItemItemCommitsWithCommit_shaItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsWithCommit_shaItemRequestBuilder) { + return NewItemItemCommitsWithCommit_shaItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_community_profile_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_community_profile_request_builder.go new file mode 100644 index 000000000..58317f6ee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_community_profile_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCommunityProfileRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\community\profile +type ItemItemCommunityProfileRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCommunityProfileRequestBuilderInternal instantiates a new ItemItemCommunityProfileRequestBuilder and sets the default values. +func NewItemItemCommunityProfileRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommunityProfileRequestBuilder) { + m := &ItemItemCommunityProfileRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/community/profile", pathParameters), + } + return m +} +// NewItemItemCommunityProfileRequestBuilder instantiates a new ItemItemCommunityProfileRequestBuilder and sets the default values. +func NewItemItemCommunityProfileRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommunityProfileRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommunityProfileRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns all community profile metrics for a repository. The repository cannot be a fork.The returned metrics include an overall health score, the repository description, the presence of documentation, thedetected code of conduct, the detected license, and the presence of ISSUE\_TEMPLATE, PULL\_REQUEST\_TEMPLATE,README, and CONTRIBUTING files.The `health_percentage` score is defined as a percentage of how many ofthe recommended community health files are present. For more information, see"[About community profiles for public repositories](https://docs.github.com/communities/setting-up-your-project-for-healthy-contributions/about-community-profiles-for-public-repositories)."`content_reports_enabled` is only returned for organization-owned repositories. +// returns a CommunityProfileable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/metrics/community#get-community-profile-metrics +func (m *ItemItemCommunityProfileRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommunityProfileable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommunityProfileFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommunityProfileable), nil +} +// ToGetRequestInformation returns all community profile metrics for a repository. The repository cannot be a fork.The returned metrics include an overall health score, the repository description, the presence of documentation, thedetected code of conduct, the detected license, and the presence of ISSUE\_TEMPLATE, PULL\_REQUEST\_TEMPLATE,README, and CONTRIBUTING files.The `health_percentage` score is defined as a percentage of how many ofthe recommended community health files are present. For more information, see"[About community profiles for public repositories](https://docs.github.com/communities/setting-up-your-project-for-healthy-contributions/about-community-profiles-for-public-repositories)."`content_reports_enabled` is only returned for organization-owned repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCommunityProfileRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCommunityProfileRequestBuilder when successful +func (m *ItemItemCommunityProfileRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommunityProfileRequestBuilder) { + return NewItemItemCommunityProfileRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_community_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_community_request_builder.go new file mode 100644 index 000000000..abd39254b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_community_request_builder.go @@ -0,0 +1,28 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemCommunityRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\community +type ItemItemCommunityRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCommunityRequestBuilderInternal instantiates a new ItemItemCommunityRequestBuilder and sets the default values. +func NewItemItemCommunityRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommunityRequestBuilder) { + m := &ItemItemCommunityRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/community", pathParameters), + } + return m +} +// NewItemItemCommunityRequestBuilder instantiates a new ItemItemCommunityRequestBuilder and sets the default values. +func NewItemItemCommunityRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommunityRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommunityRequestBuilderInternal(urlParams, requestAdapter) +} +// Profile the profile property +// returns a *ItemItemCommunityProfileRequestBuilder when successful +func (m *ItemItemCommunityRequestBuilder) Profile()(*ItemItemCommunityProfileRequestBuilder) { + return NewItemItemCommunityProfileRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_compare_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_compare_request_builder.go new file mode 100644 index 000000000..8b9146790 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_compare_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemCompareRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\compare +type ItemItemCompareRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByBasehead gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.compare.item collection +// returns a *ItemItemCompareWithBaseheadItemRequestBuilder when successful +func (m *ItemItemCompareRequestBuilder) ByBasehead(basehead string)(*ItemItemCompareWithBaseheadItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if basehead != "" { + urlTplParams["basehead"] = basehead + } + return NewItemItemCompareWithBaseheadItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCompareRequestBuilderInternal instantiates a new ItemItemCompareRequestBuilder and sets the default values. +func NewItemItemCompareRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCompareRequestBuilder) { + m := &ItemItemCompareRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/compare", pathParameters), + } + return m +} +// NewItemItemCompareRequestBuilder instantiates a new ItemItemCompareRequestBuilder and sets the default values. +func NewItemItemCompareRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCompareRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCompareRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_compare_with_basehead_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_compare_with_basehead_item_request_builder.go new file mode 100644 index 000000000..3b10de364 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_compare_with_basehead_item_request_builder.go @@ -0,0 +1,72 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCompareWithBaseheadItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\compare\{basehead} +type ItemItemCompareWithBaseheadItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCompareWithBaseheadItemRequestBuilderGetQueryParameters compares two commits against one another. You can compare refs (branches or tags) and commit SHAs in the same repository, or you can compare refs and commit SHAs that exist in different repositories within the same repository network, including fork branches. For more information about how to view a repository's network, see "[Understanding connections between repositories](https://docs.github.com/repositories/viewing-activity-and-data-for-your-repository/understanding-connections-between-repositories)."This endpoint is equivalent to running the `git log BASE..HEAD` command, but it returns commits in a different order. The `git log BASE..HEAD` command returns commits in reverse chronological order, whereas the API returns commits in chronological order.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.diff`**: Returns the diff of the commit.- **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property.The API response includes details about the files that were changed between the two commits. This includes the status of the change (if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file.When calling this endpoint without any paging parameter (`per_page` or `page`), the returned list is limited to 250 commits, and the last commit in the list is the most recent of the entire comparison.**Working with large comparisons**To process a response with a large number of commits, use a query parameter (`per_page` or `page`) to paginate the results. When using pagination:- The list of changed files is only shown on the first page of results, and it includes up to 300 changed files for the entire comparison.- The results are returned in chronological order, but the last commit in the returned list may not be the most recent one in the entire set if there are more pages of results.For more information on working with pagination, see "[Using pagination in the REST API](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api)."**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The `verification` object includes the following fields:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +type ItemItemCompareWithBaseheadItemRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemCompareWithBaseheadItemRequestBuilderInternal instantiates a new ItemItemCompareWithBaseheadItemRequestBuilder and sets the default values. +func NewItemItemCompareWithBaseheadItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCompareWithBaseheadItemRequestBuilder) { + m := &ItemItemCompareWithBaseheadItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/compare/{basehead}{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCompareWithBaseheadItemRequestBuilder instantiates a new ItemItemCompareWithBaseheadItemRequestBuilder and sets the default values. +func NewItemItemCompareWithBaseheadItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCompareWithBaseheadItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCompareWithBaseheadItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get compares two commits against one another. You can compare refs (branches or tags) and commit SHAs in the same repository, or you can compare refs and commit SHAs that exist in different repositories within the same repository network, including fork branches. For more information about how to view a repository's network, see "[Understanding connections between repositories](https://docs.github.com/repositories/viewing-activity-and-data-for-your-repository/understanding-connections-between-repositories)."This endpoint is equivalent to running the `git log BASE..HEAD` command, but it returns commits in a different order. The `git log BASE..HEAD` command returns commits in reverse chronological order, whereas the API returns commits in chronological order.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.diff`**: Returns the diff of the commit.- **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property.The API response includes details about the files that were changed between the two commits. This includes the status of the change (if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file.When calling this endpoint without any paging parameter (`per_page` or `page`), the returned list is limited to 250 commits, and the last commit in the list is the most recent of the entire comparison.**Working with large comparisons**To process a response with a large number of commits, use a query parameter (`per_page` or `page`) to paginate the results. When using pagination:- The list of changed files is only shown on the first page of results, and it includes up to 300 changed files for the entire comparison.- The results are returned in chronological order, but the last commit in the returned list may not be the most recent one in the entire set if there are more pages of results.For more information on working with pagination, see "[Using pagination in the REST API](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api)."**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The `verification` object includes the following fields:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a CommitComparisonable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// returns a CommitComparison503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/commits/commits#compare-two-commits +func (m *ItemItemCompareWithBaseheadItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCompareWithBaseheadItemRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitComparisonable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommitComparison503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommitComparisonFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitComparisonable), nil +} +// ToGetRequestInformation compares two commits against one another. You can compare refs (branches or tags) and commit SHAs in the same repository, or you can compare refs and commit SHAs that exist in different repositories within the same repository network, including fork branches. For more information about how to view a repository's network, see "[Understanding connections between repositories](https://docs.github.com/repositories/viewing-activity-and-data-for-your-repository/understanding-connections-between-repositories)."This endpoint is equivalent to running the `git log BASE..HEAD` command, but it returns commits in a different order. The `git log BASE..HEAD` command returns commits in reverse chronological order, whereas the API returns commits in chronological order.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.diff`**: Returns the diff of the commit.- **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property.The API response includes details about the files that were changed between the two commits. This includes the status of the change (if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file.When calling this endpoint without any paging parameter (`per_page` or `page`), the returned list is limited to 250 commits, and the last commit in the list is the most recent of the entire comparison.**Working with large comparisons**To process a response with a large number of commits, use a query parameter (`per_page` or `page`) to paginate the results. When using pagination:- The list of changed files is only shown on the first page of results, and it includes up to 300 changed files for the entire comparison.- The results are returned in chronological order, but the last commit in the returned list may not be the most recent one in the entire set if there are more pages of results.For more information on working with pagination, see "[Using pagination in the REST API](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api)."**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The `verification` object includes the following fields:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a *RequestInformation when successful +func (m *ItemItemCompareWithBaseheadItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCompareWithBaseheadItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCompareWithBaseheadItemRequestBuilder when successful +func (m *ItemItemCompareWithBaseheadItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCompareWithBaseheadItemRequestBuilder) { + return NewItemItemCompareWithBaseheadItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_delete_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_delete_request_body.go new file mode 100644 index 000000000..4440e9556 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_delete_request_body.go @@ -0,0 +1,196 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemContentsItemWithPathDeleteRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // object containing information about the author. + author ItemItemContentsItemWithPathDeleteRequestBody_authorable + // The branch name. Default: the repository’s default branch + branch *string + // object containing information about the committer. + committer ItemItemContentsItemWithPathDeleteRequestBody_committerable + // The commit message. + message *string + // The blob SHA of the file being deleted. + sha *string +} +// NewItemItemContentsItemWithPathDeleteRequestBody instantiates a new ItemItemContentsItemWithPathDeleteRequestBody and sets the default values. +func NewItemItemContentsItemWithPathDeleteRequestBody()(*ItemItemContentsItemWithPathDeleteRequestBody) { + m := &ItemItemContentsItemWithPathDeleteRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemContentsItemWithPathDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemContentsItemWithPathDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemContentsItemWithPathDeleteRequestBody(), 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 *ItemItemContentsItemWithPathDeleteRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. object containing information about the author. +// returns a ItemItemContentsItemWithPathDeleteRequestBody_authorable when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody) GetAuthor()(ItemItemContentsItemWithPathDeleteRequestBody_authorable) { + return m.author +} +// GetBranch gets the branch property value. The branch name. Default: the repository’s default branch +// returns a *string when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody) GetBranch()(*string) { + return m.branch +} +// GetCommitter gets the committer property value. object containing information about the committer. +// returns a ItemItemContentsItemWithPathDeleteRequestBody_committerable when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody) GetCommitter()(ItemItemContentsItemWithPathDeleteRequestBody_committerable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemContentsItemWithPathDeleteRequestBody_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(ItemItemContentsItemWithPathDeleteRequestBody_authorable)) + } + return nil + } + res["branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranch(val) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemContentsItemWithPathDeleteRequestBody_committerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(ItemItemContentsItemWithPathDeleteRequestBody_committerable)) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The commit message. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody) GetMessage()(*string) { + return m.message +} +// GetSha gets the sha property value. The blob SHA of the file being deleted. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *ItemItemContentsItemWithPathDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branch", m.GetBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *ItemItemContentsItemWithPathDeleteRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. object containing information about the author. +func (m *ItemItemContentsItemWithPathDeleteRequestBody) SetAuthor(value ItemItemContentsItemWithPathDeleteRequestBody_authorable)() { + m.author = value +} +// SetBranch sets the branch property value. The branch name. Default: the repository’s default branch +func (m *ItemItemContentsItemWithPathDeleteRequestBody) SetBranch(value *string)() { + m.branch = value +} +// SetCommitter sets the committer property value. object containing information about the committer. +func (m *ItemItemContentsItemWithPathDeleteRequestBody) SetCommitter(value ItemItemContentsItemWithPathDeleteRequestBody_committerable)() { + m.committer = value +} +// SetMessage sets the message property value. The commit message. +func (m *ItemItemContentsItemWithPathDeleteRequestBody) SetMessage(value *string)() { + m.message = value +} +// SetSha sets the sha property value. The blob SHA of the file being deleted. +func (m *ItemItemContentsItemWithPathDeleteRequestBody) SetSha(value *string)() { + m.sha = value +} +type ItemItemContentsItemWithPathDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(ItemItemContentsItemWithPathDeleteRequestBody_authorable) + GetBranch()(*string) + GetCommitter()(ItemItemContentsItemWithPathDeleteRequestBody_committerable) + GetMessage()(*string) + GetSha()(*string) + SetAuthor(value ItemItemContentsItemWithPathDeleteRequestBody_authorable)() + SetBranch(value *string)() + SetCommitter(value ItemItemContentsItemWithPathDeleteRequestBody_committerable)() + SetMessage(value *string)() + SetSha(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_delete_request_body_author.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_delete_request_body_author.go new file mode 100644 index 000000000..329e76fea --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_delete_request_body_author.go @@ -0,0 +1,110 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemContentsItemWithPathDeleteRequestBody_author object containing information about the author. +type ItemItemContentsItemWithPathDeleteRequestBody_author struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The email of the author (or committer) of the commit + email *string + // The name of the author (or committer) of the commit + name *string +} +// NewItemItemContentsItemWithPathDeleteRequestBody_author instantiates a new ItemItemContentsItemWithPathDeleteRequestBody_author and sets the default values. +func NewItemItemContentsItemWithPathDeleteRequestBody_author()(*ItemItemContentsItemWithPathDeleteRequestBody_author) { + m := &ItemItemContentsItemWithPathDeleteRequestBody_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemContentsItemWithPathDeleteRequestBody_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemContentsItemWithPathDeleteRequestBody_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemContentsItemWithPathDeleteRequestBody_author(), 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 *ItemItemContentsItemWithPathDeleteRequestBody_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. The email of the author (or committer) of the commit +// returns a *string when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the author (or committer) of the commit +// returns a *string when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemContentsItemWithPathDeleteRequestBody_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemContentsItemWithPathDeleteRequestBody_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. The email of the author (or committer) of the commit +func (m *ItemItemContentsItemWithPathDeleteRequestBody_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name of the author (or committer) of the commit +func (m *ItemItemContentsItemWithPathDeleteRequestBody_author) SetName(value *string)() { + m.name = value +} +type ItemItemContentsItemWithPathDeleteRequestBody_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetName()(*string) + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_delete_request_body_committer.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_delete_request_body_committer.go new file mode 100644 index 000000000..12d49e582 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_delete_request_body_committer.go @@ -0,0 +1,110 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemContentsItemWithPathDeleteRequestBody_committer object containing information about the committer. +type ItemItemContentsItemWithPathDeleteRequestBody_committer struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The email of the author (or committer) of the commit + email *string + // The name of the author (or committer) of the commit + name *string +} +// NewItemItemContentsItemWithPathDeleteRequestBody_committer instantiates a new ItemItemContentsItemWithPathDeleteRequestBody_committer and sets the default values. +func NewItemItemContentsItemWithPathDeleteRequestBody_committer()(*ItemItemContentsItemWithPathDeleteRequestBody_committer) { + m := &ItemItemContentsItemWithPathDeleteRequestBody_committer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemContentsItemWithPathDeleteRequestBody_committerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemContentsItemWithPathDeleteRequestBody_committerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemContentsItemWithPathDeleteRequestBody_committer(), 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 *ItemItemContentsItemWithPathDeleteRequestBody_committer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. The email of the author (or committer) of the commit +// returns a *string when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody_committer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody_committer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the author (or committer) of the commit +// returns a *string when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody_committer) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemContentsItemWithPathDeleteRequestBody_committer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemContentsItemWithPathDeleteRequestBody_committer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. The email of the author (or committer) of the commit +func (m *ItemItemContentsItemWithPathDeleteRequestBody_committer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name of the author (or committer) of the commit +func (m *ItemItemContentsItemWithPathDeleteRequestBody_committer) SetName(value *string)() { + m.name = value +} +type ItemItemContentsItemWithPathDeleteRequestBody_committerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetName()(*string) + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_put_request_body.go new file mode 100644 index 000000000..865ae5838 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_put_request_body.go @@ -0,0 +1,225 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemContentsItemWithPathPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The author of the file. Default: The `committer` or the authenticated user if you omit `committer`. + author ItemItemContentsItemWithPathPutRequestBody_authorable + // The branch name. Default: the repository’s default branch. + branch *string + // The person that committed the file. Default: the authenticated user. + committer ItemItemContentsItemWithPathPutRequestBody_committerable + // The new file content, using Base64 encoding. + content *string + // The commit message. + message *string + // **Required if you are updating a file**. The blob SHA of the file being replaced. + sha *string +} +// NewItemItemContentsItemWithPathPutRequestBody instantiates a new ItemItemContentsItemWithPathPutRequestBody and sets the default values. +func NewItemItemContentsItemWithPathPutRequestBody()(*ItemItemContentsItemWithPathPutRequestBody) { + m := &ItemItemContentsItemWithPathPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemContentsItemWithPathPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemContentsItemWithPathPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemContentsItemWithPathPutRequestBody(), 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 *ItemItemContentsItemWithPathPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. The author of the file. Default: The `committer` or the authenticated user if you omit `committer`. +// returns a ItemItemContentsItemWithPathPutRequestBody_authorable when successful +func (m *ItemItemContentsItemWithPathPutRequestBody) GetAuthor()(ItemItemContentsItemWithPathPutRequestBody_authorable) { + return m.author +} +// GetBranch gets the branch property value. The branch name. Default: the repository’s default branch. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody) GetBranch()(*string) { + return m.branch +} +// GetCommitter gets the committer property value. The person that committed the file. Default: the authenticated user. +// returns a ItemItemContentsItemWithPathPutRequestBody_committerable when successful +func (m *ItemItemContentsItemWithPathPutRequestBody) GetCommitter()(ItemItemContentsItemWithPathPutRequestBody_committerable) { + return m.committer +} +// GetContent gets the content property value. The new file content, using Base64 encoding. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody) GetContent()(*string) { + return m.content +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemContentsItemWithPathPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemContentsItemWithPathPutRequestBody_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(ItemItemContentsItemWithPathPutRequestBody_authorable)) + } + return nil + } + res["branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranch(val) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemContentsItemWithPathPutRequestBody_committerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(ItemItemContentsItemWithPathPutRequestBody_committerable)) + } + return nil + } + res["content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContent(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The commit message. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody) GetMessage()(*string) { + return m.message +} +// GetSha gets the sha property value. **Required if you are updating a file**. The blob SHA of the file being replaced. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *ItemItemContentsItemWithPathPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branch", m.GetBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("content", m.GetContent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *ItemItemContentsItemWithPathPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. The author of the file. Default: The `committer` or the authenticated user if you omit `committer`. +func (m *ItemItemContentsItemWithPathPutRequestBody) SetAuthor(value ItemItemContentsItemWithPathPutRequestBody_authorable)() { + m.author = value +} +// SetBranch sets the branch property value. The branch name. Default: the repository’s default branch. +func (m *ItemItemContentsItemWithPathPutRequestBody) SetBranch(value *string)() { + m.branch = value +} +// SetCommitter sets the committer property value. The person that committed the file. Default: the authenticated user. +func (m *ItemItemContentsItemWithPathPutRequestBody) SetCommitter(value ItemItemContentsItemWithPathPutRequestBody_committerable)() { + m.committer = value +} +// SetContent sets the content property value. The new file content, using Base64 encoding. +func (m *ItemItemContentsItemWithPathPutRequestBody) SetContent(value *string)() { + m.content = value +} +// SetMessage sets the message property value. The commit message. +func (m *ItemItemContentsItemWithPathPutRequestBody) SetMessage(value *string)() { + m.message = value +} +// SetSha sets the sha property value. **Required if you are updating a file**. The blob SHA of the file being replaced. +func (m *ItemItemContentsItemWithPathPutRequestBody) SetSha(value *string)() { + m.sha = value +} +type ItemItemContentsItemWithPathPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(ItemItemContentsItemWithPathPutRequestBody_authorable) + GetBranch()(*string) + GetCommitter()(ItemItemContentsItemWithPathPutRequestBody_committerable) + GetContent()(*string) + GetMessage()(*string) + GetSha()(*string) + SetAuthor(value ItemItemContentsItemWithPathPutRequestBody_authorable)() + SetBranch(value *string)() + SetCommitter(value ItemItemContentsItemWithPathPutRequestBody_committerable)() + SetContent(value *string)() + SetMessage(value *string)() + SetSha(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_put_request_body_author.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_put_request_body_author.go new file mode 100644 index 000000000..698132c97 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_put_request_body_author.go @@ -0,0 +1,139 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemContentsItemWithPathPutRequestBody_author the author of the file. Default: The `committer` or the authenticated user if you omit `committer`. +type ItemItemContentsItemWithPathPutRequestBody_author struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The date property + date *string + // The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted. + email *string + // The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted. + name *string +} +// NewItemItemContentsItemWithPathPutRequestBody_author instantiates a new ItemItemContentsItemWithPathPutRequestBody_author and sets the default values. +func NewItemItemContentsItemWithPathPutRequestBody_author()(*ItemItemContentsItemWithPathPutRequestBody_author) { + m := &ItemItemContentsItemWithPathPutRequestBody_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemContentsItemWithPathPutRequestBody_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemContentsItemWithPathPutRequestBody_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemContentsItemWithPathPutRequestBody_author(), 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 *ItemItemContentsItemWithPathPutRequestBody_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. The date property +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody_author) GetDate()(*string) { + return m.date +} +// GetEmail gets the email property value. The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemContentsItemWithPathPutRequestBody_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemContentsItemWithPathPutRequestBody_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemContentsItemWithPathPutRequestBody_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. The date property +func (m *ItemItemContentsItemWithPathPutRequestBody_author) SetDate(value *string)() { + m.date = value +} +// SetEmail sets the email property value. The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted. +func (m *ItemItemContentsItemWithPathPutRequestBody_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted. +func (m *ItemItemContentsItemWithPathPutRequestBody_author) SetName(value *string)() { + m.name = value +} +type ItemItemContentsItemWithPathPutRequestBody_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*string) + GetEmail()(*string) + GetName()(*string) + SetDate(value *string)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_put_request_body_committer.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_put_request_body_committer.go new file mode 100644 index 000000000..10461c71e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_item_with_path_put_request_body_committer.go @@ -0,0 +1,139 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemContentsItemWithPathPutRequestBody_committer the person that committed the file. Default: the authenticated user. +type ItemItemContentsItemWithPathPutRequestBody_committer struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The date property + date *string + // The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted. + email *string + // The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted. + name *string +} +// NewItemItemContentsItemWithPathPutRequestBody_committer instantiates a new ItemItemContentsItemWithPathPutRequestBody_committer and sets the default values. +func NewItemItemContentsItemWithPathPutRequestBody_committer()(*ItemItemContentsItemWithPathPutRequestBody_committer) { + m := &ItemItemContentsItemWithPathPutRequestBody_committer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemContentsItemWithPathPutRequestBody_committerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemContentsItemWithPathPutRequestBody_committerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemContentsItemWithPathPutRequestBody_committer(), 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 *ItemItemContentsItemWithPathPutRequestBody_committer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. The date property +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody_committer) GetDate()(*string) { + return m.date +} +// GetEmail gets the email property value. The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody_committer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemContentsItemWithPathPutRequestBody_committer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody_committer) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemContentsItemWithPathPutRequestBody_committer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemContentsItemWithPathPutRequestBody_committer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. The date property +func (m *ItemItemContentsItemWithPathPutRequestBody_committer) SetDate(value *string)() { + m.date = value +} +// SetEmail sets the email property value. The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted. +func (m *ItemItemContentsItemWithPathPutRequestBody_committer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted. +func (m *ItemItemContentsItemWithPathPutRequestBody_committer) SetName(value *string)() { + m.name = value +} +type ItemItemContentsItemWithPathPutRequestBody_committerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*string) + GetEmail()(*string) + GetName()(*string) + SetDate(value *string)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_request_builder.go new file mode 100644 index 000000000..c845d8f58 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemContentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\contents +type ItemItemContentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByPath gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.contents.item collection +// returns a *ItemItemContentsWithPathItemRequestBuilder when successful +func (m *ItemItemContentsRequestBuilder) ByPath(path string)(*ItemItemContentsWithPathItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if path != "" { + urlTplParams["path"] = path + } + return NewItemItemContentsWithPathItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemContentsRequestBuilderInternal instantiates a new ItemItemContentsRequestBuilder and sets the default values. +func NewItemItemContentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemContentsRequestBuilder) { + m := &ItemItemContentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/contents", pathParameters), + } + return m +} +// NewItemItemContentsRequestBuilder instantiates a new ItemItemContentsRequestBuilder and sets the default values. +func NewItemItemContentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemContentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemContentsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_with_path_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_with_path_item_request_builder.go new file mode 100644 index 000000000..47ce56935 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contents_with_path_item_request_builder.go @@ -0,0 +1,286 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemContentsWithPathItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\contents\{path} +type ItemItemContentsWithPathItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemContentsWithPathItemRequestBuilderGetQueryParameters gets the contents of a file or directory in a repository. Specify the file path or directory with the `path` parameter. If you omit the `path` parameter, you will receive the contents of the repository's root directory.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents for files and symlinks.- **`application/vnd.github.html+json`**: Returns the file contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup).- **`application/vnd.github.object+json`**: Returns the contents in a consistent object format regardless of the content type. For example, instead of an array of objects for a directory, the response will be an object with an `entries` attribute containing the array of objects.If the content is a directory, the response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value _should_ be "submodule". This behavior exists [for backwards compatibility purposes](https://git.io/v1YCW). In the next major version of the API, the type will be returned as "submodule".If the content is a symlink and the symlink's target is a normal file in the repository, then the API responds with the content of the file. Otherwise, the API responds with an object describing the symlink itself.If the content is a submodule, the `submodule_git_url` field identifies the location of the submodule repository, and the `sha` identifies a specific commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit. If the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links["git"]`) and the github.com URLs (`html_url` and `_links["html"]`) will have null values.**Notes**:- To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/git/trees#get-a-tree).- This API has an upper limit of 1,000 files for a directory. If you need to retrievemore files, use the [Git Trees API](https://docs.github.com/rest/git/trees#get-a-tree).- Download URLs expire and are meant to be used just once. To ensure the download URL does not expire, please use the contents API to obtain a fresh download URL for each download.- If the requested file's size is: - 1 MB or smaller: All features of this endpoint are supported. - Between 1-100 MB: Only the `raw` or `object` custom media types are supported. Both will work as normal, except that when using the `object` media type, the `content` field will be an emptystring and the `encoding` field will be `"none"`. To get the contents of these larger files, use the `raw` media type. - Greater than 100 MB: This endpoint is not supported. +type ItemItemContentsWithPathItemRequestBuilderGetQueryParameters struct { + // The name of the commit/branch/tag. Default: the repository’s default branch. + Ref *string `uriparametername:"ref"` +} +// WithPathGetResponse composed type wrapper for classes i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentFileable, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSubmoduleable, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSymlinkable, []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WithPathGetResponseMember1able +type WithPathGetResponse struct { + // Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentFileable + contentFile i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentFileable + // Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSubmoduleable + contentSubmodule i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSubmoduleable + // Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSymlinkable + contentSymlink i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSymlinkable + // Composed type representation for type []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WithPathGetResponseMember1able + withPathGetResponseMember1 []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WithPathGetResponseMember1able +} +// NewWithPathGetResponse instantiates a new WithPathGetResponse and sets the default values. +func NewWithPathGetResponse()(*WithPathGetResponse) { + m := &WithPathGetResponse{ + } + return m +} +// CreateWithPathGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWithPathGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewWithPathGetResponse() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWithPathGetResponseMember1FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WithPathGetResponseMember1able, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WithPathGetResponseMember1able) + } + } + result.SetWithPathGetResponseMember1(cast) + } + return result, nil +} +// GetContentFile gets the contentFile property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentFileable +// returns a ContentFileable when successful +func (m *WithPathGetResponse) GetContentFile()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentFileable) { + return m.contentFile +} +// GetContentSubmodule gets the contentSubmodule property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSubmoduleable +// returns a ContentSubmoduleable when successful +func (m *WithPathGetResponse) GetContentSubmodule()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSubmoduleable) { + return m.contentSubmodule +} +// GetContentSymlink gets the contentSymlink property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSymlinkable +// returns a ContentSymlinkable when successful +func (m *WithPathGetResponse) GetContentSymlink()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSymlinkable) { + return m.contentSymlink +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WithPathGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *WithPathGetResponse) GetIsComposedType()(bool) { + return true +} +// GetWithPathGetResponseMember1 gets the WithPathGetResponseMember1 property value. Composed type representation for type []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WithPathGetResponseMember1able +// returns a []WithPathGetResponseMember1able when successful +func (m *WithPathGetResponse) GetWithPathGetResponseMember1()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WithPathGetResponseMember1able) { + return m.withPathGetResponseMember1 +} +// Serialize serializes information the current object +func (m *WithPathGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContentFile() != nil { + err := writer.WriteObjectValue("", m.GetContentFile()) + if err != nil { + return err + } + } else if m.GetContentSubmodule() != nil { + err := writer.WriteObjectValue("", m.GetContentSubmodule()) + if err != nil { + return err + } + } else if m.GetContentSymlink() != nil { + err := writer.WriteObjectValue("", m.GetContentSymlink()) + if err != nil { + return err + } + } else if m.GetWithPathGetResponseMember1() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetWithPathGetResponseMember1())) + for i, v := range m.GetWithPathGetResponseMember1() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } + return nil +} +// SetContentFile sets the contentFile property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentFileable +func (m *WithPathGetResponse) SetContentFile(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentFileable)() { + m.contentFile = value +} +// SetContentSubmodule sets the contentSubmodule property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSubmoduleable +func (m *WithPathGetResponse) SetContentSubmodule(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSubmoduleable)() { + m.contentSubmodule = value +} +// SetContentSymlink sets the contentSymlink property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSymlinkable +func (m *WithPathGetResponse) SetContentSymlink(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSymlinkable)() { + m.contentSymlink = value +} +// SetWithPathGetResponseMember1 sets the WithPathGetResponseMember1 property value. Composed type representation for type []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WithPathGetResponseMember1able +func (m *WithPathGetResponse) SetWithPathGetResponseMember1(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WithPathGetResponseMember1able)() { + m.withPathGetResponseMember1 = value +} +type WithPathGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentFile()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentFileable) + GetContentSubmodule()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSubmoduleable) + GetContentSymlink()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSymlinkable) + GetWithPathGetResponseMember1()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WithPathGetResponseMember1able) + SetContentFile(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentFileable)() + SetContentSubmodule(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSubmoduleable)() + SetContentSymlink(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentSymlinkable)() + SetWithPathGetResponseMember1(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WithPathGetResponseMember1able)() +} +// NewItemItemContentsWithPathItemRequestBuilderInternal instantiates a new ItemItemContentsWithPathItemRequestBuilder and sets the default values. +func NewItemItemContentsWithPathItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemContentsWithPathItemRequestBuilder) { + m := &ItemItemContentsWithPathItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/contents/{path}{?ref*}", pathParameters), + } + return m +} +// NewItemItemContentsWithPathItemRequestBuilder instantiates a new ItemItemContentsWithPathItemRequestBuilder and sets the default values. +func NewItemItemContentsWithPathItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemContentsWithPathItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemContentsWithPathItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a file in a repository.You can provide an additional `committer` parameter, which is an object containing information about the committer. Or, you can provide an `author` parameter, which is an object containing information about the author.The `author` section is optional and is filled in with the `committer` information if omitted. If the `committer` information is omitted, the authenticated user's information is used.You must provide values for both `name` and `email`, whether you choose to use `author` or `committer`. Otherwise, you'll receive a `422` status code.**Note:** If you use this endpoint and the "[Create or update file contents](https://docs.github.com/rest/repos/contents/#create-or-update-file-contents)" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead. +// returns a FileCommitable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a FileCommit503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/contents#delete-a-file +func (m *ItemItemContentsWithPathItemRequestBuilder) Delete(ctx context.Context, body ItemItemContentsItemWithPathDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FileCommitable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateFileCommit503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateFileCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FileCommitable), nil +} +// Get gets the contents of a file or directory in a repository. Specify the file path or directory with the `path` parameter. If you omit the `path` parameter, you will receive the contents of the repository's root directory.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents for files and symlinks.- **`application/vnd.github.html+json`**: Returns the file contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup).- **`application/vnd.github.object+json`**: Returns the contents in a consistent object format regardless of the content type. For example, instead of an array of objects for a directory, the response will be an object with an `entries` attribute containing the array of objects.If the content is a directory, the response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value _should_ be "submodule". This behavior exists [for backwards compatibility purposes](https://git.io/v1YCW). In the next major version of the API, the type will be returned as "submodule".If the content is a symlink and the symlink's target is a normal file in the repository, then the API responds with the content of the file. Otherwise, the API responds with an object describing the symlink itself.If the content is a submodule, the `submodule_git_url` field identifies the location of the submodule repository, and the `sha` identifies a specific commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit. If the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links["git"]`) and the github.com URLs (`html_url` and `_links["html"]`) will have null values.**Notes**:- To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/git/trees#get-a-tree).- This API has an upper limit of 1,000 files for a directory. If you need to retrievemore files, use the [Git Trees API](https://docs.github.com/rest/git/trees#get-a-tree).- Download URLs expire and are meant to be used just once. To ensure the download URL does not expire, please use the contents API to obtain a fresh download URL for each download.- If the requested file's size is: - 1 MB or smaller: All features of this endpoint are supported. - Between 1-100 MB: Only the `raw` or `object` custom media types are supported. Both will work as normal, except that when using the `object` media type, the `content` field will be an emptystring and the `encoding` field will be `"none"`. To get the contents of these larger files, use the `raw` media type. - Greater than 100 MB: This endpoint is not supported. +// returns a WithPathGetResponseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/contents#get-repository-content +func (m *ItemItemContentsWithPathItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemContentsWithPathItemRequestBuilderGetQueryParameters])(WithPathGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateWithPathGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(WithPathGetResponseable), nil +} +// Put creates a new file or replaces an existing file in a repository.**Note:** If you use this endpoint and the "[Delete a file](https://docs.github.com/rest/repos/contents/#delete-a-file)" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. The `workflow` scope is also required in order to modify files in the `.github/workflows` directory. +// returns a FileCommitable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/contents#create-or-update-file-contents +func (m *ItemItemContentsWithPathItemRequestBuilder) Put(ctx context.Context, body ItemItemContentsItemWithPathPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FileCommitable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateFileCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FileCommitable), nil +} +// ToDeleteRequestInformation deletes a file in a repository.You can provide an additional `committer` parameter, which is an object containing information about the committer. Or, you can provide an `author` parameter, which is an object containing information about the author.The `author` section is optional and is filled in with the `committer` information if omitted. If the `committer` information is omitted, the authenticated user's information is used.You must provide values for both `name` and `email`, whether you choose to use `author` or `committer`. Otherwise, you'll receive a `422` status code.**Note:** If you use this endpoint and the "[Create or update file contents](https://docs.github.com/rest/repos/contents/#create-or-update-file-contents)" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead. +// returns a *RequestInformation when successful +func (m *ItemItemContentsWithPathItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ItemItemContentsItemWithPathDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToGetRequestInformation gets the contents of a file or directory in a repository. Specify the file path or directory with the `path` parameter. If you omit the `path` parameter, you will receive the contents of the repository's root directory.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents for files and symlinks.- **`application/vnd.github.html+json`**: Returns the file contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup).- **`application/vnd.github.object+json`**: Returns the contents in a consistent object format regardless of the content type. For example, instead of an array of objects for a directory, the response will be an object with an `entries` attribute containing the array of objects.If the content is a directory, the response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value _should_ be "submodule". This behavior exists [for backwards compatibility purposes](https://git.io/v1YCW). In the next major version of the API, the type will be returned as "submodule".If the content is a symlink and the symlink's target is a normal file in the repository, then the API responds with the content of the file. Otherwise, the API responds with an object describing the symlink itself.If the content is a submodule, the `submodule_git_url` field identifies the location of the submodule repository, and the `sha` identifies a specific commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit. If the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links["git"]`) and the github.com URLs (`html_url` and `_links["html"]`) will have null values.**Notes**:- To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/git/trees#get-a-tree).- This API has an upper limit of 1,000 files for a directory. If you need to retrievemore files, use the [Git Trees API](https://docs.github.com/rest/git/trees#get-a-tree).- Download URLs expire and are meant to be used just once. To ensure the download URL does not expire, please use the contents API to obtain a fresh download URL for each download.- If the requested file's size is: - 1 MB or smaller: All features of this endpoint are supported. - Between 1-100 MB: Only the `raw` or `object` custom media types are supported. Both will work as normal, except that when using the `object` media type, the `content` field will be an emptystring and the `encoding` field will be `"none"`. To get the contents of these larger files, use the `raw` media type. - Greater than 100 MB: This endpoint is not supported. +// returns a *RequestInformation when successful +func (m *ItemItemContentsWithPathItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemContentsWithPathItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation creates a new file or replaces an existing file in a repository.**Note:** If you use this endpoint and the "[Delete a file](https://docs.github.com/rest/repos/contents/#delete-a-file)" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. The `workflow` scope is also required in order to modify files in the `.github/workflows` directory. +// returns a *RequestInformation when successful +func (m *ItemItemContentsWithPathItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemContentsItemWithPathPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemContentsWithPathItemRequestBuilder when successful +func (m *ItemItemContentsWithPathItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemContentsWithPathItemRequestBuilder) { + return NewItemItemContentsWithPathItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contributors_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contributors_request_builder.go new file mode 100644 index 000000000..3ef352dc3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_contributors_request_builder.go @@ -0,0 +1,75 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemContributorsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\contributors +type ItemItemContributorsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemContributorsRequestBuilderGetQueryParameters lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API caches contributor data to improve performance.GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information. +type ItemItemContributorsRequestBuilderGetQueryParameters struct { + // Set to `1` or `true` to include anonymous contributors in results. + Anon *string `uriparametername:"anon"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemContributorsRequestBuilderInternal instantiates a new ItemItemContributorsRequestBuilder and sets the default values. +func NewItemItemContributorsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemContributorsRequestBuilder) { + m := &ItemItemContributorsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/contributors{?anon*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemContributorsRequestBuilder instantiates a new ItemItemContributorsRequestBuilder and sets the default values. +func NewItemItemContributorsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemContributorsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemContributorsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API caches contributor data to improve performance.GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information. +// returns a []Contributorable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#list-repository-contributors +func (m *ItemItemContributorsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemContributorsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Contributorable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateContributorFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Contributorable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Contributorable) + } + } + return val, nil +} +// ToGetRequestInformation lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API caches contributor data to improve performance.GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information. +// returns a *RequestInformation when successful +func (m *ItemItemContributorsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemContributorsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemContributorsRequestBuilder when successful +func (m *ItemItemContributorsRequestBuilder) WithUrl(rawUrl string)(*ItemItemContributorsRequestBuilder) { + return NewItemItemContributorsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_alerts_item_with_alert_number_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_alerts_item_with_alert_number_patch_request_body.go new file mode 100644 index 000000000..60e7716d3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_alerts_item_with_alert_number_patch_request_body.go @@ -0,0 +1,61 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody struct { + // An optional comment associated with dismissing the alert. + dismissed_comment *string +} +// NewItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody instantiates a new ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody and sets the default values. +func NewItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody()(*ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody) { + m := &ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody{ + } + return m +} +// CreateItemItemDependabotAlertsItemWithAlert_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemDependabotAlertsItemWithAlert_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody(), nil +} +// GetDismissedComment gets the dismissed_comment property value. An optional comment associated with dismissing the alert. +// returns a *string when successful +func (m *ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody) GetDismissedComment()(*string) { + return m.dismissed_comment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["dismissed_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedComment(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("dismissed_comment", m.GetDismissedComment()) + if err != nil { + return err + } + } + return nil +} +// SetDismissedComment sets the dismissed_comment property value. An optional comment associated with dismissing the alert. +func (m *ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody) SetDismissedComment(value *string)() { + m.dismissed_comment = value +} +type ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDismissedComment()(*string) + SetDismissedComment(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_alerts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_alerts_request_builder.go new file mode 100644 index 000000000..4146506d2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_alerts_request_builder.go @@ -0,0 +1,115 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i4239b9a99f590fb557f6cee5c0b7a464cc1a12da753e0582e737b6a06899504e "github.com/octokit/go-sdk/pkg/github/repos/item/item/dependabot/alerts" +) + +// ItemItemDependabotAlertsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependabot\alerts +type ItemItemDependabotAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemDependabotAlertsRequestBuilderGetQueryParameters oAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +type ItemItemDependabotAlertsRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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)." + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *i4239b9a99f590fb557f6cee5c0b7a464cc1a12da753e0582e737b6a06899504e.GetDirectionQueryParameterType `uriparametername:"direction"` + // A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned.Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust` + Ecosystem *string `uriparametername:"ecosystem"` + // **Deprecated**. The number of results per page (max 100), starting from the first matching result.This parameter must not be used in combination with `last`.Instead, use `per_page` in combination with `after` to fetch the first page of results. + First *int32 `uriparametername:"first"` + // **Deprecated**. The number of results per page (max 100), starting from the last matching result.This parameter must not be used in combination with `first`.Instead, use `per_page` in combination with `before` to fetch the last page of results. + Last *int32 `uriparametername:"last"` + // A comma-separated list of full manifest paths. If specified, only alerts for these manifests will be returned. + Manifest *string `uriparametername:"manifest"` + // A comma-separated list of package names. If specified, only alerts for these packages will be returned. + Package *string `uriparametername:"package"` + // **Deprecated**. Page number of the results to fetch. Use cursor-based pagination with `before` or `after` instead. + // Deprecated: + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + // Deprecated: + Per_page *int32 `uriparametername:"per_page"` + // The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. + Scope *i4239b9a99f590fb557f6cee5c0b7a464cc1a12da753e0582e737b6a06899504e.GetScopeQueryParameterType `uriparametername:"scope"` + // A comma-separated list of severities. If specified, only alerts with these severities will be returned.Can be: `low`, `medium`, `high`, `critical` + Severity *string `uriparametername:"severity"` + // The property by which to sort the results.`created` means when the alert was created.`updated` means when the alert's state last changed. + Sort *i4239b9a99f590fb557f6cee5c0b7a464cc1a12da753e0582e737b6a06899504e.GetSortQueryParameterType `uriparametername:"sort"` + // A comma-separated list of states. If specified, only alerts with these states will be returned.Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` + State *string `uriparametername:"state"` +} +// ByAlert_number gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.dependabot.alerts.item collection +// returns a *ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder when successful +func (m *ItemItemDependabotAlertsRequestBuilder) ByAlert_number(alert_number int32)(*ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["alert_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(alert_number), 10) + return NewItemItemDependabotAlertsWithAlert_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemDependabotAlertsRequestBuilderInternal instantiates a new ItemItemDependabotAlertsRequestBuilder and sets the default values. +func NewItemItemDependabotAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotAlertsRequestBuilder) { + m := &ItemItemDependabotAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependabot/alerts{?after*,before*,direction*,ecosystem*,first*,last*,manifest*,package*,page*,per_page*,scope*,severity*,sort*,state*}", pathParameters), + } + return m +} +// NewItemItemDependabotAlertsRequestBuilder instantiates a new ItemItemDependabotAlertsRequestBuilder and sets the default values. +func NewItemItemDependabotAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependabotAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get oAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a []DependabotAlertable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository +func (m *ItemItemDependabotAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDependabotAlertsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotAlertable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDependabotAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotAlertable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotAlertable) + } + } + return val, nil +} +// ToGetRequestInformation oAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemItemDependabotAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDependabotAlertsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemDependabotAlertsRequestBuilder when successful +func (m *ItemItemDependabotAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemItemDependabotAlertsRequestBuilder) { + return NewItemItemDependabotAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_alerts_with_alert_number_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_alerts_with_alert_number_item_request_builder.go new file mode 100644 index 000000000..917241c48 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_alerts_with_alert_number_item_request_builder.go @@ -0,0 +1,106 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependabot\alerts\{alert_number} +type ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemDependabotAlertsWithAlert_numberItemRequestBuilderInternal instantiates a new ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder and sets the default values. +func NewItemItemDependabotAlertsWithAlert_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) { + m := &ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependabot/alerts/{alert_number}", pathParameters), + } + return m +} +// NewItemItemDependabotAlertsWithAlert_numberItemRequestBuilder instantiates a new ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder and sets the default values. +func NewItemItemDependabotAlertsWithAlert_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependabotAlertsWithAlert_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get oAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a DependabotAlertable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert +func (m *ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotAlertable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDependabotAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotAlertable), nil +} +// Patch the authenticated user must have access to security alerts for the repository to use this endpoint. For more information, see "[Granting access to security alerts](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts)."OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a DependabotAlertable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert +func (m *ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) Patch(ctx context.Context, body ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotAlertable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDependabotAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotAlertable), nil +} +// ToGetRequestInformation oAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation the authenticated user must have access to security alerts for the repository to use this endpoint. For more information, see "[Granting access to security alerts](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts)."OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder when successful +func (m *ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) { + return NewItemItemDependabotAlertsWithAlert_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_request_builder.go new file mode 100644 index 000000000..ca39c1175 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_request_builder.go @@ -0,0 +1,33 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemDependabotRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependabot +type ItemItemDependabotRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Alerts the alerts property +// returns a *ItemItemDependabotAlertsRequestBuilder when successful +func (m *ItemItemDependabotRequestBuilder) Alerts()(*ItemItemDependabotAlertsRequestBuilder) { + return NewItemItemDependabotAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemDependabotRequestBuilderInternal instantiates a new ItemItemDependabotRequestBuilder and sets the default values. +func NewItemItemDependabotRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotRequestBuilder) { + m := &ItemItemDependabotRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependabot", pathParameters), + } + return m +} +// NewItemItemDependabotRequestBuilder instantiates a new ItemItemDependabotRequestBuilder and sets the default values. +func NewItemItemDependabotRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependabotRequestBuilderInternal(urlParams, requestAdapter) +} +// Secrets the secrets property +// returns a *ItemItemDependabotSecretsRequestBuilder when successful +func (m *ItemItemDependabotRequestBuilder) Secrets()(*ItemItemDependabotSecretsRequestBuilder) { + return NewItemItemDependabotSecretsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_get_response.go new file mode 100644 index 000000000..bdae4b552 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemDependabotSecretsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The secrets property + secrets []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotSecretable + // The total_count property + total_count *int32 +} +// NewItemItemDependabotSecretsGetResponse instantiates a new ItemItemDependabotSecretsGetResponse and sets the default values. +func NewItemItemDependabotSecretsGetResponse()(*ItemItemDependabotSecretsGetResponse) { + m := &ItemItemDependabotSecretsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemDependabotSecretsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemDependabotSecretsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDependabotSecretsGetResponse(), 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 *ItemItemDependabotSecretsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemDependabotSecretsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDependabotSecretFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotSecretable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotSecretable) + } + } + m.SetSecrets(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetSecrets gets the secrets property value. The secrets property +// returns a []DependabotSecretable when successful +func (m *ItemItemDependabotSecretsGetResponse) GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotSecretable) { + return m.secrets +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemDependabotSecretsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemDependabotSecretsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecrets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSecrets())) + for i, v := range m.GetSecrets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("secrets", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemDependabotSecretsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSecrets sets the secrets property value. The secrets property +func (m *ItemItemDependabotSecretsGetResponse) SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotSecretable)() { + m.secrets = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemDependabotSecretsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemDependabotSecretsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotSecretable) + GetTotalCount()(*int32) + SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotSecretable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_item_with_secret_name_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_item_with_secret_name_put_request_body.go new file mode 100644 index 000000000..fb8fffc6a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_item_with_secret_name_put_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemDependabotSecretsItemWithSecret_namePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key) endpoint. + encrypted_value *string + // ID of the key you used to encrypt the secret. + key_id *string +} +// NewItemItemDependabotSecretsItemWithSecret_namePutRequestBody instantiates a new ItemItemDependabotSecretsItemWithSecret_namePutRequestBody and sets the default values. +func NewItemItemDependabotSecretsItemWithSecret_namePutRequestBody()(*ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) { + m := &ItemItemDependabotSecretsItemWithSecret_namePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemDependabotSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemDependabotSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDependabotSecretsItemWithSecret_namePutRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncryptedValue gets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key) endpoint. +// returns a *string when successful +func (m *ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) GetEncryptedValue()(*string) { + return m.encrypted_value +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["encrypted_value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncryptedValue(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + return res +} +// GetKeyId gets the key_id property value. ID of the key you used to encrypt the secret. +// returns a *string when successful +func (m *ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) GetKeyId()(*string) { + return m.key_id +} +// Serialize serializes information the current object +func (m *ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("encrypted_value", m.GetEncryptedValue()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncryptedValue sets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key) endpoint. +func (m *ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) SetEncryptedValue(value *string)() { + m.encrypted_value = value +} +// SetKeyId sets the key_id property value. ID of the key you used to encrypt the secret. +func (m *ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) SetKeyId(value *string)() { + m.key_id = value +} +type ItemItemDependabotSecretsItemWithSecret_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncryptedValue()(*string) + GetKeyId()(*string) + SetEncryptedValue(value *string)() + SetKeyId(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_public_key_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_public_key_request_builder.go new file mode 100644 index 000000000..892ba8843 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_public_key_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemDependabotSecretsPublicKeyRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependabot\secrets\public-key +type ItemItemDependabotSecretsPublicKeyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemDependabotSecretsPublicKeyRequestBuilderInternal instantiates a new ItemItemDependabotSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemItemDependabotSecretsPublicKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotSecretsPublicKeyRequestBuilder) { + m := &ItemItemDependabotSecretsPublicKeyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependabot/secrets/public-key", pathParameters), + } + return m +} +// NewItemItemDependabotSecretsPublicKeyRequestBuilder instantiates a new ItemItemDependabotSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemItemDependabotSecretsPublicKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotSecretsPublicKeyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependabotSecretsPublicKeyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets. Anyone with read accessto the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the repository is private. +// returns a DependabotPublicKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key +func (m *ItemItemDependabotSecretsPublicKeyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotPublicKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDependabotPublicKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotPublicKeyable), nil +} +// ToGetRequestInformation gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets. Anyone with read accessto the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the repository is private. +// returns a *RequestInformation when successful +func (m *ItemItemDependabotSecretsPublicKeyRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemDependabotSecretsPublicKeyRequestBuilder when successful +func (m *ItemItemDependabotSecretsPublicKeyRequestBuilder) WithUrl(rawUrl string)(*ItemItemDependabotSecretsPublicKeyRequestBuilder) { + return NewItemItemDependabotSecretsPublicKeyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_request_builder.go new file mode 100644 index 000000000..9e32d7c88 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_request_builder.go @@ -0,0 +1,80 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemDependabotSecretsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependabot\secrets +type ItemItemDependabotSecretsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemDependabotSecretsRequestBuilderGetQueryParameters lists all secrets available in a repository without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemDependabotSecretsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// BySecret_name gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.dependabot.secrets.item collection +// returns a *ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemItemDependabotSecretsRequestBuilder) BySecret_name(secret_name string)(*ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if secret_name != "" { + urlTplParams["secret_name"] = secret_name + } + return NewItemItemDependabotSecretsWithSecret_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemDependabotSecretsRequestBuilderInternal instantiates a new ItemItemDependabotSecretsRequestBuilder and sets the default values. +func NewItemItemDependabotSecretsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotSecretsRequestBuilder) { + m := &ItemItemDependabotSecretsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependabot/secrets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemDependabotSecretsRequestBuilder instantiates a new ItemItemDependabotSecretsRequestBuilder and sets the default values. +func NewItemItemDependabotSecretsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotSecretsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependabotSecretsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all secrets available in a repository without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemDependabotSecretsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets +func (m *ItemItemDependabotSecretsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDependabotSecretsRequestBuilderGetQueryParameters])(ItemItemDependabotSecretsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemDependabotSecretsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemDependabotSecretsGetResponseable), nil +} +// PublicKey the publicKey property +// returns a *ItemItemDependabotSecretsPublicKeyRequestBuilder when successful +func (m *ItemItemDependabotSecretsRequestBuilder) PublicKey()(*ItemItemDependabotSecretsPublicKeyRequestBuilder) { + return NewItemItemDependabotSecretsPublicKeyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all secrets available in a repository without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemDependabotSecretsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDependabotSecretsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemDependabotSecretsRequestBuilder when successful +func (m *ItemItemDependabotSecretsRequestBuilder) WithUrl(rawUrl string)(*ItemItemDependabotSecretsRequestBuilder) { + return NewItemItemDependabotSecretsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_response.go new file mode 100644 index 000000000..dfdaa7bbb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemDependabotSecretsResponse +// Deprecated: This class is obsolete. Use secretsGetResponse instead. +type ItemItemDependabotSecretsResponse struct { + ItemItemDependabotSecretsGetResponse +} +// NewItemItemDependabotSecretsResponse instantiates a new ItemItemDependabotSecretsResponse and sets the default values. +func NewItemItemDependabotSecretsResponse()(*ItemItemDependabotSecretsResponse) { + m := &ItemItemDependabotSecretsResponse{ + ItemItemDependabotSecretsGetResponse: *NewItemItemDependabotSecretsGetResponse(), + } + return m +} +// CreateItemItemDependabotSecretsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemDependabotSecretsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDependabotSecretsResponse(), nil +} +// ItemItemDependabotSecretsResponseable +// Deprecated: This class is obsolete. Use secretsGetResponse instead. +type ItemItemDependabotSecretsResponseable interface { + ItemItemDependabotSecretsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_with_secret_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_with_secret_name_item_request_builder.go new file mode 100644 index 000000000..57625ff07 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependabot_secrets_with_secret_name_item_request_builder.go @@ -0,0 +1,110 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependabot\secrets\{secret_name} +type ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemDependabotSecretsWithSecret_nameItemRequestBuilderInternal instantiates a new ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemItemDependabotSecretsWithSecret_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) { + m := &ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependabot/secrets/{secret_name}", pathParameters), + } + return m +} +// NewItemItemDependabotSecretsWithSecret_nameItemRequestBuilder instantiates a new ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemItemDependabotSecretsWithSecret_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependabotSecretsWithSecret_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a secret in a repository using the secret name.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret +func (m *ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a single repository secret without revealing its encrypted value.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a DependabotSecretable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret +func (m *ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotSecretable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDependabotSecretFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependabotSecretable), nil +} +// Put creates or updates a repository secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret +func (m *ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) Put(ctx context.Context, body ItemItemDependabotSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToDeleteRequestInformation deletes a secret in a repository using the secret name.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a single repository secret without revealing its encrypted value.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation creates or updates a repository secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemDependabotSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) { + return NewItemItemDependabotSecretsWithSecret_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_compare_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_compare_request_builder.go new file mode 100644 index 000000000..06e23c5fe --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_compare_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemDependencyGraphCompareRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependency-graph\compare +type ItemItemDependencyGraphCompareRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByBasehead gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.dependencyGraph.compare.item collection +// returns a *ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder when successful +func (m *ItemItemDependencyGraphCompareRequestBuilder) ByBasehead(basehead string)(*ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if basehead != "" { + urlTplParams["basehead"] = basehead + } + return NewItemItemDependencyGraphCompareWithBaseheadItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemDependencyGraphCompareRequestBuilderInternal instantiates a new ItemItemDependencyGraphCompareRequestBuilder and sets the default values. +func NewItemItemDependencyGraphCompareRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphCompareRequestBuilder) { + m := &ItemItemDependencyGraphCompareRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependency-graph/compare", pathParameters), + } + return m +} +// NewItemItemDependencyGraphCompareRequestBuilder instantiates a new ItemItemDependencyGraphCompareRequestBuilder and sets the default values. +func NewItemItemDependencyGraphCompareRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphCompareRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependencyGraphCompareRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_compare_with_basehead_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_compare_with_basehead_item_request_builder.go new file mode 100644 index 000000000..88c692441 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_compare_with_basehead_item_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependency-graph\compare\{basehead} +type ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilderGetQueryParameters gets the diff of the dependency changes between two commits of a repository, based on the changes to the dependency manifests made in those commits. +type ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilderGetQueryParameters struct { + // The full path, relative to the repository root, of the dependency manifest file. + Name *string `uriparametername:"name"` +} +// NewItemItemDependencyGraphCompareWithBaseheadItemRequestBuilderInternal instantiates a new ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder and sets the default values. +func NewItemItemDependencyGraphCompareWithBaseheadItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder) { + m := &ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependency-graph/compare/{basehead}{?name*}", pathParameters), + } + return m +} +// NewItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder instantiates a new ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder and sets the default values. +func NewItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependencyGraphCompareWithBaseheadItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the diff of the dependency changes between two commits of a repository, based on the changes to the dependency manifests made in those commits. +// returns a []DependencyGraphDiffable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependency-graph/dependency-review#get-a-diff-of-the-dependencies-between-commits +func (m *ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependencyGraphDiffable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDependencyGraphDiffFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependencyGraphDiffable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependencyGraphDiffable) + } + } + return val, nil +} +// ToGetRequestInformation gets the diff of the dependency changes between two commits of a repository, based on the changes to the dependency manifests made in those commits. +// returns a *RequestInformation when successful +func (m *ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder when successful +func (m *ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder) { + return NewItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_request_builder.go new file mode 100644 index 000000000..3662dca32 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_request_builder.go @@ -0,0 +1,38 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemDependencyGraphRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependency-graph +type ItemItemDependencyGraphRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Compare the compare property +// returns a *ItemItemDependencyGraphCompareRequestBuilder when successful +func (m *ItemItemDependencyGraphRequestBuilder) Compare()(*ItemItemDependencyGraphCompareRequestBuilder) { + return NewItemItemDependencyGraphCompareRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemDependencyGraphRequestBuilderInternal instantiates a new ItemItemDependencyGraphRequestBuilder and sets the default values. +func NewItemItemDependencyGraphRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphRequestBuilder) { + m := &ItemItemDependencyGraphRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependency-graph", pathParameters), + } + return m +} +// NewItemItemDependencyGraphRequestBuilder instantiates a new ItemItemDependencyGraphRequestBuilder and sets the default values. +func NewItemItemDependencyGraphRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependencyGraphRequestBuilderInternal(urlParams, requestAdapter) +} +// Sbom the sbom property +// returns a *ItemItemDependencyGraphSbomRequestBuilder when successful +func (m *ItemItemDependencyGraphRequestBuilder) Sbom()(*ItemItemDependencyGraphSbomRequestBuilder) { + return NewItemItemDependencyGraphSbomRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Snapshots the snapshots property +// returns a *ItemItemDependencyGraphSnapshotsRequestBuilder when successful +func (m *ItemItemDependencyGraphRequestBuilder) Snapshots()(*ItemItemDependencyGraphSnapshotsRequestBuilder) { + return NewItemItemDependencyGraphSnapshotsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_sbom_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_sbom_request_builder.go new file mode 100644 index 000000000..35eda9c8c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_sbom_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemDependencyGraphSbomRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependency-graph\sbom +type ItemItemDependencyGraphSbomRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemDependencyGraphSbomRequestBuilderInternal instantiates a new ItemItemDependencyGraphSbomRequestBuilder and sets the default values. +func NewItemItemDependencyGraphSbomRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphSbomRequestBuilder) { + m := &ItemItemDependencyGraphSbomRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependency-graph/sbom", pathParameters), + } + return m +} +// NewItemItemDependencyGraphSbomRequestBuilder instantiates a new ItemItemDependencyGraphSbomRequestBuilder and sets the default values. +func NewItemItemDependencyGraphSbomRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphSbomRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependencyGraphSbomRequestBuilderInternal(urlParams, requestAdapter) +} +// Get exports the software bill of materials (SBOM) for a repository in SPDX JSON format. +// returns a DependencyGraphSpdxSbomable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository +func (m *ItemItemDependencyGraphSbomRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependencyGraphSpdxSbomable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDependencyGraphSpdxSbomFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DependencyGraphSpdxSbomable), nil +} +// ToGetRequestInformation exports the software bill of materials (SBOM) for a repository in SPDX JSON format. +// returns a *RequestInformation when successful +func (m *ItemItemDependencyGraphSbomRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemDependencyGraphSbomRequestBuilder when successful +func (m *ItemItemDependencyGraphSbomRequestBuilder) WithUrl(rawUrl string)(*ItemItemDependencyGraphSbomRequestBuilder) { + return NewItemItemDependencyGraphSbomRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_snapshots_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_snapshots_post_response.go new file mode 100644 index 000000000..c53131250 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_snapshots_post_response.go @@ -0,0 +1,167 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemDependencyGraphSnapshotsPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time at which the snapshot was created. + created_at *string + // ID of the created snapshot. + id *int32 + // A message providing further details about the result, such as why the dependencies were not updated. + message *string + // Either "SUCCESS", "ACCEPTED", or "INVALID". "SUCCESS" indicates that the snapshot was successfully created and the repository's dependencies were updated. "ACCEPTED" indicates that the snapshot was successfully created, but the repository's dependencies were not updated. "INVALID" indicates that the snapshot was malformed. + result *string +} +// NewItemItemDependencyGraphSnapshotsPostResponse instantiates a new ItemItemDependencyGraphSnapshotsPostResponse and sets the default values. +func NewItemItemDependencyGraphSnapshotsPostResponse()(*ItemItemDependencyGraphSnapshotsPostResponse) { + m := &ItemItemDependencyGraphSnapshotsPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemDependencyGraphSnapshotsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemDependencyGraphSnapshotsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDependencyGraphSnapshotsPostResponse(), 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 *ItemItemDependencyGraphSnapshotsPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The time at which the snapshot was created. +// returns a *string when successful +func (m *ItemItemDependencyGraphSnapshotsPostResponse) GetCreatedAt()(*string) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemDependencyGraphSnapshotsPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["result"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResult(val) + } + return nil + } + return res +} +// GetId gets the id property value. ID of the created snapshot. +// returns a *int32 when successful +func (m *ItemItemDependencyGraphSnapshotsPostResponse) GetId()(*int32) { + return m.id +} +// GetMessage gets the message property value. A message providing further details about the result, such as why the dependencies were not updated. +// returns a *string when successful +func (m *ItemItemDependencyGraphSnapshotsPostResponse) GetMessage()(*string) { + return m.message +} +// GetResult gets the result property value. Either "SUCCESS", "ACCEPTED", or "INVALID". "SUCCESS" indicates that the snapshot was successfully created and the repository's dependencies were updated. "ACCEPTED" indicates that the snapshot was successfully created, but the repository's dependencies were not updated. "INVALID" indicates that the snapshot was malformed. +// returns a *string when successful +func (m *ItemItemDependencyGraphSnapshotsPostResponse) GetResult()(*string) { + return m.result +} +// Serialize serializes information the current object +func (m *ItemItemDependencyGraphSnapshotsPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("result", m.GetResult()) + 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 *ItemItemDependencyGraphSnapshotsPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The time at which the snapshot was created. +func (m *ItemItemDependencyGraphSnapshotsPostResponse) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetId sets the id property value. ID of the created snapshot. +func (m *ItemItemDependencyGraphSnapshotsPostResponse) SetId(value *int32)() { + m.id = value +} +// SetMessage sets the message property value. A message providing further details about the result, such as why the dependencies were not updated. +func (m *ItemItemDependencyGraphSnapshotsPostResponse) SetMessage(value *string)() { + m.message = value +} +// SetResult sets the result property value. Either "SUCCESS", "ACCEPTED", or "INVALID". "SUCCESS" indicates that the snapshot was successfully created and the repository's dependencies were updated. "ACCEPTED" indicates that the snapshot was successfully created, but the repository's dependencies were not updated. "INVALID" indicates that the snapshot was malformed. +func (m *ItemItemDependencyGraphSnapshotsPostResponse) SetResult(value *string)() { + m.result = value +} +type ItemItemDependencyGraphSnapshotsPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*string) + GetId()(*int32) + GetMessage()(*string) + GetResult()(*string) + SetCreatedAt(value *string)() + SetId(value *int32)() + SetMessage(value *string)() + SetResult(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_snapshots_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_snapshots_request_builder.go new file mode 100644 index 000000000..12391ff7d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_snapshots_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemDependencyGraphSnapshotsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependency-graph\snapshots +type ItemItemDependencyGraphSnapshotsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemDependencyGraphSnapshotsRequestBuilderInternal instantiates a new ItemItemDependencyGraphSnapshotsRequestBuilder and sets the default values. +func NewItemItemDependencyGraphSnapshotsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphSnapshotsRequestBuilder) { + m := &ItemItemDependencyGraphSnapshotsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependency-graph/snapshots", pathParameters), + } + return m +} +// NewItemItemDependencyGraphSnapshotsRequestBuilder instantiates a new ItemItemDependencyGraphSnapshotsRequestBuilder and sets the default values. +func NewItemItemDependencyGraphSnapshotsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphSnapshotsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependencyGraphSnapshotsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post create a new snapshot of a repository's dependencies.The authenticated user must have access to the repository.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemDependencyGraphSnapshotsPostResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +func (m *ItemItemDependencyGraphSnapshotsRequestBuilder) Post(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Snapshotable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemDependencyGraphSnapshotsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemDependencyGraphSnapshotsPostResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemDependencyGraphSnapshotsPostResponseable), nil +} +// ToPostRequestInformation create a new snapshot of a repository's dependencies.The authenticated user must have access to the repository.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemDependencyGraphSnapshotsRequestBuilder) ToPostRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Snapshotable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemDependencyGraphSnapshotsRequestBuilder when successful +func (m *ItemItemDependencyGraphSnapshotsRequestBuilder) WithUrl(rawUrl string)(*ItemItemDependencyGraphSnapshotsRequestBuilder) { + return NewItemItemDependencyGraphSnapshotsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_snapshots_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_snapshots_response.go new file mode 100644 index 000000000..79ddb502e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dependency_graph_snapshots_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemDependencyGraphSnapshotsResponse +// Deprecated: This class is obsolete. Use snapshotsPostResponse instead. +type ItemItemDependencyGraphSnapshotsResponse struct { + ItemItemDependencyGraphSnapshotsPostResponse +} +// NewItemItemDependencyGraphSnapshotsResponse instantiates a new ItemItemDependencyGraphSnapshotsResponse and sets the default values. +func NewItemItemDependencyGraphSnapshotsResponse()(*ItemItemDependencyGraphSnapshotsResponse) { + m := &ItemItemDependencyGraphSnapshotsResponse{ + ItemItemDependencyGraphSnapshotsPostResponse: *NewItemItemDependencyGraphSnapshotsPostResponse(), + } + return m +} +// CreateItemItemDependencyGraphSnapshotsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemDependencyGraphSnapshotsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDependencyGraphSnapshotsResponse(), nil +} +// ItemItemDependencyGraphSnapshotsResponseable +// Deprecated: This class is obsolete. Use snapshotsPostResponse instead. +type ItemItemDependencyGraphSnapshotsResponseable interface { + ItemItemDependencyGraphSnapshotsPostResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_item_statuses_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_item_statuses_post_request_body.go new file mode 100644 index 000000000..b1edea5d3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_item_statuses_post_request_body.go @@ -0,0 +1,225 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemDeploymentsItemStatusesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Adds a new `inactive` status to all prior non-transient, non-production environment deployments with the same repository and `environment` name as the created status's deployment. An `inactive` status is only added to deployments that had a `success` state. Default: `true` + auto_inactive *bool + // A short description of the status. The maximum description length is 140 characters. + description *string + // Name for the target deployment environment, which can be changed when setting a deploy status. For example, `production`, `staging`, or `qa`. If not defined, the environment of the previous status on the deployment will be used, if it exists. Otherwise, the environment of the deployment will be used. + environment *string + // Sets the URL for accessing your environment. Default: `""` + environment_url *string + // The full URL of the deployment's output. This parameter replaces `target_url`. We will continue to accept `target_url` to support legacy uses, but we recommend replacing `target_url` with `log_url`. Setting `log_url` will automatically set `target_url` to the same value. Default: `""` + log_url *string + // The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. **Note:** It's recommended to use the `log_url` parameter, which replaces `target_url`. + target_url *string +} +// NewItemItemDeploymentsItemStatusesPostRequestBody instantiates a new ItemItemDeploymentsItemStatusesPostRequestBody and sets the default values. +func NewItemItemDeploymentsItemStatusesPostRequestBody()(*ItemItemDeploymentsItemStatusesPostRequestBody) { + m := &ItemItemDeploymentsItemStatusesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemDeploymentsItemStatusesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemDeploymentsItemStatusesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDeploymentsItemStatusesPostRequestBody(), 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 *ItemItemDeploymentsItemStatusesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAutoInactive gets the auto_inactive property value. Adds a new `inactive` status to all prior non-transient, non-production environment deployments with the same repository and `environment` name as the created status's deployment. An `inactive` status is only added to deployments that had a `success` state. Default: `true` +// returns a *bool when successful +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) GetAutoInactive()(*bool) { + return m.auto_inactive +} +// GetDescription gets the description property value. A short description of the status. The maximum description length is 140 characters. +// returns a *string when successful +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) GetDescription()(*string) { + return m.description +} +// GetEnvironment gets the environment property value. Name for the target deployment environment, which can be changed when setting a deploy status. For example, `production`, `staging`, or `qa`. If not defined, the environment of the previous status on the deployment will be used, if it exists. Otherwise, the environment of the deployment will be used. +// returns a *string when successful +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) GetEnvironment()(*string) { + return m.environment +} +// GetEnvironmentUrl gets the environment_url property value. Sets the URL for accessing your environment. Default: `""` +// returns a *string when successful +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) GetEnvironmentUrl()(*string) { + return m.environment_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["auto_inactive"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAutoInactive(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val) + } + return nil + } + res["environment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironmentUrl(val) + } + return nil + } + res["log_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogUrl(val) + } + return nil + } + res["target_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetUrl(val) + } + return nil + } + return res +} +// GetLogUrl gets the log_url property value. The full URL of the deployment's output. This parameter replaces `target_url`. We will continue to accept `target_url` to support legacy uses, but we recommend replacing `target_url` with `log_url`. Setting `log_url` will automatically set `target_url` to the same value. Default: `""` +// returns a *string when successful +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) GetLogUrl()(*string) { + return m.log_url +} +// GetTargetUrl gets the target_url property value. The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. **Note:** It's recommended to use the `log_url` parameter, which replaces `target_url`. +// returns a *string when successful +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) GetTargetUrl()(*string) { + return m.target_url +} +// Serialize serializes information the current object +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("auto_inactive", m.GetAutoInactive()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment_url", m.GetEnvironmentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("log_url", m.GetLogUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_url", m.GetTargetUrl()) + 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 *ItemItemDeploymentsItemStatusesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAutoInactive sets the auto_inactive property value. Adds a new `inactive` status to all prior non-transient, non-production environment deployments with the same repository and `environment` name as the created status's deployment. An `inactive` status is only added to deployments that had a `success` state. Default: `true` +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) SetAutoInactive(value *bool)() { + m.auto_inactive = value +} +// SetDescription sets the description property value. A short description of the status. The maximum description length is 140 characters. +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetEnvironment sets the environment property value. Name for the target deployment environment, which can be changed when setting a deploy status. For example, `production`, `staging`, or `qa`. If not defined, the environment of the previous status on the deployment will be used, if it exists. Otherwise, the environment of the deployment will be used. +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) SetEnvironment(value *string)() { + m.environment = value +} +// SetEnvironmentUrl sets the environment_url property value. Sets the URL for accessing your environment. Default: `""` +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) SetEnvironmentUrl(value *string)() { + m.environment_url = value +} +// SetLogUrl sets the log_url property value. The full URL of the deployment's output. This parameter replaces `target_url`. We will continue to accept `target_url` to support legacy uses, but we recommend replacing `target_url` with `log_url`. Setting `log_url` will automatically set `target_url` to the same value. Default: `""` +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) SetLogUrl(value *string)() { + m.log_url = value +} +// SetTargetUrl sets the target_url property value. The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. **Note:** It's recommended to use the `log_url` parameter, which replaces `target_url`. +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) SetTargetUrl(value *string)() { + m.target_url = value +} +type ItemItemDeploymentsItemStatusesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAutoInactive()(*bool) + GetDescription()(*string) + GetEnvironment()(*string) + GetEnvironmentUrl()(*string) + GetLogUrl()(*string) + GetTargetUrl()(*string) + SetAutoInactive(value *bool)() + SetDescription(value *string)() + SetEnvironment(value *string)() + SetEnvironmentUrl(value *string)() + SetLogUrl(value *string)() + SetTargetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_item_statuses_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_item_statuses_request_builder.go new file mode 100644 index 000000000..3130d6d6d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_item_statuses_request_builder.go @@ -0,0 +1,117 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemDeploymentsItemStatusesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\deployments\{deployment_id}\statuses +type ItemItemDeploymentsItemStatusesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemDeploymentsItemStatusesRequestBuilderGetQueryParameters users with pull access can view deployment statuses for a deployment: +type ItemItemDeploymentsItemStatusesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByStatus_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.deployments.item.statuses.item collection +// returns a *ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder when successful +func (m *ItemItemDeploymentsItemStatusesRequestBuilder) ByStatus_id(status_id int32)(*ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["status_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(status_id), 10) + return NewItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemDeploymentsItemStatusesRequestBuilderInternal instantiates a new ItemItemDeploymentsItemStatusesRequestBuilder and sets the default values. +func NewItemItemDeploymentsItemStatusesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDeploymentsItemStatusesRequestBuilder) { + m := &ItemItemDeploymentsItemStatusesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/deployments/{deployment_id}/statuses{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemDeploymentsItemStatusesRequestBuilder instantiates a new ItemItemDeploymentsItemStatusesRequestBuilder and sets the default values. +func NewItemItemDeploymentsItemStatusesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDeploymentsItemStatusesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDeploymentsItemStatusesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get users with pull access can view deployment statuses for a deployment: +// returns a []DeploymentStatusable 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/deployments/statuses#list-deployment-statuses +func (m *ItemItemDeploymentsItemStatusesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDeploymentsItemStatusesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentStatusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeploymentStatusFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentStatusable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentStatusable) + } + } + return val, nil +} +// Post users with `push` access can create deployment statuses for a given deployment.OAuth app tokens and personal access tokens (classic) need the `repo_deployment` scope to use this endpoint. +// returns a DeploymentStatusable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status +func (m *ItemItemDeploymentsItemStatusesRequestBuilder) Post(ctx context.Context, body ItemItemDeploymentsItemStatusesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentStatusable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeploymentStatusFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentStatusable), nil +} +// ToGetRequestInformation users with pull access can view deployment statuses for a deployment: +// returns a *RequestInformation when successful +func (m *ItemItemDeploymentsItemStatusesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDeploymentsItemStatusesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation users with `push` access can create deployment statuses for a given deployment.OAuth app tokens and personal access tokens (classic) need the `repo_deployment` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemDeploymentsItemStatusesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemDeploymentsItemStatusesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemDeploymentsItemStatusesRequestBuilder when successful +func (m *ItemItemDeploymentsItemStatusesRequestBuilder) WithUrl(rawUrl string)(*ItemItemDeploymentsItemStatusesRequestBuilder) { + return NewItemItemDeploymentsItemStatusesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_item_statuses_with_status_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_item_statuses_with_status_item_request_builder.go new file mode 100644 index 000000000..0c413d595 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_item_statuses_with_status_item_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\deployments\{deployment_id}\statuses\{status_id} +type ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilderInternal instantiates a new ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder and sets the default values. +func NewItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder) { + m := &ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/deployments/{deployment_id}/statuses/{status_id}", pathParameters), + } + return m +} +// NewItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder instantiates a new ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder and sets the default values. +func NewItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get users with pull access can view a deployment status for a deployment: +// returns a DeploymentStatusable 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/deployments/statuses#get-a-deployment-status +func (m *ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentStatusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeploymentStatusFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentStatusable), nil +} +// ToGetRequestInformation users with pull access can view a deployment status for a deployment: +// returns a *RequestInformation when successful +func (m *ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder when successful +func (m *ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder) { + return NewItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_post_request_body.go new file mode 100644 index 000000000..4cb65daac --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_post_request_body.go @@ -0,0 +1,322 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemDeploymentsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. + auto_merge *bool + // Short description of the deployment. + description *string + // Name for the target deployment environment (e.g., `production`, `staging`, `qa`). + environment *string + // The payload property + payload *string + // Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise. + production_environment *bool + // The ref to deploy. This can be a branch, tag, or SHA. + ref *string + // The [status](https://docs.github.com/rest/commits/statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts. + required_contexts []string + // Specifies a task to execute (e.g., `deploy` or `deploy:migrations`). + task *string + // Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false` + transient_environment *bool +} +// NewItemItemDeploymentsPostRequestBody instantiates a new ItemItemDeploymentsPostRequestBody and sets the default values. +func NewItemItemDeploymentsPostRequestBody()(*ItemItemDeploymentsPostRequestBody) { + m := &ItemItemDeploymentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + environmentValue := "production" + m.SetEnvironment(&environmentValue) + taskValue := "deploy" + m.SetTask(&taskValue) + return m +} +// CreateItemItemDeploymentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemDeploymentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDeploymentsPostRequestBody(), 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 *ItemItemDeploymentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAutoMerge gets the auto_merge property value. Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. +// returns a *bool when successful +func (m *ItemItemDeploymentsPostRequestBody) GetAutoMerge()(*bool) { + return m.auto_merge +} +// GetDescription gets the description property value. Short description of the deployment. +// returns a *string when successful +func (m *ItemItemDeploymentsPostRequestBody) GetDescription()(*string) { + return m.description +} +// GetEnvironment gets the environment property value. Name for the target deployment environment (e.g., `production`, `staging`, `qa`). +// returns a *string when successful +func (m *ItemItemDeploymentsPostRequestBody) GetEnvironment()(*string) { + return m.environment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemDeploymentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAutoMerge(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val) + } + return nil + } + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPayload(val) + } + return nil + } + res["production_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetProductionEnvironment(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["required_contexts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRequiredContexts(res) + } + return nil + } + res["task"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTask(val) + } + return nil + } + res["transient_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTransientEnvironment(val) + } + return nil + } + return res +} +// GetPayload gets the payload property value. The payload property +// returns a *string when successful +func (m *ItemItemDeploymentsPostRequestBody) GetPayload()(*string) { + return m.payload +} +// GetProductionEnvironment gets the production_environment property value. Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise. +// returns a *bool when successful +func (m *ItemItemDeploymentsPostRequestBody) GetProductionEnvironment()(*bool) { + return m.production_environment +} +// GetRef gets the ref property value. The ref to deploy. This can be a branch, tag, or SHA. +// returns a *string when successful +func (m *ItemItemDeploymentsPostRequestBody) GetRef()(*string) { + return m.ref +} +// GetRequiredContexts gets the required_contexts property value. The [status](https://docs.github.com/rest/commits/statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts. +// returns a []string when successful +func (m *ItemItemDeploymentsPostRequestBody) GetRequiredContexts()([]string) { + return m.required_contexts +} +// GetTask gets the task property value. Specifies a task to execute (e.g., `deploy` or `deploy:migrations`). +// returns a *string when successful +func (m *ItemItemDeploymentsPostRequestBody) GetTask()(*string) { + return m.task +} +// GetTransientEnvironment gets the transient_environment property value. Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false` +// returns a *bool when successful +func (m *ItemItemDeploymentsPostRequestBody) GetTransientEnvironment()(*bool) { + return m.transient_environment +} +// Serialize serializes information the current object +func (m *ItemItemDeploymentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("auto_merge", m.GetAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("payload", m.GetPayload()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("production_environment", m.GetProductionEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + if m.GetRequiredContexts() != nil { + err := writer.WriteCollectionOfStringValues("required_contexts", m.GetRequiredContexts()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("task", m.GetTask()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("transient_environment", m.GetTransientEnvironment()) + 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 *ItemItemDeploymentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAutoMerge sets the auto_merge property value. Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. +func (m *ItemItemDeploymentsPostRequestBody) SetAutoMerge(value *bool)() { + m.auto_merge = value +} +// SetDescription sets the description property value. Short description of the deployment. +func (m *ItemItemDeploymentsPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetEnvironment sets the environment property value. Name for the target deployment environment (e.g., `production`, `staging`, `qa`). +func (m *ItemItemDeploymentsPostRequestBody) SetEnvironment(value *string)() { + m.environment = value +} +// SetPayload sets the payload property value. The payload property +func (m *ItemItemDeploymentsPostRequestBody) SetPayload(value *string)() { + m.payload = value +} +// SetProductionEnvironment sets the production_environment property value. Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise. +func (m *ItemItemDeploymentsPostRequestBody) SetProductionEnvironment(value *bool)() { + m.production_environment = value +} +// SetRef sets the ref property value. The ref to deploy. This can be a branch, tag, or SHA. +func (m *ItemItemDeploymentsPostRequestBody) SetRef(value *string)() { + m.ref = value +} +// SetRequiredContexts sets the required_contexts property value. The [status](https://docs.github.com/rest/commits/statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts. +func (m *ItemItemDeploymentsPostRequestBody) SetRequiredContexts(value []string)() { + m.required_contexts = value +} +// SetTask sets the task property value. Specifies a task to execute (e.g., `deploy` or `deploy:migrations`). +func (m *ItemItemDeploymentsPostRequestBody) SetTask(value *string)() { + m.task = value +} +// SetTransientEnvironment sets the transient_environment property value. Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false` +func (m *ItemItemDeploymentsPostRequestBody) SetTransientEnvironment(value *bool)() { + m.transient_environment = value +} +type ItemItemDeploymentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAutoMerge()(*bool) + GetDescription()(*string) + GetEnvironment()(*string) + GetPayload()(*string) + GetProductionEnvironment()(*bool) + GetRef()(*string) + GetRequiredContexts()([]string) + GetTask()(*string) + GetTransientEnvironment()(*bool) + SetAutoMerge(value *bool)() + SetDescription(value *string)() + SetEnvironment(value *string)() + SetPayload(value *string)() + SetProductionEnvironment(value *bool)() + SetRef(value *string)() + SetRequiredContexts(value []string)() + SetTask(value *string)() + SetTransientEnvironment(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_post_request_body_payload_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_post_request_body_payload_member1.go new file mode 100644 index 000000000..68363b37b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_post_request_body_payload_member1.go @@ -0,0 +1,50 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemDeploymentsPostRequestBody_payloadMember1 +type ItemItemDeploymentsPostRequestBody_payloadMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemDeploymentsPostRequestBody_payloadMember1 instantiates a new ItemItemDeploymentsPostRequestBody_payloadMember1 and sets the default values. +func NewItemItemDeploymentsPostRequestBody_payloadMember1()(*ItemItemDeploymentsPostRequestBody_payloadMember1) { + m := &ItemItemDeploymentsPostRequestBody_payloadMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemDeploymentsPostRequestBody_payloadMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemDeploymentsPostRequestBody_payloadMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDeploymentsPostRequestBody_payloadMember1(), 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. +func (m *ItemItemDeploymentsPostRequestBody_payloadMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +func (m *ItemItemDeploymentsPostRequestBody_payloadMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemDeploymentsPostRequestBody_payloadMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemDeploymentsPostRequestBody_payloadMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// ItemItemDeploymentsPostRequestBody_payloadMember1able +type ItemItemDeploymentsPostRequestBody_payloadMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_request_builder.go new file mode 100644 index 000000000..a96b7a2c3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_request_builder.go @@ -0,0 +1,121 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemDeploymentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\deployments +type ItemItemDeploymentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemDeploymentsRequestBuilderGetQueryParameters simple filtering of deployments is available via query parameters: +type ItemItemDeploymentsRequestBuilderGetQueryParameters struct { + // The name of the environment that was deployed to (e.g., `staging` or `production`). + Environment *string `uriparametername:"environment"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The name of the ref. This can be a branch, tag, or SHA. + Ref *string `uriparametername:"ref"` + // The SHA recorded at creation time. + Sha *string `uriparametername:"sha"` + // The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`). + Task *string `uriparametername:"task"` +} +// ByDeployment_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.deployments.item collection +// returns a *ItemItemDeploymentsWithDeployment_ItemRequestBuilder when successful +func (m *ItemItemDeploymentsRequestBuilder) ByDeployment_id(deployment_id int32)(*ItemItemDeploymentsWithDeployment_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["deployment_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(deployment_id), 10) + return NewItemItemDeploymentsWithDeployment_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemDeploymentsRequestBuilderInternal instantiates a new ItemItemDeploymentsRequestBuilder and sets the default values. +func NewItemItemDeploymentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDeploymentsRequestBuilder) { + m := &ItemItemDeploymentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/deployments{?environment*,page*,per_page*,ref*,sha*,task*}", pathParameters), + } + return m +} +// NewItemItemDeploymentsRequestBuilder instantiates a new ItemItemDeploymentsRequestBuilder and sets the default values. +func NewItemItemDeploymentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDeploymentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDeploymentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get simple filtering of deployments is available via query parameters: +// returns a []Deploymentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/deployments#list-deployments +func (m *ItemItemDeploymentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDeploymentsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Deploymentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeploymentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Deploymentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Deploymentable) + } + } + return val, nil +} +// Post deployments offer a few configurable parameters with certain defaults.The `ref` parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify thembefore we merge a pull request.The `environment` parameter allows deployments to be issued to different runtime environments. Teams often havemultiple environments for verifying their applications, such as `production`, `staging`, and `qa`. This parametermakes it easier to track which environments have requested deployments. The default environment is `production`.The `auto_merge` parameter is used to ensure that the requested ref is not behind the repository's default branch. Ifthe ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API willreturn a failure response.By default, [commit statuses](https://docs.github.com/rest/commits/statuses) for every submitted context must be in a `success`state. The `required_contexts` parameter allows you to specify a subset of contexts that must be `success`, or tospecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you donot require any contexts or create any commit statuses, the deployment will always succeed.The `payload` parameter is available for any extra information that a deployment system might need. It is a JSON textfield that will be passed on when a deployment event is dispatched.The `task` parameter is used by the deployment system to allow different execution paths. In the web world this mightbe `deploy:migrations` to run schema changes on the system. In the compiled world this could be a flag to compile anapplication with debugging enabled.Merged branch response:You will see this response when GitHub automatically merges the base branch into the topic branch instead of creatinga deployment. This auto-merge happens when:* Auto-merge option is enabled in the repository* Topic branch does not include the latest changes on the base branch, which is `master` in the response example* There are no merge conflictsIf there are no new commits in the base branch, a new request to create a deployment should give a successfulresponse.Merge conflict response:This error happens when the `auto_merge` option is enabled and when the default branch (in this case `master`), can'tbe merged into the branch that's being deployed (in this case `topic-branch`), due to merge conflicts.Failed commit status checks:This error happens when the `required_contexts` parameter indicates that one or more contexts need to have a `success`status for the commit to be deployed, but one or more of the required contexts do not have a state of `success`.OAuth app tokens and personal access tokens (classic) need the `repo` or `repo_deployment` scope to use this endpoint. +// returns a Deploymentable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/deployments#create-a-deployment +func (m *ItemItemDeploymentsRequestBuilder) Post(ctx context.Context, body ItemItemDeploymentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Deploymentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeploymentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Deploymentable), nil +} +// ToGetRequestInformation simple filtering of deployments is available via query parameters: +// returns a *RequestInformation when successful +func (m *ItemItemDeploymentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDeploymentsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation deployments offer a few configurable parameters with certain defaults.The `ref` parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify thembefore we merge a pull request.The `environment` parameter allows deployments to be issued to different runtime environments. Teams often havemultiple environments for verifying their applications, such as `production`, `staging`, and `qa`. This parametermakes it easier to track which environments have requested deployments. The default environment is `production`.The `auto_merge` parameter is used to ensure that the requested ref is not behind the repository's default branch. Ifthe ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API willreturn a failure response.By default, [commit statuses](https://docs.github.com/rest/commits/statuses) for every submitted context must be in a `success`state. The `required_contexts` parameter allows you to specify a subset of contexts that must be `success`, or tospecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you donot require any contexts or create any commit statuses, the deployment will always succeed.The `payload` parameter is available for any extra information that a deployment system might need. It is a JSON textfield that will be passed on when a deployment event is dispatched.The `task` parameter is used by the deployment system to allow different execution paths. In the web world this mightbe `deploy:migrations` to run schema changes on the system. In the compiled world this could be a flag to compile anapplication with debugging enabled.Merged branch response:You will see this response when GitHub automatically merges the base branch into the topic branch instead of creatinga deployment. This auto-merge happens when:* Auto-merge option is enabled in the repository* Topic branch does not include the latest changes on the base branch, which is `master` in the response example* There are no merge conflictsIf there are no new commits in the base branch, a new request to create a deployment should give a successfulresponse.Merge conflict response:This error happens when the `auto_merge` option is enabled and when the default branch (in this case `master`), can'tbe merged into the branch that's being deployed (in this case `topic-branch`), due to merge conflicts.Failed commit status checks:This error happens when the `required_contexts` parameter indicates that one or more contexts need to have a `success`status for the commit to be deployed, but one or more of the required contexts do not have a state of `success`.OAuth app tokens and personal access tokens (classic) need the `repo` or `repo_deployment` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemDeploymentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemDeploymentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemDeploymentsRequestBuilder when successful +func (m *ItemItemDeploymentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemDeploymentsRequestBuilder) { + return NewItemItemDeploymentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_with_deployment_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_with_deployment_item_request_builder.go new file mode 100644 index 000000000..3bda00910 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_deployments_with_deployment_item_request_builder.go @@ -0,0 +1,94 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemDeploymentsWithDeployment_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\deployments\{deployment_id} +type ItemItemDeploymentsWithDeployment_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemDeploymentsWithDeployment_ItemRequestBuilderInternal instantiates a new ItemItemDeploymentsWithDeployment_ItemRequestBuilder and sets the default values. +func NewItemItemDeploymentsWithDeployment_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDeploymentsWithDeployment_ItemRequestBuilder) { + m := &ItemItemDeploymentsWithDeployment_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/deployments/{deployment_id}", pathParameters), + } + return m +} +// NewItemItemDeploymentsWithDeployment_ItemRequestBuilder instantiates a new ItemItemDeploymentsWithDeployment_ItemRequestBuilder and sets the default values. +func NewItemItemDeploymentsWithDeployment_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDeploymentsWithDeployment_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDeploymentsWithDeployment_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete if the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment.To set a deployment as inactive, you must:* Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.* Mark the active deployment as inactive by adding any non-successful deployment status.For more information, see "[Create a deployment](https://docs.github.com/rest/deployments/deployments/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/rest/deployments/statuses#create-a-deployment-status)."OAuth app tokens and personal access tokens (classic) need the `repo` or `repo_deployment` scope to use this endpoint. +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/deployments#delete-a-deployment +func (m *ItemItemDeploymentsWithDeployment_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get get a deployment +// returns a Deploymentable 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/deployments/deployments#get-a-deployment +func (m *ItemItemDeploymentsWithDeployment_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Deploymentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeploymentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Deploymentable), nil +} +// Statuses the statuses property +// returns a *ItemItemDeploymentsItemStatusesRequestBuilder when successful +func (m *ItemItemDeploymentsWithDeployment_ItemRequestBuilder) Statuses()(*ItemItemDeploymentsItemStatusesRequestBuilder) { + return NewItemItemDeploymentsItemStatusesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation if the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment.To set a deployment as inactive, you must:* Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.* Mark the active deployment as inactive by adding any non-successful deployment status.For more information, see "[Create a deployment](https://docs.github.com/rest/deployments/deployments/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/rest/deployments/statuses#create-a-deployment-status)."OAuth app tokens and personal access tokens (classic) need the `repo` or `repo_deployment` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemDeploymentsWithDeployment_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *ItemItemDeploymentsWithDeployment_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemDeploymentsWithDeployment_ItemRequestBuilder when successful +func (m *ItemItemDeploymentsWithDeployment_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemDeploymentsWithDeployment_ItemRequestBuilder) { + return NewItemItemDeploymentsWithDeployment_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dispatches_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dispatches_post_request_body.go new file mode 100644 index 000000000..a463fda99 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dispatches_post_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemDispatchesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. + client_payload ItemItemDispatchesPostRequestBody_client_payloadable + // A custom webhook event name. Must be 100 characters or fewer. + event_type *string +} +// NewItemItemDispatchesPostRequestBody instantiates a new ItemItemDispatchesPostRequestBody and sets the default values. +func NewItemItemDispatchesPostRequestBody()(*ItemItemDispatchesPostRequestBody) { + m := &ItemItemDispatchesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemDispatchesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemDispatchesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDispatchesPostRequestBody(), 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 *ItemItemDispatchesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientPayload gets the client_payload property value. JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. +// returns a ItemItemDispatchesPostRequestBody_client_payloadable when successful +func (m *ItemItemDispatchesPostRequestBody) GetClientPayload()(ItemItemDispatchesPostRequestBody_client_payloadable) { + return m.client_payload +} +// GetEventType gets the event_type property value. A custom webhook event name. Must be 100 characters or fewer. +// returns a *string when successful +func (m *ItemItemDispatchesPostRequestBody) GetEventType()(*string) { + return m.event_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemDispatchesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemDispatchesPostRequestBody_client_payloadFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetClientPayload(val.(ItemItemDispatchesPostRequestBody_client_payloadable)) + } + return nil + } + res["event_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventType(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemDispatchesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("client_payload", m.GetClientPayload()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event_type", m.GetEventType()) + 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 *ItemItemDispatchesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientPayload sets the client_payload property value. JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. +func (m *ItemItemDispatchesPostRequestBody) SetClientPayload(value ItemItemDispatchesPostRequestBody_client_payloadable)() { + m.client_payload = value +} +// SetEventType sets the event_type property value. A custom webhook event name. Must be 100 characters or fewer. +func (m *ItemItemDispatchesPostRequestBody) SetEventType(value *string)() { + m.event_type = value +} +type ItemItemDispatchesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientPayload()(ItemItemDispatchesPostRequestBody_client_payloadable) + GetEventType()(*string) + SetClientPayload(value ItemItemDispatchesPostRequestBody_client_payloadable)() + SetEventType(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dispatches_post_request_body_client_payload.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dispatches_post_request_body_client_payload.go new file mode 100644 index 000000000..1e325ee05 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dispatches_post_request_body_client_payload.go @@ -0,0 +1,52 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemDispatchesPostRequestBody_client_payload jSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. +type ItemItemDispatchesPostRequestBody_client_payload struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemDispatchesPostRequestBody_client_payload instantiates a new ItemItemDispatchesPostRequestBody_client_payload and sets the default values. +func NewItemItemDispatchesPostRequestBody_client_payload()(*ItemItemDispatchesPostRequestBody_client_payload) { + m := &ItemItemDispatchesPostRequestBody_client_payload{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemDispatchesPostRequestBody_client_payloadFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemDispatchesPostRequestBody_client_payloadFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDispatchesPostRequestBody_client_payload(), 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 *ItemItemDispatchesPostRequestBody_client_payload) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemDispatchesPostRequestBody_client_payload) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemDispatchesPostRequestBody_client_payload) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemDispatchesPostRequestBody_client_payload) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemDispatchesPostRequestBody_client_payloadable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dispatches_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dispatches_request_builder.go new file mode 100644 index 000000000..923b31325 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_dispatches_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemDispatchesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dispatches +type ItemItemDispatchesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemDispatchesRequestBuilderInternal instantiates a new ItemItemDispatchesRequestBuilder and sets the default values. +func NewItemItemDispatchesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDispatchesRequestBuilder) { + m := &ItemItemDispatchesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dispatches", pathParameters), + } + return m +} +// NewItemItemDispatchesRequestBuilder instantiates a new ItemItemDispatchesRequestBuilder and sets the default values. +func NewItemItemDispatchesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDispatchesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + 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] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event +func (m *ItemItemDispatchesRequestBuilder) Post(ctx context.Context, body ItemItemDispatchesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation 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 *RequestInformation when successful +func (m *ItemItemDispatchesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemDispatchesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemDispatchesRequestBuilder when successful +func (m *ItemItemDispatchesRequestBuilder) WithUrl(rawUrl string)(*ItemItemDispatchesRequestBuilder) { + return NewItemItemDispatchesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_get_response.go new file mode 100644 index 000000000..5fc47f317 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemEnvironmentsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The environments property + environments []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Environmentable + // The number of environments in this repository + total_count *int32 +} +// NewItemItemEnvironmentsGetResponse instantiates a new ItemItemEnvironmentsGetResponse and sets the default values. +func NewItemItemEnvironmentsGetResponse()(*ItemItemEnvironmentsGetResponse) { + m := &ItemItemEnvironmentsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsGetResponse(), 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 *ItemItemEnvironmentsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnvironments gets the environments property value. The environments property +// returns a []Environmentable when successful +func (m *ItemItemEnvironmentsGetResponse) GetEnvironments()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Environmentable) { + return m.environments +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["environments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEnvironmentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Environmentable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Environmentable) + } + } + m.SetEnvironments(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The number of environments in this repository +// returns a *int32 when successful +func (m *ItemItemEnvironmentsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEnvironments() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetEnvironments())) + for i, v := range m.GetEnvironments() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("environments", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemEnvironmentsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnvironments sets the environments property value. The environments property +func (m *ItemItemEnvironmentsGetResponse) SetEnvironments(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Environmentable)() { + m.environments = value +} +// SetTotalCount sets the total_count property value. The number of environments in this repository +func (m *ItemItemEnvironmentsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemEnvironmentsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnvironments()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Environmentable) + GetTotalCount()(*int32) + SetEnvironments(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Environmentable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_branch_policies_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_branch_policies_get_response.go new file mode 100644 index 000000000..f092ef082 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_branch_policies_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The branch_policies property + branch_policies []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicyable + // The number of deployment branch policies for the environment. + total_count *int32 +} +// NewItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse instantiates a new ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse and sets the default values. +func NewItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse()(*ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) { + m := &ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse(), 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 *ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBranchPolicies gets the branch_policies property value. The branch_policies property +// returns a []DeploymentBranchPolicyable when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) GetBranchPolicies()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicyable) { + return m.branch_policies +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["branch_policies"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeploymentBranchPolicyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicyable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicyable) + } + } + m.SetBranchPolicies(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The number of deployment branch policies for the environment. +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBranchPolicies() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetBranchPolicies())) + for i, v := range m.GetBranchPolicies() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("branch_policies", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBranchPolicies sets the branch_policies property value. The branch_policies property +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) SetBranchPolicies(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicyable)() { + m.branch_policies = value +} +// SetTotalCount sets the total_count property value. The number of deployment branch policies for the environment. +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBranchPolicies()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicyable) + GetTotalCount()(*int32) + SetBranchPolicies(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicyable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_branch_policies_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_branch_policies_request_builder.go new file mode 100644 index 000000000..73c328e18 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_branch_policies_request_builder.go @@ -0,0 +1,106 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\deployment-branch-policies +type ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilderGetQueryParameters lists the deployment branch policies for an environment.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByBranch_policy_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.environments.item.deploymentBranchPolicies.item collection +// returns a *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) ByBranch_policy_id(branch_policy_id int32)(*ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["branch_policy_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(branch_policy_id), 10) + return NewItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) { + m := &ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/deployment-branch-policies{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder instantiates a new ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the deployment branch policies for an environment.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilderGetQueryParameters])(ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponseable), nil +} +// Post creates a deployment branch or tag policy for an environment.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a DeploymentBranchPolicyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) Post(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicyNamePatternWithTypeable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicyable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeploymentBranchPolicyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicyable), nil +} +// ToGetRequestInformation lists the deployment branch policies for an environment.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a deployment branch or tag policy for an environment.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) ToPostRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicyNamePatternWithTypeable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) { + return NewItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_branch_policies_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_branch_policies_response.go new file mode 100644 index 000000000..791b5f7d6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_branch_policies_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemEnvironmentsItemDeploymentBranchPoliciesResponse +// Deprecated: This class is obsolete. Use deploymentBranchPoliciesGetResponse instead. +type ItemItemEnvironmentsItemDeploymentBranchPoliciesResponse struct { + ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse +} +// NewItemItemEnvironmentsItemDeploymentBranchPoliciesResponse instantiates a new ItemItemEnvironmentsItemDeploymentBranchPoliciesResponse and sets the default values. +func NewItemItemEnvironmentsItemDeploymentBranchPoliciesResponse()(*ItemItemEnvironmentsItemDeploymentBranchPoliciesResponse) { + m := &ItemItemEnvironmentsItemDeploymentBranchPoliciesResponse{ + ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse: *NewItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse(), + } + return m +} +// CreateItemItemEnvironmentsItemDeploymentBranchPoliciesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemEnvironmentsItemDeploymentBranchPoliciesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemDeploymentBranchPoliciesResponse(), nil +} +// ItemItemEnvironmentsItemDeploymentBranchPoliciesResponseable +// Deprecated: This class is obsolete. Use deploymentBranchPoliciesGetResponse instead. +type ItemItemEnvironmentsItemDeploymentBranchPoliciesResponseable interface { + ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_branch_policies_with_branch_policy_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_branch_policies_with_branch_policy_item_request_builder.go new file mode 100644 index 000000000..38dced8a8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_branch_policies_with_branch_policy_item_request_builder.go @@ -0,0 +1,110 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\deployment-branch-policies\{branch_policy_id} +type ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) { + m := &ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder instantiates a new ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a deployment branch or tag policy for an environment.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a deployment branch or tag policy for an environment.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a DeploymentBranchPolicyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeploymentBranchPolicyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicyable), nil +} +// Put updates a deployment branch or tag policy for an environment.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a DeploymentBranchPolicyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) Put(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicyNamePatternable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicyable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeploymentBranchPolicyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicyable), nil +} +// ToDeleteRequestInformation deletes a deployment branch or tag policy for an environment.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a deployment branch or tag policy for an environment.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation updates a deployment branch or tag policy for an environment.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicyNamePatternable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) { + return NewItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_apps_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_apps_get_response.go new file mode 100644 index 000000000..a0d1b02fa --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_apps_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The available_custom_deployment_protection_rule_integrations property + available_custom_deployment_protection_rule_integrations []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomDeploymentRuleAppable + // The total number of custom deployment protection rule integrations available for this environment. + total_count *int32 +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse()(*ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) { + m := &ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse(), 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 *ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvailableCustomDeploymentProtectionRuleIntegrations gets the available_custom_deployment_protection_rule_integrations property value. The available_custom_deployment_protection_rule_integrations property +// returns a []CustomDeploymentRuleAppable when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) GetAvailableCustomDeploymentProtectionRuleIntegrations()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomDeploymentRuleAppable) { + return m.available_custom_deployment_protection_rule_integrations +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["available_custom_deployment_protection_rule_integrations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCustomDeploymentRuleAppFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomDeploymentRuleAppable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomDeploymentRuleAppable) + } + } + m.SetAvailableCustomDeploymentProtectionRuleIntegrations(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total number of custom deployment protection rule integrations available for this environment. +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAvailableCustomDeploymentProtectionRuleIntegrations() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAvailableCustomDeploymentProtectionRuleIntegrations())) + for i, v := range m.GetAvailableCustomDeploymentProtectionRuleIntegrations() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("available_custom_deployment_protection_rule_integrations", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvailableCustomDeploymentProtectionRuleIntegrations sets the available_custom_deployment_protection_rule_integrations property value. The available_custom_deployment_protection_rule_integrations property +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) SetAvailableCustomDeploymentProtectionRuleIntegrations(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomDeploymentRuleAppable)() { + m.available_custom_deployment_protection_rule_integrations = value +} +// SetTotalCount sets the total_count property value. The total number of custom deployment protection rule integrations available for this environment. +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvailableCustomDeploymentProtectionRuleIntegrations()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomDeploymentRuleAppable) + GetTotalCount()(*int32) + SetAvailableCustomDeploymentProtectionRuleIntegrations(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomDeploymentRuleAppable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_apps_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_apps_request_builder.go new file mode 100644 index 000000000..84e9b2829 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_apps_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\deployment_protection_rules\apps +type ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilderGetQueryParameters gets all custom deployment protection rule integrations that are available for an environment. Anyone with read access to the repository can use this endpoint.For more information about environments, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."For more information about the app that is providing this custom deployment rule, see "[GET an app](https://docs.github.com/rest/apps/apps#get-an-app)".OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder) { + m := &ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/deployment_protection_rules/apps{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets all custom deployment protection rule integrations that are available for an environment. Anyone with read access to the repository can use this endpoint.For more information about environments, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."For more information about the app that is providing this custom deployment rule, see "[GET an app](https://docs.github.com/rest/apps/apps#get-an-app)".OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/protection-rules#list-custom-deployment-rule-integrations-available-for-an-environment +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilderGetQueryParameters])(ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponseable), nil +} +// ToGetRequestInformation gets all custom deployment protection rule integrations that are available for an environment. Anyone with read access to the repository can use this endpoint.For more information about environments, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."For more information about the app that is providing this custom deployment rule, see "[GET an app](https://docs.github.com/rest/apps/apps#get-an-app)".OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_apps_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_apps_response.go new file mode 100644 index 000000000..906c51025 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_apps_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemEnvironmentsItemDeployment_protection_rulesAppsResponse +// Deprecated: This class is obsolete. Use appsGetResponse instead. +type ItemItemEnvironmentsItemDeployment_protection_rulesAppsResponse struct { + ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesAppsResponse instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesAppsResponse and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesAppsResponse()(*ItemItemEnvironmentsItemDeployment_protection_rulesAppsResponse) { + m := &ItemItemEnvironmentsItemDeployment_protection_rulesAppsResponse{ + ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse: *NewItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse(), + } + return m +} +// CreateItemItemEnvironmentsItemDeployment_protection_rulesAppsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemEnvironmentsItemDeployment_protection_rulesAppsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesAppsResponse(), nil +} +// ItemItemEnvironmentsItemDeployment_protection_rulesAppsResponseable +// Deprecated: This class is obsolete. Use appsGetResponse instead. +type ItemItemEnvironmentsItemDeployment_protection_rulesAppsResponseable interface { + ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_get_response.go new file mode 100644 index 000000000..e2ffc596d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The custom_deployment_protection_rules property + custom_deployment_protection_rules []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentProtectionRuleable + // The number of enabled custom deployment protection rules for this environment + total_count *int32 +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesGetResponse instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesGetResponse()(*ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) { + m := &ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemDeployment_protection_rulesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemDeployment_protection_rulesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesGetResponse(), 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 *ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCustomDeploymentProtectionRules gets the custom_deployment_protection_rules property value. The custom_deployment_protection_rules property +// returns a []DeploymentProtectionRuleable when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) GetCustomDeploymentProtectionRules()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentProtectionRuleable) { + return m.custom_deployment_protection_rules +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["custom_deployment_protection_rules"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeploymentProtectionRuleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentProtectionRuleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentProtectionRuleable) + } + } + m.SetCustomDeploymentProtectionRules(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The number of enabled custom deployment protection rules for this environment +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCustomDeploymentProtectionRules() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCustomDeploymentProtectionRules())) + for i, v := range m.GetCustomDeploymentProtectionRules() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("custom_deployment_protection_rules", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCustomDeploymentProtectionRules sets the custom_deployment_protection_rules property value. The custom_deployment_protection_rules property +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) SetCustomDeploymentProtectionRules(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentProtectionRuleable)() { + m.custom_deployment_protection_rules = value +} +// SetTotalCount sets the total_count property value. The number of enabled custom deployment protection rules for this environment +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemEnvironmentsItemDeployment_protection_rulesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCustomDeploymentProtectionRules()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentProtectionRuleable) + GetTotalCount()(*int32) + SetCustomDeploymentProtectionRules(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentProtectionRuleable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_post_request_body.go new file mode 100644 index 000000000..6f415ee1d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The ID of the custom app that will be enabled on the environment. + integration_id *int32 +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody()(*ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody) { + m := &ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody(), 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 *ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["integration_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetIntegrationId(val) + } + return nil + } + return res +} +// GetIntegrationId gets the integration_id property value. The ID of the custom app that will be enabled on the environment. +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody) GetIntegrationId()(*int32) { + return m.integration_id +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("integration_id", m.GetIntegrationId()) + 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 *ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIntegrationId sets the integration_id property value. The ID of the custom app that will be enabled on the environment. +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody) SetIntegrationId(value *int32)() { + m.integration_id = value +} +type ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIntegrationId()(*int32) + SetIntegrationId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_request_builder.go new file mode 100644 index 000000000..444ce9f58 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_request_builder.go @@ -0,0 +1,104 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\deployment_protection_rules +type ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Apps the apps property +// returns a *ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) Apps()(*ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ByProtection_rule_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.environments.item.deployment_protection_rules.item collection +// returns a *ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) ByProtection_rule_id(protection_rule_id int32)(*ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["protection_rule_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(protection_rule_id), 10) + return NewItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) { + m := &ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/deployment_protection_rules", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets all custom deployment protection rules that are enabled for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemEnvironmentsItemDeployment_protection_rulesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/protection-rules#get-all-deployment-protection-rules-for-an-environment +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemEnvironmentsItemDeployment_protection_rulesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemEnvironmentsItemDeployment_protection_rulesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemEnvironmentsItemDeployment_protection_rulesGetResponseable), nil +} +// Post enable a custom deployment protection rule for an environment.The authenticated user must have admin or owner permissions to the repository to use this endpoint.For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a DeploymentProtectionRuleable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/protection-rules#create-a-custom-deployment-protection-rule-on-an-environment +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) Post(ctx context.Context, body ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentProtectionRuleable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeploymentProtectionRuleFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentProtectionRuleable), nil +} +// ToGetRequestInformation gets all custom deployment protection rules that are enabled for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation enable a custom deployment protection rule for an environment.The authenticated user must have admin or owner permissions to the repository to use this endpoint.For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_response.go new file mode 100644 index 000000000..80dd96381 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemEnvironmentsItemDeployment_protection_rulesResponse +// Deprecated: This class is obsolete. Use deployment_protection_rulesGetResponse instead. +type ItemItemEnvironmentsItemDeployment_protection_rulesResponse struct { + ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesResponse instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesResponse and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesResponse()(*ItemItemEnvironmentsItemDeployment_protection_rulesResponse) { + m := &ItemItemEnvironmentsItemDeployment_protection_rulesResponse{ + ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse: *NewItemItemEnvironmentsItemDeployment_protection_rulesGetResponse(), + } + return m +} +// CreateItemItemEnvironmentsItemDeployment_protection_rulesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemEnvironmentsItemDeployment_protection_rulesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesResponse(), nil +} +// ItemItemEnvironmentsItemDeployment_protection_rulesResponseable +// Deprecated: This class is obsolete. Use deployment_protection_rulesGetResponse instead. +type ItemItemEnvironmentsItemDeployment_protection_rulesResponseable interface { + ItemItemEnvironmentsItemDeployment_protection_rulesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_with_protection_rule_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_with_protection_rule_item_request_builder.go new file mode 100644 index 000000000..924177c99 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_deployment_protection_rules_with_protection_rule_item_request_builder.go @@ -0,0 +1,79 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\deployment_protection_rules\{protection_rule_id} +type ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder) { + m := &ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete disables a custom deployment protection rule for an environment.The authenticated user must have admin or owner permissions to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/protection-rules#disable-a-custom-protection-rule-for-an-environment +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets an enabled custom deployment protection rule for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."For more information about the app that is providing this custom deployment rule, see [`GET /apps/{app_slug}`](https://docs.github.com/rest/apps/apps#get-an-app).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a DeploymentProtectionRuleable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/protection-rules#get-a-custom-deployment-protection-rule +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentProtectionRuleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeploymentProtectionRuleFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentProtectionRuleable), nil +} +// ToDeleteRequestInformation disables a custom deployment protection rule for an environment.The authenticated user must have admin or owner permissions to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets an enabled custom deployment protection rule for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."For more information about the app that is providing this custom deployment rule, see [`GET /apps/{app_slug}`](https://docs.github.com/rest/apps/apps#get-an-app).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_secrets_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_secrets_get_response.go new file mode 100644 index 000000000..fc38ea285 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_secrets_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemEnvironmentsItemSecretsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The secrets property + secrets []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable + // The total_count property + total_count *int32 +} +// NewItemItemEnvironmentsItemSecretsGetResponse instantiates a new ItemItemEnvironmentsItemSecretsGetResponse and sets the default values. +func NewItemItemEnvironmentsItemSecretsGetResponse()(*ItemItemEnvironmentsItemSecretsGetResponse) { + m := &ItemItemEnvironmentsItemSecretsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemSecretsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemSecretsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemSecretsGetResponse(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemItemEnvironmentsItemSecretsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsItemSecretsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsSecretFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable) + } + } + m.SetSecrets(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetSecrets gets the secrets property value. The secrets property +// returns a []ActionsSecretable when successful +func (m *ItemItemEnvironmentsItemSecretsGetResponse) GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable) { + return m.secrets +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemSecretsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemSecretsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecrets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSecrets())) + for i, v := range m.GetSecrets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("secrets", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemEnvironmentsItemSecretsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSecrets sets the secrets property value. The secrets property +func (m *ItemItemEnvironmentsItemSecretsGetResponse) SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable)() { + m.secrets = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemEnvironmentsItemSecretsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemEnvironmentsItemSecretsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable) + GetTotalCount()(*int32) + SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_secrets_item_with_secret_name_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_secrets_item_with_secret_name_put_request_body.go new file mode 100644 index 000000000..e3573cbe6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_secrets_item_with_secret_name_put_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an environment public key](https://docs.github.com/rest/actions/secrets#get-an-environment-public-key) endpoint. + encrypted_value *string + // ID of the key you used to encrypt the secret. + key_id *string +} +// NewItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody instantiates a new ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody and sets the default values. +func NewItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody()(*ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) { + m := &ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncryptedValue gets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an environment public key](https://docs.github.com/rest/actions/secrets#get-an-environment-public-key) endpoint. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) GetEncryptedValue()(*string) { + return m.encrypted_value +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["encrypted_value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncryptedValue(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + return res +} +// GetKeyId gets the key_id property value. ID of the key you used to encrypt the secret. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) GetKeyId()(*string) { + return m.key_id +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("encrypted_value", m.GetEncryptedValue()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncryptedValue sets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an environment public key](https://docs.github.com/rest/actions/secrets#get-an-environment-public-key) endpoint. +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) SetEncryptedValue(value *string)() { + m.encrypted_value = value +} +// SetKeyId sets the key_id property value. ID of the key you used to encrypt the secret. +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) SetKeyId(value *string)() { + m.key_id = value +} +type ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncryptedValue()(*string) + GetKeyId()(*string) + SetEncryptedValue(value *string)() + SetKeyId(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_secrets_public_key_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_secrets_public_key_request_builder.go new file mode 100644 index 000000000..9ec3340c7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_secrets_public_key_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\secrets\public-key +type ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) { + m := &ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/secrets/public-key", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder instantiates a new ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get the public key for an environment, which you need to encrypt environmentsecrets. You need to encrypt a secret before you can create or update secrets.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsPublicKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key +func (m *ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsPublicKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsPublicKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsPublicKeyable), nil +} +// ToGetRequestInformation get the public key for an environment, which you need to encrypt environmentsecrets. You need to encrypt a secret before you can create or update secrets.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder when successful +func (m *ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) { + return NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_secrets_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_secrets_request_builder.go new file mode 100644 index 000000000..194dba2c2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_secrets_request_builder.go @@ -0,0 +1,80 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemEnvironmentsItemSecretsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\secrets +type ItemItemEnvironmentsItemSecretsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemEnvironmentsItemSecretsRequestBuilderGetQueryParameters lists all secrets available in an environment without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemEnvironmentsItemSecretsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// BySecret_name gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.environments.item.secrets.item collection +// returns a *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemSecretsRequestBuilder) BySecret_name(secret_name string)(*ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if secret_name != "" { + urlTplParams["secret_name"] = secret_name + } + return NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemEnvironmentsItemSecretsRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemSecretsRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsRequestBuilder) { + m := &ItemItemEnvironmentsItemSecretsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/secrets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemSecretsRequestBuilder instantiates a new ItemItemEnvironmentsItemSecretsRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemSecretsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all secrets available in an environment without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemEnvironmentsItemSecretsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#list-environment-secrets +func (m *ItemItemEnvironmentsItemSecretsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemSecretsRequestBuilderGetQueryParameters])(ItemItemEnvironmentsItemSecretsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemEnvironmentsItemSecretsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemEnvironmentsItemSecretsGetResponseable), nil +} +// PublicKey the publicKey property +// returns a *ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder when successful +func (m *ItemItemEnvironmentsItemSecretsRequestBuilder) PublicKey()(*ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) { + return NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all secrets available in an environment without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemSecretsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemSecretsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemEnvironmentsItemSecretsRequestBuilder when successful +func (m *ItemItemEnvironmentsItemSecretsRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemSecretsRequestBuilder) { + return NewItemItemEnvironmentsItemSecretsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_secrets_with_secret_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_secrets_with_secret_name_item_request_builder.go new file mode 100644 index 000000000..7eb8ac8da --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_secrets_with_secret_name_item_request_builder.go @@ -0,0 +1,110 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\secrets\{secret_name} +type ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) { + m := &ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/secrets/{secret_name}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder instantiates a new ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a secret in an environment using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a single environment secret without revealing its encrypted value.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsSecretable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#get-an-environment-secret +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsSecretFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable), nil +} +// Put creates or updates an environment secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) Put(ctx context.Context, body ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToDeleteRequestInformation deletes a secret in an environment using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a single environment secret without revealing its encrypted value.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation creates or updates an environment secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) { + return NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_variables_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_variables_get_response.go new file mode 100644 index 000000000..9efcf000a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_variables_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemEnvironmentsItemVariablesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The total_count property + total_count *int32 + // The variables property + variables []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable +} +// NewItemItemEnvironmentsItemVariablesGetResponse instantiates a new ItemItemEnvironmentsItemVariablesGetResponse and sets the default values. +func NewItemItemEnvironmentsItemVariablesGetResponse()(*ItemItemEnvironmentsItemVariablesGetResponse) { + m := &ItemItemEnvironmentsItemVariablesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemVariablesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemVariablesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemVariablesGetResponse(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemItemEnvironmentsItemVariablesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsItemVariablesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + res["variables"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsVariableFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable) + } + } + m.SetVariables(res) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemVariablesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// GetVariables gets the variables property value. The variables property +// returns a []ActionsVariableable when successful +func (m *ItemItemEnvironmentsItemVariablesGetResponse) GetVariables()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable) { + return m.variables +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemVariablesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + if m.GetVariables() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVariables())) + for i, v := range m.GetVariables() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("variables", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemEnvironmentsItemVariablesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemEnvironmentsItemVariablesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetVariables sets the variables property value. The variables property +func (m *ItemItemEnvironmentsItemVariablesGetResponse) SetVariables(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable)() { + m.variables = value +} +type ItemItemEnvironmentsItemVariablesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalCount()(*int32) + GetVariables()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable) + SetTotalCount(value *int32)() + SetVariables(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_variables_item_with_name_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_variables_item_with_name_patch_request_body.go new file mode 100644 index 000000000..4e6e93176 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_variables_item_with_name_patch_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name of the variable. + name *string + // The value of the variable. + value *string +} +// NewItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody instantiates a new ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody and sets the default values. +func NewItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody()(*ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) { + m := &ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) GetName()(*string) { + return m.name +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name of the variable. +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) SetValue(value *string)() { + m.value = value +} +type ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetValue()(*string) + SetName(value *string)() + SetValue(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_variables_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_variables_post_request_body.go new file mode 100644 index 000000000..dff25b31d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_variables_post_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemEnvironmentsItemVariablesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name of the variable. + name *string + // The value of the variable. + value *string +} +// NewItemItemEnvironmentsItemVariablesPostRequestBody instantiates a new ItemItemEnvironmentsItemVariablesPostRequestBody and sets the default values. +func NewItemItemEnvironmentsItemVariablesPostRequestBody()(*ItemItemEnvironmentsItemVariablesPostRequestBody) { + m := &ItemItemEnvironmentsItemVariablesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemVariablesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemVariablesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemVariablesPostRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) GetName()(*string) { + return m.name +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name of the variable. +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) SetValue(value *string)() { + m.value = value +} +type ItemItemEnvironmentsItemVariablesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetValue()(*string) + SetName(value *string)() + SetValue(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_variables_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_variables_request_builder.go new file mode 100644 index 000000000..5d2e7bf30 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_variables_request_builder.go @@ -0,0 +1,107 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemEnvironmentsItemVariablesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\variables +type ItemItemEnvironmentsItemVariablesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemEnvironmentsItemVariablesRequestBuilderGetQueryParameters lists all environment variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemEnvironmentsItemVariablesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 30). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByName gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.environments.item.variables.item collection +// returns a *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) ByName(name string)(*ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemEnvironmentsItemVariablesRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemVariablesRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemVariablesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemVariablesRequestBuilder) { + m := &ItemItemEnvironmentsItemVariablesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/variables{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemVariablesRequestBuilder instantiates a new ItemItemEnvironmentsItemVariablesRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemVariablesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemVariablesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemVariablesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all environment variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemEnvironmentsItemVariablesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#list-environment-variables +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemVariablesRequestBuilderGetQueryParameters])(ItemItemEnvironmentsItemVariablesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemEnvironmentsItemVariablesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemEnvironmentsItemVariablesGetResponseable), nil +} +// Post create an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#create-an-environment-variable +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) Post(ctx context.Context, body ItemItemEnvironmentsItemVariablesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToGetRequestInformation lists all environment variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemVariablesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation create an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemEnvironmentsItemVariablesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemEnvironmentsItemVariablesRequestBuilder when successful +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemVariablesRequestBuilder) { + return NewItemItemEnvironmentsItemVariablesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_variables_with_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_variables_with_name_item_request_builder.go new file mode 100644 index 000000000..b25a674f6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_variables_with_name_item_request_builder.go @@ -0,0 +1,105 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\variables\{name} +type ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) { + m := &ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/variables/{name}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder instantiates a new ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes an environment variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#delete-an-environment-variable +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a specific variable in an environment.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsVariableable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#get-an-environment-variable +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsVariableFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable), nil +} +// Patch updates an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#update-an-environment-variable +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) Patch(ctx context.Context, body ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation deletes an environment variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a specific variable in an environment.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) { + return NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_with_environment_name_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_with_environment_name_put_request_body.go new file mode 100644 index 000000000..1e8c98123 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_with_environment_name_put_request_body.go @@ -0,0 +1,161 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody struct { + // The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`. + deployment_branch_policy i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicySettingsable + // Whether or not a user who created the job is prevented from approving their own job. + prevent_self_review *bool + // The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. + reviewers []ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable + // The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days). + wait_timer *int32 +} +// NewItemItemEnvironmentsItemWithEnvironment_namePutRequestBody instantiates a new ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody and sets the default values. +func NewItemItemEnvironmentsItemWithEnvironment_namePutRequestBody()(*ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) { + m := &ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody{ + } + return m +} +// CreateItemItemEnvironmentsItemWithEnvironment_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemWithEnvironment_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemWithEnvironment_namePutRequestBody(), nil +} +// GetDeploymentBranchPolicy gets the deployment_branch_policy property value. The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`. +// returns a DeploymentBranchPolicySettingsable when successful +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) GetDeploymentBranchPolicy()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicySettingsable) { + return m.deployment_branch_policy +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["deployment_branch_policy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeploymentBranchPolicySettingsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDeploymentBranchPolicy(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicySettingsable)) + } + return nil + } + res["prevent_self_review"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPreventSelfReview(val) + } + return nil + } + res["reviewers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable) + } + } + m.SetReviewers(res) + } + return nil + } + res["wait_timer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWaitTimer(val) + } + return nil + } + return res +} +// GetPreventSelfReview gets the prevent_self_review property value. Whether or not a user who created the job is prevented from approving their own job. +// returns a *bool when successful +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) GetPreventSelfReview()(*bool) { + return m.prevent_self_review +} +// GetReviewers gets the reviewers property value. The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. +// returns a []ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable when successful +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) GetReviewers()([]ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable) { + return m.reviewers +} +// GetWaitTimer gets the wait_timer property value. The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days). +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) GetWaitTimer()(*int32) { + return m.wait_timer +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("deployment_branch_policy", m.GetDeploymentBranchPolicy()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("prevent_self_review", m.GetPreventSelfReview()) + if err != nil { + return err + } + } + if m.GetReviewers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetReviewers())) + for i, v := range m.GetReviewers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("reviewers", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("wait_timer", m.GetWaitTimer()) + if err != nil { + return err + } + } + return nil +} +// SetDeploymentBranchPolicy sets the deployment_branch_policy property value. The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`. +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) SetDeploymentBranchPolicy(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicySettingsable)() { + m.deployment_branch_policy = value +} +// SetPreventSelfReview sets the prevent_self_review property value. Whether or not a user who created the job is prevented from approving their own job. +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) SetPreventSelfReview(value *bool)() { + m.prevent_self_review = value +} +// SetReviewers sets the reviewers property value. The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) SetReviewers(value []ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable)() { + m.reviewers = value +} +// SetWaitTimer sets the wait_timer property value. The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days). +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) SetWaitTimer(value *int32)() { + m.wait_timer = value +} +type ItemItemEnvironmentsItemWithEnvironment_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDeploymentBranchPolicy()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicySettingsable) + GetPreventSelfReview()(*bool) + GetReviewers()([]ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable) + GetWaitTimer()(*int32) + SetDeploymentBranchPolicy(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentBranchPolicySettingsable)() + SetPreventSelfReview(value *bool)() + SetReviewers(value []ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable)() + SetWaitTimer(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_with_environment_name_put_request_body_reviewers.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_with_environment_name_put_request_body_reviewers.go new file mode 100644 index 000000000..85d1c8720 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_item_with_environment_name_put_request_body_reviewers.go @@ -0,0 +1,111 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id of the user or team who can review the deployment + id *int32 + // The type of reviewer. + typeEscaped *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentReviewerType +} +// NewItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers instantiates a new ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers and sets the default values. +func NewItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers()(*ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) { + m := &ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers(), 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 *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ParseDeploymentReviewerType) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentReviewerType)) + } + return nil + } + return res +} +// GetId gets the id property value. The id of the user or team who can review the deployment +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) GetId()(*int32) { + return m.id +} +// GetTypeEscaped gets the type property value. The type of reviewer. +// returns a *DeploymentReviewerType when successful +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) GetTypeEscaped()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentReviewerType) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id of the user or team who can review the deployment +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) SetId(value *int32)() { + m.id = value +} +// SetTypeEscaped sets the type property value. The type of reviewer. +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) SetTypeEscaped(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentReviewerType)() { + m.typeEscaped = value +} +type ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetTypeEscaped()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentReviewerType) + SetId(value *int32)() + SetTypeEscaped(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeploymentReviewerType)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_request_builder.go new file mode 100644 index 000000000..eed9c8f8f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_request_builder.go @@ -0,0 +1,75 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemEnvironmentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments +type ItemItemEnvironmentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemEnvironmentsRequestBuilderGetQueryParameters lists the environments for a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemEnvironmentsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByEnvironment_name gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.environments.item collection +// returns a *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder when successful +func (m *ItemItemEnvironmentsRequestBuilder) ByEnvironment_name(environment_name string)(*ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if environment_name != "" { + urlTplParams["environment_name"] = environment_name + } + return NewItemItemEnvironmentsWithEnvironment_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemEnvironmentsRequestBuilderInternal instantiates a new ItemItemEnvironmentsRequestBuilder and sets the default values. +func NewItemItemEnvironmentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsRequestBuilder) { + m := &ItemItemEnvironmentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsRequestBuilder instantiates a new ItemItemEnvironmentsRequestBuilder and sets the default values. +func NewItemItemEnvironmentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the environments for a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemEnvironmentsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/environments#list-environments +func (m *ItemItemEnvironmentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsRequestBuilderGetQueryParameters])(ItemItemEnvironmentsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemEnvironmentsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemEnvironmentsGetResponseable), nil +} +// ToGetRequestInformation lists the environments for a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemEnvironmentsRequestBuilder when successful +func (m *ItemItemEnvironmentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsRequestBuilder) { + return NewItemItemEnvironmentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_response.go new file mode 100644 index 000000000..738099567 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemEnvironmentsResponse +// Deprecated: This class is obsolete. Use environmentsGetResponse instead. +type ItemItemEnvironmentsResponse struct { + ItemItemEnvironmentsGetResponse +} +// NewItemItemEnvironmentsResponse instantiates a new ItemItemEnvironmentsResponse and sets the default values. +func NewItemItemEnvironmentsResponse()(*ItemItemEnvironmentsResponse) { + m := &ItemItemEnvironmentsResponse{ + ItemItemEnvironmentsGetResponse: *NewItemItemEnvironmentsGetResponse(), + } + return m +} +// CreateItemItemEnvironmentsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemEnvironmentsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsResponse(), nil +} +// ItemItemEnvironmentsResponseable +// Deprecated: This class is obsolete. Use environmentsGetResponse instead. +type ItemItemEnvironmentsResponseable interface { + ItemItemEnvironmentsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_with_environment_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_with_environment_name_item_request_builder.go new file mode 100644 index 000000000..1f73138b3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_environments_with_environment_name_item_request_builder.go @@ -0,0 +1,134 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name} +type ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemEnvironmentsWithEnvironment_nameItemRequestBuilderInternal instantiates a new ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsWithEnvironment_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) { + m := &ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder instantiates a new ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsWithEnvironment_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete oAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/environments#delete-an-environment +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Deployment_protection_rules the deployment_protection_rules property +// returns a *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder when successful +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) Deployment_protection_rules()(*ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// DeploymentBranchPolicies the deploymentBranchPolicies property +// returns a *ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder when successful +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) DeploymentBranchPolicies()(*ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) { + return NewItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get **Note:** To get information about name patterns that branches must match in order to deploy to this environment, see "[Get a deployment branch policy](/rest/deployments/branch-policies#get-a-deployment-branch-policy)."Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a Environmentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/environments#get-an-environment +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Environmentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEnvironmentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Environmentable), nil +} +// Put create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see "[Environments](/actions/reference/environments#environment-protection-rules)."**Note:** To create or update name patterns that branches must match in order to deploy to this environment, see "[Deployment branch policies](/rest/deployments/branch-policies)."**Note:** To create or update secrets for an environment, see "[GitHub Actions secrets](/rest/actions/secrets)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a Environmentable when successful +// returns a BasicError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) Put(ctx context.Context, body ItemItemEnvironmentsItemWithEnvironment_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Environmentable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEnvironmentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Environmentable), nil +} +// Secrets the secrets property +// returns a *ItemItemEnvironmentsItemSecretsRequestBuilder when successful +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) Secrets()(*ItemItemEnvironmentsItemSecretsRequestBuilder) { + return NewItemItemEnvironmentsItemSecretsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation oAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation **Note:** To get information about name patterns that branches must match in order to deploy to this environment, see "[Get a deployment branch policy](/rest/deployments/branch-policies#get-a-deployment-branch-policy)."Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see "[Environments](/actions/reference/environments#environment-protection-rules)."**Note:** To create or update name patterns that branches must match in order to deploy to this environment, see "[Deployment branch policies](/rest/deployments/branch-policies)."**Note:** To create or update secrets for an environment, see "[GitHub Actions secrets](/rest/actions/secrets)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemEnvironmentsItemWithEnvironment_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// Variables the variables property +// returns a *ItemItemEnvironmentsItemVariablesRequestBuilder when successful +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) Variables()(*ItemItemEnvironmentsItemVariablesRequestBuilder) { + return NewItemItemEnvironmentsItemVariablesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder when successful +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) { + return NewItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_events_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_events_request_builder.go new file mode 100644 index 000000000..1f2afa31d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_events_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemEventsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\events +type ItemItemEventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemEventsRequestBuilderGetQueryParameters **Note**: This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +type ItemItemEventsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemEventsRequestBuilderInternal instantiates a new ItemItemEventsRequestBuilder and sets the default values. +func NewItemItemEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEventsRequestBuilder) { + m := &ItemItemEventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/events{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemEventsRequestBuilder instantiates a new ItemItemEventsRequestBuilder and sets the default values. +func NewItemItemEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Note**: This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a []Eventable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/events#list-repository-events +func (m *ItemItemEventsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEventsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEventFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable) + } + } + return val, nil +} +// ToGetRequestInformation **Note**: This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a *RequestInformation when successful +func (m *ItemItemEventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEventsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemEventsRequestBuilder when successful +func (m *ItemItemEventsRequestBuilder) WithUrl(rawUrl string)(*ItemItemEventsRequestBuilder) { + return NewItemItemEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_forks_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_forks_post_request_body.go new file mode 100644 index 000000000..762c276f8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_forks_post_request_body.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemForksPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // When forking from an existing repository, fork with only the default branch. + default_branch_only *bool + // When forking from an existing repository, a new name for the fork. + name *string + // Optional parameter to specify the organization name if forking into an organization. + organization *string +} +// NewItemItemForksPostRequestBody instantiates a new ItemItemForksPostRequestBody and sets the default values. +func NewItemItemForksPostRequestBody()(*ItemItemForksPostRequestBody) { + m := &ItemItemForksPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemForksPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemForksPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemForksPostRequestBody(), 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 *ItemItemForksPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDefaultBranchOnly gets the default_branch_only property value. When forking from an existing repository, fork with only the default branch. +// returns a *bool when successful +func (m *ItemItemForksPostRequestBody) GetDefaultBranchOnly()(*bool) { + return m.default_branch_only +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemForksPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["default_branch_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranchOnly(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganization(val) + } + return nil + } + return res +} +// GetName gets the name property value. When forking from an existing repository, a new name for the fork. +// returns a *string when successful +func (m *ItemItemForksPostRequestBody) GetName()(*string) { + return m.name +} +// GetOrganization gets the organization property value. Optional parameter to specify the organization name if forking into an organization. +// returns a *string when successful +func (m *ItemItemForksPostRequestBody) GetOrganization()(*string) { + return m.organization +} +// Serialize serializes information the current object +func (m *ItemItemForksPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("default_branch_only", m.GetDefaultBranchOnly()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization", m.GetOrganization()) + 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 *ItemItemForksPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDefaultBranchOnly sets the default_branch_only property value. When forking from an existing repository, fork with only the default branch. +func (m *ItemItemForksPostRequestBody) SetDefaultBranchOnly(value *bool)() { + m.default_branch_only = value +} +// SetName sets the name property value. When forking from an existing repository, a new name for the fork. +func (m *ItemItemForksPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetOrganization sets the organization property value. Optional parameter to specify the organization name if forking into an organization. +func (m *ItemItemForksPostRequestBody) SetOrganization(value *string)() { + m.organization = value +} +type ItemItemForksPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDefaultBranchOnly()(*bool) + GetName()(*string) + GetOrganization()(*string) + SetDefaultBranchOnly(value *bool)() + SetName(value *string)() + SetOrganization(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_forks_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_forks_request_builder.go new file mode 100644 index 000000000..408290a21 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_forks_request_builder.go @@ -0,0 +1,114 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + ia8522d4fb15ab1318931fab69bc994cc5db2188067860f52c78d065e2adc8db4 "github.com/octokit/go-sdk/pkg/github/repos/item/item/forks" +) + +// ItemItemForksRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\forks +type ItemItemForksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemForksRequestBuilderGetQueryParameters list forks +type ItemItemForksRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The sort order. `stargazers` will sort by star count. + Sort *ia8522d4fb15ab1318931fab69bc994cc5db2188067860f52c78d065e2adc8db4.GetSortQueryParameterType `uriparametername:"sort"` +} +// NewItemItemForksRequestBuilderInternal instantiates a new ItemItemForksRequestBuilder and sets the default values. +func NewItemItemForksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemForksRequestBuilder) { + m := &ItemItemForksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/forks{?page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewItemItemForksRequestBuilder instantiates a new ItemItemForksRequestBuilder and sets the default values. +func NewItemItemForksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemForksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemForksRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list forks +// returns a []MinimalRepositoryable when successful +// returns a BasicError error when the service returns a 400 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/forks#list-forks +func (m *ItemItemForksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemForksRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + } + } + return val, nil +} +// Post create a fork for the authenticated user.**Note**: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Support](https://support.github.com/contact?tags=dotcom-rest-api).**Note**: Although this endpoint works with GitHub Apps, the GitHub App must be installed on the destination account with access to all repositories and on the source account with access to the source repository. +// returns a FullRepositoryable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/repos/forks#create-a-fork +func (m *ItemItemForksRequestBuilder) Post(ctx context.Context, body ItemItemForksPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateFullRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable), nil +} +// returns a *RequestInformation when successful +func (m *ItemItemForksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemForksRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation create a fork for the authenticated user.**Note**: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Support](https://support.github.com/contact?tags=dotcom-rest-api).**Note**: Although this endpoint works with GitHub Apps, the GitHub App must be installed on the destination account with access to all repositories and on the source account with access to the source repository. +// returns a *RequestInformation when successful +func (m *ItemItemForksRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemForksPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemForksRequestBuilder when successful +func (m *ItemItemForksRequestBuilder) WithUrl(rawUrl string)(*ItemItemForksRequestBuilder) { + return NewItemItemForksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_generate_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_generate_post_request_body.go new file mode 100644 index 000000000..7dd8fd0e4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_generate_post_request_body.go @@ -0,0 +1,196 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemGeneratePostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A short description of the new repository. + description *string + // Set to `true` to include the directory structure and files from all branches in the template repository, and not just the default branch. Default: `false`. + include_all_branches *bool + // The name of the new repository. + name *string + // The organization or person who will own the new repository. To create a new repository in an organization, the authenticated user must be a member of the specified organization. + owner *string + // Either `true` to create a new private repository or `false` to create a new public one. + private *bool +} +// NewItemItemGeneratePostRequestBody instantiates a new ItemItemGeneratePostRequestBody and sets the default values. +func NewItemItemGeneratePostRequestBody()(*ItemItemGeneratePostRequestBody) { + m := &ItemItemGeneratePostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGeneratePostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGeneratePostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGeneratePostRequestBody(), 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 *ItemItemGeneratePostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. A short description of the new repository. +// returns a *string when successful +func (m *ItemItemGeneratePostRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGeneratePostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["include_all_branches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncludeAllBranches(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOwner(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + return res +} +// GetIncludeAllBranches gets the include_all_branches property value. Set to `true` to include the directory structure and files from all branches in the template repository, and not just the default branch. Default: `false`. +// returns a *bool when successful +func (m *ItemItemGeneratePostRequestBody) GetIncludeAllBranches()(*bool) { + return m.include_all_branches +} +// GetName gets the name property value. The name of the new repository. +// returns a *string when successful +func (m *ItemItemGeneratePostRequestBody) GetName()(*string) { + return m.name +} +// GetOwner gets the owner property value. The organization or person who will own the new repository. To create a new repository in an organization, the authenticated user must be a member of the specified organization. +// returns a *string when successful +func (m *ItemItemGeneratePostRequestBody) GetOwner()(*string) { + return m.owner +} +// GetPrivate gets the private property value. Either `true` to create a new private repository or `false` to create a new public one. +// returns a *bool when successful +func (m *ItemItemGeneratePostRequestBody) GetPrivate()(*bool) { + return m.private +} +// Serialize serializes information the current object +func (m *ItemItemGeneratePostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("include_all_branches", m.GetIncludeAllBranches()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + 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 *ItemItemGeneratePostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. A short description of the new repository. +func (m *ItemItemGeneratePostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetIncludeAllBranches sets the include_all_branches property value. Set to `true` to include the directory structure and files from all branches in the template repository, and not just the default branch. Default: `false`. +func (m *ItemItemGeneratePostRequestBody) SetIncludeAllBranches(value *bool)() { + m.include_all_branches = value +} +// SetName sets the name property value. The name of the new repository. +func (m *ItemItemGeneratePostRequestBody) SetName(value *string)() { + m.name = value +} +// SetOwner sets the owner property value. The organization or person who will own the new repository. To create a new repository in an organization, the authenticated user must be a member of the specified organization. +func (m *ItemItemGeneratePostRequestBody) SetOwner(value *string)() { + m.owner = value +} +// SetPrivate sets the private property value. Either `true` to create a new private repository or `false` to create a new public one. +func (m *ItemItemGeneratePostRequestBody) SetPrivate(value *bool)() { + m.private = value +} +type ItemItemGeneratePostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetIncludeAllBranches()(*bool) + GetName()(*string) + GetOwner()(*string) + GetPrivate()(*bool) + SetDescription(value *string)() + SetIncludeAllBranches(value *bool)() + SetName(value *string)() + SetOwner(value *string)() + SetPrivate(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_generate_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_generate_request_builder.go new file mode 100644 index 000000000..339818d91 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_generate_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemGenerateRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\generate +type ItemItemGenerateRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemGenerateRequestBuilderInternal instantiates a new ItemItemGenerateRequestBuilder and sets the default values. +func NewItemItemGenerateRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGenerateRequestBuilder) { + m := &ItemItemGenerateRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/generate", pathParameters), + } + return m +} +// NewItemItemGenerateRequestBuilder instantiates a new ItemItemGenerateRequestBuilder and sets the default values. +func NewItemItemGenerateRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGenerateRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGenerateRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. If the repository is not public, the authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/repos/repos#get-a-repository) endpoint and check that the `is_template` key is `true`.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository. +// returns a FullRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template +func (m *ItemItemGenerateRequestBuilder) Post(ctx context.Context, body ItemItemGeneratePostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateFullRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable), nil +} +// ToPostRequestInformation creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. If the repository is not public, the authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/repos/repos#get-a-repository) endpoint and check that the `is_template` key is `true`.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemGenerateRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemGeneratePostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemGenerateRequestBuilder when successful +func (m *ItemItemGenerateRequestBuilder) WithUrl(rawUrl string)(*ItemItemGenerateRequestBuilder) { + return NewItemItemGenerateRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_blobs_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_blobs_post_request_body.go new file mode 100644 index 000000000..6aaa85ac7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_blobs_post_request_body.go @@ -0,0 +1,111 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemGitBlobsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The new blob's content. + content *string + // The encoding used for `content`. Currently, `"utf-8"` and `"base64"` are supported. + encoding *string +} +// NewItemItemGitBlobsPostRequestBody instantiates a new ItemItemGitBlobsPostRequestBody and sets the default values. +func NewItemItemGitBlobsPostRequestBody()(*ItemItemGitBlobsPostRequestBody) { + m := &ItemItemGitBlobsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + encodingValue := "utf-8" + m.SetEncoding(&encodingValue) + return m +} +// CreateItemItemGitBlobsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitBlobsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitBlobsPostRequestBody(), 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 *ItemItemGitBlobsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContent gets the content property value. The new blob's content. +// returns a *string when successful +func (m *ItemItemGitBlobsPostRequestBody) GetContent()(*string) { + return m.content +} +// GetEncoding gets the encoding property value. The encoding used for `content`. Currently, `"utf-8"` and `"base64"` are supported. +// returns a *string when successful +func (m *ItemItemGitBlobsPostRequestBody) GetEncoding()(*string) { + return m.encoding +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGitBlobsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContent(val) + } + return nil + } + res["encoding"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncoding(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemGitBlobsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content", m.GetContent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("encoding", m.GetEncoding()) + 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 *ItemItemGitBlobsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContent sets the content property value. The new blob's content. +func (m *ItemItemGitBlobsPostRequestBody) SetContent(value *string)() { + m.content = value +} +// SetEncoding sets the encoding property value. The encoding used for `content`. Currently, `"utf-8"` and `"base64"` are supported. +func (m *ItemItemGitBlobsPostRequestBody) SetEncoding(value *string)() { + m.encoding = value +} +type ItemItemGitBlobsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContent()(*string) + GetEncoding()(*string) + SetContent(value *string)() + SetEncoding(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_blobs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_blobs_request_builder.go new file mode 100644 index 000000000..e1d313dee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_blobs_request_builder.go @@ -0,0 +1,82 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemGitBlobsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\blobs +type ItemItemGitBlobsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByFile_sha gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.git.blobs.item collection +// returns a *ItemItemGitBlobsWithFile_shaItemRequestBuilder when successful +func (m *ItemItemGitBlobsRequestBuilder) ByFile_sha(file_sha string)(*ItemItemGitBlobsWithFile_shaItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if file_sha != "" { + urlTplParams["file_sha"] = file_sha + } + return NewItemItemGitBlobsWithFile_shaItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemGitBlobsRequestBuilderInternal instantiates a new ItemItemGitBlobsRequestBuilder and sets the default values. +func NewItemItemGitBlobsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitBlobsRequestBuilder) { + m := &ItemItemGitBlobsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/blobs", pathParameters), + } + return m +} +// NewItemItemGitBlobsRequestBuilder instantiates a new ItemItemGitBlobsRequestBuilder and sets the default values. +func NewItemItemGitBlobsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitBlobsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitBlobsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post create a blob +// returns a ShortBlobable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/git/blobs#create-a-blob +func (m *ItemItemGitBlobsRequestBuilder) Post(ctx context.Context, body ItemItemGitBlobsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ShortBlobable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateShortBlobFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ShortBlobable), nil +} +// returns a *RequestInformation when successful +func (m *ItemItemGitBlobsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemGitBlobsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemGitBlobsRequestBuilder when successful +func (m *ItemItemGitBlobsRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitBlobsRequestBuilder) { + return NewItemItemGitBlobsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_blobs_with_file_sha_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_blobs_with_file_sha_item_request_builder.go new file mode 100644 index 000000000..8cd44f970 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_blobs_with_file_sha_item_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemGitBlobsWithFile_shaItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\blobs\{file_sha} +type ItemItemGitBlobsWithFile_shaItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemGitBlobsWithFile_shaItemRequestBuilderInternal instantiates a new ItemItemGitBlobsWithFile_shaItemRequestBuilder and sets the default values. +func NewItemItemGitBlobsWithFile_shaItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitBlobsWithFile_shaItemRequestBuilder) { + m := &ItemItemGitBlobsWithFile_shaItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/blobs/{file_sha}", pathParameters), + } + return m +} +// NewItemItemGitBlobsWithFile_shaItemRequestBuilder instantiates a new ItemItemGitBlobsWithFile_shaItemRequestBuilder and sets the default values. +func NewItemItemGitBlobsWithFile_shaItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitBlobsWithFile_shaItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitBlobsWithFile_shaItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get the `content` in the response will always be Base64 encoded.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw blob data.- **`application/vnd.github+json`**: Returns a JSON representation of the blob with `content` as a base64 encoded string. This is the default if no media type is specified.**Note** This endpoint supports blobs up to 100 megabytes in size. +// returns a Blobable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/git/blobs#get-a-blob +func (m *ItemItemGitBlobsWithFile_shaItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Blobable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBlobFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Blobable), nil +} +// ToGetRequestInformation the `content` in the response will always be Base64 encoded.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw blob data.- **`application/vnd.github+json`**: Returns a JSON representation of the blob with `content` as a base64 encoded string. This is the default if no media type is specified.**Note** This endpoint supports blobs up to 100 megabytes in size. +// returns a *RequestInformation when successful +func (m *ItemItemGitBlobsWithFile_shaItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemGitBlobsWithFile_shaItemRequestBuilder when successful +func (m *ItemItemGitBlobsWithFile_shaItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitBlobsWithFile_shaItemRequestBuilder) { + return NewItemItemGitBlobsWithFile_shaItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_commits_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_commits_post_request_body.go new file mode 100644 index 000000000..76c2644ca --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_commits_post_request_body.go @@ -0,0 +1,231 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemGitCommitsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Information about the author of the commit. By default, the `author` will be the authenticated user and the current date. See the `author` and `committer` object below for details. + author ItemItemGitCommitsPostRequestBody_authorable + // Information about the person who is making the commit. By default, `committer` will use the information set in `author`. See the `author` and `committer` object below for details. + committer ItemItemGitCommitsPostRequestBody_committerable + // The commit message + message *string + // The SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of more than one should be provided. + parents []string + // The [PGP signature](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) of the commit. GitHub adds the signature to the `gpgsig` header of the created commit. For a commit signature to be verifiable by Git or GitHub, it must be an ASCII-armored detached PGP signature over the string commit as it would be written to the object database. To pass a `signature` parameter, you need to first manually create a valid PGP signature, which can be complicated. You may find it easier to [use the command line](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work) to create signed commits. + signature *string + // The SHA of the tree object this commit points to + tree *string +} +// NewItemItemGitCommitsPostRequestBody instantiates a new ItemItemGitCommitsPostRequestBody and sets the default values. +func NewItemItemGitCommitsPostRequestBody()(*ItemItemGitCommitsPostRequestBody) { + m := &ItemItemGitCommitsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitCommitsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitCommitsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitCommitsPostRequestBody(), 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 *ItemItemGitCommitsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. Information about the author of the commit. By default, the `author` will be the authenticated user and the current date. See the `author` and `committer` object below for details. +// returns a ItemItemGitCommitsPostRequestBody_authorable when successful +func (m *ItemItemGitCommitsPostRequestBody) GetAuthor()(ItemItemGitCommitsPostRequestBody_authorable) { + return m.author +} +// GetCommitter gets the committer property value. Information about the person who is making the commit. By default, `committer` will use the information set in `author`. See the `author` and `committer` object below for details. +// returns a ItemItemGitCommitsPostRequestBody_committerable when successful +func (m *ItemItemGitCommitsPostRequestBody) GetCommitter()(ItemItemGitCommitsPostRequestBody_committerable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGitCommitsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemGitCommitsPostRequestBody_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(ItemItemGitCommitsPostRequestBody_authorable)) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemGitCommitsPostRequestBody_committerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(ItemItemGitCommitsPostRequestBody_committerable)) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["parents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetParents(res) + } + return nil + } + res["signature"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSignature(val) + } + return nil + } + res["tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTree(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The commit message +// returns a *string when successful +func (m *ItemItemGitCommitsPostRequestBody) GetMessage()(*string) { + return m.message +} +// GetParents gets the parents property value. The SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of more than one should be provided. +// returns a []string when successful +func (m *ItemItemGitCommitsPostRequestBody) GetParents()([]string) { + return m.parents +} +// GetSignature gets the signature property value. The [PGP signature](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) of the commit. GitHub adds the signature to the `gpgsig` header of the created commit. For a commit signature to be verifiable by Git or GitHub, it must be an ASCII-armored detached PGP signature over the string commit as it would be written to the object database. To pass a `signature` parameter, you need to first manually create a valid PGP signature, which can be complicated. You may find it easier to [use the command line](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work) to create signed commits. +// returns a *string when successful +func (m *ItemItemGitCommitsPostRequestBody) GetSignature()(*string) { + return m.signature +} +// GetTree gets the tree property value. The SHA of the tree object this commit points to +// returns a *string when successful +func (m *ItemItemGitCommitsPostRequestBody) GetTree()(*string) { + return m.tree +} +// Serialize serializes information the current object +func (m *ItemItemGitCommitsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + if m.GetParents() != nil { + err := writer.WriteCollectionOfStringValues("parents", m.GetParents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("signature", m.GetSignature()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tree", m.GetTree()) + 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 *ItemItemGitCommitsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. Information about the author of the commit. By default, the `author` will be the authenticated user and the current date. See the `author` and `committer` object below for details. +func (m *ItemItemGitCommitsPostRequestBody) SetAuthor(value ItemItemGitCommitsPostRequestBody_authorable)() { + m.author = value +} +// SetCommitter sets the committer property value. Information about the person who is making the commit. By default, `committer` will use the information set in `author`. See the `author` and `committer` object below for details. +func (m *ItemItemGitCommitsPostRequestBody) SetCommitter(value ItemItemGitCommitsPostRequestBody_committerable)() { + m.committer = value +} +// SetMessage sets the message property value. The commit message +func (m *ItemItemGitCommitsPostRequestBody) SetMessage(value *string)() { + m.message = value +} +// SetParents sets the parents property value. The SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of more than one should be provided. +func (m *ItemItemGitCommitsPostRequestBody) SetParents(value []string)() { + m.parents = value +} +// SetSignature sets the signature property value. The [PGP signature](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) of the commit. GitHub adds the signature to the `gpgsig` header of the created commit. For a commit signature to be verifiable by Git or GitHub, it must be an ASCII-armored detached PGP signature over the string commit as it would be written to the object database. To pass a `signature` parameter, you need to first manually create a valid PGP signature, which can be complicated. You may find it easier to [use the command line](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work) to create signed commits. +func (m *ItemItemGitCommitsPostRequestBody) SetSignature(value *string)() { + m.signature = value +} +// SetTree sets the tree property value. The SHA of the tree object this commit points to +func (m *ItemItemGitCommitsPostRequestBody) SetTree(value *string)() { + m.tree = value +} +type ItemItemGitCommitsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(ItemItemGitCommitsPostRequestBody_authorable) + GetCommitter()(ItemItemGitCommitsPostRequestBody_committerable) + GetMessage()(*string) + GetParents()([]string) + GetSignature()(*string) + GetTree()(*string) + SetAuthor(value ItemItemGitCommitsPostRequestBody_authorable)() + SetCommitter(value ItemItemGitCommitsPostRequestBody_committerable)() + SetMessage(value *string)() + SetParents(value []string)() + SetSignature(value *string)() + SetTree(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_commits_post_request_body_author.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_commits_post_request_body_author.go new file mode 100644 index 000000000..7f6fdae0a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_commits_post_request_body_author.go @@ -0,0 +1,140 @@ +package repos + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemGitCommitsPostRequestBody_author information about the author of the commit. By default, the `author` will be the authenticated user and the current date. See the `author` and `committer` object below for details. +type ItemItemGitCommitsPostRequestBody_author struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + date *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The email of the author (or committer) of the commit + email *string + // The name of the author (or committer) of the commit + name *string +} +// NewItemItemGitCommitsPostRequestBody_author instantiates a new ItemItemGitCommitsPostRequestBody_author and sets the default values. +func NewItemItemGitCommitsPostRequestBody_author()(*ItemItemGitCommitsPostRequestBody_author) { + m := &ItemItemGitCommitsPostRequestBody_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitCommitsPostRequestBody_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitCommitsPostRequestBody_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitCommitsPostRequestBody_author(), 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 *ItemItemGitCommitsPostRequestBody_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *ItemItemGitCommitsPostRequestBody_author) GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.date +} +// GetEmail gets the email property value. The email of the author (or committer) of the commit +// returns a *string when successful +func (m *ItemItemGitCommitsPostRequestBody_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGitCommitsPostRequestBody_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the author (or committer) of the commit +// returns a *string when successful +func (m *ItemItemGitCommitsPostRequestBody_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemGitCommitsPostRequestBody_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemGitCommitsPostRequestBody_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *ItemItemGitCommitsPostRequestBody_author) SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.date = value +} +// SetEmail sets the email property value. The email of the author (or committer) of the commit +func (m *ItemItemGitCommitsPostRequestBody_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name of the author (or committer) of the commit +func (m *ItemItemGitCommitsPostRequestBody_author) SetName(value *string)() { + m.name = value +} +type ItemItemGitCommitsPostRequestBody_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetName()(*string) + SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_commits_post_request_body_committer.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_commits_post_request_body_committer.go new file mode 100644 index 000000000..05ab58bdd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_commits_post_request_body_committer.go @@ -0,0 +1,140 @@ +package repos + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemGitCommitsPostRequestBody_committer information about the person who is making the commit. By default, `committer` will use the information set in `author`. See the `author` and `committer` object below for details. +type ItemItemGitCommitsPostRequestBody_committer struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + date *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The email of the author (or committer) of the commit + email *string + // The name of the author (or committer) of the commit + name *string +} +// NewItemItemGitCommitsPostRequestBody_committer instantiates a new ItemItemGitCommitsPostRequestBody_committer and sets the default values. +func NewItemItemGitCommitsPostRequestBody_committer()(*ItemItemGitCommitsPostRequestBody_committer) { + m := &ItemItemGitCommitsPostRequestBody_committer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitCommitsPostRequestBody_committerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitCommitsPostRequestBody_committerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitCommitsPostRequestBody_committer(), 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 *ItemItemGitCommitsPostRequestBody_committer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *ItemItemGitCommitsPostRequestBody_committer) GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.date +} +// GetEmail gets the email property value. The email of the author (or committer) of the commit +// returns a *string when successful +func (m *ItemItemGitCommitsPostRequestBody_committer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGitCommitsPostRequestBody_committer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the author (or committer) of the commit +// returns a *string when successful +func (m *ItemItemGitCommitsPostRequestBody_committer) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemGitCommitsPostRequestBody_committer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemGitCommitsPostRequestBody_committer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *ItemItemGitCommitsPostRequestBody_committer) SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.date = value +} +// SetEmail sets the email property value. The email of the author (or committer) of the commit +func (m *ItemItemGitCommitsPostRequestBody_committer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name of the author (or committer) of the commit +func (m *ItemItemGitCommitsPostRequestBody_committer) SetName(value *string)() { + m.name = value +} +type ItemItemGitCommitsPostRequestBody_committerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetName()(*string) + SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_commits_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_commits_request_builder.go new file mode 100644 index 000000000..e58a64ead --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_commits_request_builder.go @@ -0,0 +1,81 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemGitCommitsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\commits +type ItemItemGitCommitsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByCommit_sha gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.git.commits.item collection +// returns a *ItemItemGitCommitsWithCommit_shaItemRequestBuilder when successful +func (m *ItemItemGitCommitsRequestBuilder) ByCommit_sha(commit_sha string)(*ItemItemGitCommitsWithCommit_shaItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if commit_sha != "" { + urlTplParams["commit_sha"] = commit_sha + } + return NewItemItemGitCommitsWithCommit_shaItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemGitCommitsRequestBuilderInternal instantiates a new ItemItemGitCommitsRequestBuilder and sets the default values. +func NewItemItemGitCommitsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitCommitsRequestBuilder) { + m := &ItemItemGitCommitsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/commits", pathParameters), + } + return m +} +// NewItemItemGitCommitsRequestBuilder instantiates a new ItemItemGitCommitsRequestBuilder and sets the default values. +func NewItemItemGitCommitsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitCommitsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitCommitsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates a new Git [commit object](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects).**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in the table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a GitCommitable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/git/commits#create-a-commit +func (m *ItemItemGitCommitsRequestBuilder) Post(ctx context.Context, body ItemItemGitCommitsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitCommitable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGitCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitCommitable), nil +} +// ToPostRequestInformation creates a new Git [commit object](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects).**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in the table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a *RequestInformation when successful +func (m *ItemItemGitCommitsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemGitCommitsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemGitCommitsRequestBuilder when successful +func (m *ItemItemGitCommitsRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitCommitsRequestBuilder) { + return NewItemItemGitCommitsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_commits_with_commit_sha_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_commits_with_commit_sha_item_request_builder.go new file mode 100644 index 000000000..936cfcbc0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_commits_with_commit_sha_item_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemGitCommitsWithCommit_shaItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\commits\{commit_sha} +type ItemItemGitCommitsWithCommit_shaItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemGitCommitsWithCommit_shaItemRequestBuilderInternal instantiates a new ItemItemGitCommitsWithCommit_shaItemRequestBuilder and sets the default values. +func NewItemItemGitCommitsWithCommit_shaItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitCommitsWithCommit_shaItemRequestBuilder) { + m := &ItemItemGitCommitsWithCommit_shaItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/commits/{commit_sha}", pathParameters), + } + return m +} +// NewItemItemGitCommitsWithCommit_shaItemRequestBuilder instantiates a new ItemItemGitCommitsWithCommit_shaItemRequestBuilder and sets the default values. +func NewItemItemGitCommitsWithCommit_shaItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitCommitsWithCommit_shaItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitCommitsWithCommit_shaItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a Git [commit object](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects).To get the contents of a commit, see "[Get a commit](/rest/commits/commits#get-a-commit)."**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in the table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a GitCommitable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/git/commits#get-a-commit-object +func (m *ItemItemGitCommitsWithCommit_shaItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitCommitable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGitCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitCommitable), nil +} +// ToGetRequestInformation gets a Git [commit object](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects).To get the contents of a commit, see "[Get a commit](/rest/commits/commits#get-a-commit)."**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in the table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a *RequestInformation when successful +func (m *ItemItemGitCommitsWithCommit_shaItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemGitCommitsWithCommit_shaItemRequestBuilder when successful +func (m *ItemItemGitCommitsWithCommit_shaItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitCommitsWithCommit_shaItemRequestBuilder) { + return NewItemItemGitCommitsWithCommit_shaItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_matching_refs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_matching_refs_request_builder.go new file mode 100644 index 000000000..383338f0f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_matching_refs_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemGitMatchingRefsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\matching-refs +type ItemItemGitMatchingRefsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRef gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.git.matchingRefs.item collection +// returns a *ItemItemGitMatchingRefsWithRefItemRequestBuilder when successful +func (m *ItemItemGitMatchingRefsRequestBuilder) ByRef(ref string)(*ItemItemGitMatchingRefsWithRefItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if ref != "" { + urlTplParams["ref"] = ref + } + return NewItemItemGitMatchingRefsWithRefItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemGitMatchingRefsRequestBuilderInternal instantiates a new ItemItemGitMatchingRefsRequestBuilder and sets the default values. +func NewItemItemGitMatchingRefsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitMatchingRefsRequestBuilder) { + m := &ItemItemGitMatchingRefsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/matching-refs", pathParameters), + } + return m +} +// NewItemItemGitMatchingRefsRequestBuilder instantiates a new ItemItemGitMatchingRefsRequestBuilder and sets the default values. +func NewItemItemGitMatchingRefsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitMatchingRefsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitMatchingRefsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_matching_refs_with_ref_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_matching_refs_with_ref_item_request_builder.go new file mode 100644 index 000000000..895b7a5b8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_matching_refs_with_ref_item_request_builder.go @@ -0,0 +1,64 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemGitMatchingRefsWithRefItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\matching-refs\{ref} +type ItemItemGitMatchingRefsWithRefItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemGitMatchingRefsWithRefItemRequestBuilderInternal instantiates a new ItemItemGitMatchingRefsWithRefItemRequestBuilder and sets the default values. +func NewItemItemGitMatchingRefsWithRefItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitMatchingRefsWithRefItemRequestBuilder) { + m := &ItemItemGitMatchingRefsWithRefItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/matching-refs/{ref}", pathParameters), + } + return m +} +// NewItemItemGitMatchingRefsWithRefItemRequestBuilder instantiates a new ItemItemGitMatchingRefsWithRefItemRequestBuilder and sets the default values. +func NewItemItemGitMatchingRefsWithRefItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitMatchingRefsWithRefItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitMatchingRefsWithRefItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns an array of references from your Git database that match the supplied name. The `:ref` in the URL must be formatted as `heads/` for branches and `tags/` for tags. If the `:ref` doesn't exist in the repository, but existing refs start with `:ref`, they will be returned as an array.When you use this endpoint without providing a `:ref`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just `heads` and `tags`.**Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/pulls/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)".If you request matching references for a branch named `feature` but the branch `feature` doesn't exist, the response can still include other matching head refs that start with the word `feature`, such as `featureA` and `featureB`. +// returns a []GitRefable when successful +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/git/refs#list-matching-references +func (m *ItemItemGitMatchingRefsWithRefItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitRefable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGitRefFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitRefable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitRefable) + } + } + return val, nil +} +// ToGetRequestInformation returns an array of references from your Git database that match the supplied name. The `:ref` in the URL must be formatted as `heads/` for branches and `tags/` for tags. If the `:ref` doesn't exist in the repository, but existing refs start with `:ref`, they will be returned as an array.When you use this endpoint without providing a `:ref`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just `heads` and `tags`.**Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/pulls/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)".If you request matching references for a branch named `feature` but the branch `feature` doesn't exist, the response can still include other matching head refs that start with the word `feature`, such as `featureA` and `featureB`. +// returns a *RequestInformation when successful +func (m *ItemItemGitMatchingRefsWithRefItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemGitMatchingRefsWithRefItemRequestBuilder when successful +func (m *ItemItemGitMatchingRefsWithRefItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitMatchingRefsWithRefItemRequestBuilder) { + return NewItemItemGitMatchingRefsWithRefItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_ref_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_ref_request_builder.go new file mode 100644 index 000000000..339eff94b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_ref_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemGitRefRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\ref +type ItemItemGitRefRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRef gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.git.ref.item collection +// returns a *ItemItemGitRefWithRefItemRequestBuilder when successful +func (m *ItemItemGitRefRequestBuilder) ByRef(ref string)(*ItemItemGitRefWithRefItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if ref != "" { + urlTplParams["ref"] = ref + } + return NewItemItemGitRefWithRefItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemGitRefRequestBuilderInternal instantiates a new ItemItemGitRefRequestBuilder and sets the default values. +func NewItemItemGitRefRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRefRequestBuilder) { + m := &ItemItemGitRefRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/ref", pathParameters), + } + return m +} +// NewItemItemGitRefRequestBuilder instantiates a new ItemItemGitRefRequestBuilder and sets the default values. +func NewItemItemGitRefRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRefRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitRefRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_ref_with_ref_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_ref_with_ref_item_request_builder.go new file mode 100644 index 000000000..a5669212a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_ref_with_ref_item_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemGitRefWithRefItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\ref\{ref} +type ItemItemGitRefWithRefItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemGitRefWithRefItemRequestBuilderInternal instantiates a new ItemItemGitRefWithRefItemRequestBuilder and sets the default values. +func NewItemItemGitRefWithRefItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRefWithRefItemRequestBuilder) { + m := &ItemItemGitRefWithRefItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/ref/{ref}", pathParameters), + } + return m +} +// NewItemItemGitRefWithRefItemRequestBuilder instantiates a new ItemItemGitRefWithRefItemRequestBuilder and sets the default values. +func NewItemItemGitRefWithRefItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRefWithRefItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitRefWithRefItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns a single reference from your Git database. The `:ref` in the URL must be formatted as `heads/` for branches and `tags/` for tags. If the `:ref` doesn't match an existing ref, a `404` is returned.**Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/pulls/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". +// returns a GitRefable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/git/refs#get-a-reference +func (m *ItemItemGitRefWithRefItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitRefable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGitRefFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitRefable), nil +} +// ToGetRequestInformation returns a single reference from your Git database. The `:ref` in the URL must be formatted as `heads/` for branches and `tags/` for tags. If the `:ref` doesn't match an existing ref, a `404` is returned.**Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/pulls/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". +// returns a *RequestInformation when successful +func (m *ItemItemGitRefWithRefItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemGitRefWithRefItemRequestBuilder when successful +func (m *ItemItemGitRefWithRefItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitRefWithRefItemRequestBuilder) { + return NewItemItemGitRefWithRefItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_refs_item_with_ref_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_refs_item_with_ref_patch_request_body.go new file mode 100644 index 000000000..3ba5f7733 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_refs_item_with_ref_patch_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemGitRefsItemWithRefPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to `false` will make sure you're not overwriting work. + force *bool + // The SHA1 value to set this reference to + sha *string +} +// NewItemItemGitRefsItemWithRefPatchRequestBody instantiates a new ItemItemGitRefsItemWithRefPatchRequestBody and sets the default values. +func NewItemItemGitRefsItemWithRefPatchRequestBody()(*ItemItemGitRefsItemWithRefPatchRequestBody) { + m := &ItemItemGitRefsItemWithRefPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitRefsItemWithRefPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitRefsItemWithRefPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitRefsItemWithRefPatchRequestBody(), 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 *ItemItemGitRefsItemWithRefPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGitRefsItemWithRefPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["force"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetForce(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetForce gets the force property value. Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to `false` will make sure you're not overwriting work. +// returns a *bool when successful +func (m *ItemItemGitRefsItemWithRefPatchRequestBody) GetForce()(*bool) { + return m.force +} +// GetSha gets the sha property value. The SHA1 value to set this reference to +// returns a *string when successful +func (m *ItemItemGitRefsItemWithRefPatchRequestBody) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *ItemItemGitRefsItemWithRefPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("force", m.GetForce()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *ItemItemGitRefsItemWithRefPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetForce sets the force property value. Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to `false` will make sure you're not overwriting work. +func (m *ItemItemGitRefsItemWithRefPatchRequestBody) SetForce(value *bool)() { + m.force = value +} +// SetSha sets the sha property value. The SHA1 value to set this reference to +func (m *ItemItemGitRefsItemWithRefPatchRequestBody) SetSha(value *string)() { + m.sha = value +} +type ItemItemGitRefsItemWithRefPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetForce()(*bool) + GetSha()(*string) + SetForce(value *bool)() + SetSha(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_refs_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_refs_post_request_body.go new file mode 100644 index 000000000..2b225bf60 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_refs_post_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemGitRefsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name of the fully qualified reference (ie: `refs/heads/master`). If it doesn't start with 'refs' and have at least two slashes, it will be rejected. + ref *string + // The SHA1 value for this reference. + sha *string +} +// NewItemItemGitRefsPostRequestBody instantiates a new ItemItemGitRefsPostRequestBody and sets the default values. +func NewItemItemGitRefsPostRequestBody()(*ItemItemGitRefsPostRequestBody) { + m := &ItemItemGitRefsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitRefsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitRefsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitRefsPostRequestBody(), 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 *ItemItemGitRefsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGitRefsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetRef gets the ref property value. The name of the fully qualified reference (ie: `refs/heads/master`). If it doesn't start with 'refs' and have at least two slashes, it will be rejected. +// returns a *string when successful +func (m *ItemItemGitRefsPostRequestBody) GetRef()(*string) { + return m.ref +} +// GetSha gets the sha property value. The SHA1 value for this reference. +// returns a *string when successful +func (m *ItemItemGitRefsPostRequestBody) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *ItemItemGitRefsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *ItemItemGitRefsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRef sets the ref property value. The name of the fully qualified reference (ie: `refs/heads/master`). If it doesn't start with 'refs' and have at least two slashes, it will be rejected. +func (m *ItemItemGitRefsPostRequestBody) SetRef(value *string)() { + m.ref = value +} +// SetSha sets the sha property value. The SHA1 value for this reference. +func (m *ItemItemGitRefsPostRequestBody) SetSha(value *string)() { + m.sha = value +} +type ItemItemGitRefsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRef()(*string) + GetSha()(*string) + SetRef(value *string)() + SetSha(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_refs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_refs_request_builder.go new file mode 100644 index 000000000..28697054e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_refs_request_builder.go @@ -0,0 +1,79 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemGitRefsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\refs +type ItemItemGitRefsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRef gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.git.refs.item collection +// returns a *ItemItemGitRefsWithRefItemRequestBuilder when successful +func (m *ItemItemGitRefsRequestBuilder) ByRef(ref string)(*ItemItemGitRefsWithRefItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if ref != "" { + urlTplParams["ref"] = ref + } + return NewItemItemGitRefsWithRefItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemGitRefsRequestBuilderInternal instantiates a new ItemItemGitRefsRequestBuilder and sets the default values. +func NewItemItemGitRefsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRefsRequestBuilder) { + m := &ItemItemGitRefsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/refs", pathParameters), + } + return m +} +// NewItemItemGitRefsRequestBuilder instantiates a new ItemItemGitRefsRequestBuilder and sets the default values. +func NewItemItemGitRefsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRefsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitRefsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches. +// returns a GitRefable when successful +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/git/refs#create-a-reference +func (m *ItemItemGitRefsRequestBuilder) Post(ctx context.Context, body ItemItemGitRefsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitRefable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGitRefFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitRefable), nil +} +// ToPostRequestInformation creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches. +// returns a *RequestInformation when successful +func (m *ItemItemGitRefsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemGitRefsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemGitRefsRequestBuilder when successful +func (m *ItemItemGitRefsRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitRefsRequestBuilder) { + return NewItemItemGitRefsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_refs_with_ref_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_refs_with_ref_item_request_builder.go new file mode 100644 index 000000000..3dccba2e1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_refs_with_ref_item_request_builder.go @@ -0,0 +1,96 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemGitRefsWithRefItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\refs\{ref} +type ItemItemGitRefsWithRefItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemGitRefsWithRefItemRequestBuilderInternal instantiates a new ItemItemGitRefsWithRefItemRequestBuilder and sets the default values. +func NewItemItemGitRefsWithRefItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRefsWithRefItemRequestBuilder) { + m := &ItemItemGitRefsWithRefItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/refs/{ref}", pathParameters), + } + return m +} +// NewItemItemGitRefsWithRefItemRequestBuilder instantiates a new ItemItemGitRefsWithRefItemRequestBuilder and sets the default values. +func NewItemItemGitRefsWithRefItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRefsWithRefItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitRefsWithRefItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes the provided reference. +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/git/refs#delete-a-reference +func (m *ItemItemGitRefsWithRefItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Patch updates the provided reference to point to a new SHA. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. +// returns a GitRefable when successful +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/git/refs#update-a-reference +func (m *ItemItemGitRefsWithRefItemRequestBuilder) Patch(ctx context.Context, body ItemItemGitRefsItemWithRefPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitRefable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGitRefFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitRefable), nil +} +// ToDeleteRequestInformation deletes the provided reference. +// returns a *RequestInformation when successful +func (m *ItemItemGitRefsWithRefItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates the provided reference to point to a new SHA. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. +// returns a *RequestInformation when successful +func (m *ItemItemGitRefsWithRefItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemGitRefsItemWithRefPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemGitRefsWithRefItemRequestBuilder when successful +func (m *ItemItemGitRefsWithRefItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitRefsWithRefItemRequestBuilder) { + return NewItemItemGitRefsWithRefItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_request_builder.go new file mode 100644 index 000000000..eb9451b69 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_request_builder.go @@ -0,0 +1,58 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemGitRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git +type ItemItemGitRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Blobs the blobs property +// returns a *ItemItemGitBlobsRequestBuilder when successful +func (m *ItemItemGitRequestBuilder) Blobs()(*ItemItemGitBlobsRequestBuilder) { + return NewItemItemGitBlobsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Commits the commits property +// returns a *ItemItemGitCommitsRequestBuilder when successful +func (m *ItemItemGitRequestBuilder) Commits()(*ItemItemGitCommitsRequestBuilder) { + return NewItemItemGitCommitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemGitRequestBuilderInternal instantiates a new ItemItemGitRequestBuilder and sets the default values. +func NewItemItemGitRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRequestBuilder) { + m := &ItemItemGitRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git", pathParameters), + } + return m +} +// NewItemItemGitRequestBuilder instantiates a new ItemItemGitRequestBuilder and sets the default values. +func NewItemItemGitRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitRequestBuilderInternal(urlParams, requestAdapter) +} +// MatchingRefs the matchingRefs property +// returns a *ItemItemGitMatchingRefsRequestBuilder when successful +func (m *ItemItemGitRequestBuilder) MatchingRefs()(*ItemItemGitMatchingRefsRequestBuilder) { + return NewItemItemGitMatchingRefsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Ref the ref property +// returns a *ItemItemGitRefRequestBuilder when successful +func (m *ItemItemGitRequestBuilder) Ref()(*ItemItemGitRefRequestBuilder) { + return NewItemItemGitRefRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Refs the refs property +// returns a *ItemItemGitRefsRequestBuilder when successful +func (m *ItemItemGitRequestBuilder) Refs()(*ItemItemGitRefsRequestBuilder) { + return NewItemItemGitRefsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Tags the tags property +// returns a *ItemItemGitTagsRequestBuilder when successful +func (m *ItemItemGitRequestBuilder) Tags()(*ItemItemGitTagsRequestBuilder) { + return NewItemItemGitTagsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Trees the trees property +// returns a *ItemItemGitTreesRequestBuilder when successful +func (m *ItemItemGitRequestBuilder) Trees()(*ItemItemGitTreesRequestBuilder) { + return NewItemItemGitTreesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_tags_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_tags_post_request_body.go new file mode 100644 index 000000000..2e85db948 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_tags_post_request_body.go @@ -0,0 +1,167 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemGitTagsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The tag message. + message *string + // The SHA of the git object this is tagging. + object *string + // The tag's name. This is typically a version (e.g., "v0.0.1"). + tag *string + // An object with information about the individual creating the tag. + tagger ItemItemGitTagsPostRequestBody_taggerable +} +// NewItemItemGitTagsPostRequestBody instantiates a new ItemItemGitTagsPostRequestBody and sets the default values. +func NewItemItemGitTagsPostRequestBody()(*ItemItemGitTagsPostRequestBody) { + m := &ItemItemGitTagsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitTagsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitTagsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitTagsPostRequestBody(), 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 *ItemItemGitTagsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGitTagsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["object"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObject(val) + } + return nil + } + res["tag"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTag(val) + } + return nil + } + res["tagger"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemGitTagsPostRequestBody_taggerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTagger(val.(ItemItemGitTagsPostRequestBody_taggerable)) + } + return nil + } + return res +} +// GetMessage gets the message property value. The tag message. +// returns a *string when successful +func (m *ItemItemGitTagsPostRequestBody) GetMessage()(*string) { + return m.message +} +// GetObject gets the object property value. The SHA of the git object this is tagging. +// returns a *string when successful +func (m *ItemItemGitTagsPostRequestBody) GetObject()(*string) { + return m.object +} +// GetTag gets the tag property value. The tag's name. This is typically a version (e.g., "v0.0.1"). +// returns a *string when successful +func (m *ItemItemGitTagsPostRequestBody) GetTag()(*string) { + return m.tag +} +// GetTagger gets the tagger property value. An object with information about the individual creating the tag. +// returns a ItemItemGitTagsPostRequestBody_taggerable when successful +func (m *ItemItemGitTagsPostRequestBody) GetTagger()(ItemItemGitTagsPostRequestBody_taggerable) { + return m.tagger +} +// Serialize serializes information the current object +func (m *ItemItemGitTagsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object", m.GetObject()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tag", m.GetTag()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tagger", m.GetTagger()) + 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 *ItemItemGitTagsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. The tag message. +func (m *ItemItemGitTagsPostRequestBody) SetMessage(value *string)() { + m.message = value +} +// SetObject sets the object property value. The SHA of the git object this is tagging. +func (m *ItemItemGitTagsPostRequestBody) SetObject(value *string)() { + m.object = value +} +// SetTag sets the tag property value. The tag's name. This is typically a version (e.g., "v0.0.1"). +func (m *ItemItemGitTagsPostRequestBody) SetTag(value *string)() { + m.tag = value +} +// SetTagger sets the tagger property value. An object with information about the individual creating the tag. +func (m *ItemItemGitTagsPostRequestBody) SetTagger(value ItemItemGitTagsPostRequestBody_taggerable)() { + m.tagger = value +} +type ItemItemGitTagsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + GetObject()(*string) + GetTag()(*string) + GetTagger()(ItemItemGitTagsPostRequestBody_taggerable) + SetMessage(value *string)() + SetObject(value *string)() + SetTag(value *string)() + SetTagger(value ItemItemGitTagsPostRequestBody_taggerable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_tags_post_request_body_tagger.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_tags_post_request_body_tagger.go new file mode 100644 index 000000000..a952dc90c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_tags_post_request_body_tagger.go @@ -0,0 +1,140 @@ +package repos + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemGitTagsPostRequestBody_tagger an object with information about the individual creating the tag. +type ItemItemGitTagsPostRequestBody_tagger struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // When this object was tagged. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + date *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The email of the author of the tag + email *string + // The name of the author of the tag + name *string +} +// NewItemItemGitTagsPostRequestBody_tagger instantiates a new ItemItemGitTagsPostRequestBody_tagger and sets the default values. +func NewItemItemGitTagsPostRequestBody_tagger()(*ItemItemGitTagsPostRequestBody_tagger) { + m := &ItemItemGitTagsPostRequestBody_tagger{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitTagsPostRequestBody_taggerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitTagsPostRequestBody_taggerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitTagsPostRequestBody_tagger(), 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 *ItemItemGitTagsPostRequestBody_tagger) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. When this object was tagged. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *ItemItemGitTagsPostRequestBody_tagger) GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.date +} +// GetEmail gets the email property value. The email of the author of the tag +// returns a *string when successful +func (m *ItemItemGitTagsPostRequestBody_tagger) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGitTagsPostRequestBody_tagger) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the author of the tag +// returns a *string when successful +func (m *ItemItemGitTagsPostRequestBody_tagger) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemGitTagsPostRequestBody_tagger) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemGitTagsPostRequestBody_tagger) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. When this object was tagged. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *ItemItemGitTagsPostRequestBody_tagger) SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.date = value +} +// SetEmail sets the email property value. The email of the author of the tag +func (m *ItemItemGitTagsPostRequestBody_tagger) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name of the author of the tag +func (m *ItemItemGitTagsPostRequestBody_tagger) SetName(value *string)() { + m.name = value +} +type ItemItemGitTagsPostRequestBody_taggerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetName()(*string) + SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_tags_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_tags_request_builder.go new file mode 100644 index 000000000..b539d6195 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_tags_request_builder.go @@ -0,0 +1,79 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemGitTagsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\tags +type ItemItemGitTagsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByTag_sha gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.git.tags.item collection +// returns a *ItemItemGitTagsWithTag_shaItemRequestBuilder when successful +func (m *ItemItemGitTagsRequestBuilder) ByTag_sha(tag_sha string)(*ItemItemGitTagsWithTag_shaItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if tag_sha != "" { + urlTplParams["tag_sha"] = tag_sha + } + return NewItemItemGitTagsWithTag_shaItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemGitTagsRequestBuilderInternal instantiates a new ItemItemGitTagsRequestBuilder and sets the default values. +func NewItemItemGitTagsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitTagsRequestBuilder) { + m := &ItemItemGitTagsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/tags", pathParameters), + } + return m +} +// NewItemItemGitTagsRequestBuilder instantiates a new ItemItemGitTagsRequestBuilder and sets the default values. +func NewItemItemGitTagsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitTagsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitTagsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then [create](https://docs.github.com/rest/git/refs#create-a-reference) the `refs/tags/[tag]` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/rest/git/refs#create-a-reference) the tag reference - this call would be unnecessary.**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a GitTagable when successful +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/git/tags#create-a-tag-object +func (m *ItemItemGitTagsRequestBuilder) Post(ctx context.Context, body ItemItemGitTagsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitTagable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGitTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitTagable), nil +} +// ToPostRequestInformation note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then [create](https://docs.github.com/rest/git/refs#create-a-reference) the `refs/tags/[tag]` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/rest/git/refs#create-a-reference) the tag reference - this call would be unnecessary.**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a *RequestInformation when successful +func (m *ItemItemGitTagsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemGitTagsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemGitTagsRequestBuilder when successful +func (m *ItemItemGitTagsRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitTagsRequestBuilder) { + return NewItemItemGitTagsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_tags_with_tag_sha_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_tags_with_tag_sha_item_request_builder.go new file mode 100644 index 000000000..f66097e23 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_tags_with_tag_sha_item_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemGitTagsWithTag_shaItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\tags\{tag_sha} +type ItemItemGitTagsWithTag_shaItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemGitTagsWithTag_shaItemRequestBuilderInternal instantiates a new ItemItemGitTagsWithTag_shaItemRequestBuilder and sets the default values. +func NewItemItemGitTagsWithTag_shaItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitTagsWithTag_shaItemRequestBuilder) { + m := &ItemItemGitTagsWithTag_shaItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/tags/{tag_sha}", pathParameters), + } + return m +} +// NewItemItemGitTagsWithTag_shaItemRequestBuilder instantiates a new ItemItemGitTagsWithTag_shaItemRequestBuilder and sets the default values. +func NewItemItemGitTagsWithTag_shaItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitTagsWithTag_shaItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitTagsWithTag_shaItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a GitTagable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/git/tags#get-a-tag +func (m *ItemItemGitTagsWithTag_shaItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitTagable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGitTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitTagable), nil +} +// ToGetRequestInformation **Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a *RequestInformation when successful +func (m *ItemItemGitTagsWithTag_shaItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemGitTagsWithTag_shaItemRequestBuilder when successful +func (m *ItemItemGitTagsWithTag_shaItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitTagsWithTag_shaItemRequestBuilder) { + return NewItemItemGitTagsWithTag_shaItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_trees_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_trees_post_request_body.go new file mode 100644 index 000000000..5a10e2180 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_trees_post_request_body.go @@ -0,0 +1,121 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemGitTreesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The SHA1 of an existing Git tree object which will be used as the base for the new tree. If provided, a new Git tree object will be created from entries in the Git tree object pointed to by `base_tree` and entries defined in the `tree` parameter. Entries defined in the `tree` parameter will overwrite items from `base_tree` with the same `path`. If you're creating new changes on a branch, then normally you'd set `base_tree` to the SHA1 of the Git tree object of the current latest commit on the branch you're working on.If not provided, GitHub will create a new Git tree object from only the entries defined in the `tree` parameter. If you create a new commit pointing to such a tree, then all files which were a part of the parent commit's tree and were not defined in the `tree` parameter will be listed as deleted by the new commit. + base_tree *string + // Objects (of `path`, `mode`, `type`, and `sha`) specifying a tree structure. + tree []ItemItemGitTreesPostRequestBody_treeable +} +// NewItemItemGitTreesPostRequestBody instantiates a new ItemItemGitTreesPostRequestBody and sets the default values. +func NewItemItemGitTreesPostRequestBody()(*ItemItemGitTreesPostRequestBody) { + m := &ItemItemGitTreesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitTreesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitTreesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitTreesPostRequestBody(), 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 *ItemItemGitTreesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBaseTree gets the base_tree property value. The SHA1 of an existing Git tree object which will be used as the base for the new tree. If provided, a new Git tree object will be created from entries in the Git tree object pointed to by `base_tree` and entries defined in the `tree` parameter. Entries defined in the `tree` parameter will overwrite items from `base_tree` with the same `path`. If you're creating new changes on a branch, then normally you'd set `base_tree` to the SHA1 of the Git tree object of the current latest commit on the branch you're working on.If not provided, GitHub will create a new Git tree object from only the entries defined in the `tree` parameter. If you create a new commit pointing to such a tree, then all files which were a part of the parent commit's tree and were not defined in the `tree` parameter will be listed as deleted by the new commit. +// returns a *string when successful +func (m *ItemItemGitTreesPostRequestBody) GetBaseTree()(*string) { + return m.base_tree +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGitTreesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["base_tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBaseTree(val) + } + return nil + } + res["tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemGitTreesPostRequestBody_treeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemGitTreesPostRequestBody_treeable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemGitTreesPostRequestBody_treeable) + } + } + m.SetTree(res) + } + return nil + } + return res +} +// GetTree gets the tree property value. Objects (of `path`, `mode`, `type`, and `sha`) specifying a tree structure. +// returns a []ItemItemGitTreesPostRequestBody_treeable when successful +func (m *ItemItemGitTreesPostRequestBody) GetTree()([]ItemItemGitTreesPostRequestBody_treeable) { + return m.tree +} +// Serialize serializes information the current object +func (m *ItemItemGitTreesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("base_tree", m.GetBaseTree()) + if err != nil { + return err + } + } + if m.GetTree() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTree())) + for i, v := range m.GetTree() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("tree", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemGitTreesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBaseTree sets the base_tree property value. The SHA1 of an existing Git tree object which will be used as the base for the new tree. If provided, a new Git tree object will be created from entries in the Git tree object pointed to by `base_tree` and entries defined in the `tree` parameter. Entries defined in the `tree` parameter will overwrite items from `base_tree` with the same `path`. If you're creating new changes on a branch, then normally you'd set `base_tree` to the SHA1 of the Git tree object of the current latest commit on the branch you're working on.If not provided, GitHub will create a new Git tree object from only the entries defined in the `tree` parameter. If you create a new commit pointing to such a tree, then all files which were a part of the parent commit's tree and were not defined in the `tree` parameter will be listed as deleted by the new commit. +func (m *ItemItemGitTreesPostRequestBody) SetBaseTree(value *string)() { + m.base_tree = value +} +// SetTree sets the tree property value. Objects (of `path`, `mode`, `type`, and `sha`) specifying a tree structure. +func (m *ItemItemGitTreesPostRequestBody) SetTree(value []ItemItemGitTreesPostRequestBody_treeable)() { + m.tree = value +} +type ItemItemGitTreesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBaseTree()(*string) + GetTree()([]ItemItemGitTreesPostRequestBody_treeable) + SetBaseTree(value *string)() + SetTree(value []ItemItemGitTreesPostRequestBody_treeable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_trees_post_request_body_tree.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_trees_post_request_body_tree.go new file mode 100644 index 000000000..80f0fba73 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_trees_post_request_body_tree.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemGitTreesPostRequestBody_tree struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The content you want this file to have. GitHub will write this blob out and use that SHA for this entry. Use either this, or `tree.sha`. **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error. + content *string + // The file referenced in the tree. + path *string + // The SHA1 checksum ID of the object in the tree. Also called `tree.sha`. If the value is `null` then the file will be deleted. **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error. + sha *string +} +// NewItemItemGitTreesPostRequestBody_tree instantiates a new ItemItemGitTreesPostRequestBody_tree and sets the default values. +func NewItemItemGitTreesPostRequestBody_tree()(*ItemItemGitTreesPostRequestBody_tree) { + m := &ItemItemGitTreesPostRequestBody_tree{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitTreesPostRequestBody_treeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitTreesPostRequestBody_treeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitTreesPostRequestBody_tree(), 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 *ItemItemGitTreesPostRequestBody_tree) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContent gets the content property value. The content you want this file to have. GitHub will write this blob out and use that SHA for this entry. Use either this, or `tree.sha`. **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error. +// returns a *string when successful +func (m *ItemItemGitTreesPostRequestBody_tree) GetContent()(*string) { + return m.content +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGitTreesPostRequestBody_tree) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContent(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["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetPath gets the path property value. The file referenced in the tree. +// returns a *string when successful +func (m *ItemItemGitTreesPostRequestBody_tree) GetPath()(*string) { + return m.path +} +// GetSha gets the sha property value. The SHA1 checksum ID of the object in the tree. Also called `tree.sha`. If the value is `null` then the file will be deleted. **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error. +// returns a *string when successful +func (m *ItemItemGitTreesPostRequestBody_tree) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *ItemItemGitTreesPostRequestBody_tree) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content", m.GetContent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *ItemItemGitTreesPostRequestBody_tree) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContent sets the content property value. The content you want this file to have. GitHub will write this blob out and use that SHA for this entry. Use either this, or `tree.sha`. **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error. +func (m *ItemItemGitTreesPostRequestBody_tree) SetContent(value *string)() { + m.content = value +} +// SetPath sets the path property value. The file referenced in the tree. +func (m *ItemItemGitTreesPostRequestBody_tree) SetPath(value *string)() { + m.path = value +} +// SetSha sets the sha property value. The SHA1 checksum ID of the object in the tree. Also called `tree.sha`. If the value is `null` then the file will be deleted. **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error. +func (m *ItemItemGitTreesPostRequestBody_tree) SetSha(value *string)() { + m.sha = value +} +type ItemItemGitTreesPostRequestBody_treeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContent()(*string) + GetPath()(*string) + GetSha()(*string) + SetContent(value *string)() + SetPath(value *string)() + SetSha(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_trees_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_trees_request_builder.go new file mode 100644 index 000000000..5fbfdf891 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_trees_request_builder.go @@ -0,0 +1,83 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemGitTreesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\trees +type ItemItemGitTreesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByTree_sha gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.git.trees.item collection +// returns a *ItemItemGitTreesWithTree_shaItemRequestBuilder when successful +func (m *ItemItemGitTreesRequestBuilder) ByTree_sha(tree_sha string)(*ItemItemGitTreesWithTree_shaItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if tree_sha != "" { + urlTplParams["tree_sha"] = tree_sha + } + return NewItemItemGitTreesWithTree_shaItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemGitTreesRequestBuilderInternal instantiates a new ItemItemGitTreesRequestBuilder and sets the default values. +func NewItemItemGitTreesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitTreesRequestBuilder) { + m := &ItemItemGitTreesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/trees", pathParameters), + } + return m +} +// NewItemItemGitTreesRequestBuilder instantiates a new ItemItemGitTreesRequestBuilder and sets the default values. +func NewItemItemGitTreesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitTreesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitTreesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post the tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure.If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://docs.github.com/rest/git/commits#create-a-commit)" and "[Update a reference](https://docs.github.com/rest/git/refs#update-a-reference)."Returns an error if you try to delete a file that does not exist. +// returns a GitTreeable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/git/trees#create-a-tree +func (m *ItemItemGitTreesRequestBuilder) Post(ctx context.Context, body ItemItemGitTreesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitTreeable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGitTreeFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitTreeable), nil +} +// ToPostRequestInformation the tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure.If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://docs.github.com/rest/git/commits#create-a-commit)" and "[Update a reference](https://docs.github.com/rest/git/refs#update-a-reference)."Returns an error if you try to delete a file that does not exist. +// returns a *RequestInformation when successful +func (m *ItemItemGitTreesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemGitTreesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemGitTreesRequestBuilder when successful +func (m *ItemItemGitTreesRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitTreesRequestBuilder) { + return NewItemItemGitTreesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_trees_with_tree_sha_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_trees_with_tree_sha_item_request_builder.go new file mode 100644 index 000000000..1766f404a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_git_trees_with_tree_sha_item_request_builder.go @@ -0,0 +1,70 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemGitTreesWithTree_shaItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\trees\{tree_sha} +type ItemItemGitTreesWithTree_shaItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemGitTreesWithTree_shaItemRequestBuilderGetQueryParameters returns a single tree using the SHA1 value or ref name for that tree.If `truncated` is `true` in the response then the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time.**Note**: The limit for the `tree` array is 100,000 entries with a maximum size of 7 MB when using the `recursive` parameter. +type ItemItemGitTreesWithTree_shaItemRequestBuilderGetQueryParameters struct { + // Setting this parameter to any value returns the objects or subtrees referenced by the tree specified in `:tree_sha`. For example, setting `recursive` to any of the following will enable returning objects or subtrees: `0`, `1`, `"true"`, and `"false"`. Omit this parameter to prevent recursively returning objects or subtrees. + Recursive *string `uriparametername:"recursive"` +} +// NewItemItemGitTreesWithTree_shaItemRequestBuilderInternal instantiates a new ItemItemGitTreesWithTree_shaItemRequestBuilder and sets the default values. +func NewItemItemGitTreesWithTree_shaItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitTreesWithTree_shaItemRequestBuilder) { + m := &ItemItemGitTreesWithTree_shaItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/trees/{tree_sha}{?recursive*}", pathParameters), + } + return m +} +// NewItemItemGitTreesWithTree_shaItemRequestBuilder instantiates a new ItemItemGitTreesWithTree_shaItemRequestBuilder and sets the default values. +func NewItemItemGitTreesWithTree_shaItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitTreesWithTree_shaItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitTreesWithTree_shaItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns a single tree using the SHA1 value or ref name for that tree.If `truncated` is `true` in the response then the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time.**Note**: The limit for the `tree` array is 100,000 entries with a maximum size of 7 MB when using the `recursive` parameter. +// returns a GitTreeable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/git/trees#get-a-tree +func (m *ItemItemGitTreesWithTree_shaItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemGitTreesWithTree_shaItemRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitTreeable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGitTreeFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GitTreeable), nil +} +// ToGetRequestInformation returns a single tree using the SHA1 value or ref name for that tree.If `truncated` is `true` in the response then the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time.**Note**: The limit for the `tree` array is 100,000 entries with a maximum size of 7 MB when using the `recursive` parameter. +// returns a *RequestInformation when successful +func (m *ItemItemGitTreesWithTree_shaItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemGitTreesWithTree_shaItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemGitTreesWithTree_shaItemRequestBuilder when successful +func (m *ItemItemGitTreesWithTree_shaItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitTreesWithTree_shaItemRequestBuilder) { + return NewItemItemGitTreesWithTree_shaItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_config_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_config_patch_request_body.go new file mode 100644 index 000000000..eb633e332 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_config_patch_request_body.go @@ -0,0 +1,149 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemHooksItemConfigPatchRequestBody struct { + // The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // The insecure_ssl property + insecure_ssl i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). + secret *string + // The URL to which the payloads will be delivered. + url *string +} +// NewItemItemHooksItemConfigPatchRequestBody instantiates a new ItemItemHooksItemConfigPatchRequestBody and sets the default values. +func NewItemItemHooksItemConfigPatchRequestBody()(*ItemItemHooksItemConfigPatchRequestBody) { + m := &ItemItemHooksItemConfigPatchRequestBody{ + } + return m +} +// CreateItemItemHooksItemConfigPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemHooksItemConfigPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemHooksItemConfigPatchRequestBody(), nil +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +// returns a *string when successful +func (m *ItemItemHooksItemConfigPatchRequestBody) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemHooksItemConfigPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWebhookConfigInsecureSslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a WebhookConfigInsecureSslable when successful +func (m *ItemItemHooksItemConfigPatchRequestBody) GetInsecureSsl()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable) { + return m.insecure_ssl +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +// returns a *string when successful +func (m *ItemItemHooksItemConfigPatchRequestBody) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +// returns a *string when successful +func (m *ItemItemHooksItemConfigPatchRequestBody) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ItemItemHooksItemConfigPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + return nil +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *ItemItemHooksItemConfigPatchRequestBody) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *ItemItemHooksItemConfigPatchRequestBody) SetInsecureSsl(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)() { + m.insecure_ssl = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +func (m *ItemItemHooksItemConfigPatchRequestBody) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *ItemItemHooksItemConfigPatchRequestBody) SetUrl(value *string)() { + m.url = value +} +type ItemItemHooksItemConfigPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable) + GetSecret()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_config_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_config_request_builder.go new file mode 100644 index 000000000..1fde5d33d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_config_request_builder.go @@ -0,0 +1,88 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemHooksItemConfigRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\hooks\{hook_id}\config +type ItemItemHooksItemConfigRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemHooksItemConfigRequestBuilderInternal instantiates a new ItemItemHooksItemConfigRequestBuilder and sets the default values. +func NewItemItemHooksItemConfigRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemConfigRequestBuilder) { + m := &ItemItemHooksItemConfigRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/hooks/{hook_id}/config", pathParameters), + } + return m +} +// NewItemItemHooksItemConfigRequestBuilder instantiates a new ItemItemHooksItemConfigRequestBuilder and sets the default values. +func NewItemItemHooksItemConfigRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemConfigRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemHooksItemConfigRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the webhook configuration for a repository. To get more information about the webhook, including the `active` state and `events`, use "[Get a repository webhook](/rest/webhooks/repos#get-a-repository-webhook)."OAuth app tokens and personal access tokens (classic) need the `read:repo_hook` or `repo` scope to use this endpoint. +// returns a WebhookConfigable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/webhooks#get-a-webhook-configuration-for-a-repository +func (m *ItemItemHooksItemConfigRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWebhookConfigFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable), nil +} +// Patch updates the webhook configuration for a repository. To update more information about the webhook, including the `active` state and `events`, use "[Update a repository webhook](/rest/webhooks/repos#update-a-repository-webhook)."OAuth app tokens and personal access tokens (classic) need the `write:repo_hook` or `repo` scope to use this endpoint. +// returns a WebhookConfigable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/webhooks#update-a-webhook-configuration-for-a-repository +func (m *ItemItemHooksItemConfigRequestBuilder) Patch(ctx context.Context, body ItemItemHooksItemConfigPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWebhookConfigFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable), nil +} +// ToGetRequestInformation returns the webhook configuration for a repository. To get more information about the webhook, including the `active` state and `events`, use "[Get a repository webhook](/rest/webhooks/repos#get-a-repository-webhook)."OAuth app tokens and personal access tokens (classic) need the `read:repo_hook` or `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemHooksItemConfigRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates the webhook configuration for a repository. To update more information about the webhook, including the `active` state and `events`, use "[Update a repository webhook](/rest/webhooks/repos#update-a-repository-webhook)."OAuth app tokens and personal access tokens (classic) need the `write:repo_hook` or `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemHooksItemConfigRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemHooksItemConfigPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemHooksItemConfigRequestBuilder when successful +func (m *ItemItemHooksItemConfigRequestBuilder) WithUrl(rawUrl string)(*ItemItemHooksItemConfigRequestBuilder) { + return NewItemItemHooksItemConfigRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_deliveries_item_attempts_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_deliveries_item_attempts_post_response.go new file mode 100644 index 000000000..563795782 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_deliveries_item_attempts_post_response.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemHooksItemDeliveriesItemAttemptsPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemHooksItemDeliveriesItemAttemptsPostResponse instantiates a new ItemItemHooksItemDeliveriesItemAttemptsPostResponse and sets the default values. +func NewItemItemHooksItemDeliveriesItemAttemptsPostResponse()(*ItemItemHooksItemDeliveriesItemAttemptsPostResponse) { + m := &ItemItemHooksItemDeliveriesItemAttemptsPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemHooksItemDeliveriesItemAttemptsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemHooksItemDeliveriesItemAttemptsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemHooksItemDeliveriesItemAttemptsPostResponse(), 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 *ItemItemHooksItemDeliveriesItemAttemptsPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemHooksItemDeliveriesItemAttemptsPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemHooksItemDeliveriesItemAttemptsPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemHooksItemDeliveriesItemAttemptsPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemHooksItemDeliveriesItemAttemptsPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_deliveries_item_attempts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_deliveries_item_attempts_request_builder.go new file mode 100644 index 000000000..1948ad1c5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_deliveries_item_attempts_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\hooks\{hook_id}\deliveries\{delivery_id}\attempts +type ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemHooksItemDeliveriesItemAttemptsRequestBuilderInternal instantiates a new ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder and sets the default values. +func NewItemItemHooksItemDeliveriesItemAttemptsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder) { + m := &ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/hooks/{hook_id}/deliveries/{delivery_id}/attempts", pathParameters), + } + return m +} +// NewItemItemHooksItemDeliveriesItemAttemptsRequestBuilder instantiates a new ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder and sets the default values. +func NewItemItemHooksItemDeliveriesItemAttemptsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemHooksItemDeliveriesItemAttemptsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post redeliver a webhook delivery for a webhook configured in a repository. +// returns a ItemItemHooksItemDeliveriesItemAttemptsPostResponseable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/webhooks#redeliver-a-delivery-for-a-repository-webhook +func (m *ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemHooksItemDeliveriesItemAttemptsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemHooksItemDeliveriesItemAttemptsPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemHooksItemDeliveriesItemAttemptsPostResponseable), nil +} +// ToPostRequestInformation redeliver a webhook delivery for a webhook configured in a repository. +// returns a *RequestInformation when successful +func (m *ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder when successful +func (m *ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder) WithUrl(rawUrl string)(*ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder) { + return NewItemItemHooksItemDeliveriesItemAttemptsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_deliveries_item_attempts_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_deliveries_item_attempts_response.go new file mode 100644 index 000000000..e663029c4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_deliveries_item_attempts_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemHooksItemDeliveriesItemAttemptsResponse +// Deprecated: This class is obsolete. Use attemptsPostResponse instead. +type ItemItemHooksItemDeliveriesItemAttemptsResponse struct { + ItemItemHooksItemDeliveriesItemAttemptsPostResponse +} +// NewItemItemHooksItemDeliveriesItemAttemptsResponse instantiates a new ItemItemHooksItemDeliveriesItemAttemptsResponse and sets the default values. +func NewItemItemHooksItemDeliveriesItemAttemptsResponse()(*ItemItemHooksItemDeliveriesItemAttemptsResponse) { + m := &ItemItemHooksItemDeliveriesItemAttemptsResponse{ + ItemItemHooksItemDeliveriesItemAttemptsPostResponse: *NewItemItemHooksItemDeliveriesItemAttemptsPostResponse(), + } + return m +} +// CreateItemItemHooksItemDeliveriesItemAttemptsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemHooksItemDeliveriesItemAttemptsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemHooksItemDeliveriesItemAttemptsResponse(), nil +} +// ItemItemHooksItemDeliveriesItemAttemptsResponseable +// Deprecated: This class is obsolete. Use attemptsPostResponse instead. +type ItemItemHooksItemDeliveriesItemAttemptsResponseable interface { + ItemItemHooksItemDeliveriesItemAttemptsPostResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_deliveries_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_deliveries_request_builder.go new file mode 100644 index 000000000..fda7a2526 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_deliveries_request_builder.go @@ -0,0 +1,85 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemHooksItemDeliveriesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\hooks\{hook_id}\deliveries +type ItemItemHooksItemDeliveriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemHooksItemDeliveriesRequestBuilderGetQueryParameters returns a list of webhook deliveries for a webhook configured in a repository. +type ItemItemHooksItemDeliveriesRequestBuilderGetQueryParameters 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"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + Redelivery *bool `uriparametername:"redelivery"` +} +// ByDelivery_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.hooks.item.deliveries.item collection +// returns a *ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder when successful +func (m *ItemItemHooksItemDeliveriesRequestBuilder) ByDelivery_id(delivery_id int32)(*ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["delivery_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(delivery_id), 10) + return NewItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemHooksItemDeliveriesRequestBuilderInternal instantiates a new ItemItemHooksItemDeliveriesRequestBuilder and sets the default values. +func NewItemItemHooksItemDeliveriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemDeliveriesRequestBuilder) { + m := &ItemItemHooksItemDeliveriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/hooks/{hook_id}/deliveries{?cursor*,per_page*,redelivery*}", pathParameters), + } + return m +} +// NewItemItemHooksItemDeliveriesRequestBuilder instantiates a new ItemItemHooksItemDeliveriesRequestBuilder and sets the default values. +func NewItemItemHooksItemDeliveriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemDeliveriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemHooksItemDeliveriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns a list of webhook deliveries for a webhook configured in a repository. +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/webhooks#list-deliveries-for-a-repository-webhook +func (m *ItemItemHooksItemDeliveriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemHooksItemDeliveriesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.HookDeliveryItemable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateHookDeliveryItemFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.HookDeliveryItemable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.HookDeliveryItemable) + } + } + return val, nil +} +// ToGetRequestInformation returns a list of webhook deliveries for a webhook configured in a repository. +// returns a *RequestInformation when successful +func (m *ItemItemHooksItemDeliveriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemHooksItemDeliveriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemHooksItemDeliveriesRequestBuilder when successful +func (m *ItemItemHooksItemDeliveriesRequestBuilder) WithUrl(rawUrl string)(*ItemItemHooksItemDeliveriesRequestBuilder) { + return NewItemItemHooksItemDeliveriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_deliveries_with_delivery_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_deliveries_with_delivery_item_request_builder.go new file mode 100644 index 000000000..702ab2000 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_deliveries_with_delivery_item_request_builder.go @@ -0,0 +1,68 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\hooks\{hook_id}\deliveries\{delivery_id} +type ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Attempts the attempts property +// returns a *ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder when successful +func (m *ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) Attempts()(*ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder) { + return NewItemItemHooksItemDeliveriesItemAttemptsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilderInternal instantiates a new ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder and sets the default values. +func NewItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) { + m := &ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/hooks/{hook_id}/deliveries/{delivery_id}", pathParameters), + } + return m +} +// NewItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder instantiates a new ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder and sets the default values. +func NewItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns a delivery for a webhook configured in a repository. +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/webhooks#get-a-delivery-for-a-repository-webhook +func (m *ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.HookDeliveryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateHookDeliveryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.HookDeliveryable), nil +} +// ToGetRequestInformation returns a delivery for a webhook configured in a repository. +// returns a *RequestInformation when successful +func (m *ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder when successful +func (m *ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) { + return NewItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_pings_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_pings_request_builder.go new file mode 100644 index 000000000..60c74bc34 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_pings_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemHooksItemPingsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\hooks\{hook_id}\pings +type ItemItemHooksItemPingsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemHooksItemPingsRequestBuilderInternal instantiates a new ItemItemHooksItemPingsRequestBuilder and sets the default values. +func NewItemItemHooksItemPingsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemPingsRequestBuilder) { + m := &ItemItemHooksItemPingsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/hooks/{hook_id}/pings", pathParameters), + } + return m +} +// NewItemItemHooksItemPingsRequestBuilder instantiates a new ItemItemHooksItemPingsRequestBuilder and sets the default values. +func NewItemItemHooksItemPingsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemPingsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemHooksItemPingsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post this will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/webhooks#ping-a-repository-webhook +func (m *ItemItemHooksItemPingsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation this will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. +// returns a *RequestInformation when successful +func (m *ItemItemHooksItemPingsRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemHooksItemPingsRequestBuilder when successful +func (m *ItemItemHooksItemPingsRequestBuilder) WithUrl(rawUrl string)(*ItemItemHooksItemPingsRequestBuilder) { + return NewItemItemHooksItemPingsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_tests_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_tests_request_builder.go new file mode 100644 index 000000000..5fd89b04b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_tests_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemHooksItemTestsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\hooks\{hook_id}\tests +type ItemItemHooksItemTestsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemHooksItemTestsRequestBuilderInternal instantiates a new ItemItemHooksItemTestsRequestBuilder and sets the default values. +func NewItemItemHooksItemTestsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemTestsRequestBuilder) { + m := &ItemItemHooksItemTestsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/hooks/{hook_id}/tests", pathParameters), + } + return m +} +// NewItemItemHooksItemTestsRequestBuilder instantiates a new ItemItemHooksItemTestsRequestBuilder and sets the default values. +func NewItemItemHooksItemTestsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemTestsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemHooksItemTestsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post this will trigger the hook with the latest push to the current repository if the hook is subscribed to `push` events. If the hook is not subscribed to `push` events, the server will respond with 204 but no test POST will be generated.**Note**: Previously `/repos/:owner/:repo/hooks/:hook_id/test` +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/webhooks#test-the-push-repository-webhook +func (m *ItemItemHooksItemTestsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation this will trigger the hook with the latest push to the current repository if the hook is subscribed to `push` events. If the hook is not subscribed to `push` events, the server will respond with 204 but no test POST will be generated.**Note**: Previously `/repos/:owner/:repo/hooks/:hook_id/test` +// returns a *RequestInformation when successful +func (m *ItemItemHooksItemTestsRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemHooksItemTestsRequestBuilder when successful +func (m *ItemItemHooksItemTestsRequestBuilder) WithUrl(rawUrl string)(*ItemItemHooksItemTestsRequestBuilder) { + return NewItemItemHooksItemTestsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_with_hook_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_with_hook_patch_request_body.go new file mode 100644 index 000000000..35a1e2eb2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_with_hook_patch_request_body.go @@ -0,0 +1,215 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemHooksItemWithHook_PatchRequestBody struct { + // Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + active *bool + // Determines a list of events to be added to the list of events that the Hook triggers for. + add_events []string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Configuration object of the webhook + config i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable + // Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. This replaces the entire array of events. + events []string + // Determines a list of events to be removed from the list of events that the Hook triggers for. + remove_events []string +} +// NewItemItemHooksItemWithHook_PatchRequestBody instantiates a new ItemItemHooksItemWithHook_PatchRequestBody and sets the default values. +func NewItemItemHooksItemWithHook_PatchRequestBody()(*ItemItemHooksItemWithHook_PatchRequestBody) { + m := &ItemItemHooksItemWithHook_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemHooksItemWithHook_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemHooksItemWithHook_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemHooksItemWithHook_PatchRequestBody(), nil +} +// GetActive gets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +// returns a *bool when successful +func (m *ItemItemHooksItemWithHook_PatchRequestBody) GetActive()(*bool) { + return m.active +} +// GetAddEvents gets the add_events property value. Determines a list of events to be added to the list of events that the Hook triggers for. +// returns a []string when successful +func (m *ItemItemHooksItemWithHook_PatchRequestBody) GetAddEvents()([]string) { + return m.add_events +} +// 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 *ItemItemHooksItemWithHook_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfig gets the config property value. Configuration object of the webhook +// returns a WebhookConfigable when successful +func (m *ItemItemHooksItemWithHook_PatchRequestBody) GetConfig()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable) { + return m.config +} +// GetEvents gets the events property value. Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. This replaces the entire array of events. +// returns a []string when successful +func (m *ItemItemHooksItemWithHook_PatchRequestBody) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemHooksItemWithHook_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["add_events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetAddEvents(res) + } + return nil + } + res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWebhookConfigFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfig(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable)) + } + return nil + } + res["events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetEvents(res) + } + return nil + } + res["remove_events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRemoveEvents(res) + } + return nil + } + return res +} +// GetRemoveEvents gets the remove_events property value. Determines a list of events to be removed from the list of events that the Hook triggers for. +// returns a []string when successful +func (m *ItemItemHooksItemWithHook_PatchRequestBody) GetRemoveEvents()([]string) { + return m.remove_events +} +// Serialize serializes information the current object +func (m *ItemItemHooksItemWithHook_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + if m.GetAddEvents() != nil { + err := writer.WriteCollectionOfStringValues("add_events", m.GetAddEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("config", m.GetConfig()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + if m.GetRemoveEvents() != nil { + err := writer.WriteCollectionOfStringValues("remove_events", m.GetRemoveEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActive sets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +func (m *ItemItemHooksItemWithHook_PatchRequestBody) SetActive(value *bool)() { + m.active = value +} +// SetAddEvents sets the add_events property value. Determines a list of events to be added to the list of events that the Hook triggers for. +func (m *ItemItemHooksItemWithHook_PatchRequestBody) SetAddEvents(value []string)() { + m.add_events = value +} +// 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 *ItemItemHooksItemWithHook_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfig sets the config property value. Configuration object of the webhook +func (m *ItemItemHooksItemWithHook_PatchRequestBody) SetConfig(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable)() { + m.config = value +} +// SetEvents sets the events property value. Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. This replaces the entire array of events. +func (m *ItemItemHooksItemWithHook_PatchRequestBody) SetEvents(value []string)() { + m.events = value +} +// SetRemoveEvents sets the remove_events property value. Determines a list of events to be removed from the list of events that the Hook triggers for. +func (m *ItemItemHooksItemWithHook_PatchRequestBody) SetRemoveEvents(value []string)() { + m.remove_events = value +} +type ItemItemHooksItemWithHook_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetAddEvents()([]string) + GetConfig()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable) + GetEvents()([]string) + GetRemoveEvents()([]string) + SetActive(value *bool)() + SetAddEvents(value []string)() + SetConfig(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigable)() + SetEvents(value []string)() + SetRemoveEvents(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_with_hook_patch_request_body_config.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_with_hook_patch_request_body_config.go new file mode 100644 index 000000000..d1e9ba3fa --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_item_with_hook_patch_request_body_config.go @@ -0,0 +1,219 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemHooksItemWithHook_PatchRequestBody_config key/value pairs to provide settings for this webhook. +type ItemItemHooksItemWithHook_PatchRequestBody_config struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The address property + address *string + // The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // The insecure_ssl property + insecure_ssl i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable + // The room property + room *string + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). + secret *string + // The URL to which the payloads will be delivered. + url *string +} +// NewItemItemHooksItemWithHook_PatchRequestBody_config instantiates a new ItemItemHooksItemWithHook_PatchRequestBody_config and sets the default values. +func NewItemItemHooksItemWithHook_PatchRequestBody_config()(*ItemItemHooksItemWithHook_PatchRequestBody_config) { + m := &ItemItemHooksItemWithHook_PatchRequestBody_config{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemHooksItemWithHook_PatchRequestBody_configFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemHooksItemWithHook_PatchRequestBody_configFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemHooksItemWithHook_PatchRequestBody_config(), 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. +func (m *ItemItemHooksItemWithHook_PatchRequestBody_config) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAddress gets the address property value. The address property +func (m *ItemItemHooksItemWithHook_PatchRequestBody_config) GetAddress()(*string) { + return m.address +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *ItemItemHooksItemWithHook_PatchRequestBody_config) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +func (m *ItemItemHooksItemWithHook_PatchRequestBody_config) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["address"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAddress(val) + } + return nil + } + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWebhookConfigInsecureSslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)) + } + return nil + } + res["room"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRoom(val) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +func (m *ItemItemHooksItemWithHook_PatchRequestBody_config) GetInsecureSsl()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable) { + return m.insecure_ssl +} +// GetRoom gets the room property value. The room property +func (m *ItemItemHooksItemWithHook_PatchRequestBody_config) GetRoom()(*string) { + return m.room +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +func (m *ItemItemHooksItemWithHook_PatchRequestBody_config) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +func (m *ItemItemHooksItemWithHook_PatchRequestBody_config) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ItemItemHooksItemWithHook_PatchRequestBody_config) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("address", m.GetAddress()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("room", m.GetRoom()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ItemItemHooksItemWithHook_PatchRequestBody_config) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAddress sets the address property value. The address property +func (m *ItemItemHooksItemWithHook_PatchRequestBody_config) SetAddress(value *string)() { + m.address = value +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *ItemItemHooksItemWithHook_PatchRequestBody_config) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *ItemItemHooksItemWithHook_PatchRequestBody_config) SetInsecureSsl(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)() { + m.insecure_ssl = value +} +// SetRoom sets the room property value. The room property +func (m *ItemItemHooksItemWithHook_PatchRequestBody_config) SetRoom(value *string)() { + m.room = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +func (m *ItemItemHooksItemWithHook_PatchRequestBody_config) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *ItemItemHooksItemWithHook_PatchRequestBody_config) SetUrl(value *string)() { + m.url = value +} +// ItemItemHooksItemWithHook_PatchRequestBody_configable +type ItemItemHooksItemWithHook_PatchRequestBody_configable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAddress()(*string) + GetContentType()(*string) + GetInsecureSsl()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable) + GetRoom()(*string) + GetSecret()(*string) + GetUrl()(*string) + SetAddress(value *string)() + SetContentType(value *string)() + SetInsecureSsl(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)() + SetRoom(value *string)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_post_request_body.go new file mode 100644 index 000000000..b367ba6e0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_post_request_body.go @@ -0,0 +1,154 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemHooksPostRequestBody struct { + // Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + active *bool + // Key/value pairs to provide settings for this webhook. + config ItemItemHooksPostRequestBody_configable + // Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. + events []string + // Use `web` to create a webhook. Default: `web`. This parameter only accepts the value `web`. + name *string +} +// NewItemItemHooksPostRequestBody instantiates a new ItemItemHooksPostRequestBody and sets the default values. +func NewItemItemHooksPostRequestBody()(*ItemItemHooksPostRequestBody) { + m := &ItemItemHooksPostRequestBody{ + } + return m +} +// CreateItemItemHooksPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemHooksPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemHooksPostRequestBody(), nil +} +// GetActive gets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +// returns a *bool when successful +func (m *ItemItemHooksPostRequestBody) GetActive()(*bool) { + return m.active +} +// GetConfig gets the config property value. Key/value pairs to provide settings for this webhook. +// returns a ItemItemHooksPostRequestBody_configable when successful +func (m *ItemItemHooksPostRequestBody) GetConfig()(ItemItemHooksPostRequestBody_configable) { + return m.config +} +// GetEvents gets the events property value. Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. +// returns a []string when successful +func (m *ItemItemHooksPostRequestBody) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemHooksPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemHooksPostRequestBody_configFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfig(val.(ItemItemHooksPostRequestBody_configable)) + } + return nil + } + res["events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetEvents(res) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. Use `web` to create a webhook. Default: `web`. This parameter only accepts the value `web`. +// returns a *string when successful +func (m *ItemItemHooksPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemHooksPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("config", m.GetConfig()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + return nil +} +// SetActive sets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +func (m *ItemItemHooksPostRequestBody) SetActive(value *bool)() { + m.active = value +} +// SetConfig sets the config property value. Key/value pairs to provide settings for this webhook. +func (m *ItemItemHooksPostRequestBody) SetConfig(value ItemItemHooksPostRequestBody_configable)() { + m.config = value +} +// SetEvents sets the events property value. Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. +func (m *ItemItemHooksPostRequestBody) SetEvents(value []string)() { + m.events = value +} +// SetName sets the name property value. Use `web` to create a webhook. Default: `web`. This parameter only accepts the value `web`. +func (m *ItemItemHooksPostRequestBody) SetName(value *string)() { + m.name = value +} +type ItemItemHooksPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetConfig()(ItemItemHooksPostRequestBody_configable) + GetEvents()([]string) + GetName()(*string) + SetActive(value *bool)() + SetConfig(value ItemItemHooksPostRequestBody_configable)() + SetEvents(value []string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_post_request_body_config.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_post_request_body_config.go new file mode 100644 index 000000000..44f6f4e90 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_post_request_body_config.go @@ -0,0 +1,169 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemHooksPostRequestBody_config key/value pairs to provide settings for this webhook. +type ItemItemHooksPostRequestBody_config struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // The insecure_ssl property + insecure_ssl i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). + secret *string + // The URL to which the payloads will be delivered. + url *string +} +// NewItemItemHooksPostRequestBody_config instantiates a new ItemItemHooksPostRequestBody_config and sets the default values. +func NewItemItemHooksPostRequestBody_config()(*ItemItemHooksPostRequestBody_config) { + m := &ItemItemHooksPostRequestBody_config{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemHooksPostRequestBody_configFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemHooksPostRequestBody_configFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemHooksPostRequestBody_config(), 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 *ItemItemHooksPostRequestBody_config) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +// returns a *string when successful +func (m *ItemItemHooksPostRequestBody_config) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemHooksPostRequestBody_config) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateWebhookConfigInsecureSslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a WebhookConfigInsecureSslable when successful +func (m *ItemItemHooksPostRequestBody_config) GetInsecureSsl()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable) { + return m.insecure_ssl +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +// returns a *string when successful +func (m *ItemItemHooksPostRequestBody_config) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +// returns a *string when successful +func (m *ItemItemHooksPostRequestBody_config) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ItemItemHooksPostRequestBody_config) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ItemItemHooksPostRequestBody_config) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *ItemItemHooksPostRequestBody_config) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *ItemItemHooksPostRequestBody_config) SetInsecureSsl(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)() { + m.insecure_ssl = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). +func (m *ItemItemHooksPostRequestBody_config) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *ItemItemHooksPostRequestBody_config) SetUrl(value *string)() { + m.url = value +} +type ItemItemHooksPostRequestBody_configable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable) + GetSecret()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.WebhookConfigInsecureSslable)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_request_builder.go new file mode 100644 index 000000000..3cd4c1c16 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_request_builder.go @@ -0,0 +1,121 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemHooksRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\hooks +type ItemItemHooksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemHooksRequestBuilderGetQueryParameters lists webhooks for a repository. `last response` may return null if there have not been any deliveries within 30 days. +type ItemItemHooksRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByHook_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.hooks.item collection +// returns a *ItemItemHooksWithHook_ItemRequestBuilder when successful +func (m *ItemItemHooksRequestBuilder) ByHook_id(hook_id int32)(*ItemItemHooksWithHook_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["hook_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(hook_id), 10) + return NewItemItemHooksWithHook_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemHooksRequestBuilderInternal instantiates a new ItemItemHooksRequestBuilder and sets the default values. +func NewItemItemHooksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksRequestBuilder) { + m := &ItemItemHooksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/hooks{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemHooksRequestBuilder instantiates a new ItemItemHooksRequestBuilder and sets the default values. +func NewItemItemHooksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemHooksRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists webhooks for a repository. `last response` may return null if there have not been any deliveries within 30 days. +// returns a []Hookable 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/repos/webhooks#list-repository-webhooks +func (m *ItemItemHooksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemHooksRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Hookable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateHookFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Hookable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Hookable) + } + } + return val, nil +} +// Post repositories can have multiple webhooks installed. Each webhook should have a unique `config`. Multiple webhooks canshare the same `config` as long as those webhooks do not have any `events` that overlap. +// returns a Hookable when successful +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/repos/webhooks#create-a-repository-webhook +func (m *ItemItemHooksRequestBuilder) Post(ctx context.Context, body ItemItemHooksPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Hookable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateHookFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Hookable), nil +} +// ToGetRequestInformation lists webhooks for a repository. `last response` may return null if there have not been any deliveries within 30 days. +// returns a *RequestInformation when successful +func (m *ItemItemHooksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemHooksRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation repositories can have multiple webhooks installed. Each webhook should have a unique `config`. Multiple webhooks canshare the same `config` as long as those webhooks do not have any `events` that overlap. +// returns a *RequestInformation when successful +func (m *ItemItemHooksRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemHooksPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemHooksRequestBuilder when successful +func (m *ItemItemHooksRequestBuilder) WithUrl(rawUrl string)(*ItemItemHooksRequestBuilder) { + return NewItemItemHooksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_with_hook_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_with_hook_item_request_builder.go new file mode 100644 index 000000000..fe0edb16a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_hooks_with_hook_item_request_builder.go @@ -0,0 +1,144 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemHooksWithHook_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\hooks\{hook_id} +type ItemItemHooksWithHook_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Config the config property +// returns a *ItemItemHooksItemConfigRequestBuilder when successful +func (m *ItemItemHooksWithHook_ItemRequestBuilder) Config()(*ItemItemHooksItemConfigRequestBuilder) { + return NewItemItemHooksItemConfigRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemHooksWithHook_ItemRequestBuilderInternal instantiates a new ItemItemHooksWithHook_ItemRequestBuilder and sets the default values. +func NewItemItemHooksWithHook_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksWithHook_ItemRequestBuilder) { + m := &ItemItemHooksWithHook_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/hooks/{hook_id}", pathParameters), + } + return m +} +// NewItemItemHooksWithHook_ItemRequestBuilder instantiates a new ItemItemHooksWithHook_ItemRequestBuilder and sets the default values. +func NewItemItemHooksWithHook_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksWithHook_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemHooksWithHook_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a repository webhook +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/webhooks#delete-a-repository-webhook +func (m *ItemItemHooksWithHook_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Deliveries the deliveries property +// returns a *ItemItemHooksItemDeliveriesRequestBuilder when successful +func (m *ItemItemHooksWithHook_ItemRequestBuilder) Deliveries()(*ItemItemHooksItemDeliveriesRequestBuilder) { + return NewItemItemHooksItemDeliveriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get returns a webhook configured in a repository. To get only the webhook `config` properties, see "[Get a webhook configuration for a repository](/rest/webhooks/repo-config#get-a-webhook-configuration-for-a-repository)." +// returns a Hookable 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/repos/webhooks#get-a-repository-webhook +func (m *ItemItemHooksWithHook_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Hookable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateHookFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Hookable), nil +} +// Patch updates a webhook configured in a repository. 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 a repository](/rest/webhooks/repo-config#update-a-webhook-configuration-for-a-repository)." +// returns a Hookable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/webhooks#update-a-repository-webhook +func (m *ItemItemHooksWithHook_ItemRequestBuilder) Patch(ctx context.Context, body ItemItemHooksItemWithHook_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Hookable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateHookFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Hookable), nil +} +// Pings the pings property +// returns a *ItemItemHooksItemPingsRequestBuilder when successful +func (m *ItemItemHooksWithHook_ItemRequestBuilder) Pings()(*ItemItemHooksItemPingsRequestBuilder) { + return NewItemItemHooksItemPingsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Tests the tests property +// returns a *ItemItemHooksItemTestsRequestBuilder when successful +func (m *ItemItemHooksWithHook_ItemRequestBuilder) Tests()(*ItemItemHooksItemTestsRequestBuilder) { + return NewItemItemHooksItemTestsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// returns a *RequestInformation when successful +func (m *ItemItemHooksWithHook_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation returns a webhook configured in a repository. To get only the webhook `config` properties, see "[Get a webhook configuration for a repository](/rest/webhooks/repo-config#get-a-webhook-configuration-for-a-repository)." +// returns a *RequestInformation when successful +func (m *ItemItemHooksWithHook_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates a webhook configured in a repository. 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 a repository](/rest/webhooks/repo-config#update-a-webhook-configuration-for-a-repository)." +// returns a *RequestInformation when successful +func (m *ItemItemHooksWithHook_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemHooksItemWithHook_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemHooksWithHook_ItemRequestBuilder when successful +func (m *ItemItemHooksWithHook_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemHooksWithHook_ItemRequestBuilder) { + return NewItemItemHooksWithHook_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_authors_item_with_author_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_authors_item_with_author_patch_request_body.go new file mode 100644 index 000000000..b26705c9c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_authors_item_with_author_patch_request_body.go @@ -0,0 +1,90 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemImportAuthorsItemWithAuthor_PatchRequestBody struct { + // The new Git author email. + email *string + // The new Git author name. + name *string +} +// NewItemItemImportAuthorsItemWithAuthor_PatchRequestBody instantiates a new ItemItemImportAuthorsItemWithAuthor_PatchRequestBody and sets the default values. +func NewItemItemImportAuthorsItemWithAuthor_PatchRequestBody()(*ItemItemImportAuthorsItemWithAuthor_PatchRequestBody) { + m := &ItemItemImportAuthorsItemWithAuthor_PatchRequestBody{ + } + return m +} +// CreateItemItemImportAuthorsItemWithAuthor_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemImportAuthorsItemWithAuthor_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemImportAuthorsItemWithAuthor_PatchRequestBody(), nil +} +// GetEmail gets the email property value. The new Git author email. +// returns a *string when successful +func (m *ItemItemImportAuthorsItemWithAuthor_PatchRequestBody) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemImportAuthorsItemWithAuthor_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The new Git author name. +// returns a *string when successful +func (m *ItemItemImportAuthorsItemWithAuthor_PatchRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemImportAuthorsItemWithAuthor_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + return nil +} +// SetEmail sets the email property value. The new Git author email. +func (m *ItemItemImportAuthorsItemWithAuthor_PatchRequestBody) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The new Git author name. +func (m *ItemItemImportAuthorsItemWithAuthor_PatchRequestBody) SetName(value *string)() { + m.name = value +} +type ItemItemImportAuthorsItemWithAuthor_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetName()(*string) + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_authors_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_authors_request_builder.go new file mode 100644 index 000000000..2c767adc8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_authors_request_builder.go @@ -0,0 +1,86 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemImportAuthorsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\import\authors +type ItemItemImportAuthorsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemImportAuthorsRequestBuilderGetQueryParameters each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username `hubot` into something like `hubot `.This endpoint and the [Map a commit author](https://docs.github.com/rest/migrations/source-imports#map-a-commit-author) endpoint allow you to provide correct Git author information.**Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). +type ItemItemImportAuthorsRequestBuilderGetQueryParameters struct { + // A user ID. Only return users with an ID greater than this ID. + Since *int32 `uriparametername:"since"` +} +// ByAuthor_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.import.authors.item collection +// Deprecated: +// returns a *ItemItemImportAuthorsWithAuthor_ItemRequestBuilder when successful +func (m *ItemItemImportAuthorsRequestBuilder) ByAuthor_id(author_id int32)(*ItemItemImportAuthorsWithAuthor_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["author_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(author_id), 10) + return NewItemItemImportAuthorsWithAuthor_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemImportAuthorsRequestBuilderInternal instantiates a new ItemItemImportAuthorsRequestBuilder and sets the default values. +func NewItemItemImportAuthorsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemImportAuthorsRequestBuilder) { + m := &ItemItemImportAuthorsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/import/authors{?since*}", pathParameters), + } + return m +} +// NewItemItemImportAuthorsRequestBuilder instantiates a new ItemItemImportAuthorsRequestBuilder and sets the default values. +func NewItemItemImportAuthorsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemImportAuthorsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemImportAuthorsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username `hubot` into something like `hubot `.This endpoint and the [Map a commit author](https://docs.github.com/rest/migrations/source-imports#map-a-commit-author) endpoint allow you to provide correct Git author information.**Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). +// Deprecated: +// returns a []PorterAuthorable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/migrations/source-imports#get-commit-authors +func (m *ItemItemImportAuthorsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemImportAuthorsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PorterAuthorable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePorterAuthorFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PorterAuthorable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PorterAuthorable) + } + } + return val, nil +} +// ToGetRequestInformation each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username `hubot` into something like `hubot `.This endpoint and the [Map a commit author](https://docs.github.com/rest/migrations/source-imports#map-a-commit-author) endpoint allow you to provide correct Git author information.**Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemItemImportAuthorsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemImportAuthorsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemItemImportAuthorsRequestBuilder when successful +func (m *ItemItemImportAuthorsRequestBuilder) WithUrl(rawUrl string)(*ItemItemImportAuthorsRequestBuilder) { + return NewItemItemImportAuthorsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_authors_with_author_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_authors_with_author_item_request_builder.go new file mode 100644 index 000000000..0fb44ff5e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_authors_with_author_item_request_builder.go @@ -0,0 +1,72 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemImportAuthorsWithAuthor_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\import\authors\{author_id} +type ItemItemImportAuthorsWithAuthor_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemImportAuthorsWithAuthor_ItemRequestBuilderInternal instantiates a new ItemItemImportAuthorsWithAuthor_ItemRequestBuilder and sets the default values. +func NewItemItemImportAuthorsWithAuthor_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemImportAuthorsWithAuthor_ItemRequestBuilder) { + m := &ItemItemImportAuthorsWithAuthor_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/import/authors/{author_id}", pathParameters), + } + return m +} +// NewItemItemImportAuthorsWithAuthor_ItemRequestBuilder instantiates a new ItemItemImportAuthorsWithAuthor_ItemRequestBuilder and sets the default values. +func NewItemItemImportAuthorsWithAuthor_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemImportAuthorsWithAuthor_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemImportAuthorsWithAuthor_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Patch update an author's identity for the import. Your application can continue updating authors any time before you pushnew commits to the repository.**Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). +// Deprecated: +// returns a PorterAuthorable 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 +// returns a BasicError error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/migrations/source-imports#map-a-commit-author +func (m *ItemItemImportAuthorsWithAuthor_ItemRequestBuilder) Patch(ctx context.Context, body ItemItemImportAuthorsItemWithAuthor_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PorterAuthorable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePorterAuthorFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PorterAuthorable), nil +} +// ToPatchRequestInformation update an author's identity for the import. Your application can continue updating authors any time before you pushnew commits to the repository.**Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemItemImportAuthorsWithAuthor_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemImportAuthorsItemWithAuthor_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemItemImportAuthorsWithAuthor_ItemRequestBuilder when successful +func (m *ItemItemImportAuthorsWithAuthor_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemImportAuthorsWithAuthor_ItemRequestBuilder) { + return NewItemItemImportAuthorsWithAuthor_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_large_files_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_large_files_request_builder.go new file mode 100644 index 000000000..387c41403 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_large_files_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemImportLarge_filesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\import\large_files +type ItemItemImportLarge_filesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemImportLarge_filesRequestBuilderInternal instantiates a new ItemItemImportLarge_filesRequestBuilder and sets the default values. +func NewItemItemImportLarge_filesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemImportLarge_filesRequestBuilder) { + m := &ItemItemImportLarge_filesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/import/large_files", pathParameters), + } + return m +} +// NewItemItemImportLarge_filesRequestBuilder instantiates a new ItemItemImportLarge_filesRequestBuilder and sets the default values. +func NewItemItemImportLarge_filesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemImportLarge_filesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemImportLarge_filesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list files larger than 100MB found during the import**Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). +// Deprecated: +// returns a []PorterLargeFileable when successful +// returns a BasicError error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/migrations/source-imports#get-large-files +func (m *ItemItemImportLarge_filesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PorterLargeFileable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePorterLargeFileFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PorterLargeFileable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PorterLargeFileable) + } + } + return val, nil +} +// ToGetRequestInformation list files larger than 100MB found during the import**Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemItemImportLarge_filesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemItemImportLarge_filesRequestBuilder when successful +func (m *ItemItemImportLarge_filesRequestBuilder) WithUrl(rawUrl string)(*ItemItemImportLarge_filesRequestBuilder) { + return NewItemItemImportLarge_filesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_lfs_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_lfs_patch_request_body.go new file mode 100644 index 000000000..c81c162c5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_lfs_patch_request_body.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemImportLfsPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemImportLfsPatchRequestBody instantiates a new ItemItemImportLfsPatchRequestBody and sets the default values. +func NewItemItemImportLfsPatchRequestBody()(*ItemItemImportLfsPatchRequestBody) { + m := &ItemItemImportLfsPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemImportLfsPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemImportLfsPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemImportLfsPatchRequestBody(), 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 *ItemItemImportLfsPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemImportLfsPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemImportLfsPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemImportLfsPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemImportLfsPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_lfs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_lfs_request_builder.go new file mode 100644 index 000000000..e56d7c532 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_lfs_request_builder.go @@ -0,0 +1,70 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemImportLfsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\import\lfs +type ItemItemImportLfsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemImportLfsRequestBuilderInternal instantiates a new ItemItemImportLfsRequestBuilder and sets the default values. +func NewItemItemImportLfsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemImportLfsRequestBuilder) { + m := &ItemItemImportLfsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/import/lfs", pathParameters), + } + return m +} +// NewItemItemImportLfsRequestBuilder instantiates a new ItemItemImportLfsRequestBuilder and sets the default values. +func NewItemItemImportLfsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemImportLfsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemImportLfsRequestBuilderInternal(urlParams, requestAdapter) +} +// Patch you can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This abilityis powered by [Git LFS](https://git-lfs.com).You can learn more about our LFS feature and working with large files [on our helpsite](https://docs.github.com/repositories/working-with-files/managing-large-files).**Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). +// Deprecated: +// returns a ImportEscapedable when successful +// returns a ValidationError error when the service returns a 422 status code +// returns a BasicError error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference +func (m *ItemItemImportLfsRequestBuilder) Patch(ctx context.Context, body ItemItemImportLfsPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ImportEscapedable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateImportEscapedFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ImportEscapedable), nil +} +// ToPatchRequestInformation you can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This abilityis powered by [Git LFS](https://git-lfs.com).You can learn more about our LFS feature and working with large files [on our helpsite](https://docs.github.com/repositories/working-with-files/managing-large-files).**Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemItemImportLfsRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemImportLfsPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemItemImportLfsRequestBuilder when successful +func (m *ItemItemImportLfsRequestBuilder) WithUrl(rawUrl string)(*ItemItemImportLfsRequestBuilder) { + return NewItemItemImportLfsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_patch_request_body.go new file mode 100644 index 000000000..dae3f7dde --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_patch_request_body.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemImportPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // For a tfvc import, the name of the project that is being imported. + tfvc_project *string + // The password to provide to the originating repository. + vcs_password *string + // The username to provide to the originating repository. + vcs_username *string +} +// NewItemItemImportPatchRequestBody instantiates a new ItemItemImportPatchRequestBody and sets the default values. +func NewItemItemImportPatchRequestBody()(*ItemItemImportPatchRequestBody) { + m := &ItemItemImportPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemImportPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemImportPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemImportPatchRequestBody(), 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 *ItemItemImportPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemImportPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["tfvc_project"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTfvcProject(val) + } + return nil + } + res["vcs_password"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVcsPassword(val) + } + return nil + } + res["vcs_username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVcsUsername(val) + } + return nil + } + return res +} +// GetTfvcProject gets the tfvc_project property value. For a tfvc import, the name of the project that is being imported. +// returns a *string when successful +func (m *ItemItemImportPatchRequestBody) GetTfvcProject()(*string) { + return m.tfvc_project +} +// GetVcsPassword gets the vcs_password property value. The password to provide to the originating repository. +// returns a *string when successful +func (m *ItemItemImportPatchRequestBody) GetVcsPassword()(*string) { + return m.vcs_password +} +// GetVcsUsername gets the vcs_username property value. The username to provide to the originating repository. +// returns a *string when successful +func (m *ItemItemImportPatchRequestBody) GetVcsUsername()(*string) { + return m.vcs_username +} +// Serialize serializes information the current object +func (m *ItemItemImportPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("tfvc_project", m.GetTfvcProject()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("vcs_password", m.GetVcsPassword()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("vcs_username", m.GetVcsUsername()) + 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 *ItemItemImportPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTfvcProject sets the tfvc_project property value. For a tfvc import, the name of the project that is being imported. +func (m *ItemItemImportPatchRequestBody) SetTfvcProject(value *string)() { + m.tfvc_project = value +} +// SetVcsPassword sets the vcs_password property value. The password to provide to the originating repository. +func (m *ItemItemImportPatchRequestBody) SetVcsPassword(value *string)() { + m.vcs_password = value +} +// SetVcsUsername sets the vcs_username property value. The username to provide to the originating repository. +func (m *ItemItemImportPatchRequestBody) SetVcsUsername(value *string)() { + m.vcs_username = value +} +type ItemItemImportPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTfvcProject()(*string) + GetVcsPassword()(*string) + GetVcsUsername()(*string) + SetTfvcProject(value *string)() + SetVcsPassword(value *string)() + SetVcsUsername(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_put_request_body.go new file mode 100644 index 000000000..ebf405c89 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_put_request_body.go @@ -0,0 +1,167 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemImportPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // For a tfvc import, the name of the project that is being imported. + tfvc_project *string + // If authentication is required, the password to provide to `vcs_url`. + vcs_password *string + // The URL of the originating repository. + vcs_url *string + // If authentication is required, the username to provide to `vcs_url`. + vcs_username *string +} +// NewItemItemImportPutRequestBody instantiates a new ItemItemImportPutRequestBody and sets the default values. +func NewItemItemImportPutRequestBody()(*ItemItemImportPutRequestBody) { + m := &ItemItemImportPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemImportPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemImportPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemImportPutRequestBody(), 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 *ItemItemImportPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemImportPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["tfvc_project"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTfvcProject(val) + } + return nil + } + res["vcs_password"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVcsPassword(val) + } + return nil + } + res["vcs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVcsUrl(val) + } + return nil + } + res["vcs_username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVcsUsername(val) + } + return nil + } + return res +} +// GetTfvcProject gets the tfvc_project property value. For a tfvc import, the name of the project that is being imported. +// returns a *string when successful +func (m *ItemItemImportPutRequestBody) GetTfvcProject()(*string) { + return m.tfvc_project +} +// GetVcsPassword gets the vcs_password property value. If authentication is required, the password to provide to `vcs_url`. +// returns a *string when successful +func (m *ItemItemImportPutRequestBody) GetVcsPassword()(*string) { + return m.vcs_password +} +// GetVcsUrl gets the vcs_url property value. The URL of the originating repository. +// returns a *string when successful +func (m *ItemItemImportPutRequestBody) GetVcsUrl()(*string) { + return m.vcs_url +} +// GetVcsUsername gets the vcs_username property value. If authentication is required, the username to provide to `vcs_url`. +// returns a *string when successful +func (m *ItemItemImportPutRequestBody) GetVcsUsername()(*string) { + return m.vcs_username +} +// Serialize serializes information the current object +func (m *ItemItemImportPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("tfvc_project", m.GetTfvcProject()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("vcs_password", m.GetVcsPassword()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("vcs_url", m.GetVcsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("vcs_username", m.GetVcsUsername()) + 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 *ItemItemImportPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTfvcProject sets the tfvc_project property value. For a tfvc import, the name of the project that is being imported. +func (m *ItemItemImportPutRequestBody) SetTfvcProject(value *string)() { + m.tfvc_project = value +} +// SetVcsPassword sets the vcs_password property value. If authentication is required, the password to provide to `vcs_url`. +func (m *ItemItemImportPutRequestBody) SetVcsPassword(value *string)() { + m.vcs_password = value +} +// SetVcsUrl sets the vcs_url property value. The URL of the originating repository. +func (m *ItemItemImportPutRequestBody) SetVcsUrl(value *string)() { + m.vcs_url = value +} +// SetVcsUsername sets the vcs_username property value. If authentication is required, the username to provide to `vcs_url`. +func (m *ItemItemImportPutRequestBody) SetVcsUsername(value *string)() { + m.vcs_username = value +} +type ItemItemImportPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTfvcProject()(*string) + GetVcsPassword()(*string) + GetVcsUrl()(*string) + GetVcsUsername()(*string) + SetTfvcProject(value *string)() + SetVcsPassword(value *string)() + SetVcsUrl(value *string)() + SetVcsUsername(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_request_builder.go new file mode 100644 index 000000000..dafca4d4f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_import_request_builder.go @@ -0,0 +1,188 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemImportRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\import +type ItemItemImportRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Authors the authors property +// returns a *ItemItemImportAuthorsRequestBuilder when successful +func (m *ItemItemImportRequestBuilder) Authors()(*ItemItemImportAuthorsRequestBuilder) { + return NewItemItemImportAuthorsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemImportRequestBuilderInternal instantiates a new ItemItemImportRequestBuilder and sets the default values. +func NewItemItemImportRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemImportRequestBuilder) { + m := &ItemItemImportRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/import", pathParameters), + } + return m +} +// NewItemItemImportRequestBuilder instantiates a new ItemItemImportRequestBuilder and sets the default values. +func NewItemItemImportRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemImportRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemImportRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete stop an import for a repository.**Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). +// Deprecated: +// returns a BasicError error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/migrations/source-imports#cancel-an-import +func (m *ItemItemImportRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get view the progress of an import.**Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).**Import status**This section includes details about the possible values of the `status` field of the Import Progress response.An import that does not have errors will progress through these steps:* `detecting` - the "detection" step of the import is in progress because the request did not include a `vcs` parameter. The import is identifying the type of source control present at the URL.* `importing` - the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include `commit_count` (the total number of raw commits that will be imported) and `percent` (0 - 100, the current progress through the import).* `mapping` - the "rewrite" step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information.* `pushing` - the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include `push_percent`, which is the percent value reported by `git push` when it is "Writing objects".* `complete` - the import is complete, and the repository is ready on GitHub.If there are problems, you will see one of these in the `status` field:* `auth_failed` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/migrations/source-imports#update-an-import) section.* `error` - the import encountered an error. The import progress response will include the `failed_step` and an error message. Contact [GitHub Support](https://support.github.com/contact?tags=dotcom-rest-api) for more information.* `detection_needs_auth` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/migrations/source-imports#update-an-import) section.* `detection_found_nothing` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](https://docs.github.com/rest/migrations/source-imports#cancel-an-import) and [retry](https://docs.github.com/rest/migrations/source-imports#start-an-import) with the correct URL.* `detection_found_multiple` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a `project_choices` field with the possible project choices as values. To update project choice, please see the [Update an import](https://docs.github.com/rest/migrations/source-imports#update-an-import) section.**The project_choices field**When multiple projects are found at the provided URL, the response hash will include a `project_choices` field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type.**Git LFS related fields**This section includes details about Git LFS related fields that may be present in the Import Progress response.* `use_lfs` - describes whether the import has been opted in or out of using Git LFS. The value can be `opt_in`, `opt_out`, or `undecided` if no action has been taken.* `has_large_files` - the boolean value describing whether files larger than 100MB were found during the `importing` step.* `large_files_size` - the total size in gigabytes of files larger than 100MB found in the originating repository.* `large_files_count` - the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request. +// Deprecated: +// returns a ImportEscapedable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/migrations/source-imports#get-an-import-status +func (m *ItemItemImportRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ImportEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateImportEscapedFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ImportEscapedable), nil +} +// Large_files the large_files property +// returns a *ItemItemImportLarge_filesRequestBuilder when successful +func (m *ItemItemImportRequestBuilder) Large_files()(*ItemItemImportLarge_filesRequestBuilder) { + return NewItemItemImportLarge_filesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Lfs the lfs property +// returns a *ItemItemImportLfsRequestBuilder when successful +func (m *ItemItemImportRequestBuilder) Lfs()(*ItemItemImportLfsRequestBuilder) { + return NewItemItemImportLfsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch an import can be updated with credentials or a project choice by passing in the appropriate parameters in this APIrequest. If no parameters are provided, the import will be restarted.Some servers (e.g. TFS servers) can have several projects at a single URL. In those cases the import progress willhave the status `detection_found_multiple` and the Import Progress response will include a `project_choices` array.You can select the project to import by providing one of the objects in the `project_choices` array in the update request.**Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). +// Deprecated: +// returns a ImportEscapedable when successful +// returns a BasicError error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/migrations/source-imports#update-an-import +func (m *ItemItemImportRequestBuilder) Patch(ctx context.Context, body ItemItemImportPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ImportEscapedable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateImportEscapedFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ImportEscapedable), nil +} +// Put start a source import to a GitHub repository using GitHub Importer.Importing into a GitHub repository with GitHub Actions enabled is not supported and willreturn a status `422 Unprocessable Entity` response.**Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). +// Deprecated: +// returns a ImportEscapedable 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 +// returns a BasicError error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/migrations/source-imports#start-an-import +func (m *ItemItemImportRequestBuilder) Put(ctx context.Context, body ItemItemImportPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ImportEscapedable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateImportEscapedFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ImportEscapedable), nil +} +// ToDeleteRequestInformation stop an import for a repository.**Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemItemImportRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation view the progress of an import.**Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).**Import status**This section includes details about the possible values of the `status` field of the Import Progress response.An import that does not have errors will progress through these steps:* `detecting` - the "detection" step of the import is in progress because the request did not include a `vcs` parameter. The import is identifying the type of source control present at the URL.* `importing` - the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include `commit_count` (the total number of raw commits that will be imported) and `percent` (0 - 100, the current progress through the import).* `mapping` - the "rewrite" step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information.* `pushing` - the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include `push_percent`, which is the percent value reported by `git push` when it is "Writing objects".* `complete` - the import is complete, and the repository is ready on GitHub.If there are problems, you will see one of these in the `status` field:* `auth_failed` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/migrations/source-imports#update-an-import) section.* `error` - the import encountered an error. The import progress response will include the `failed_step` and an error message. Contact [GitHub Support](https://support.github.com/contact?tags=dotcom-rest-api) for more information.* `detection_needs_auth` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/migrations/source-imports#update-an-import) section.* `detection_found_nothing` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](https://docs.github.com/rest/migrations/source-imports#cancel-an-import) and [retry](https://docs.github.com/rest/migrations/source-imports#start-an-import) with the correct URL.* `detection_found_multiple` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a `project_choices` field with the possible project choices as values. To update project choice, please see the [Update an import](https://docs.github.com/rest/migrations/source-imports#update-an-import) section.**The project_choices field**When multiple projects are found at the provided URL, the response hash will include a `project_choices` field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type.**Git LFS related fields**This section includes details about Git LFS related fields that may be present in the Import Progress response.* `use_lfs` - describes whether the import has been opted in or out of using Git LFS. The value can be `opt_in`, `opt_out`, or `undecided` if no action has been taken.* `has_large_files` - the boolean value describing whether files larger than 100MB were found during the `importing` step.* `large_files_size` - the total size in gigabytes of files larger than 100MB found in the originating repository.* `large_files_count` - the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemItemImportRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation an import can be updated with credentials or a project choice by passing in the appropriate parameters in this APIrequest. If no parameters are provided, the import will be restarted.Some servers (e.g. TFS servers) can have several projects at a single URL. In those cases the import progress willhave the status `detection_found_multiple` and the Import Progress response will include a `project_choices` array.You can select the project to import by providing one of the objects in the `project_choices` array in the update request.**Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemItemImportRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemImportPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPutRequestInformation start a source import to a GitHub repository using GitHub Importer.Importing into a GitHub repository with GitHub Actions enabled is not supported and willreturn a status `422 Unprocessable Entity` response.**Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemItemImportRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemImportPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemItemImportRequestBuilder when successful +func (m *ItemItemImportRequestBuilder) WithUrl(rawUrl string)(*ItemItemImportRequestBuilder) { + return NewItemItemImportRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_installation_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_installation_request_builder.go new file mode 100644 index 000000000..f3ea07dd3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_installation_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemInstallationRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\installation +type ItemItemInstallationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemInstallationRequestBuilderInternal instantiates a new ItemItemInstallationRequestBuilder and sets the default values. +func NewItemItemInstallationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemInstallationRequestBuilder) { + m := &ItemItemInstallationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/installation", pathParameters), + } + return m +} +// NewItemItemInstallationRequestBuilder instantiates a new ItemItemInstallationRequestBuilder and sets the default values. +func NewItemItemInstallationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemInstallationRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemInstallationRequestBuilderInternal(urlParams, requestAdapter) +} +// Get enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a Installationable 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/apps/apps#get-a-repository-installation-for-the-authenticated-app +func (m *ItemItemInstallationRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateInstallationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable), nil +} +// ToGetRequestInformation enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemInstallationRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemInstallationRequestBuilder when successful +func (m *ItemItemInstallationRequestBuilder) WithUrl(rawUrl string)(*ItemItemInstallationRequestBuilder) { + return NewItemItemInstallationRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_interaction_limits_get_response_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_interaction_limits_get_response_member1.go new file mode 100644 index 000000000..c244505a8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_interaction_limits_get_response_member1.go @@ -0,0 +1,32 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemInteractionLimitsGetResponseMember1 +type ItemItemInteractionLimitsGetResponseMember1 struct { +} +// NewItemItemInteractionLimitsGetResponseMember1 instantiates a new ItemItemInteractionLimitsGetResponseMember1 and sets the default values. +func NewItemItemInteractionLimitsGetResponseMember1()(*ItemItemInteractionLimitsGetResponseMember1) { + m := &ItemItemInteractionLimitsGetResponseMember1{ + } + return m +} +// CreateItemItemInteractionLimitsGetResponseMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemInteractionLimitsGetResponseMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemInteractionLimitsGetResponseMember1(), nil +} +// GetFieldDeserializers the deserialization information for the current model +func (m *ItemItemInteractionLimitsGetResponseMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemInteractionLimitsGetResponseMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// ItemItemInteractionLimitsGetResponseMember1able +type ItemItemInteractionLimitsGetResponseMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_interaction_limits_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_interaction_limits_request_builder.go new file mode 100644 index 000000000..a5e45336e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_interaction_limits_request_builder.go @@ -0,0 +1,110 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemInteractionLimitsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\interaction-limits +type ItemItemInteractionLimitsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemInteractionLimitsRequestBuilderInternal instantiates a new ItemItemInteractionLimitsRequestBuilder and sets the default values. +func NewItemItemInteractionLimitsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemInteractionLimitsRequestBuilder) { + m := &ItemItemInteractionLimitsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/interaction-limits", pathParameters), + } + return m +} +// NewItemItemInteractionLimitsRequestBuilder instantiates a new ItemItemInteractionLimitsRequestBuilder and sets the default values. +func NewItemItemInteractionLimitsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemInteractionLimitsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemInteractionLimitsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository +func (m *ItemItemInteractionLimitsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response. +// returns a InteractionLimitResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/interactions/repos#get-interaction-restrictions-for-a-repository +func (m *ItemItemInteractionLimitsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateInteractionLimitResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitResponseable), nil +} +// Put temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository. +// returns a InteractionLimitResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/interactions/repos#set-interaction-restrictions-for-a-repository +func (m *ItemItemInteractionLimitsRequestBuilder) Put(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateInteractionLimitResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitResponseable), nil +} +// ToDeleteRequestInformation removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository. +// returns a *RequestInformation when successful +func (m *ItemItemInteractionLimitsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response. +// returns a *RequestInformation when successful +func (m *ItemItemInteractionLimitsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository. +// returns a *RequestInformation when successful +func (m *ItemItemInteractionLimitsRequestBuilder) ToPutRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemInteractionLimitsRequestBuilder when successful +func (m *ItemItemInteractionLimitsRequestBuilder) WithUrl(rawUrl string)(*ItemItemInteractionLimitsRequestBuilder) { + return NewItemItemInteractionLimitsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_invitations_item_with_invitation_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_invitations_item_with_invitation_patch_request_body.go new file mode 100644 index 000000000..c78762dfc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_invitations_item_with_invitation_patch_request_body.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemInvitationsItemWithInvitation_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemInvitationsItemWithInvitation_PatchRequestBody instantiates a new ItemItemInvitationsItemWithInvitation_PatchRequestBody and sets the default values. +func NewItemItemInvitationsItemWithInvitation_PatchRequestBody()(*ItemItemInvitationsItemWithInvitation_PatchRequestBody) { + m := &ItemItemInvitationsItemWithInvitation_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemInvitationsItemWithInvitation_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemInvitationsItemWithInvitation_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemInvitationsItemWithInvitation_PatchRequestBody(), 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 *ItemItemInvitationsItemWithInvitation_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemInvitationsItemWithInvitation_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemInvitationsItemWithInvitation_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemInvitationsItemWithInvitation_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemInvitationsItemWithInvitation_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_invitations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_invitations_request_builder.go new file mode 100644 index 000000000..33b9400b1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_invitations_request_builder.go @@ -0,0 +1,78 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemInvitationsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\invitations +type ItemItemInvitationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemInvitationsRequestBuilderGetQueryParameters when authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. +type ItemItemInvitationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByInvitation_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.invitations.item collection +// returns a *ItemItemInvitationsWithInvitation_ItemRequestBuilder when successful +func (m *ItemItemInvitationsRequestBuilder) ByInvitation_id(invitation_id int32)(*ItemItemInvitationsWithInvitation_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["invitation_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(invitation_id), 10) + return NewItemItemInvitationsWithInvitation_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemInvitationsRequestBuilderInternal instantiates a new ItemItemInvitationsRequestBuilder and sets the default values. +func NewItemItemInvitationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemInvitationsRequestBuilder) { + m := &ItemItemInvitationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/invitations{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemInvitationsRequestBuilder instantiates a new ItemItemInvitationsRequestBuilder and sets the default values. +func NewItemItemInvitationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemInvitationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemInvitationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get when authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. +// returns a []RepositoryInvitationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations +func (m *ItemItemInvitationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemInvitationsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryInvitationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryInvitationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryInvitationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryInvitationable) + } + } + return val, nil +} +// ToGetRequestInformation when authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. +// returns a *RequestInformation when successful +func (m *ItemItemInvitationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemInvitationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemInvitationsRequestBuilder when successful +func (m *ItemItemInvitationsRequestBuilder) WithUrl(rawUrl string)(*ItemItemInvitationsRequestBuilder) { + return NewItemItemInvitationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_invitations_with_invitation_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_invitations_with_invitation_item_request_builder.go new file mode 100644 index 000000000..1decaeb54 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_invitations_with_invitation_item_request_builder.go @@ -0,0 +1,81 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemInvitationsWithInvitation_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\invitations\{invitation_id} +type ItemItemInvitationsWithInvitation_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemInvitationsWithInvitation_ItemRequestBuilderInternal instantiates a new ItemItemInvitationsWithInvitation_ItemRequestBuilder and sets the default values. +func NewItemItemInvitationsWithInvitation_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemInvitationsWithInvitation_ItemRequestBuilder) { + m := &ItemItemInvitationsWithInvitation_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/invitations/{invitation_id}", pathParameters), + } + return m +} +// NewItemItemInvitationsWithInvitation_ItemRequestBuilder instantiates a new ItemItemInvitationsWithInvitation_ItemRequestBuilder and sets the default values. +func NewItemItemInvitationsWithInvitation_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemInvitationsWithInvitation_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemInvitationsWithInvitation_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a repository invitation +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation +func (m *ItemItemInvitationsWithInvitation_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Patch update a repository invitation +// returns a RepositoryInvitationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation +func (m *ItemItemInvitationsWithInvitation_ItemRequestBuilder) Patch(ctx context.Context, body ItemItemInvitationsItemWithInvitation_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryInvitationable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryInvitationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryInvitationable), nil +} +// returns a *RequestInformation when successful +func (m *ItemItemInvitationsWithInvitation_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *ItemItemInvitationsWithInvitation_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemInvitationsItemWithInvitation_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemInvitationsWithInvitation_ItemRequestBuilder when successful +func (m *ItemItemInvitationsWithInvitation_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemInvitationsWithInvitation_ItemRequestBuilder) { + return NewItemItemInvitationsWithInvitation_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_item_reactions_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_item_reactions_post_request_body.go new file mode 100644 index 000000000..01f1b541b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesCommentsItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemIssuesCommentsItemReactionsPostRequestBody instantiates a new ItemItemIssuesCommentsItemReactionsPostRequestBody and sets the default values. +func NewItemItemIssuesCommentsItemReactionsPostRequestBody()(*ItemItemIssuesCommentsItemReactionsPostRequestBody) { + m := &ItemItemIssuesCommentsItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesCommentsItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesCommentsItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesCommentsItemReactionsPostRequestBody(), 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 *ItemItemIssuesCommentsItemReactionsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesCommentsItemReactionsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemIssuesCommentsItemReactionsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemIssuesCommentsItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemIssuesCommentsItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_item_reactions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_item_reactions_request_builder.go new file mode 100644 index 000000000..c4b9b38d2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_item_reactions_request_builder.go @@ -0,0 +1,120 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i4962a446a8e590313347ef7c73ec2d481be83dcd51a243c337358fc09ae22a4e "github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/comments/item/reactions" +) + +// ItemItemIssuesCommentsItemReactionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\comments\{comment_id}\reactions +type ItemItemIssuesCommentsItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesCommentsItemReactionsRequestBuilderGetQueryParameters list the reactions to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). +type ItemItemIssuesCommentsItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to an issue comment. + Content *i4962a446a8e590313347ef7c73ec2d481be83dcd51a243c337358fc09ae22a4e.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByReaction_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.issues.comments.item.reactions.item collection +// returns a *ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemIssuesCommentsItemReactionsRequestBuilder) ByReaction_id(reaction_id int32)(*ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["reaction_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(reaction_id), 10) + return NewItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemIssuesCommentsItemReactionsRequestBuilderInternal instantiates a new ItemItemIssuesCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemItemIssuesCommentsItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesCommentsItemReactionsRequestBuilder) { + m := &ItemItemIssuesCommentsItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/comments/{comment_id}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemIssuesCommentsItemReactionsRequestBuilder instantiates a new ItemItemIssuesCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemItemIssuesCommentsItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesCommentsItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesCommentsItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the reactions to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). +// returns a []Reactionable 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/reactions/reactions#list-reactions-for-an-issue-comment +func (m *ItemItemIssuesCommentsItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesCommentsItemReactionsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable) + } + } + return val, nil +} +// Post create a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). A response with an HTTP `200` status means that you already added the reaction type to this issue comment. +// returns a Reactionable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment +func (m *ItemItemIssuesCommentsItemReactionsRequestBuilder) Post(ctx context.Context, body ItemItemIssuesCommentsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable), nil +} +// ToGetRequestInformation list the reactions to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). +// returns a *RequestInformation when successful +func (m *ItemItemIssuesCommentsItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesCommentsItemReactionsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation create a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). A response with an HTTP `200` status means that you already added the reaction type to this issue comment. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesCommentsItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemIssuesCommentsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesCommentsItemReactionsRequestBuilder when successful +func (m *ItemItemIssuesCommentsItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesCommentsItemReactionsRequestBuilder) { + return NewItemItemIssuesCommentsItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_item_reactions_with_reaction_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_item_reactions_with_reaction_item_request_builder.go new file mode 100644 index 000000000..c5e6a6f84 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_item_reactions_with_reaction_item_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\comments\{comment_id}\reactions\{reaction_id} +type ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilderInternal instantiates a new ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder) { + m := &ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/comments/{comment_id}/reactions/{reaction_id}", pathParameters), + } + return m +} +// NewItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder instantiates a new ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete **Note:** You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`.Delete a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction +func (m *ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation **Note:** You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`.Delete a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). +// returns a *RequestInformation when successful +func (m *ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder) { + return NewItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_item_with_comment_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_item_with_comment_patch_request_body.go new file mode 100644 index 000000000..77996dc9a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_item_with_comment_patch_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesCommentsItemWithComment_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The contents of the comment. + body *string +} +// NewItemItemIssuesCommentsItemWithComment_PatchRequestBody instantiates a new ItemItemIssuesCommentsItemWithComment_PatchRequestBody and sets the default values. +func NewItemItemIssuesCommentsItemWithComment_PatchRequestBody()(*ItemItemIssuesCommentsItemWithComment_PatchRequestBody) { + m := &ItemItemIssuesCommentsItemWithComment_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesCommentsItemWithComment_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesCommentsItemWithComment_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesCommentsItemWithComment_PatchRequestBody(), 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 *ItemItemIssuesCommentsItemWithComment_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The contents of the comment. +// returns a *string when successful +func (m *ItemItemIssuesCommentsItemWithComment_PatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesCommentsItemWithComment_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemIssuesCommentsItemWithComment_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemItemIssuesCommentsItemWithComment_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The contents of the comment. +func (m *ItemItemIssuesCommentsItemWithComment_PatchRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemItemIssuesCommentsItemWithComment_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_request_builder.go new file mode 100644 index 000000000..a2a14ad79 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_request_builder.go @@ -0,0 +1,92 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + if9fe7687d66ccbe48e81b41eb88b87988bd006a467b7e33a09cc95d9ac51aa3f "github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/comments" +) + +// ItemItemIssuesCommentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\comments +type ItemItemIssuesCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesCommentsRequestBuilderGetQueryParameters you can use the REST API to list comments on issues and pull requests for a repository. Every pull request is an issue, but not every issue is a pull request.By default, issue comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemIssuesCommentsRequestBuilderGetQueryParameters struct { + // Either `asc` or `desc`. Ignored without the `sort` parameter. + Direction *if9fe7687d66ccbe48e81b41eb88b87988bd006a467b7e33a09cc95d9ac51aa3f.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + // The property to sort the results by. + Sort *if9fe7687d66ccbe48e81b41eb88b87988bd006a467b7e33a09cc95d9ac51aa3f.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByComment_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.issues.comments.item collection +// returns a *ItemItemIssuesCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemItemIssuesCommentsRequestBuilder) ByComment_id(comment_id int32)(*ItemItemIssuesCommentsWithComment_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["comment_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(comment_id), 10) + return NewItemItemIssuesCommentsWithComment_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemIssuesCommentsRequestBuilderInternal instantiates a new ItemItemIssuesCommentsRequestBuilder and sets the default values. +func NewItemItemIssuesCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesCommentsRequestBuilder) { + m := &ItemItemIssuesCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/comments{?direction*,page*,per_page*,since*,sort*}", pathParameters), + } + return m +} +// NewItemItemIssuesCommentsRequestBuilder instantiates a new ItemItemIssuesCommentsRequestBuilder and sets the default values. +func NewItemItemIssuesCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get you can use the REST API to list comments on issues and pull requests for a repository. Every pull request is an issue, but not every issue is a pull request.By default, issue comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []IssueCommentable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository +func (m *ItemItemIssuesCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesCommentsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueCommentable) + } + } + return val, nil +} +// ToGetRequestInformation you can use the REST API to list comments on issues and pull requests for a repository. Every pull request is an issue, but not every issue is a pull request.By default, issue comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesCommentsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesCommentsRequestBuilder when successful +func (m *ItemItemIssuesCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesCommentsRequestBuilder) { + return NewItemItemIssuesCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_with_comment_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_with_comment_item_request_builder.go new file mode 100644 index 000000000..fe7692656 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_comments_with_comment_item_request_builder.go @@ -0,0 +1,123 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemIssuesCommentsWithComment_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\comments\{comment_id} +type ItemItemIssuesCommentsWithComment_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemIssuesCommentsWithComment_ItemRequestBuilderInternal instantiates a new ItemItemIssuesCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemItemIssuesCommentsWithComment_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesCommentsWithComment_ItemRequestBuilder) { + m := &ItemItemIssuesCommentsWithComment_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/comments/{comment_id}", pathParameters), + } + return m +} +// NewItemItemIssuesCommentsWithComment_ItemRequestBuilder instantiates a new ItemItemIssuesCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemItemIssuesCommentsWithComment_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesCommentsWithComment_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesCommentsWithComment_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete you can use the REST API to delete comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/comments#delete-an-issue-comment +func (m *ItemItemIssuesCommentsWithComment_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get you can use the REST API to get comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a IssueCommentable 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/issues/comments#get-an-issue-comment +func (m *ItemItemIssuesCommentsWithComment_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueCommentable), nil +} +// Patch you can use the REST API to update comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a IssueCommentable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/comments#update-an-issue-comment +func (m *ItemItemIssuesCommentsWithComment_ItemRequestBuilder) Patch(ctx context.Context, body ItemItemIssuesCommentsItemWithComment_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueCommentable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueCommentable), nil +} +// Reactions the reactions property +// returns a *ItemItemIssuesCommentsItemReactionsRequestBuilder when successful +func (m *ItemItemIssuesCommentsWithComment_ItemRequestBuilder) Reactions()(*ItemItemIssuesCommentsItemReactionsRequestBuilder) { + return NewItemItemIssuesCommentsItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation you can use the REST API to delete comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesCommentsWithComment_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation you can use the REST API to get comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesCommentsWithComment_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation you can use the REST API to update comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesCommentsWithComment_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemIssuesCommentsItemWithComment_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemItemIssuesCommentsWithComment_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesCommentsWithComment_ItemRequestBuilder) { + return NewItemItemIssuesCommentsWithComment_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_events_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_events_request_builder.go new file mode 100644 index 000000000..2775fbbfc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_events_request_builder.go @@ -0,0 +1,82 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemIssuesEventsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\events +type ItemItemIssuesEventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesEventsRequestBuilderGetQueryParameters lists events for a repository. +type ItemItemIssuesEventsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByEvent_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.issues.events.item collection +// returns a *ItemItemIssuesEventsWithEvent_ItemRequestBuilder when successful +func (m *ItemItemIssuesEventsRequestBuilder) ByEvent_id(event_id int32)(*ItemItemIssuesEventsWithEvent_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["event_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(event_id), 10) + return NewItemItemIssuesEventsWithEvent_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemIssuesEventsRequestBuilderInternal instantiates a new ItemItemIssuesEventsRequestBuilder and sets the default values. +func NewItemItemIssuesEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesEventsRequestBuilder) { + m := &ItemItemIssuesEventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/events{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemIssuesEventsRequestBuilder instantiates a new ItemItemIssuesEventsRequestBuilder and sets the default values. +func NewItemItemIssuesEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesEventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesEventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists events for a repository. +// returns a []IssueEventable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository +func (m *ItemItemIssuesEventsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesEventsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueEventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueEventFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueEventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueEventable) + } + } + return val, nil +} +// ToGetRequestInformation lists events for a repository. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesEventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesEventsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesEventsRequestBuilder when successful +func (m *ItemItemIssuesEventsRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesEventsRequestBuilder) { + return NewItemItemIssuesEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_events_with_event_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_events_with_event_item_request_builder.go new file mode 100644 index 000000000..c98d1fcb3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_events_with_event_item_request_builder.go @@ -0,0 +1,65 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemIssuesEventsWithEvent_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\events\{event_id} +type ItemItemIssuesEventsWithEvent_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemIssuesEventsWithEvent_ItemRequestBuilderInternal instantiates a new ItemItemIssuesEventsWithEvent_ItemRequestBuilder and sets the default values. +func NewItemItemIssuesEventsWithEvent_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesEventsWithEvent_ItemRequestBuilder) { + m := &ItemItemIssuesEventsWithEvent_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/events/{event_id}", pathParameters), + } + return m +} +// NewItemItemIssuesEventsWithEvent_ItemRequestBuilder instantiates a new ItemItemIssuesEventsWithEvent_ItemRequestBuilder and sets the default values. +func NewItemItemIssuesEventsWithEvent_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesEventsWithEvent_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesEventsWithEvent_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a single event by the event id. +// returns a IssueEventable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/events#get-an-issue-event +func (m *ItemItemIssuesEventsWithEvent_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueEventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueEventFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueEventable), nil +} +// ToGetRequestInformation gets a single event by the event id. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesEventsWithEvent_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesEventsWithEvent_ItemRequestBuilder when successful +func (m *ItemItemIssuesEventsWithEvent_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesEventsWithEvent_ItemRequestBuilder) { + return NewItemItemIssuesEventsWithEvent_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_assignees_delete_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_assignees_delete_request_body.go new file mode 100644 index 000000000..4fb7a2dc0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_assignees_delete_request_body.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemAssigneesDeleteRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._ + assignees []string +} +// NewItemItemIssuesItemAssigneesDeleteRequestBody instantiates a new ItemItemIssuesItemAssigneesDeleteRequestBody and sets the default values. +func NewItemItemIssuesItemAssigneesDeleteRequestBody()(*ItemItemIssuesItemAssigneesDeleteRequestBody) { + m := &ItemItemIssuesItemAssigneesDeleteRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemAssigneesDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemAssigneesDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemAssigneesDeleteRequestBody(), 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 *ItemItemIssuesItemAssigneesDeleteRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignees gets the assignees property value. Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._ +// returns a []string when successful +func (m *ItemItemIssuesItemAssigneesDeleteRequestBody) GetAssignees()([]string) { + return m.assignees +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemAssigneesDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["assignees"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetAssignees(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemAssigneesDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAssignees() != nil { + err := writer.WriteCollectionOfStringValues("assignees", m.GetAssignees()) + 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 *ItemItemIssuesItemAssigneesDeleteRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignees sets the assignees property value. Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._ +func (m *ItemItemIssuesItemAssigneesDeleteRequestBody) SetAssignees(value []string)() { + m.assignees = value +} +type ItemItemIssuesItemAssigneesDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssignees()([]string) + SetAssignees(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_assignees_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_assignees_post_request_body.go new file mode 100644 index 000000000..7ae722e97 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_assignees_post_request_body.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemAssigneesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ + assignees []string +} +// NewItemItemIssuesItemAssigneesPostRequestBody instantiates a new ItemItemIssuesItemAssigneesPostRequestBody and sets the default values. +func NewItemItemIssuesItemAssigneesPostRequestBody()(*ItemItemIssuesItemAssigneesPostRequestBody) { + m := &ItemItemIssuesItemAssigneesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemAssigneesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemAssigneesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemAssigneesPostRequestBody(), 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 *ItemItemIssuesItemAssigneesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignees gets the assignees property value. Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ +// returns a []string when successful +func (m *ItemItemIssuesItemAssigneesPostRequestBody) GetAssignees()([]string) { + return m.assignees +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemAssigneesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["assignees"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetAssignees(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemAssigneesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAssignees() != nil { + err := writer.WriteCollectionOfStringValues("assignees", m.GetAssignees()) + 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 *ItemItemIssuesItemAssigneesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignees sets the assignees property value. Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ +func (m *ItemItemIssuesItemAssigneesPostRequestBody) SetAssignees(value []string)() { + m.assignees = value +} +type ItemItemIssuesItemAssigneesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssignees()([]string) + SetAssignees(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_assignees_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_assignees_request_builder.go new file mode 100644 index 000000000..b488e7e89 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_assignees_request_builder.go @@ -0,0 +1,104 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemIssuesItemAssigneesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\assignees +type ItemItemIssuesItemAssigneesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByAssignee gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.issues.item.assignees.item collection +// returns a *ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder when successful +func (m *ItemItemIssuesItemAssigneesRequestBuilder) ByAssignee(assignee string)(*ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if assignee != "" { + urlTplParams["assignee"] = assignee + } + return NewItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemIssuesItemAssigneesRequestBuilderInternal instantiates a new ItemItemIssuesItemAssigneesRequestBuilder and sets the default values. +func NewItemItemIssuesItemAssigneesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemAssigneesRequestBuilder) { + m := &ItemItemIssuesItemAssigneesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/assignees", pathParameters), + } + return m +} +// NewItemItemIssuesItemAssigneesRequestBuilder instantiates a new ItemItemIssuesItemAssigneesRequestBuilder and sets the default values. +func NewItemItemIssuesItemAssigneesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemAssigneesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemAssigneesRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes one or more assignees from an issue. +// returns a Issueable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue +func (m *ItemItemIssuesItemAssigneesRequestBuilder) Delete(ctx context.Context, body ItemItemIssuesItemAssigneesDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable), nil +} +// Post adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. +// returns a Issueable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue +func (m *ItemItemIssuesItemAssigneesRequestBuilder) Post(ctx context.Context, body ItemItemIssuesItemAssigneesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable), nil +} +// ToDeleteRequestInformation removes one or more assignees from an issue. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemAssigneesRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ItemItemIssuesItemAssigneesDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPostRequestInformation adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemAssigneesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemIssuesItemAssigneesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesItemAssigneesRequestBuilder when successful +func (m *ItemItemIssuesItemAssigneesRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemAssigneesRequestBuilder) { + return NewItemItemIssuesItemAssigneesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_assignees_with_assignee_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_assignees_with_assignee_item_request_builder.go new file mode 100644 index 000000000..ac1f3da86 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_assignees_with_assignee_item_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\assignees\{assignee} +type ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilderInternal instantiates a new ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder and sets the default values. +func NewItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder) { + m := &ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/assignees/{assignee}", pathParameters), + } + return m +} +// NewItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder instantiates a new ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder and sets the default values. +func NewItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get checks if a user has permission to be assigned to a specific issue.If the `assignee` can be assigned to this issue, a `204` status code with no content is returned.Otherwise a `404` status code is returned. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned-to-a-issue +func (m *ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation checks if a user has permission to be assigned to a specific issue.If the `assignee` can be assigned to this issue, a `204` status code with no content is returned.Otherwise a `404` status code is returned. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder when successful +func (m *ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder) { + return NewItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_comments_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_comments_post_request_body.go new file mode 100644 index 000000000..c85f841dd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_comments_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemCommentsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The contents of the comment. + body *string +} +// NewItemItemIssuesItemCommentsPostRequestBody instantiates a new ItemItemIssuesItemCommentsPostRequestBody and sets the default values. +func NewItemItemIssuesItemCommentsPostRequestBody()(*ItemItemIssuesItemCommentsPostRequestBody) { + m := &ItemItemIssuesItemCommentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemCommentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemCommentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemCommentsPostRequestBody(), 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 *ItemItemIssuesItemCommentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The contents of the comment. +// returns a *string when successful +func (m *ItemItemIssuesItemCommentsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemCommentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemCommentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemItemIssuesItemCommentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The contents of the comment. +func (m *ItemItemIssuesItemCommentsPostRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemItemIssuesItemCommentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_comments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_comments_request_builder.go new file mode 100644 index 000000000..e23df40fb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_comments_request_builder.go @@ -0,0 +1,117 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemIssuesItemCommentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\comments +type ItemItemIssuesItemCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesItemCommentsRequestBuilderGetQueryParameters you can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.Issue comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemIssuesItemCommentsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` +} +// NewItemItemIssuesItemCommentsRequestBuilderInternal instantiates a new ItemItemIssuesItemCommentsRequestBuilder and sets the default values. +func NewItemItemIssuesItemCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemCommentsRequestBuilder) { + m := &ItemItemIssuesItemCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/comments{?page*,per_page*,since*}", pathParameters), + } + return m +} +// NewItemItemIssuesItemCommentsRequestBuilder instantiates a new ItemItemIssuesItemCommentsRequestBuilder and sets the default values. +func NewItemItemIssuesItemCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get you can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.Issue comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []IssueCommentable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/comments#list-issue-comments +func (m *ItemItemIssuesItemCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemCommentsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueCommentable) + } + } + return val, nil +} +// Post you can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications).Creating content too quickly using this endpoint may result in secondary rate limiting.For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a IssueCommentable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/comments#create-an-issue-comment +func (m *ItemItemIssuesItemCommentsRequestBuilder) Post(ctx context.Context, body ItemItemIssuesItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueCommentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueCommentable), nil +} +// ToGetRequestInformation you can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.Issue comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemCommentsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation you can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications).Creating content too quickly using this endpoint may result in secondary rate limiting.For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemCommentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemIssuesItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesItemCommentsRequestBuilder when successful +func (m *ItemItemIssuesItemCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemCommentsRequestBuilder) { + return NewItemItemIssuesItemCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_events_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_events_request_builder.go new file mode 100644 index 000000000..753783ce3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_events_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemIssuesItemEventsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\events +type ItemItemIssuesItemEventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesItemEventsRequestBuilderGetQueryParameters lists all events for an issue. +type ItemItemIssuesItemEventsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemIssuesItemEventsRequestBuilderInternal instantiates a new ItemItemIssuesItemEventsRequestBuilder and sets the default values. +func NewItemItemIssuesItemEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemEventsRequestBuilder) { + m := &ItemItemIssuesItemEventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/events{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemIssuesItemEventsRequestBuilder instantiates a new ItemItemIssuesItemEventsRequestBuilder and sets the default values. +func NewItemItemIssuesItemEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemEventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemEventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all events for an issue. +// returns a []IssueEventForIssueable 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/issues/events#list-issue-events +func (m *ItemItemIssuesItemEventsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemEventsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueEventForIssueable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueEventForIssueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueEventForIssueable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueEventForIssueable) + } + } + return val, nil +} +// ToGetRequestInformation lists all events for an issue. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemEventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemEventsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesItemEventsRequestBuilder when successful +func (m *ItemItemIssuesItemEventsRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemEventsRequestBuilder) { + return NewItemItemIssuesItemEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_post_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_post_request_body_member1.go new file mode 100644 index 000000000..549f99d28 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_post_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLabelsPostRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The names of the labels to add to the issue's existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also replace all of the labels for an issue. For more information, see "[Set labels for an issue](https://docs.github.com/rest/issues/labels#set-labels-for-an-issue)." + labels []string +} +// NewItemItemIssuesItemLabelsPostRequestBodyMember1 instantiates a new ItemItemIssuesItemLabelsPostRequestBodyMember1 and sets the default values. +func NewItemItemIssuesItemLabelsPostRequestBodyMember1()(*ItemItemIssuesItemLabelsPostRequestBodyMember1) { + m := &ItemItemIssuesItemLabelsPostRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLabelsPostRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLabelsPostRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLabelsPostRequestBodyMember1(), 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 *ItemItemIssuesItemLabelsPostRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the labels to add to the issue's existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also replace all of the labels for an issue. For more information, see "[Set labels for an issue](https://docs.github.com/rest/issues/labels#set-labels-for-an-issue)." +// returns a []string when successful +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember1) GetLabels()([]string) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + 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 *ItemItemIssuesItemLabelsPostRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the labels to add to the issue's existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also replace all of the labels for an issue. For more information, see "[Set labels for an issue](https://docs.github.com/rest/issues/labels#set-labels-for-an-issue)." +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember1) SetLabels(value []string)() { + m.labels = value +} +type ItemItemIssuesItemLabelsPostRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + SetLabels(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_post_request_body_member2.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_post_request_body_member2.go new file mode 100644 index 000000000..ea62452b3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_post_request_body_member2.go @@ -0,0 +1,92 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLabelsPostRequestBodyMember2 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The labels property + labels []ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable +} +// NewItemItemIssuesItemLabelsPostRequestBodyMember2 instantiates a new ItemItemIssuesItemLabelsPostRequestBodyMember2 and sets the default values. +func NewItemItemIssuesItemLabelsPostRequestBodyMember2()(*ItemItemIssuesItemLabelsPostRequestBodyMember2) { + m := &ItemItemIssuesItemLabelsPostRequestBodyMember2{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLabelsPostRequestBodyMember2FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLabelsPostRequestBodyMember2FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLabelsPostRequestBodyMember2(), 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 *ItemItemIssuesItemLabelsPostRequestBodyMember2) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember2) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemIssuesItemLabelsPostRequestBodyMember2_labelsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable) + } + } + m.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The labels property +// returns a []ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable when successful +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember2) GetLabels()([]ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember2) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember2) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember2) SetLabels(value []ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable)() { + m.labels = value +} +type ItemItemIssuesItemLabelsPostRequestBodyMember2able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable) + SetLabels(value []ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_post_request_body_member2_labels.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_post_request_body_member2_labels.go new file mode 100644 index 000000000..444ea9a90 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_post_request_body_member2_labels.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLabelsPostRequestBodyMember2_labels struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name property + name *string +} +// NewItemItemIssuesItemLabelsPostRequestBodyMember2_labels instantiates a new ItemItemIssuesItemLabelsPostRequestBodyMember2_labels and sets the default values. +func NewItemItemIssuesItemLabelsPostRequestBodyMember2_labels()(*ItemItemIssuesItemLabelsPostRequestBodyMember2_labels) { + m := &ItemItemIssuesItemLabelsPostRequestBodyMember2_labels{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLabelsPostRequestBodyMember2_labelsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLabelsPostRequestBodyMember2_labelsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLabelsPostRequestBodyMember2_labels(), 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 *ItemItemIssuesItemLabelsPostRequestBodyMember2_labels) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember2_labels) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember2_labels) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember2_labels) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemIssuesItemLabelsPostRequestBodyMember2_labels) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name property +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember2_labels) SetName(value *string)() { + m.name = value +} +type ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_post_request_body_member3.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_post_request_body_member3.go new file mode 100644 index 000000000..5495d2d05 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_post_request_body_member3.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLabelsPostRequestBodyMember3 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemIssuesItemLabelsPostRequestBodyMember3 instantiates a new ItemItemIssuesItemLabelsPostRequestBodyMember3 and sets the default values. +func NewItemItemIssuesItemLabelsPostRequestBodyMember3()(*ItemItemIssuesItemLabelsPostRequestBodyMember3) { + m := &ItemItemIssuesItemLabelsPostRequestBodyMember3{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLabelsPostRequestBodyMember3FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLabelsPostRequestBodyMember3FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLabelsPostRequestBodyMember3(), 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 *ItemItemIssuesItemLabelsPostRequestBodyMember3) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember3) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember3) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemIssuesItemLabelsPostRequestBodyMember3) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemIssuesItemLabelsPostRequestBodyMember3able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_put_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_put_request_body_member1.go new file mode 100644 index 000000000..fe1ff5989 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_put_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLabelsPutRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The names of the labels to set for the issue. The labels you set replace any existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also add labels to the existing labels for an issue. For more information, see "[Add labels to an issue](https://docs.github.com/rest/issues/labels#add-labels-to-an-issue)." + labels []string +} +// NewItemItemIssuesItemLabelsPutRequestBodyMember1 instantiates a new ItemItemIssuesItemLabelsPutRequestBodyMember1 and sets the default values. +func NewItemItemIssuesItemLabelsPutRequestBodyMember1()(*ItemItemIssuesItemLabelsPutRequestBodyMember1) { + m := &ItemItemIssuesItemLabelsPutRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLabelsPutRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLabelsPutRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLabelsPutRequestBodyMember1(), 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 *ItemItemIssuesItemLabelsPutRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the labels to set for the issue. The labels you set replace any existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also add labels to the existing labels for an issue. For more information, see "[Add labels to an issue](https://docs.github.com/rest/issues/labels#add-labels-to-an-issue)." +// returns a []string when successful +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember1) GetLabels()([]string) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + 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 *ItemItemIssuesItemLabelsPutRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the labels to set for the issue. The labels you set replace any existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also add labels to the existing labels for an issue. For more information, see "[Add labels to an issue](https://docs.github.com/rest/issues/labels#add-labels-to-an-issue)." +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember1) SetLabels(value []string)() { + m.labels = value +} +type ItemItemIssuesItemLabelsPutRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + SetLabels(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_put_request_body_member2.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_put_request_body_member2.go new file mode 100644 index 000000000..5d5c56e0d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_put_request_body_member2.go @@ -0,0 +1,92 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLabelsPutRequestBodyMember2 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The labels property + labels []ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable +} +// NewItemItemIssuesItemLabelsPutRequestBodyMember2 instantiates a new ItemItemIssuesItemLabelsPutRequestBodyMember2 and sets the default values. +func NewItemItemIssuesItemLabelsPutRequestBodyMember2()(*ItemItemIssuesItemLabelsPutRequestBodyMember2) { + m := &ItemItemIssuesItemLabelsPutRequestBodyMember2{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLabelsPutRequestBodyMember2FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLabelsPutRequestBodyMember2FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLabelsPutRequestBodyMember2(), 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 *ItemItemIssuesItemLabelsPutRequestBodyMember2) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember2) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemIssuesItemLabelsPutRequestBodyMember2_labelsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable) + } + } + m.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The labels property +// returns a []ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable when successful +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember2) GetLabels()([]ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember2) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember2) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember2) SetLabels(value []ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable)() { + m.labels = value +} +type ItemItemIssuesItemLabelsPutRequestBodyMember2able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable) + SetLabels(value []ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_put_request_body_member2_labels.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_put_request_body_member2_labels.go new file mode 100644 index 000000000..4aac85db7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_put_request_body_member2_labels.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLabelsPutRequestBodyMember2_labels struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name property + name *string +} +// NewItemItemIssuesItemLabelsPutRequestBodyMember2_labels instantiates a new ItemItemIssuesItemLabelsPutRequestBodyMember2_labels and sets the default values. +func NewItemItemIssuesItemLabelsPutRequestBodyMember2_labels()(*ItemItemIssuesItemLabelsPutRequestBodyMember2_labels) { + m := &ItemItemIssuesItemLabelsPutRequestBodyMember2_labels{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLabelsPutRequestBodyMember2_labelsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLabelsPutRequestBodyMember2_labelsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLabelsPutRequestBodyMember2_labels(), 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 *ItemItemIssuesItemLabelsPutRequestBodyMember2_labels) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember2_labels) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember2_labels) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember2_labels) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemIssuesItemLabelsPutRequestBodyMember2_labels) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name property +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember2_labels) SetName(value *string)() { + m.name = value +} +type ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_put_request_body_member3.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_put_request_body_member3.go new file mode 100644 index 000000000..dd7c1f5e4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_put_request_body_member3.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLabelsPutRequestBodyMember3 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemIssuesItemLabelsPutRequestBodyMember3 instantiates a new ItemItemIssuesItemLabelsPutRequestBodyMember3 and sets the default values. +func NewItemItemIssuesItemLabelsPutRequestBodyMember3()(*ItemItemIssuesItemLabelsPutRequestBodyMember3) { + m := &ItemItemIssuesItemLabelsPutRequestBodyMember3{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLabelsPutRequestBodyMember3FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLabelsPutRequestBodyMember3FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLabelsPutRequestBodyMember3(), 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 *ItemItemIssuesItemLabelsPutRequestBodyMember3) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember3) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember3) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemIssuesItemLabelsPutRequestBodyMember3) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemIssuesItemLabelsPutRequestBodyMember3able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_request_builder.go new file mode 100644 index 000000000..fa91e8deb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_request_builder.go @@ -0,0 +1,671 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemIssuesItemLabelsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\labels +type ItemItemIssuesItemLabelsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesItemLabelsRequestBuilderGetQueryParameters lists all labels for an issue. +type ItemItemIssuesItemLabelsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// LabelsPostRequestBody composed type wrapper for classes ItemItemIssuesItemLabelsPostRequestBodyMember1able, ItemItemIssuesItemLabelsPostRequestBodyMember2able, string, []ItemItemIssuesItemLabelsPostRequestBodyMember3able +type LabelsPostRequestBody struct { + // Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember1able + itemItemIssuesItemLabelsPostRequestBodyMember1 ItemItemIssuesItemLabelsPostRequestBodyMember1able + // Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember2able + itemItemIssuesItemLabelsPostRequestBodyMember2 ItemItemIssuesItemLabelsPostRequestBodyMember2able + // Composed type representation for type []ItemItemIssuesItemLabelsPostRequestBodyMember3able + itemItemIssuesItemLabelsPostRequestBodyMember3 []ItemItemIssuesItemLabelsPostRequestBodyMember3able + // Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember1able + labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1 ItemItemIssuesItemLabelsPostRequestBodyMember1able + // Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember2able + labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2 ItemItemIssuesItemLabelsPostRequestBodyMember2able + // Composed type representation for type []ItemItemIssuesItemLabelsPostRequestBodyMember3able + labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3 []ItemItemIssuesItemLabelsPostRequestBodyMember3able + // Composed type representation for type string + labelsPostRequestBodyString *string + // Composed type representation for type string + string *string +} +// NewLabelsPostRequestBody instantiates a new LabelsPostRequestBody and sets the default values. +func NewLabelsPostRequestBody()(*LabelsPostRequestBody) { + m := &LabelsPostRequestBody{ + } + return m +} +// CreateLabelsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabelsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewLabelsPostRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetLabelsPostRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } else if val, err := parseNode.GetCollectionOfObjectValues(CreateItemItemIssuesItemLabelsPostRequestBodyMember3FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]ItemItemIssuesItemLabelsPostRequestBodyMember3able, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(ItemItemIssuesItemLabelsPostRequestBodyMember3able) + } + } + result.SetItemItemIssuesItemLabelsPostRequestBodyMember3(cast) + } else if val, err := parseNode.GetCollectionOfObjectValues(CreateItemItemIssuesItemLabelsPostRequestBodyMember3FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]ItemItemIssuesItemLabelsPostRequestBodyMember3able, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(ItemItemIssuesItemLabelsPostRequestBodyMember3able) + } + } + result.SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3(cast) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LabelsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *LabelsPostRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemIssuesItemLabelsPostRequestBodyMember1 gets the ItemItemIssuesItemLabelsPostRequestBodyMember1 property value. Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember1able +// returns a ItemItemIssuesItemLabelsPostRequestBodyMember1able when successful +func (m *LabelsPostRequestBody) GetItemItemIssuesItemLabelsPostRequestBodyMember1()(ItemItemIssuesItemLabelsPostRequestBodyMember1able) { + return m.itemItemIssuesItemLabelsPostRequestBodyMember1 +} +// GetItemItemIssuesItemLabelsPostRequestBodyMember2 gets the ItemItemIssuesItemLabelsPostRequestBodyMember2 property value. Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember2able +// returns a ItemItemIssuesItemLabelsPostRequestBodyMember2able when successful +func (m *LabelsPostRequestBody) GetItemItemIssuesItemLabelsPostRequestBodyMember2()(ItemItemIssuesItemLabelsPostRequestBodyMember2able) { + return m.itemItemIssuesItemLabelsPostRequestBodyMember2 +} +// GetItemItemIssuesItemLabelsPostRequestBodyMember3 gets the ItemItemIssuesItemLabelsPostRequestBodyMember3 property value. Composed type representation for type []ItemItemIssuesItemLabelsPostRequestBodyMember3able +// returns a []ItemItemIssuesItemLabelsPostRequestBodyMember3able when successful +func (m *LabelsPostRequestBody) GetItemItemIssuesItemLabelsPostRequestBodyMember3()([]ItemItemIssuesItemLabelsPostRequestBodyMember3able) { + return m.itemItemIssuesItemLabelsPostRequestBodyMember3 +} +// GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1 gets the ItemItemIssuesItemLabelsPostRequestBodyMember1 property value. Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember1able +// returns a ItemItemIssuesItemLabelsPostRequestBodyMember1able when successful +func (m *LabelsPostRequestBody) GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1()(ItemItemIssuesItemLabelsPostRequestBodyMember1able) { + return m.labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1 +} +// GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2 gets the ItemItemIssuesItemLabelsPostRequestBodyMember2 property value. Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember2able +// returns a ItemItemIssuesItemLabelsPostRequestBodyMember2able when successful +func (m *LabelsPostRequestBody) GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2()(ItemItemIssuesItemLabelsPostRequestBodyMember2able) { + return m.labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2 +} +// GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3 gets the ItemItemIssuesItemLabelsPostRequestBodyMember3 property value. Composed type representation for type []ItemItemIssuesItemLabelsPostRequestBodyMember3able +// returns a []ItemItemIssuesItemLabelsPostRequestBodyMember3able when successful +func (m *LabelsPostRequestBody) GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3()([]ItemItemIssuesItemLabelsPostRequestBodyMember3able) { + return m.labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3 +} +// GetLabelsPostRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *LabelsPostRequestBody) GetLabelsPostRequestBodyString()(*string) { + return m.labelsPostRequestBodyString +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *LabelsPostRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *LabelsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemIssuesItemLabelsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemIssuesItemLabelsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemIssuesItemLabelsPostRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetItemItemIssuesItemLabelsPostRequestBodyMember2()) + if err != nil { + return err + } + } else if m.GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2()) + if err != nil { + return err + } + } else if m.GetLabelsPostRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetLabelsPostRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetItemItemIssuesItemLabelsPostRequestBodyMember3() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItemItemIssuesItemLabelsPostRequestBodyMember3())) + for i, v := range m.GetItemItemIssuesItemLabelsPostRequestBodyMember3() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } else if m.GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3())) + for i, v := range m.GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } + return nil +} +// SetItemItemIssuesItemLabelsPostRequestBodyMember1 sets the ItemItemIssuesItemLabelsPostRequestBodyMember1 property value. Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember1able +func (m *LabelsPostRequestBody) SetItemItemIssuesItemLabelsPostRequestBodyMember1(value ItemItemIssuesItemLabelsPostRequestBodyMember1able)() { + m.itemItemIssuesItemLabelsPostRequestBodyMember1 = value +} +// SetItemItemIssuesItemLabelsPostRequestBodyMember2 sets the ItemItemIssuesItemLabelsPostRequestBodyMember2 property value. Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember2able +func (m *LabelsPostRequestBody) SetItemItemIssuesItemLabelsPostRequestBodyMember2(value ItemItemIssuesItemLabelsPostRequestBodyMember2able)() { + m.itemItemIssuesItemLabelsPostRequestBodyMember2 = value +} +// SetItemItemIssuesItemLabelsPostRequestBodyMember3 sets the ItemItemIssuesItemLabelsPostRequestBodyMember3 property value. Composed type representation for type []ItemItemIssuesItemLabelsPostRequestBodyMember3able +func (m *LabelsPostRequestBody) SetItemItemIssuesItemLabelsPostRequestBodyMember3(value []ItemItemIssuesItemLabelsPostRequestBodyMember3able)() { + m.itemItemIssuesItemLabelsPostRequestBodyMember3 = value +} +// SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1 sets the ItemItemIssuesItemLabelsPostRequestBodyMember1 property value. Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember1able +func (m *LabelsPostRequestBody) SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1(value ItemItemIssuesItemLabelsPostRequestBodyMember1able)() { + m.labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1 = value +} +// SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2 sets the ItemItemIssuesItemLabelsPostRequestBodyMember2 property value. Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember2able +func (m *LabelsPostRequestBody) SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2(value ItemItemIssuesItemLabelsPostRequestBodyMember2able)() { + m.labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2 = value +} +// SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3 sets the ItemItemIssuesItemLabelsPostRequestBodyMember3 property value. Composed type representation for type []ItemItemIssuesItemLabelsPostRequestBodyMember3able +func (m *LabelsPostRequestBody) SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3(value []ItemItemIssuesItemLabelsPostRequestBodyMember3able)() { + m.labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3 = value +} +// SetLabelsPostRequestBodyString sets the string property value. Composed type representation for type string +func (m *LabelsPostRequestBody) SetLabelsPostRequestBodyString(value *string)() { + m.labelsPostRequestBodyString = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *LabelsPostRequestBody) SetString(value *string)() { + m.string = value +} +// LabelsPutRequestBody composed type wrapper for classes ItemItemIssuesItemLabelsPutRequestBodyMember1able, ItemItemIssuesItemLabelsPutRequestBodyMember2able, string, []ItemItemIssuesItemLabelsPutRequestBodyMember3able +type LabelsPutRequestBody struct { + // Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember1able + itemItemIssuesItemLabelsPutRequestBodyMember1 ItemItemIssuesItemLabelsPutRequestBodyMember1able + // Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember2able + itemItemIssuesItemLabelsPutRequestBodyMember2 ItemItemIssuesItemLabelsPutRequestBodyMember2able + // Composed type representation for type []ItemItemIssuesItemLabelsPutRequestBodyMember3able + itemItemIssuesItemLabelsPutRequestBodyMember3 []ItemItemIssuesItemLabelsPutRequestBodyMember3able + // Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember1able + labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1 ItemItemIssuesItemLabelsPutRequestBodyMember1able + // Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember2able + labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2 ItemItemIssuesItemLabelsPutRequestBodyMember2able + // Composed type representation for type []ItemItemIssuesItemLabelsPutRequestBodyMember3able + labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3 []ItemItemIssuesItemLabelsPutRequestBodyMember3able + // Composed type representation for type string + labelsPutRequestBodyString *string + // Composed type representation for type string + string *string +} +// NewLabelsPutRequestBody instantiates a new LabelsPutRequestBody and sets the default values. +func NewLabelsPutRequestBody()(*LabelsPutRequestBody) { + m := &LabelsPutRequestBody{ + } + return m +} +// CreateLabelsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabelsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewLabelsPutRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetLabelsPutRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } else if val, err := parseNode.GetCollectionOfObjectValues(CreateItemItemIssuesItemLabelsPutRequestBodyMember3FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]ItemItemIssuesItemLabelsPutRequestBodyMember3able, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(ItemItemIssuesItemLabelsPutRequestBodyMember3able) + } + } + result.SetItemItemIssuesItemLabelsPutRequestBodyMember3(cast) + } else if val, err := parseNode.GetCollectionOfObjectValues(CreateItemItemIssuesItemLabelsPutRequestBodyMember3FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]ItemItemIssuesItemLabelsPutRequestBodyMember3able, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(ItemItemIssuesItemLabelsPutRequestBodyMember3able) + } + } + result.SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3(cast) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LabelsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *LabelsPutRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemIssuesItemLabelsPutRequestBodyMember1 gets the ItemItemIssuesItemLabelsPutRequestBodyMember1 property value. Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember1able +// returns a ItemItemIssuesItemLabelsPutRequestBodyMember1able when successful +func (m *LabelsPutRequestBody) GetItemItemIssuesItemLabelsPutRequestBodyMember1()(ItemItemIssuesItemLabelsPutRequestBodyMember1able) { + return m.itemItemIssuesItemLabelsPutRequestBodyMember1 +} +// GetItemItemIssuesItemLabelsPutRequestBodyMember2 gets the ItemItemIssuesItemLabelsPutRequestBodyMember2 property value. Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember2able +// returns a ItemItemIssuesItemLabelsPutRequestBodyMember2able when successful +func (m *LabelsPutRequestBody) GetItemItemIssuesItemLabelsPutRequestBodyMember2()(ItemItemIssuesItemLabelsPutRequestBodyMember2able) { + return m.itemItemIssuesItemLabelsPutRequestBodyMember2 +} +// GetItemItemIssuesItemLabelsPutRequestBodyMember3 gets the ItemItemIssuesItemLabelsPutRequestBodyMember3 property value. Composed type representation for type []ItemItemIssuesItemLabelsPutRequestBodyMember3able +// returns a []ItemItemIssuesItemLabelsPutRequestBodyMember3able when successful +func (m *LabelsPutRequestBody) GetItemItemIssuesItemLabelsPutRequestBodyMember3()([]ItemItemIssuesItemLabelsPutRequestBodyMember3able) { + return m.itemItemIssuesItemLabelsPutRequestBodyMember3 +} +// GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1 gets the ItemItemIssuesItemLabelsPutRequestBodyMember1 property value. Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember1able +// returns a ItemItemIssuesItemLabelsPutRequestBodyMember1able when successful +func (m *LabelsPutRequestBody) GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1()(ItemItemIssuesItemLabelsPutRequestBodyMember1able) { + return m.labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1 +} +// GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2 gets the ItemItemIssuesItemLabelsPutRequestBodyMember2 property value. Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember2able +// returns a ItemItemIssuesItemLabelsPutRequestBodyMember2able when successful +func (m *LabelsPutRequestBody) GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2()(ItemItemIssuesItemLabelsPutRequestBodyMember2able) { + return m.labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2 +} +// GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3 gets the ItemItemIssuesItemLabelsPutRequestBodyMember3 property value. Composed type representation for type []ItemItemIssuesItemLabelsPutRequestBodyMember3able +// returns a []ItemItemIssuesItemLabelsPutRequestBodyMember3able when successful +func (m *LabelsPutRequestBody) GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3()([]ItemItemIssuesItemLabelsPutRequestBodyMember3able) { + return m.labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3 +} +// GetLabelsPutRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *LabelsPutRequestBody) GetLabelsPutRequestBodyString()(*string) { + return m.labelsPutRequestBodyString +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *LabelsPutRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *LabelsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemIssuesItemLabelsPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemIssuesItemLabelsPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemIssuesItemLabelsPutRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetItemItemIssuesItemLabelsPutRequestBodyMember2()) + if err != nil { + return err + } + } else if m.GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2()) + if err != nil { + return err + } + } else if m.GetLabelsPutRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetLabelsPutRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetItemItemIssuesItemLabelsPutRequestBodyMember3() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItemItemIssuesItemLabelsPutRequestBodyMember3())) + for i, v := range m.GetItemItemIssuesItemLabelsPutRequestBodyMember3() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } else if m.GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3())) + for i, v := range m.GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } + return nil +} +// SetItemItemIssuesItemLabelsPutRequestBodyMember1 sets the ItemItemIssuesItemLabelsPutRequestBodyMember1 property value. Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember1able +func (m *LabelsPutRequestBody) SetItemItemIssuesItemLabelsPutRequestBodyMember1(value ItemItemIssuesItemLabelsPutRequestBodyMember1able)() { + m.itemItemIssuesItemLabelsPutRequestBodyMember1 = value +} +// SetItemItemIssuesItemLabelsPutRequestBodyMember2 sets the ItemItemIssuesItemLabelsPutRequestBodyMember2 property value. Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember2able +func (m *LabelsPutRequestBody) SetItemItemIssuesItemLabelsPutRequestBodyMember2(value ItemItemIssuesItemLabelsPutRequestBodyMember2able)() { + m.itemItemIssuesItemLabelsPutRequestBodyMember2 = value +} +// SetItemItemIssuesItemLabelsPutRequestBodyMember3 sets the ItemItemIssuesItemLabelsPutRequestBodyMember3 property value. Composed type representation for type []ItemItemIssuesItemLabelsPutRequestBodyMember3able +func (m *LabelsPutRequestBody) SetItemItemIssuesItemLabelsPutRequestBodyMember3(value []ItemItemIssuesItemLabelsPutRequestBodyMember3able)() { + m.itemItemIssuesItemLabelsPutRequestBodyMember3 = value +} +// SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1 sets the ItemItemIssuesItemLabelsPutRequestBodyMember1 property value. Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember1able +func (m *LabelsPutRequestBody) SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1(value ItemItemIssuesItemLabelsPutRequestBodyMember1able)() { + m.labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1 = value +} +// SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2 sets the ItemItemIssuesItemLabelsPutRequestBodyMember2 property value. Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember2able +func (m *LabelsPutRequestBody) SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2(value ItemItemIssuesItemLabelsPutRequestBodyMember2able)() { + m.labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2 = value +} +// SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3 sets the ItemItemIssuesItemLabelsPutRequestBodyMember3 property value. Composed type representation for type []ItemItemIssuesItemLabelsPutRequestBodyMember3able +func (m *LabelsPutRequestBody) SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3(value []ItemItemIssuesItemLabelsPutRequestBodyMember3able)() { + m.labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3 = value +} +// SetLabelsPutRequestBodyString sets the string property value. Composed type representation for type string +func (m *LabelsPutRequestBody) SetLabelsPutRequestBodyString(value *string)() { + m.labelsPutRequestBodyString = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *LabelsPutRequestBody) SetString(value *string)() { + m.string = value +} +type LabelsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemIssuesItemLabelsPostRequestBodyMember1()(ItemItemIssuesItemLabelsPostRequestBodyMember1able) + GetItemItemIssuesItemLabelsPostRequestBodyMember2()(ItemItemIssuesItemLabelsPostRequestBodyMember2able) + GetItemItemIssuesItemLabelsPostRequestBodyMember3()([]ItemItemIssuesItemLabelsPostRequestBodyMember3able) + GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1()(ItemItemIssuesItemLabelsPostRequestBodyMember1able) + GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2()(ItemItemIssuesItemLabelsPostRequestBodyMember2able) + GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3()([]ItemItemIssuesItemLabelsPostRequestBodyMember3able) + GetLabelsPostRequestBodyString()(*string) + GetString()(*string) + SetItemItemIssuesItemLabelsPostRequestBodyMember1(value ItemItemIssuesItemLabelsPostRequestBodyMember1able)() + SetItemItemIssuesItemLabelsPostRequestBodyMember2(value ItemItemIssuesItemLabelsPostRequestBodyMember2able)() + SetItemItemIssuesItemLabelsPostRequestBodyMember3(value []ItemItemIssuesItemLabelsPostRequestBodyMember3able)() + SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1(value ItemItemIssuesItemLabelsPostRequestBodyMember1able)() + SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2(value ItemItemIssuesItemLabelsPostRequestBodyMember2able)() + SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3(value []ItemItemIssuesItemLabelsPostRequestBodyMember3able)() + SetLabelsPostRequestBodyString(value *string)() + SetString(value *string)() +} +type LabelsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemIssuesItemLabelsPutRequestBodyMember1()(ItemItemIssuesItemLabelsPutRequestBodyMember1able) + GetItemItemIssuesItemLabelsPutRequestBodyMember2()(ItemItemIssuesItemLabelsPutRequestBodyMember2able) + GetItemItemIssuesItemLabelsPutRequestBodyMember3()([]ItemItemIssuesItemLabelsPutRequestBodyMember3able) + GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1()(ItemItemIssuesItemLabelsPutRequestBodyMember1able) + GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2()(ItemItemIssuesItemLabelsPutRequestBodyMember2able) + GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3()([]ItemItemIssuesItemLabelsPutRequestBodyMember3able) + GetLabelsPutRequestBodyString()(*string) + GetString()(*string) + SetItemItemIssuesItemLabelsPutRequestBodyMember1(value ItemItemIssuesItemLabelsPutRequestBodyMember1able)() + SetItemItemIssuesItemLabelsPutRequestBodyMember2(value ItemItemIssuesItemLabelsPutRequestBodyMember2able)() + SetItemItemIssuesItemLabelsPutRequestBodyMember3(value []ItemItemIssuesItemLabelsPutRequestBodyMember3able)() + SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1(value ItemItemIssuesItemLabelsPutRequestBodyMember1able)() + SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2(value ItemItemIssuesItemLabelsPutRequestBodyMember2able)() + SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3(value []ItemItemIssuesItemLabelsPutRequestBodyMember3able)() + SetLabelsPutRequestBodyString(value *string)() + SetString(value *string)() +} +// ByName gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.issues.item.labels.item collection +// returns a *ItemItemIssuesItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemItemIssuesItemLabelsRequestBuilder) ByName(name string)(*ItemItemIssuesItemLabelsWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewItemItemIssuesItemLabelsWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemIssuesItemLabelsRequestBuilderInternal instantiates a new ItemItemIssuesItemLabelsRequestBuilder and sets the default values. +func NewItemItemIssuesItemLabelsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemLabelsRequestBuilder) { + m := &ItemItemIssuesItemLabelsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/labels{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemIssuesItemLabelsRequestBuilder instantiates a new ItemItemIssuesItemLabelsRequestBuilder and sets the default values. +func NewItemItemIssuesItemLabelsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemLabelsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemLabelsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes all labels from an issue. +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue +func (m *ItemItemIssuesItemLabelsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get lists all labels for an issue. +// returns a []Labelable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue +func (m *ItemItemIssuesItemLabelsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemLabelsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateLabelFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable) + } + } + return val, nil +} +// Post adds labels to an issue. If you provide an empty array of labels, all labels are removed from the issue. +// returns a []Labelable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue +func (m *ItemItemIssuesItemLabelsRequestBuilder) Post(ctx context.Context, body LabelsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateLabelFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable) + } + } + return val, nil +} +// Put removes any previous labels and sets the new labels for an issue. +// returns a []Labelable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue +func (m *ItemItemIssuesItemLabelsRequestBuilder) Put(ctx context.Context, body LabelsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateLabelFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable) + } + } + return val, nil +} +// ToDeleteRequestInformation removes all labels from an issue. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemLabelsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation lists all labels for an issue. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemLabelsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemLabelsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation adds labels to an issue. If you provide an empty array of labels, all labels are removed from the issue. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemLabelsRequestBuilder) ToPostRequestInformation(ctx context.Context, body LabelsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPutRequestInformation removes any previous labels and sets the new labels for an issue. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemLabelsRequestBuilder) ToPutRequestInformation(ctx context.Context, body LabelsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesItemLabelsRequestBuilder when successful +func (m *ItemItemIssuesItemLabelsRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemLabelsRequestBuilder) { + return NewItemItemIssuesItemLabelsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_with_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_with_name_item_request_builder.go new file mode 100644 index 000000000..91a72f024 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_labels_with_name_item_request_builder.go @@ -0,0 +1,66 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemIssuesItemLabelsWithNameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\labels\{name} +type ItemItemIssuesItemLabelsWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemIssuesItemLabelsWithNameItemRequestBuilderInternal instantiates a new ItemItemIssuesItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemItemIssuesItemLabelsWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemLabelsWithNameItemRequestBuilder) { + m := &ItemItemIssuesItemLabelsWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/labels/{name}", pathParameters), + } + return m +} +// NewItemItemIssuesItemLabelsWithNameItemRequestBuilder instantiates a new ItemItemIssuesItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemItemIssuesItemLabelsWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemLabelsWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemLabelsWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist. +// returns a []Labelable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue +func (m *ItemItemIssuesItemLabelsWithNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateLabelFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable) + } + } + return val, nil +} +// ToDeleteRequestInformation removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemLabelsWithNameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemItemIssuesItemLabelsWithNameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemLabelsWithNameItemRequestBuilder) { + return NewItemItemIssuesItemLabelsWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_lock_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_lock_put_request_body.go new file mode 100644 index 000000000..9a8d2dbe0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_lock_put_request_body.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLockPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemIssuesItemLockPutRequestBody instantiates a new ItemItemIssuesItemLockPutRequestBody and sets the default values. +func NewItemItemIssuesItemLockPutRequestBody()(*ItemItemIssuesItemLockPutRequestBody) { + m := &ItemItemIssuesItemLockPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLockPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLockPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLockPutRequestBody(), 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 *ItemItemIssuesItemLockPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemLockPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemLockPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemIssuesItemLockPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemIssuesItemLockPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_lock_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_lock_request_builder.go new file mode 100644 index 000000000..9e0a3a313 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_lock_request_builder.go @@ -0,0 +1,96 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemIssuesItemLockRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\lock +type ItemItemIssuesItemLockRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemIssuesItemLockRequestBuilderInternal instantiates a new ItemItemIssuesItemLockRequestBuilder and sets the default values. +func NewItemItemIssuesItemLockRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemLockRequestBuilder) { + m := &ItemItemIssuesItemLockRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/lock", pathParameters), + } + return m +} +// NewItemItemIssuesItemLockRequestBuilder instantiates a new ItemItemIssuesItemLockRequestBuilder and sets the default values. +func NewItemItemIssuesItemLockRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemLockRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemLockRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete users with push access can unlock an issue's conversation. +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/issues#unlock-an-issue +func (m *ItemItemIssuesItemLockRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put users with push access can lock an issue or pull request's conversation.Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/issues#lock-an-issue +func (m *ItemItemIssuesItemLockRequestBuilder) Put(ctx context.Context, body ItemItemIssuesItemLockPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation users with push access can unlock an issue's conversation. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemLockRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation users with push access can lock an issue or pull request's conversation.Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemLockRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemIssuesItemLockPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesItemLockRequestBuilder when successful +func (m *ItemItemIssuesItemLockRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemLockRequestBuilder) { + return NewItemItemIssuesItemLockRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_reactions_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_reactions_post_request_body.go new file mode 100644 index 000000000..f0d000245 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemIssuesItemReactionsPostRequestBody instantiates a new ItemItemIssuesItemReactionsPostRequestBody and sets the default values. +func NewItemItemIssuesItemReactionsPostRequestBody()(*ItemItemIssuesItemReactionsPostRequestBody) { + m := &ItemItemIssuesItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemReactionsPostRequestBody(), 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 *ItemItemIssuesItemReactionsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemReactionsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemReactionsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemIssuesItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemIssuesItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_reactions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_reactions_request_builder.go new file mode 100644 index 000000000..da00dd3d1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_reactions_request_builder.go @@ -0,0 +1,122 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i23dfc4d3062a1aeb05c0a81c841e05d19316f4891ddc2aeb575a550bc4053b96 "github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/item/reactions" +) + +// ItemItemIssuesItemReactionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\reactions +type ItemItemIssuesItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesItemReactionsRequestBuilderGetQueryParameters list the reactions to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). +type ItemItemIssuesItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to an issue. + Content *i23dfc4d3062a1aeb05c0a81c841e05d19316f4891ddc2aeb575a550bc4053b96.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByReaction_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.issues.item.reactions.item collection +// returns a *ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemIssuesItemReactionsRequestBuilder) ByReaction_id(reaction_id int32)(*ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["reaction_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(reaction_id), 10) + return NewItemItemIssuesItemReactionsWithReaction_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemIssuesItemReactionsRequestBuilderInternal instantiates a new ItemItemIssuesItemReactionsRequestBuilder and sets the default values. +func NewItemItemIssuesItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemReactionsRequestBuilder) { + m := &ItemItemIssuesItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemIssuesItemReactionsRequestBuilder instantiates a new ItemItemIssuesItemReactionsRequestBuilder and sets the default values. +func NewItemItemIssuesItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the reactions to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). +// returns a []Reactionable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue +func (m *ItemItemIssuesItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemReactionsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable) + } + } + return val, nil +} +// Post create a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). A response with an HTTP `200` status means that you already added the reaction type to this issue. +// returns a Reactionable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue +func (m *ItemItemIssuesItemReactionsRequestBuilder) Post(ctx context.Context, body ItemItemIssuesItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable), nil +} +// ToGetRequestInformation list the reactions to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemReactionsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation create a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). A response with an HTTP `200` status means that you already added the reaction type to this issue. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemIssuesItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesItemReactionsRequestBuilder when successful +func (m *ItemItemIssuesItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemReactionsRequestBuilder) { + return NewItemItemIssuesItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_reactions_with_reaction_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_reactions_with_reaction_item_request_builder.go new file mode 100644 index 000000000..cc2a264a1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_reactions_with_reaction_item_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\reactions\{reaction_id} +type ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemIssuesItemReactionsWithReaction_ItemRequestBuilderInternal instantiates a new ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemIssuesItemReactionsWithReaction_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder) { + m := &ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/reactions/{reaction_id}", pathParameters), + } + return m +} +// NewItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder instantiates a new ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemReactionsWithReaction_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`.Delete a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction +func (m *ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`.Delete a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder) { + return NewItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_timeline_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_timeline_request_builder.go new file mode 100644 index 000000000..5f50f8492 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_timeline_request_builder.go @@ -0,0 +1,73 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemIssuesItemTimelineRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\timeline +type ItemItemIssuesItemTimelineRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesItemTimelineRequestBuilderGetQueryParameters list all timeline events for an issue. +type ItemItemIssuesItemTimelineRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemIssuesItemTimelineRequestBuilderInternal instantiates a new ItemItemIssuesItemTimelineRequestBuilder and sets the default values. +func NewItemItemIssuesItemTimelineRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemTimelineRequestBuilder) { + m := &ItemItemIssuesItemTimelineRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/timeline{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemIssuesItemTimelineRequestBuilder instantiates a new ItemItemIssuesItemTimelineRequestBuilder and sets the default values. +func NewItemItemIssuesItemTimelineRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemTimelineRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemTimelineRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all timeline events for an issue. +// returns a []TimelineIssueEventsable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue +func (m *ItemItemIssuesItemTimelineRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemTimelineRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TimelineIssueEventsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTimelineIssueEventsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TimelineIssueEventsable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TimelineIssueEventsable) + } + } + return val, nil +} +// ToGetRequestInformation list all timeline events for an issue. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemTimelineRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemTimelineRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesItemTimelineRequestBuilder when successful +func (m *ItemItemIssuesItemTimelineRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemTimelineRequestBuilder) { + return NewItemItemIssuesItemTimelineRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_with_issue_number_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_with_issue_number_patch_request_body.go new file mode 100644 index 000000000..237c669b3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_item_with_issue_number_patch_request_body.go @@ -0,0 +1,425 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemWithIssue_numberPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Username to assign to this issue. **This field is deprecated.** + assignee *string + // Usernames to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this issue. Send an empty array (`[]`) to clear all assignees from the issue. Only users with push access can set assignees for new issues. Without push access to the repository, assignee changes are silently dropped. + assignees []string + // The contents of the issue. + body *string + // Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped. + labels []string + // The milestone property + milestone ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneable + // The title of the issue. + title ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleable +} +// ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone composed type wrapper for classes int32, string +type ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone struct { + // Composed type representation for type int32 + integer *int32 + // Composed type representation for type string + string *string +} +// NewItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone instantiates a new ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone and sets the default values. +func NewItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone()(*ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone) { + m := &ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone{ + } + return m +} +// CreateItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetInt32Value(); val != nil { + if err != nil { + return nil, err + } + result.SetInteger(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetInteger gets the integer property value. Composed type representation for type int32 +// returns a *int32 when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone) GetInteger()(*int32) { + return m.integer +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInteger() != nil { + err := writer.WriteInt32Value("", m.GetInteger()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetInteger sets the integer property value. Composed type representation for type int32 +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone) SetInteger(value *int32)() { + m.integer = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone) SetString(value *string)() { + m.string = value +} +// ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title composed type wrapper for classes int32, string +type ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title struct { + // Composed type representation for type int32 + integer *int32 + // Composed type representation for type string + string *string +} +// NewItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title instantiates a new ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title and sets the default values. +func NewItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title()(*ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title) { + m := &ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title{ + } + return m +} +// CreateItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetInt32Value(); val != nil { + if err != nil { + return nil, err + } + result.SetInteger(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetInteger gets the integer property value. Composed type representation for type int32 +// returns a *int32 when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title) GetInteger()(*int32) { + return m.integer +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInteger() != nil { + err := writer.WriteInt32Value("", m.GetInteger()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetInteger sets the integer property value. Composed type representation for type int32 +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title) SetInteger(value *int32)() { + m.integer = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title) SetString(value *string)() { + m.string = value +} +type ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInteger()(*int32) + GetString()(*string) + SetInteger(value *int32)() + SetString(value *string)() +} +type ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInteger()(*int32) + GetString()(*string) + SetInteger(value *int32)() + SetString(value *string)() +} +// NewItemItemIssuesItemWithIssue_numberPatchRequestBody instantiates a new ItemItemIssuesItemWithIssue_numberPatchRequestBody and sets the default values. +func NewItemItemIssuesItemWithIssue_numberPatchRequestBody()(*ItemItemIssuesItemWithIssue_numberPatchRequestBody) { + m := &ItemItemIssuesItemWithIssue_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemWithIssue_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemWithIssue_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemWithIssue_numberPatchRequestBody(), 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 *ItemItemIssuesItemWithIssue_numberPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. Username to assign to this issue. **This field is deprecated.** +// returns a *string when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) GetAssignee()(*string) { + return m.assignee +} +// GetAssignees gets the assignees property value. Usernames to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this issue. Send an empty array (`[]`) to clear all assignees from the issue. Only users with push access can set assignees for new issues. Without push access to the repository, assignee changes are silently dropped. +// returns a []string when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) GetAssignees()([]string) { + return m.assignees +} +// GetBody gets the body property value. The contents of the issue. +// returns a *string when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val) + } + return nil + } + res["assignees"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetAssignees(res) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetLabels(res) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneable)) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTitle(val.(ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleable)) + } + return nil + } + return res +} +// GetLabels gets the labels property value. Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped. +// returns a []string when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) GetLabels()([]string) { + return m.labels +} +// GetMilestone gets the milestone property value. The milestone property +// returns a ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneable when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) GetMilestone()(ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneable) { + return m.milestone +} +// GetTitle gets the title property value. The title of the issue. +// returns a ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleable when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) GetTitle()(ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleable) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + if m.GetAssignees() != nil { + err := writer.WriteCollectionOfStringValues("assignees", m.GetAssignees()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("title", m.GetTitle()) + 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 *ItemItemIssuesItemWithIssue_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. Username to assign to this issue. **This field is deprecated.** +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) SetAssignee(value *string)() { + m.assignee = value +} +// SetAssignees sets the assignees property value. Usernames to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this issue. Send an empty array (`[]`) to clear all assignees from the issue. Only users with push access can set assignees for new issues. Without push access to the repository, assignee changes are silently dropped. +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) SetAssignees(value []string)() { + m.assignees = value +} +// SetBody sets the body property value. The contents of the issue. +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) SetBody(value *string)() { + m.body = value +} +// SetLabels sets the labels property value. Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped. +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) SetLabels(value []string)() { + m.labels = value +} +// SetMilestone sets the milestone property value. The milestone property +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) SetMilestone(value ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneable)() { + m.milestone = value +} +// SetTitle sets the title property value. The title of the issue. +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) SetTitle(value ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleable)() { + m.title = value +} +type ItemItemIssuesItemWithIssue_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssignee()(*string) + GetAssignees()([]string) + GetBody()(*string) + GetLabels()([]string) + GetMilestone()(ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneable) + GetTitle()(ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleable) + SetAssignee(value *string)() + SetAssignees(value []string)() + SetBody(value *string)() + SetLabels(value []string)() + SetMilestone(value ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneable)() + SetTitle(value ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_post_request_body.go new file mode 100644 index 000000000..cb5064276 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_post_request_body.go @@ -0,0 +1,425 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is deprecated.**_ + assignee *string + // Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ + assignees []string + // The contents of the issue. + body *string + // Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ + labels []string + // The milestone property + milestone ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneable + // The title of the issue. + title ItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleable +} +// ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone composed type wrapper for classes int32, string +type ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone struct { + // Composed type representation for type int32 + integer *int32 + // Composed type representation for type string + string *string +} +// NewItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone instantiates a new ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone and sets the default values. +func NewItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone()(*ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone) { + m := &ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone{ + } + return m +} +// CreateItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetInt32Value(); val != nil { + if err != nil { + return nil, err + } + result.SetInteger(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetInteger gets the integer property value. Composed type representation for type int32 +// returns a *int32 when successful +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone) GetInteger()(*int32) { + return m.integer +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInteger() != nil { + err := writer.WriteInt32Value("", m.GetInteger()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetInteger sets the integer property value. Composed type representation for type int32 +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone) SetInteger(value *int32)() { + m.integer = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone) SetString(value *string)() { + m.string = value +} +// ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title composed type wrapper for classes int32, string +type ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title struct { + // Composed type representation for type int32 + integer *int32 + // Composed type representation for type string + string *string +} +// NewItemItemIssuesPostRequestBody_IssuesPostRequestBody_title instantiates a new ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title and sets the default values. +func NewItemItemIssuesPostRequestBody_IssuesPostRequestBody_title()(*ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title) { + m := &ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title{ + } + return m +} +// CreateItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewItemItemIssuesPostRequestBody_IssuesPostRequestBody_title() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetInt32Value(); val != nil { + if err != nil { + return nil, err + } + result.SetInteger(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetInteger gets the integer property value. Composed type representation for type int32 +// returns a *int32 when successful +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title) GetInteger()(*int32) { + return m.integer +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInteger() != nil { + err := writer.WriteInt32Value("", m.GetInteger()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetInteger sets the integer property value. Composed type representation for type int32 +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title) SetInteger(value *int32)() { + m.integer = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title) SetString(value *string)() { + m.string = value +} +type ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInteger()(*int32) + GetString()(*string) + SetInteger(value *int32)() + SetString(value *string)() +} +type ItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInteger()(*int32) + GetString()(*string) + SetInteger(value *int32)() + SetString(value *string)() +} +// NewItemItemIssuesPostRequestBody instantiates a new ItemItemIssuesPostRequestBody and sets the default values. +func NewItemItemIssuesPostRequestBody()(*ItemItemIssuesPostRequestBody) { + m := &ItemItemIssuesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesPostRequestBody(), 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 *ItemItemIssuesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is deprecated.**_ +// returns a *string when successful +func (m *ItemItemIssuesPostRequestBody) GetAssignee()(*string) { + return m.assignee +} +// GetAssignees gets the assignees property value. Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ +// returns a []string when successful +func (m *ItemItemIssuesPostRequestBody) GetAssignees()([]string) { + return m.assignees +} +// GetBody gets the body property value. The contents of the issue. +// returns a *string when successful +func (m *ItemItemIssuesPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val) + } + return nil + } + res["assignees"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetAssignees(res) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetLabels(res) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneable)) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTitle(val.(ItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleable)) + } + return nil + } + return res +} +// GetLabels gets the labels property value. Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ +// returns a []string when successful +func (m *ItemItemIssuesPostRequestBody) GetLabels()([]string) { + return m.labels +} +// GetMilestone gets the milestone property value. The milestone property +// returns a ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneable when successful +func (m *ItemItemIssuesPostRequestBody) GetMilestone()(ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneable) { + return m.milestone +} +// GetTitle gets the title property value. The title of the issue. +// returns a ItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleable when successful +func (m *ItemItemIssuesPostRequestBody) GetTitle()(ItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleable) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemItemIssuesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + if m.GetAssignees() != nil { + err := writer.WriteCollectionOfStringValues("assignees", m.GetAssignees()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("title", m.GetTitle()) + 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 *ItemItemIssuesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is deprecated.**_ +func (m *ItemItemIssuesPostRequestBody) SetAssignee(value *string)() { + m.assignee = value +} +// SetAssignees sets the assignees property value. Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ +func (m *ItemItemIssuesPostRequestBody) SetAssignees(value []string)() { + m.assignees = value +} +// SetBody sets the body property value. The contents of the issue. +func (m *ItemItemIssuesPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetLabels sets the labels property value. Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ +func (m *ItemItemIssuesPostRequestBody) SetLabels(value []string)() { + m.labels = value +} +// SetMilestone sets the milestone property value. The milestone property +func (m *ItemItemIssuesPostRequestBody) SetMilestone(value ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneable)() { + m.milestone = value +} +// SetTitle sets the title property value. The title of the issue. +func (m *ItemItemIssuesPostRequestBody) SetTitle(value ItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleable)() { + m.title = value +} +type ItemItemIssuesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssignee()(*string) + GetAssignees()([]string) + GetBody()(*string) + GetLabels()([]string) + GetMilestone()(ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneable) + GetTitle()(ItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleable) + SetAssignee(value *string)() + SetAssignees(value []string)() + SetBody(value *string)() + SetLabels(value []string)() + SetMilestone(value ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneable)() + SetTitle(value ItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_request_builder.go new file mode 100644 index 000000000..bf1b2de47 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_request_builder.go @@ -0,0 +1,159 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i787c2810dc1fca202084462fd425cb4203e935ffcb1f365e1aa1ff3aabf406d4 "github.com/octokit/go-sdk/pkg/github/repos/item/item/issues" +) + +// ItemItemIssuesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues +type ItemItemIssuesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesRequestBuilderGetQueryParameters list issues in a repository. Only open issues will be listed.**Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For thisreason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests bythe `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pullrequest id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemIssuesRequestBuilderGetQueryParameters struct { + // Can be the name of a user. Pass in `none` for issues with no assigned user, and `*` for issues assigned to any user. + Assignee *string `uriparametername:"assignee"` + // The user that created the issue. + Creator *string `uriparametername:"creator"` + // The direction to sort the results by. + Direction *i787c2810dc1fca202084462fd425cb4203e935ffcb1f365e1aa1ff3aabf406d4.GetDirectionQueryParameterType `uriparametername:"direction"` + // A list of comma separated label names. Example: `bug,ui,@high` + Labels *string `uriparametername:"labels"` + // A user that's mentioned in the issue. + Mentioned *string `uriparametername:"mentioned"` + // If an `integer` is passed, it should refer to a milestone by its `number` field. If the string `*` is passed, issues with any milestone are accepted. If the string `none` is passed, issues without milestones are returned. + Milestone *string `uriparametername:"milestone"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + // What to sort results by. + Sort *i787c2810dc1fca202084462fd425cb4203e935ffcb1f365e1aa1ff3aabf406d4.GetSortQueryParameterType `uriparametername:"sort"` + // Indicates the state of the issues to return. + State *i787c2810dc1fca202084462fd425cb4203e935ffcb1f365e1aa1ff3aabf406d4.GetStateQueryParameterType `uriparametername:"state"` +} +// ByIssue_number gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.issues.item collection +// returns a *ItemItemIssuesWithIssue_numberItemRequestBuilder when successful +func (m *ItemItemIssuesRequestBuilder) ByIssue_number(issue_number int32)(*ItemItemIssuesWithIssue_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["issue_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(issue_number), 10) + return NewItemItemIssuesWithIssue_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +// returns a *ItemItemIssuesCommentsRequestBuilder when successful +func (m *ItemItemIssuesRequestBuilder) Comments()(*ItemItemIssuesCommentsRequestBuilder) { + return NewItemItemIssuesCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemIssuesRequestBuilderInternal instantiates a new ItemItemIssuesRequestBuilder and sets the default values. +func NewItemItemIssuesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesRequestBuilder) { + m := &ItemItemIssuesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues{?assignee*,creator*,direction*,labels*,mentioned*,milestone*,page*,per_page*,since*,sort*,state*}", pathParameters), + } + return m +} +// NewItemItemIssuesRequestBuilder instantiates a new ItemItemIssuesRequestBuilder and sets the default values. +func NewItemItemIssuesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesRequestBuilderInternal(urlParams, requestAdapter) +} +// Events the events property +// returns a *ItemItemIssuesEventsRequestBuilder when successful +func (m *ItemItemIssuesRequestBuilder) Events()(*ItemItemIssuesEventsRequestBuilder) { + return NewItemItemIssuesEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get list issues in a repository. Only open issues will be listed.**Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For thisreason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests bythe `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pullrequest id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []Issueable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/issues#list-repository-issues +func (m *ItemItemIssuesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable) + } + } + return val, nil +} +// Post any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://docs.github.com/articles/disabling-issues/), the API returns a `410 Gone` status.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a Issueable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a Issue503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/issues#create-an-issue +func (m *ItemItemIssuesRequestBuilder) Post(ctx context.Context, body ItemItemIssuesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssue503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable), nil +} +// ToGetRequestInformation list issues in a repository. Only open issues will be listed.**Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For thisreason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests bythe `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pullrequest id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://docs.github.com/articles/disabling-issues/), the API returns a `410 Gone` status.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemIssuesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesRequestBuilder when successful +func (m *ItemItemIssuesRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesRequestBuilder) { + return NewItemItemIssuesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_with_issue_number_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_with_issue_number_item_request_builder.go new file mode 100644 index 000000000..a9cc5694e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_issues_with_issue_number_item_request_builder.go @@ -0,0 +1,141 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemIssuesWithIssue_numberItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number} +type ItemItemIssuesWithIssue_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Assignees the assignees property +// returns a *ItemItemIssuesItemAssigneesRequestBuilder when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Assignees()(*ItemItemIssuesItemAssigneesRequestBuilder) { + return NewItemItemIssuesItemAssigneesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +// returns a *ItemItemIssuesItemCommentsRequestBuilder when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Comments()(*ItemItemIssuesItemCommentsRequestBuilder) { + return NewItemItemIssuesItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemIssuesWithIssue_numberItemRequestBuilderInternal instantiates a new ItemItemIssuesWithIssue_numberItemRequestBuilder and sets the default values. +func NewItemItemIssuesWithIssue_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesWithIssue_numberItemRequestBuilder) { + m := &ItemItemIssuesWithIssue_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}", pathParameters), + } + return m +} +// NewItemItemIssuesWithIssue_numberItemRequestBuilder instantiates a new ItemItemIssuesWithIssue_numberItemRequestBuilder and sets the default values. +func NewItemItemIssuesWithIssue_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesWithIssue_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesWithIssue_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Events the events property +// returns a *ItemItemIssuesItemEventsRequestBuilder when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Events()(*ItemItemIssuesItemEventsRequestBuilder) { + return NewItemItemIssuesItemEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get the API returns a [`301 Moved Permanently` status](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api#follow-redirects) if the issue was[transferred](https://docs.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. Ifthe issue was transferred to or deleted from a repository where the authenticated user lacks read access, the APIreturns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has readaccess, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribeto the [`issues`](https://docs.github.com/webhooks/event-payloads/#issues) webhook.**Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For thisreason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests bythe `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pullrequest id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a Issueable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/issues#get-an-issue +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable), nil +} +// Labels the labels property +// returns a *ItemItemIssuesItemLabelsRequestBuilder when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Labels()(*ItemItemIssuesItemLabelsRequestBuilder) { + return NewItemItemIssuesItemLabelsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Lock the lock property +// returns a *ItemItemIssuesItemLockRequestBuilder when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Lock()(*ItemItemIssuesItemLockRequestBuilder) { + return NewItemItemIssuesItemLockRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch issue owners and users with push access can edit an issue.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a Issueable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a Issue503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/issues#update-an-issue +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Patch(ctx context.Context, body ItemItemIssuesItemWithIssue_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssue503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable), nil +} +// Reactions the reactions property +// returns a *ItemItemIssuesItemReactionsRequestBuilder when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Reactions()(*ItemItemIssuesItemReactionsRequestBuilder) { + return NewItemItemIssuesItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Timeline the timeline property +// returns a *ItemItemIssuesItemTimelineRequestBuilder when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Timeline()(*ItemItemIssuesItemTimelineRequestBuilder) { + return NewItemItemIssuesItemTimelineRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation the API returns a [`301 Moved Permanently` status](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api#follow-redirects) if the issue was[transferred](https://docs.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. Ifthe issue was transferred to or deleted from a repository where the authenticated user lacks read access, the APIreturns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has readaccess, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribeto the [`issues`](https://docs.github.com/webhooks/event-payloads/#issues) webhook.**Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For thisreason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests bythe `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pullrequest id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation issue owners and users with push access can edit an issue.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemIssuesItemWithIssue_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesWithIssue_numberItemRequestBuilder when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesWithIssue_numberItemRequestBuilder) { + return NewItemItemIssuesWithIssue_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_keys_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_keys_post_request_body.go new file mode 100644 index 000000000..c3e33064b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_keys_post_request_body.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemKeysPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The contents of the key. + key *string + // If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see "[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)" and "[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/)." + read_only *bool + // A name for the key. + title *string +} +// NewItemItemKeysPostRequestBody instantiates a new ItemItemKeysPostRequestBody and sets the default values. +func NewItemItemKeysPostRequestBody()(*ItemItemKeysPostRequestBody) { + m := &ItemItemKeysPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemKeysPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemKeysPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemKeysPostRequestBody(), 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 *ItemItemKeysPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemKeysPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["read_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetReadOnly(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The contents of the key. +// returns a *string when successful +func (m *ItemItemKeysPostRequestBody) GetKey()(*string) { + return m.key +} +// GetReadOnly gets the read_only property value. If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see "[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)" and "[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/)." +// returns a *bool when successful +func (m *ItemItemKeysPostRequestBody) GetReadOnly()(*bool) { + return m.read_only +} +// GetTitle gets the title property value. A name for the key. +// returns a *string when successful +func (m *ItemItemKeysPostRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemItemKeysPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("read_only", m.GetReadOnly()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemItemKeysPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The contents of the key. +func (m *ItemItemKeysPostRequestBody) SetKey(value *string)() { + m.key = value +} +// SetReadOnly sets the read_only property value. If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see "[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)" and "[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/)." +func (m *ItemItemKeysPostRequestBody) SetReadOnly(value *bool)() { + m.read_only = value +} +// SetTitle sets the title property value. A name for the key. +func (m *ItemItemKeysPostRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemItemKeysPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetReadOnly()(*bool) + GetTitle()(*string) + SetKey(value *string)() + SetReadOnly(value *bool)() + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_keys_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_keys_request_builder.go new file mode 100644 index 000000000..360a4e30d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_keys_request_builder.go @@ -0,0 +1,112 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemKeysRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\keys +type ItemItemKeysRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemKeysRequestBuilderGetQueryParameters list deploy keys +type ItemItemKeysRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByKey_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.keys.item collection +// returns a *ItemItemKeysWithKey_ItemRequestBuilder when successful +func (m *ItemItemKeysRequestBuilder) ByKey_id(key_id int32)(*ItemItemKeysWithKey_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["key_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(key_id), 10) + return NewItemItemKeysWithKey_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemKeysRequestBuilderInternal instantiates a new ItemItemKeysRequestBuilder and sets the default values. +func NewItemItemKeysRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemKeysRequestBuilder) { + m := &ItemItemKeysRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/keys{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemKeysRequestBuilder instantiates a new ItemItemKeysRequestBuilder and sets the default values. +func NewItemItemKeysRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemKeysRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemKeysRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list deploy keys +// returns a []DeployKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys +func (m *ItemItemKeysRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemKeysRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeployKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeployKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeployKeyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeployKeyable) + } + } + return val, nil +} +// Post you can create a read-only deploy key. +// returns a DeployKeyable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key +func (m *ItemItemKeysRequestBuilder) Post(ctx context.Context, body ItemItemKeysPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeployKeyable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeployKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeployKeyable), nil +} +// returns a *RequestInformation when successful +func (m *ItemItemKeysRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemKeysRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation you can create a read-only deploy key. +// returns a *RequestInformation when successful +func (m *ItemItemKeysRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemKeysPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemKeysRequestBuilder when successful +func (m *ItemItemKeysRequestBuilder) WithUrl(rawUrl string)(*ItemItemKeysRequestBuilder) { + return NewItemItemKeysRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_keys_with_key_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_keys_with_key_item_request_builder.go new file mode 100644 index 000000000..ed9923769 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_keys_with_key_item_request_builder.go @@ -0,0 +1,82 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemKeysWithKey_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\keys\{key_id} +type ItemItemKeysWithKey_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemKeysWithKey_ItemRequestBuilderInternal instantiates a new ItemItemKeysWithKey_ItemRequestBuilder and sets the default values. +func NewItemItemKeysWithKey_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemKeysWithKey_ItemRequestBuilder) { + m := &ItemItemKeysWithKey_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/keys/{key_id}", pathParameters), + } + return m +} +// NewItemItemKeysWithKey_ItemRequestBuilder instantiates a new ItemItemKeysWithKey_ItemRequestBuilder and sets the default values. +func NewItemItemKeysWithKey_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemKeysWithKey_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemKeysWithKey_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key +func (m *ItemItemKeysWithKey_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get get a deploy key +// returns a DeployKeyable 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/deploy-keys/deploy-keys#get-a-deploy-key +func (m *ItemItemKeysWithKey_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeployKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDeployKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DeployKeyable), nil +} +// ToDeleteRequestInformation deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. +// returns a *RequestInformation when successful +func (m *ItemItemKeysWithKey_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *ItemItemKeysWithKey_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemKeysWithKey_ItemRequestBuilder when successful +func (m *ItemItemKeysWithKey_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemKeysWithKey_ItemRequestBuilder) { + return NewItemItemKeysWithKey_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_labels_item_with_name_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_labels_item_with_name_patch_request_body.go new file mode 100644 index 000000000..3b1e16a59 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_labels_item_with_name_patch_request_body.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemLabelsItemWithNamePatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. + color *string + // A short description of the label. Must be 100 characters or fewer. + description *string + // The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." + new_name *string +} +// NewItemItemLabelsItemWithNamePatchRequestBody instantiates a new ItemItemLabelsItemWithNamePatchRequestBody and sets the default values. +func NewItemItemLabelsItemWithNamePatchRequestBody()(*ItemItemLabelsItemWithNamePatchRequestBody) { + m := &ItemItemLabelsItemWithNamePatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemLabelsItemWithNamePatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemLabelsItemWithNamePatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemLabelsItemWithNamePatchRequestBody(), 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 *ItemItemLabelsItemWithNamePatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. +// returns a *string when successful +func (m *ItemItemLabelsItemWithNamePatchRequestBody) GetColor()(*string) { + return m.color +} +// GetDescription gets the description property value. A short description of the label. Must be 100 characters or fewer. +// returns a *string when successful +func (m *ItemItemLabelsItemWithNamePatchRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemLabelsItemWithNamePatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["new_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNewName(val) + } + return nil + } + return res +} +// GetNewName gets the new_name property value. The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." +// returns a *string when successful +func (m *ItemItemLabelsItemWithNamePatchRequestBody) GetNewName()(*string) { + return m.new_name +} +// Serialize serializes information the current object +func (m *ItemItemLabelsItemWithNamePatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("new_name", m.GetNewName()) + 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 *ItemItemLabelsItemWithNamePatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. +func (m *ItemItemLabelsItemWithNamePatchRequestBody) SetColor(value *string)() { + m.color = value +} +// SetDescription sets the description property value. A short description of the label. Must be 100 characters or fewer. +func (m *ItemItemLabelsItemWithNamePatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetNewName sets the new_name property value. The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." +func (m *ItemItemLabelsItemWithNamePatchRequestBody) SetNewName(value *string)() { + m.new_name = value +} +type ItemItemLabelsItemWithNamePatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetDescription()(*string) + GetNewName()(*string) + SetColor(value *string)() + SetDescription(value *string)() + SetNewName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_labels_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_labels_post_request_body.go new file mode 100644 index 000000000..aced5da37 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_labels_post_request_body.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemLabelsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. + color *string + // A short description of the label. Must be 100 characters or fewer. + description *string + // The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." + name *string +} +// NewItemItemLabelsPostRequestBody instantiates a new ItemItemLabelsPostRequestBody and sets the default values. +func NewItemItemLabelsPostRequestBody()(*ItemItemLabelsPostRequestBody) { + m := &ItemItemLabelsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemLabelsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemLabelsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemLabelsPostRequestBody(), 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 *ItemItemLabelsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. +// returns a *string when successful +func (m *ItemItemLabelsPostRequestBody) GetColor()(*string) { + return m.color +} +// GetDescription gets the description property value. A short description of the label. Must be 100 characters or fewer. +// returns a *string when successful +func (m *ItemItemLabelsPostRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemLabelsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." +// returns a *string when successful +func (m *ItemItemLabelsPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemLabelsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemLabelsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. +func (m *ItemItemLabelsPostRequestBody) SetColor(value *string)() { + m.color = value +} +// SetDescription sets the description property value. A short description of the label. Must be 100 characters or fewer. +func (m *ItemItemLabelsPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetName sets the name property value. The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." +func (m *ItemItemLabelsPostRequestBody) SetName(value *string)() { + m.name = value +} +type ItemItemLabelsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetDescription()(*string) + GetName()(*string) + SetColor(value *string)() + SetDescription(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_labels_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_labels_request_builder.go new file mode 100644 index 000000000..b6f3f83f6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_labels_request_builder.go @@ -0,0 +1,120 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemLabelsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\labels +type ItemItemLabelsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemLabelsRequestBuilderGetQueryParameters lists all labels for a repository. +type ItemItemLabelsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByName gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.labels.item collection +// returns a *ItemItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemItemLabelsRequestBuilder) ByName(name string)(*ItemItemLabelsWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewItemItemLabelsWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemLabelsRequestBuilderInternal instantiates a new ItemItemLabelsRequestBuilder and sets the default values. +func NewItemItemLabelsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLabelsRequestBuilder) { + m := &ItemItemLabelsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/labels{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemLabelsRequestBuilder instantiates a new ItemItemLabelsRequestBuilder and sets the default values. +func NewItemItemLabelsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLabelsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemLabelsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all labels for a repository. +// returns a []Labelable 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/issues/labels#list-labels-for-a-repository +func (m *ItemItemLabelsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemLabelsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateLabelFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable) + } + } + return val, nil +} +// Post creates a label for the specified repository with the given name and color. The name and color parameters are required. The color must be a valid [hexadecimal color code](http://www.color-hex.com/). +// returns a Labelable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/labels#create-a-label +func (m *ItemItemLabelsRequestBuilder) Post(ctx context.Context, body ItemItemLabelsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateLabelFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable), nil +} +// ToGetRequestInformation lists all labels for a repository. +// returns a *RequestInformation when successful +func (m *ItemItemLabelsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemLabelsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a label for the specified repository with the given name and color. The name and color parameters are required. The color must be a valid [hexadecimal color code](http://www.color-hex.com/). +// returns a *RequestInformation when successful +func (m *ItemItemLabelsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemLabelsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemLabelsRequestBuilder when successful +func (m *ItemItemLabelsRequestBuilder) WithUrl(rawUrl string)(*ItemItemLabelsRequestBuilder) { + return NewItemItemLabelsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_labels_with_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_labels_with_name_item_request_builder.go new file mode 100644 index 000000000..154825eb2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_labels_with_name_item_request_builder.go @@ -0,0 +1,114 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemLabelsWithNameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\labels\{name} +type ItemItemLabelsWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemLabelsWithNameItemRequestBuilderInternal instantiates a new ItemItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemItemLabelsWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLabelsWithNameItemRequestBuilder) { + m := &ItemItemLabelsWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/labels/{name}", pathParameters), + } + return m +} +// NewItemItemLabelsWithNameItemRequestBuilder instantiates a new ItemItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemItemLabelsWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLabelsWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemLabelsWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a label using the given label name. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/labels#delete-a-label +func (m *ItemItemLabelsWithNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a label using the given name. +// returns a Labelable 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/issues/labels#get-a-label +func (m *ItemItemLabelsWithNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateLabelFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable), nil +} +// Patch updates a label using the given label name. +// returns a Labelable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/labels#update-a-label +func (m *ItemItemLabelsWithNameItemRequestBuilder) Patch(ctx context.Context, body ItemItemLabelsItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateLabelFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable), nil +} +// ToDeleteRequestInformation deletes a label using the given label name. +// returns a *RequestInformation when successful +func (m *ItemItemLabelsWithNameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a label using the given name. +// returns a *RequestInformation when successful +func (m *ItemItemLabelsWithNameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates a label using the given label name. +// returns a *RequestInformation when successful +func (m *ItemItemLabelsWithNameItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemLabelsItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemItemLabelsWithNameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemLabelsWithNameItemRequestBuilder) { + return NewItemItemLabelsWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_languages_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_languages_request_builder.go new file mode 100644 index 000000000..c232a8dc3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_languages_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemLanguagesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\languages +type ItemItemLanguagesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemLanguagesRequestBuilderInternal instantiates a new ItemItemLanguagesRequestBuilder and sets the default values. +func NewItemItemLanguagesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLanguagesRequestBuilder) { + m := &ItemItemLanguagesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/languages", pathParameters), + } + return m +} +// NewItemItemLanguagesRequestBuilder instantiates a new ItemItemLanguagesRequestBuilder and sets the default values. +func NewItemItemLanguagesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLanguagesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemLanguagesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language. +// returns a Languageable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#list-repository-languages +func (m *ItemItemLanguagesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Languageable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateLanguageFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Languageable), nil +} +// ToGetRequestInformation lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language. +// returns a *RequestInformation when successful +func (m *ItemItemLanguagesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemLanguagesRequestBuilder when successful +func (m *ItemItemLanguagesRequestBuilder) WithUrl(rawUrl string)(*ItemItemLanguagesRequestBuilder) { + return NewItemItemLanguagesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_license_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_license_request_builder.go new file mode 100644 index 000000000..931a321f7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_license_request_builder.go @@ -0,0 +1,66 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemLicenseRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\license +type ItemItemLicenseRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemLicenseRequestBuilderGetQueryParameters this method returns the contents of the repository's license file, if one is detected.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw contents of the license.- **`application/vnd.github.html+json`**: Returns the license contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +type ItemItemLicenseRequestBuilderGetQueryParameters struct { + // The Git reference for the results you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. + Ref *string `uriparametername:"ref"` +} +// NewItemItemLicenseRequestBuilderInternal instantiates a new ItemItemLicenseRequestBuilder and sets the default values. +func NewItemItemLicenseRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLicenseRequestBuilder) { + m := &ItemItemLicenseRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/license{?ref*}", pathParameters), + } + return m +} +// NewItemItemLicenseRequestBuilder instantiates a new ItemItemLicenseRequestBuilder and sets the default values. +func NewItemItemLicenseRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLicenseRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemLicenseRequestBuilderInternal(urlParams, requestAdapter) +} +// Get this method returns the contents of the repository's license file, if one is detected.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw contents of the license.- **`application/vnd.github.html+json`**: Returns the license contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +// returns a LicenseContentable 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/licenses/licenses#get-the-license-for-a-repository +func (m *ItemItemLicenseRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemLicenseRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.LicenseContentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateLicenseContentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.LicenseContentable), nil +} +// ToGetRequestInformation this method returns the contents of the repository's license file, if one is detected.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw contents of the license.- **`application/vnd.github.html+json`**: Returns the license contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +// returns a *RequestInformation when successful +func (m *ItemItemLicenseRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemLicenseRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemLicenseRequestBuilder when successful +func (m *ItemItemLicenseRequestBuilder) WithUrl(rawUrl string)(*ItemItemLicenseRequestBuilder) { + return NewItemItemLicenseRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_merge_upstream_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_merge_upstream_post_request_body.go new file mode 100644 index 000000000..72115ee76 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_merge_upstream_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemMergeUpstreamPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name of the branch which should be updated to match upstream. + branch *string +} +// NewItemItemMergeUpstreamPostRequestBody instantiates a new ItemItemMergeUpstreamPostRequestBody and sets the default values. +func NewItemItemMergeUpstreamPostRequestBody()(*ItemItemMergeUpstreamPostRequestBody) { + m := &ItemItemMergeUpstreamPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemMergeUpstreamPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemMergeUpstreamPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemMergeUpstreamPostRequestBody(), 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 *ItemItemMergeUpstreamPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBranch gets the branch property value. The name of the branch which should be updated to match upstream. +// returns a *string when successful +func (m *ItemItemMergeUpstreamPostRequestBody) GetBranch()(*string) { + return m.branch +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemMergeUpstreamPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranch(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemMergeUpstreamPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("branch", m.GetBranch()) + 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 *ItemItemMergeUpstreamPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBranch sets the branch property value. The name of the branch which should be updated to match upstream. +func (m *ItemItemMergeUpstreamPostRequestBody) SetBranch(value *string)() { + m.branch = value +} +type ItemItemMergeUpstreamPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBranch()(*string) + SetBranch(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_merge_upstream_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_merge_upstream_request_builder.go new file mode 100644 index 000000000..3ec9bb9a4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_merge_upstream_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemMergeUpstreamRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\merge-upstream +type ItemItemMergeUpstreamRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemMergeUpstreamRequestBuilderInternal instantiates a new ItemItemMergeUpstreamRequestBuilder and sets the default values. +func NewItemItemMergeUpstreamRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMergeUpstreamRequestBuilder) { + m := &ItemItemMergeUpstreamRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/merge-upstream", pathParameters), + } + return m +} +// NewItemItemMergeUpstreamRequestBuilder instantiates a new ItemItemMergeUpstreamRequestBuilder and sets the default values. +func NewItemItemMergeUpstreamRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMergeUpstreamRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemMergeUpstreamRequestBuilderInternal(urlParams, requestAdapter) +} +// Post sync a branch of a forked repository to keep it up-to-date with the upstream repository. +// returns a MergedUpstreamable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository +func (m *ItemItemMergeUpstreamRequestBuilder) Post(ctx context.Context, body ItemItemMergeUpstreamPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MergedUpstreamable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMergedUpstreamFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MergedUpstreamable), nil +} +// ToPostRequestInformation sync a branch of a forked repository to keep it up-to-date with the upstream repository. +// returns a *RequestInformation when successful +func (m *ItemItemMergeUpstreamRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemMergeUpstreamPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemMergeUpstreamRequestBuilder when successful +func (m *ItemItemMergeUpstreamRequestBuilder) WithUrl(rawUrl string)(*ItemItemMergeUpstreamRequestBuilder) { + return NewItemItemMergeUpstreamRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_merges_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_merges_post_request_body.go new file mode 100644 index 000000000..cb297264f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_merges_post_request_body.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemMergesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name of the base branch that the head will be merged into. + base *string + // Commit message to use for the merge commit. If omitted, a default message will be used. + commit_message *string + // The head to merge. This can be a branch name or a commit SHA1. + head *string +} +// NewItemItemMergesPostRequestBody instantiates a new ItemItemMergesPostRequestBody and sets the default values. +func NewItemItemMergesPostRequestBody()(*ItemItemMergesPostRequestBody) { + m := &ItemItemMergesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemMergesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemMergesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemMergesPostRequestBody(), 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 *ItemItemMergesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBase gets the base property value. The name of the base branch that the head will be merged into. +// returns a *string when successful +func (m *ItemItemMergesPostRequestBody) GetBase()(*string) { + return m.base +} +// GetCommitMessage gets the commit_message property value. Commit message to use for the merge commit. If omitted, a default message will be used. +// returns a *string when successful +func (m *ItemItemMergesPostRequestBody) GetCommitMessage()(*string) { + return m.commit_message +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemMergesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["base"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBase(val) + } + return nil + } + res["commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitMessage(val) + } + return nil + } + res["head"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHead(val) + } + return nil + } + return res +} +// GetHead gets the head property value. The head to merge. This can be a branch name or a commit SHA1. +// returns a *string when successful +func (m *ItemItemMergesPostRequestBody) GetHead()(*string) { + return m.head +} +// Serialize serializes information the current object +func (m *ItemItemMergesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("base", m.GetBase()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_message", m.GetCommitMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head", m.GetHead()) + 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 *ItemItemMergesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBase sets the base property value. The name of the base branch that the head will be merged into. +func (m *ItemItemMergesPostRequestBody) SetBase(value *string)() { + m.base = value +} +// SetCommitMessage sets the commit_message property value. Commit message to use for the merge commit. If omitted, a default message will be used. +func (m *ItemItemMergesPostRequestBody) SetCommitMessage(value *string)() { + m.commit_message = value +} +// SetHead sets the head property value. The head to merge. This can be a branch name or a commit SHA1. +func (m *ItemItemMergesPostRequestBody) SetHead(value *string)() { + m.head = value +} +type ItemItemMergesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBase()(*string) + GetCommitMessage()(*string) + GetHead()(*string) + SetBase(value *string)() + SetCommitMessage(value *string)() + SetHead(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_merges_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_merges_request_builder.go new file mode 100644 index 000000000..55d626774 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_merges_request_builder.go @@ -0,0 +1,66 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemMergesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\merges +type ItemItemMergesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemMergesRequestBuilderInternal instantiates a new ItemItemMergesRequestBuilder and sets the default values. +func NewItemItemMergesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMergesRequestBuilder) { + m := &ItemItemMergesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/merges", pathParameters), + } + return m +} +// NewItemItemMergesRequestBuilder instantiates a new ItemItemMergesRequestBuilder and sets the default values. +func NewItemItemMergesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMergesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemMergesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post merge a branch +// returns a Commitable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/branches/branches#merge-a-branch +func (m *ItemItemMergesRequestBuilder) Post(ctx context.Context, body ItemItemMergesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Commitable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Commitable), nil +} +// returns a *RequestInformation when successful +func (m *ItemItemMergesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemMergesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemMergesRequestBuilder when successful +func (m *ItemItemMergesRequestBuilder) WithUrl(rawUrl string)(*ItemItemMergesRequestBuilder) { + return NewItemItemMergesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_milestones_item_labels_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_milestones_item_labels_request_builder.go new file mode 100644 index 000000000..d5baaa926 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_milestones_item_labels_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemMilestonesItemLabelsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\milestones\{milestone_number}\labels +type ItemItemMilestonesItemLabelsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemMilestonesItemLabelsRequestBuilderGetQueryParameters lists labels for issues in a milestone. +type ItemItemMilestonesItemLabelsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemMilestonesItemLabelsRequestBuilderInternal instantiates a new ItemItemMilestonesItemLabelsRequestBuilder and sets the default values. +func NewItemItemMilestonesItemLabelsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMilestonesItemLabelsRequestBuilder) { + m := &ItemItemMilestonesItemLabelsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/milestones/{milestone_number}/labels{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemMilestonesItemLabelsRequestBuilder instantiates a new ItemItemMilestonesItemLabelsRequestBuilder and sets the default values. +func NewItemItemMilestonesItemLabelsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMilestonesItemLabelsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemMilestonesItemLabelsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists labels for issues in a milestone. +// returns a []Labelable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone +func (m *ItemItemMilestonesItemLabelsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemMilestonesItemLabelsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateLabelFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Labelable) + } + } + return val, nil +} +// ToGetRequestInformation lists labels for issues in a milestone. +// returns a *RequestInformation when successful +func (m *ItemItemMilestonesItemLabelsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemMilestonesItemLabelsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemMilestonesItemLabelsRequestBuilder when successful +func (m *ItemItemMilestonesItemLabelsRequestBuilder) WithUrl(rawUrl string)(*ItemItemMilestonesItemLabelsRequestBuilder) { + return NewItemItemMilestonesItemLabelsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_milestones_item_with_milestone_number_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_milestones_item_with_milestone_number_patch_request_body.go new file mode 100644 index 000000000..5794f09d5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_milestones_item_with_milestone_number_patch_request_body.go @@ -0,0 +1,139 @@ +package repos + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemMilestonesItemWithMilestone_numberPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A description of the milestone. + description *string + // The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + due_on *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The title of the milestone. + title *string +} +// NewItemItemMilestonesItemWithMilestone_numberPatchRequestBody instantiates a new ItemItemMilestonesItemWithMilestone_numberPatchRequestBody and sets the default values. +func NewItemItemMilestonesItemWithMilestone_numberPatchRequestBody()(*ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) { + m := &ItemItemMilestonesItemWithMilestone_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemMilestonesItemWithMilestone_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemMilestonesItemWithMilestone_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemMilestonesItemWithMilestone_numberPatchRequestBody(), 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 *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. A description of the milestone. +// returns a *string when successful +func (m *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) GetDescription()(*string) { + return m.description +} +// GetDueOn gets the due_on property value. The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) GetDueOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.due_on +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["due_on"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDueOn(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetTitle gets the title property value. The title of the milestone. +// returns a *string when successful +func (m *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("due_on", m.GetDueOn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. A description of the milestone. +func (m *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetDueOn sets the due_on property value. The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) SetDueOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.due_on = value +} +// SetTitle sets the title property value. The title of the milestone. +func (m *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemItemMilestonesItemWithMilestone_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetDueOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetTitle()(*string) + SetDescription(value *string)() + SetDueOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_milestones_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_milestones_post_request_body.go new file mode 100644 index 000000000..25cae0526 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_milestones_post_request_body.go @@ -0,0 +1,139 @@ +package repos + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemMilestonesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A description of the milestone. + description *string + // The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + due_on *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The title of the milestone. + title *string +} +// NewItemItemMilestonesPostRequestBody instantiates a new ItemItemMilestonesPostRequestBody and sets the default values. +func NewItemItemMilestonesPostRequestBody()(*ItemItemMilestonesPostRequestBody) { + m := &ItemItemMilestonesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemMilestonesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemMilestonesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemMilestonesPostRequestBody(), 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 *ItemItemMilestonesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. A description of the milestone. +// returns a *string when successful +func (m *ItemItemMilestonesPostRequestBody) GetDescription()(*string) { + return m.description +} +// GetDueOn gets the due_on property value. The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *ItemItemMilestonesPostRequestBody) GetDueOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.due_on +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemMilestonesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["due_on"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDueOn(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetTitle gets the title property value. The title of the milestone. +// returns a *string when successful +func (m *ItemItemMilestonesPostRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemItemMilestonesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("due_on", m.GetDueOn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemItemMilestonesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. A description of the milestone. +func (m *ItemItemMilestonesPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetDueOn sets the due_on property value. The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *ItemItemMilestonesPostRequestBody) SetDueOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.due_on = value +} +// SetTitle sets the title property value. The title of the milestone. +func (m *ItemItemMilestonesPostRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemItemMilestonesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetDueOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetTitle()(*string) + SetDescription(value *string)() + SetDueOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_milestones_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_milestones_request_builder.go new file mode 100644 index 000000000..1e0050e6a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_milestones_request_builder.go @@ -0,0 +1,126 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i1ebd97b17bc9aa912e6d52ba66eb2fba73070ddd43b0bc79944e735e3a7ba7c7 "github.com/octokit/go-sdk/pkg/github/repos/item/item/milestones" +) + +// ItemItemMilestonesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\milestones +type ItemItemMilestonesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemMilestonesRequestBuilderGetQueryParameters lists milestones for a repository. +type ItemItemMilestonesRequestBuilderGetQueryParameters struct { + // The direction of the sort. Either `asc` or `desc`. + Direction *i1ebd97b17bc9aa912e6d52ba66eb2fba73070ddd43b0bc79944e735e3a7ba7c7.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // What to sort results by. Either `due_on` or `completeness`. + Sort *i1ebd97b17bc9aa912e6d52ba66eb2fba73070ddd43b0bc79944e735e3a7ba7c7.GetSortQueryParameterType `uriparametername:"sort"` + // The state of the milestone. Either `open`, `closed`, or `all`. + State *i1ebd97b17bc9aa912e6d52ba66eb2fba73070ddd43b0bc79944e735e3a7ba7c7.GetStateQueryParameterType `uriparametername:"state"` +} +// ByMilestone_number gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.milestones.item collection +// returns a *ItemItemMilestonesWithMilestone_numberItemRequestBuilder when successful +func (m *ItemItemMilestonesRequestBuilder) ByMilestone_number(milestone_number int32)(*ItemItemMilestonesWithMilestone_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["milestone_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(milestone_number), 10) + return NewItemItemMilestonesWithMilestone_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemMilestonesRequestBuilderInternal instantiates a new ItemItemMilestonesRequestBuilder and sets the default values. +func NewItemItemMilestonesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMilestonesRequestBuilder) { + m := &ItemItemMilestonesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/milestones{?direction*,page*,per_page*,sort*,state*}", pathParameters), + } + return m +} +// NewItemItemMilestonesRequestBuilder instantiates a new ItemItemMilestonesRequestBuilder and sets the default values. +func NewItemItemMilestonesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMilestonesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemMilestonesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists milestones for a repository. +// returns a []Milestoneable 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/issues/milestones#list-milestones +func (m *ItemItemMilestonesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemMilestonesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Milestoneable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMilestoneFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Milestoneable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Milestoneable) + } + } + return val, nil +} +// Post creates a milestone. +// returns a Milestoneable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/milestones#create-a-milestone +func (m *ItemItemMilestonesRequestBuilder) Post(ctx context.Context, body ItemItemMilestonesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Milestoneable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMilestoneFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Milestoneable), nil +} +// ToGetRequestInformation lists milestones for a repository. +// returns a *RequestInformation when successful +func (m *ItemItemMilestonesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemMilestonesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a milestone. +// returns a *RequestInformation when successful +func (m *ItemItemMilestonesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemMilestonesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemMilestonesRequestBuilder when successful +func (m *ItemItemMilestonesRequestBuilder) WithUrl(rawUrl string)(*ItemItemMilestonesRequestBuilder) { + return NewItemItemMilestonesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_milestones_with_milestone_number_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_milestones_with_milestone_number_item_request_builder.go new file mode 100644 index 000000000..93ad4c080 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_milestones_with_milestone_number_item_request_builder.go @@ -0,0 +1,123 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemMilestonesWithMilestone_numberItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\milestones\{milestone_number} +type ItemItemMilestonesWithMilestone_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemMilestonesWithMilestone_numberItemRequestBuilderInternal instantiates a new ItemItemMilestonesWithMilestone_numberItemRequestBuilder and sets the default values. +func NewItemItemMilestonesWithMilestone_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMilestonesWithMilestone_numberItemRequestBuilder) { + m := &ItemItemMilestonesWithMilestone_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/milestones/{milestone_number}", pathParameters), + } + return m +} +// NewItemItemMilestonesWithMilestone_numberItemRequestBuilder instantiates a new ItemItemMilestonesWithMilestone_numberItemRequestBuilder and sets the default values. +func NewItemItemMilestonesWithMilestone_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMilestonesWithMilestone_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemMilestonesWithMilestone_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a milestone using the given milestone number. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/milestones#delete-a-milestone +func (m *ItemItemMilestonesWithMilestone_numberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a milestone using the given milestone number. +// returns a Milestoneable 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/issues/milestones#get-a-milestone +func (m *ItemItemMilestonesWithMilestone_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Milestoneable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMilestoneFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Milestoneable), nil +} +// Labels the labels property +// returns a *ItemItemMilestonesItemLabelsRequestBuilder when successful +func (m *ItemItemMilestonesWithMilestone_numberItemRequestBuilder) Labels()(*ItemItemMilestonesItemLabelsRequestBuilder) { + return NewItemItemMilestonesItemLabelsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch update a milestone +// returns a Milestoneable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/issues/milestones#update-a-milestone +func (m *ItemItemMilestonesWithMilestone_numberItemRequestBuilder) Patch(ctx context.Context, body ItemItemMilestonesItemWithMilestone_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Milestoneable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMilestoneFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Milestoneable), nil +} +// ToDeleteRequestInformation deletes a milestone using the given milestone number. +// returns a *RequestInformation when successful +func (m *ItemItemMilestonesWithMilestone_numberItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets a milestone using the given milestone number. +// returns a *RequestInformation when successful +func (m *ItemItemMilestonesWithMilestone_numberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *ItemItemMilestonesWithMilestone_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemMilestonesItemWithMilestone_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemMilestonesWithMilestone_numberItemRequestBuilder when successful +func (m *ItemItemMilestonesWithMilestone_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemMilestonesWithMilestone_numberItemRequestBuilder) { + return NewItemItemMilestonesWithMilestone_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_notifications_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_notifications_put_request_body.go new file mode 100644 index 000000000..79d00d448 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_notifications_put_request_body.go @@ -0,0 +1,81 @@ +package repos + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemNotificationsPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp. + last_read_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewItemItemNotificationsPutRequestBody instantiates a new ItemItemNotificationsPutRequestBody and sets the default values. +func NewItemItemNotificationsPutRequestBody()(*ItemItemNotificationsPutRequestBody) { + m := &ItemItemNotificationsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemNotificationsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemNotificationsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemNotificationsPutRequestBody(), 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 *ItemItemNotificationsPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemNotificationsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["last_read_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastReadAt(val) + } + return nil + } + return res +} +// GetLastReadAt gets the last_read_at property value. Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp. +// returns a *Time when successful +func (m *ItemItemNotificationsPutRequestBody) GetLastReadAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.last_read_at +} +// Serialize serializes information the current object +func (m *ItemItemNotificationsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("last_read_at", m.GetLastReadAt()) + 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 *ItemItemNotificationsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLastReadAt sets the last_read_at property value. Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp. +func (m *ItemItemNotificationsPutRequestBody) SetLastReadAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.last_read_at = value +} +type ItemItemNotificationsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLastReadAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetLastReadAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_notifications_put_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_notifications_put_response.go new file mode 100644 index 000000000..9e60f7ace --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_notifications_put_response.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemNotificationsPutResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The message property + message *string + // The url property + url *string +} +// NewItemItemNotificationsPutResponse instantiates a new ItemItemNotificationsPutResponse and sets the default values. +func NewItemItemNotificationsPutResponse()(*ItemItemNotificationsPutResponse) { + m := &ItemItemNotificationsPutResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemNotificationsPutResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemNotificationsPutResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemNotificationsPutResponse(), 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 *ItemItemNotificationsPutResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemNotificationsPutResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ItemItemNotificationsPutResponse) GetMessage()(*string) { + return m.message +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ItemItemNotificationsPutResponse) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ItemItemNotificationsPutResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ItemItemNotificationsPutResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. The message property +func (m *ItemItemNotificationsPutResponse) SetMessage(value *string)() { + m.message = value +} +// SetUrl sets the url property value. The url property +func (m *ItemItemNotificationsPutResponse) SetUrl(value *string)() { + m.url = value +} +type ItemItemNotificationsPutResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + GetUrl()(*string) + SetMessage(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_notifications_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_notifications_request_builder.go new file mode 100644 index 000000000..f2c4cd864 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_notifications_request_builder.go @@ -0,0 +1,107 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemNotificationsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\notifications +type ItemItemNotificationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemNotificationsRequestBuilderGetQueryParameters lists all notifications for the current user in the specified repository. +type ItemItemNotificationsRequestBuilderGetQueryParameters struct { + // If `true`, show notifications marked as read. + All *bool `uriparametername:"all"` + // Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Before *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"before"` + // 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"` + // If `true`, only shows notifications in which the user is directly participating or mentioned. + Participating *bool `uriparametername:"participating"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` +} +// NewItemItemNotificationsRequestBuilderInternal instantiates a new ItemItemNotificationsRequestBuilder and sets the default values. +func NewItemItemNotificationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemNotificationsRequestBuilder) { + m := &ItemItemNotificationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/notifications{?all*,before*,page*,participating*,per_page*,since*}", pathParameters), + } + return m +} +// NewItemItemNotificationsRequestBuilder instantiates a new ItemItemNotificationsRequestBuilder and sets the default values. +func NewItemItemNotificationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemNotificationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemNotificationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all notifications for the current user in the specified repository. +// returns a []Threadable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user +func (m *ItemItemNotificationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemNotificationsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Threadable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateThreadFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Threadable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Threadable) + } + } + return val, nil +} +// Put marks all notifications in a repository as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. +// returns a ItemItemNotificationsPutResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read +func (m *ItemItemNotificationsRequestBuilder) Put(ctx context.Context, body ItemItemNotificationsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemNotificationsPutResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemNotificationsPutResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemNotificationsPutResponseable), nil +} +// ToGetRequestInformation lists all notifications for the current user in the specified repository. +// returns a *RequestInformation when successful +func (m *ItemItemNotificationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemNotificationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation marks all notifications in a repository as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. +// returns a *RequestInformation when successful +func (m *ItemItemNotificationsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemNotificationsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemNotificationsRequestBuilder when successful +func (m *ItemItemNotificationsRequestBuilder) WithUrl(rawUrl string)(*ItemItemNotificationsRequestBuilder) { + return NewItemItemNotificationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_notifications_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_notifications_response.go new file mode 100644 index 000000000..d54343575 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_notifications_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemNotificationsResponse +// Deprecated: This class is obsolete. Use notificationsPutResponse instead. +type ItemItemNotificationsResponse struct { + ItemItemNotificationsPutResponse +} +// NewItemItemNotificationsResponse instantiates a new ItemItemNotificationsResponse and sets the default values. +func NewItemItemNotificationsResponse()(*ItemItemNotificationsResponse) { + m := &ItemItemNotificationsResponse{ + ItemItemNotificationsPutResponse: *NewItemItemNotificationsPutResponse(), + } + return m +} +// CreateItemItemNotificationsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemNotificationsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemNotificationsResponse(), nil +} +// ItemItemNotificationsResponseable +// Deprecated: This class is obsolete. Use notificationsPutResponse instead. +type ItemItemNotificationsResponseable interface { + ItemItemNotificationsPutResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner403_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner403_error.go new file mode 100644 index 000000000..95f5e5d16 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner403_error.go @@ -0,0 +1,117 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemOwner403Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewItemItemOwner403Error instantiates a new ItemItemOwner403Error and sets the default values. +func NewItemItemOwner403Error()(*ItemItemOwner403Error) { + m := &ItemItemOwner403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemOwner403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemOwner403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemOwner403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemItemOwner403Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemItemOwner403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ItemItemOwner403Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemOwner403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ItemItemOwner403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemItemOwner403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ItemItemOwner403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemItemOwner403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *ItemItemOwner403Error) SetMessage(value *string)() { + m.message = value +} +type ItemItemOwner403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner_patch_request_body.go new file mode 100644 index 000000000..030f06553 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner_patch_request_body.go @@ -0,0 +1,634 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemOwnerPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. + allow_auto_merge *bool + // Either `true` to allow private forks, or `false` to prevent private forks. + allow_forking *bool + // Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. + allow_merge_commit *bool + // Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. + allow_rebase_merge *bool + // Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. + allow_squash_merge *bool + // Either `true` to always allow a pull request head branch that is behind its base branch to be updated even if it is not required to be up to date before merging, or false otherwise. + allow_update_branch *bool + // Whether to archive this repository. `false` will unarchive a previously archived repository. + archived *bool + // Updates the default branch for this repository. + default_branch *string + // Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. + delete_branch_on_merge *bool + // A short description of the repository. + description *string + // Either `true` to enable issues for this repository or `false` to disable them. + has_issues *bool + // Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. + has_projects *bool + // Either `true` to enable the wiki for this repository or `false` to disable it. + has_wiki *bool + // A URL with more information about the repository. + homepage *string + // Either `true` to make this repo available as a template repository or `false` to prevent it. + is_template *bool + // The name of the repository. + name *string + // Either `true` to make the repository private or `false` to make it public. Default: `false`. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. + private *bool + // Specify which security and analysis features to enable or disable for the repository.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."For example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request:`{ "security_and_analysis": {"advanced_security": { "status": "enabled" } } }`.You can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. + security_and_analysis ItemItemOwnerPatchRequestBody_security_and_analysisable + // Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + // Deprecated: + use_squash_pr_title_as_default *bool + // Either `true` to require contributors to sign off on web-based commits, or `false` to not require contributors to sign off on web-based commits. + web_commit_signoff_required *bool +} +// NewItemItemOwnerPatchRequestBody instantiates a new ItemItemOwnerPatchRequestBody and sets the default values. +func NewItemItemOwnerPatchRequestBody()(*ItemItemOwnerPatchRequestBody) { + m := &ItemItemOwnerPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemOwnerPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemOwnerPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemOwnerPatchRequestBody(), 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 *ItemItemOwnerPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. +// returns a *bool when successful +func (m *ItemItemOwnerPatchRequestBody) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowForking gets the allow_forking property value. Either `true` to allow private forks, or `false` to prevent private forks. +// returns a *bool when successful +func (m *ItemItemOwnerPatchRequestBody) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. +// returns a *bool when successful +func (m *ItemItemOwnerPatchRequestBody) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. +// returns a *bool when successful +func (m *ItemItemOwnerPatchRequestBody) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. +// returns a *bool when successful +func (m *ItemItemOwnerPatchRequestBody) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetAllowUpdateBranch gets the allow_update_branch property value. Either `true` to always allow a pull request head branch that is behind its base branch to be updated even if it is not required to be up to date before merging, or false otherwise. +// returns a *bool when successful +func (m *ItemItemOwnerPatchRequestBody) GetAllowUpdateBranch()(*bool) { + return m.allow_update_branch +} +// GetArchived gets the archived property value. Whether to archive this repository. `false` will unarchive a previously archived repository. +// returns a *bool when successful +func (m *ItemItemOwnerPatchRequestBody) GetArchived()(*bool) { + return m.archived +} +// GetDefaultBranch gets the default_branch property value. Updates the default branch for this repository. +// returns a *string when successful +func (m *ItemItemOwnerPatchRequestBody) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. +// returns a *bool when successful +func (m *ItemItemOwnerPatchRequestBody) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDescription gets the description property value. A short description of the repository. +// returns a *string when successful +func (m *ItemItemOwnerPatchRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemOwnerPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["allow_update_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowUpdateBranch(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["security_and_analysis"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemOwnerPatchRequestBody_security_and_analysisFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAndAnalysis(val.(ItemItemOwnerPatchRequestBody_security_and_analysisable)) + } + return nil + } + res["use_squash_pr_title_as_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseSquashPrTitleAsDefault(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetHasIssues gets the has_issues property value. Either `true` to enable issues for this repository or `false` to disable them. +// returns a *bool when successful +func (m *ItemItemOwnerPatchRequestBody) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasProjects gets the has_projects property value. Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. +// returns a *bool when successful +func (m *ItemItemOwnerPatchRequestBody) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. Either `true` to enable the wiki for this repository or `false` to disable it. +// returns a *bool when successful +func (m *ItemItemOwnerPatchRequestBody) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. A URL with more information about the repository. +// returns a *string when successful +func (m *ItemItemOwnerPatchRequestBody) GetHomepage()(*string) { + return m.homepage +} +// GetIsTemplate gets the is_template property value. Either `true` to make this repo available as a template repository or `false` to prevent it. +// returns a *bool when successful +func (m *ItemItemOwnerPatchRequestBody) GetIsTemplate()(*bool) { + return m.is_template +} +// GetName gets the name property value. The name of the repository. +// returns a *string when successful +func (m *ItemItemOwnerPatchRequestBody) GetName()(*string) { + return m.name +} +// GetPrivate gets the private property value. Either `true` to make the repository private or `false` to make it public. Default: `false`. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. +// returns a *bool when successful +func (m *ItemItemOwnerPatchRequestBody) GetPrivate()(*bool) { + return m.private +} +// GetSecurityAndAnalysis gets the security_and_analysis property value. Specify which security and analysis features to enable or disable for the repository.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."For example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request:`{ "security_and_analysis": {"advanced_security": { "status": "enabled" } } }`.You can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. +// returns a ItemItemOwnerPatchRequestBody_security_and_analysisable when successful +func (m *ItemItemOwnerPatchRequestBody) GetSecurityAndAnalysis()(ItemItemOwnerPatchRequestBody_security_and_analysisable) { + return m.security_and_analysis +} +// GetUseSquashPrTitleAsDefault gets the use_squash_pr_title_as_default property value. Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +// returns a *bool when successful +func (m *ItemItemOwnerPatchRequestBody) GetUseSquashPrTitleAsDefault()(*bool) { + return m.use_squash_pr_title_as_default +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. Either `true` to require contributors to sign off on web-based commits, or `false` to not require contributors to sign off on web-based commits. +// returns a *bool when successful +func (m *ItemItemOwnerPatchRequestBody) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *ItemItemOwnerPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_update_branch", m.GetAllowUpdateBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("security_and_analysis", m.GetSecurityAndAnalysis()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_squash_pr_title_as_default", m.GetUseSquashPrTitleAsDefault()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *ItemItemOwnerPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. +func (m *ItemItemOwnerPatchRequestBody) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowForking sets the allow_forking property value. Either `true` to allow private forks, or `false` to prevent private forks. +func (m *ItemItemOwnerPatchRequestBody) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. +func (m *ItemItemOwnerPatchRequestBody) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. +func (m *ItemItemOwnerPatchRequestBody) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. +func (m *ItemItemOwnerPatchRequestBody) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetAllowUpdateBranch sets the allow_update_branch property value. Either `true` to always allow a pull request head branch that is behind its base branch to be updated even if it is not required to be up to date before merging, or false otherwise. +func (m *ItemItemOwnerPatchRequestBody) SetAllowUpdateBranch(value *bool)() { + m.allow_update_branch = value +} +// SetArchived sets the archived property value. Whether to archive this repository. `false` will unarchive a previously archived repository. +func (m *ItemItemOwnerPatchRequestBody) SetArchived(value *bool)() { + m.archived = value +} +// SetDefaultBranch sets the default_branch property value. Updates the default branch for this repository. +func (m *ItemItemOwnerPatchRequestBody) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. +func (m *ItemItemOwnerPatchRequestBody) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDescription sets the description property value. A short description of the repository. +func (m *ItemItemOwnerPatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetHasIssues sets the has_issues property value. Either `true` to enable issues for this repository or `false` to disable them. +func (m *ItemItemOwnerPatchRequestBody) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasProjects sets the has_projects property value. Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. +func (m *ItemItemOwnerPatchRequestBody) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. Either `true` to enable the wiki for this repository or `false` to disable it. +func (m *ItemItemOwnerPatchRequestBody) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. A URL with more information about the repository. +func (m *ItemItemOwnerPatchRequestBody) SetHomepage(value *string)() { + m.homepage = value +} +// SetIsTemplate sets the is_template property value. Either `true` to make this repo available as a template repository or `false` to prevent it. +func (m *ItemItemOwnerPatchRequestBody) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetName sets the name property value. The name of the repository. +func (m *ItemItemOwnerPatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetPrivate sets the private property value. Either `true` to make the repository private or `false` to make it public. Default: `false`. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. +func (m *ItemItemOwnerPatchRequestBody) SetPrivate(value *bool)() { + m.private = value +} +// SetSecurityAndAnalysis sets the security_and_analysis property value. Specify which security and analysis features to enable or disable for the repository.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."For example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request:`{ "security_and_analysis": {"advanced_security": { "status": "enabled" } } }`.You can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. +func (m *ItemItemOwnerPatchRequestBody) SetSecurityAndAnalysis(value ItemItemOwnerPatchRequestBody_security_and_analysisable)() { + m.security_and_analysis = value +} +// SetUseSquashPrTitleAsDefault sets the use_squash_pr_title_as_default property value. Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +func (m *ItemItemOwnerPatchRequestBody) SetUseSquashPrTitleAsDefault(value *bool)() { + m.use_squash_pr_title_as_default = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. Either `true` to require contributors to sign off on web-based commits, or `false` to not require contributors to sign off on web-based commits. +func (m *ItemItemOwnerPatchRequestBody) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type ItemItemOwnerPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetAllowUpdateBranch()(*bool) + GetArchived()(*bool) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDescription()(*string) + GetHasIssues()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetIsTemplate()(*bool) + GetName()(*string) + GetPrivate()(*bool) + GetSecurityAndAnalysis()(ItemItemOwnerPatchRequestBody_security_and_analysisable) + GetUseSquashPrTitleAsDefault()(*bool) + GetWebCommitSignoffRequired()(*bool) + SetAllowAutoMerge(value *bool)() + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetAllowUpdateBranch(value *bool)() + SetArchived(value *bool)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDescription(value *string)() + SetHasIssues(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetIsTemplate(value *bool)() + SetName(value *string)() + SetPrivate(value *bool)() + SetSecurityAndAnalysis(value ItemItemOwnerPatchRequestBody_security_and_analysisable)() + SetUseSquashPrTitleAsDefault(value *bool)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner_patch_request_body_security_and_analysis.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner_patch_request_body_security_and_analysis.go new file mode 100644 index 000000000..a3fa50dd2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner_patch_request_body_security_and_analysis.go @@ -0,0 +1,139 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemOwnerPatchRequestBody_security_and_analysis specify which security and analysis features to enable or disable for the repository.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."For example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request:`{ "security_and_analysis": {"advanced_security": { "status": "enabled" } } }`.You can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. +type ItemItemOwnerPatchRequestBody_security_and_analysis struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." + advanced_security ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_securityable + // Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." + secret_scanning ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanningable + // Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." + secret_scanning_push_protection ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable +} +// NewItemItemOwnerPatchRequestBody_security_and_analysis instantiates a new ItemItemOwnerPatchRequestBody_security_and_analysis and sets the default values. +func NewItemItemOwnerPatchRequestBody_security_and_analysis()(*ItemItemOwnerPatchRequestBody_security_and_analysis) { + m := &ItemItemOwnerPatchRequestBody_security_and_analysis{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemOwnerPatchRequestBody_security_and_analysisFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemOwnerPatchRequestBody_security_and_analysisFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemOwnerPatchRequestBody_security_and_analysis(), 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 *ItemItemOwnerPatchRequestBody_security_and_analysis) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvancedSecurity gets the advanced_security property value. Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." +// returns a ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_securityable when successful +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis) GetAdvancedSecurity()(ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_securityable) { + return m.advanced_security +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["advanced_security"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemOwnerPatchRequestBody_security_and_analysis_advanced_securityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurity(val.(ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_securityable)) + } + return nil + } + res["secret_scanning"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanningFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecretScanning(val.(ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanningable)) + } + return nil + } + res["secret_scanning_push_protection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protectionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtection(val.(ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable)) + } + return nil + } + return res +} +// GetSecretScanning gets the secret_scanning property value. Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." +// returns a ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanningable when successful +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis) GetSecretScanning()(ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanningable) { + return m.secret_scanning +} +// GetSecretScanningPushProtection gets the secret_scanning_push_protection property value. Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." +// returns a ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable when successful +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis) GetSecretScanningPushProtection()(ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable) { + return m.secret_scanning_push_protection +} +// Serialize serializes information the current object +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("advanced_security", m.GetAdvancedSecurity()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("secret_scanning", m.GetSecretScanning()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("secret_scanning_push_protection", m.GetSecretScanningPushProtection()) + 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 *ItemItemOwnerPatchRequestBody_security_and_analysis) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvancedSecurity sets the advanced_security property value. Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis) SetAdvancedSecurity(value ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_securityable)() { + m.advanced_security = value +} +// SetSecretScanning sets the secret_scanning property value. Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis) SetSecretScanning(value ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanningable)() { + m.secret_scanning = value +} +// SetSecretScanningPushProtection sets the secret_scanning_push_protection property value. Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis) SetSecretScanningPushProtection(value ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable)() { + m.secret_scanning_push_protection = value +} +type ItemItemOwnerPatchRequestBody_security_and_analysisable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdvancedSecurity()(ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_securityable) + GetSecretScanning()(ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanningable) + GetSecretScanningPushProtection()(ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable) + SetAdvancedSecurity(value ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_securityable)() + SetSecretScanning(value ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanningable)() + SetSecretScanningPushProtection(value ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner_patch_request_body_security_and_analysis_advanced_security.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner_patch_request_body_security_and_analysis_advanced_security.go new file mode 100644 index 000000000..2b6ace09f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner_patch_request_body_security_and_analysis_advanced_security.go @@ -0,0 +1,81 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_security use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." +type ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_security struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Can be `enabled` or `disabled`. + status *string +} +// NewItemItemOwnerPatchRequestBody_security_and_analysis_advanced_security instantiates a new ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_security and sets the default values. +func NewItemItemOwnerPatchRequestBody_security_and_analysis_advanced_security()(*ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_security) { + m := &ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_security{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemOwnerPatchRequestBody_security_and_analysis_advanced_securityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemOwnerPatchRequestBody_security_and_analysis_advanced_securityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemOwnerPatchRequestBody_security_and_analysis_advanced_security(), 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 *ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_security) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_security) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetStatus gets the status property value. Can be `enabled` or `disabled`. +// returns a *string when successful +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_security) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_security) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_security) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. Can be `enabled` or `disabled`. +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_security) SetStatus(value *string)() { + m.status = value +} +type ItemItemOwnerPatchRequestBody_security_and_analysis_advanced_securityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*string) + SetStatus(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner_patch_request_body_security_and_analysis_secret_scanning.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner_patch_request_body_security_and_analysis_secret_scanning.go new file mode 100644 index 000000000..ea6d88ca8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner_patch_request_body_security_and_analysis_secret_scanning.go @@ -0,0 +1,81 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." +type ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Can be `enabled` or `disabled`. + status *string +} +// NewItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning instantiates a new ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning and sets the default values. +func NewItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning()(*ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning) { + m := &ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanningFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanningFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning(), 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 *ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetStatus gets the status property value. Can be `enabled` or `disabled`. +// returns a *string when successful +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. Can be `enabled` or `disabled`. +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning) SetStatus(value *string)() { + m.status = value +} +type ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanningable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*string) + SetStatus(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner_patch_request_body_security_and_analysis_secret_scanning_push_protection.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner_patch_request_body_security_and_analysis_secret_scanning_push_protection.go new file mode 100644 index 000000000..1211e784a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_owner_patch_request_body_security_and_analysis_secret_scanning_push_protection.go @@ -0,0 +1,81 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protection use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." +type ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protection struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Can be `enabled` or `disabled`. + status *string +} +// NewItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protection instantiates a new ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protection and sets the default values. +func NewItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protection()(*ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protection) { + m := &ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protection{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protectionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protectionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protection(), 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 *ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protection) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protection) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetStatus gets the status property value. Can be `enabled` or `disabled`. +// returns a *string when successful +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protection) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protection) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protection) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. Can be `enabled` or `disabled`. +func (m *ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protection) SetStatus(value *string)() { + m.status = value +} +type ItemItemOwnerPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*string) + SetStatus(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_builds_latest_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_builds_latest_request_builder.go new file mode 100644 index 000000000..8d6020bfa --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_builds_latest_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPagesBuildsLatestRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pages\builds\latest +type ItemItemPagesBuildsLatestRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPagesBuildsLatestRequestBuilderInternal instantiates a new ItemItemPagesBuildsLatestRequestBuilder and sets the default values. +func NewItemItemPagesBuildsLatestRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesBuildsLatestRequestBuilder) { + m := &ItemItemPagesBuildsLatestRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pages/builds/latest", pathParameters), + } + return m +} +// NewItemItemPagesBuildsLatestRequestBuilder instantiates a new ItemItemPagesBuildsLatestRequestBuilder and sets the default values. +func NewItemItemPagesBuildsLatestRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesBuildsLatestRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPagesBuildsLatestRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets information about the single most recent build of a GitHub Pages site.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a PageBuildable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pages/pages#get-latest-pages-build +func (m *ItemItemPagesBuildsLatestRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PageBuildable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePageBuildFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PageBuildable), nil +} +// ToGetRequestInformation gets information about the single most recent build of a GitHub Pages site.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPagesBuildsLatestRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPagesBuildsLatestRequestBuilder when successful +func (m *ItemItemPagesBuildsLatestRequestBuilder) WithUrl(rawUrl string)(*ItemItemPagesBuildsLatestRequestBuilder) { + return NewItemItemPagesBuildsLatestRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_builds_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_builds_request_builder.go new file mode 100644 index 000000000..d589e78fe --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_builds_request_builder.go @@ -0,0 +1,110 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPagesBuildsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pages\builds +type ItemItemPagesBuildsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPagesBuildsRequestBuilderGetQueryParameters lists builts of a GitHub Pages site.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemPagesBuildsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByBuild_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.pages.builds.item collection +// returns a *ItemItemPagesBuildsWithBuild_ItemRequestBuilder when successful +func (m *ItemItemPagesBuildsRequestBuilder) ByBuild_id(build_id int32)(*ItemItemPagesBuildsWithBuild_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["build_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(build_id), 10) + return NewItemItemPagesBuildsWithBuild_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPagesBuildsRequestBuilderInternal instantiates a new ItemItemPagesBuildsRequestBuilder and sets the default values. +func NewItemItemPagesBuildsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesBuildsRequestBuilder) { + m := &ItemItemPagesBuildsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pages/builds{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemPagesBuildsRequestBuilder instantiates a new ItemItemPagesBuildsRequestBuilder and sets the default values. +func NewItemItemPagesBuildsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesBuildsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPagesBuildsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists builts of a GitHub Pages site.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a []PageBuildable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pages/pages#list-apiname-pages-builds +func (m *ItemItemPagesBuildsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPagesBuildsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PageBuildable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePageBuildFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PageBuildable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PageBuildable) + } + } + return val, nil +} +// Latest the latest property +// returns a *ItemItemPagesBuildsLatestRequestBuilder when successful +func (m *ItemItemPagesBuildsRequestBuilder) Latest()(*ItemItemPagesBuildsLatestRequestBuilder) { + return NewItemItemPagesBuildsLatestRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Post you can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures.Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes. +// returns a PageBuildStatusable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pages/pages#request-a-apiname-pages-build +func (m *ItemItemPagesBuildsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PageBuildStatusable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePageBuildStatusFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PageBuildStatusable), nil +} +// ToGetRequestInformation lists builts of a GitHub Pages site.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPagesBuildsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPagesBuildsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation you can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures.Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes. +// returns a *RequestInformation when successful +func (m *ItemItemPagesBuildsRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPagesBuildsRequestBuilder when successful +func (m *ItemItemPagesBuildsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPagesBuildsRequestBuilder) { + return NewItemItemPagesBuildsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_builds_with_build_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_builds_with_build_item_request_builder.go new file mode 100644 index 000000000..a0289033c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_builds_with_build_item_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPagesBuildsWithBuild_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pages\builds\{build_id} +type ItemItemPagesBuildsWithBuild_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPagesBuildsWithBuild_ItemRequestBuilderInternal instantiates a new ItemItemPagesBuildsWithBuild_ItemRequestBuilder and sets the default values. +func NewItemItemPagesBuildsWithBuild_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesBuildsWithBuild_ItemRequestBuilder) { + m := &ItemItemPagesBuildsWithBuild_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pages/builds/{build_id}", pathParameters), + } + return m +} +// NewItemItemPagesBuildsWithBuild_ItemRequestBuilder instantiates a new ItemItemPagesBuildsWithBuild_ItemRequestBuilder and sets the default values. +func NewItemItemPagesBuildsWithBuild_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesBuildsWithBuild_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPagesBuildsWithBuild_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets information about a GitHub Pages build.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a PageBuildable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pages/pages#get-apiname-pages-build +func (m *ItemItemPagesBuildsWithBuild_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PageBuildable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePageBuildFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PageBuildable), nil +} +// ToGetRequestInformation gets information about a GitHub Pages build.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPagesBuildsWithBuild_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPagesBuildsWithBuild_ItemRequestBuilder when successful +func (m *ItemItemPagesBuildsWithBuild_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemPagesBuildsWithBuild_ItemRequestBuilder) { + return NewItemItemPagesBuildsWithBuild_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployment_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployment_post_request_body.go new file mode 100644 index 000000000..f0ea72e22 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployment_post_request_body.go @@ -0,0 +1,166 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemPagesDeploymentPostRequestBody the object used to create GitHub Pages deployment +type ItemItemPagesDeploymentPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The URL of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. + artifact_url *string + // The target environment for this GitHub Pages deployment. + environment *string + // The OIDC token issued by GitHub Actions certifying the origin of the deployment. + oidc_token *string + // A unique string that represents the version of the build for this deployment. + pages_build_version *string +} +// NewItemItemPagesDeploymentPostRequestBody instantiates a new ItemItemPagesDeploymentPostRequestBody and sets the default values. +func NewItemItemPagesDeploymentPostRequestBody()(*ItemItemPagesDeploymentPostRequestBody) { + m := &ItemItemPagesDeploymentPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + environmentValue := "github-pages" + m.SetEnvironment(&environmentValue) + pages_build_versionValue := "GITHUB_SHA" + m.SetPagesBuildVersion(&pages_build_versionValue) + return m +} +// CreateItemItemPagesDeploymentPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemPagesDeploymentPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPagesDeploymentPostRequestBody(), 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. +func (m *ItemItemPagesDeploymentPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArtifactUrl gets the artifact_url property value. The URL of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. +func (m *ItemItemPagesDeploymentPostRequestBody) GetArtifactUrl()(*string) { + return m.artifact_url +} +// GetEnvironment gets the environment property value. The target environment for this GitHub Pages deployment. +func (m *ItemItemPagesDeploymentPostRequestBody) GetEnvironment()(*string) { + return m.environment +} +// GetFieldDeserializers the deserialization information for the current model +func (m *ItemItemPagesDeploymentPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["artifact_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArtifactUrl(val) + } + return nil + } + res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val) + } + return nil + } + res["oidc_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOidcToken(val) + } + return nil + } + res["pages_build_version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPagesBuildVersion(val) + } + return nil + } + return res +} +// GetOidcToken gets the oidc_token property value. The OIDC token issued by GitHub Actions certifying the origin of the deployment. +func (m *ItemItemPagesDeploymentPostRequestBody) GetOidcToken()(*string) { + return m.oidc_token +} +// GetPagesBuildVersion gets the pages_build_version property value. A unique string that represents the version of the build for this deployment. +func (m *ItemItemPagesDeploymentPostRequestBody) GetPagesBuildVersion()(*string) { + return m.pages_build_version +} +// Serialize serializes information the current object +func (m *ItemItemPagesDeploymentPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("artifact_url", m.GetArtifactUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("oidc_token", m.GetOidcToken()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pages_build_version", m.GetPagesBuildVersion()) + 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 *ItemItemPagesDeploymentPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArtifactUrl sets the artifact_url property value. The URL of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. +func (m *ItemItemPagesDeploymentPostRequestBody) SetArtifactUrl(value *string)() { + m.artifact_url = value +} +// SetEnvironment sets the environment property value. The target environment for this GitHub Pages deployment. +func (m *ItemItemPagesDeploymentPostRequestBody) SetEnvironment(value *string)() { + m.environment = value +} +// SetOidcToken sets the oidc_token property value. The OIDC token issued by GitHub Actions certifying the origin of the deployment. +func (m *ItemItemPagesDeploymentPostRequestBody) SetOidcToken(value *string)() { + m.oidc_token = value +} +// SetPagesBuildVersion sets the pages_build_version property value. A unique string that represents the version of the build for this deployment. +func (m *ItemItemPagesDeploymentPostRequestBody) SetPagesBuildVersion(value *string)() { + m.pages_build_version = value +} +// ItemItemPagesDeploymentPostRequestBodyable +type ItemItemPagesDeploymentPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArtifactUrl()(*string) + GetEnvironment()(*string) + GetOidcToken()(*string) + GetPagesBuildVersion()(*string) + SetArtifactUrl(value *string)() + SetEnvironment(value *string)() + SetOidcToken(value *string)() + SetPagesBuildVersion(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployment_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployment_request_builder.go new file mode 100644 index 000000000..4ae49d3be --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployment_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPagesDeploymentRequestBuilder builds and executes requests for operations under \repos\{repos-id}\{Owner-id}\pages\deployment +type ItemItemPagesDeploymentRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPagesDeploymentRequestBuilderInternal instantiates a new DeploymentRequestBuilder and sets the default values. +func NewItemItemPagesDeploymentRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesDeploymentRequestBuilder) { + m := &ItemItemPagesDeploymentRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{repos%2Did}/{Owner%2Did}/pages/deployment", pathParameters), + } + return m +} +// NewItemItemPagesDeploymentRequestBuilder instantiates a new DeploymentRequestBuilder and sets the default values. +func NewItemItemPagesDeploymentRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesDeploymentRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPagesDeploymentRequestBuilderInternal(urlParams, requestAdapter) +} +// Post create a GitHub Pages deployment for a repository.Users must have write permissions. GitHub Apps must have the `pages:write` permission to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pages/pages#create-a-github-pages-deployment +func (m *ItemItemPagesDeploymentRequestBuilder) Post(ctx context.Context, body ItemItemPagesDeploymentPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PageDeploymentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePageDeploymentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PageDeploymentable), nil +} +// ToPostRequestInformation create a GitHub Pages deployment for a repository.Users must have write permissions. GitHub Apps must have the `pages:write` permission to use this endpoint. +func (m *ItemItemPagesDeploymentRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPagesDeploymentPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +func (m *ItemItemPagesDeploymentRequestBuilder) WithUrl(rawUrl string)(*ItemItemPagesDeploymentRequestBuilder) { + return NewItemItemPagesDeploymentRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployments_item_cancel_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployments_item_cancel_request_builder.go new file mode 100644 index 000000000..20c35633b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployments_item_cancel_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPagesDeploymentsItemCancelRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pages\deployments\{pages_deployment_id}\cancel +type ItemItemPagesDeploymentsItemCancelRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPagesDeploymentsItemCancelRequestBuilderInternal instantiates a new ItemItemPagesDeploymentsItemCancelRequestBuilder and sets the default values. +func NewItemItemPagesDeploymentsItemCancelRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesDeploymentsItemCancelRequestBuilder) { + m := &ItemItemPagesDeploymentsItemCancelRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pages/deployments/{pages_deployment_id}/cancel", pathParameters), + } + return m +} +// NewItemItemPagesDeploymentsItemCancelRequestBuilder instantiates a new ItemItemPagesDeploymentsItemCancelRequestBuilder and sets the default values. +func NewItemItemPagesDeploymentsItemCancelRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesDeploymentsItemCancelRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPagesDeploymentsItemCancelRequestBuilderInternal(urlParams, requestAdapter) +} +// Post cancels a GitHub Pages deployment.The authenticated user must have write permissions for the GitHub Pages site. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pages/pages#cancel-a-github-pages-deployment +func (m *ItemItemPagesDeploymentsItemCancelRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation cancels a GitHub Pages deployment.The authenticated user must have write permissions for the GitHub Pages site. +// returns a *RequestInformation when successful +func (m *ItemItemPagesDeploymentsItemCancelRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPagesDeploymentsItemCancelRequestBuilder when successful +func (m *ItemItemPagesDeploymentsItemCancelRequestBuilder) WithUrl(rawUrl string)(*ItemItemPagesDeploymentsItemCancelRequestBuilder) { + return NewItemItemPagesDeploymentsItemCancelRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployments_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployments_post_request_body.go new file mode 100644 index 000000000..6c394be12 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployments_post_request_body.go @@ -0,0 +1,201 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemPagesDeploymentsPostRequestBody the object used to create GitHub Pages deployment +type ItemItemPagesDeploymentsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The ID of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. Either `artifact_id` or `artifact_url` are required. + artifact_id *float64 + // The URL of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. Either `artifact_id` or `artifact_url` are required. + artifact_url *string + // The target environment for this GitHub Pages deployment. + environment *string + // The OIDC token issued by GitHub Actions certifying the origin of the deployment. + oidc_token *string + // A unique string that represents the version of the build for this deployment. + pages_build_version *string +} +// NewItemItemPagesDeploymentsPostRequestBody instantiates a new ItemItemPagesDeploymentsPostRequestBody and sets the default values. +func NewItemItemPagesDeploymentsPostRequestBody()(*ItemItemPagesDeploymentsPostRequestBody) { + m := &ItemItemPagesDeploymentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + environmentValue := "github-pages" + m.SetEnvironment(&environmentValue) + pages_build_versionValue := "GITHUB_SHA" + m.SetPagesBuildVersion(&pages_build_versionValue) + return m +} +// CreateItemItemPagesDeploymentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPagesDeploymentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPagesDeploymentsPostRequestBody(), 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 *ItemItemPagesDeploymentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArtifactId gets the artifact_id property value. The ID of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. Either `artifact_id` or `artifact_url` are required. +// returns a *float64 when successful +func (m *ItemItemPagesDeploymentsPostRequestBody) GetArtifactId()(*float64) { + return m.artifact_id +} +// GetArtifactUrl gets the artifact_url property value. The URL of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. Either `artifact_id` or `artifact_url` are required. +// returns a *string when successful +func (m *ItemItemPagesDeploymentsPostRequestBody) GetArtifactUrl()(*string) { + return m.artifact_url +} +// GetEnvironment gets the environment property value. The target environment for this GitHub Pages deployment. +// returns a *string when successful +func (m *ItemItemPagesDeploymentsPostRequestBody) GetEnvironment()(*string) { + return m.environment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPagesDeploymentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["artifact_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetArtifactId(val) + } + return nil + } + res["artifact_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArtifactUrl(val) + } + return nil + } + res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val) + } + return nil + } + res["oidc_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOidcToken(val) + } + return nil + } + res["pages_build_version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPagesBuildVersion(val) + } + return nil + } + return res +} +// GetOidcToken gets the oidc_token property value. The OIDC token issued by GitHub Actions certifying the origin of the deployment. +// returns a *string when successful +func (m *ItemItemPagesDeploymentsPostRequestBody) GetOidcToken()(*string) { + return m.oidc_token +} +// GetPagesBuildVersion gets the pages_build_version property value. A unique string that represents the version of the build for this deployment. +// returns a *string when successful +func (m *ItemItemPagesDeploymentsPostRequestBody) GetPagesBuildVersion()(*string) { + return m.pages_build_version +} +// Serialize serializes information the current object +func (m *ItemItemPagesDeploymentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteFloat64Value("artifact_id", m.GetArtifactId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("artifact_url", m.GetArtifactUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("oidc_token", m.GetOidcToken()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pages_build_version", m.GetPagesBuildVersion()) + 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 *ItemItemPagesDeploymentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArtifactId sets the artifact_id property value. The ID of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. Either `artifact_id` or `artifact_url` are required. +func (m *ItemItemPagesDeploymentsPostRequestBody) SetArtifactId(value *float64)() { + m.artifact_id = value +} +// SetArtifactUrl sets the artifact_url property value. The URL of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. Either `artifact_id` or `artifact_url` are required. +func (m *ItemItemPagesDeploymentsPostRequestBody) SetArtifactUrl(value *string)() { + m.artifact_url = value +} +// SetEnvironment sets the environment property value. The target environment for this GitHub Pages deployment. +func (m *ItemItemPagesDeploymentsPostRequestBody) SetEnvironment(value *string)() { + m.environment = value +} +// SetOidcToken sets the oidc_token property value. The OIDC token issued by GitHub Actions certifying the origin of the deployment. +func (m *ItemItemPagesDeploymentsPostRequestBody) SetOidcToken(value *string)() { + m.oidc_token = value +} +// SetPagesBuildVersion sets the pages_build_version property value. A unique string that represents the version of the build for this deployment. +func (m *ItemItemPagesDeploymentsPostRequestBody) SetPagesBuildVersion(value *string)() { + m.pages_build_version = value +} +type ItemItemPagesDeploymentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArtifactId()(*float64) + GetArtifactUrl()(*string) + GetEnvironment()(*string) + GetOidcToken()(*string) + GetPagesBuildVersion()(*string) + SetArtifactId(value *float64)() + SetArtifactUrl(value *string)() + SetEnvironment(value *string)() + SetOidcToken(value *string)() + SetPagesBuildVersion(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployments_request_builder.go new file mode 100644 index 000000000..969518c11 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployments_request_builder.go @@ -0,0 +1,80 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPagesDeploymentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pages\deployments +type ItemItemPagesDeploymentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByPages_deployment_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.pages.deployments.item collection +// returns a *ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder when successful +func (m *ItemItemPagesDeploymentsRequestBuilder) ByPages_deployment_id(pages_deployment_id int32)(*ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["pages_deployment_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(pages_deployment_id), 10) + return NewItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPagesDeploymentsRequestBuilderInternal instantiates a new ItemItemPagesDeploymentsRequestBuilder and sets the default values. +func NewItemItemPagesDeploymentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesDeploymentsRequestBuilder) { + m := &ItemItemPagesDeploymentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pages/deployments", pathParameters), + } + return m +} +// NewItemItemPagesDeploymentsRequestBuilder instantiates a new ItemItemPagesDeploymentsRequestBuilder and sets the default values. +func NewItemItemPagesDeploymentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesDeploymentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPagesDeploymentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post create a GitHub Pages deployment for a repository.The authenticated user must have write permission to the repository. +// returns a PageDeploymentable when successful +// returns a BasicError error when the service returns a 400 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/pages/pages#create-a-github-pages-deployment +func (m *ItemItemPagesDeploymentsRequestBuilder) Post(ctx context.Context, body ItemItemPagesDeploymentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PageDeploymentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePageDeploymentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PageDeploymentable), nil +} +// ToPostRequestInformation create a GitHub Pages deployment for a repository.The authenticated user must have write permission to the repository. +// returns a *RequestInformation when successful +func (m *ItemItemPagesDeploymentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPagesDeploymentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPagesDeploymentsRequestBuilder when successful +func (m *ItemItemPagesDeploymentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPagesDeploymentsRequestBuilder) { + return NewItemItemPagesDeploymentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployments_with_pages_deployment_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployments_with_pages_deployment_item_request_builder.go new file mode 100644 index 000000000..8ecc195e3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_deployments_with_pages_deployment_item_request_builder.go @@ -0,0 +1,66 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pages\deployments\{pages_deployment_id} +type ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Cancel the cancel property +// returns a *ItemItemPagesDeploymentsItemCancelRequestBuilder when successful +func (m *ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder) Cancel()(*ItemItemPagesDeploymentsItemCancelRequestBuilder) { + return NewItemItemPagesDeploymentsItemCancelRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilderInternal instantiates a new ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder and sets the default values. +func NewItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder) { + m := &ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pages/deployments/{pages_deployment_id}", pathParameters), + } + return m +} +// NewItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder instantiates a new ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder and sets the default values. +func NewItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the current status of a GitHub Pages deployment.The authenticated user must have read permission for the GitHub Pages site. +// returns a PagesDeploymentStatusable 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/pages/pages#get-the-status-of-a-github-pages-deployment +func (m *ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PagesDeploymentStatusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePagesDeploymentStatusFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PagesDeploymentStatusable), nil +} +// ToGetRequestInformation gets the current status of a GitHub Pages deployment.The authenticated user must have read permission for the GitHub Pages site. +// returns a *RequestInformation when successful +func (m *ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder when successful +func (m *ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder) { + return NewItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_health_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_health_request_builder.go new file mode 100644 index 000000000..9bfb1c4c1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_health_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPagesHealthRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pages\health +type ItemItemPagesHealthRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPagesHealthRequestBuilderInternal instantiates a new ItemItemPagesHealthRequestBuilder and sets the default values. +func NewItemItemPagesHealthRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesHealthRequestBuilder) { + m := &ItemItemPagesHealthRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pages/health", pathParameters), + } + return m +} +// NewItemItemPagesHealthRequestBuilder instantiates a new ItemItemPagesHealthRequestBuilder and sets the default values. +func NewItemItemPagesHealthRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesHealthRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPagesHealthRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a health check of the DNS settings for the `CNAME` record configured for a repository's GitHub Pages.The first request to this endpoint returns a `202 Accepted` status and starts an asynchronous background task to get the results for the domain. After the background task completes, subsequent requests to this endpoint return a `200 OK` status with the health check results in the response.The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a PagesHealthCheckable 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/pages/pages#get-a-dns-health-check-for-github-pages +func (m *ItemItemPagesHealthRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PagesHealthCheckable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePagesHealthCheckFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PagesHealthCheckable), nil +} +// ToGetRequestInformation gets a health check of the DNS settings for the `CNAME` record configured for a repository's GitHub Pages.The first request to this endpoint returns a `202 Accepted` status and starts an asynchronous background task to get the results for the domain. After the background task completes, subsequent requests to this endpoint return a `200 OK` status with the health check results in the response.The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPagesHealthRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPagesHealthRequestBuilder when successful +func (m *ItemItemPagesHealthRequestBuilder) WithUrl(rawUrl string)(*ItemItemPagesHealthRequestBuilder) { + return NewItemItemPagesHealthRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_post_request_body.go new file mode 100644 index 000000000..ed62902d0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_post_request_body.go @@ -0,0 +1,81 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemPagesPostRequestBody the source branch and directory used to publish your Pages site. +type ItemItemPagesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The source branch and directory used to publish your Pages site. + source ItemItemPagesPostRequestBody_sourceable +} +// NewItemItemPagesPostRequestBody instantiates a new ItemItemPagesPostRequestBody and sets the default values. +func NewItemItemPagesPostRequestBody()(*ItemItemPagesPostRequestBody) { + m := &ItemItemPagesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPagesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPagesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPagesPostRequestBody(), 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 *ItemItemPagesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPagesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemPagesPostRequestBody_sourceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSource(val.(ItemItemPagesPostRequestBody_sourceable)) + } + return nil + } + return res +} +// GetSource gets the source property value. The source branch and directory used to publish your Pages site. +// returns a ItemItemPagesPostRequestBody_sourceable when successful +func (m *ItemItemPagesPostRequestBody) GetSource()(ItemItemPagesPostRequestBody_sourceable) { + return m.source +} +// Serialize serializes information the current object +func (m *ItemItemPagesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("source", m.GetSource()) + 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 *ItemItemPagesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSource sets the source property value. The source branch and directory used to publish your Pages site. +func (m *ItemItemPagesPostRequestBody) SetSource(value ItemItemPagesPostRequestBody_sourceable)() { + m.source = value +} +type ItemItemPagesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSource()(ItemItemPagesPostRequestBody_sourceable) + SetSource(value ItemItemPagesPostRequestBody_sourceable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_post_request_body_source.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_post_request_body_source.go new file mode 100644 index 000000000..7ae5f6c3f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_post_request_body_source.go @@ -0,0 +1,81 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemPagesPostRequestBody_source the source branch and directory used to publish your Pages site. +type ItemItemPagesPostRequestBody_source struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The repository branch used to publish your site's source files. + branch *string +} +// NewItemItemPagesPostRequestBody_source instantiates a new ItemItemPagesPostRequestBody_source and sets the default values. +func NewItemItemPagesPostRequestBody_source()(*ItemItemPagesPostRequestBody_source) { + m := &ItemItemPagesPostRequestBody_source{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPagesPostRequestBody_sourceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPagesPostRequestBody_sourceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPagesPostRequestBody_source(), 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 *ItemItemPagesPostRequestBody_source) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBranch gets the branch property value. The repository branch used to publish your site's source files. +// returns a *string when successful +func (m *ItemItemPagesPostRequestBody_source) GetBranch()(*string) { + return m.branch +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPagesPostRequestBody_source) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranch(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemPagesPostRequestBody_source) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("branch", m.GetBranch()) + 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 *ItemItemPagesPostRequestBody_source) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBranch sets the branch property value. The repository branch used to publish your site's source files. +func (m *ItemItemPagesPostRequestBody_source) SetBranch(value *string)() { + m.branch = value +} +type ItemItemPagesPostRequestBody_sourceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBranch()(*string) + SetBranch(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_put_request_body.go new file mode 100644 index 000000000..cdcd531d5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_put_request_body.go @@ -0,0 +1,222 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPagesPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Specify a custom domain for the repository. Sending a `null` value will remove the custom domain. For more about custom domains, see "[Using a custom domain with GitHub Pages](https://docs.github.com/pages/configuring-a-custom-domain-for-your-github-pages-site)." + cname *string + // Specify whether HTTPS should be enforced for the repository. + https_enforced *bool + // The source property + source ItemItemPagesPutRequestBody_PagesPutRequestBody_sourceable +} +// ItemItemPagesPutRequestBody_PagesPutRequestBody_source composed type wrapper for classes ItemItemPagesPutRequestBody_sourceMember1able, string +type ItemItemPagesPutRequestBody_PagesPutRequestBody_source struct { + // Composed type representation for type ItemItemPagesPutRequestBody_sourceMember1able + itemItemPagesPutRequestBody_sourceMember1 ItemItemPagesPutRequestBody_sourceMember1able + // Composed type representation for type string + string *string +} +// NewItemItemPagesPutRequestBody_PagesPutRequestBody_source instantiates a new ItemItemPagesPutRequestBody_PagesPutRequestBody_source and sets the default values. +func NewItemItemPagesPutRequestBody_PagesPutRequestBody_source()(*ItemItemPagesPutRequestBody_PagesPutRequestBody_source) { + m := &ItemItemPagesPutRequestBody_PagesPutRequestBody_source{ + } + return m +} +// CreateItemItemPagesPutRequestBody_PagesPutRequestBody_sourceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPagesPutRequestBody_PagesPutRequestBody_sourceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewItemItemPagesPutRequestBody_PagesPutRequestBody_source() + if parseNode != nil { + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } else if val, err := parseNode.GetObjectValue(CreateItemItemPagesPutRequestBody_sourceMember1FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ItemItemPagesPutRequestBody_sourceMember1able); ok { + result.SetItemItemPagesPutRequestBodySourceMember1(cast) + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPagesPutRequestBody_PagesPutRequestBody_source) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *ItemItemPagesPutRequestBody_PagesPutRequestBody_source) GetIsComposedType()(bool) { + return true +} +// GetItemItemPagesPutRequestBodySourceMember1 gets the ItemItemPagesPutRequestBody_sourceMember1 property value. Composed type representation for type ItemItemPagesPutRequestBody_sourceMember1able +// returns a ItemItemPagesPutRequestBody_sourceMember1able when successful +func (m *ItemItemPagesPutRequestBody_PagesPutRequestBody_source) GetItemItemPagesPutRequestBodySourceMember1()(ItemItemPagesPutRequestBody_sourceMember1able) { + return m.itemItemPagesPutRequestBody_sourceMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ItemItemPagesPutRequestBody_PagesPutRequestBody_source) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ItemItemPagesPutRequestBody_PagesPutRequestBody_source) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetItemItemPagesPutRequestBodySourceMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemPagesPutRequestBodySourceMember1()) + if err != nil { + return err + } + } + return nil +} +// SetItemItemPagesPutRequestBodySourceMember1 sets the ItemItemPagesPutRequestBody_sourceMember1 property value. Composed type representation for type ItemItemPagesPutRequestBody_sourceMember1able +func (m *ItemItemPagesPutRequestBody_PagesPutRequestBody_source) SetItemItemPagesPutRequestBodySourceMember1(value ItemItemPagesPutRequestBody_sourceMember1able)() { + m.itemItemPagesPutRequestBody_sourceMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ItemItemPagesPutRequestBody_PagesPutRequestBody_source) SetString(value *string)() { + m.string = value +} +type ItemItemPagesPutRequestBody_PagesPutRequestBody_sourceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemPagesPutRequestBodySourceMember1()(ItemItemPagesPutRequestBody_sourceMember1able) + GetString()(*string) + SetItemItemPagesPutRequestBodySourceMember1(value ItemItemPagesPutRequestBody_sourceMember1able)() + SetString(value *string)() +} +// NewItemItemPagesPutRequestBody instantiates a new ItemItemPagesPutRequestBody and sets the default values. +func NewItemItemPagesPutRequestBody()(*ItemItemPagesPutRequestBody) { + m := &ItemItemPagesPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPagesPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPagesPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPagesPutRequestBody(), 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 *ItemItemPagesPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCname gets the cname property value. Specify a custom domain for the repository. Sending a `null` value will remove the custom domain. For more about custom domains, see "[Using a custom domain with GitHub Pages](https://docs.github.com/pages/configuring-a-custom-domain-for-your-github-pages-site)." +// returns a *string when successful +func (m *ItemItemPagesPutRequestBody) GetCname()(*string) { + return m.cname +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPagesPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cname"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCname(val) + } + return nil + } + res["https_enforced"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHttpsEnforced(val) + } + return nil + } + res["source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemPagesPutRequestBody_PagesPutRequestBody_sourceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSource(val.(ItemItemPagesPutRequestBody_PagesPutRequestBody_sourceable)) + } + return nil + } + return res +} +// GetHttpsEnforced gets the https_enforced property value. Specify whether HTTPS should be enforced for the repository. +// returns a *bool when successful +func (m *ItemItemPagesPutRequestBody) GetHttpsEnforced()(*bool) { + return m.https_enforced +} +// GetSource gets the source property value. The source property +// returns a ItemItemPagesPutRequestBody_PagesPutRequestBody_sourceable when successful +func (m *ItemItemPagesPutRequestBody) GetSource()(ItemItemPagesPutRequestBody_PagesPutRequestBody_sourceable) { + return m.source +} +// Serialize serializes information the current object +func (m *ItemItemPagesPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("cname", m.GetCname()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("https_enforced", m.GetHttpsEnforced()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("source", m.GetSource()) + 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 *ItemItemPagesPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCname sets the cname property value. Specify a custom domain for the repository. Sending a `null` value will remove the custom domain. For more about custom domains, see "[Using a custom domain with GitHub Pages](https://docs.github.com/pages/configuring-a-custom-domain-for-your-github-pages-site)." +func (m *ItemItemPagesPutRequestBody) SetCname(value *string)() { + m.cname = value +} +// SetHttpsEnforced sets the https_enforced property value. Specify whether HTTPS should be enforced for the repository. +func (m *ItemItemPagesPutRequestBody) SetHttpsEnforced(value *bool)() { + m.https_enforced = value +} +// SetSource sets the source property value. The source property +func (m *ItemItemPagesPutRequestBody) SetSource(value ItemItemPagesPutRequestBody_PagesPutRequestBody_sourceable)() { + m.source = value +} +type ItemItemPagesPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCname()(*string) + GetHttpsEnforced()(*bool) + GetSource()(ItemItemPagesPutRequestBody_PagesPutRequestBody_sourceable) + SetCname(value *string)() + SetHttpsEnforced(value *bool)() + SetSource(value ItemItemPagesPutRequestBody_PagesPutRequestBody_sourceable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_put_request_body_source_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_put_request_body_source_member1.go new file mode 100644 index 000000000..a4f389516 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_put_request_body_source_member1.go @@ -0,0 +1,81 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemPagesPutRequestBody_sourceMember1 update the source for the repository. Must include the branch name and path. +type ItemItemPagesPutRequestBody_sourceMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The repository branch used to publish your site's source files. + branch *string +} +// NewItemItemPagesPutRequestBody_sourceMember1 instantiates a new ItemItemPagesPutRequestBody_sourceMember1 and sets the default values. +func NewItemItemPagesPutRequestBody_sourceMember1()(*ItemItemPagesPutRequestBody_sourceMember1) { + m := &ItemItemPagesPutRequestBody_sourceMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPagesPutRequestBody_sourceMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPagesPutRequestBody_sourceMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPagesPutRequestBody_sourceMember1(), 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 *ItemItemPagesPutRequestBody_sourceMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBranch gets the branch property value. The repository branch used to publish your site's source files. +// returns a *string when successful +func (m *ItemItemPagesPutRequestBody_sourceMember1) GetBranch()(*string) { + return m.branch +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPagesPutRequestBody_sourceMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranch(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemPagesPutRequestBody_sourceMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("branch", m.GetBranch()) + 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 *ItemItemPagesPutRequestBody_sourceMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBranch sets the branch property value. The repository branch used to publish your site's source files. +func (m *ItemItemPagesPutRequestBody_sourceMember1) SetBranch(value *string)() { + m.branch = value +} +type ItemItemPagesPutRequestBody_sourceMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBranch()(*string) + SetBranch(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_request_builder.go new file mode 100644 index 000000000..3c913bb2d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pages_request_builder.go @@ -0,0 +1,179 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPagesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pages +type ItemItemPagesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Builds the builds property +// returns a *ItemItemPagesBuildsRequestBuilder when successful +func (m *ItemItemPagesRequestBuilder) Builds()(*ItemItemPagesBuildsRequestBuilder) { + return NewItemItemPagesBuildsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPagesRequestBuilderInternal instantiates a new ItemItemPagesRequestBuilder and sets the default values. +func NewItemItemPagesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesRequestBuilder) { + m := &ItemItemPagesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pages", pathParameters), + } + return m +} +// NewItemItemPagesRequestBuilder instantiates a new ItemItemPagesRequestBuilder and sets the default values. +func NewItemItemPagesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPagesRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages).The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.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 BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pages/pages#delete-a-apiname-pages-site +func (m *ItemItemPagesRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Deployments the deployments property +// returns a *ItemItemPagesDeploymentsRequestBuilder when successful +func (m *ItemItemPagesRequestBuilder) Deployments()(*ItemItemPagesDeploymentsRequestBuilder) { + return NewItemItemPagesDeploymentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get gets information about a GitHub Pages site.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a Pageable 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/pages/pages#get-a-apiname-pages-site +func (m *ItemItemPagesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Pageable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePageFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Pageable), nil +} +// Health the health property +// returns a *ItemItemPagesHealthRequestBuilder when successful +func (m *ItemItemPagesRequestBuilder) Health()(*ItemItemPagesHealthRequestBuilder) { + return NewItemItemPagesHealthRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Post configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)."The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a Pageable when successful +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pages/pages#create-a-apiname-pages-site +func (m *ItemItemPagesRequestBuilder) Post(ctx context.Context, body ItemItemPagesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Pageable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePageFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Pageable), nil +} +// Put updates information for a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages).The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.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 400 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pages/pages#update-information-about-a-apiname-pages-site +func (m *ItemItemPagesRequestBuilder) Put(ctx context.Context, body ItemItemPagesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation deletes a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages).The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPagesRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets information about a GitHub Pages site.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPagesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)."The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPagesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPagesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPutRequestInformation updates information for a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages).The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPagesRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemPagesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json, application/scim+json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPagesRequestBuilder when successful +func (m *ItemItemPagesRequestBuilder) WithUrl(rawUrl string)(*ItemItemPagesRequestBuilder) { + return NewItemItemPagesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_private_vulnerability_reporting_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_private_vulnerability_reporting_get_response.go new file mode 100644 index 000000000..1734e9280 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_private_vulnerability_reporting_get_response.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPrivateVulnerabilityReportingGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether or not private vulnerability reporting is enabled for the repository. + enabled *bool +} +// NewItemItemPrivateVulnerabilityReportingGetResponse instantiates a new ItemItemPrivateVulnerabilityReportingGetResponse and sets the default values. +func NewItemItemPrivateVulnerabilityReportingGetResponse()(*ItemItemPrivateVulnerabilityReportingGetResponse) { + m := &ItemItemPrivateVulnerabilityReportingGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPrivateVulnerabilityReportingGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPrivateVulnerabilityReportingGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPrivateVulnerabilityReportingGetResponse(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemItemPrivateVulnerabilityReportingGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. Whether or not private vulnerability reporting is enabled for the repository. +// returns a *bool when successful +func (m *ItemItemPrivateVulnerabilityReportingGetResponse) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPrivateVulnerabilityReportingGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemPrivateVulnerabilityReportingGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemPrivateVulnerabilityReportingGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. Whether or not private vulnerability reporting is enabled for the repository. +func (m *ItemItemPrivateVulnerabilityReportingGetResponse) SetEnabled(value *bool)() { + m.enabled = value +} +type ItemItemPrivateVulnerabilityReportingGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_private_vulnerability_reporting_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_private_vulnerability_reporting_request_builder.go new file mode 100644 index 000000000..99781927e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_private_vulnerability_reporting_request_builder.go @@ -0,0 +1,115 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPrivateVulnerabilityReportingRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\private-vulnerability-reporting +type ItemItemPrivateVulnerabilityReportingRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPrivateVulnerabilityReportingRequestBuilderInternal instantiates a new ItemItemPrivateVulnerabilityReportingRequestBuilder and sets the default values. +func NewItemItemPrivateVulnerabilityReportingRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPrivateVulnerabilityReportingRequestBuilder) { + m := &ItemItemPrivateVulnerabilityReportingRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/private-vulnerability-reporting", pathParameters), + } + return m +} +// NewItemItemPrivateVulnerabilityReportingRequestBuilder instantiates a new ItemItemPrivateVulnerabilityReportingRequestBuilder and sets the default values. +func NewItemItemPrivateVulnerabilityReportingRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPrivateVulnerabilityReportingRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPrivateVulnerabilityReportingRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete disables private vulnerability reporting for a repository. The authenticated user must have admin access to the repository. For more information, see "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)". +// returns a BasicError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository +func (m *ItemItemPrivateVulnerabilityReportingRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get returns a boolean indicating whether or not private vulnerability reporting is enabled for the repository. For more information, see "[Evaluating the security settings of a repository](https://docs.github.com/code-security/security-advisories/working-with-repository-security-advisories/evaluating-the-security-settings-of-a-repository)". +// returns a ItemItemPrivateVulnerabilityReportingGetResponseable when successful +// returns a BasicError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#check-if-private-vulnerability-reporting-is-enabled-for-a-repository +func (m *ItemItemPrivateVulnerabilityReportingRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemPrivateVulnerabilityReportingGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemPrivateVulnerabilityReportingGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemPrivateVulnerabilityReportingGetResponseable), nil +} +// Put enables private vulnerability reporting for a repository. The authenticated user must have admin access to the repository. For more information, see "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)." +// returns a BasicError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository +func (m *ItemItemPrivateVulnerabilityReportingRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation disables private vulnerability reporting for a repository. The authenticated user must have admin access to the repository. For more information, see "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)". +// returns a *RequestInformation when successful +func (m *ItemItemPrivateVulnerabilityReportingRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json, application/scim+json") + return requestInfo, nil +} +// ToGetRequestInformation returns a boolean indicating whether or not private vulnerability reporting is enabled for the repository. For more information, see "[Evaluating the security settings of a repository](https://docs.github.com/code-security/security-advisories/working-with-repository-security-advisories/evaluating-the-security-settings-of-a-repository)". +// returns a *RequestInformation when successful +func (m *ItemItemPrivateVulnerabilityReportingRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation enables private vulnerability reporting for a repository. The authenticated user must have admin access to the repository. For more information, see "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)." +// returns a *RequestInformation when successful +func (m *ItemItemPrivateVulnerabilityReportingRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json, application/scim+json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPrivateVulnerabilityReportingRequestBuilder when successful +func (m *ItemItemPrivateVulnerabilityReportingRequestBuilder) WithUrl(rawUrl string)(*ItemItemPrivateVulnerabilityReportingRequestBuilder) { + return NewItemItemPrivateVulnerabilityReportingRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_projects_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_projects_post_request_body.go new file mode 100644 index 000000000..8e34c9023 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_projects_post_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemProjectsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The description of the project. + body *string + // The name of the project. + name *string +} +// NewItemItemProjectsPostRequestBody instantiates a new ItemItemProjectsPostRequestBody and sets the default values. +func NewItemItemProjectsPostRequestBody()(*ItemItemProjectsPostRequestBody) { + m := &ItemItemProjectsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemProjectsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemProjectsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemProjectsPostRequestBody(), 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 *ItemItemProjectsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The description of the project. +// returns a *string when successful +func (m *ItemItemProjectsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemProjectsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the project. +// returns a *string when successful +func (m *ItemItemProjectsPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemProjectsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemProjectsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The description of the project. +func (m *ItemItemProjectsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetName sets the name property value. The name of the project. +func (m *ItemItemProjectsPostRequestBody) SetName(value *string)() { + m.name = value +} +type ItemItemProjectsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetName()(*string) + SetBody(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_projects_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_projects_request_builder.go new file mode 100644 index 000000000..0bea6ded5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_projects_request_builder.go @@ -0,0 +1,125 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + iedf64ed44a0011ca62087b788afaa0899b92df0467761a33f17befb5c6646f39 "github.com/octokit/go-sdk/pkg/github/repos/item/item/projects" +) + +// ItemItemProjectsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\projects +type ItemItemProjectsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemProjectsRequestBuilderGetQueryParameters lists the projects in a repository. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +type ItemItemProjectsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Indicates the state of the projects to return. + State *iedf64ed44a0011ca62087b788afaa0899b92df0467761a33f17befb5c6646f39.GetStateQueryParameterType `uriparametername:"state"` +} +// NewItemItemProjectsRequestBuilderInternal instantiates a new ItemItemProjectsRequestBuilder and sets the default values. +func NewItemItemProjectsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemProjectsRequestBuilder) { + m := &ItemItemProjectsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/projects{?page*,per_page*,state*}", pathParameters), + } + return m +} +// NewItemItemProjectsRequestBuilder instantiates a new ItemItemProjectsRequestBuilder and sets the default values. +func NewItemItemProjectsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemProjectsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemProjectsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the projects in a repository. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a []Projectable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/projects/projects#list-repository-projects +func (m *ItemItemProjectsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemProjectsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable) + } + } + return val, nil +} +// Post creates a repository project board. Returns a `410 Gone` status if projects are disabled in the repository or if the repository does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a Projectable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/projects/projects#create-a-repository-project +func (m *ItemItemProjectsRequestBuilder) Post(ctx context.Context, body ItemItemProjectsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "410": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable), nil +} +// ToGetRequestInformation lists the projects in a repository. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a *RequestInformation when successful +func (m *ItemItemProjectsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemProjectsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a repository project board. Returns a `410 Gone` status if projects are disabled in the repository or if the repository does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a *RequestInformation when successful +func (m *ItemItemProjectsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemProjectsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemProjectsRequestBuilder when successful +func (m *ItemItemProjectsRequestBuilder) WithUrl(rawUrl string)(*ItemItemProjectsRequestBuilder) { + return NewItemItemProjectsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_properties_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_properties_request_builder.go new file mode 100644 index 000000000..0ed8e8623 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_properties_request_builder.go @@ -0,0 +1,28 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemPropertiesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\properties +type ItemItemPropertiesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPropertiesRequestBuilderInternal instantiates a new ItemItemPropertiesRequestBuilder and sets the default values. +func NewItemItemPropertiesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPropertiesRequestBuilder) { + m := &ItemItemPropertiesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/properties", pathParameters), + } + return m +} +// NewItemItemPropertiesRequestBuilder instantiates a new ItemItemPropertiesRequestBuilder and sets the default values. +func NewItemItemPropertiesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPropertiesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPropertiesRequestBuilderInternal(urlParams, requestAdapter) +} +// Values the values property +// returns a *ItemItemPropertiesValuesRequestBuilder when successful +func (m *ItemItemPropertiesRequestBuilder) Values()(*ItemItemPropertiesValuesRequestBuilder) { + return NewItemItemPropertiesValuesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_properties_values_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_properties_values_patch_request_body.go new file mode 100644 index 000000000..ad4191091 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_properties_values_patch_request_body.go @@ -0,0 +1,93 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemPropertiesValuesPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A list of custom property names and associated values to apply to the repositories. + properties []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyValueable +} +// NewItemItemPropertiesValuesPatchRequestBody instantiates a new ItemItemPropertiesValuesPatchRequestBody and sets the default values. +func NewItemItemPropertiesValuesPatchRequestBody()(*ItemItemPropertiesValuesPatchRequestBody) { + m := &ItemItemPropertiesValuesPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPropertiesValuesPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPropertiesValuesPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPropertiesValuesPatchRequestBody(), 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 *ItemItemPropertiesValuesPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPropertiesValuesPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCustomPropertyValueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyValueable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyValueable) + } + } + m.SetProperties(res) + } + return nil + } + return res +} +// GetProperties gets the properties property value. A list of custom property names and associated values to apply to the repositories. +// returns a []CustomPropertyValueable when successful +func (m *ItemItemPropertiesValuesPatchRequestBody) GetProperties()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyValueable) { + return m.properties +} +// Serialize serializes information the current object +func (m *ItemItemPropertiesValuesPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetProperties() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetProperties())) + for i, v := range m.GetProperties() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("properties", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemPropertiesValuesPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetProperties sets the properties property value. A list of custom property names and associated values to apply to the repositories. +func (m *ItemItemPropertiesValuesPatchRequestBody) SetProperties(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyValueable)() { + m.properties = value +} +type ItemItemPropertiesValuesPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetProperties()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyValueable) + SetProperties(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyValueable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_properties_values_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_properties_values_request_builder.go new file mode 100644 index 000000000..dc4ca6eb5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_properties_values_request_builder.go @@ -0,0 +1,101 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPropertiesValuesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\properties\values +type ItemItemPropertiesValuesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPropertiesValuesRequestBuilderInternal instantiates a new ItemItemPropertiesValuesRequestBuilder and sets the default values. +func NewItemItemPropertiesValuesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPropertiesValuesRequestBuilder) { + m := &ItemItemPropertiesValuesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/properties/values", pathParameters), + } + return m +} +// NewItemItemPropertiesValuesRequestBuilder instantiates a new ItemItemPropertiesValuesRequestBuilder and sets the default values. +func NewItemItemPropertiesValuesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPropertiesValuesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPropertiesValuesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets all custom property values that are set for a repository.Users with read access to the repository can use this endpoint. +// returns a []CustomPropertyValueable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository +func (m *ItemItemPropertiesValuesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyValueable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCustomPropertyValueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyValueable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyValueable) + } + } + return val, nil +} +// Patch create new or update existing custom property values for a repository.Using a value of `null` for a custom property will remove or 'unset' the property value from the repository.Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint. +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/repos/custom-properties#create-or-update-custom-property-values-for-a-repository +func (m *ItemItemPropertiesValuesRequestBuilder) Patch(ctx context.Context, body ItemItemPropertiesValuesPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets all custom property values that are set for a repository.Users with read access to the repository can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPropertiesValuesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation create new or update existing custom property values for a repository.Using a value of `null` for a custom property will remove or 'unset' the property value from the repository.Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPropertiesValuesRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemPropertiesValuesPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPropertiesValuesRequestBuilder when successful +func (m *ItemItemPropertiesValuesRequestBuilder) WithUrl(rawUrl string)(*ItemItemPropertiesValuesRequestBuilder) { + return NewItemItemPropertiesValuesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_item_reactions_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_item_reactions_post_request_body.go new file mode 100644 index 000000000..27ac2c6a6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsCommentsItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemPullsCommentsItemReactionsPostRequestBody instantiates a new ItemItemPullsCommentsItemReactionsPostRequestBody and sets the default values. +func NewItemItemPullsCommentsItemReactionsPostRequestBody()(*ItemItemPullsCommentsItemReactionsPostRequestBody) { + m := &ItemItemPullsCommentsItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsCommentsItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsCommentsItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsCommentsItemReactionsPostRequestBody(), 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 *ItemItemPullsCommentsItemReactionsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsCommentsItemReactionsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemPullsCommentsItemReactionsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemPullsCommentsItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemPullsCommentsItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_item_reactions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_item_reactions_request_builder.go new file mode 100644 index 000000000..4ce76f043 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_item_reactions_request_builder.go @@ -0,0 +1,120 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i4616a3143f9ba47e6ce7ed361a63486cb652bc76f85469b9e0a828664000ecb5 "github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/comments/item/reactions" +) + +// ItemItemPullsCommentsItemReactionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\comments\{comment_id}\reactions +type ItemItemPullsCommentsItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPullsCommentsItemReactionsRequestBuilderGetQueryParameters list the reactions to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). +type ItemItemPullsCommentsItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a pull request review comment. + Content *i4616a3143f9ba47e6ce7ed361a63486cb652bc76f85469b9e0a828664000ecb5.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByReaction_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.pulls.comments.item.reactions.item collection +// returns a *ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemPullsCommentsItemReactionsRequestBuilder) ByReaction_id(reaction_id int32)(*ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["reaction_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(reaction_id), 10) + return NewItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPullsCommentsItemReactionsRequestBuilderInternal instantiates a new ItemItemPullsCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemItemPullsCommentsItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsCommentsItemReactionsRequestBuilder) { + m := &ItemItemPullsCommentsItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/comments/{comment_id}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemPullsCommentsItemReactionsRequestBuilder instantiates a new ItemItemPullsCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemItemPullsCommentsItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsCommentsItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsCommentsItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the reactions to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). +// returns a []Reactionable 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/reactions/reactions#list-reactions-for-a-pull-request-review-comment +func (m *ItemItemPullsCommentsItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsCommentsItemReactionsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable) + } + } + return val, nil +} +// Post create a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). A response with an HTTP `200` status means that you already added the reaction type to this pull request review comment. +// returns a Reactionable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment +func (m *ItemItemPullsCommentsItemReactionsRequestBuilder) Post(ctx context.Context, body ItemItemPullsCommentsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable), nil +} +// ToGetRequestInformation list the reactions to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). +// returns a *RequestInformation when successful +func (m *ItemItemPullsCommentsItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsCommentsItemReactionsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation create a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). A response with an HTTP `200` status means that you already added the reaction type to this pull request review comment. +// returns a *RequestInformation when successful +func (m *ItemItemPullsCommentsItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPullsCommentsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsCommentsItemReactionsRequestBuilder when successful +func (m *ItemItemPullsCommentsItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsCommentsItemReactionsRequestBuilder) { + return NewItemItemPullsCommentsItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_item_reactions_with_reaction_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_item_reactions_with_reaction_item_request_builder.go new file mode 100644 index 000000000..aec7eadcc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_item_reactions_with_reaction_item_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\comments\{comment_id}\reactions\{reaction_id} +type ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilderInternal instantiates a new ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder) { + m := &ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/comments/{comment_id}/reactions/{reaction_id}", pathParameters), + } + return m +} +// NewItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder instantiates a new ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.`Delete a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction +func (m *ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.`Delete a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). +// returns a *RequestInformation when successful +func (m *ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder) { + return NewItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_item_with_comment_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_item_with_comment_patch_request_body.go new file mode 100644 index 000000000..60c34fe02 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_item_with_comment_patch_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsCommentsItemWithComment_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The text of the reply to the review comment. + body *string +} +// NewItemItemPullsCommentsItemWithComment_PatchRequestBody instantiates a new ItemItemPullsCommentsItemWithComment_PatchRequestBody and sets the default values. +func NewItemItemPullsCommentsItemWithComment_PatchRequestBody()(*ItemItemPullsCommentsItemWithComment_PatchRequestBody) { + m := &ItemItemPullsCommentsItemWithComment_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsCommentsItemWithComment_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsCommentsItemWithComment_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsCommentsItemWithComment_PatchRequestBody(), 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 *ItemItemPullsCommentsItemWithComment_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The text of the reply to the review comment. +// returns a *string when successful +func (m *ItemItemPullsCommentsItemWithComment_PatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsCommentsItemWithComment_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemPullsCommentsItemWithComment_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemItemPullsCommentsItemWithComment_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The text of the reply to the review comment. +func (m *ItemItemPullsCommentsItemWithComment_PatchRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemItemPullsCommentsItemWithComment_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_request_builder.go new file mode 100644 index 000000000..aff133cdb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_request_builder.go @@ -0,0 +1,85 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + ib4d397322ec768ed4fc8434d537dcd71b5e6aa74ead18e7de1d535c73d675c96 "github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/comments" +) + +// ItemItemPullsCommentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\comments +type ItemItemPullsCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPullsCommentsRequestBuilderGetQueryParameters lists review comments for all pull requests in a repository. By default,review comments are in ascending order by ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemPullsCommentsRequestBuilderGetQueryParameters struct { + // The direction to sort results. Ignored without `sort` parameter. + Direction *ib4d397322ec768ed4fc8434d537dcd71b5e6aa74ead18e7de1d535c73d675c96.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + Sort *ib4d397322ec768ed4fc8434d537dcd71b5e6aa74ead18e7de1d535c73d675c96.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByComment_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.pulls.comments.item collection +// returns a *ItemItemPullsCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemItemPullsCommentsRequestBuilder) ByComment_id(comment_id int32)(*ItemItemPullsCommentsWithComment_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["comment_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(comment_id), 10) + return NewItemItemPullsCommentsWithComment_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPullsCommentsRequestBuilderInternal instantiates a new ItemItemPullsCommentsRequestBuilder and sets the default values. +func NewItemItemPullsCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsCommentsRequestBuilder) { + m := &ItemItemPullsCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/comments{?direction*,page*,per_page*,since*,sort*}", pathParameters), + } + return m +} +// NewItemItemPullsCommentsRequestBuilder instantiates a new ItemItemPullsCommentsRequestBuilder and sets the default values. +func NewItemItemPullsCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists review comments for all pull requests in a repository. By default,review comments are in ascending order by ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []PullRequestReviewCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository +func (m *ItemItemPullsCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsCommentsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestReviewCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewCommentable) + } + } + return val, nil +} +// ToGetRequestInformation lists review comments for all pull requests in a repository. By default,review comments are in ascending order by ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsCommentsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsCommentsRequestBuilder when successful +func (m *ItemItemPullsCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsCommentsRequestBuilder) { + return NewItemItemPullsCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_with_comment_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_with_comment_item_request_builder.go new file mode 100644 index 000000000..2c884d7b0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_comments_with_comment_item_request_builder.go @@ -0,0 +1,124 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPullsCommentsWithComment_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\comments\{comment_id} +type ItemItemPullsCommentsWithComment_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsCommentsWithComment_ItemRequestBuilderInternal instantiates a new ItemItemPullsCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemItemPullsCommentsWithComment_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsCommentsWithComment_ItemRequestBuilder) { + m := &ItemItemPullsCommentsWithComment_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/comments/{comment_id}", pathParameters), + } + return m +} +// NewItemItemPullsCommentsWithComment_ItemRequestBuilder instantiates a new ItemItemPullsCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemItemPullsCommentsWithComment_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsCommentsWithComment_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsCommentsWithComment_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a review comment. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request +func (m *ItemItemPullsCommentsWithComment_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get provides details for a specified review comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewCommentable 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/pulls/comments#get-a-review-comment-for-a-pull-request +func (m *ItemItemPullsCommentsWithComment_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestReviewCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewCommentable), nil +} +// Patch edits the content of a specified review comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request +func (m *ItemItemPullsCommentsWithComment_ItemRequestBuilder) Patch(ctx context.Context, body ItemItemPullsCommentsItemWithComment_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewCommentable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestReviewCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewCommentable), nil +} +// Reactions the reactions property +// returns a *ItemItemPullsCommentsItemReactionsRequestBuilder when successful +func (m *ItemItemPullsCommentsWithComment_ItemRequestBuilder) Reactions()(*ItemItemPullsCommentsItemReactionsRequestBuilder) { + return NewItemItemPullsCommentsItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a review comment. +// returns a *RequestInformation when successful +func (m *ItemItemPullsCommentsWithComment_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation provides details for a specified review comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsCommentsWithComment_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation edits the content of a specified review comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsCommentsWithComment_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemPullsCommentsItemWithComment_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemItemPullsCommentsWithComment_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsCommentsWithComment_ItemRequestBuilder) { + return NewItemItemPullsCommentsWithComment_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_codespaces_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_codespaces_post_request_body.go new file mode 100644 index 000000000..7ec711f3f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_codespaces_post_request_body.go @@ -0,0 +1,312 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemCodespacesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // IP for location auto-detection when proxying a request + client_ip *string + // Path to devcontainer.json config to use for this codespace + devcontainer_path *string + // Display name for this codespace + display_name *string + // Time in minutes before codespace stops from inactivity + idle_timeout_minutes *int32 + // The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. + location *string + // Machine type to use for this codespace + machine *string + // Whether to authorize requested permissions from devcontainer.json + multi_repo_permissions_opt_out *bool + // Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days). + retention_period_minutes *int32 + // Working directory for this codespace + working_directory *string +} +// NewItemItemPullsItemCodespacesPostRequestBody instantiates a new ItemItemPullsItemCodespacesPostRequestBody and sets the default values. +func NewItemItemPullsItemCodespacesPostRequestBody()(*ItemItemPullsItemCodespacesPostRequestBody) { + m := &ItemItemPullsItemCodespacesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemCodespacesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemCodespacesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemCodespacesPostRequestBody(), 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 *ItemItemPullsItemCodespacesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientIp gets the client_ip property value. IP for location auto-detection when proxying a request +// returns a *string when successful +func (m *ItemItemPullsItemCodespacesPostRequestBody) GetClientIp()(*string) { + return m.client_ip +} +// GetDevcontainerPath gets the devcontainer_path property value. Path to devcontainer.json config to use for this codespace +// returns a *string when successful +func (m *ItemItemPullsItemCodespacesPostRequestBody) GetDevcontainerPath()(*string) { + return m.devcontainer_path +} +// GetDisplayName gets the display_name property value. Display name for this codespace +// returns a *string when successful +func (m *ItemItemPullsItemCodespacesPostRequestBody) GetDisplayName()(*string) { + return m.display_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemCodespacesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_ip"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientIp(val) + } + return nil + } + res["devcontainer_path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDevcontainerPath(val) + } + return nil + } + res["display_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["idle_timeout_minutes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetIdleTimeoutMinutes(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["machine"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMachine(val) + } + return nil + } + res["multi_repo_permissions_opt_out"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMultiRepoPermissionsOptOut(val) + } + return nil + } + res["retention_period_minutes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRetentionPeriodMinutes(val) + } + return nil + } + res["working_directory"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWorkingDirectory(val) + } + return nil + } + return res +} +// GetIdleTimeoutMinutes gets the idle_timeout_minutes property value. Time in minutes before codespace stops from inactivity +// returns a *int32 when successful +func (m *ItemItemPullsItemCodespacesPostRequestBody) GetIdleTimeoutMinutes()(*int32) { + return m.idle_timeout_minutes +} +// GetLocation gets the location property value. The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. +// returns a *string when successful +func (m *ItemItemPullsItemCodespacesPostRequestBody) GetLocation()(*string) { + return m.location +} +// GetMachine gets the machine property value. Machine type to use for this codespace +// returns a *string when successful +func (m *ItemItemPullsItemCodespacesPostRequestBody) GetMachine()(*string) { + return m.machine +} +// GetMultiRepoPermissionsOptOut gets the multi_repo_permissions_opt_out property value. Whether to authorize requested permissions from devcontainer.json +// returns a *bool when successful +func (m *ItemItemPullsItemCodespacesPostRequestBody) GetMultiRepoPermissionsOptOut()(*bool) { + return m.multi_repo_permissions_opt_out +} +// GetRetentionPeriodMinutes gets the retention_period_minutes property value. Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days). +// returns a *int32 when successful +func (m *ItemItemPullsItemCodespacesPostRequestBody) GetRetentionPeriodMinutes()(*int32) { + return m.retention_period_minutes +} +// GetWorkingDirectory gets the working_directory property value. Working directory for this codespace +// returns a *string when successful +func (m *ItemItemPullsItemCodespacesPostRequestBody) GetWorkingDirectory()(*string) { + return m.working_directory +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemCodespacesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("client_ip", m.GetClientIp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("devcontainer_path", m.GetDevcontainerPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("display_name", m.GetDisplayName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("idle_timeout_minutes", m.GetIdleTimeoutMinutes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("machine", m.GetMachine()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("multi_repo_permissions_opt_out", m.GetMultiRepoPermissionsOptOut()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("retention_period_minutes", m.GetRetentionPeriodMinutes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("working_directory", m.GetWorkingDirectory()) + 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 *ItemItemPullsItemCodespacesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientIp sets the client_ip property value. IP for location auto-detection when proxying a request +func (m *ItemItemPullsItemCodespacesPostRequestBody) SetClientIp(value *string)() { + m.client_ip = value +} +// SetDevcontainerPath sets the devcontainer_path property value. Path to devcontainer.json config to use for this codespace +func (m *ItemItemPullsItemCodespacesPostRequestBody) SetDevcontainerPath(value *string)() { + m.devcontainer_path = value +} +// SetDisplayName sets the display_name property value. Display name for this codespace +func (m *ItemItemPullsItemCodespacesPostRequestBody) SetDisplayName(value *string)() { + m.display_name = value +} +// SetIdleTimeoutMinutes sets the idle_timeout_minutes property value. Time in minutes before codespace stops from inactivity +func (m *ItemItemPullsItemCodespacesPostRequestBody) SetIdleTimeoutMinutes(value *int32)() { + m.idle_timeout_minutes = value +} +// SetLocation sets the location property value. The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. +func (m *ItemItemPullsItemCodespacesPostRequestBody) SetLocation(value *string)() { + m.location = value +} +// SetMachine sets the machine property value. Machine type to use for this codespace +func (m *ItemItemPullsItemCodespacesPostRequestBody) SetMachine(value *string)() { + m.machine = value +} +// SetMultiRepoPermissionsOptOut sets the multi_repo_permissions_opt_out property value. Whether to authorize requested permissions from devcontainer.json +func (m *ItemItemPullsItemCodespacesPostRequestBody) SetMultiRepoPermissionsOptOut(value *bool)() { + m.multi_repo_permissions_opt_out = value +} +// SetRetentionPeriodMinutes sets the retention_period_minutes property value. Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days). +func (m *ItemItemPullsItemCodespacesPostRequestBody) SetRetentionPeriodMinutes(value *int32)() { + m.retention_period_minutes = value +} +// SetWorkingDirectory sets the working_directory property value. Working directory for this codespace +func (m *ItemItemPullsItemCodespacesPostRequestBody) SetWorkingDirectory(value *string)() { + m.working_directory = value +} +type ItemItemPullsItemCodespacesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientIp()(*string) + GetDevcontainerPath()(*string) + GetDisplayName()(*string) + GetIdleTimeoutMinutes()(*int32) + GetLocation()(*string) + GetMachine()(*string) + GetMultiRepoPermissionsOptOut()(*bool) + GetRetentionPeriodMinutes()(*int32) + GetWorkingDirectory()(*string) + SetClientIp(value *string)() + SetDevcontainerPath(value *string)() + SetDisplayName(value *string)() + SetIdleTimeoutMinutes(value *int32)() + SetLocation(value *string)() + SetMachine(value *string)() + SetMultiRepoPermissionsOptOut(value *bool)() + SetRetentionPeriodMinutes(value *int32)() + SetWorkingDirectory(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_codespaces_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_codespaces_request_builder.go new file mode 100644 index 000000000..1c47fbc4f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_codespaces_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPullsItemCodespacesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\codespaces +type ItemItemPullsItemCodespacesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsItemCodespacesRequestBuilderInternal instantiates a new ItemItemPullsItemCodespacesRequestBuilder and sets the default values. +func NewItemItemPullsItemCodespacesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCodespacesRequestBuilder) { + m := &ItemItemPullsItemCodespacesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/codespaces", pathParameters), + } + return m +} +// NewItemItemPullsItemCodespacesRequestBuilder instantiates a new ItemItemPullsItemCodespacesRequestBuilder and sets the default values. +func NewItemItemPullsItemCodespacesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCodespacesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemCodespacesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates a codespace owned by the authenticated user for the specified pull request.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a Codespaceable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a Codespace503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-from-a-pull-request +func (m *ItemItemPullsItemCodespacesRequestBuilder) Post(ctx context.Context, body ItemItemPullsItemCodespacesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespace503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespaceFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable), nil +} +// ToPostRequestInformation creates a codespace owned by the authenticated user for the specified pull request.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemCodespacesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPullsItemCodespacesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsItemCodespacesRequestBuilder when successful +func (m *ItemItemPullsItemCodespacesRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemCodespacesRequestBuilder) { + return NewItemItemPullsItemCodespacesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_comments_item_replies_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_comments_item_replies_post_request_body.go new file mode 100644 index 000000000..fb82874a5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_comments_item_replies_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemCommentsItemRepliesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The text of the review comment. + body *string +} +// NewItemItemPullsItemCommentsItemRepliesPostRequestBody instantiates a new ItemItemPullsItemCommentsItemRepliesPostRequestBody and sets the default values. +func NewItemItemPullsItemCommentsItemRepliesPostRequestBody()(*ItemItemPullsItemCommentsItemRepliesPostRequestBody) { + m := &ItemItemPullsItemCommentsItemRepliesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemCommentsItemRepliesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemCommentsItemRepliesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemCommentsItemRepliesPostRequestBody(), 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 *ItemItemPullsItemCommentsItemRepliesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The text of the review comment. +// returns a *string when successful +func (m *ItemItemPullsItemCommentsItemRepliesPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemCommentsItemRepliesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemCommentsItemRepliesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemItemPullsItemCommentsItemRepliesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The text of the review comment. +func (m *ItemItemPullsItemCommentsItemRepliesPostRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemItemPullsItemCommentsItemRepliesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_comments_item_replies_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_comments_item_replies_request_builder.go new file mode 100644 index 000000000..bf1665100 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_comments_item_replies_request_builder.go @@ -0,0 +1,65 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPullsItemCommentsItemRepliesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\comments\{comment_id}\replies +type ItemItemPullsItemCommentsItemRepliesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsItemCommentsItemRepliesRequestBuilderInternal instantiates a new ItemItemPullsItemCommentsItemRepliesRequestBuilder and sets the default values. +func NewItemItemPullsItemCommentsItemRepliesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCommentsItemRepliesRequestBuilder) { + m := &ItemItemPullsItemCommentsItemRepliesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/comments/{comment_id}/replies", pathParameters), + } + return m +} +// NewItemItemPullsItemCommentsItemRepliesRequestBuilder instantiates a new ItemItemPullsItemCommentsItemRepliesRequestBuilder and sets the default values. +func NewItemItemPullsItemCommentsItemRepliesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCommentsItemRepliesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemCommentsItemRepliesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates a reply to a review comment for a pull request. For the `comment_id`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewCommentable 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/pulls/comments#create-a-reply-for-a-review-comment +func (m *ItemItemPullsItemCommentsItemRepliesRequestBuilder) Post(ctx context.Context, body ItemItemPullsItemCommentsItemRepliesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewCommentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestReviewCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewCommentable), nil +} +// ToPostRequestInformation creates a reply to a review comment for a pull request. For the `comment_id`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemCommentsItemRepliesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPullsItemCommentsItemRepliesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsItemCommentsItemRepliesRequestBuilder when successful +func (m *ItemItemPullsItemCommentsItemRepliesRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemCommentsItemRepliesRequestBuilder) { + return NewItemItemPullsItemCommentsItemRepliesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_comments_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_comments_post_request_body.go new file mode 100644 index 000000000..179a5b726 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_comments_post_request_body.go @@ -0,0 +1,257 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemCommentsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The text of the review comment. + body *string + // The SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the `position`. + commit_id *string + // The ID of the review comment to reply to. To find the ID of a review comment with ["List review comments on a pull request"](#list-review-comments-on-a-pull-request). When specified, all parameters other than `body` in the request body are ignored. + in_reply_to *int32 + // **Required unless using `subject_type:file`**. The line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to. + line *int32 + // The relative path to the file that necessitates a comment. + path *string + // **This parameter is deprecated. Use `line` instead**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. + // Deprecated: + position *int32 + // **Required when using multi-line comments unless using `in_reply_to`**. The `start_line` is the first line in the pull request diff that your multi-line comment applies to. To learn more about multi-line comments, see "[Commenting on a pull request](https://docs.github.com/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. + start_line *int32 +} +// NewItemItemPullsItemCommentsPostRequestBody instantiates a new ItemItemPullsItemCommentsPostRequestBody and sets the default values. +func NewItemItemPullsItemCommentsPostRequestBody()(*ItemItemPullsItemCommentsPostRequestBody) { + m := &ItemItemPullsItemCommentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemCommentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemCommentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemCommentsPostRequestBody(), 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 *ItemItemPullsItemCommentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The text of the review comment. +// returns a *string when successful +func (m *ItemItemPullsItemCommentsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetCommitId gets the commit_id property value. The SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the `position`. +// returns a *string when successful +func (m *ItemItemPullsItemCommentsPostRequestBody) GetCommitId()(*string) { + return m.commit_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemCommentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["in_reply_to"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetInReplyTo(val) + } + return nil + } + res["line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLine(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["position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPosition(val) + } + return nil + } + res["start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartLine(val) + } + return nil + } + return res +} +// GetInReplyTo gets the in_reply_to property value. The ID of the review comment to reply to. To find the ID of a review comment with ["List review comments on a pull request"](#list-review-comments-on-a-pull-request). When specified, all parameters other than `body` in the request body are ignored. +// returns a *int32 when successful +func (m *ItemItemPullsItemCommentsPostRequestBody) GetInReplyTo()(*int32) { + return m.in_reply_to +} +// GetLine gets the line property value. **Required unless using `subject_type:file`**. The line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to. +// returns a *int32 when successful +func (m *ItemItemPullsItemCommentsPostRequestBody) GetLine()(*int32) { + return m.line +} +// GetPath gets the path property value. The relative path to the file that necessitates a comment. +// returns a *string when successful +func (m *ItemItemPullsItemCommentsPostRequestBody) GetPath()(*string) { + return m.path +} +// GetPosition gets the position property value. **This parameter is deprecated. Use `line` instead**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. +// Deprecated: +// returns a *int32 when successful +func (m *ItemItemPullsItemCommentsPostRequestBody) GetPosition()(*int32) { + return m.position +} +// GetStartLine gets the start_line property value. **Required when using multi-line comments unless using `in_reply_to`**. The `start_line` is the first line in the pull request diff that your multi-line comment applies to. To learn more about multi-line comments, see "[Commenting on a pull request](https://docs.github.com/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. +// returns a *int32 when successful +func (m *ItemItemPullsItemCommentsPostRequestBody) GetStartLine()(*int32) { + return m.start_line +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemCommentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("in_reply_to", m.GetInReplyTo()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("line", m.GetLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("position", m.GetPosition()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("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 *ItemItemPullsItemCommentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The text of the review comment. +func (m *ItemItemPullsItemCommentsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetCommitId sets the commit_id property value. The SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the `position`. +func (m *ItemItemPullsItemCommentsPostRequestBody) SetCommitId(value *string)() { + m.commit_id = value +} +// SetInReplyTo sets the in_reply_to property value. The ID of the review comment to reply to. To find the ID of a review comment with ["List review comments on a pull request"](#list-review-comments-on-a-pull-request). When specified, all parameters other than `body` in the request body are ignored. +func (m *ItemItemPullsItemCommentsPostRequestBody) SetInReplyTo(value *int32)() { + m.in_reply_to = value +} +// SetLine sets the line property value. **Required unless using `subject_type:file`**. The line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to. +func (m *ItemItemPullsItemCommentsPostRequestBody) SetLine(value *int32)() { + m.line = value +} +// SetPath sets the path property value. The relative path to the file that necessitates a comment. +func (m *ItemItemPullsItemCommentsPostRequestBody) SetPath(value *string)() { + m.path = value +} +// SetPosition sets the position property value. **This parameter is deprecated. Use `line` instead**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. +// Deprecated: +func (m *ItemItemPullsItemCommentsPostRequestBody) SetPosition(value *int32)() { + m.position = value +} +// SetStartLine sets the start_line property value. **Required when using multi-line comments unless using `in_reply_to`**. The `start_line` is the first line in the pull request diff that your multi-line comment applies to. To learn more about multi-line comments, see "[Commenting on a pull request](https://docs.github.com/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. +func (m *ItemItemPullsItemCommentsPostRequestBody) SetStartLine(value *int32)() { + m.start_line = value +} +type ItemItemPullsItemCommentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetCommitId()(*string) + GetInReplyTo()(*int32) + GetLine()(*int32) + GetPath()(*string) + GetPosition()(*int32) + GetStartLine()(*int32) + SetBody(value *string)() + SetCommitId(value *string)() + SetInReplyTo(value *int32)() + SetLine(value *int32)() + SetPath(value *string)() + SetPosition(value *int32)() + SetStartLine(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_comments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_comments_request_builder.go new file mode 100644 index 000000000..2e9ab5bb6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_comments_request_builder.go @@ -0,0 +1,123 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i7e815420148810f5a54942bff4de28f1f9dc6ef1e9fcbdfdb2255d0329e2272e "github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/item/comments" +) + +// ItemItemPullsItemCommentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\comments +type ItemItemPullsItemCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPullsItemCommentsRequestBuilderGetQueryParameters lists all review comments for a specified pull request. By default, review commentsare in ascending order by ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemPullsItemCommentsRequestBuilderGetQueryParameters struct { + // The direction to sort results. Ignored without `sort` parameter. + Direction *i7e815420148810f5a54942bff4de28f1f9dc6ef1e9fcbdfdb2255d0329e2272e.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + // The property to sort the results by. + Sort *i7e815420148810f5a54942bff4de28f1f9dc6ef1e9fcbdfdb2255d0329e2272e.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByComment_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.pulls.item.comments.item collection +// returns a *ItemItemPullsItemCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemItemPullsItemCommentsRequestBuilder) ByComment_id(comment_id int32)(*ItemItemPullsItemCommentsWithComment_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["comment_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(comment_id), 10) + return NewItemItemPullsItemCommentsWithComment_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPullsItemCommentsRequestBuilderInternal instantiates a new ItemItemPullsItemCommentsRequestBuilder and sets the default values. +func NewItemItemPullsItemCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCommentsRequestBuilder) { + m := &ItemItemPullsItemCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/comments{?direction*,page*,per_page*,since*,sort*}", pathParameters), + } + return m +} +// NewItemItemPullsItemCommentsRequestBuilder instantiates a new ItemItemPullsItemCommentsRequestBuilder and sets the default values. +func NewItemItemPullsItemCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all review comments for a specified pull request. By default, review commentsare in ascending order by ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []PullRequestReviewCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/comments#list-review-comments-on-a-pull-request +func (m *ItemItemPullsItemCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemCommentsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestReviewCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewCommentable) + } + } + return val, nil +} +// Post creates a review comment on the diff of a specified pull request. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/rest/issues/comments#create-an-issue-comment)."If your comment applies to more than one line in the pull request diff, you should use the parameters `line`, `side`, and optionally `start_line` and `start_side` in your request.The `position` parameter is deprecated. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewCommentable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request +func (m *ItemItemPullsItemCommentsRequestBuilder) Post(ctx context.Context, body ItemItemPullsItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewCommentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestReviewCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewCommentable), nil +} +// ToGetRequestInformation lists all review comments for a specified pull request. By default, review commentsare in ascending order by ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemCommentsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a review comment on the diff of a specified pull request. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/rest/issues/comments#create-an-issue-comment)."If your comment applies to more than one line in the pull request diff, you should use the parameters `line`, `side`, and optionally `start_line` and `start_side` in your request.The `position` parameter is deprecated. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemCommentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPullsItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsItemCommentsRequestBuilder when successful +func (m *ItemItemPullsItemCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemCommentsRequestBuilder) { + return NewItemItemPullsItemCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_comments_with_comment_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_comments_with_comment_item_request_builder.go new file mode 100644 index 000000000..9ab0a753b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_comments_with_comment_item_request_builder.go @@ -0,0 +1,28 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemPullsItemCommentsWithComment_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\comments\{comment_id} +type ItemItemPullsItemCommentsWithComment_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsItemCommentsWithComment_ItemRequestBuilderInternal instantiates a new ItemItemPullsItemCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemItemPullsItemCommentsWithComment_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCommentsWithComment_ItemRequestBuilder) { + m := &ItemItemPullsItemCommentsWithComment_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/comments/{comment_id}", pathParameters), + } + return m +} +// NewItemItemPullsItemCommentsWithComment_ItemRequestBuilder instantiates a new ItemItemPullsItemCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemItemPullsItemCommentsWithComment_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCommentsWithComment_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemCommentsWithComment_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Replies the replies property +// returns a *ItemItemPullsItemCommentsItemRepliesRequestBuilder when successful +func (m *ItemItemPullsItemCommentsWithComment_ItemRequestBuilder) Replies()(*ItemItemPullsItemCommentsItemRepliesRequestBuilder) { + return NewItemItemPullsItemCommentsItemRepliesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_commits_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_commits_request_builder.go new file mode 100644 index 000000000..69bfbb568 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_commits_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPullsItemCommitsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\commits +type ItemItemPullsItemCommitsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPullsItemCommitsRequestBuilderGetQueryParameters lists a maximum of 250 commits for a pull request. To receive a completecommit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/rest/commits/commits#list-commits)endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemPullsItemCommitsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemPullsItemCommitsRequestBuilderInternal instantiates a new ItemItemPullsItemCommitsRequestBuilder and sets the default values. +func NewItemItemPullsItemCommitsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCommitsRequestBuilder) { + m := &ItemItemPullsItemCommitsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/commits{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemPullsItemCommitsRequestBuilder instantiates a new ItemItemPullsItemCommitsRequestBuilder and sets the default values. +func NewItemItemPullsItemCommitsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCommitsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemCommitsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists a maximum of 250 commits for a pull request. To receive a completecommit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/rest/commits/commits#list-commits)endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []Commitable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request +func (m *ItemItemPullsItemCommitsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemCommitsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Commitable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommitFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Commitable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Commitable) + } + } + return val, nil +} +// ToGetRequestInformation lists a maximum of 250 commits for a pull request. To receive a completecommit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/rest/commits/commits#list-commits)endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemCommitsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemCommitsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsItemCommitsRequestBuilder when successful +func (m *ItemItemPullsItemCommitsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemCommitsRequestBuilder) { + return NewItemItemPullsItemCommitsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_files_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_files_request_builder.go new file mode 100644 index 000000000..1286f6397 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_files_request_builder.go @@ -0,0 +1,75 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPullsItemFilesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\files +type ItemItemPullsItemFilesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPullsItemFilesRequestBuilderGetQueryParameters lists the files in a specified pull request.**Note:** Responses include a maximum of 3000 files. The paginated responsereturns 30 files per page by default.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemPullsItemFilesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemPullsItemFilesRequestBuilderInternal instantiates a new ItemItemPullsItemFilesRequestBuilder and sets the default values. +func NewItemItemPullsItemFilesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemFilesRequestBuilder) { + m := &ItemItemPullsItemFilesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/files{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemPullsItemFilesRequestBuilder instantiates a new ItemItemPullsItemFilesRequestBuilder and sets the default values. +func NewItemItemPullsItemFilesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemFilesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemFilesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the files in a specified pull request.**Note:** Responses include a maximum of 3000 files. The paginated responsereturns 30 files per page by default.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []DiffEntryable when successful +// returns a ValidationError error when the service returns a 422 status code +// returns a BasicError error when the service returns a 500 status code +// returns a Files503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files +func (m *ItemItemPullsItemFilesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemFilesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DiffEntryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateFiles503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateDiffEntryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DiffEntryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.DiffEntryable) + } + } + return val, nil +} +// ToGetRequestInformation lists the files in a specified pull request.**Note:** Responses include a maximum of 3000 files. The paginated responsereturns 30 files per page by default.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemFilesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemFilesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsItemFilesRequestBuilder when successful +func (m *ItemItemPullsItemFilesRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemFilesRequestBuilder) { + return NewItemItemPullsItemFilesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_merge_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_merge_put_request_body.go new file mode 100644 index 000000000..f1a9d4859 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_merge_put_request_body.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemMergePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Extra detail to append to automatic commit message. + commit_message *string + // Title for the automatic commit message. + commit_title *string + // SHA that pull request head must match to allow merge. + sha *string +} +// NewItemItemPullsItemMergePutRequestBody instantiates a new ItemItemPullsItemMergePutRequestBody and sets the default values. +func NewItemItemPullsItemMergePutRequestBody()(*ItemItemPullsItemMergePutRequestBody) { + m := &ItemItemPullsItemMergePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemMergePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemMergePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemMergePutRequestBody(), 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 *ItemItemPullsItemMergePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitMessage gets the commit_message property value. Extra detail to append to automatic commit message. +// returns a *string when successful +func (m *ItemItemPullsItemMergePutRequestBody) GetCommitMessage()(*string) { + return m.commit_message +} +// GetCommitTitle gets the commit_title property value. Title for the automatic commit message. +// returns a *string when successful +func (m *ItemItemPullsItemMergePutRequestBody) GetCommitTitle()(*string) { + return m.commit_title +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemMergePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitMessage(val) + } + return nil + } + res["commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitTitle(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. SHA that pull request head must match to allow merge. +// returns a *string when successful +func (m *ItemItemPullsItemMergePutRequestBody) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemMergePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("commit_message", m.GetCommitMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_title", m.GetCommitTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *ItemItemPullsItemMergePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitMessage sets the commit_message property value. Extra detail to append to automatic commit message. +func (m *ItemItemPullsItemMergePutRequestBody) SetCommitMessage(value *string)() { + m.commit_message = value +} +// SetCommitTitle sets the commit_title property value. Title for the automatic commit message. +func (m *ItemItemPullsItemMergePutRequestBody) SetCommitTitle(value *string)() { + m.commit_title = value +} +// SetSha sets the sha property value. SHA that pull request head must match to allow merge. +func (m *ItemItemPullsItemMergePutRequestBody) SetSha(value *string)() { + m.sha = value +} +type ItemItemPullsItemMergePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommitMessage()(*string) + GetCommitTitle()(*string) + GetSha()(*string) + SetCommitMessage(value *string)() + SetCommitTitle(value *string)() + SetSha(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_merge_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_merge_request_builder.go new file mode 100644 index 000000000..0624d1521 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_merge_request_builder.go @@ -0,0 +1,95 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPullsItemMergeRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\merge +type ItemItemPullsItemMergeRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsItemMergeRequestBuilderInternal instantiates a new ItemItemPullsItemMergeRequestBuilder and sets the default values. +func NewItemItemPullsItemMergeRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemMergeRequestBuilder) { + m := &ItemItemPullsItemMergeRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/merge", pathParameters), + } + return m +} +// NewItemItemPullsItemMergeRequestBuilder instantiates a new ItemItemPullsItemMergeRequestBuilder and sets the default values. +func NewItemItemPullsItemMergeRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemMergeRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemMergeRequestBuilderInternal(urlParams, requestAdapter) +} +// Get checks if a pull request has been merged into the base branch. The HTTP status of the response indicates whether or not the pull request has been merged; the response body is empty. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged +func (m *ItemItemPullsItemMergeRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put merges a pull request into the base branch.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." +// returns a PullRequestMergeResultable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ItemItemPullsItemPullRequestMergeResult405Error error when the service returns a 405 status code +// returns a ItemItemPullsItemPullRequestMergeResult409Error error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request +func (m *ItemItemPullsItemMergeRequestBuilder) Put(ctx context.Context, body ItemItemPullsItemMergePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestMergeResultable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "405": CreateItemItemPullsItemPullRequestMergeResult405ErrorFromDiscriminatorValue, + "409": CreateItemItemPullsItemPullRequestMergeResult409ErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestMergeResultFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestMergeResultable), nil +} +// ToGetRequestInformation checks if a pull request has been merged into the base branch. The HTTP status of the response indicates whether or not the pull request has been merged; the response body is empty. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemMergeRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToPutRequestInformation merges a pull request into the base branch.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemMergeRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemPullsItemMergePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsItemMergeRequestBuilder when successful +func (m *ItemItemPullsItemMergeRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemMergeRequestBuilder) { + return NewItemItemPullsItemMergeRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_pull_request_merge_result405_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_pull_request_merge_result405_error.go new file mode 100644 index 000000000..81a20746f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_pull_request_merge_result405_error.go @@ -0,0 +1,117 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemPullRequestMergeResult405Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewItemItemPullsItemPullRequestMergeResult405Error instantiates a new ItemItemPullsItemPullRequestMergeResult405Error and sets the default values. +func NewItemItemPullsItemPullRequestMergeResult405Error()(*ItemItemPullsItemPullRequestMergeResult405Error) { + m := &ItemItemPullsItemPullRequestMergeResult405Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemPullRequestMergeResult405ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemPullRequestMergeResult405ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemPullRequestMergeResult405Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemItemPullsItemPullRequestMergeResult405Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemItemPullsItemPullRequestMergeResult405Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ItemItemPullsItemPullRequestMergeResult405Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemPullRequestMergeResult405Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ItemItemPullsItemPullRequestMergeResult405Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemPullRequestMergeResult405Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ItemItemPullsItemPullRequestMergeResult405Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemItemPullsItemPullRequestMergeResult405Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *ItemItemPullsItemPullRequestMergeResult405Error) SetMessage(value *string)() { + m.message = value +} +type ItemItemPullsItemPullRequestMergeResult405Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_pull_request_merge_result409_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_pull_request_merge_result409_error.go new file mode 100644 index 000000000..0ffb26f6e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_pull_request_merge_result409_error.go @@ -0,0 +1,117 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemPullRequestMergeResult409Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewItemItemPullsItemPullRequestMergeResult409Error instantiates a new ItemItemPullsItemPullRequestMergeResult409Error and sets the default values. +func NewItemItemPullsItemPullRequestMergeResult409Error()(*ItemItemPullsItemPullRequestMergeResult409Error) { + m := &ItemItemPullsItemPullRequestMergeResult409Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemPullRequestMergeResult409ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemPullRequestMergeResult409ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemPullRequestMergeResult409Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemItemPullsItemPullRequestMergeResult409Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemItemPullsItemPullRequestMergeResult409Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ItemItemPullsItemPullRequestMergeResult409Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemPullRequestMergeResult409Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ItemItemPullsItemPullRequestMergeResult409Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemPullRequestMergeResult409Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ItemItemPullsItemPullRequestMergeResult409Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemItemPullsItemPullRequestMergeResult409Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *ItemItemPullsItemPullRequestMergeResult409Error) SetMessage(value *string)() { + m.message = value +} +type ItemItemPullsItemPullRequestMergeResult409Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_requested_reviewers_delete_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_requested_reviewers_delete_request_body.go new file mode 100644 index 000000000..c463cd16c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_requested_reviewers_delete_request_body.go @@ -0,0 +1,121 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemRequested_reviewersDeleteRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // An array of user `login`s that will be removed. + reviewers []string + // An array of team `slug`s that will be removed. + team_reviewers []string +} +// NewItemItemPullsItemRequested_reviewersDeleteRequestBody instantiates a new ItemItemPullsItemRequested_reviewersDeleteRequestBody and sets the default values. +func NewItemItemPullsItemRequested_reviewersDeleteRequestBody()(*ItemItemPullsItemRequested_reviewersDeleteRequestBody) { + m := &ItemItemPullsItemRequested_reviewersDeleteRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemRequested_reviewersDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemRequested_reviewersDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemRequested_reviewersDeleteRequestBody(), 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 *ItemItemPullsItemRequested_reviewersDeleteRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemRequested_reviewersDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["reviewers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetReviewers(res) + } + return nil + } + res["team_reviewers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTeamReviewers(res) + } + return nil + } + return res +} +// GetReviewers gets the reviewers property value. An array of user `login`s that will be removed. +// returns a []string when successful +func (m *ItemItemPullsItemRequested_reviewersDeleteRequestBody) GetReviewers()([]string) { + return m.reviewers +} +// GetTeamReviewers gets the team_reviewers property value. An array of team `slug`s that will be removed. +// returns a []string when successful +func (m *ItemItemPullsItemRequested_reviewersDeleteRequestBody) GetTeamReviewers()([]string) { + return m.team_reviewers +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemRequested_reviewersDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetReviewers() != nil { + err := writer.WriteCollectionOfStringValues("reviewers", m.GetReviewers()) + if err != nil { + return err + } + } + if m.GetTeamReviewers() != nil { + err := writer.WriteCollectionOfStringValues("team_reviewers", m.GetTeamReviewers()) + 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 *ItemItemPullsItemRequested_reviewersDeleteRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetReviewers sets the reviewers property value. An array of user `login`s that will be removed. +func (m *ItemItemPullsItemRequested_reviewersDeleteRequestBody) SetReviewers(value []string)() { + m.reviewers = value +} +// SetTeamReviewers sets the team_reviewers property value. An array of team `slug`s that will be removed. +func (m *ItemItemPullsItemRequested_reviewersDeleteRequestBody) SetTeamReviewers(value []string)() { + m.team_reviewers = value +} +type ItemItemPullsItemRequested_reviewersDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetReviewers()([]string) + GetTeamReviewers()([]string) + SetReviewers(value []string)() + SetTeamReviewers(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_requested_reviewers_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_requested_reviewers_post_request_body.go new file mode 100644 index 000000000..878559f97 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_requested_reviewers_post_request_body.go @@ -0,0 +1,121 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemRequested_reviewersPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // An array of user `login`s that will be requested. + reviewers []string + // An array of team `slug`s that will be requested. + team_reviewers []string +} +// NewItemItemPullsItemRequested_reviewersPostRequestBody instantiates a new ItemItemPullsItemRequested_reviewersPostRequestBody and sets the default values. +func NewItemItemPullsItemRequested_reviewersPostRequestBody()(*ItemItemPullsItemRequested_reviewersPostRequestBody) { + m := &ItemItemPullsItemRequested_reviewersPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemRequested_reviewersPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemRequested_reviewersPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemRequested_reviewersPostRequestBody(), 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 *ItemItemPullsItemRequested_reviewersPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemRequested_reviewersPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["reviewers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetReviewers(res) + } + return nil + } + res["team_reviewers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTeamReviewers(res) + } + return nil + } + return res +} +// GetReviewers gets the reviewers property value. An array of user `login`s that will be requested. +// returns a []string when successful +func (m *ItemItemPullsItemRequested_reviewersPostRequestBody) GetReviewers()([]string) { + return m.reviewers +} +// GetTeamReviewers gets the team_reviewers property value. An array of team `slug`s that will be requested. +// returns a []string when successful +func (m *ItemItemPullsItemRequested_reviewersPostRequestBody) GetTeamReviewers()([]string) { + return m.team_reviewers +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemRequested_reviewersPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetReviewers() != nil { + err := writer.WriteCollectionOfStringValues("reviewers", m.GetReviewers()) + if err != nil { + return err + } + } + if m.GetTeamReviewers() != nil { + err := writer.WriteCollectionOfStringValues("team_reviewers", m.GetTeamReviewers()) + 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 *ItemItemPullsItemRequested_reviewersPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetReviewers sets the reviewers property value. An array of user `login`s that will be requested. +func (m *ItemItemPullsItemRequested_reviewersPostRequestBody) SetReviewers(value []string)() { + m.reviewers = value +} +// SetTeamReviewers sets the team_reviewers property value. An array of team `slug`s that will be requested. +func (m *ItemItemPullsItemRequested_reviewersPostRequestBody) SetTeamReviewers(value []string)() { + m.team_reviewers = value +} +type ItemItemPullsItemRequested_reviewersPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetReviewers()([]string) + GetTeamReviewers()([]string) + SetReviewers(value []string)() + SetTeamReviewers(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_requested_reviewers_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_requested_reviewers_request_builder.go new file mode 100644 index 000000000..872582d4a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_requested_reviewers_request_builder.go @@ -0,0 +1,127 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPullsItemRequested_reviewersRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\requested_reviewers +type ItemItemPullsItemRequested_reviewersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsItemRequested_reviewersRequestBuilderInternal instantiates a new ItemItemPullsItemRequested_reviewersRequestBuilder and sets the default values. +func NewItemItemPullsItemRequested_reviewersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemRequested_reviewersRequestBuilder) { + m := &ItemItemPullsItemRequested_reviewersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/requested_reviewers", pathParameters), + } + return m +} +// NewItemItemPullsItemRequested_reviewersRequestBuilder instantiates a new ItemItemPullsItemRequested_reviewersRequestBuilder and sets the default values. +func NewItemItemPullsItemRequested_reviewersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemRequested_reviewersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemRequested_reviewersRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes review requests from a pull request for a given set of users and/or teams. +// returns a PullRequestSimpleable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request +func (m *ItemItemPullsItemRequested_reviewersRequestBuilder) Delete(ctx context.Context, body ItemItemPullsItemRequested_reviewersDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestSimpleable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestSimpleable), nil +} +// Get gets the users or teams whose review is requested for a pull request. Once a requested reviewer submits a review, they are no longer considered a requested reviewer. Their review will instead be returned by the [List reviews for a pull request](https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request) operation. +// returns a PullRequestReviewRequestable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request +func (m *ItemItemPullsItemRequested_reviewersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewRequestable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestReviewRequestFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewRequestable), nil +} +// Post requests reviews for a pull request from a given set of users and/or teams.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." +// returns a PullRequestSimpleable when successful +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request +func (m *ItemItemPullsItemRequested_reviewersRequestBuilder) Post(ctx context.Context, body ItemItemPullsItemRequested_reviewersPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestSimpleable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestSimpleable), nil +} +// ToDeleteRequestInformation removes review requests from a pull request for a given set of users and/or teams. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemRequested_reviewersRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ItemItemPullsItemRequested_reviewersDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToGetRequestInformation gets the users or teams whose review is requested for a pull request. Once a requested reviewer submits a review, they are no longer considered a requested reviewer. Their review will instead be returned by the [List reviews for a pull request](https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request) operation. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemRequested_reviewersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation requests reviews for a pull request from a given set of users and/or teams.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemRequested_reviewersRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPullsItemRequested_reviewersPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsItemRequested_reviewersRequestBuilder when successful +func (m *ItemItemPullsItemRequested_reviewersRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemRequested_reviewersRequestBuilder) { + return NewItemItemPullsItemRequested_reviewersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_comments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_comments_request_builder.go new file mode 100644 index 000000000..30c3ae614 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_comments_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPullsItemReviewsItemCommentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\reviews\{review_id}\comments +type ItemItemPullsItemReviewsItemCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPullsItemReviewsItemCommentsRequestBuilderGetQueryParameters lists comments for a specific pull request review.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemPullsItemReviewsItemCommentsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemPullsItemReviewsItemCommentsRequestBuilderInternal instantiates a new ItemItemPullsItemReviewsItemCommentsRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsItemCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsItemCommentsRequestBuilder) { + m := &ItemItemPullsItemReviewsItemCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/reviews/{review_id}/comments{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemPullsItemReviewsItemCommentsRequestBuilder instantiates a new ItemItemPullsItemReviewsItemCommentsRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsItemCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsItemCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemReviewsItemCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists comments for a specific pull request review.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []ReviewCommentable 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/pulls/reviews#list-comments-for-a-pull-request-review +func (m *ItemItemPullsItemReviewsItemCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemReviewsItemCommentsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReviewCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReviewCommentable) + } + } + return val, nil +} +// ToGetRequestInformation lists comments for a specific pull request review.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemReviewsItemCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemReviewsItemCommentsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsItemReviewsItemCommentsRequestBuilder when successful +func (m *ItemItemPullsItemReviewsItemCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemReviewsItemCommentsRequestBuilder) { + return NewItemItemPullsItemReviewsItemCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_dismissals_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_dismissals_put_request_body.go new file mode 100644 index 000000000..729c18a0f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_dismissals_put_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemReviewsItemDismissalsPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The message for the pull request review dismissal + message *string +} +// NewItemItemPullsItemReviewsItemDismissalsPutRequestBody instantiates a new ItemItemPullsItemReviewsItemDismissalsPutRequestBody and sets the default values. +func NewItemItemPullsItemReviewsItemDismissalsPutRequestBody()(*ItemItemPullsItemReviewsItemDismissalsPutRequestBody) { + m := &ItemItemPullsItemReviewsItemDismissalsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemReviewsItemDismissalsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemReviewsItemDismissalsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemReviewsItemDismissalsPutRequestBody(), 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 *ItemItemPullsItemReviewsItemDismissalsPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemReviewsItemDismissalsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message for the pull request review dismissal +// returns a *string when successful +func (m *ItemItemPullsItemReviewsItemDismissalsPutRequestBody) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemReviewsItemDismissalsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ItemItemPullsItemReviewsItemDismissalsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. The message for the pull request review dismissal +func (m *ItemItemPullsItemReviewsItemDismissalsPutRequestBody) SetMessage(value *string)() { + m.message = value +} +type ItemItemPullsItemReviewsItemDismissalsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_dismissals_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_dismissals_request_builder.go new file mode 100644 index 000000000..b1d39f9e2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_dismissals_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPullsItemReviewsItemDismissalsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\reviews\{review_id}\dismissals +type ItemItemPullsItemReviewsItemDismissalsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsItemReviewsItemDismissalsRequestBuilderInternal instantiates a new ItemItemPullsItemReviewsItemDismissalsRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsItemDismissalsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsItemDismissalsRequestBuilder) { + m := &ItemItemPullsItemReviewsItemDismissalsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/reviews/{review_id}/dismissals", pathParameters), + } + return m +} +// NewItemItemPullsItemReviewsItemDismissalsRequestBuilder instantiates a new ItemItemPullsItemReviewsItemDismissalsRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsItemDismissalsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsItemDismissalsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemReviewsItemDismissalsRequestBuilderInternal(urlParams, requestAdapter) +} +// Put dismisses a specified review on a pull request.**Note:** To dismiss a pull request review on a [protected branch](https://docs.github.com/rest/branches/branch-protection),you must be a repository administrator or be included in the list of people or teamswho can dismiss pull request reviews.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request +func (m *ItemItemPullsItemReviewsItemDismissalsRequestBuilder) Put(ctx context.Context, body ItemItemPullsItemReviewsItemDismissalsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestReviewFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewable), nil +} +// ToPutRequestInformation dismisses a specified review on a pull request.**Note:** To dismiss a pull request review on a [protected branch](https://docs.github.com/rest/branches/branch-protection),you must be a repository administrator or be included in the list of people or teamswho can dismiss pull request reviews.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemReviewsItemDismissalsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemPullsItemReviewsItemDismissalsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsItemReviewsItemDismissalsRequestBuilder when successful +func (m *ItemItemPullsItemReviewsItemDismissalsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemReviewsItemDismissalsRequestBuilder) { + return NewItemItemPullsItemReviewsItemDismissalsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_events_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_events_post_request_body.go new file mode 100644 index 000000000..fb6507955 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_events_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemReviewsItemEventsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The body text of the pull request review + body *string +} +// NewItemItemPullsItemReviewsItemEventsPostRequestBody instantiates a new ItemItemPullsItemReviewsItemEventsPostRequestBody and sets the default values. +func NewItemItemPullsItemReviewsItemEventsPostRequestBody()(*ItemItemPullsItemReviewsItemEventsPostRequestBody) { + m := &ItemItemPullsItemReviewsItemEventsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemReviewsItemEventsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemReviewsItemEventsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemReviewsItemEventsPostRequestBody(), 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 *ItemItemPullsItemReviewsItemEventsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The body text of the pull request review +// returns a *string when successful +func (m *ItemItemPullsItemReviewsItemEventsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemReviewsItemEventsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemReviewsItemEventsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemItemPullsItemReviewsItemEventsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The body text of the pull request review +func (m *ItemItemPullsItemReviewsItemEventsPostRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemItemPullsItemReviewsItemEventsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_events_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_events_request_builder.go new file mode 100644 index 000000000..6468a619b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_events_request_builder.go @@ -0,0 +1,69 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPullsItemReviewsItemEventsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\reviews\{review_id}\events +type ItemItemPullsItemReviewsItemEventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsItemReviewsItemEventsRequestBuilderInternal instantiates a new ItemItemPullsItemReviewsItemEventsRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsItemEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsItemEventsRequestBuilder) { + m := &ItemItemPullsItemReviewsItemEventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/reviews/{review_id}/events", pathParameters), + } + return m +} +// NewItemItemPullsItemReviewsItemEventsRequestBuilder instantiates a new ItemItemPullsItemReviewsItemEventsRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsItemEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsItemEventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemReviewsItemEventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post submits a pending review for a pull request. For more information about creating a pending review for a pull request, see "[Create a review for a pull request](https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request +func (m *ItemItemPullsItemReviewsItemEventsRequestBuilder) Post(ctx context.Context, body ItemItemPullsItemReviewsItemEventsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestReviewFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewable), nil +} +// ToPostRequestInformation submits a pending review for a pull request. For more information about creating a pending review for a pull request, see "[Create a review for a pull request](https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemReviewsItemEventsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPullsItemReviewsItemEventsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsItemReviewsItemEventsRequestBuilder when successful +func (m *ItemItemPullsItemReviewsItemEventsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemReviewsItemEventsRequestBuilder) { + return NewItemItemPullsItemReviewsItemEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_with_review_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_with_review_put_request_body.go new file mode 100644 index 000000000..455fee42b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_item_with_review_put_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemReviewsItemWithReview_PutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The body text of the pull request review. + body *string +} +// NewItemItemPullsItemReviewsItemWithReview_PutRequestBody instantiates a new ItemItemPullsItemReviewsItemWithReview_PutRequestBody and sets the default values. +func NewItemItemPullsItemReviewsItemWithReview_PutRequestBody()(*ItemItemPullsItemReviewsItemWithReview_PutRequestBody) { + m := &ItemItemPullsItemReviewsItemWithReview_PutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemReviewsItemWithReview_PutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemReviewsItemWithReview_PutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemReviewsItemWithReview_PutRequestBody(), 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 *ItemItemPullsItemReviewsItemWithReview_PutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The body text of the pull request review. +// returns a *string when successful +func (m *ItemItemPullsItemReviewsItemWithReview_PutRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemReviewsItemWithReview_PutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemReviewsItemWithReview_PutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemItemPullsItemReviewsItemWithReview_PutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The body text of the pull request review. +func (m *ItemItemPullsItemReviewsItemWithReview_PutRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemItemPullsItemReviewsItemWithReview_PutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_post_request_body.go new file mode 100644 index 000000000..0f0449bf7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_post_request_body.go @@ -0,0 +1,150 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemReviewsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // **Required** when using `REQUEST_CHANGES` or `COMMENT` for the `event` parameter. The body text of the pull request review. + body *string + // Use the following table to specify the location, destination, and contents of the draft review comment. + comments []ItemItemPullsItemReviewsPostRequestBody_commentsable + // The SHA of the commit that needs a review. Not using the latest commit SHA may render your review comment outdated if a subsequent commit modifies the line you specify as the `position`. Defaults to the most recent commit in the pull request when you do not specify a value. + commit_id *string +} +// NewItemItemPullsItemReviewsPostRequestBody instantiates a new ItemItemPullsItemReviewsPostRequestBody and sets the default values. +func NewItemItemPullsItemReviewsPostRequestBody()(*ItemItemPullsItemReviewsPostRequestBody) { + m := &ItemItemPullsItemReviewsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemReviewsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemReviewsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemReviewsPostRequestBody(), 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 *ItemItemPullsItemReviewsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. **Required** when using `REQUEST_CHANGES` or `COMMENT` for the `event` parameter. The body text of the pull request review. +// returns a *string when successful +func (m *ItemItemPullsItemReviewsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetComments gets the comments property value. Use the following table to specify the location, destination, and contents of the draft review comment. +// returns a []ItemItemPullsItemReviewsPostRequestBody_commentsable when successful +func (m *ItemItemPullsItemReviewsPostRequestBody) GetComments()([]ItemItemPullsItemReviewsPostRequestBody_commentsable) { + return m.comments +} +// GetCommitId gets the commit_id property value. The SHA of the commit that needs a review. Not using the latest commit SHA may render your review comment outdated if a subsequent commit modifies the line you specify as the `position`. Defaults to the most recent commit in the pull request when you do not specify a value. +// returns a *string when successful +func (m *ItemItemPullsItemReviewsPostRequestBody) GetCommitId()(*string) { + return m.commit_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemReviewsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemPullsItemReviewsPostRequestBody_commentsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemPullsItemReviewsPostRequestBody_commentsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemPullsItemReviewsPostRequestBody_commentsable) + } + } + m.SetComments(res) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemReviewsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + if m.GetComments() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetComments())) + for i, v := range m.GetComments() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("comments", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + 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 *ItemItemPullsItemReviewsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. **Required** when using `REQUEST_CHANGES` or `COMMENT` for the `event` parameter. The body text of the pull request review. +func (m *ItemItemPullsItemReviewsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetComments sets the comments property value. Use the following table to specify the location, destination, and contents of the draft review comment. +func (m *ItemItemPullsItemReviewsPostRequestBody) SetComments(value []ItemItemPullsItemReviewsPostRequestBody_commentsable)() { + m.comments = value +} +// SetCommitId sets the commit_id property value. The SHA of the commit that needs a review. Not using the latest commit SHA may render your review comment outdated if a subsequent commit modifies the line you specify as the `position`. Defaults to the most recent commit in the pull request when you do not specify a value. +func (m *ItemItemPullsItemReviewsPostRequestBody) SetCommitId(value *string)() { + m.commit_id = value +} +type ItemItemPullsItemReviewsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetComments()([]ItemItemPullsItemReviewsPostRequestBody_commentsable) + GetCommitId()(*string) + SetBody(value *string)() + SetComments(value []ItemItemPullsItemReviewsPostRequestBody_commentsable)() + SetCommitId(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_post_request_body_comments.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_post_request_body_comments.go new file mode 100644 index 000000000..23a8e03c1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_post_request_body_comments.go @@ -0,0 +1,254 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemReviewsPostRequestBody_comments struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Text of the review comment. + body *string + // The line property + line *int32 + // The relative path to the file that necessitates a review comment. + path *string + // The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The `position` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. + position *int32 + // The side property + side *string + // The start_line property + start_line *int32 + // The start_side property + start_side *string +} +// NewItemItemPullsItemReviewsPostRequestBody_comments instantiates a new ItemItemPullsItemReviewsPostRequestBody_comments and sets the default values. +func NewItemItemPullsItemReviewsPostRequestBody_comments()(*ItemItemPullsItemReviewsPostRequestBody_comments) { + m := &ItemItemPullsItemReviewsPostRequestBody_comments{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemReviewsPostRequestBody_commentsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemReviewsPostRequestBody_commentsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemReviewsPostRequestBody_comments(), 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 *ItemItemPullsItemReviewsPostRequestBody_comments) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. Text of the review comment. +// returns a *string when successful +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLine(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["position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPosition(val) + } + return nil + } + res["side"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSide(val) + } + return nil + } + res["start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartLine(val) + } + return nil + } + res["start_side"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStartSide(val) + } + return nil + } + return res +} +// GetLine gets the line property value. The line property +// returns a *int32 when successful +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) GetLine()(*int32) { + return m.line +} +// GetPath gets the path property value. The relative path to the file that necessitates a review comment. +// returns a *string when successful +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) GetPath()(*string) { + return m.path +} +// GetPosition gets the position property value. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The `position` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. +// returns a *int32 when successful +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) GetPosition()(*int32) { + return m.position +} +// GetSide gets the side property value. The side property +// returns a *string when successful +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) GetSide()(*string) { + return m.side +} +// GetStartLine gets the start_line property value. The start_line property +// returns a *int32 when successful +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) GetStartLine()(*int32) { + return m.start_line +} +// GetStartSide gets the start_side property value. The start_side property +// returns a *string when successful +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) GetStartSide()(*string) { + return m.start_side +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("line", m.GetLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("position", m.GetPosition()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("side", m.GetSide()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("start_line", m.GetStartLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("start_side", m.GetStartSide()) + 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 *ItemItemPullsItemReviewsPostRequestBody_comments) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. Text of the review comment. +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) SetBody(value *string)() { + m.body = value +} +// SetLine sets the line property value. The line property +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) SetLine(value *int32)() { + m.line = value +} +// SetPath sets the path property value. The relative path to the file that necessitates a review comment. +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) SetPath(value *string)() { + m.path = value +} +// SetPosition sets the position property value. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The `position` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) SetPosition(value *int32)() { + m.position = value +} +// SetSide sets the side property value. The side property +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) SetSide(value *string)() { + m.side = value +} +// SetStartLine sets the start_line property value. The start_line property +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) SetStartLine(value *int32)() { + m.start_line = value +} +// SetStartSide sets the start_side property value. The start_side property +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) SetStartSide(value *string)() { + m.start_side = value +} +type ItemItemPullsItemReviewsPostRequestBody_commentsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetLine()(*int32) + GetPath()(*string) + GetPosition()(*int32) + GetSide()(*string) + GetStartLine()(*int32) + GetStartSide()(*string) + SetBody(value *string)() + SetLine(value *int32)() + SetPath(value *string)() + SetPosition(value *int32)() + SetSide(value *string)() + SetStartLine(value *int32)() + SetStartSide(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_request_builder.go new file mode 100644 index 000000000..9b495833a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_request_builder.go @@ -0,0 +1,115 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPullsItemReviewsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\reviews +type ItemItemPullsItemReviewsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPullsItemReviewsRequestBuilderGetQueryParameters lists all reviews for a specified pull request. The list of reviews returns in chronological order.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemPullsItemReviewsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByReview_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.pulls.item.reviews.item collection +// returns a *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder when successful +func (m *ItemItemPullsItemReviewsRequestBuilder) ByReview_id(review_id int32)(*ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["review_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(review_id), 10) + return NewItemItemPullsItemReviewsWithReview_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPullsItemReviewsRequestBuilderInternal instantiates a new ItemItemPullsItemReviewsRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsRequestBuilder) { + m := &ItemItemPullsItemReviewsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/reviews{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemPullsItemReviewsRequestBuilder instantiates a new ItemItemPullsItemReviewsRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemReviewsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all reviews for a specified pull request. The list of reviews returns in chronological order.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []PullRequestReviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request +func (m *ItemItemPullsItemReviewsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemReviewsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestReviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewable) + } + } + return val, nil +} +// Post creates a review on a specified pull request.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."Pull request reviews created in the `PENDING` state are not submitted and therefore do not include the `submitted_at` property in the response. To create a pending review for a pull request, leave the `event` parameter blank. For more information about submitting a `PENDING` review, see "[Submit a review for a pull request](https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request)."**Note:** To comment on a specific line in a file, you need to first determine the position of that line in the diff. To see a pull request diff, add the `application/vnd.github.v3.diff` media type to the `Accept` header of a call to the [Get a pull request](https://docs.github.com/rest/pulls/pulls#get-a-pull-request) endpoint.The `position` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request +func (m *ItemItemPullsItemReviewsRequestBuilder) Post(ctx context.Context, body ItemItemPullsItemReviewsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestReviewFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewable), nil +} +// ToGetRequestInformation lists all reviews for a specified pull request. The list of reviews returns in chronological order.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemReviewsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemReviewsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a review on a specified pull request.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."Pull request reviews created in the `PENDING` state are not submitted and therefore do not include the `submitted_at` property in the response. To create a pending review for a pull request, leave the `event` parameter blank. For more information about submitting a `PENDING` review, see "[Submit a review for a pull request](https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request)."**Note:** To comment on a specific line in a file, you need to first determine the position of that line in the diff. To see a pull request diff, add the `application/vnd.github.v3.diff` media type to the `Accept` header of a call to the [Get a pull request](https://docs.github.com/rest/pulls/pulls#get-a-pull-request) endpoint.The `position` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemReviewsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPullsItemReviewsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsItemReviewsRequestBuilder when successful +func (m *ItemItemPullsItemReviewsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemReviewsRequestBuilder) { + return NewItemItemPullsItemReviewsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_with_review_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_with_review_item_request_builder.go new file mode 100644 index 000000000..09baf7877 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_reviews_with_review_item_request_builder.go @@ -0,0 +1,144 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPullsItemReviewsWithReview_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\reviews\{review_id} +type ItemItemPullsItemReviewsWithReview_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Comments the comments property +// returns a *ItemItemPullsItemReviewsItemCommentsRequestBuilder when successful +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) Comments()(*ItemItemPullsItemReviewsItemCommentsRequestBuilder) { + return NewItemItemPullsItemReviewsItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPullsItemReviewsWithReview_ItemRequestBuilderInternal instantiates a new ItemItemPullsItemReviewsWithReview_ItemRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsWithReview_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) { + m := &ItemItemPullsItemReviewsWithReview_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/reviews/{review_id}", pathParameters), + } + return m +} +// NewItemItemPullsItemReviewsWithReview_ItemRequestBuilder instantiates a new ItemItemPullsItemReviewsWithReview_ItemRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsWithReview_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemReviewsWithReview_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a pull request review that has not been submitted. Submitted reviews cannot be deleted.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestReviewFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewable), nil +} +// Dismissals the dismissals property +// returns a *ItemItemPullsItemReviewsItemDismissalsRequestBuilder when successful +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) Dismissals()(*ItemItemPullsItemReviewsItemDismissalsRequestBuilder) { + return NewItemItemPullsItemReviewsItemDismissalsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Events the events property +// returns a *ItemItemPullsItemReviewsItemEventsRequestBuilder when successful +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) Events()(*ItemItemPullsItemReviewsItemEventsRequestBuilder) { + return NewItemItemPullsItemReviewsItemEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get retrieves a pull request review by its ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewable 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/pulls/reviews#get-a-review-for-a-pull-request +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestReviewFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewable), nil +} +// Put updates the contents of a specified review summary comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewable when successful +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) Put(ctx context.Context, body ItemItemPullsItemReviewsItemWithReview_PutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestReviewFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestReviewable), nil +} +// ToDeleteRequestInformation deletes a pull request review that has not been submitted. Submitted reviews cannot be deleted.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation retrieves a pull request review by its ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation updates the contents of a specified review summary comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemPullsItemReviewsItemWithReview_PutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder when successful +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) { + return NewItemItemPullsItemReviewsWithReview_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_update_branch_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_update_branch_put_request_body.go new file mode 100644 index 000000000..38ce93f8a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_update_branch_put_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemUpdateBranchPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a `422 Unprocessable Entity` status. You can use the "[List commits](https://docs.github.com/rest/commits/commits#list-commits)" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref. + expected_head_sha *string +} +// NewItemItemPullsItemUpdateBranchPutRequestBody instantiates a new ItemItemPullsItemUpdateBranchPutRequestBody and sets the default values. +func NewItemItemPullsItemUpdateBranchPutRequestBody()(*ItemItemPullsItemUpdateBranchPutRequestBody) { + m := &ItemItemPullsItemUpdateBranchPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemUpdateBranchPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemUpdateBranchPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemUpdateBranchPutRequestBody(), 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 *ItemItemPullsItemUpdateBranchPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetExpectedHeadSha gets the expected_head_sha property value. The expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a `422 Unprocessable Entity` status. You can use the "[List commits](https://docs.github.com/rest/commits/commits#list-commits)" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref. +// returns a *string when successful +func (m *ItemItemPullsItemUpdateBranchPutRequestBody) GetExpectedHeadSha()(*string) { + return m.expected_head_sha +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemUpdateBranchPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["expected_head_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExpectedHeadSha(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemUpdateBranchPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("expected_head_sha", m.GetExpectedHeadSha()) + 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 *ItemItemPullsItemUpdateBranchPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetExpectedHeadSha sets the expected_head_sha property value. The expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a `422 Unprocessable Entity` status. You can use the "[List commits](https://docs.github.com/rest/commits/commits#list-commits)" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref. +func (m *ItemItemPullsItemUpdateBranchPutRequestBody) SetExpectedHeadSha(value *string)() { + m.expected_head_sha = value +} +type ItemItemPullsItemUpdateBranchPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetExpectedHeadSha()(*string) + SetExpectedHeadSha(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_update_branch_put_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_update_branch_put_response.go new file mode 100644 index 000000000..56409bc43 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_update_branch_put_response.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemUpdateBranchPutResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The message property + message *string + // The url property + url *string +} +// NewItemItemPullsItemUpdateBranchPutResponse instantiates a new ItemItemPullsItemUpdateBranchPutResponse and sets the default values. +func NewItemItemPullsItemUpdateBranchPutResponse()(*ItemItemPullsItemUpdateBranchPutResponse) { + m := &ItemItemPullsItemUpdateBranchPutResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemUpdateBranchPutResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemUpdateBranchPutResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemUpdateBranchPutResponse(), 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 *ItemItemPullsItemUpdateBranchPutResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemUpdateBranchPutResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ItemItemPullsItemUpdateBranchPutResponse) GetMessage()(*string) { + return m.message +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ItemItemPullsItemUpdateBranchPutResponse) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemUpdateBranchPutResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ItemItemPullsItemUpdateBranchPutResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. The message property +func (m *ItemItemPullsItemUpdateBranchPutResponse) SetMessage(value *string)() { + m.message = value +} +// SetUrl sets the url property value. The url property +func (m *ItemItemPullsItemUpdateBranchPutResponse) SetUrl(value *string)() { + m.url = value +} +type ItemItemPullsItemUpdateBranchPutResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + GetUrl()(*string) + SetMessage(value *string)() + SetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_update_branch_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_update_branch_request_builder.go new file mode 100644 index 000000000..97310b696 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_update_branch_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPullsItemUpdateBranchRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\update-branch +type ItemItemPullsItemUpdateBranchRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsItemUpdateBranchRequestBuilderInternal instantiates a new ItemItemPullsItemUpdateBranchRequestBuilder and sets the default values. +func NewItemItemPullsItemUpdateBranchRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemUpdateBranchRequestBuilder) { + m := &ItemItemPullsItemUpdateBranchRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/update-branch", pathParameters), + } + return m +} +// NewItemItemPullsItemUpdateBranchRequestBuilder instantiates a new ItemItemPullsItemUpdateBranchRequestBuilder and sets the default values. +func NewItemItemPullsItemUpdateBranchRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemUpdateBranchRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemUpdateBranchRequestBuilderInternal(urlParams, requestAdapter) +} +// Put updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. +// returns a ItemItemPullsItemUpdateBranchPutResponseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch +func (m *ItemItemPullsItemUpdateBranchRequestBuilder) Put(ctx context.Context, body ItemItemPullsItemUpdateBranchPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemPullsItemUpdateBranchPutResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemPullsItemUpdateBranchPutResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemPullsItemUpdateBranchPutResponseable), nil +} +// ToPutRequestInformation updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemUpdateBranchRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemPullsItemUpdateBranchPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsItemUpdateBranchRequestBuilder when successful +func (m *ItemItemPullsItemUpdateBranchRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemUpdateBranchRequestBuilder) { + return NewItemItemPullsItemUpdateBranchRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_update_branch_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_update_branch_response.go new file mode 100644 index 000000000..061a32863 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_update_branch_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemPullsItemUpdateBranchResponse +// Deprecated: This class is obsolete. Use updateBranchPutResponse instead. +type ItemItemPullsItemUpdateBranchResponse struct { + ItemItemPullsItemUpdateBranchPutResponse +} +// NewItemItemPullsItemUpdateBranchResponse instantiates a new ItemItemPullsItemUpdateBranchResponse and sets the default values. +func NewItemItemPullsItemUpdateBranchResponse()(*ItemItemPullsItemUpdateBranchResponse) { + m := &ItemItemPullsItemUpdateBranchResponse{ + ItemItemPullsItemUpdateBranchPutResponse: *NewItemItemPullsItemUpdateBranchPutResponse(), + } + return m +} +// CreateItemItemPullsItemUpdateBranchResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemPullsItemUpdateBranchResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemUpdateBranchResponse(), nil +} +// ItemItemPullsItemUpdateBranchResponseable +// Deprecated: This class is obsolete. Use updateBranchPutResponse instead. +type ItemItemPullsItemUpdateBranchResponseable interface { + ItemItemPullsItemUpdateBranchPutResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_with_pull_number_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_with_pull_number_patch_request_body.go new file mode 100644 index 000000000..c9d4c4706 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_item_with_pull_number_patch_request_body.go @@ -0,0 +1,167 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemWithPull_numberPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot update the base branch on a pull request to point to another repository. + base *string + // The contents of the pull request. + body *string + // Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. + maintainer_can_modify *bool + // The title of the pull request. + title *string +} +// NewItemItemPullsItemWithPull_numberPatchRequestBody instantiates a new ItemItemPullsItemWithPull_numberPatchRequestBody and sets the default values. +func NewItemItemPullsItemWithPull_numberPatchRequestBody()(*ItemItemPullsItemWithPull_numberPatchRequestBody) { + m := &ItemItemPullsItemWithPull_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemWithPull_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemWithPull_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemWithPull_numberPatchRequestBody(), 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 *ItemItemPullsItemWithPull_numberPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBase gets the base property value. The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot update the base branch on a pull request to point to another repository. +// returns a *string when successful +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) GetBase()(*string) { + return m.base +} +// GetBody gets the body property value. The contents of the pull request. +// returns a *string when successful +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["base"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBase(val) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["maintainer_can_modify"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintainerCanModify(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetMaintainerCanModify gets the maintainer_can_modify property value. Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. +// returns a *bool when successful +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) GetMaintainerCanModify()(*bool) { + return m.maintainer_can_modify +} +// GetTitle gets the title property value. The title of the pull request. +// returns a *string when successful +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("base", m.GetBase()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintainer_can_modify", m.GetMaintainerCanModify()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemItemPullsItemWithPull_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBase sets the base property value. The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot update the base branch on a pull request to point to another repository. +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) SetBase(value *string)() { + m.base = value +} +// SetBody sets the body property value. The contents of the pull request. +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) SetBody(value *string)() { + m.body = value +} +// SetMaintainerCanModify sets the maintainer_can_modify property value. Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) SetMaintainerCanModify(value *bool)() { + m.maintainer_can_modify = value +} +// SetTitle sets the title property value. The title of the pull request. +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemItemPullsItemWithPull_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBase()(*string) + GetBody()(*string) + GetMaintainerCanModify()(*bool) + GetTitle()(*string) + SetBase(value *string)() + SetBody(value *string)() + SetMaintainerCanModify(value *bool)() + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_post_request_body.go new file mode 100644 index 000000000..fa7c9b20a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_post_request_body.go @@ -0,0 +1,283 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository. + base *string + // The contents of the pull request. + body *string + // Indicates whether the pull request is a draft. See "[Draft Pull Requests](https://docs.github.com/articles/about-pull-requests#draft-pull-requests)" in the GitHub Help documentation to learn more. + draft *bool + // The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace `head` with a user like this: `username:branch`. + head *string + // The name of the repository where the changes in the pull request were made. This field is required for cross-repository pull requests if both repositories are owned by the same organization. + head_repo *string + // An issue in the repository to convert to a pull request. The issue title, body, and comments will become the title, body, and comments on the new pull request. Required unless `title` is specified. + issue *int64 + // Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. + maintainer_can_modify *bool + // The title of the new pull request. Required unless `issue` is specified. + title *string +} +// NewItemItemPullsPostRequestBody instantiates a new ItemItemPullsPostRequestBody and sets the default values. +func NewItemItemPullsPostRequestBody()(*ItemItemPullsPostRequestBody) { + m := &ItemItemPullsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsPostRequestBody(), 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 *ItemItemPullsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBase gets the base property value. The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository. +// returns a *string when successful +func (m *ItemItemPullsPostRequestBody) GetBase()(*string) { + return m.base +} +// GetBody gets the body property value. The contents of the pull request. +// returns a *string when successful +func (m *ItemItemPullsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetDraft gets the draft property value. Indicates whether the pull request is a draft. See "[Draft Pull Requests](https://docs.github.com/articles/about-pull-requests#draft-pull-requests)" in the GitHub Help documentation to learn more. +// returns a *bool when successful +func (m *ItemItemPullsPostRequestBody) GetDraft()(*bool) { + return m.draft +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["base"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBase(val) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(val) + } + return nil + } + res["head"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHead(val) + } + return nil + } + res["head_repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadRepo(val) + } + return nil + } + res["issue"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetIssue(val) + } + return nil + } + res["maintainer_can_modify"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintainerCanModify(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetHead gets the head property value. The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace `head` with a user like this: `username:branch`. +// returns a *string when successful +func (m *ItemItemPullsPostRequestBody) GetHead()(*string) { + return m.head +} +// GetHeadRepo gets the head_repo property value. The name of the repository where the changes in the pull request were made. This field is required for cross-repository pull requests if both repositories are owned by the same organization. +// returns a *string when successful +func (m *ItemItemPullsPostRequestBody) GetHeadRepo()(*string) { + return m.head_repo +} +// GetIssue gets the issue property value. An issue in the repository to convert to a pull request. The issue title, body, and comments will become the title, body, and comments on the new pull request. Required unless `title` is specified. +// returns a *int64 when successful +func (m *ItemItemPullsPostRequestBody) GetIssue()(*int64) { + return m.issue +} +// GetMaintainerCanModify gets the maintainer_can_modify property value. Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. +// returns a *bool when successful +func (m *ItemItemPullsPostRequestBody) GetMaintainerCanModify()(*bool) { + return m.maintainer_can_modify +} +// GetTitle gets the title property value. The title of the new pull request. Required unless `issue` is specified. +// returns a *string when successful +func (m *ItemItemPullsPostRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemItemPullsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("base", m.GetBase()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head", m.GetHead()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_repo", m.GetHeadRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("issue", m.GetIssue()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintainer_can_modify", m.GetMaintainerCanModify()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemItemPullsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBase sets the base property value. The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository. +func (m *ItemItemPullsPostRequestBody) SetBase(value *string)() { + m.base = value +} +// SetBody sets the body property value. The contents of the pull request. +func (m *ItemItemPullsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetDraft sets the draft property value. Indicates whether the pull request is a draft. See "[Draft Pull Requests](https://docs.github.com/articles/about-pull-requests#draft-pull-requests)" in the GitHub Help documentation to learn more. +func (m *ItemItemPullsPostRequestBody) SetDraft(value *bool)() { + m.draft = value +} +// SetHead sets the head property value. The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace `head` with a user like this: `username:branch`. +func (m *ItemItemPullsPostRequestBody) SetHead(value *string)() { + m.head = value +} +// SetHeadRepo sets the head_repo property value. The name of the repository where the changes in the pull request were made. This field is required for cross-repository pull requests if both repositories are owned by the same organization. +func (m *ItemItemPullsPostRequestBody) SetHeadRepo(value *string)() { + m.head_repo = value +} +// SetIssue sets the issue property value. An issue in the repository to convert to a pull request. The issue title, body, and comments will become the title, body, and comments on the new pull request. Required unless `title` is specified. +func (m *ItemItemPullsPostRequestBody) SetIssue(value *int64)() { + m.issue = value +} +// SetMaintainerCanModify sets the maintainer_can_modify property value. Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. +func (m *ItemItemPullsPostRequestBody) SetMaintainerCanModify(value *bool)() { + m.maintainer_can_modify = value +} +// SetTitle sets the title property value. The title of the new pull request. Required unless `issue` is specified. +func (m *ItemItemPullsPostRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemItemPullsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBase()(*string) + GetBody()(*string) + GetDraft()(*bool) + GetHead()(*string) + GetHeadRepo()(*string) + GetIssue()(*int64) + GetMaintainerCanModify()(*bool) + GetTitle()(*string) + SetBase(value *string)() + SetBody(value *string)() + SetDraft(value *bool)() + SetHead(value *string)() + SetHeadRepo(value *string)() + SetIssue(value *int64)() + SetMaintainerCanModify(value *bool)() + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_request_builder.go new file mode 100644 index 000000000..e22387b76 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_request_builder.go @@ -0,0 +1,135 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i4980f88b83fd6b3743c68ab8eff5072f163dacd27a6e92d0995ffa675b31f76d "github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls" +) + +// ItemItemPullsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls +type ItemItemPullsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPullsRequestBuilderGetQueryParameters lists pull requests in a specified repository.Draft pull requests are available in public repositories with GitHubFree and GitHub Free for organizations, GitHub Pro, and legacy per-repository billingplans, and in public and private repositories with GitHub Team and GitHub EnterpriseCloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)in the GitHub Help documentation.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemPullsRequestBuilderGetQueryParameters struct { + // Filter pulls by base branch name. Example: `gh-pages`. + Base *string `uriparametername:"base"` + // The direction of the sort. Default: `desc` when sort is `created` or sort is not specified, otherwise `asc`. + Direction *i4980f88b83fd6b3743c68ab8eff5072f163dacd27a6e92d0995ffa675b31f76d.GetDirectionQueryParameterType `uriparametername:"direction"` + // Filter pulls by head user or head organization and branch name in the format of `user:ref-name` or `organization:ref-name`. For example: `github:new-script-format` or `octocat:test-branch`. + Head *string `uriparametername:"head"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // What to sort results by. `popularity` will sort by the number of comments. `long-running` will sort by date created and will limit the results to pull requests that have been open for more than a month and have had activity within the past month. + Sort *i4980f88b83fd6b3743c68ab8eff5072f163dacd27a6e92d0995ffa675b31f76d.GetSortQueryParameterType `uriparametername:"sort"` + // Either `open`, `closed`, or `all` to filter by state. + State *i4980f88b83fd6b3743c68ab8eff5072f163dacd27a6e92d0995ffa675b31f76d.GetStateQueryParameterType `uriparametername:"state"` +} +// ByPull_number gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.pulls.item collection +// returns a *ItemItemPullsWithPull_numberItemRequestBuilder when successful +func (m *ItemItemPullsRequestBuilder) ByPull_number(pull_number int32)(*ItemItemPullsWithPull_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["pull_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(pull_number), 10) + return NewItemItemPullsWithPull_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +// returns a *ItemItemPullsCommentsRequestBuilder when successful +func (m *ItemItemPullsRequestBuilder) Comments()(*ItemItemPullsCommentsRequestBuilder) { + return NewItemItemPullsCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPullsRequestBuilderInternal instantiates a new ItemItemPullsRequestBuilder and sets the default values. +func NewItemItemPullsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsRequestBuilder) { + m := &ItemItemPullsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls{?base*,direction*,head*,page*,per_page*,sort*,state*}", pathParameters), + } + return m +} +// NewItemItemPullsRequestBuilder instantiates a new ItemItemPullsRequestBuilder and sets the default values. +func NewItemItemPullsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists pull requests in a specified repository.Draft pull requests are available in public repositories with GitHubFree and GitHub Free for organizations, GitHub Pro, and legacy per-repository billingplans, and in public and private repositories with GitHub Team and GitHub EnterpriseCloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)in the GitHub Help documentation.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []PullRequestSimpleable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/pulls#list-pull-requests +func (m *ItemItemPullsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestSimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestSimpleable) + } + } + return val, nil +} +// Post draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/pulls#create-a-pull-request +func (m *ItemItemPullsRequestBuilder) Post(ctx context.Context, body ItemItemPullsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestable), nil +} +// ToGetRequestInformation lists pull requests in a specified repository.Draft pull requests are available in public repositories with GitHubFree and GitHub Free for organizations, GitHub Pro, and legacy per-repository billingplans, and in public and private repositories with GitHub Team and GitHub EnterpriseCloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)in the GitHub Help documentation.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPullsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsRequestBuilder when successful +func (m *ItemItemPullsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsRequestBuilder) { + return NewItemItemPullsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_with_pull_number_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_with_pull_number_item_request_builder.go new file mode 100644 index 000000000..28349c251 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_pulls_with_pull_number_item_request_builder.go @@ -0,0 +1,144 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemPullsWithPull_numberItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number} +type ItemItemPullsWithPull_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Codespaces the codespaces property +// returns a *ItemItemPullsItemCodespacesRequestBuilder when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) Codespaces()(*ItemItemPullsItemCodespacesRequestBuilder) { + return NewItemItemPullsItemCodespacesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +// returns a *ItemItemPullsItemCommentsRequestBuilder when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) Comments()(*ItemItemPullsItemCommentsRequestBuilder) { + return NewItemItemPullsItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Commits the commits property +// returns a *ItemItemPullsItemCommitsRequestBuilder when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) Commits()(*ItemItemPullsItemCommitsRequestBuilder) { + return NewItemItemPullsItemCommitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPullsWithPull_numberItemRequestBuilderInternal instantiates a new ItemItemPullsWithPull_numberItemRequestBuilder and sets the default values. +func NewItemItemPullsWithPull_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsWithPull_numberItemRequestBuilder) { + m := &ItemItemPullsWithPull_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}", pathParameters), + } + return m +} +// NewItemItemPullsWithPull_numberItemRequestBuilder instantiates a new ItemItemPullsWithPull_numberItemRequestBuilder and sets the default values. +func NewItemItemPullsWithPull_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsWithPull_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsWithPull_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Files the files property +// returns a *ItemItemPullsItemFilesRequestBuilder when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) Files()(*ItemItemPullsItemFilesRequestBuilder) { + return NewItemItemPullsItemFilesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists details of a pull request by providing its number.When you get, [create](https://docs.github.com/rest/pulls/pulls/#create-a-pull-request), or [edit](https://docs.github.com/rest/pulls/pulls#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the `mergeable` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)".The value of the `mergeable` attribute can be `true`, `false`, or `null`. If the value is `null`, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-`null` value for the `mergeable` attribute in the response. If `mergeable` is `true`, then `merge_commit_sha` will be the SHA of the _test_ merge commit.The value of the `merge_commit_sha` attribute changes depending on the state of the pull request. Before merging a pull request, the `merge_commit_sha` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the `merge_commit_sha` attribute changes depending on how you merged the pull request:* If merged as a [merge commit](https://docs.github.com/articles/about-merge-methods-on-github/), `merge_commit_sha` represents the SHA of the merge commit.* If merged via a [squash](https://docs.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), `merge_commit_sha` represents the SHA of the squashed commit on the base branch.* If [rebased](https://docs.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), `merge_commit_sha` represents the commit that the base branch was updated to.Pass the appropriate [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types) to fetch diff and patch formats.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.- **`application/vnd.github.diff`**: For more information, see "[git-diff](https://git-scm.com/docs/git-diff)" in the Git documentation. If a diff is corrupt, contact us through the [GitHub Support portal](https://support.github.com/). Include the repository name and pull request ID in your message. +// returns a PullRequestable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 406 status code +// returns a BasicError error when the service returns a 500 status code +// returns a PullRequest503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/pulls#get-a-pull-request +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "406": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequest503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestable), nil +} +// Merge the merge property +// returns a *ItemItemPullsItemMergeRequestBuilder when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) Merge()(*ItemItemPullsItemMergeRequestBuilder) { + return NewItemItemPullsItemMergeRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/pulls/pulls#update-a-pull-request +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) Patch(ctx context.Context, body ItemItemPullsItemWithPull_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePullRequestFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PullRequestable), nil +} +// Requested_reviewers the requested_reviewers property +// returns a *ItemItemPullsItemRequested_reviewersRequestBuilder when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) Requested_reviewers()(*ItemItemPullsItemRequested_reviewersRequestBuilder) { + return NewItemItemPullsItemRequested_reviewersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Reviews the reviews property +// returns a *ItemItemPullsItemReviewsRequestBuilder when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) Reviews()(*ItemItemPullsItemReviewsRequestBuilder) { + return NewItemItemPullsItemReviewsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists details of a pull request by providing its number.When you get, [create](https://docs.github.com/rest/pulls/pulls/#create-a-pull-request), or [edit](https://docs.github.com/rest/pulls/pulls#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the `mergeable` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)".The value of the `mergeable` attribute can be `true`, `false`, or `null`. If the value is `null`, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-`null` value for the `mergeable` attribute in the response. If `mergeable` is `true`, then `merge_commit_sha` will be the SHA of the _test_ merge commit.The value of the `merge_commit_sha` attribute changes depending on the state of the pull request. Before merging a pull request, the `merge_commit_sha` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the `merge_commit_sha` attribute changes depending on how you merged the pull request:* If merged as a [merge commit](https://docs.github.com/articles/about-merge-methods-on-github/), `merge_commit_sha` represents the SHA of the merge commit.* If merged via a [squash](https://docs.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), `merge_commit_sha` represents the SHA of the squashed commit on the base branch.* If [rebased](https://docs.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), `merge_commit_sha` represents the commit that the base branch was updated to.Pass the appropriate [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types) to fetch diff and patch formats.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.- **`application/vnd.github.diff`**: For more information, see "[git-diff](https://git-scm.com/docs/git-diff)" in the Git documentation. If a diff is corrupt, contact us through the [GitHub Support portal](https://support.github.com/). Include the repository name and pull request ID in your message. +// returns a *RequestInformation when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemPullsItemWithPull_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// UpdateBranch the updateBranch property +// returns a *ItemItemPullsItemUpdateBranchRequestBuilder when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) UpdateBranch()(*ItemItemPullsItemUpdateBranchRequestBuilder) { + return NewItemItemPullsItemUpdateBranchRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsWithPull_numberItemRequestBuilder when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsWithPull_numberItemRequestBuilder) { + return NewItemItemPullsWithPull_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_readme_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_readme_request_builder.go new file mode 100644 index 000000000..ed8314a6f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_readme_request_builder.go @@ -0,0 +1,80 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemReadmeRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\readme +type ItemItemReadmeRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemReadmeRequestBuilderGetQueryParameters gets the preferred README for a repository.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents. This is the default if you do not specify a media type.- **`application/vnd.github.html+json`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +type ItemItemReadmeRequestBuilderGetQueryParameters struct { + // The name of the commit/branch/tag. Default: the repository’s default branch. + Ref *string `uriparametername:"ref"` +} +// ByDir gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.readme.item collection +// returns a *ItemItemReadmeWithDirItemRequestBuilder when successful +func (m *ItemItemReadmeRequestBuilder) ByDir(dir string)(*ItemItemReadmeWithDirItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if dir != "" { + urlTplParams["dir"] = dir + } + return NewItemItemReadmeWithDirItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemReadmeRequestBuilderInternal instantiates a new ItemItemReadmeRequestBuilder and sets the default values. +func NewItemItemReadmeRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReadmeRequestBuilder) { + m := &ItemItemReadmeRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/readme{?ref*}", pathParameters), + } + return m +} +// NewItemItemReadmeRequestBuilder instantiates a new ItemItemReadmeRequestBuilder and sets the default values. +func NewItemItemReadmeRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReadmeRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReadmeRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the preferred README for a repository.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents. This is the default if you do not specify a media type.- **`application/vnd.github.html+json`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +// returns a ContentFileable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/contents#get-a-repository-readme +func (m *ItemItemReadmeRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReadmeRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentFileable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateContentFileFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentFileable), nil +} +// ToGetRequestInformation gets the preferred README for a repository.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents. This is the default if you do not specify a media type.- **`application/vnd.github.html+json`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +// returns a *RequestInformation when successful +func (m *ItemItemReadmeRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReadmeRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemReadmeRequestBuilder when successful +func (m *ItemItemReadmeRequestBuilder) WithUrl(rawUrl string)(*ItemItemReadmeRequestBuilder) { + return NewItemItemReadmeRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_readme_with_dir_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_readme_with_dir_item_request_builder.go new file mode 100644 index 000000000..b76f33591 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_readme_with_dir_item_request_builder.go @@ -0,0 +1,68 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemReadmeWithDirItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\readme\{dir} +type ItemItemReadmeWithDirItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemReadmeWithDirItemRequestBuilderGetQueryParameters gets the README from a repository directory.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents. This is the default if you do not specify a media type.- **`application/vnd.github.html+json`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +type ItemItemReadmeWithDirItemRequestBuilderGetQueryParameters struct { + // The name of the commit/branch/tag. Default: the repository’s default branch. + Ref *string `uriparametername:"ref"` +} +// NewItemItemReadmeWithDirItemRequestBuilderInternal instantiates a new ItemItemReadmeWithDirItemRequestBuilder and sets the default values. +func NewItemItemReadmeWithDirItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReadmeWithDirItemRequestBuilder) { + m := &ItemItemReadmeWithDirItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/readme/{dir}{?ref*}", pathParameters), + } + return m +} +// NewItemItemReadmeWithDirItemRequestBuilder instantiates a new ItemItemReadmeWithDirItemRequestBuilder and sets the default values. +func NewItemItemReadmeWithDirItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReadmeWithDirItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReadmeWithDirItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the README from a repository directory.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents. This is the default if you do not specify a media type.- **`application/vnd.github.html+json`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +// returns a ContentFileable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/contents#get-a-repository-readme-for-a-directory +func (m *ItemItemReadmeWithDirItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReadmeWithDirItemRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentFileable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateContentFileFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentFileable), nil +} +// ToGetRequestInformation gets the README from a repository directory.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents. This is the default if you do not specify a media type.- **`application/vnd.github.html+json`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +// returns a *RequestInformation when successful +func (m *ItemItemReadmeWithDirItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReadmeWithDirItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemReadmeWithDirItemRequestBuilder when successful +func (m *ItemItemReadmeWithDirItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemReadmeWithDirItemRequestBuilder) { + return NewItemItemReadmeWithDirItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_assets_item_with_asset_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_assets_item_with_asset_patch_request_body.go new file mode 100644 index 000000000..75327c7e3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_assets_item_with_asset_patch_request_body.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemReleasesAssetsItemWithAsset_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // An alternate short description of the asset. Used in place of the filename. + label *string + // The file name of the asset. + name *string + // The state property + state *string +} +// NewItemItemReleasesAssetsItemWithAsset_PatchRequestBody instantiates a new ItemItemReleasesAssetsItemWithAsset_PatchRequestBody and sets the default values. +func NewItemItemReleasesAssetsItemWithAsset_PatchRequestBody()(*ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) { + m := &ItemItemReleasesAssetsItemWithAsset_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemReleasesAssetsItemWithAsset_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemReleasesAssetsItemWithAsset_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemReleasesAssetsItemWithAsset_PatchRequestBody(), 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 *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabel(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + return res +} +// GetLabel gets the label property value. An alternate short description of the asset. Used in place of the filename. +// returns a *string when successful +func (m *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) GetLabel()(*string) { + return m.label +} +// GetName gets the name property value. The file name of the asset. +// returns a *string when successful +func (m *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) GetName()(*string) { + return m.name +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) GetState()(*string) { + return m.state +} +// Serialize serializes information the current object +func (m *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + 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 *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabel sets the label property value. An alternate short description of the asset. Used in place of the filename. +func (m *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) SetLabel(value *string)() { + m.label = value +} +// SetName sets the name property value. The file name of the asset. +func (m *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetState sets the state property value. The state property +func (m *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) SetState(value *string)() { + m.state = value +} +type ItemItemReleasesAssetsItemWithAsset_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabel()(*string) + GetName()(*string) + GetState()(*string) + SetLabel(value *string)() + SetName(value *string)() + SetState(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_assets_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_assets_request_builder.go new file mode 100644 index 000000000..3870a9fc0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_assets_request_builder.go @@ -0,0 +1,34 @@ +package repos + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemReleasesAssetsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\assets +type ItemItemReleasesAssetsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByAsset_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.releases.assets.item collection +// returns a *ItemItemReleasesAssetsWithAsset_ItemRequestBuilder when successful +func (m *ItemItemReleasesAssetsRequestBuilder) ByAsset_id(asset_id int32)(*ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["asset_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(asset_id), 10) + return NewItemItemReleasesAssetsWithAsset_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemReleasesAssetsRequestBuilderInternal instantiates a new ItemItemReleasesAssetsRequestBuilder and sets the default values. +func NewItemItemReleasesAssetsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesAssetsRequestBuilder) { + m := &ItemItemReleasesAssetsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/assets", pathParameters), + } + return m +} +// NewItemItemReleasesAssetsRequestBuilder instantiates a new ItemItemReleasesAssetsRequestBuilder and sets the default values. +func NewItemItemReleasesAssetsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesAssetsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesAssetsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_assets_with_asset_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_assets_with_asset_item_request_builder.go new file mode 100644 index 000000000..ed76f8763 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_assets_with_asset_item_request_builder.go @@ -0,0 +1,113 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemReleasesAssetsWithAsset_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\assets\{asset_id} +type ItemItemReleasesAssetsWithAsset_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemReleasesAssetsWithAsset_ItemRequestBuilderInternal instantiates a new ItemItemReleasesAssetsWithAsset_ItemRequestBuilder and sets the default values. +func NewItemItemReleasesAssetsWithAsset_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) { + m := &ItemItemReleasesAssetsWithAsset_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/assets/{asset_id}", pathParameters), + } + return m +} +// NewItemItemReleasesAssetsWithAsset_ItemRequestBuilder instantiates a new ItemItemReleasesAssetsWithAsset_ItemRequestBuilder and sets the default values. +func NewItemItemReleasesAssetsWithAsset_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesAssetsWithAsset_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a release asset +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/releases/assets#delete-a-release-asset +func (m *ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get to download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response. +// returns a ReleaseAssetable 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/releases/assets#get-a-release-asset +func (m *ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReleaseAssetable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReleaseAssetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReleaseAssetable), nil +} +// Patch users with push access to the repository can edit a release asset. +// returns a ReleaseAssetable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/releases/assets#update-a-release-asset +func (m *ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) Patch(ctx context.Context, body ItemItemReleasesAssetsItemWithAsset_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReleaseAssetable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReleaseAssetFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReleaseAssetable), nil +} +// returns a *RequestInformation when successful +func (m *ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation to download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation users with push access to the repository can edit a release asset. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemReleasesAssetsItemWithAsset_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemReleasesAssetsWithAsset_ItemRequestBuilder when successful +func (m *ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) { + return NewItemItemReleasesAssetsWithAsset_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_generate_notes_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_generate_notes_post_request_body.go new file mode 100644 index 000000000..2f1db063a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_generate_notes_post_request_body.go @@ -0,0 +1,167 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemReleasesGenerateNotesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Specifies a path to a file in the repository containing configuration settings used for generating the release notes. If unspecified, the configuration file located in the repository at '.github/release.yml' or '.github/release.yaml' will be used. If that is not present, the default configuration will be used. + configuration_file_path *string + // The name of the previous tag to use as the starting point for the release notes. Use to manually specify the range for the set of changes considered as part this release. + previous_tag_name *string + // The tag name for the release. This can be an existing tag or a new one. + tag_name *string + // Specifies the commitish value that will be the target for the release's tag. Required if the supplied tag_name does not reference an existing tag. Ignored if the tag_name already exists. + target_commitish *string +} +// NewItemItemReleasesGenerateNotesPostRequestBody instantiates a new ItemItemReleasesGenerateNotesPostRequestBody and sets the default values. +func NewItemItemReleasesGenerateNotesPostRequestBody()(*ItemItemReleasesGenerateNotesPostRequestBody) { + m := &ItemItemReleasesGenerateNotesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemReleasesGenerateNotesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemReleasesGenerateNotesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemReleasesGenerateNotesPostRequestBody(), 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 *ItemItemReleasesGenerateNotesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfigurationFilePath gets the configuration_file_path property value. Specifies a path to a file in the repository containing configuration settings used for generating the release notes. If unspecified, the configuration file located in the repository at '.github/release.yml' or '.github/release.yaml' will be used. If that is not present, the default configuration will be used. +// returns a *string when successful +func (m *ItemItemReleasesGenerateNotesPostRequestBody) GetConfigurationFilePath()(*string) { + return m.configuration_file_path +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemReleasesGenerateNotesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["configuration_file_path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetConfigurationFilePath(val) + } + return nil + } + res["previous_tag_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviousTagName(val) + } + return nil + } + res["tag_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagName(val) + } + return nil + } + res["target_commitish"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetCommitish(val) + } + return nil + } + return res +} +// GetPreviousTagName gets the previous_tag_name property value. The name of the previous tag to use as the starting point for the release notes. Use to manually specify the range for the set of changes considered as part this release. +// returns a *string when successful +func (m *ItemItemReleasesGenerateNotesPostRequestBody) GetPreviousTagName()(*string) { + return m.previous_tag_name +} +// GetTagName gets the tag_name property value. The tag name for the release. This can be an existing tag or a new one. +// returns a *string when successful +func (m *ItemItemReleasesGenerateNotesPostRequestBody) GetTagName()(*string) { + return m.tag_name +} +// GetTargetCommitish gets the target_commitish property value. Specifies the commitish value that will be the target for the release's tag. Required if the supplied tag_name does not reference an existing tag. Ignored if the tag_name already exists. +// returns a *string when successful +func (m *ItemItemReleasesGenerateNotesPostRequestBody) GetTargetCommitish()(*string) { + return m.target_commitish +} +// Serialize serializes information the current object +func (m *ItemItemReleasesGenerateNotesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("configuration_file_path", m.GetConfigurationFilePath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("previous_tag_name", m.GetPreviousTagName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tag_name", m.GetTagName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_commitish", m.GetTargetCommitish()) + 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 *ItemItemReleasesGenerateNotesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfigurationFilePath sets the configuration_file_path property value. Specifies a path to a file in the repository containing configuration settings used for generating the release notes. If unspecified, the configuration file located in the repository at '.github/release.yml' or '.github/release.yaml' will be used. If that is not present, the default configuration will be used. +func (m *ItemItemReleasesGenerateNotesPostRequestBody) SetConfigurationFilePath(value *string)() { + m.configuration_file_path = value +} +// SetPreviousTagName sets the previous_tag_name property value. The name of the previous tag to use as the starting point for the release notes. Use to manually specify the range for the set of changes considered as part this release. +func (m *ItemItemReleasesGenerateNotesPostRequestBody) SetPreviousTagName(value *string)() { + m.previous_tag_name = value +} +// SetTagName sets the tag_name property value. The tag name for the release. This can be an existing tag or a new one. +func (m *ItemItemReleasesGenerateNotesPostRequestBody) SetTagName(value *string)() { + m.tag_name = value +} +// SetTargetCommitish sets the target_commitish property value. Specifies the commitish value that will be the target for the release's tag. Required if the supplied tag_name does not reference an existing tag. Ignored if the tag_name already exists. +func (m *ItemItemReleasesGenerateNotesPostRequestBody) SetTargetCommitish(value *string)() { + m.target_commitish = value +} +type ItemItemReleasesGenerateNotesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetConfigurationFilePath()(*string) + GetPreviousTagName()(*string) + GetTagName()(*string) + GetTargetCommitish()(*string) + SetConfigurationFilePath(value *string)() + SetPreviousTagName(value *string)() + SetTagName(value *string)() + SetTargetCommitish(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_generate_notes_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_generate_notes_request_builder.go new file mode 100644 index 000000000..7a3aa2468 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_generate_notes_request_builder.go @@ -0,0 +1,65 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemReleasesGenerateNotesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\generate-notes +type ItemItemReleasesGenerateNotesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemReleasesGenerateNotesRequestBuilderInternal instantiates a new ItemItemReleasesGenerateNotesRequestBuilder and sets the default values. +func NewItemItemReleasesGenerateNotesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesGenerateNotesRequestBuilder) { + m := &ItemItemReleasesGenerateNotesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/generate-notes", pathParameters), + } + return m +} +// NewItemItemReleasesGenerateNotesRequestBuilder instantiates a new ItemItemReleasesGenerateNotesRequestBuilder and sets the default values. +func NewItemItemReleasesGenerateNotesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesGenerateNotesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesGenerateNotesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post generate a name and body describing a [release](https://docs.github.com/rest/releases/releases#get-a-release). The body content will be markdown formatted and contain information like the changes since last release and users who contributed. The generated release notes are not saved anywhere. They are intended to be generated and used when creating a new release. +// returns a ReleaseNotesContentable 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/releases/releases#generate-release-notes-content-for-a-release +func (m *ItemItemReleasesGenerateNotesRequestBuilder) Post(ctx context.Context, body ItemItemReleasesGenerateNotesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReleaseNotesContentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReleaseNotesContentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReleaseNotesContentable), nil +} +// ToPostRequestInformation generate a name and body describing a [release](https://docs.github.com/rest/releases/releases#get-a-release). The body content will be markdown formatted and contain information like the changes since last release and users who contributed. The generated release notes are not saved anywhere. They are intended to be generated and used when creating a new release. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesGenerateNotesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemReleasesGenerateNotesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemReleasesGenerateNotesRequestBuilder when successful +func (m *ItemItemReleasesGenerateNotesRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesGenerateNotesRequestBuilder) { + return NewItemItemReleasesGenerateNotesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_item_assets_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_item_assets_request_builder.go new file mode 100644 index 000000000..7adbf9bcf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_item_assets_request_builder.go @@ -0,0 +1,99 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemReleasesItemAssetsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\{release_id}\assets +type ItemItemReleasesItemAssetsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemReleasesItemAssetsRequestBuilderGetQueryParameters list release assets +type ItemItemReleasesItemAssetsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ItemItemReleasesItemAssetsRequestBuilderPostQueryParameters this endpoint makes use of a [Hypermedia relation](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the `upload_url` returned inthe response of the [Create a release endpoint](https://docs.github.com/rest/releases/releases#create-a-release) to upload a release asset.You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint.Most libraries will set the required `Content-Length` header automatically. Use the required `Content-Type` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example: `application/zip`GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example,you'll still need to pass your authentication to be able to upload an asset.When an upstream failure occurs, you will receive a `502 Bad Gateway` status. This may leave an empty asset with a state of `starter`. It can be safely deleted.**Notes:*** GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List release assets](https://docs.github.com/rest/releases/assets#list-release-assets)"endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://support.github.com/contact?tags=dotcom-rest-api).* To find the `release_id` query the [`GET /repos/{owner}/{repo}/releases/latest` endpoint](https://docs.github.com/rest/releases/releases#get-the-latest-release). * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset. +type ItemItemReleasesItemAssetsRequestBuilderPostQueryParameters struct { + Label *string `uriparametername:"label"` + Name *string `uriparametername:"name"` +} +// NewItemItemReleasesItemAssetsRequestBuilderInternal instantiates a new ItemItemReleasesItemAssetsRequestBuilder and sets the default values. +func NewItemItemReleasesItemAssetsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesItemAssetsRequestBuilder) { + m := &ItemItemReleasesItemAssetsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/{release_id}/assets?name={name}{&label*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemReleasesItemAssetsRequestBuilder instantiates a new ItemItemReleasesItemAssetsRequestBuilder and sets the default values. +func NewItemItemReleasesItemAssetsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesItemAssetsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesItemAssetsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list release assets +// returns a []ReleaseAssetable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/releases/assets#list-release-assets +func (m *ItemItemReleasesItemAssetsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReleasesItemAssetsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReleaseAssetable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReleaseAssetFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReleaseAssetable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReleaseAssetable) + } + } + return val, nil +} +// Post this endpoint makes use of a [Hypermedia relation](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the `upload_url` returned inthe response of the [Create a release endpoint](https://docs.github.com/rest/releases/releases#create-a-release) to upload a release asset.You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint.Most libraries will set the required `Content-Length` header automatically. Use the required `Content-Type` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example: `application/zip`GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example,you'll still need to pass your authentication to be able to upload an asset.When an upstream failure occurs, you will receive a `502 Bad Gateway` status. This may leave an empty asset with a state of `starter`. It can be safely deleted.**Notes:*** GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List release assets](https://docs.github.com/rest/releases/assets#list-release-assets)"endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://support.github.com/contact?tags=dotcom-rest-api).* To find the `release_id` query the [`GET /repos/{owner}/{repo}/releases/latest` endpoint](https://docs.github.com/rest/releases/releases#get-the-latest-release). * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset. +// returns a ReleaseAssetable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/releases/assets#upload-a-release-asset +func (m *ItemItemReleasesItemAssetsRequestBuilder) Post(ctx context.Context, body []byte, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReleasesItemAssetsRequestBuilderPostQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReleaseAssetable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReleaseAssetFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReleaseAssetable), nil +} +// returns a *RequestInformation when successful +func (m *ItemItemReleasesItemAssetsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReleasesItemAssetsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/{release_id}/assets{?page*,per_page*}", m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation this endpoint makes use of a [Hypermedia relation](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the `upload_url` returned inthe response of the [Create a release endpoint](https://docs.github.com/rest/releases/releases#create-a-release) to upload a release asset.You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint.Most libraries will set the required `Content-Length` header automatically. Use the required `Content-Type` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example: `application/zip`GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example,you'll still need to pass your authentication to be able to upload an asset.When an upstream failure occurs, you will receive a `502 Bad Gateway` status. This may leave an empty asset with a state of `starter`. It can be safely deleted.**Notes:*** GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List release assets](https://docs.github.com/rest/releases/assets#list-release-assets)"endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://support.github.com/contact?tags=dotcom-rest-api).* To find the `release_id` query the [`GET /repos/{owner}/{repo}/releases/latest` endpoint](https://docs.github.com/rest/releases/releases#get-the-latest-release). * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesItemAssetsRequestBuilder) ToPostRequestInformation(ctx context.Context, body []byte, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReleasesItemAssetsRequestBuilderPostQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/{release_id}/assets?name={name}{&label*}", m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + requestInfo.SetStreamContentAndContentType(body, "application/octet-stream") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemReleasesItemAssetsRequestBuilder when successful +func (m *ItemItemReleasesItemAssetsRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesItemAssetsRequestBuilder) { + return NewItemItemReleasesItemAssetsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_item_reactions_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_item_reactions_post_request_body.go new file mode 100644 index 000000000..a7a44a27f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemReleasesItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemReleasesItemReactionsPostRequestBody instantiates a new ItemItemReleasesItemReactionsPostRequestBody and sets the default values. +func NewItemItemReleasesItemReactionsPostRequestBody()(*ItemItemReleasesItemReactionsPostRequestBody) { + m := &ItemItemReleasesItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemReleasesItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemReleasesItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemReleasesItemReactionsPostRequestBody(), 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 *ItemItemReleasesItemReactionsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemReleasesItemReactionsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemReleasesItemReactionsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemReleasesItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemReleasesItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_item_reactions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_item_reactions_request_builder.go new file mode 100644 index 000000000..b1e2e3441 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_item_reactions_request_builder.go @@ -0,0 +1,120 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + id55cffcf6bbb94221b5dee244a08d4356fef6defe3cbba2cf764187f9d0ca7d2 "github.com/octokit/go-sdk/pkg/github/repos/item/item/releases/item/reactions" +) + +// ItemItemReleasesItemReactionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\{release_id}\reactions +type ItemItemReleasesItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemReleasesItemReactionsRequestBuilderGetQueryParameters list the reactions to a [release](https://docs.github.com/rest/releases/releases#get-a-release). +type ItemItemReleasesItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a release. + Content *id55cffcf6bbb94221b5dee244a08d4356fef6defe3cbba2cf764187f9d0ca7d2.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByReaction_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.releases.item.reactions.item collection +// returns a *ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemReleasesItemReactionsRequestBuilder) ByReaction_id(reaction_id int32)(*ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["reaction_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(reaction_id), 10) + return NewItemItemReleasesItemReactionsWithReaction_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemReleasesItemReactionsRequestBuilderInternal instantiates a new ItemItemReleasesItemReactionsRequestBuilder and sets the default values. +func NewItemItemReleasesItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesItemReactionsRequestBuilder) { + m := &ItemItemReleasesItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/{release_id}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemReleasesItemReactionsRequestBuilder instantiates a new ItemItemReleasesItemReactionsRequestBuilder and sets the default values. +func NewItemItemReleasesItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the reactions to a [release](https://docs.github.com/rest/releases/releases#get-a-release). +// returns a []Reactionable 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/reactions/reactions#list-reactions-for-a-release +func (m *ItemItemReleasesItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReleasesItemReactionsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable) + } + } + return val, nil +} +// Post create a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release). A response with a `Status: 200 OK` means that you already added the reaction type to this release. +// returns a Reactionable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release +func (m *ItemItemReleasesItemReactionsRequestBuilder) Post(ctx context.Context, body ItemItemReleasesItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable), nil +} +// ToGetRequestInformation list the reactions to a [release](https://docs.github.com/rest/releases/releases#get-a-release). +// returns a *RequestInformation when successful +func (m *ItemItemReleasesItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReleasesItemReactionsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation create a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release). A response with a `Status: 200 OK` means that you already added the reaction type to this release. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemReleasesItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemReleasesItemReactionsRequestBuilder when successful +func (m *ItemItemReleasesItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesItemReactionsRequestBuilder) { + return NewItemItemReleasesItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_item_reactions_with_reaction_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_item_reactions_with_reaction_item_request_builder.go new file mode 100644 index 000000000..e120c005c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_item_reactions_with_reaction_item_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\{release_id}\reactions\{reaction_id} +type ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemReleasesItemReactionsWithReaction_ItemRequestBuilderInternal instantiates a new ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemReleasesItemReactionsWithReaction_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder) { + m := &ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/{release_id}/reactions/{reaction_id}", pathParameters), + } + return m +} +// NewItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder instantiates a new ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesItemReactionsWithReaction_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete **Note:** You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/releases/:release_id/reactions/:reaction_id`.Delete a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release). +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction +func (m *ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation **Note:** You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/releases/:release_id/reactions/:reaction_id`.Delete a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release). +// returns a *RequestInformation when successful +func (m *ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder) { + return NewItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_item_with_release_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_item_with_release_patch_request_body.go new file mode 100644 index 000000000..83a0564d8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_item_with_release_patch_request_body.go @@ -0,0 +1,254 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemReleasesItemWithRelease_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Text describing the contents of the tag. + body *string + // If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. If there is already a discussion linked to the release, this parameter is ignored. For more information, see "[Managing categories for discussions in your repository](https://docs.github.com/discussions/managing-discussions-for-your-community/managing-categories-for-discussions-in-your-repository)." + discussion_category_name *string + // `true` makes the release a draft, and `false` publishes the release. + draft *bool + // The name of the release. + name *string + // `true` to identify the release as a prerelease, `false` to identify the release as a full release. + prerelease *bool + // The name of the tag. + tag_name *string + // Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch. + target_commitish *string +} +// NewItemItemReleasesItemWithRelease_PatchRequestBody instantiates a new ItemItemReleasesItemWithRelease_PatchRequestBody and sets the default values. +func NewItemItemReleasesItemWithRelease_PatchRequestBody()(*ItemItemReleasesItemWithRelease_PatchRequestBody) { + m := &ItemItemReleasesItemWithRelease_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemReleasesItemWithRelease_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemReleasesItemWithRelease_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemReleasesItemWithRelease_PatchRequestBody(), 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 *ItemItemReleasesItemWithRelease_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. Text describing the contents of the tag. +// returns a *string when successful +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) GetBody()(*string) { + return m.body +} +// GetDiscussionCategoryName gets the discussion_category_name property value. If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. If there is already a discussion linked to the release, this parameter is ignored. For more information, see "[Managing categories for discussions in your repository](https://docs.github.com/discussions/managing-discussions-for-your-community/managing-categories-for-discussions-in-your-repository)." +// returns a *string when successful +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) GetDiscussionCategoryName()(*string) { + return m.discussion_category_name +} +// GetDraft gets the draft property value. `true` makes the release a draft, and `false` publishes the release. +// returns a *bool when successful +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) GetDraft()(*bool) { + return m.draft +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["discussion_category_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiscussionCategoryName(val) + } + return nil + } + res["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["prerelease"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrerelease(val) + } + return nil + } + res["tag_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagName(val) + } + return nil + } + res["target_commitish"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetCommitish(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the release. +// returns a *string when successful +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) GetName()(*string) { + return m.name +} +// GetPrerelease gets the prerelease property value. `true` to identify the release as a prerelease, `false` to identify the release as a full release. +// returns a *bool when successful +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) GetPrerelease()(*bool) { + return m.prerelease +} +// GetTagName gets the tag_name property value. The name of the tag. +// returns a *string when successful +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) GetTagName()(*string) { + return m.tag_name +} +// GetTargetCommitish gets the target_commitish property value. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch. +// returns a *string when successful +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) GetTargetCommitish()(*string) { + return m.target_commitish +} +// Serialize serializes information the current object +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("discussion_category_name", m.GetDiscussionCategoryName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("prerelease", m.GetPrerelease()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tag_name", m.GetTagName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_commitish", m.GetTargetCommitish()) + 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 *ItemItemReleasesItemWithRelease_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. Text describing the contents of the tag. +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) SetBody(value *string)() { + m.body = value +} +// SetDiscussionCategoryName sets the discussion_category_name property value. If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. If there is already a discussion linked to the release, this parameter is ignored. For more information, see "[Managing categories for discussions in your repository](https://docs.github.com/discussions/managing-discussions-for-your-community/managing-categories-for-discussions-in-your-repository)." +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) SetDiscussionCategoryName(value *string)() { + m.discussion_category_name = value +} +// SetDraft sets the draft property value. `true` makes the release a draft, and `false` publishes the release. +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) SetDraft(value *bool)() { + m.draft = value +} +// SetName sets the name property value. The name of the release. +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetPrerelease sets the prerelease property value. `true` to identify the release as a prerelease, `false` to identify the release as a full release. +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) SetPrerelease(value *bool)() { + m.prerelease = value +} +// SetTagName sets the tag_name property value. The name of the tag. +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) SetTagName(value *string)() { + m.tag_name = value +} +// SetTargetCommitish sets the target_commitish property value. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch. +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) SetTargetCommitish(value *string)() { + m.target_commitish = value +} +type ItemItemReleasesItemWithRelease_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetDiscussionCategoryName()(*string) + GetDraft()(*bool) + GetName()(*string) + GetPrerelease()(*bool) + GetTagName()(*string) + GetTargetCommitish()(*string) + SetBody(value *string)() + SetDiscussionCategoryName(value *string)() + SetDraft(value *bool)() + SetName(value *string)() + SetPrerelease(value *bool)() + SetTagName(value *string)() + SetTargetCommitish(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_latest_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_latest_request_builder.go new file mode 100644 index 000000000..13de53414 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_latest_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemReleasesLatestRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\latest +type ItemItemReleasesLatestRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemReleasesLatestRequestBuilderInternal instantiates a new ItemItemReleasesLatestRequestBuilder and sets the default values. +func NewItemItemReleasesLatestRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesLatestRequestBuilder) { + m := &ItemItemReleasesLatestRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/latest", pathParameters), + } + return m +} +// NewItemItemReleasesLatestRequestBuilder instantiates a new ItemItemReleasesLatestRequestBuilder and sets the default values. +func NewItemItemReleasesLatestRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesLatestRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesLatestRequestBuilderInternal(urlParams, requestAdapter) +} +// Get view the latest published full release for the repository.The latest release is the most recent non-prerelease, non-draft release, sorted by the `created_at` attribute. The `created_at` attribute is the date of the commit used for the release, and not the date when the release was drafted or published. +// returns a Releaseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/releases/releases#get-the-latest-release +func (m *ItemItemReleasesLatestRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Releaseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReleaseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Releaseable), nil +} +// ToGetRequestInformation view the latest published full release for the repository.The latest release is the most recent non-prerelease, non-draft release, sorted by the `created_at` attribute. The `created_at` attribute is the date of the commit used for the release, and not the date when the release was drafted or published. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesLatestRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemReleasesLatestRequestBuilder when successful +func (m *ItemItemReleasesLatestRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesLatestRequestBuilder) { + return NewItemItemReleasesLatestRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_post_request_body.go new file mode 100644 index 000000000..45d292ab1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_post_request_body.go @@ -0,0 +1,283 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemReleasesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Text describing the contents of the tag. + body *string + // If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. For more information, see "[Managing categories for discussions in your repository](https://docs.github.com/discussions/managing-discussions-for-your-community/managing-categories-for-discussions-in-your-repository)." + discussion_category_name *string + // `true` to create a draft (unpublished) release, `false` to create a published one. + draft *bool + // Whether to automatically generate the name and body for this release. If `name` is specified, the specified name will be used; otherwise, a name will be automatically generated. If `body` is specified, the body will be pre-pended to the automatically generated notes. + generate_release_notes *bool + // The name of the release. + name *string + // `true` to identify the release as a prerelease. `false` to identify the release as a full release. + prerelease *bool + // The name of the tag. + tag_name *string + // Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch. + target_commitish *string +} +// NewItemItemReleasesPostRequestBody instantiates a new ItemItemReleasesPostRequestBody and sets the default values. +func NewItemItemReleasesPostRequestBody()(*ItemItemReleasesPostRequestBody) { + m := &ItemItemReleasesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemReleasesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemReleasesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemReleasesPostRequestBody(), 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 *ItemItemReleasesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. Text describing the contents of the tag. +// returns a *string when successful +func (m *ItemItemReleasesPostRequestBody) GetBody()(*string) { + return m.body +} +// GetDiscussionCategoryName gets the discussion_category_name property value. If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. For more information, see "[Managing categories for discussions in your repository](https://docs.github.com/discussions/managing-discussions-for-your-community/managing-categories-for-discussions-in-your-repository)." +// returns a *string when successful +func (m *ItemItemReleasesPostRequestBody) GetDiscussionCategoryName()(*string) { + return m.discussion_category_name +} +// GetDraft gets the draft property value. `true` to create a draft (unpublished) release, `false` to create a published one. +// returns a *bool when successful +func (m *ItemItemReleasesPostRequestBody) GetDraft()(*bool) { + return m.draft +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemReleasesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["discussion_category_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiscussionCategoryName(val) + } + return nil + } + res["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(val) + } + return nil + } + res["generate_release_notes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetGenerateReleaseNotes(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["prerelease"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrerelease(val) + } + return nil + } + res["tag_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagName(val) + } + return nil + } + res["target_commitish"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetCommitish(val) + } + return nil + } + return res +} +// GetGenerateReleaseNotes gets the generate_release_notes property value. Whether to automatically generate the name and body for this release. If `name` is specified, the specified name will be used; otherwise, a name will be automatically generated. If `body` is specified, the body will be pre-pended to the automatically generated notes. +// returns a *bool when successful +func (m *ItemItemReleasesPostRequestBody) GetGenerateReleaseNotes()(*bool) { + return m.generate_release_notes +} +// GetName gets the name property value. The name of the release. +// returns a *string when successful +func (m *ItemItemReleasesPostRequestBody) GetName()(*string) { + return m.name +} +// GetPrerelease gets the prerelease property value. `true` to identify the release as a prerelease. `false` to identify the release as a full release. +// returns a *bool when successful +func (m *ItemItemReleasesPostRequestBody) GetPrerelease()(*bool) { + return m.prerelease +} +// GetTagName gets the tag_name property value. The name of the tag. +// returns a *string when successful +func (m *ItemItemReleasesPostRequestBody) GetTagName()(*string) { + return m.tag_name +} +// GetTargetCommitish gets the target_commitish property value. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch. +// returns a *string when successful +func (m *ItemItemReleasesPostRequestBody) GetTargetCommitish()(*string) { + return m.target_commitish +} +// Serialize serializes information the current object +func (m *ItemItemReleasesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("discussion_category_name", m.GetDiscussionCategoryName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("generate_release_notes", m.GetGenerateReleaseNotes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("prerelease", m.GetPrerelease()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tag_name", m.GetTagName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_commitish", m.GetTargetCommitish()) + 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 *ItemItemReleasesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. Text describing the contents of the tag. +func (m *ItemItemReleasesPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetDiscussionCategoryName sets the discussion_category_name property value. If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. For more information, see "[Managing categories for discussions in your repository](https://docs.github.com/discussions/managing-discussions-for-your-community/managing-categories-for-discussions-in-your-repository)." +func (m *ItemItemReleasesPostRequestBody) SetDiscussionCategoryName(value *string)() { + m.discussion_category_name = value +} +// SetDraft sets the draft property value. `true` to create a draft (unpublished) release, `false` to create a published one. +func (m *ItemItemReleasesPostRequestBody) SetDraft(value *bool)() { + m.draft = value +} +// SetGenerateReleaseNotes sets the generate_release_notes property value. Whether to automatically generate the name and body for this release. If `name` is specified, the specified name will be used; otherwise, a name will be automatically generated. If `body` is specified, the body will be pre-pended to the automatically generated notes. +func (m *ItemItemReleasesPostRequestBody) SetGenerateReleaseNotes(value *bool)() { + m.generate_release_notes = value +} +// SetName sets the name property value. The name of the release. +func (m *ItemItemReleasesPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetPrerelease sets the prerelease property value. `true` to identify the release as a prerelease. `false` to identify the release as a full release. +func (m *ItemItemReleasesPostRequestBody) SetPrerelease(value *bool)() { + m.prerelease = value +} +// SetTagName sets the tag_name property value. The name of the tag. +func (m *ItemItemReleasesPostRequestBody) SetTagName(value *string)() { + m.tag_name = value +} +// SetTargetCommitish sets the target_commitish property value. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch. +func (m *ItemItemReleasesPostRequestBody) SetTargetCommitish(value *string)() { + m.target_commitish = value +} +type ItemItemReleasesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetDiscussionCategoryName()(*string) + GetDraft()(*bool) + GetGenerateReleaseNotes()(*bool) + GetName()(*string) + GetPrerelease()(*bool) + GetTagName()(*string) + GetTargetCommitish()(*string) + SetBody(value *string)() + SetDiscussionCategoryName(value *string)() + SetDraft(value *bool)() + SetGenerateReleaseNotes(value *bool)() + SetName(value *string)() + SetPrerelease(value *bool)() + SetTagName(value *string)() + SetTargetCommitish(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_request_builder.go new file mode 100644 index 000000000..8f9fb84a9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_request_builder.go @@ -0,0 +1,139 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemReleasesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases +type ItemItemReleasesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemReleasesRequestBuilderGetQueryParameters this returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/rest/repos/repos#list-repository-tags).Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. +type ItemItemReleasesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// Assets the assets property +// returns a *ItemItemReleasesAssetsRequestBuilder when successful +func (m *ItemItemReleasesRequestBuilder) Assets()(*ItemItemReleasesAssetsRequestBuilder) { + return NewItemItemReleasesAssetsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ByRelease_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.releases.item collection +// returns a *ItemItemReleasesWithRelease_ItemRequestBuilder when successful +func (m *ItemItemReleasesRequestBuilder) ByRelease_id(release_id int32)(*ItemItemReleasesWithRelease_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["release_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(release_id), 10) + return NewItemItemReleasesWithRelease_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemReleasesRequestBuilderInternal instantiates a new ItemItemReleasesRequestBuilder and sets the default values. +func NewItemItemReleasesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesRequestBuilder) { + m := &ItemItemReleasesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemReleasesRequestBuilder instantiates a new ItemItemReleasesRequestBuilder and sets the default values. +func NewItemItemReleasesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesRequestBuilderInternal(urlParams, requestAdapter) +} +// GenerateNotes the generateNotes property +// returns a *ItemItemReleasesGenerateNotesRequestBuilder when successful +func (m *ItemItemReleasesRequestBuilder) GenerateNotes()(*ItemItemReleasesGenerateNotesRequestBuilder) { + return NewItemItemReleasesGenerateNotesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get this returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/rest/repos/repos#list-repository-tags).Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. +// returns a []Releaseable 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/releases/releases#list-releases +func (m *ItemItemReleasesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReleasesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Releaseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReleaseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Releaseable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Releaseable) + } + } + return val, nil +} +// Latest the latest property +// returns a *ItemItemReleasesLatestRequestBuilder when successful +func (m *ItemItemReleasesRequestBuilder) Latest()(*ItemItemReleasesLatestRequestBuilder) { + return NewItemItemReleasesLatestRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Post users with push access to the repository can create a release.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." +// returns a Releaseable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/releases/releases#create-a-release +func (m *ItemItemReleasesRequestBuilder) Post(ctx context.Context, body ItemItemReleasesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Releaseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReleaseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Releaseable), nil +} +// Tags the tags property +// returns a *ItemItemReleasesTagsRequestBuilder when successful +func (m *ItemItemReleasesRequestBuilder) Tags()(*ItemItemReleasesTagsRequestBuilder) { + return NewItemItemReleasesTagsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation this returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/rest/repos/repos#list-repository-tags).Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReleasesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation users with push access to the repository can create a release.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." +// returns a *RequestInformation when successful +func (m *ItemItemReleasesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemReleasesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemReleasesRequestBuilder when successful +func (m *ItemItemReleasesRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesRequestBuilder) { + return NewItemItemReleasesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_tags_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_tags_request_builder.go new file mode 100644 index 000000000..30c12813e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_tags_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemReleasesTagsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\tags +type ItemItemReleasesTagsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByTag gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.releases.tags.item collection +// returns a *ItemItemReleasesTagsWithTagItemRequestBuilder when successful +func (m *ItemItemReleasesTagsRequestBuilder) ByTag(tag string)(*ItemItemReleasesTagsWithTagItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if tag != "" { + urlTplParams["tag"] = tag + } + return NewItemItemReleasesTagsWithTagItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemReleasesTagsRequestBuilderInternal instantiates a new ItemItemReleasesTagsRequestBuilder and sets the default values. +func NewItemItemReleasesTagsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesTagsRequestBuilder) { + m := &ItemItemReleasesTagsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/tags", pathParameters), + } + return m +} +// NewItemItemReleasesTagsRequestBuilder instantiates a new ItemItemReleasesTagsRequestBuilder and sets the default values. +func NewItemItemReleasesTagsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesTagsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesTagsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_tags_with_tag_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_tags_with_tag_item_request_builder.go new file mode 100644 index 000000000..3d15f62c5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_tags_with_tag_item_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemReleasesTagsWithTagItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\tags\{tag} +type ItemItemReleasesTagsWithTagItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemReleasesTagsWithTagItemRequestBuilderInternal instantiates a new ItemItemReleasesTagsWithTagItemRequestBuilder and sets the default values. +func NewItemItemReleasesTagsWithTagItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesTagsWithTagItemRequestBuilder) { + m := &ItemItemReleasesTagsWithTagItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/tags/{tag}", pathParameters), + } + return m +} +// NewItemItemReleasesTagsWithTagItemRequestBuilder instantiates a new ItemItemReleasesTagsWithTagItemRequestBuilder and sets the default values. +func NewItemItemReleasesTagsWithTagItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesTagsWithTagItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesTagsWithTagItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get a published release with the specified tag. +// returns a Releaseable 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/releases/releases#get-a-release-by-tag-name +func (m *ItemItemReleasesTagsWithTagItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Releaseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReleaseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Releaseable), nil +} +// ToGetRequestInformation get a published release with the specified tag. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesTagsWithTagItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemReleasesTagsWithTagItemRequestBuilder when successful +func (m *ItemItemReleasesTagsWithTagItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesTagsWithTagItemRequestBuilder) { + return NewItemItemReleasesTagsWithTagItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_with_release_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_with_release_item_request_builder.go new file mode 100644 index 000000000..1c6d8c1d4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_releases_with_release_item_request_builder.go @@ -0,0 +1,124 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemReleasesWithRelease_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\{release_id} +type ItemItemReleasesWithRelease_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Assets the assets property +// returns a *ItemItemReleasesItemAssetsRequestBuilder when successful +func (m *ItemItemReleasesWithRelease_ItemRequestBuilder) Assets()(*ItemItemReleasesItemAssetsRequestBuilder) { + return NewItemItemReleasesItemAssetsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemReleasesWithRelease_ItemRequestBuilderInternal instantiates a new ItemItemReleasesWithRelease_ItemRequestBuilder and sets the default values. +func NewItemItemReleasesWithRelease_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesWithRelease_ItemRequestBuilder) { + m := &ItemItemReleasesWithRelease_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/{release_id}", pathParameters), + } + return m +} +// NewItemItemReleasesWithRelease_ItemRequestBuilder instantiates a new ItemItemReleasesWithRelease_ItemRequestBuilder and sets the default values. +func NewItemItemReleasesWithRelease_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesWithRelease_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesWithRelease_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete users with push access to the repository can delete a release. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/releases/releases#delete-a-release +func (m *ItemItemReleasesWithRelease_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a public release with the specified release ID.**Note:** This returns an `upload_url` key corresponding to the endpointfor uploading release assets. This key is a hypermedia resource. For more information, see"[Getting started with the REST API](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia)." +// returns a Releaseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/releases/releases#get-a-release +func (m *ItemItemReleasesWithRelease_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Releaseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReleaseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Releaseable), nil +} +// Patch users with push access to the repository can edit a release. +// returns a Releaseable 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/releases/releases#update-a-release +func (m *ItemItemReleasesWithRelease_ItemRequestBuilder) Patch(ctx context.Context, body ItemItemReleasesItemWithRelease_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Releaseable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReleaseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Releaseable), nil +} +// Reactions the reactions property +// returns a *ItemItemReleasesItemReactionsRequestBuilder when successful +func (m *ItemItemReleasesWithRelease_ItemRequestBuilder) Reactions()(*ItemItemReleasesItemReactionsRequestBuilder) { + return NewItemItemReleasesItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation users with push access to the repository can delete a release. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesWithRelease_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a public release with the specified release ID.**Note:** This returns an `upload_url` key corresponding to the endpointfor uploading release assets. This key is a hypermedia resource. For more information, see"[Getting started with the REST API](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia)." +// returns a *RequestInformation when successful +func (m *ItemItemReleasesWithRelease_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation users with push access to the repository can edit a release. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesWithRelease_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemReleasesItemWithRelease_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemReleasesWithRelease_ItemRequestBuilder when successful +func (m *ItemItemReleasesWithRelease_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesWithRelease_ItemRequestBuilder) { + return NewItemItemReleasesWithRelease_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo403_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo403_error.go new file mode 100644 index 000000000..6e1369f70 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo403_error.go @@ -0,0 +1,117 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemRepo403Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewItemItemRepo403Error instantiates a new ItemItemRepo403Error and sets the default values. +func NewItemItemRepo403Error()(*ItemItemRepo403Error) { + m := &ItemItemRepo403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemRepo403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemRepo403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemRepo403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemItemRepo403Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemItemRepo403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ItemItemRepo403Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemRepo403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ItemItemRepo403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemItemRepo403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ItemItemRepo403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemItemRepo403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *ItemItemRepo403Error) SetMessage(value *string)() { + m.message = value +} +type ItemItemRepo403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo_patch_request_body.go new file mode 100644 index 000000000..666113eb2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo_patch_request_body.go @@ -0,0 +1,634 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemRepoPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. + allow_auto_merge *bool + // Either `true` to allow private forks, or `false` to prevent private forks. + allow_forking *bool + // Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. + allow_merge_commit *bool + // Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. + allow_rebase_merge *bool + // Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. + allow_squash_merge *bool + // Either `true` to always allow a pull request head branch that is behind its base branch to be updated even if it is not required to be up to date before merging, or false otherwise. + allow_update_branch *bool + // Whether to archive this repository. `false` will unarchive a previously archived repository. + archived *bool + // Updates the default branch for this repository. + default_branch *string + // Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. + delete_branch_on_merge *bool + // A short description of the repository. + description *string + // Either `true` to enable issues for this repository or `false` to disable them. + has_issues *bool + // Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. + has_projects *bool + // Either `true` to enable the wiki for this repository or `false` to disable it. + has_wiki *bool + // A URL with more information about the repository. + homepage *string + // Either `true` to make this repo available as a template repository or `false` to prevent it. + is_template *bool + // The name of the repository. + name *string + // Either `true` to make the repository private or `false` to make it public. Default: `false`. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. + private *bool + // Specify which security and analysis features to enable or disable for the repository.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."For example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request:`{ "security_and_analysis": {"advanced_security": { "status": "enabled" } } }`.You can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. + security_and_analysis ItemItemRepoPatchRequestBody_security_and_analysisable + // Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + // Deprecated: + use_squash_pr_title_as_default *bool + // Either `true` to require contributors to sign off on web-based commits, or `false` to not require contributors to sign off on web-based commits. + web_commit_signoff_required *bool +} +// NewItemItemRepoPatchRequestBody instantiates a new ItemItemRepoPatchRequestBody and sets the default values. +func NewItemItemRepoPatchRequestBody()(*ItemItemRepoPatchRequestBody) { + m := &ItemItemRepoPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemRepoPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemRepoPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemRepoPatchRequestBody(), 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 *ItemItemRepoPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowForking gets the allow_forking property value. Either `true` to allow private forks, or `false` to prevent private forks. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetAllowUpdateBranch gets the allow_update_branch property value. Either `true` to always allow a pull request head branch that is behind its base branch to be updated even if it is not required to be up to date before merging, or false otherwise. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetAllowUpdateBranch()(*bool) { + return m.allow_update_branch +} +// GetArchived gets the archived property value. Whether to archive this repository. `false` will unarchive a previously archived repository. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetArchived()(*bool) { + return m.archived +} +// GetDefaultBranch gets the default_branch property value. Updates the default branch for this repository. +// returns a *string when successful +func (m *ItemItemRepoPatchRequestBody) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDescription gets the description property value. A short description of the repository. +// returns a *string when successful +func (m *ItemItemRepoPatchRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemRepoPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["allow_update_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowUpdateBranch(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["security_and_analysis"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemRepoPatchRequestBody_security_and_analysisFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAndAnalysis(val.(ItemItemRepoPatchRequestBody_security_and_analysisable)) + } + return nil + } + res["use_squash_pr_title_as_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseSquashPrTitleAsDefault(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetHasIssues gets the has_issues property value. Either `true` to enable issues for this repository or `false` to disable them. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasProjects gets the has_projects property value. Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. Either `true` to enable the wiki for this repository or `false` to disable it. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. A URL with more information about the repository. +// returns a *string when successful +func (m *ItemItemRepoPatchRequestBody) GetHomepage()(*string) { + return m.homepage +} +// GetIsTemplate gets the is_template property value. Either `true` to make this repo available as a template repository or `false` to prevent it. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetIsTemplate()(*bool) { + return m.is_template +} +// GetName gets the name property value. The name of the repository. +// returns a *string when successful +func (m *ItemItemRepoPatchRequestBody) GetName()(*string) { + return m.name +} +// GetPrivate gets the private property value. Either `true` to make the repository private or `false` to make it public. Default: `false`. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetPrivate()(*bool) { + return m.private +} +// GetSecurityAndAnalysis gets the security_and_analysis property value. Specify which security and analysis features to enable or disable for the repository.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."For example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request:`{ "security_and_analysis": {"advanced_security": { "status": "enabled" } } }`.You can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. +// returns a ItemItemRepoPatchRequestBody_security_and_analysisable when successful +func (m *ItemItemRepoPatchRequestBody) GetSecurityAndAnalysis()(ItemItemRepoPatchRequestBody_security_and_analysisable) { + return m.security_and_analysis +} +// GetUseSquashPrTitleAsDefault gets the use_squash_pr_title_as_default property value. Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetUseSquashPrTitleAsDefault()(*bool) { + return m.use_squash_pr_title_as_default +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. Either `true` to require contributors to sign off on web-based commits, or `false` to not require contributors to sign off on web-based commits. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *ItemItemRepoPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_update_branch", m.GetAllowUpdateBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("security_and_analysis", m.GetSecurityAndAnalysis()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_squash_pr_title_as_default", m.GetUseSquashPrTitleAsDefault()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *ItemItemRepoPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. +func (m *ItemItemRepoPatchRequestBody) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowForking sets the allow_forking property value. Either `true` to allow private forks, or `false` to prevent private forks. +func (m *ItemItemRepoPatchRequestBody) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. +func (m *ItemItemRepoPatchRequestBody) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. +func (m *ItemItemRepoPatchRequestBody) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. +func (m *ItemItemRepoPatchRequestBody) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetAllowUpdateBranch sets the allow_update_branch property value. Either `true` to always allow a pull request head branch that is behind its base branch to be updated even if it is not required to be up to date before merging, or false otherwise. +func (m *ItemItemRepoPatchRequestBody) SetAllowUpdateBranch(value *bool)() { + m.allow_update_branch = value +} +// SetArchived sets the archived property value. Whether to archive this repository. `false` will unarchive a previously archived repository. +func (m *ItemItemRepoPatchRequestBody) SetArchived(value *bool)() { + m.archived = value +} +// SetDefaultBranch sets the default_branch property value. Updates the default branch for this repository. +func (m *ItemItemRepoPatchRequestBody) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. +func (m *ItemItemRepoPatchRequestBody) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDescription sets the description property value. A short description of the repository. +func (m *ItemItemRepoPatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetHasIssues sets the has_issues property value. Either `true` to enable issues for this repository or `false` to disable them. +func (m *ItemItemRepoPatchRequestBody) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasProjects sets the has_projects property value. Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. +func (m *ItemItemRepoPatchRequestBody) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. Either `true` to enable the wiki for this repository or `false` to disable it. +func (m *ItemItemRepoPatchRequestBody) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. A URL with more information about the repository. +func (m *ItemItemRepoPatchRequestBody) SetHomepage(value *string)() { + m.homepage = value +} +// SetIsTemplate sets the is_template property value. Either `true` to make this repo available as a template repository or `false` to prevent it. +func (m *ItemItemRepoPatchRequestBody) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetName sets the name property value. The name of the repository. +func (m *ItemItemRepoPatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetPrivate sets the private property value. Either `true` to make the repository private or `false` to make it public. Default: `false`. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. +func (m *ItemItemRepoPatchRequestBody) SetPrivate(value *bool)() { + m.private = value +} +// SetSecurityAndAnalysis sets the security_and_analysis property value. Specify which security and analysis features to enable or disable for the repository.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."For example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request:`{ "security_and_analysis": {"advanced_security": { "status": "enabled" } } }`.You can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. +func (m *ItemItemRepoPatchRequestBody) SetSecurityAndAnalysis(value ItemItemRepoPatchRequestBody_security_and_analysisable)() { + m.security_and_analysis = value +} +// SetUseSquashPrTitleAsDefault sets the use_squash_pr_title_as_default property value. Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +func (m *ItemItemRepoPatchRequestBody) SetUseSquashPrTitleAsDefault(value *bool)() { + m.use_squash_pr_title_as_default = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. Either `true` to require contributors to sign off on web-based commits, or `false` to not require contributors to sign off on web-based commits. +func (m *ItemItemRepoPatchRequestBody) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type ItemItemRepoPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetAllowUpdateBranch()(*bool) + GetArchived()(*bool) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDescription()(*string) + GetHasIssues()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetIsTemplate()(*bool) + GetName()(*string) + GetPrivate()(*bool) + GetSecurityAndAnalysis()(ItemItemRepoPatchRequestBody_security_and_analysisable) + GetUseSquashPrTitleAsDefault()(*bool) + GetWebCommitSignoffRequired()(*bool) + SetAllowAutoMerge(value *bool)() + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetAllowUpdateBranch(value *bool)() + SetArchived(value *bool)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDescription(value *string)() + SetHasIssues(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetIsTemplate(value *bool)() + SetName(value *string)() + SetPrivate(value *bool)() + SetSecurityAndAnalysis(value ItemItemRepoPatchRequestBody_security_and_analysisable)() + SetUseSquashPrTitleAsDefault(value *bool)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo_patch_request_body_security_and_analysis.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo_patch_request_body_security_and_analysis.go new file mode 100644 index 000000000..d5b32b376 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo_patch_request_body_security_and_analysis.go @@ -0,0 +1,139 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemRepoPatchRequestBody_security_and_analysis specify which security and analysis features to enable or disable for the repository.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."For example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request:`{ "security_and_analysis": {"advanced_security": { "status": "enabled" } } }`.You can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. +type ItemItemRepoPatchRequestBody_security_and_analysis struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." + advanced_security ItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityable + // Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." + secret_scanning ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningable + // Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." + secret_scanning_push_protection ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable +} +// NewItemItemRepoPatchRequestBody_security_and_analysis instantiates a new ItemItemRepoPatchRequestBody_security_and_analysis and sets the default values. +func NewItemItemRepoPatchRequestBody_security_and_analysis()(*ItemItemRepoPatchRequestBody_security_and_analysis) { + m := &ItemItemRepoPatchRequestBody_security_and_analysis{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemRepoPatchRequestBody_security_and_analysisFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemRepoPatchRequestBody_security_and_analysisFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemRepoPatchRequestBody_security_and_analysis(), 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 *ItemItemRepoPatchRequestBody_security_and_analysis) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvancedSecurity gets the advanced_security property value. Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." +// returns a ItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityable when successful +func (m *ItemItemRepoPatchRequestBody_security_and_analysis) GetAdvancedSecurity()(ItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityable) { + return m.advanced_security +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemRepoPatchRequestBody_security_and_analysis) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["advanced_security"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurity(val.(ItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityable)) + } + return nil + } + res["secret_scanning"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecretScanning(val.(ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningable)) + } + return nil + } + res["secret_scanning_push_protection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtection(val.(ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable)) + } + return nil + } + return res +} +// GetSecretScanning gets the secret_scanning property value. Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." +// returns a ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningable when successful +func (m *ItemItemRepoPatchRequestBody_security_and_analysis) GetSecretScanning()(ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningable) { + return m.secret_scanning +} +// GetSecretScanningPushProtection gets the secret_scanning_push_protection property value. Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." +// returns a ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable when successful +func (m *ItemItemRepoPatchRequestBody_security_and_analysis) GetSecretScanningPushProtection()(ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable) { + return m.secret_scanning_push_protection +} +// Serialize serializes information the current object +func (m *ItemItemRepoPatchRequestBody_security_and_analysis) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("advanced_security", m.GetAdvancedSecurity()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("secret_scanning", m.GetSecretScanning()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("secret_scanning_push_protection", m.GetSecretScanningPushProtection()) + 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 *ItemItemRepoPatchRequestBody_security_and_analysis) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvancedSecurity sets the advanced_security property value. Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." +func (m *ItemItemRepoPatchRequestBody_security_and_analysis) SetAdvancedSecurity(value ItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityable)() { + m.advanced_security = value +} +// SetSecretScanning sets the secret_scanning property value. Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." +func (m *ItemItemRepoPatchRequestBody_security_and_analysis) SetSecretScanning(value ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningable)() { + m.secret_scanning = value +} +// SetSecretScanningPushProtection sets the secret_scanning_push_protection property value. Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." +func (m *ItemItemRepoPatchRequestBody_security_and_analysis) SetSecretScanningPushProtection(value ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable)() { + m.secret_scanning_push_protection = value +} +type ItemItemRepoPatchRequestBody_security_and_analysisable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdvancedSecurity()(ItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityable) + GetSecretScanning()(ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningable) + GetSecretScanningPushProtection()(ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable) + SetAdvancedSecurity(value ItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityable)() + SetSecretScanning(value ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningable)() + SetSecretScanningPushProtection(value ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo_patch_request_body_security_and_analysis_advanced_security.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo_patch_request_body_security_and_analysis_advanced_security.go new file mode 100644 index 000000000..064955b3c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo_patch_request_body_security_and_analysis_advanced_security.go @@ -0,0 +1,81 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." +type ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Can be `enabled` or `disabled`. + status *string +} +// NewItemItemRepoPatchRequestBody_security_and_analysis_advanced_security instantiates a new ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security and sets the default values. +func NewItemItemRepoPatchRequestBody_security_and_analysis_advanced_security()(*ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security) { + m := &ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemRepoPatchRequestBody_security_and_analysis_advanced_security(), 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 *ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetStatus gets the status property value. Can be `enabled` or `disabled`. +// returns a *string when successful +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. Can be `enabled` or `disabled`. +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security) SetStatus(value *string)() { + m.status = value +} +type ItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*string) + SetStatus(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo_patch_request_body_security_and_analysis_secret_scanning.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo_patch_request_body_security_and_analysis_secret_scanning.go new file mode 100644 index 000000000..e12b9ac94 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo_patch_request_body_security_and_analysis_secret_scanning.go @@ -0,0 +1,81 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." +type ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Can be `enabled` or `disabled`. + status *string +} +// NewItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning instantiates a new ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning and sets the default values. +func NewItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning()(*ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning) { + m := &ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning(), 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 *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetStatus gets the status property value. Can be `enabled` or `disabled`. +// returns a *string when successful +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. Can be `enabled` or `disabled`. +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning) SetStatus(value *string)() { + m.status = value +} +type ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*string) + SetStatus(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo_patch_request_body_security_and_analysis_secret_scanning_push_protection.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo_patch_request_body_security_and_analysis_secret_scanning_push_protection.go new file mode 100644 index 000000000..da569ebf8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_repo_patch_request_body_security_and_analysis_secret_scanning_push_protection.go @@ -0,0 +1,81 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." +type ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Can be `enabled` or `disabled`. + status *string +} +// NewItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection instantiates a new ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection and sets the default values. +func NewItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection()(*ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) { + m := &ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection(), 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 *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetStatus gets the status property value. Can be `enabled` or `disabled`. +// returns a *string when successful +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. Can be `enabled` or `disabled`. +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) SetStatus(value *string)() { + m.status = value +} +type ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*string) + SetStatus(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rules_branches_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rules_branches_request_builder.go new file mode 100644 index 000000000..9ad71c8b9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rules_branches_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemRulesBranchesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\rules\branches +type ItemItemRulesBranchesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByBranch gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.rules.branches.item collection +// returns a *ItemItemRulesBranchesWithBranchItemRequestBuilder when successful +func (m *ItemItemRulesBranchesRequestBuilder) ByBranch(branch string)(*ItemItemRulesBranchesWithBranchItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if branch != "" { + urlTplParams["branch"] = branch + } + return NewItemItemRulesBranchesWithBranchItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemRulesBranchesRequestBuilderInternal instantiates a new ItemItemRulesBranchesRequestBuilder and sets the default values. +func NewItemItemRulesBranchesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesBranchesRequestBuilder) { + m := &ItemItemRulesBranchesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/rules/branches", pathParameters), + } + return m +} +// NewItemItemRulesBranchesRequestBuilder instantiates a new ItemItemRulesBranchesRequestBuilder and sets the default values. +func NewItemItemRulesBranchesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesBranchesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemRulesBranchesRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rules_branches_with_branch_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rules_branches_with_branch_item_request_builder.go new file mode 100644 index 000000000..c3ce89995 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rules_branches_with_branch_item_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemRulesBranchesWithBranchItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\rules\branches\{branch} +type ItemItemRulesBranchesWithBranchItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemRulesBranchesWithBranchItemRequestBuilderGetQueryParameters returns all active rules that apply to the specified branch. The branch does not need to exist; rules that would applyto a branch with that name will be returned. All active rules that apply will be returned, regardless of the levelat which they are configured (e.g. repository or organization). Rules in rulesets with "evaluate" or "disabled"enforcement statuses are not returned. +type ItemItemRulesBranchesWithBranchItemRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemRulesBranchesWithBranchItemRequestBuilderInternal instantiates a new ItemItemRulesBranchesWithBranchItemRequestBuilder and sets the default values. +func NewItemItemRulesBranchesWithBranchItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesBranchesWithBranchItemRequestBuilder) { + m := &ItemItemRulesBranchesWithBranchItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/rules/branches/{branch}{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemRulesBranchesWithBranchItemRequestBuilder instantiates a new ItemItemRulesBranchesWithBranchItemRequestBuilder and sets the default values. +func NewItemItemRulesBranchesWithBranchItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesBranchesWithBranchItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemRulesBranchesWithBranchItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns all active rules that apply to the specified branch. The branch does not need to exist; rules that would applyto a branch with that name will be returned. All active rules that apply will be returned, regardless of the levelat which they are configured (e.g. repository or organization). Rules in rulesets with "evaluate" or "disabled"enforcement statuses are not returned. +// returns a []RepositoryRuleDetailedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch +func (m *ItemItemRulesBranchesWithBranchItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemRulesBranchesWithBranchItemRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleDetailedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRuleDetailedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleDetailedable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleDetailedable) + } + } + return val, nil +} +// ToGetRequestInformation returns all active rules that apply to the specified branch. The branch does not need to exist; rules that would applyto a branch with that name will be returned. All active rules that apply will be returned, regardless of the levelat which they are configured (e.g. repository or organization). Rules in rulesets with "evaluate" or "disabled"enforcement statuses are not returned. +// returns a *RequestInformation when successful +func (m *ItemItemRulesBranchesWithBranchItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemRulesBranchesWithBranchItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemRulesBranchesWithBranchItemRequestBuilder when successful +func (m *ItemItemRulesBranchesWithBranchItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemRulesBranchesWithBranchItemRequestBuilder) { + return NewItemItemRulesBranchesWithBranchItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rules_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rules_request_builder.go new file mode 100644 index 000000000..7630fadee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rules_request_builder.go @@ -0,0 +1,28 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemRulesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\rules +type ItemItemRulesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Branches the branches property +// returns a *ItemItemRulesBranchesRequestBuilder when successful +func (m *ItemItemRulesRequestBuilder) Branches()(*ItemItemRulesBranchesRequestBuilder) { + return NewItemItemRulesBranchesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemRulesRequestBuilderInternal instantiates a new ItemItemRulesRequestBuilder and sets the default values. +func NewItemItemRulesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesRequestBuilder) { + m := &ItemItemRulesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/rules", pathParameters), + } + return m +} +// NewItemItemRulesRequestBuilder instantiates a new ItemItemRulesRequestBuilder and sets the default values. +func NewItemItemRulesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemRulesRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_item_with_ruleset_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_item_with_ruleset_put_request_body.go new file mode 100644 index 000000000..fbdc66f5a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_item_with_ruleset_put_request_body.go @@ -0,0 +1,222 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemRulesetsItemWithRuleset_PutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The actors that can bypass the rules in this ruleset + bypass_actors []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable + // Parameters for a repository ruleset ref name condition + conditions i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetConditionsable + // The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). + enforcement *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement + // The name of the ruleset. + name *string + // An array of rules within the ruleset. + rules []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable +} +// NewItemItemRulesetsItemWithRuleset_PutRequestBody instantiates a new ItemItemRulesetsItemWithRuleset_PutRequestBody and sets the default values. +func NewItemItemRulesetsItemWithRuleset_PutRequestBody()(*ItemItemRulesetsItemWithRuleset_PutRequestBody) { + m := &ItemItemRulesetsItemWithRuleset_PutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemRulesetsItemWithRuleset_PutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemRulesetsItemWithRuleset_PutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemRulesetsItemWithRuleset_PutRequestBody(), 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 *ItemItemRulesetsItemWithRuleset_PutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassActors gets the bypass_actors property value. The actors that can bypass the rules in this ruleset +// returns a []RepositoryRulesetBypassActorable when successful +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) GetBypassActors()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable) { + return m.bypass_actors +} +// GetConditions gets the conditions property value. Parameters for a repository ruleset ref name condition +// returns a RepositoryRulesetConditionsable when successful +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) GetConditions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetConditionsable) { + return m.conditions +} +// GetEnforcement gets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). +// returns a *RepositoryRuleEnforcement when successful +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) GetEnforcement()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement) { + return m.enforcement +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bypass_actors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRulesetBypassActorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable) + } + } + m.SetBypassActors(res) + } + return nil + } + res["conditions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRulesetConditionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConditions(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetConditionsable)) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ParseRepositoryRuleEnforcement) + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val.(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["rules"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRuleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable) + } + } + m.SetRules(res) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the ruleset. +// returns a *string when successful +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) GetName()(*string) { + return m.name +} +// GetRules gets the rules property value. An array of rules within the ruleset. +// returns a []RepositoryRuleable when successful +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) GetRules()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable) { + return m.rules +} +// Serialize serializes information the current object +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBypassActors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetBypassActors())) + for i, v := range m.GetBypassActors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("bypass_actors", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("conditions", m.GetConditions()) + if err != nil { + return err + } + } + if m.GetEnforcement() != nil { + cast := (*m.GetEnforcement()).String() + err := writer.WriteStringValue("enforcement", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetRules() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRules())) + for i, v := range m.GetRules() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("rules", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassActors sets the bypass_actors property value. The actors that can bypass the rules in this ruleset +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) SetBypassActors(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable)() { + m.bypass_actors = value +} +// SetConditions sets the conditions property value. Parameters for a repository ruleset ref name condition +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) SetConditions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetConditionsable)() { + m.conditions = value +} +// SetEnforcement sets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) SetEnforcement(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement)() { + m.enforcement = value +} +// SetName sets the name property value. The name of the ruleset. +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) SetName(value *string)() { + m.name = value +} +// SetRules sets the rules property value. An array of rules within the ruleset. +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) SetRules(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable)() { + m.rules = value +} +type ItemItemRulesetsItemWithRuleset_PutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassActors()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable) + GetConditions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetConditionsable) + GetEnforcement()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement) + GetName()(*string) + GetRules()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable) + SetBypassActors(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable)() + SetConditions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetConditionsable)() + SetEnforcement(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement)() + SetName(value *string)() + SetRules(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_post_request_body.go new file mode 100644 index 000000000..c53ace892 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_post_request_body.go @@ -0,0 +1,222 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemRulesetsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The actors that can bypass the rules in this ruleset + bypass_actors []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable + // Parameters for a repository ruleset ref name condition + conditions i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetConditionsable + // The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). + enforcement *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement + // The name of the ruleset. + name *string + // An array of rules within the ruleset. + rules []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable +} +// NewItemItemRulesetsPostRequestBody instantiates a new ItemItemRulesetsPostRequestBody and sets the default values. +func NewItemItemRulesetsPostRequestBody()(*ItemItemRulesetsPostRequestBody) { + m := &ItemItemRulesetsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemRulesetsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemRulesetsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemRulesetsPostRequestBody(), 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 *ItemItemRulesetsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassActors gets the bypass_actors property value. The actors that can bypass the rules in this ruleset +// returns a []RepositoryRulesetBypassActorable when successful +func (m *ItemItemRulesetsPostRequestBody) GetBypassActors()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable) { + return m.bypass_actors +} +// GetConditions gets the conditions property value. Parameters for a repository ruleset ref name condition +// returns a RepositoryRulesetConditionsable when successful +func (m *ItemItemRulesetsPostRequestBody) GetConditions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetConditionsable) { + return m.conditions +} +// GetEnforcement gets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). +// returns a *RepositoryRuleEnforcement when successful +func (m *ItemItemRulesetsPostRequestBody) GetEnforcement()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement) { + return m.enforcement +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemRulesetsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bypass_actors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRulesetBypassActorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable) + } + } + m.SetBypassActors(res) + } + return nil + } + res["conditions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRulesetConditionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConditions(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetConditionsable)) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ParseRepositoryRuleEnforcement) + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val.(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["rules"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRuleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable) + } + } + m.SetRules(res) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the ruleset. +// returns a *string when successful +func (m *ItemItemRulesetsPostRequestBody) GetName()(*string) { + return m.name +} +// GetRules gets the rules property value. An array of rules within the ruleset. +// returns a []RepositoryRuleable when successful +func (m *ItemItemRulesetsPostRequestBody) GetRules()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable) { + return m.rules +} +// Serialize serializes information the current object +func (m *ItemItemRulesetsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBypassActors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetBypassActors())) + for i, v := range m.GetBypassActors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("bypass_actors", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("conditions", m.GetConditions()) + if err != nil { + return err + } + } + if m.GetEnforcement() != nil { + cast := (*m.GetEnforcement()).String() + err := writer.WriteStringValue("enforcement", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetRules() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRules())) + for i, v := range m.GetRules() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("rules", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemRulesetsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassActors sets the bypass_actors property value. The actors that can bypass the rules in this ruleset +func (m *ItemItemRulesetsPostRequestBody) SetBypassActors(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable)() { + m.bypass_actors = value +} +// SetConditions sets the conditions property value. Parameters for a repository ruleset ref name condition +func (m *ItemItemRulesetsPostRequestBody) SetConditions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetConditionsable)() { + m.conditions = value +} +// SetEnforcement sets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). +func (m *ItemItemRulesetsPostRequestBody) SetEnforcement(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement)() { + m.enforcement = value +} +// SetName sets the name property value. The name of the ruleset. +func (m *ItemItemRulesetsPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetRules sets the rules property value. An array of rules within the ruleset. +func (m *ItemItemRulesetsPostRequestBody) SetRules(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable)() { + m.rules = value +} +type ItemItemRulesetsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassActors()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable) + GetConditions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetConditionsable) + GetEnforcement()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement) + GetName()(*string) + GetRules()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable) + SetBypassActors(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable)() + SetConditions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetConditionsable)() + SetEnforcement(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement)() + SetName(value *string)() + SetRules(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_request_builder.go new file mode 100644 index 000000000..370b5ef03 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_request_builder.go @@ -0,0 +1,128 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemRulesetsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\rulesets +type ItemItemRulesetsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemRulesetsRequestBuilderGetQueryParameters get all the rulesets for a repository. +type ItemItemRulesetsRequestBuilderGetQueryParameters struct { + // Include rulesets configured at higher levels that apply to this repository + Includes_parents *bool `uriparametername:"includes_parents"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRuleset_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.rulesets.item collection +// returns a *ItemItemRulesetsWithRuleset_ItemRequestBuilder when successful +func (m *ItemItemRulesetsRequestBuilder) ByRuleset_id(ruleset_id int32)(*ItemItemRulesetsWithRuleset_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["ruleset_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(ruleset_id), 10) + return NewItemItemRulesetsWithRuleset_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemRulesetsRequestBuilderInternal instantiates a new ItemItemRulesetsRequestBuilder and sets the default values. +func NewItemItemRulesetsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesetsRequestBuilder) { + m := &ItemItemRulesetsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/rulesets{?includes_parents*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemRulesetsRequestBuilder instantiates a new ItemItemRulesetsRequestBuilder and sets the default values. +func NewItemItemRulesetsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesetsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemRulesetsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get all the rulesets for a repository. +// returns a []RepositoryRulesetable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets +func (m *ItemItemRulesetsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemRulesetsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRulesetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable) + } + } + return val, nil +} +// Post create a ruleset for a repository. +// returns a RepositoryRulesetable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset +func (m *ItemItemRulesetsRequestBuilder) Post(ctx context.Context, body ItemItemRulesetsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRulesetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable), nil +} +// RuleSuites the ruleSuites property +// returns a *ItemItemRulesetsRuleSuitesRequestBuilder when successful +func (m *ItemItemRulesetsRequestBuilder) RuleSuites()(*ItemItemRulesetsRuleSuitesRequestBuilder) { + return NewItemItemRulesetsRuleSuitesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation get all the rulesets for a repository. +// returns a *RequestInformation when successful +func (m *ItemItemRulesetsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemRulesetsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation create a ruleset for a repository. +// returns a *RequestInformation when successful +func (m *ItemItemRulesetsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemRulesetsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemRulesetsRequestBuilder when successful +func (m *ItemItemRulesetsRequestBuilder) WithUrl(rawUrl string)(*ItemItemRulesetsRequestBuilder) { + return NewItemItemRulesetsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_rule_suites_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_rule_suites_request_builder.go new file mode 100644 index 000000000..10adbfda3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_rule_suites_request_builder.go @@ -0,0 +1,93 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i49541909782daeed2b70c270599a2d0c588ee37e976ebe46c3c799c2e46d3043 "github.com/octokit/go-sdk/pkg/github/repos/item/item/rulesets/rulesuites" +) + +// ItemItemRulesetsRuleSuitesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\rulesets\rule-suites +type ItemItemRulesetsRuleSuitesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemRulesetsRuleSuitesRequestBuilderGetQueryParameters lists suites of rule evaluations at the repository level.For more information, see "[Managing rulesets for a repository](https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets)." +type ItemItemRulesetsRuleSuitesRequestBuilderGetQueryParameters struct { + // The handle for the GitHub user account to filter on. When specified, only rule evaluations triggered by this actor will be returned. + Actor_name *string `uriparametername:"actor_name"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The name of the ref. Cannot contain wildcard characters. When specified, only rule evaluations triggered for this ref will be returned. + Ref *string `uriparametername:"ref"` + // The rule results to filter on. When specified, only suites with this result will be returned. + Rule_suite_result *i49541909782daeed2b70c270599a2d0c588ee37e976ebe46c3c799c2e46d3043.GetRule_suite_resultQueryParameterType `uriparametername:"rule_suite_result"` + // The time period to filter by.For example, `day` will filter for rule suites that occurred in the past 24 hours, and `week` will filter for insights that occurred in the past 7 days (168 hours). + Time_period *i49541909782daeed2b70c270599a2d0c588ee37e976ebe46c3c799c2e46d3043.GetTime_periodQueryParameterType `uriparametername:"time_period"` +} +// ByRule_suite_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.rulesets.ruleSuites.item collection +// returns a *ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder when successful +func (m *ItemItemRulesetsRuleSuitesRequestBuilder) ByRule_suite_id(rule_suite_id int32)(*ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["rule_suite_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(rule_suite_id), 10) + return NewItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemRulesetsRuleSuitesRequestBuilderInternal instantiates a new ItemItemRulesetsRuleSuitesRequestBuilder and sets the default values. +func NewItemItemRulesetsRuleSuitesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesetsRuleSuitesRequestBuilder) { + m := &ItemItemRulesetsRuleSuitesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/rulesets/rule-suites{?actor_name*,page*,per_page*,ref*,rule_suite_result*,time_period*}", pathParameters), + } + return m +} +// NewItemItemRulesetsRuleSuitesRequestBuilder instantiates a new ItemItemRulesetsRuleSuitesRequestBuilder and sets the default values. +func NewItemItemRulesetsRuleSuitesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesetsRuleSuitesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemRulesetsRuleSuitesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists suites of rule evaluations at the repository level.For more information, see "[Managing rulesets for a repository](https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets)." +// returns a []RuleSuitesable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/rule-suites#list-repository-rule-suites +func (m *ItemItemRulesetsRuleSuitesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemRulesetsRuleSuitesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RuleSuitesable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRuleSuitesFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RuleSuitesable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RuleSuitesable) + } + } + return val, nil +} +// ToGetRequestInformation lists suites of rule evaluations at the repository level.For more information, see "[Managing rulesets for a repository](https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets)." +// returns a *RequestInformation when successful +func (m *ItemItemRulesetsRuleSuitesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemRulesetsRuleSuitesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemRulesetsRuleSuitesRequestBuilder when successful +func (m *ItemItemRulesetsRuleSuitesRequestBuilder) WithUrl(rawUrl string)(*ItemItemRulesetsRuleSuitesRequestBuilder) { + return NewItemItemRulesetsRuleSuitesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_rule_suites_with_rule_suite_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_rule_suites_with_rule_suite_item_request_builder.go new file mode 100644 index 000000000..cd340529e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_rule_suites_with_rule_suite_item_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\rulesets\rule-suites\{rule_suite_id} +type ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilderInternal instantiates a new ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder and sets the default values. +func NewItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) { + m := &ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/rulesets/rule-suites/{rule_suite_id}", pathParameters), + } + return m +} +// NewItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder instantiates a new ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder and sets the default values. +func NewItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets information about a suite of rule evaluations from within a repository.For more information, see "[Managing rulesets for a repository](https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets)." +// returns a RuleSuiteable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/rule-suites#get-a-repository-rule-suite +func (m *ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RuleSuiteable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRuleSuiteFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RuleSuiteable), nil +} +// ToGetRequestInformation gets information about a suite of rule evaluations from within a repository.For more information, see "[Managing rulesets for a repository](https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets)." +// returns a *RequestInformation when successful +func (m *ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder when successful +func (m *ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) { + return NewItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_with_ruleset_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_with_ruleset_item_request_builder.go new file mode 100644 index 000000000..3acd392c3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_rulesets_with_ruleset_item_request_builder.go @@ -0,0 +1,134 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemRulesetsWithRuleset_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\rulesets\{ruleset_id} +type ItemItemRulesetsWithRuleset_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemRulesetsWithRuleset_ItemRequestBuilderGetQueryParameters get a ruleset for a repository. +type ItemItemRulesetsWithRuleset_ItemRequestBuilderGetQueryParameters struct { + // Include rulesets configured at higher levels that apply to this repository + Includes_parents *bool `uriparametername:"includes_parents"` +} +// NewItemItemRulesetsWithRuleset_ItemRequestBuilderInternal instantiates a new ItemItemRulesetsWithRuleset_ItemRequestBuilder and sets the default values. +func NewItemItemRulesetsWithRuleset_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesetsWithRuleset_ItemRequestBuilder) { + m := &ItemItemRulesetsWithRuleset_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/rulesets/{ruleset_id}{?includes_parents*}", pathParameters), + } + return m +} +// NewItemItemRulesetsWithRuleset_ItemRequestBuilder instantiates a new ItemItemRulesetsWithRuleset_ItemRequestBuilder and sets the default values. +func NewItemItemRulesetsWithRuleset_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesetsWithRuleset_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemRulesetsWithRuleset_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a ruleset for a repository. +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset +func (m *ItemItemRulesetsWithRuleset_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get get a ruleset for a repository. +// returns a RepositoryRulesetable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset +func (m *ItemItemRulesetsWithRuleset_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemRulesetsWithRuleset_ItemRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRulesetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable), nil +} +// Put update a ruleset for a repository. +// returns a RepositoryRulesetable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset +func (m *ItemItemRulesetsWithRuleset_ItemRequestBuilder) Put(ctx context.Context, body ItemItemRulesetsItemWithRuleset_PutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryRulesetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetable), nil +} +// ToDeleteRequestInformation delete a ruleset for a repository. +// returns a *RequestInformation when successful +func (m *ItemItemRulesetsWithRuleset_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation get a ruleset for a repository. +// returns a *RequestInformation when successful +func (m *ItemItemRulesetsWithRuleset_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemRulesetsWithRuleset_ItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation update a ruleset for a repository. +// returns a *RequestInformation when successful +func (m *ItemItemRulesetsWithRuleset_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemRulesetsItemWithRuleset_PutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemRulesetsWithRuleset_ItemRequestBuilder when successful +func (m *ItemItemRulesetsWithRuleset_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemRulesetsWithRuleset_ItemRequestBuilder) { + return NewItemItemRulesetsWithRuleset_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_secret_scanning_alerts_item_locations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_secret_scanning_alerts_item_locations_request_builder.go new file mode 100644 index 000000000..59919ca5a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_secret_scanning_alerts_item_locations_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemSecretScanningAlertsItemLocationsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\secret-scanning\alerts\{alert_number}\locations +type ItemItemSecretScanningAlertsItemLocationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemSecretScanningAlertsItemLocationsRequestBuilderGetQueryParameters lists all locations for a given secret scanning alert for an eligible repository.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +type ItemItemSecretScanningAlertsItemLocationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemSecretScanningAlertsItemLocationsRequestBuilderInternal instantiates a new ItemItemSecretScanningAlertsItemLocationsRequestBuilder and sets the default values. +func NewItemItemSecretScanningAlertsItemLocationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningAlertsItemLocationsRequestBuilder) { + m := &ItemItemSecretScanningAlertsItemLocationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/secret-scanning/alerts/{alert_number}/locations{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemSecretScanningAlertsItemLocationsRequestBuilder instantiates a new ItemItemSecretScanningAlertsItemLocationsRequestBuilder and sets the default values. +func NewItemItemSecretScanningAlertsItemLocationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningAlertsItemLocationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSecretScanningAlertsItemLocationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all locations for a given secret scanning alert for an eligible repository.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a []SecretScanningLocationable when successful +// returns a Locations503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert +func (m *ItemItemSecretScanningAlertsItemLocationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemSecretScanningAlertsItemLocationsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningLocationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateLocations503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSecretScanningLocationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningLocationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningLocationable) + } + } + return val, nil +} +// ToGetRequestInformation lists all locations for a given secret scanning alert for an eligible repository.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemItemSecretScanningAlertsItemLocationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemSecretScanningAlertsItemLocationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemSecretScanningAlertsItemLocationsRequestBuilder when successful +func (m *ItemItemSecretScanningAlertsItemLocationsRequestBuilder) WithUrl(rawUrl string)(*ItemItemSecretScanningAlertsItemLocationsRequestBuilder) { + return NewItemItemSecretScanningAlertsItemLocationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_secret_scanning_alerts_item_with_alert_number_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_secret_scanning_alerts_item_with_alert_number_patch_request_body.go new file mode 100644 index 000000000..7687ed337 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_secret_scanning_alerts_item_with_alert_number_patch_request_body.go @@ -0,0 +1,141 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // **Required when the `state` is `resolved`.** The reason for resolving the alert. + resolution *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertResolution + // An optional comment when closing an alert. Cannot be updated or deleted. Must be `null` when changing `state` to `open`. + resolution_comment *string + // Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. + state *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertState +} +// NewItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody instantiates a new ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody and sets the default values. +func NewItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody()(*ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) { + m := &ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody(), 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 *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["resolution"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ParseSecretScanningAlertResolution) + if err != nil { + return err + } + if val != nil { + m.SetResolution(val.(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertResolution)) + } + return nil + } + res["resolution_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResolutionComment(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ParseSecretScanningAlertState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertState)) + } + return nil + } + return res +} +// GetResolution gets the resolution property value. **Required when the `state` is `resolved`.** The reason for resolving the alert. +// returns a *SecretScanningAlertResolution when successful +func (m *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) GetResolution()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertResolution) { + return m.resolution +} +// GetResolutionComment gets the resolution_comment property value. An optional comment when closing an alert. Cannot be updated or deleted. Must be `null` when changing `state` to `open`. +// returns a *string when successful +func (m *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) GetResolutionComment()(*string) { + return m.resolution_comment +} +// GetState gets the state property value. Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. +// returns a *SecretScanningAlertState when successful +func (m *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) GetState()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertState) { + return m.state +} +// Serialize serializes information the current object +func (m *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetResolution() != nil { + cast := (*m.GetResolution()).String() + err := writer.WriteStringValue("resolution", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("resolution_comment", m.GetResolutionComment()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetResolution sets the resolution property value. **Required when the `state` is `resolved`.** The reason for resolving the alert. +func (m *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) SetResolution(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertResolution)() { + m.resolution = value +} +// SetResolutionComment sets the resolution_comment property value. An optional comment when closing an alert. Cannot be updated or deleted. Must be `null` when changing `state` to `open`. +func (m *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) SetResolutionComment(value *string)() { + m.resolution_comment = value +} +// SetState sets the state property value. Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. +func (m *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) SetState(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertState)() { + m.state = value +} +type ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetResolution()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertResolution) + GetResolutionComment()(*string) + GetState()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertState) + SetResolution(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertResolution)() + SetResolutionComment(value *string)() + SetState(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertState)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_secret_scanning_alerts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_secret_scanning_alerts_request_builder.go new file mode 100644 index 000000000..834ad4e0b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_secret_scanning_alerts_request_builder.go @@ -0,0 +1,99 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + ifed8ddc03e7fae238df937128818f42535837e18e6b784c23db9ad03bec21683 "github.com/octokit/go-sdk/pkg/github/repos/item/item/secretscanning/alerts" +) + +// ItemItemSecretScanningAlertsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\secret-scanning\alerts +type ItemItemSecretScanningAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemSecretScanningAlertsRequestBuilderGetQueryParameters lists secret scanning alerts for an eligible repository, from newest to oldest.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +type ItemItemSecretScanningAlertsRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *ifed8ddc03e7fae238df937128818f42535837e18e6b784c23db9ad03bec21683.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. + Resolution *string `uriparametername:"resolution"` + // A comma-separated list of secret types to return. By default all secret types are returned.See "[Secret scanning patterns](https://docs.github.com/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)"for a complete list of secret types. + Secret_type *string `uriparametername:"secret_type"` + // The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. + Sort *ifed8ddc03e7fae238df937128818f42535837e18e6b784c23db9ad03bec21683.GetSortQueryParameterType `uriparametername:"sort"` + // Set to `open` or `resolved` to only list secret scanning alerts in a specific state. + State *ifed8ddc03e7fae238df937128818f42535837e18e6b784c23db9ad03bec21683.GetStateQueryParameterType `uriparametername:"state"` + // A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. + Validity *string `uriparametername:"validity"` +} +// ByAlert_number gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.secretScanning.alerts.item collection +// returns a *ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder when successful +func (m *ItemItemSecretScanningAlertsRequestBuilder) ByAlert_number(alert_number int32)(*ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["alert_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(alert_number), 10) + return NewItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemSecretScanningAlertsRequestBuilderInternal instantiates a new ItemItemSecretScanningAlertsRequestBuilder and sets the default values. +func NewItemItemSecretScanningAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningAlertsRequestBuilder) { + m := &ItemItemSecretScanningAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/secret-scanning/alerts{?after*,before*,direction*,page*,per_page*,resolution*,secret_type*,sort*,state*,validity*}", pathParameters), + } + return m +} +// NewItemItemSecretScanningAlertsRequestBuilder instantiates a new ItemItemSecretScanningAlertsRequestBuilder and sets the default values. +func NewItemItemSecretScanningAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSecretScanningAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists secret scanning alerts for an eligible repository, from newest to oldest.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a []SecretScanningAlertable when successful +// returns a Alerts503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository +func (m *ItemItemSecretScanningAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemSecretScanningAlertsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateAlerts503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSecretScanningAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertable) + } + } + return val, nil +} +// ToGetRequestInformation lists secret scanning alerts for an eligible repository, from newest to oldest.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemItemSecretScanningAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemSecretScanningAlertsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemSecretScanningAlertsRequestBuilder when successful +func (m *ItemItemSecretScanningAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemItemSecretScanningAlertsRequestBuilder) { + return NewItemItemSecretScanningAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_secret_scanning_alerts_with_alert_number_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_secret_scanning_alerts_with_alert_number_item_request_builder.go new file mode 100644 index 000000000..bd0c75ec2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_secret_scanning_alerts_with_alert_number_item_request_builder.go @@ -0,0 +1,101 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\secret-scanning\alerts\{alert_number} +type ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilderInternal instantiates a new ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder and sets the default values. +func NewItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) { + m := &ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/secret-scanning/alerts/{alert_number}", pathParameters), + } + return m +} +// NewItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder instantiates a new ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder and sets the default values. +func NewItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a single secret scanning alert detected in an eligible repository.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a SecretScanningAlertable when successful +// returns a SecretScanningAlert503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert +func (m *ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSecretScanningAlert503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSecretScanningAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertable), nil +} +// Locations the locations property +// returns a *ItemItemSecretScanningAlertsItemLocationsRequestBuilder when successful +func (m *ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) Locations()(*ItemItemSecretScanningAlertsItemLocationsRequestBuilder) { + return NewItemItemSecretScanningAlertsItemLocationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch updates the status of a secret scanning alert in an eligible repository.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a SecretScanningAlertable when successful +// returns a SecretScanningAlert503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert +func (m *ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) Patch(ctx context.Context, body ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSecretScanningAlert503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSecretScanningAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningAlertable), nil +} +// ToGetRequestInformation gets a single secret scanning alert detected in an eligible repository.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates the status of a secret scanning alert in an eligible repository.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder when successful +func (m *ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) { + return NewItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_secret_scanning_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_secret_scanning_request_builder.go new file mode 100644 index 000000000..6231e7710 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_secret_scanning_request_builder.go @@ -0,0 +1,28 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemSecretScanningRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\secret-scanning +type ItemItemSecretScanningRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Alerts the alerts property +// returns a *ItemItemSecretScanningAlertsRequestBuilder when successful +func (m *ItemItemSecretScanningRequestBuilder) Alerts()(*ItemItemSecretScanningAlertsRequestBuilder) { + return NewItemItemSecretScanningAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemSecretScanningRequestBuilderInternal instantiates a new ItemItemSecretScanningRequestBuilder and sets the default values. +func NewItemItemSecretScanningRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningRequestBuilder) { + m := &ItemItemSecretScanningRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/secret-scanning", pathParameters), + } + return m +} +// NewItemItemSecretScanningRequestBuilder instantiates a new ItemItemSecretScanningRequestBuilder and sets the default values. +func NewItemItemSecretScanningRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSecretScanningRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_item_cve_post_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_item_cve_post_response.go new file mode 100644 index 000000000..3d59cbfc3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_item_cve_post_response.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemSecurityAdvisoriesItemCvePostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemSecurityAdvisoriesItemCvePostResponse instantiates a new ItemItemSecurityAdvisoriesItemCvePostResponse and sets the default values. +func NewItemItemSecurityAdvisoriesItemCvePostResponse()(*ItemItemSecurityAdvisoriesItemCvePostResponse) { + m := &ItemItemSecurityAdvisoriesItemCvePostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemSecurityAdvisoriesItemCvePostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemSecurityAdvisoriesItemCvePostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemSecurityAdvisoriesItemCvePostResponse(), 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 *ItemItemSecurityAdvisoriesItemCvePostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemSecurityAdvisoriesItemCvePostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemSecurityAdvisoriesItemCvePostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemSecurityAdvisoriesItemCvePostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemSecurityAdvisoriesItemCvePostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_item_cve_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_item_cve_request_builder.go new file mode 100644 index 000000000..803588014 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_item_cve_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemSecurityAdvisoriesItemCveRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\security-advisories\{ghsa_id}\cve +type ItemItemSecurityAdvisoriesItemCveRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemSecurityAdvisoriesItemCveRequestBuilderInternal instantiates a new ItemItemSecurityAdvisoriesItemCveRequestBuilder and sets the default values. +func NewItemItemSecurityAdvisoriesItemCveRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecurityAdvisoriesItemCveRequestBuilder) { + m := &ItemItemSecurityAdvisoriesItemCveRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/security-advisories/{ghsa_id}/cve", pathParameters), + } + return m +} +// NewItemItemSecurityAdvisoriesItemCveRequestBuilder instantiates a new ItemItemSecurityAdvisoriesItemCveRequestBuilder and sets the default values. +func NewItemItemSecurityAdvisoriesItemCveRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecurityAdvisoriesItemCveRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSecurityAdvisoriesItemCveRequestBuilderInternal(urlParams, requestAdapter) +} +// Post if you want a CVE identification number for the security vulnerability in your project, and don't already have one, you can request a CVE identification number from GitHub. For more information see "[Requesting a CVE identification number](https://docs.github.com/code-security/security-advisories/repository-security-advisories/publishing-a-repository-security-advisory#requesting-a-cve-identification-number-optional)."You may request a CVE for public repositories, but cannot do so for private repositories.In order to request a CVE for a repository security advisory, the authenticated user must be a security manager or administrator of that repository.OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:write` scope to use this endpoint. +// returns a ItemItemSecurityAdvisoriesItemCvePostResponseable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory +func (m *ItemItemSecurityAdvisoriesItemCveRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemSecurityAdvisoriesItemCvePostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemSecurityAdvisoriesItemCvePostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemSecurityAdvisoriesItemCvePostResponseable), nil +} +// ToPostRequestInformation if you want a CVE identification number for the security vulnerability in your project, and don't already have one, you can request a CVE identification number from GitHub. For more information see "[Requesting a CVE identification number](https://docs.github.com/code-security/security-advisories/repository-security-advisories/publishing-a-repository-security-advisory#requesting-a-cve-identification-number-optional)."You may request a CVE for public repositories, but cannot do so for private repositories.In order to request a CVE for a repository security advisory, the authenticated user must be a security manager or administrator of that repository.OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:write` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemSecurityAdvisoriesItemCveRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemSecurityAdvisoriesItemCveRequestBuilder when successful +func (m *ItemItemSecurityAdvisoriesItemCveRequestBuilder) WithUrl(rawUrl string)(*ItemItemSecurityAdvisoriesItemCveRequestBuilder) { + return NewItemItemSecurityAdvisoriesItemCveRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_item_cve_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_item_cve_response.go new file mode 100644 index 000000000..d44226c44 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_item_cve_response.go @@ -0,0 +1,28 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemSecurityAdvisoriesItemCveResponse +// Deprecated: This class is obsolete. Use cvePostResponse instead. +type ItemItemSecurityAdvisoriesItemCveResponse struct { + ItemItemSecurityAdvisoriesItemCvePostResponse +} +// NewItemItemSecurityAdvisoriesItemCveResponse instantiates a new ItemItemSecurityAdvisoriesItemCveResponse and sets the default values. +func NewItemItemSecurityAdvisoriesItemCveResponse()(*ItemItemSecurityAdvisoriesItemCveResponse) { + m := &ItemItemSecurityAdvisoriesItemCveResponse{ + ItemItemSecurityAdvisoriesItemCvePostResponse: *NewItemItemSecurityAdvisoriesItemCvePostResponse(), + } + return m +} +// CreateItemItemSecurityAdvisoriesItemCveResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemSecurityAdvisoriesItemCveResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemSecurityAdvisoriesItemCveResponse(), nil +} +// ItemItemSecurityAdvisoriesItemCveResponseable +// Deprecated: This class is obsolete. Use cvePostResponse instead. +type ItemItemSecurityAdvisoriesItemCveResponseable interface { + ItemItemSecurityAdvisoriesItemCvePostResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_item_forks_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_item_forks_request_builder.go new file mode 100644 index 000000000..bd49b80e9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_item_forks_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemSecurityAdvisoriesItemForksRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\security-advisories\{ghsa_id}\forks +type ItemItemSecurityAdvisoriesItemForksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemSecurityAdvisoriesItemForksRequestBuilderInternal instantiates a new ItemItemSecurityAdvisoriesItemForksRequestBuilder and sets the default values. +func NewItemItemSecurityAdvisoriesItemForksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecurityAdvisoriesItemForksRequestBuilder) { + m := &ItemItemSecurityAdvisoriesItemForksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/security-advisories/{ghsa_id}/forks", pathParameters), + } + return m +} +// NewItemItemSecurityAdvisoriesItemForksRequestBuilder instantiates a new ItemItemSecurityAdvisoriesItemForksRequestBuilder and sets the default values. +func NewItemItemSecurityAdvisoriesItemForksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecurityAdvisoriesItemForksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSecurityAdvisoriesItemForksRequestBuilderInternal(urlParams, requestAdapter) +} +// Post create a temporary private fork to collaborate on fixing a security vulnerability in your repository.**Note**: Forking a repository happens asynchronously. You may have to wait up to 5 minutes before you can access the fork. +// returns a FullRepositoryable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/security-advisories/repository-advisories#create-a-temporary-private-fork +func (m *ItemItemSecurityAdvisoriesItemForksRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateFullRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable), nil +} +// ToPostRequestInformation create a temporary private fork to collaborate on fixing a security vulnerability in your repository.**Note**: Forking a repository happens asynchronously. You may have to wait up to 5 minutes before you can access the fork. +// returns a *RequestInformation when successful +func (m *ItemItemSecurityAdvisoriesItemForksRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemSecurityAdvisoriesItemForksRequestBuilder when successful +func (m *ItemItemSecurityAdvisoriesItemForksRequestBuilder) WithUrl(rawUrl string)(*ItemItemSecurityAdvisoriesItemForksRequestBuilder) { + return NewItemItemSecurityAdvisoriesItemForksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_reports_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_reports_request_builder.go new file mode 100644 index 000000000..b02ff0c0f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_reports_request_builder.go @@ -0,0 +1,69 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemSecurityAdvisoriesReportsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\security-advisories\reports +type ItemItemSecurityAdvisoriesReportsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemSecurityAdvisoriesReportsRequestBuilderInternal instantiates a new ItemItemSecurityAdvisoriesReportsRequestBuilder and sets the default values. +func NewItemItemSecurityAdvisoriesReportsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecurityAdvisoriesReportsRequestBuilder) { + m := &ItemItemSecurityAdvisoriesReportsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/security-advisories/reports", pathParameters), + } + return m +} +// NewItemItemSecurityAdvisoriesReportsRequestBuilder instantiates a new ItemItemSecurityAdvisoriesReportsRequestBuilder and sets the default values. +func NewItemItemSecurityAdvisoriesReportsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecurityAdvisoriesReportsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSecurityAdvisoriesReportsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post report a security vulnerability to the maintainers of the repository.See "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)" for more information about private vulnerability reporting. +// returns a RepositoryAdvisoryable when successful +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/security-advisories/repository-advisories#privately-report-a-security-vulnerability +func (m *ItemItemSecurityAdvisoriesReportsRequestBuilder) Post(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateVulnerabilityReportCreateable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryAdvisoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryable), nil +} +// ToPostRequestInformation report a security vulnerability to the maintainers of the repository.See "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)" for more information about private vulnerability reporting. +// returns a *RequestInformation when successful +func (m *ItemItemSecurityAdvisoriesReportsRequestBuilder) ToPostRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateVulnerabilityReportCreateable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemSecurityAdvisoriesReportsRequestBuilder when successful +func (m *ItemItemSecurityAdvisoriesReportsRequestBuilder) WithUrl(rawUrl string)(*ItemItemSecurityAdvisoriesReportsRequestBuilder) { + return NewItemItemSecurityAdvisoriesReportsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_request_builder.go new file mode 100644 index 000000000..ce048a6a8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_request_builder.go @@ -0,0 +1,138 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + iff82c0f4e094aa05a6584f444513221550be88a33dff983b75f25640827f7406 "github.com/octokit/go-sdk/pkg/github/repos/item/item/securityadvisories" +) + +// ItemItemSecurityAdvisoriesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\security-advisories +type ItemItemSecurityAdvisoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemSecurityAdvisoriesRequestBuilderGetQueryParameters lists security advisories in a repository.The authenticated user can access unpublished security advisories from a repository if they are a security manager or administrator of that repository, or if they are a collaborator on any security advisory.OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:read` scope to to get a published security advisory in a private repository, or any unpublished security advisory that the authenticated user has access to. +type ItemItemSecurityAdvisoriesRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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)." + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *iff82c0f4e094aa05a6584f444513221550be88a33dff983b75f25640827f7406.GetDirectionQueryParameterType `uriparametername:"direction"` + // The number of advisories to return per page. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The property to sort the results by. + Sort *iff82c0f4e094aa05a6584f444513221550be88a33dff983b75f25640827f7406.GetSortQueryParameterType `uriparametername:"sort"` + // Filter by state of the repository advisories. Only advisories of this state will be returned. + State *iff82c0f4e094aa05a6584f444513221550be88a33dff983b75f25640827f7406.GetStateQueryParameterType `uriparametername:"state"` +} +// ByGhsa_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.securityAdvisories.item collection +// returns a *ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder when successful +func (m *ItemItemSecurityAdvisoriesRequestBuilder) ByGhsa_id(ghsa_id string)(*ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if ghsa_id != "" { + urlTplParams["ghsa_id"] = ghsa_id + } + return NewItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemSecurityAdvisoriesRequestBuilderInternal instantiates a new ItemItemSecurityAdvisoriesRequestBuilder and sets the default values. +func NewItemItemSecurityAdvisoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecurityAdvisoriesRequestBuilder) { + m := &ItemItemSecurityAdvisoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/security-advisories{?after*,before*,direction*,per_page*,sort*,state*}", pathParameters), + } + return m +} +// NewItemItemSecurityAdvisoriesRequestBuilder instantiates a new ItemItemSecurityAdvisoriesRequestBuilder and sets the default values. +func NewItemItemSecurityAdvisoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecurityAdvisoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSecurityAdvisoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists security advisories in a repository.The authenticated user can access unpublished security advisories from a repository if they are a security manager or administrator of that repository, or if they are a collaborator on any security advisory.OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:read` scope to to get a published security advisory in a private repository, or any unpublished security advisory that the authenticated user has access to. +// returns a []RepositoryAdvisoryable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories +func (m *ItemItemSecurityAdvisoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemSecurityAdvisoriesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryAdvisoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryable) + } + } + return val, nil +} +// Post creates a new repository security advisory.In order to create a draft repository security advisory, the authenticated user must be a security manager or administrator of that repository.OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:write` scope to use this endpoint. +// returns a RepositoryAdvisoryable when successful +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/security-advisories/repository-advisories#create-a-repository-security-advisory +func (m *ItemItemSecurityAdvisoriesRequestBuilder) Post(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryCreateable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryAdvisoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryable), nil +} +// Reports the reports property +// returns a *ItemItemSecurityAdvisoriesReportsRequestBuilder when successful +func (m *ItemItemSecurityAdvisoriesRequestBuilder) Reports()(*ItemItemSecurityAdvisoriesReportsRequestBuilder) { + return NewItemItemSecurityAdvisoriesReportsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists security advisories in a repository.The authenticated user can access unpublished security advisories from a repository if they are a security manager or administrator of that repository, or if they are a collaborator on any security advisory.OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:read` scope to to get a published security advisory in a private repository, or any unpublished security advisory that the authenticated user has access to. +// returns a *RequestInformation when successful +func (m *ItemItemSecurityAdvisoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemSecurityAdvisoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a new repository security advisory.In order to create a draft repository security advisory, the authenticated user must be a security manager or administrator of that repository.OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:write` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemSecurityAdvisoriesRequestBuilder) ToPostRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryCreateable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemSecurityAdvisoriesRequestBuilder when successful +func (m *ItemItemSecurityAdvisoriesRequestBuilder) WithUrl(rawUrl string)(*ItemItemSecurityAdvisoriesRequestBuilder) { + return NewItemItemSecurityAdvisoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_with_ghsa_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_with_ghsa_item_request_builder.go new file mode 100644 index 000000000..82c0b70c7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_security_advisories_with_ghsa_item_request_builder.go @@ -0,0 +1,112 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\security-advisories\{ghsa_id} +type ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilderInternal instantiates a new ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder and sets the default values. +func NewItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder) { + m := &ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/security-advisories/{ghsa_id}", pathParameters), + } + return m +} +// NewItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder instantiates a new ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder and sets the default values. +func NewItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Cve the cve property +// returns a *ItemItemSecurityAdvisoriesItemCveRequestBuilder when successful +func (m *ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder) Cve()(*ItemItemSecurityAdvisoriesItemCveRequestBuilder) { + return NewItemItemSecurityAdvisoriesItemCveRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Forks the forks property +// returns a *ItemItemSecurityAdvisoriesItemForksRequestBuilder when successful +func (m *ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder) Forks()(*ItemItemSecurityAdvisoriesItemForksRequestBuilder) { + return NewItemItemSecurityAdvisoriesItemForksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get get a repository security advisory using its GitHub Security Advisory (GHSA) identifier.Anyone can access any published security advisory on a public repository.The authenticated user can access an unpublished security advisory from a repository if they are a security manager or administrator of that repository, or if they are acollaborator on the security advisory.OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:read` scope to to get a published security advisory in a private repository, or any unpublished security advisory that the authenticated user has access to. +// returns a RepositoryAdvisoryable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/security-advisories/repository-advisories#get-a-repository-security-advisory +func (m *ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryAdvisoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryable), nil +} +// Patch update a repository security advisory using its GitHub Security Advisory (GHSA) identifier.In order to update any security advisory, the authenticated user must be a security manager or administrator of that repository,or a collaborator on the repository security advisory.OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:write` scope to use this endpoint. +// returns a RepositoryAdvisoryable when successful +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/security-advisories/repository-advisories#update-a-repository-security-advisory +func (m *ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder) Patch(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryUpdateable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryAdvisoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryable), nil +} +// ToGetRequestInformation get a repository security advisory using its GitHub Security Advisory (GHSA) identifier.Anyone can access any published security advisory on a public repository.The authenticated user can access an unpublished security advisory from a repository if they are a security manager or administrator of that repository, or if they are acollaborator on the security advisory.OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:read` scope to to get a published security advisory in a private repository, or any unpublished security advisory that the authenticated user has access to. +// returns a *RequestInformation when successful +func (m *ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation update a repository security advisory using its GitHub Security Advisory (GHSA) identifier.In order to update any security advisory, the authenticated user must be a security manager or administrator of that repository,or a collaborator on the repository security advisory.OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:write` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryAdvisoryUpdateable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder when successful +func (m *ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder) { + return NewItemItemSecurityAdvisoriesWithGhsa_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stargazers_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stargazers_request_builder.go new file mode 100644 index 000000000..13eb45fee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stargazers_request_builder.go @@ -0,0 +1,175 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemStargazersRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\stargazers +type ItemItemStargazersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemStargazersRequestBuilderGetQueryParameters lists the people that have starred the repository.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +type ItemItemStargazersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// StargazersGetResponse composed type wrapper for classes []ItemItemStargazersSimpleUserable, []ItemItemStargazersStargazerable +type StargazersGetResponse struct { + // Composed type representation for type []ItemItemStargazersSimpleUserable + itemItemStargazersSimpleUser []ItemItemStargazersSimpleUserable + // Composed type representation for type []ItemItemStargazersStargazerable + itemItemStargazersStargazer []ItemItemStargazersStargazerable +} +// NewStargazersGetResponse instantiates a new StargazersGetResponse and sets the default values. +func NewStargazersGetResponse()(*StargazersGetResponse) { + m := &StargazersGetResponse{ + } + return m +} +// CreateStargazersGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateStargazersGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewStargazersGetResponse() + if parseNode != nil { + if val, err := parseNode.GetCollectionOfObjectValues(CreateItemItemStargazersSimpleUserFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]ItemItemStargazersSimpleUserable, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(ItemItemStargazersSimpleUserable) + } + } + result.SetItemItemStargazersSimpleUser(cast) + } else if val, err := parseNode.GetCollectionOfObjectValues(CreateItemItemStargazersStargazerFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]ItemItemStargazersStargazerable, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(ItemItemStargazersStargazerable) + } + } + result.SetItemItemStargazersStargazer(cast) + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *StargazersGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *StargazersGetResponse) GetIsComposedType()(bool) { + return true +} +// GetItemItemStargazersSimpleUser gets the ItemItemStargazersSimpleUser property value. Composed type representation for type []ItemItemStargazersSimpleUserable +// returns a []ItemItemStargazersSimpleUserable when successful +func (m *StargazersGetResponse) GetItemItemStargazersSimpleUser()([]ItemItemStargazersSimpleUserable) { + return m.itemItemStargazersSimpleUser +} +// GetItemItemStargazersStargazer gets the ItemItemStargazersStargazer property value. Composed type representation for type []ItemItemStargazersStargazerable +// returns a []ItemItemStargazersStargazerable when successful +func (m *StargazersGetResponse) GetItemItemStargazersStargazer()([]ItemItemStargazersStargazerable) { + return m.itemItemStargazersStargazer +} +// Serialize serializes information the current object +func (m *StargazersGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemStargazersSimpleUser() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItemItemStargazersSimpleUser())) + for i, v := range m.GetItemItemStargazersSimpleUser() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } else if m.GetItemItemStargazersStargazer() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItemItemStargazersStargazer())) + for i, v := range m.GetItemItemStargazersStargazer() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } + return nil +} +// SetItemItemStargazersSimpleUser sets the ItemItemStargazersSimpleUser property value. Composed type representation for type []ItemItemStargazersSimpleUserable +func (m *StargazersGetResponse) SetItemItemStargazersSimpleUser(value []ItemItemStargazersSimpleUserable)() { + m.itemItemStargazersSimpleUser = value +} +// SetItemItemStargazersStargazer sets the ItemItemStargazersStargazer property value. Composed type representation for type []ItemItemStargazersStargazerable +func (m *StargazersGetResponse) SetItemItemStargazersStargazer(value []ItemItemStargazersStargazerable)() { + m.itemItemStargazersStargazer = value +} +type StargazersGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemStargazersSimpleUser()([]ItemItemStargazersSimpleUserable) + GetItemItemStargazersStargazer()([]ItemItemStargazersStargazerable) + SetItemItemStargazersSimpleUser(value []ItemItemStargazersSimpleUserable)() + SetItemItemStargazersStargazer(value []ItemItemStargazersStargazerable)() +} +// NewItemItemStargazersRequestBuilderInternal instantiates a new ItemItemStargazersRequestBuilder and sets the default values. +func NewItemItemStargazersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStargazersRequestBuilder) { + m := &ItemItemStargazersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/stargazers{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemStargazersRequestBuilder instantiates a new ItemItemStargazersRequestBuilder and sets the default values. +func NewItemItemStargazersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStargazersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStargazersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the people that have starred the repository.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +// returns a StargazersGetResponseable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/starring#list-stargazers +func (m *ItemItemStargazersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemStargazersRequestBuilderGetQueryParameters])(StargazersGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateStargazersGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(StargazersGetResponseable), nil +} +// ToGetRequestInformation lists the people that have starred the repository.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +// returns a *RequestInformation when successful +func (m *ItemItemStargazersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemStargazersRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemStargazersRequestBuilder when successful +func (m *ItemItemStargazersRequestBuilder) WithUrl(rawUrl string)(*ItemItemStargazersRequestBuilder) { + return NewItemItemStargazersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stargazers_simple_user.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stargazers_simple_user.go new file mode 100644 index 000000000..179904609 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stargazers_simple_user.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemStargazersSimpleUser struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemStargazersSimpleUser instantiates a new ItemItemStargazersSimpleUser and sets the default values. +func NewItemItemStargazersSimpleUser()(*ItemItemStargazersSimpleUser) { + m := &ItemItemStargazersSimpleUser{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemStargazersSimpleUserFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemStargazersSimpleUserFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemStargazersSimpleUser(), 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 *ItemItemStargazersSimpleUser) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemStargazersSimpleUser) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemStargazersSimpleUser) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemStargazersSimpleUser) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemStargazersSimpleUserable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stargazers_stargazer.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stargazers_stargazer.go new file mode 100644 index 000000000..d8cc702dc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stargazers_stargazer.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemStargazersStargazer struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemStargazersStargazer instantiates a new ItemItemStargazersStargazer and sets the default values. +func NewItemItemStargazersStargazer()(*ItemItemStargazersStargazer) { + m := &ItemItemStargazersStargazer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemStargazersStargazerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemStargazersStargazerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemStargazersStargazer(), 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 *ItemItemStargazersStargazer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemStargazersStargazer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemItemStargazersStargazer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemStargazersStargazer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemStargazersStargazerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_code_frequency_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_code_frequency_request_builder.go new file mode 100644 index 000000000..0adef0d7a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_code_frequency_request_builder.go @@ -0,0 +1,59 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemStatsCode_frequencyRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\stats\code_frequency +type ItemItemStatsCode_frequencyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemStatsCode_frequencyRequestBuilderInternal instantiates a new ItemItemStatsCode_frequencyRequestBuilder and sets the default values. +func NewItemItemStatsCode_frequencyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsCode_frequencyRequestBuilder) { + m := &ItemItemStatsCode_frequencyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/stats/code_frequency", pathParameters), + } + return m +} +// NewItemItemStatsCode_frequencyRequestBuilder instantiates a new ItemItemStatsCode_frequencyRequestBuilder and sets the default values. +func NewItemItemStatsCode_frequencyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsCode_frequencyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStatsCode_frequencyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns a weekly aggregate of the number of additions and deletions pushed to a repository.**Note:** This endpoint can only be used for repositories with fewer than 10,000 commits. If the repository contains10,000 or more commits, a 422 status code will be returned. +// returns a []int32 when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity +func (m *ItemItemStatsCode_frequencyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitiveCollection(ctx, requestInfo, "int32", nil) + if err != nil { + return nil, err + } + val := make([]int32, len(res)) + for i, v := range res { + if v != nil { + val[i] = *(v.(*int32)) + } + } + return val, nil +} +// ToGetRequestInformation returns a weekly aggregate of the number of additions and deletions pushed to a repository.**Note:** This endpoint can only be used for repositories with fewer than 10,000 commits. If the repository contains10,000 or more commits, a 422 status code will be returned. +// returns a *RequestInformation when successful +func (m *ItemItemStatsCode_frequencyRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemStatsCode_frequencyRequestBuilder when successful +func (m *ItemItemStatsCode_frequencyRequestBuilder) WithUrl(rawUrl string)(*ItemItemStatsCode_frequencyRequestBuilder) { + return NewItemItemStatsCode_frequencyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_commit_activity_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_commit_activity_request_builder.go new file mode 100644 index 000000000..c8a4879c9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_commit_activity_request_builder.go @@ -0,0 +1,60 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemStatsCommit_activityRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\stats\commit_activity +type ItemItemStatsCommit_activityRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemStatsCommit_activityRequestBuilderInternal instantiates a new ItemItemStatsCommit_activityRequestBuilder and sets the default values. +func NewItemItemStatsCommit_activityRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsCommit_activityRequestBuilder) { + m := &ItemItemStatsCommit_activityRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/stats/commit_activity", pathParameters), + } + return m +} +// NewItemItemStatsCommit_activityRequestBuilder instantiates a new ItemItemStatsCommit_activityRequestBuilder and sets the default values. +func NewItemItemStatsCommit_activityRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsCommit_activityRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStatsCommit_activityRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the last year of commit activity grouped by week. The `days` array is a group of commits per day, starting on `Sunday`. +// returns a []CommitActivityable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity +func (m *ItemItemStatsCommit_activityRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitActivityable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommitActivityFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitActivityable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitActivityable) + } + } + return val, nil +} +// ToGetRequestInformation returns the last year of commit activity grouped by week. The `days` array is a group of commits per day, starting on `Sunday`. +// returns a *RequestInformation when successful +func (m *ItemItemStatsCommit_activityRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemStatsCommit_activityRequestBuilder when successful +func (m *ItemItemStatsCommit_activityRequestBuilder) WithUrl(rawUrl string)(*ItemItemStatsCommit_activityRequestBuilder) { + return NewItemItemStatsCommit_activityRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_contributors_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_contributors_request_builder.go new file mode 100644 index 000000000..decf1141d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_contributors_request_builder.go @@ -0,0 +1,60 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemStatsContributorsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\stats\contributors +type ItemItemStatsContributorsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemStatsContributorsRequestBuilderInternal instantiates a new ItemItemStatsContributorsRequestBuilder and sets the default values. +func NewItemItemStatsContributorsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsContributorsRequestBuilder) { + m := &ItemItemStatsContributorsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/stats/contributors", pathParameters), + } + return m +} +// NewItemItemStatsContributorsRequestBuilder instantiates a new ItemItemStatsContributorsRequestBuilder and sets the default values. +func NewItemItemStatsContributorsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsContributorsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStatsContributorsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the `total` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (`weeks` array) with the following information:* `w` - Start of the week, given as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time).* `a` - Number of additions* `d` - Number of deletions* `c` - Number of commits**Note:** This endpoint will return `0` values for all addition and deletion counts in repositories with 10,000 or more commits. +// returns a []ContributorActivityable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity +func (m *ItemItemStatsContributorsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContributorActivityable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateContributorActivityFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContributorActivityable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContributorActivityable) + } + } + return val, nil +} +// ToGetRequestInformation returns the `total` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (`weeks` array) with the following information:* `w` - Start of the week, given as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time).* `a` - Number of additions* `d` - Number of deletions* `c` - Number of commits**Note:** This endpoint will return `0` values for all addition and deletion counts in repositories with 10,000 or more commits. +// returns a *RequestInformation when successful +func (m *ItemItemStatsContributorsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemStatsContributorsRequestBuilder when successful +func (m *ItemItemStatsContributorsRequestBuilder) WithUrl(rawUrl string)(*ItemItemStatsContributorsRequestBuilder) { + return NewItemItemStatsContributorsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_participation_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_participation_request_builder.go new file mode 100644 index 000000000..c73b8c84b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_participation_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemStatsParticipationRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\stats\participation +type ItemItemStatsParticipationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemStatsParticipationRequestBuilderInternal instantiates a new ItemItemStatsParticipationRequestBuilder and sets the default values. +func NewItemItemStatsParticipationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsParticipationRequestBuilder) { + m := &ItemItemStatsParticipationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/stats/participation", pathParameters), + } + return m +} +// NewItemItemStatsParticipationRequestBuilder instantiates a new ItemItemStatsParticipationRequestBuilder and sets the default values. +func NewItemItemStatsParticipationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsParticipationRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStatsParticipationRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the total commit counts for the `owner` and total commit counts in `all`. `all` is everyone combined, including the `owner` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract `owner` from `all`.The array order is oldest week (index 0) to most recent week.The most recent week is seven days ago at UTC midnight to today at UTC midnight. +// returns a ParticipationStatsable 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/metrics/statistics#get-the-weekly-commit-count +func (m *ItemItemStatsParticipationRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ParticipationStatsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateParticipationStatsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ParticipationStatsable), nil +} +// ToGetRequestInformation returns the total commit counts for the `owner` and total commit counts in `all`. `all` is everyone combined, including the `owner` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract `owner` from `all`.The array order is oldest week (index 0) to most recent week.The most recent week is seven days ago at UTC midnight to today at UTC midnight. +// returns a *RequestInformation when successful +func (m *ItemItemStatsParticipationRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemStatsParticipationRequestBuilder when successful +func (m *ItemItemStatsParticipationRequestBuilder) WithUrl(rawUrl string)(*ItemItemStatsParticipationRequestBuilder) { + return NewItemItemStatsParticipationRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_punch_card_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_punch_card_request_builder.go new file mode 100644 index 000000000..c9c2f2faf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_punch_card_request_builder.go @@ -0,0 +1,59 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemStatsPunch_cardRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\stats\punch_card +type ItemItemStatsPunch_cardRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemStatsPunch_cardRequestBuilderInternal instantiates a new ItemItemStatsPunch_cardRequestBuilder and sets the default values. +func NewItemItemStatsPunch_cardRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsPunch_cardRequestBuilder) { + m := &ItemItemStatsPunch_cardRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/stats/punch_card", pathParameters), + } + return m +} +// NewItemItemStatsPunch_cardRequestBuilder instantiates a new ItemItemStatsPunch_cardRequestBuilder and sets the default values. +func NewItemItemStatsPunch_cardRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsPunch_cardRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStatsPunch_cardRequestBuilderInternal(urlParams, requestAdapter) +} +// Get each array contains the day number, hour number, and number of commits:* `0-6`: Sunday - Saturday* `0-23`: Hour of day* Number of commitsFor example, `[2, 14, 25]` indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits. +// returns a []int32 when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day +func (m *ItemItemStatsPunch_cardRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitiveCollection(ctx, requestInfo, "int32", nil) + if err != nil { + return nil, err + } + val := make([]int32, len(res)) + for i, v := range res { + if v != nil { + val[i] = *(v.(*int32)) + } + } + return val, nil +} +// ToGetRequestInformation each array contains the day number, hour number, and number of commits:* `0-6`: Sunday - Saturday* `0-23`: Hour of day* Number of commitsFor example, `[2, 14, 25]` indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits. +// returns a *RequestInformation when successful +func (m *ItemItemStatsPunch_cardRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemStatsPunch_cardRequestBuilder when successful +func (m *ItemItemStatsPunch_cardRequestBuilder) WithUrl(rawUrl string)(*ItemItemStatsPunch_cardRequestBuilder) { + return NewItemItemStatsPunch_cardRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_request_builder.go new file mode 100644 index 000000000..d4f3a3d86 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_stats_request_builder.go @@ -0,0 +1,48 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemStatsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\stats +type ItemItemStatsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Code_frequency the code_frequency property +// returns a *ItemItemStatsCode_frequencyRequestBuilder when successful +func (m *ItemItemStatsRequestBuilder) Code_frequency()(*ItemItemStatsCode_frequencyRequestBuilder) { + return NewItemItemStatsCode_frequencyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Commit_activity the commit_activity property +// returns a *ItemItemStatsCommit_activityRequestBuilder when successful +func (m *ItemItemStatsRequestBuilder) Commit_activity()(*ItemItemStatsCommit_activityRequestBuilder) { + return NewItemItemStatsCommit_activityRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemStatsRequestBuilderInternal instantiates a new ItemItemStatsRequestBuilder and sets the default values. +func NewItemItemStatsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsRequestBuilder) { + m := &ItemItemStatsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/stats", pathParameters), + } + return m +} +// NewItemItemStatsRequestBuilder instantiates a new ItemItemStatsRequestBuilder and sets the default values. +func NewItemItemStatsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStatsRequestBuilderInternal(urlParams, requestAdapter) +} +// Contributors the contributors property +// returns a *ItemItemStatsContributorsRequestBuilder when successful +func (m *ItemItemStatsRequestBuilder) Contributors()(*ItemItemStatsContributorsRequestBuilder) { + return NewItemItemStatsContributorsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Participation the participation property +// returns a *ItemItemStatsParticipationRequestBuilder when successful +func (m *ItemItemStatsRequestBuilder) Participation()(*ItemItemStatsParticipationRequestBuilder) { + return NewItemItemStatsParticipationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Punch_card the punch_card property +// returns a *ItemItemStatsPunch_cardRequestBuilder when successful +func (m *ItemItemStatsRequestBuilder) Punch_card()(*ItemItemStatsPunch_cardRequestBuilder) { + return NewItemItemStatsPunch_cardRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_statuses_item_with_sha_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_statuses_item_with_sha_post_request_body.go new file mode 100644 index 000000000..d19bc069d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_statuses_item_with_sha_post_request_body.go @@ -0,0 +1,140 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemStatusesItemWithShaPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A string label to differentiate this status from the status of other systems. This field is case-insensitive. + context *string + // A short description of the status. + description *string + // The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status. For example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA: `http://ci.example.com/user/repo/build/sha` + target_url *string +} +// NewItemItemStatusesItemWithShaPostRequestBody instantiates a new ItemItemStatusesItemWithShaPostRequestBody and sets the default values. +func NewItemItemStatusesItemWithShaPostRequestBody()(*ItemItemStatusesItemWithShaPostRequestBody) { + m := &ItemItemStatusesItemWithShaPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + contextValue := "default" + m.SetContext(&contextValue) + return m +} +// CreateItemItemStatusesItemWithShaPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemStatusesItemWithShaPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemStatusesItemWithShaPostRequestBody(), 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 *ItemItemStatusesItemWithShaPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContext gets the context property value. A string label to differentiate this status from the status of other systems. This field is case-insensitive. +// returns a *string when successful +func (m *ItemItemStatusesItemWithShaPostRequestBody) GetContext()(*string) { + return m.context +} +// GetDescription gets the description property value. A short description of the status. +// returns a *string when successful +func (m *ItemItemStatusesItemWithShaPostRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemStatusesItemWithShaPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["target_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetUrl(val) + } + return nil + } + return res +} +// GetTargetUrl gets the target_url property value. The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status. For example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA: `http://ci.example.com/user/repo/build/sha` +// returns a *string when successful +func (m *ItemItemStatusesItemWithShaPostRequestBody) GetTargetUrl()(*string) { + return m.target_url +} +// Serialize serializes information the current object +func (m *ItemItemStatusesItemWithShaPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("context", m.GetContext()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_url", m.GetTargetUrl()) + 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 *ItemItemStatusesItemWithShaPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContext sets the context property value. A string label to differentiate this status from the status of other systems. This field is case-insensitive. +func (m *ItemItemStatusesItemWithShaPostRequestBody) SetContext(value *string)() { + m.context = value +} +// SetDescription sets the description property value. A short description of the status. +func (m *ItemItemStatusesItemWithShaPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetTargetUrl sets the target_url property value. The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status. For example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA: `http://ci.example.com/user/repo/build/sha` +func (m *ItemItemStatusesItemWithShaPostRequestBody) SetTargetUrl(value *string)() { + m.target_url = value +} +type ItemItemStatusesItemWithShaPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContext()(*string) + GetDescription()(*string) + GetTargetUrl()(*string) + SetContext(value *string)() + SetDescription(value *string)() + SetTargetUrl(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_statuses_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_statuses_request_builder.go new file mode 100644 index 000000000..9b4543a4c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_statuses_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemStatusesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\statuses +type ItemItemStatusesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// BySha gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.statuses.item collection +// returns a *ItemItemStatusesWithShaItemRequestBuilder when successful +func (m *ItemItemStatusesRequestBuilder) BySha(sha string)(*ItemItemStatusesWithShaItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if sha != "" { + urlTplParams["sha"] = sha + } + return NewItemItemStatusesWithShaItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemStatusesRequestBuilderInternal instantiates a new ItemItemStatusesRequestBuilder and sets the default values. +func NewItemItemStatusesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatusesRequestBuilder) { + m := &ItemItemStatusesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/statuses", pathParameters), + } + return m +} +// NewItemItemStatusesRequestBuilder instantiates a new ItemItemStatusesRequestBuilder and sets the default values. +func NewItemItemStatusesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatusesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStatusesRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_statuses_with_sha_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_statuses_with_sha_item_request_builder.go new file mode 100644 index 000000000..f2e80dc7c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_statuses_with_sha_item_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemStatusesWithShaItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\statuses\{sha} +type ItemItemStatusesWithShaItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemStatusesWithShaItemRequestBuilderInternal instantiates a new ItemItemStatusesWithShaItemRequestBuilder and sets the default values. +func NewItemItemStatusesWithShaItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatusesWithShaItemRequestBuilder) { + m := &ItemItemStatusesWithShaItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/statuses/{sha}", pathParameters), + } + return m +} +// NewItemItemStatusesWithShaItemRequestBuilder instantiates a new ItemItemStatusesWithShaItemRequestBuilder and sets the default values. +func NewItemItemStatusesWithShaItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatusesWithShaItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStatusesWithShaItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Post users with push access in a repository can create commit statuses for a given SHA.Note: there is a limit of 1000 statuses per `sha` and `context` within a repository. Attempts to create more than 1000 statuses will result in a validation error. +// returns a Statusable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/commits/statuses#create-a-commit-status +func (m *ItemItemStatusesWithShaItemRequestBuilder) Post(ctx context.Context, body ItemItemStatusesItemWithShaPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Statusable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateStatusFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Statusable), nil +} +// ToPostRequestInformation users with push access in a repository can create commit statuses for a given SHA.Note: there is a limit of 1000 statuses per `sha` and `context` within a repository. Attempts to create more than 1000 statuses will result in a validation error. +// returns a *RequestInformation when successful +func (m *ItemItemStatusesWithShaItemRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemStatusesItemWithShaPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemStatusesWithShaItemRequestBuilder when successful +func (m *ItemItemStatusesWithShaItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemStatusesWithShaItemRequestBuilder) { + return NewItemItemStatusesWithShaItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_subscribers_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_subscribers_request_builder.go new file mode 100644 index 000000000..78524e4d7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_subscribers_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemSubscribersRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\subscribers +type ItemItemSubscribersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemSubscribersRequestBuilderGetQueryParameters lists the people watching the specified repository. +type ItemItemSubscribersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemSubscribersRequestBuilderInternal instantiates a new ItemItemSubscribersRequestBuilder and sets the default values. +func NewItemItemSubscribersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSubscribersRequestBuilder) { + m := &ItemItemSubscribersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/subscribers{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemSubscribersRequestBuilder instantiates a new ItemItemSubscribersRequestBuilder and sets the default values. +func NewItemItemSubscribersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSubscribersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSubscribersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the people watching the specified repository. +// returns a []SimpleUserable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/watching#list-watchers +func (m *ItemItemSubscribersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemSubscribersRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation lists the people watching the specified repository. +// returns a *RequestInformation when successful +func (m *ItemItemSubscribersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemSubscribersRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemSubscribersRequestBuilder when successful +func (m *ItemItemSubscribersRequestBuilder) WithUrl(rawUrl string)(*ItemItemSubscribersRequestBuilder) { + return NewItemItemSubscribersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_subscription_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_subscription_put_request_body.go new file mode 100644 index 000000000..763e3b2c8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_subscription_put_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemSubscriptionPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Determines if all notifications should be blocked from this repository. + ignored *bool + // Determines if notifications should be received from this repository. + subscribed *bool +} +// NewItemItemSubscriptionPutRequestBody instantiates a new ItemItemSubscriptionPutRequestBody and sets the default values. +func NewItemItemSubscriptionPutRequestBody()(*ItemItemSubscriptionPutRequestBody) { + m := &ItemItemSubscriptionPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemSubscriptionPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemSubscriptionPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemSubscriptionPutRequestBody(), 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 *ItemItemSubscriptionPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemSubscriptionPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ignored"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIgnored(val) + } + return nil + } + res["subscribed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribed(val) + } + return nil + } + return res +} +// GetIgnored gets the ignored property value. Determines if all notifications should be blocked from this repository. +// returns a *bool when successful +func (m *ItemItemSubscriptionPutRequestBody) GetIgnored()(*bool) { + return m.ignored +} +// GetSubscribed gets the subscribed property value. Determines if notifications should be received from this repository. +// returns a *bool when successful +func (m *ItemItemSubscriptionPutRequestBody) GetSubscribed()(*bool) { + return m.subscribed +} +// Serialize serializes information the current object +func (m *ItemItemSubscriptionPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("ignored", m.GetIgnored()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("subscribed", m.GetSubscribed()) + 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 *ItemItemSubscriptionPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIgnored sets the ignored property value. Determines if all notifications should be blocked from this repository. +func (m *ItemItemSubscriptionPutRequestBody) SetIgnored(value *bool)() { + m.ignored = value +} +// SetSubscribed sets the subscribed property value. Determines if notifications should be received from this repository. +func (m *ItemItemSubscriptionPutRequestBody) SetSubscribed(value *bool)() { + m.subscribed = value +} +type ItemItemSubscriptionPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIgnored()(*bool) + GetSubscribed()(*bool) + SetIgnored(value *bool)() + SetSubscribed(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_subscription_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_subscription_request_builder.go new file mode 100644 index 000000000..1272c39c5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_subscription_request_builder.go @@ -0,0 +1,114 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemSubscriptionRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\subscription +type ItemItemSubscriptionRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemSubscriptionRequestBuilderInternal instantiates a new ItemItemSubscriptionRequestBuilder and sets the default values. +func NewItemItemSubscriptionRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSubscriptionRequestBuilder) { + m := &ItemItemSubscriptionRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/subscription", pathParameters), + } + return m +} +// NewItemItemSubscriptionRequestBuilder instantiates a new ItemItemSubscriptionRequestBuilder and sets the default values. +func NewItemItemSubscriptionRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSubscriptionRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSubscriptionRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete this endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/activity/watching#set-a-repository-subscription). +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription +func (m *ItemItemSubscriptionRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets information about whether the authenticated user is subscribed to the repository. +// returns a RepositorySubscriptionable when successful +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/watching#get-a-repository-subscription +func (m *ItemItemSubscriptionRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositorySubscriptionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositorySubscriptionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositorySubscriptionable), nil +} +// Put if you would like to watch a repository, set `subscribed` to `true`. If you would like to ignore notifications made within a repository, set `ignored` to `true`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/activity/watching#delete-a-repository-subscription) completely. +// returns a RepositorySubscriptionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/watching#set-a-repository-subscription +func (m *ItemItemSubscriptionRequestBuilder) Put(ctx context.Context, body ItemItemSubscriptionPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositorySubscriptionable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositorySubscriptionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositorySubscriptionable), nil +} +// ToDeleteRequestInformation this endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/activity/watching#set-a-repository-subscription). +// returns a *RequestInformation when successful +func (m *ItemItemSubscriptionRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets information about whether the authenticated user is subscribed to the repository. +// returns a *RequestInformation when successful +func (m *ItemItemSubscriptionRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation if you would like to watch a repository, set `subscribed` to `true`. If you would like to ignore notifications made within a repository, set `ignored` to `true`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/activity/watching#delete-a-repository-subscription) completely. +// returns a *RequestInformation when successful +func (m *ItemItemSubscriptionRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemSubscriptionPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemSubscriptionRequestBuilder when successful +func (m *ItemItemSubscriptionRequestBuilder) WithUrl(rawUrl string)(*ItemItemSubscriptionRequestBuilder) { + return NewItemItemSubscriptionRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tags_protection_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tags_protection_post_request_body.go new file mode 100644 index 000000000..14928f463 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tags_protection_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemTagsProtectionPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // An optional glob pattern to match against when enforcing tag protection. + pattern *string +} +// NewItemItemTagsProtectionPostRequestBody instantiates a new ItemItemTagsProtectionPostRequestBody and sets the default values. +func NewItemItemTagsProtectionPostRequestBody()(*ItemItemTagsProtectionPostRequestBody) { + m := &ItemItemTagsProtectionPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemTagsProtectionPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemTagsProtectionPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemTagsProtectionPostRequestBody(), 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 *ItemItemTagsProtectionPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemTagsProtectionPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["pattern"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPattern(val) + } + return nil + } + return res +} +// GetPattern gets the pattern property value. An optional glob pattern to match against when enforcing tag protection. +// returns a *string when successful +func (m *ItemItemTagsProtectionPostRequestBody) GetPattern()(*string) { + return m.pattern +} +// Serialize serializes information the current object +func (m *ItemItemTagsProtectionPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("pattern", m.GetPattern()) + 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 *ItemItemTagsProtectionPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPattern sets the pattern property value. An optional glob pattern to match against when enforcing tag protection. +func (m *ItemItemTagsProtectionPostRequestBody) SetPattern(value *string)() { + m.pattern = value +} +type ItemItemTagsProtectionPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPattern()(*string) + SetPattern(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tags_protection_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tags_protection_request_builder.go new file mode 100644 index 000000000..df8dc0406 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tags_protection_request_builder.go @@ -0,0 +1,120 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemTagsProtectionRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\tags\protection +type ItemItemTagsProtectionRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByTag_protection_id gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.tags.protection.item collection +// Deprecated: +// returns a *ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder when successful +func (m *ItemItemTagsProtectionRequestBuilder) ByTag_protection_id(tag_protection_id int32)(*ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["tag_protection_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(tag_protection_id), 10) + return NewItemItemTagsProtectionWithTag_protection_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemTagsProtectionRequestBuilderInternal instantiates a new ItemItemTagsProtectionRequestBuilder and sets the default values. +func NewItemItemTagsProtectionRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTagsProtectionRequestBuilder) { + m := &ItemItemTagsProtectionRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/tags/protection", pathParameters), + } + return m +} +// NewItemItemTagsProtectionRequestBuilder instantiates a new ItemItemTagsProtectionRequestBuilder and sets the default values. +func NewItemItemTagsProtectionRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTagsProtectionRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTagsProtectionRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Note**: This operation is deprecated and will be removed after August 30th 2024Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead.This returns the tag protection states of a repository.This information is only available to repository administrators. +// Deprecated: +// returns a []TagProtectionable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/tags#deprecated---list-tag-protection-states-for-a-repository +func (m *ItemItemTagsProtectionRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TagProtectionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTagProtectionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TagProtectionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TagProtectionable) + } + } + return val, nil +} +// Post **Note**: This operation is deprecated and will be removed after August 30th 2024Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead.This creates a tag protection state for a repository.This endpoint is only available to repository administrators. +// Deprecated: +// returns a TagProtectionable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/tags#deprecated---create-a-tag-protection-state-for-a-repository +func (m *ItemItemTagsProtectionRequestBuilder) Post(ctx context.Context, body ItemItemTagsProtectionPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TagProtectionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTagProtectionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TagProtectionable), nil +} +// ToGetRequestInformation **Note**: This operation is deprecated and will be removed after August 30th 2024Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead.This returns the tag protection states of a repository.This information is only available to repository administrators. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemItemTagsProtectionRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation **Note**: This operation is deprecated and will be removed after August 30th 2024Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead.This creates a tag protection state for a repository.This endpoint is only available to repository administrators. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemItemTagsProtectionRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemTagsProtectionPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemItemTagsProtectionRequestBuilder when successful +func (m *ItemItemTagsProtectionRequestBuilder) WithUrl(rawUrl string)(*ItemItemTagsProtectionRequestBuilder) { + return NewItemItemTagsProtectionRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tags_protection_with_tag_protection_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tags_protection_with_tag_protection_item_request_builder.go new file mode 100644 index 000000000..eb53b117d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tags_protection_with_tag_protection_item_request_builder.go @@ -0,0 +1,62 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\tags\protection\{tag_protection_id} +type ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemTagsProtectionWithTag_protection_ItemRequestBuilderInternal instantiates a new ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder and sets the default values. +func NewItemItemTagsProtectionWithTag_protection_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder) { + m := &ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/tags/protection/{tag_protection_id}", pathParameters), + } + return m +} +// NewItemItemTagsProtectionWithTag_protection_ItemRequestBuilder instantiates a new ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder and sets the default values. +func NewItemItemTagsProtectionWithTag_protection_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTagsProtectionWithTag_protection_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete **Note**: This operation is deprecated and will be removed after August 30th 2024Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead.This deletes a tag protection state for a repository.This endpoint is only available to repository administrators. +// Deprecated: +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/tags#deprecated---delete-a-tag-protection-state-for-a-repository +func (m *ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation **Note**: This operation is deprecated and will be removed after August 30th 2024Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead.This deletes a tag protection state for a repository.This endpoint is only available to repository administrators. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder when successful +func (m *ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder) { + return NewItemItemTagsProtectionWithTag_protection_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tags_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tags_request_builder.go new file mode 100644 index 000000000..cb7000d83 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tags_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemTagsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\tags +type ItemItemTagsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemTagsRequestBuilderGetQueryParameters list repository tags +type ItemItemTagsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemTagsRequestBuilderInternal instantiates a new ItemItemTagsRequestBuilder and sets the default values. +func NewItemItemTagsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTagsRequestBuilder) { + m := &ItemItemTagsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/tags{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemTagsRequestBuilder instantiates a new ItemItemTagsRequestBuilder and sets the default values. +func NewItemItemTagsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTagsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTagsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list repository tags +// returns a []Tagable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#list-repository-tags +func (m *ItemItemTagsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemTagsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Tagable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTagFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Tagable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Tagable) + } + } + return val, nil +} +// Protection the protection property +// returns a *ItemItemTagsProtectionRequestBuilder when successful +func (m *ItemItemTagsRequestBuilder) Protection()(*ItemItemTagsProtectionRequestBuilder) { + return NewItemItemTagsProtectionRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// returns a *RequestInformation when successful +func (m *ItemItemTagsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemTagsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemTagsRequestBuilder when successful +func (m *ItemItemTagsRequestBuilder) WithUrl(rawUrl string)(*ItemItemTagsRequestBuilder) { + return NewItemItemTagsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tarball_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tarball_request_builder.go new file mode 100644 index 000000000..4686fcf77 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tarball_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemTarballRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\tarball +type ItemItemTarballRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRef gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.tarball.item collection +// returns a *ItemItemTarballWithRefItemRequestBuilder when successful +func (m *ItemItemTarballRequestBuilder) ByRef(ref string)(*ItemItemTarballWithRefItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if ref != "" { + urlTplParams["ref"] = ref + } + return NewItemItemTarballWithRefItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemTarballRequestBuilderInternal instantiates a new ItemItemTarballRequestBuilder and sets the default values. +func NewItemItemTarballRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTarballRequestBuilder) { + m := &ItemItemTarballRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/tarball", pathParameters), + } + return m +} +// NewItemItemTarballRequestBuilder instantiates a new ItemItemTarballRequestBuilder and sets the default values. +func NewItemItemTarballRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTarballRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTarballRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tarball_with_ref_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tarball_with_ref_item_request_builder.go new file mode 100644 index 000000000..7ddba5f39 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_tarball_with_ref_item_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemTarballWithRefItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\tarball\{ref} +type ItemItemTarballWithRefItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemTarballWithRefItemRequestBuilderInternal instantiates a new ItemItemTarballWithRefItemRequestBuilder and sets the default values. +func NewItemItemTarballWithRefItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTarballWithRefItemRequestBuilder) { + m := &ItemItemTarballWithRefItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/tarball/{ref}", pathParameters), + } + return m +} +// NewItemItemTarballWithRefItemRequestBuilder instantiates a new ItemItemTarballWithRefItemRequestBuilder and sets the default values. +func NewItemItemTarballWithRefItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTarballWithRefItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + 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. +// [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])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + 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 +func (m *ItemItemTarballWithRefItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemTarballWithRefItemRequestBuilder when successful +func (m *ItemItemTarballWithRefItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemTarballWithRefItemRequestBuilder) { + return NewItemItemTarballWithRefItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_teams_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_teams_request_builder.go new file mode 100644 index 000000000..d84b4698b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_teams_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemTeamsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\teams +type ItemItemTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemTeamsRequestBuilderGetQueryParameters lists the teams that have access to the specified repository and that are also visible to the authenticated user.For a public repository, a team is listed only if that team added the public repository explicitly.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to use this endpoint with a public repository, and `repo` scope to use this endpoint with a private repository. +type ItemItemTeamsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemTeamsRequestBuilderInternal instantiates a new ItemItemTeamsRequestBuilder and sets the default values. +func NewItemItemTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTeamsRequestBuilder) { + m := &ItemItemTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/teams{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemTeamsRequestBuilder instantiates a new ItemItemTeamsRequestBuilder and sets the default values. +func NewItemItemTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTeamsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the teams that have access to the specified repository and that are also visible to the authenticated user.For a public repository, a team is listed only if that team added the public repository explicitly.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to use this endpoint with a public repository, and `repo` scope to use this endpoint with a private repository. +// returns a []Teamable 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/repos/repos#list-repository-teams +func (m *ItemItemTeamsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemTeamsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable) + } + } + return val, nil +} +// ToGetRequestInformation lists the teams that have access to the specified repository and that are also visible to the authenticated user.For a public repository, a team is listed only if that team added the public repository explicitly.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to use this endpoint with a public repository, and `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemTeamsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemTeamsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemTeamsRequestBuilder when successful +func (m *ItemItemTeamsRequestBuilder) WithUrl(rawUrl string)(*ItemItemTeamsRequestBuilder) { + return NewItemItemTeamsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_topics_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_topics_put_request_body.go new file mode 100644 index 000000000..7d6c7c68b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_topics_put_request_body.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemTopicsPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (`[]`) to clear all topics from the repository. **Note:** Topic `names` cannot contain uppercase letters. + names []string +} +// NewItemItemTopicsPutRequestBody instantiates a new ItemItemTopicsPutRequestBody and sets the default values. +func NewItemItemTopicsPutRequestBody()(*ItemItemTopicsPutRequestBody) { + m := &ItemItemTopicsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemTopicsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemTopicsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemTopicsPutRequestBody(), 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 *ItemItemTopicsPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemTopicsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["names"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetNames(res) + } + return nil + } + return res +} +// GetNames gets the names property value. An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (`[]`) to clear all topics from the repository. **Note:** Topic `names` cannot contain uppercase letters. +// returns a []string when successful +func (m *ItemItemTopicsPutRequestBody) GetNames()([]string) { + return m.names +} +// Serialize serializes information the current object +func (m *ItemItemTopicsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetNames() != nil { + err := writer.WriteCollectionOfStringValues("names", m.GetNames()) + 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 *ItemItemTopicsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNames sets the names property value. An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (`[]`) to clear all topics from the repository. **Note:** Topic `names` cannot contain uppercase letters. +func (m *ItemItemTopicsPutRequestBody) SetNames(value []string)() { + m.names = value +} +type ItemItemTopicsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNames()([]string) + SetNames(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_topics_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_topics_request_builder.go new file mode 100644 index 000000000..ac9adb209 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_topics_request_builder.go @@ -0,0 +1,103 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemTopicsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\topics +type ItemItemTopicsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemTopicsRequestBuilderGetQueryParameters get all repository topics +type ItemItemTopicsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemTopicsRequestBuilderInternal instantiates a new ItemItemTopicsRequestBuilder and sets the default values. +func NewItemItemTopicsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTopicsRequestBuilder) { + m := &ItemItemTopicsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/topics{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemTopicsRequestBuilder instantiates a new ItemItemTopicsRequestBuilder and sets the default values. +func NewItemItemTopicsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTopicsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTopicsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get all repository topics +// returns a Topicable 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/repos/repos#get-all-repository-topics +func (m *ItemItemTopicsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemTopicsRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Topicable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTopicFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Topicable), nil +} +// Put replace all repository topics +// returns a Topicable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#replace-all-repository-topics +func (m *ItemItemTopicsRequestBuilder) Put(ctx context.Context, body ItemItemTopicsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Topicable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTopicFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Topicable), nil +} +// returns a *RequestInformation when successful +func (m *ItemItemTopicsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemTopicsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *ItemItemTopicsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemTopicsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemTopicsRequestBuilder when successful +func (m *ItemItemTopicsRequestBuilder) WithUrl(rawUrl string)(*ItemItemTopicsRequestBuilder) { + return NewItemItemTopicsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_clones_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_clones_request_builder.go new file mode 100644 index 000000000..ed93c999d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_clones_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i1d0f28263915d5f59d46016ea25888da94f489536a9769cb5698c30da42ce737 "github.com/octokit/go-sdk/pkg/github/repos/item/item/traffic/clones" +) + +// ItemItemTrafficClonesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\traffic\clones +type ItemItemTrafficClonesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemTrafficClonesRequestBuilderGetQueryParameters get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. +type ItemItemTrafficClonesRequestBuilderGetQueryParameters struct { + // The time frame to display results for. + Per *i1d0f28263915d5f59d46016ea25888da94f489536a9769cb5698c30da42ce737.GetPerQueryParameterType `uriparametername:"per"` +} +// NewItemItemTrafficClonesRequestBuilderInternal instantiates a new ItemItemTrafficClonesRequestBuilder and sets the default values. +func NewItemItemTrafficClonesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTrafficClonesRequestBuilder) { + m := &ItemItemTrafficClonesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/traffic/clones{?per*}", pathParameters), + } + return m +} +// NewItemItemTrafficClonesRequestBuilder instantiates a new ItemItemTrafficClonesRequestBuilder and sets the default values. +func NewItemItemTrafficClonesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTrafficClonesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTrafficClonesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. +// returns a CloneTrafficable when successful +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/metrics/traffic#get-repository-clones +func (m *ItemItemTrafficClonesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemTrafficClonesRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CloneTrafficable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCloneTrafficFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CloneTrafficable), nil +} +// ToGetRequestInformation get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. +// returns a *RequestInformation when successful +func (m *ItemItemTrafficClonesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemTrafficClonesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemTrafficClonesRequestBuilder when successful +func (m *ItemItemTrafficClonesRequestBuilder) WithUrl(rawUrl string)(*ItemItemTrafficClonesRequestBuilder) { + return NewItemItemTrafficClonesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_popular_paths_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_popular_paths_request_builder.go new file mode 100644 index 000000000..c25c5591d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_popular_paths_request_builder.go @@ -0,0 +1,64 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemTrafficPopularPathsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\traffic\popular\paths +type ItemItemTrafficPopularPathsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemTrafficPopularPathsRequestBuilderInternal instantiates a new ItemItemTrafficPopularPathsRequestBuilder and sets the default values. +func NewItemItemTrafficPopularPathsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTrafficPopularPathsRequestBuilder) { + m := &ItemItemTrafficPopularPathsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/traffic/popular/paths", pathParameters), + } + return m +} +// NewItemItemTrafficPopularPathsRequestBuilder instantiates a new ItemItemTrafficPopularPathsRequestBuilder and sets the default values. +func NewItemItemTrafficPopularPathsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTrafficPopularPathsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTrafficPopularPathsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get the top 10 popular contents over the last 14 days. +// returns a []ContentTrafficable when successful +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/metrics/traffic#get-top-referral-paths +func (m *ItemItemTrafficPopularPathsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentTrafficable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateContentTrafficFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentTrafficable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ContentTrafficable) + } + } + return val, nil +} +// ToGetRequestInformation get the top 10 popular contents over the last 14 days. +// returns a *RequestInformation when successful +func (m *ItemItemTrafficPopularPathsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemTrafficPopularPathsRequestBuilder when successful +func (m *ItemItemTrafficPopularPathsRequestBuilder) WithUrl(rawUrl string)(*ItemItemTrafficPopularPathsRequestBuilder) { + return NewItemItemTrafficPopularPathsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_popular_referrers_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_popular_referrers_request_builder.go new file mode 100644 index 000000000..bda877c1d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_popular_referrers_request_builder.go @@ -0,0 +1,64 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemTrafficPopularReferrersRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\traffic\popular\referrers +type ItemItemTrafficPopularReferrersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemTrafficPopularReferrersRequestBuilderInternal instantiates a new ItemItemTrafficPopularReferrersRequestBuilder and sets the default values. +func NewItemItemTrafficPopularReferrersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTrafficPopularReferrersRequestBuilder) { + m := &ItemItemTrafficPopularReferrersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/traffic/popular/referrers", pathParameters), + } + return m +} +// NewItemItemTrafficPopularReferrersRequestBuilder instantiates a new ItemItemTrafficPopularReferrersRequestBuilder and sets the default values. +func NewItemItemTrafficPopularReferrersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTrafficPopularReferrersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTrafficPopularReferrersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get the top 10 referrers over the last 14 days. +// returns a []ReferrerTrafficable when successful +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/metrics/traffic#get-top-referral-sources +func (m *ItemItemTrafficPopularReferrersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReferrerTrafficable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReferrerTrafficFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReferrerTrafficable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ReferrerTrafficable) + } + } + return val, nil +} +// ToGetRequestInformation get the top 10 referrers over the last 14 days. +// returns a *RequestInformation when successful +func (m *ItemItemTrafficPopularReferrersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemTrafficPopularReferrersRequestBuilder when successful +func (m *ItemItemTrafficPopularReferrersRequestBuilder) WithUrl(rawUrl string)(*ItemItemTrafficPopularReferrersRequestBuilder) { + return NewItemItemTrafficPopularReferrersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_popular_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_popular_request_builder.go new file mode 100644 index 000000000..d3df233a0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_popular_request_builder.go @@ -0,0 +1,33 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemTrafficPopularRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\traffic\popular +type ItemItemTrafficPopularRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemTrafficPopularRequestBuilderInternal instantiates a new ItemItemTrafficPopularRequestBuilder and sets the default values. +func NewItemItemTrafficPopularRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTrafficPopularRequestBuilder) { + m := &ItemItemTrafficPopularRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/traffic/popular", pathParameters), + } + return m +} +// NewItemItemTrafficPopularRequestBuilder instantiates a new ItemItemTrafficPopularRequestBuilder and sets the default values. +func NewItemItemTrafficPopularRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTrafficPopularRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTrafficPopularRequestBuilderInternal(urlParams, requestAdapter) +} +// Paths the paths property +// returns a *ItemItemTrafficPopularPathsRequestBuilder when successful +func (m *ItemItemTrafficPopularRequestBuilder) Paths()(*ItemItemTrafficPopularPathsRequestBuilder) { + return NewItemItemTrafficPopularPathsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Referrers the referrers property +// returns a *ItemItemTrafficPopularReferrersRequestBuilder when successful +func (m *ItemItemTrafficPopularRequestBuilder) Referrers()(*ItemItemTrafficPopularReferrersRequestBuilder) { + return NewItemItemTrafficPopularReferrersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_request_builder.go new file mode 100644 index 000000000..37ec8732f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_request_builder.go @@ -0,0 +1,38 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemTrafficRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\traffic +type ItemItemTrafficRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Clones the clones property +// returns a *ItemItemTrafficClonesRequestBuilder when successful +func (m *ItemItemTrafficRequestBuilder) Clones()(*ItemItemTrafficClonesRequestBuilder) { + return NewItemItemTrafficClonesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemTrafficRequestBuilderInternal instantiates a new ItemItemTrafficRequestBuilder and sets the default values. +func NewItemItemTrafficRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTrafficRequestBuilder) { + m := &ItemItemTrafficRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/traffic", pathParameters), + } + return m +} +// NewItemItemTrafficRequestBuilder instantiates a new ItemItemTrafficRequestBuilder and sets the default values. +func NewItemItemTrafficRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTrafficRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTrafficRequestBuilderInternal(urlParams, requestAdapter) +} +// Popular the popular property +// returns a *ItemItemTrafficPopularRequestBuilder when successful +func (m *ItemItemTrafficRequestBuilder) Popular()(*ItemItemTrafficPopularRequestBuilder) { + return NewItemItemTrafficPopularRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Views the views property +// returns a *ItemItemTrafficViewsRequestBuilder when successful +func (m *ItemItemTrafficRequestBuilder) Views()(*ItemItemTrafficViewsRequestBuilder) { + return NewItemItemTrafficViewsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_views_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_views_request_builder.go new file mode 100644 index 000000000..3c04e6ac4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_traffic_views_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i519e57b587cd0e846159d929c723700fc30b0b1283d00e0ed34d02139b90315e "github.com/octokit/go-sdk/pkg/github/repos/item/item/traffic/views" +) + +// ItemItemTrafficViewsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\traffic\views +type ItemItemTrafficViewsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemTrafficViewsRequestBuilderGetQueryParameters get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. +type ItemItemTrafficViewsRequestBuilderGetQueryParameters struct { + // The time frame to display results for. + Per *i519e57b587cd0e846159d929c723700fc30b0b1283d00e0ed34d02139b90315e.GetPerQueryParameterType `uriparametername:"per"` +} +// NewItemItemTrafficViewsRequestBuilderInternal instantiates a new ItemItemTrafficViewsRequestBuilder and sets the default values. +func NewItemItemTrafficViewsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTrafficViewsRequestBuilder) { + m := &ItemItemTrafficViewsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/traffic/views{?per*}", pathParameters), + } + return m +} +// NewItemItemTrafficViewsRequestBuilder instantiates a new ItemItemTrafficViewsRequestBuilder and sets the default values. +func NewItemItemTrafficViewsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTrafficViewsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTrafficViewsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. +// returns a ViewTrafficable when successful +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/metrics/traffic#get-page-views +func (m *ItemItemTrafficViewsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemTrafficViewsRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ViewTrafficable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateViewTrafficFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ViewTrafficable), nil +} +// ToGetRequestInformation get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. +// returns a *RequestInformation when successful +func (m *ItemItemTrafficViewsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemTrafficViewsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemTrafficViewsRequestBuilder when successful +func (m *ItemItemTrafficViewsRequestBuilder) WithUrl(rawUrl string)(*ItemItemTrafficViewsRequestBuilder) { + return NewItemItemTrafficViewsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_transfer_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_transfer_post_request_body.go new file mode 100644 index 000000000..09df893ce --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_transfer_post_request_body.go @@ -0,0 +1,144 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemTransferPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The new name to be given to the repository. + new_name *string + // The username or organization name the repository will be transferred to. + new_owner *string + // ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. + team_ids []int32 +} +// NewItemItemTransferPostRequestBody instantiates a new ItemItemTransferPostRequestBody and sets the default values. +func NewItemItemTransferPostRequestBody()(*ItemItemTransferPostRequestBody) { + m := &ItemItemTransferPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemTransferPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemTransferPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemTransferPostRequestBody(), 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 *ItemItemTransferPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemTransferPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["new_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNewName(val) + } + return nil + } + res["new_owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNewOwner(val) + } + return nil + } + res["team_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetTeamIds(res) + } + return nil + } + return res +} +// GetNewName gets the new_name property value. The new name to be given to the repository. +// returns a *string when successful +func (m *ItemItemTransferPostRequestBody) GetNewName()(*string) { + return m.new_name +} +// GetNewOwner gets the new_owner property value. The username or organization name the repository will be transferred to. +// returns a *string when successful +func (m *ItemItemTransferPostRequestBody) GetNewOwner()(*string) { + return m.new_owner +} +// GetTeamIds gets the team_ids property value. ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. +// returns a []int32 when successful +func (m *ItemItemTransferPostRequestBody) GetTeamIds()([]int32) { + return m.team_ids +} +// Serialize serializes information the current object +func (m *ItemItemTransferPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("new_name", m.GetNewName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("new_owner", m.GetNewOwner()) + if err != nil { + return err + } + } + if m.GetTeamIds() != nil { + err := writer.WriteCollectionOfInt32Values("team_ids", m.GetTeamIds()) + 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 *ItemItemTransferPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNewName sets the new_name property value. The new name to be given to the repository. +func (m *ItemItemTransferPostRequestBody) SetNewName(value *string)() { + m.new_name = value +} +// SetNewOwner sets the new_owner property value. The username or organization name the repository will be transferred to. +func (m *ItemItemTransferPostRequestBody) SetNewOwner(value *string)() { + m.new_owner = value +} +// SetTeamIds sets the team_ids property value. ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. +func (m *ItemItemTransferPostRequestBody) SetTeamIds(value []int32)() { + m.team_ids = value +} +type ItemItemTransferPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNewName()(*string) + GetNewOwner()(*string) + GetTeamIds()([]int32) + SetNewName(value *string)() + SetNewOwner(value *string)() + SetTeamIds(value []int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_transfer_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_transfer_request_builder.go new file mode 100644 index 000000000..e737f93cb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_transfer_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemTransferRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\transfer +type ItemItemTransferRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemTransferRequestBuilderInternal instantiates a new ItemItemTransferRequestBuilder and sets the default values. +func NewItemItemTransferRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTransferRequestBuilder) { + m := &ItemItemTransferRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/transfer", pathParameters), + } + return m +} +// NewItemItemTransferRequestBuilder instantiates a new ItemItemTransferRequestBuilder and sets the default values. +func NewItemItemTransferRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTransferRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTransferRequestBuilderInternal(urlParams, requestAdapter) +} +// Post a transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original `owner`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://docs.github.com/articles/about-repository-transfers/). +// returns a MinimalRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#transfer-a-repository +func (m *ItemItemTransferRequestBuilder) Post(ctx context.Context, body ItemItemTransferPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable), nil +} +// ToPostRequestInformation a transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original `owner`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://docs.github.com/articles/about-repository-transfers/). +// returns a *RequestInformation when successful +func (m *ItemItemTransferRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemTransferPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemTransferRequestBuilder when successful +func (m *ItemItemTransferRequestBuilder) WithUrl(rawUrl string)(*ItemItemTransferRequestBuilder) { + return NewItemItemTransferRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_vulnerability_alerts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_vulnerability_alerts_request_builder.go new file mode 100644 index 000000000..146c2ebf5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_vulnerability_alerts_request_builder.go @@ -0,0 +1,95 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemVulnerabilityAlertsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\vulnerability-alerts +type ItemItemVulnerabilityAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemVulnerabilityAlertsRequestBuilderInternal instantiates a new ItemItemVulnerabilityAlertsRequestBuilder and sets the default values. +func NewItemItemVulnerabilityAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemVulnerabilityAlertsRequestBuilder) { + m := &ItemItemVulnerabilityAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/vulnerability-alerts", pathParameters), + } + return m +} +// NewItemItemVulnerabilityAlertsRequestBuilder instantiates a new ItemItemVulnerabilityAlertsRequestBuilder and sets the default values. +func NewItemItemVulnerabilityAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemVulnerabilityAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemVulnerabilityAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete disables dependency alerts and the dependency graph for a repository.The authenticated user must have admin access to the repository. For more information,see "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)". +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts +func (m *ItemItemVulnerabilityAlertsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin read access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)". +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository +func (m *ItemItemVulnerabilityAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)". +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts +func (m *ItemItemVulnerabilityAlertsRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation disables dependency alerts and the dependency graph for a repository.The authenticated user must have admin access to the repository. For more information,see "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)". +// returns a *RequestInformation when successful +func (m *ItemItemVulnerabilityAlertsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin read access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)". +// returns a *RequestInformation when successful +func (m *ItemItemVulnerabilityAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToPutRequestInformation enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)". +// returns a *RequestInformation when successful +func (m *ItemItemVulnerabilityAlertsRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemVulnerabilityAlertsRequestBuilder when successful +func (m *ItemItemVulnerabilityAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemItemVulnerabilityAlertsRequestBuilder) { + return NewItemItemVulnerabilityAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo403_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo403_error.go new file mode 100644 index 000000000..f243f1151 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo403_error.go @@ -0,0 +1,113 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemWithRepo403Error +type ItemItemWithRepo403Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewItemItemWithRepo403Error instantiates a new ItemItemWithRepo403Error and sets the default values. +func NewItemItemWithRepo403Error()(*ItemItemWithRepo403Error) { + m := &ItemItemWithRepo403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemWithRepo403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemWithRepo403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemWithRepo403Error(), nil +} +// Error the primary error message. +func (m *ItemItemWithRepo403Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemWithRepo403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +func (m *ItemItemWithRepo403Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +func (m *ItemItemWithRepo403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +func (m *ItemItemWithRepo403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemItemWithRepo403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ItemItemWithRepo403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemItemWithRepo403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *ItemItemWithRepo403Error) SetMessage(value *string)() { + m.message = value +} +// ItemItemWithRepo403Errorable +type ItemItemWithRepo403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo_patch_request_body.go new file mode 100644 index 000000000..7d49aaa99 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo_patch_request_body.go @@ -0,0 +1,613 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemWithRepoPatchRequestBody +type ItemItemWithRepoPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. + allow_auto_merge *bool + // Either `true` to allow private forks, or `false` to prevent private forks. + allow_forking *bool + // Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. + allow_merge_commit *bool + // Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. + allow_rebase_merge *bool + // Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. + allow_squash_merge *bool + // Either `true` to always allow a pull request head branch that is behind its base branch to be updated even if it is not required to be up to date before merging, or false otherwise. + allow_update_branch *bool + // Whether to archive this repository. `false` will unarchive a previously archived repository. + archived *bool + // Updates the default branch for this repository. + default_branch *string + // Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. + delete_branch_on_merge *bool + // A short description of the repository. + description *string + // Either `true` to enable issues for this repository or `false` to disable them. + has_issues *bool + // Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. + has_projects *bool + // Either `true` to enable the wiki for this repository or `false` to disable it. + has_wiki *bool + // A URL with more information about the repository. + homepage *string + // Either `true` to make this repo available as a template repository or `false` to prevent it. + is_template *bool + // The name of the repository. + name *string + // Either `true` to make the repository private or `false` to make it public. Default: `false`. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. + private *bool + // Specify which security and analysis features to enable or disable for the repository.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."For example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request:`{ "security_and_analysis": {"advanced_security": { "status": "enabled" } } }`.You can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. + security_and_analysis ItemItemWithRepoPatchRequestBody_security_and_analysisable + // Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + // Deprecated: + use_squash_pr_title_as_default *bool + // Either `true` to require contributors to sign off on web-based commits, or `false` to not require contributors to sign off on web-based commits. + web_commit_signoff_required *bool +} +// NewItemItemWithRepoPatchRequestBody instantiates a new ItemItemWithRepoPatchRequestBody and sets the default values. +func NewItemItemWithRepoPatchRequestBody()(*ItemItemWithRepoPatchRequestBody) { + m := &ItemItemWithRepoPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemWithRepoPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemWithRepoPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemWithRepoPatchRequestBody(), 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. +func (m *ItemItemWithRepoPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. +func (m *ItemItemWithRepoPatchRequestBody) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowForking gets the allow_forking property value. Either `true` to allow private forks, or `false` to prevent private forks. +func (m *ItemItemWithRepoPatchRequestBody) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. +func (m *ItemItemWithRepoPatchRequestBody) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. +func (m *ItemItemWithRepoPatchRequestBody) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. +func (m *ItemItemWithRepoPatchRequestBody) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetAllowUpdateBranch gets the allow_update_branch property value. Either `true` to always allow a pull request head branch that is behind its base branch to be updated even if it is not required to be up to date before merging, or false otherwise. +func (m *ItemItemWithRepoPatchRequestBody) GetAllowUpdateBranch()(*bool) { + return m.allow_update_branch +} +// GetArchived gets the archived property value. Whether to archive this repository. `false` will unarchive a previously archived repository. +func (m *ItemItemWithRepoPatchRequestBody) GetArchived()(*bool) { + return m.archived +} +// GetDefaultBranch gets the default_branch property value. Updates the default branch for this repository. +func (m *ItemItemWithRepoPatchRequestBody) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. +func (m *ItemItemWithRepoPatchRequestBody) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDescription gets the description property value. A short description of the repository. +func (m *ItemItemWithRepoPatchRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +func (m *ItemItemWithRepoPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["allow_update_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowUpdateBranch(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["security_and_analysis"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemWithRepoPatchRequestBody_security_and_analysisFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAndAnalysis(val.(ItemItemWithRepoPatchRequestBody_security_and_analysisable)) + } + return nil + } + res["use_squash_pr_title_as_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseSquashPrTitleAsDefault(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetHasIssues gets the has_issues property value. Either `true` to enable issues for this repository or `false` to disable them. +func (m *ItemItemWithRepoPatchRequestBody) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasProjects gets the has_projects property value. Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. +func (m *ItemItemWithRepoPatchRequestBody) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. Either `true` to enable the wiki for this repository or `false` to disable it. +func (m *ItemItemWithRepoPatchRequestBody) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. A URL with more information about the repository. +func (m *ItemItemWithRepoPatchRequestBody) GetHomepage()(*string) { + return m.homepage +} +// GetIsTemplate gets the is_template property value. Either `true` to make this repo available as a template repository or `false` to prevent it. +func (m *ItemItemWithRepoPatchRequestBody) GetIsTemplate()(*bool) { + return m.is_template +} +// GetName gets the name property value. The name of the repository. +func (m *ItemItemWithRepoPatchRequestBody) GetName()(*string) { + return m.name +} +// GetPrivate gets the private property value. Either `true` to make the repository private or `false` to make it public. Default: `false`. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. +func (m *ItemItemWithRepoPatchRequestBody) GetPrivate()(*bool) { + return m.private +} +// GetSecurityAndAnalysis gets the security_and_analysis property value. Specify which security and analysis features to enable or disable for the repository.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."For example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request:`{ "security_and_analysis": {"advanced_security": { "status": "enabled" } } }`.You can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. +func (m *ItemItemWithRepoPatchRequestBody) GetSecurityAndAnalysis()(ItemItemWithRepoPatchRequestBody_security_and_analysisable) { + return m.security_and_analysis +} +// GetUseSquashPrTitleAsDefault gets the use_squash_pr_title_as_default property value. Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +func (m *ItemItemWithRepoPatchRequestBody) GetUseSquashPrTitleAsDefault()(*bool) { + return m.use_squash_pr_title_as_default +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. Either `true` to require contributors to sign off on web-based commits, or `false` to not require contributors to sign off on web-based commits. +func (m *ItemItemWithRepoPatchRequestBody) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *ItemItemWithRepoPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_update_branch", m.GetAllowUpdateBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("security_and_analysis", m.GetSecurityAndAnalysis()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_squash_pr_title_as_default", m.GetUseSquashPrTitleAsDefault()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *ItemItemWithRepoPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. +func (m *ItemItemWithRepoPatchRequestBody) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowForking sets the allow_forking property value. Either `true` to allow private forks, or `false` to prevent private forks. +func (m *ItemItemWithRepoPatchRequestBody) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. +func (m *ItemItemWithRepoPatchRequestBody) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. +func (m *ItemItemWithRepoPatchRequestBody) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. +func (m *ItemItemWithRepoPatchRequestBody) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetAllowUpdateBranch sets the allow_update_branch property value. Either `true` to always allow a pull request head branch that is behind its base branch to be updated even if it is not required to be up to date before merging, or false otherwise. +func (m *ItemItemWithRepoPatchRequestBody) SetAllowUpdateBranch(value *bool)() { + m.allow_update_branch = value +} +// SetArchived sets the archived property value. Whether to archive this repository. `false` will unarchive a previously archived repository. +func (m *ItemItemWithRepoPatchRequestBody) SetArchived(value *bool)() { + m.archived = value +} +// SetDefaultBranch sets the default_branch property value. Updates the default branch for this repository. +func (m *ItemItemWithRepoPatchRequestBody) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. +func (m *ItemItemWithRepoPatchRequestBody) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDescription sets the description property value. A short description of the repository. +func (m *ItemItemWithRepoPatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetHasIssues sets the has_issues property value. Either `true` to enable issues for this repository or `false` to disable them. +func (m *ItemItemWithRepoPatchRequestBody) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasProjects sets the has_projects property value. Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. +func (m *ItemItemWithRepoPatchRequestBody) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. Either `true` to enable the wiki for this repository or `false` to disable it. +func (m *ItemItemWithRepoPatchRequestBody) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. A URL with more information about the repository. +func (m *ItemItemWithRepoPatchRequestBody) SetHomepage(value *string)() { + m.homepage = value +} +// SetIsTemplate sets the is_template property value. Either `true` to make this repo available as a template repository or `false` to prevent it. +func (m *ItemItemWithRepoPatchRequestBody) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetName sets the name property value. The name of the repository. +func (m *ItemItemWithRepoPatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetPrivate sets the private property value. Either `true` to make the repository private or `false` to make it public. Default: `false`. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. +func (m *ItemItemWithRepoPatchRequestBody) SetPrivate(value *bool)() { + m.private = value +} +// SetSecurityAndAnalysis sets the security_and_analysis property value. Specify which security and analysis features to enable or disable for the repository.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."For example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request:`{ "security_and_analysis": {"advanced_security": { "status": "enabled" } } }`.You can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. +func (m *ItemItemWithRepoPatchRequestBody) SetSecurityAndAnalysis(value ItemItemWithRepoPatchRequestBody_security_and_analysisable)() { + m.security_and_analysis = value +} +// SetUseSquashPrTitleAsDefault sets the use_squash_pr_title_as_default property value. Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +func (m *ItemItemWithRepoPatchRequestBody) SetUseSquashPrTitleAsDefault(value *bool)() { + m.use_squash_pr_title_as_default = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. Either `true` to require contributors to sign off on web-based commits, or `false` to not require contributors to sign off on web-based commits. +func (m *ItemItemWithRepoPatchRequestBody) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +// ItemItemWithRepoPatchRequestBodyable +type ItemItemWithRepoPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetAllowUpdateBranch()(*bool) + GetArchived()(*bool) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDescription()(*string) + GetHasIssues()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetIsTemplate()(*bool) + GetName()(*string) + GetPrivate()(*bool) + GetSecurityAndAnalysis()(ItemItemWithRepoPatchRequestBody_security_and_analysisable) + GetUseSquashPrTitleAsDefault()(*bool) + GetWebCommitSignoffRequired()(*bool) + SetAllowAutoMerge(value *bool)() + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetAllowUpdateBranch(value *bool)() + SetArchived(value *bool)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDescription(value *string)() + SetHasIssues(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetIsTemplate(value *bool)() + SetName(value *string)() + SetPrivate(value *bool)() + SetSecurityAndAnalysis(value ItemItemWithRepoPatchRequestBody_security_and_analysisable)() + SetUseSquashPrTitleAsDefault(value *bool)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo_patch_request_body_security_and_analysis.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo_patch_request_body_security_and_analysis.go new file mode 100644 index 000000000..a2ae1f266 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo_patch_request_body_security_and_analysis.go @@ -0,0 +1,134 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemWithRepoPatchRequestBody_security_and_analysis specify which security and analysis features to enable or disable for the repository.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."For example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request:`{ "security_and_analysis": {"advanced_security": { "status": "enabled" } } }`.You can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. +type ItemItemWithRepoPatchRequestBody_security_and_analysis struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." + advanced_security ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_securityable + // Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." + secret_scanning ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanningable + // Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." + secret_scanning_push_protection ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable +} +// NewItemItemWithRepoPatchRequestBody_security_and_analysis instantiates a new ItemItemWithRepoPatchRequestBody_security_and_analysis and sets the default values. +func NewItemItemWithRepoPatchRequestBody_security_and_analysis()(*ItemItemWithRepoPatchRequestBody_security_and_analysis) { + m := &ItemItemWithRepoPatchRequestBody_security_and_analysis{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemWithRepoPatchRequestBody_security_and_analysisFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemWithRepoPatchRequestBody_security_and_analysisFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemWithRepoPatchRequestBody_security_and_analysis(), 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. +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvancedSecurity gets the advanced_security property value. Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis) GetAdvancedSecurity()(ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_securityable) { + return m.advanced_security +} +// GetFieldDeserializers the deserialization information for the current model +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["advanced_security"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_securityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurity(val.(ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_securityable)) + } + return nil + } + res["secret_scanning"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanningFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecretScanning(val.(ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanningable)) + } + return nil + } + res["secret_scanning_push_protection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtection(val.(ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable)) + } + return nil + } + return res +} +// GetSecretScanning gets the secret_scanning property value. Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis) GetSecretScanning()(ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanningable) { + return m.secret_scanning +} +// GetSecretScanningPushProtection gets the secret_scanning_push_protection property value. Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis) GetSecretScanningPushProtection()(ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable) { + return m.secret_scanning_push_protection +} +// Serialize serializes information the current object +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("advanced_security", m.GetAdvancedSecurity()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("secret_scanning", m.GetSecretScanning()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("secret_scanning_push_protection", m.GetSecretScanningPushProtection()) + 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 *ItemItemWithRepoPatchRequestBody_security_and_analysis) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvancedSecurity sets the advanced_security property value. Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis) SetAdvancedSecurity(value ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_securityable)() { + m.advanced_security = value +} +// SetSecretScanning sets the secret_scanning property value. Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis) SetSecretScanning(value ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanningable)() { + m.secret_scanning = value +} +// SetSecretScanningPushProtection sets the secret_scanning_push_protection property value. Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis) SetSecretScanningPushProtection(value ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable)() { + m.secret_scanning_push_protection = value +} +// ItemItemWithRepoPatchRequestBody_security_and_analysisable +type ItemItemWithRepoPatchRequestBody_security_and_analysisable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdvancedSecurity()(ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_securityable) + GetSecretScanning()(ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanningable) + GetSecretScanningPushProtection()(ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable) + SetAdvancedSecurity(value ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_securityable)() + SetSecretScanning(value ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanningable)() + SetSecretScanningPushProtection(value ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo_patch_request_body_security_and_analysis_advanced_security.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo_patch_request_body_security_and_analysis_advanced_security.go new file mode 100644 index 000000000..10bde9eed --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo_patch_request_body_security_and_analysis_advanced_security.go @@ -0,0 +1,78 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_security use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." +type ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_security struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Can be `enabled` or `disabled`. + status *string +} +// NewItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_security instantiates a new ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_security and sets the default values. +func NewItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_security()(*ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_security) { + m := &ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_security{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_securityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_securityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_security(), 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. +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_security) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_security) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetStatus gets the status property value. Can be `enabled` or `disabled`. +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_security) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_security) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_security) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. Can be `enabled` or `disabled`. +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_security) SetStatus(value *string)() { + m.status = value +} +// ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_securityable +type ItemItemWithRepoPatchRequestBody_security_and_analysis_advanced_securityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*string) + SetStatus(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo_patch_request_body_security_and_analysis_secret_scanning.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo_patch_request_body_security_and_analysis_secret_scanning.go new file mode 100644 index 000000000..97ec6e4bd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo_patch_request_body_security_and_analysis_secret_scanning.go @@ -0,0 +1,78 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." +type ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Can be `enabled` or `disabled`. + status *string +} +// NewItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning instantiates a new ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning and sets the default values. +func NewItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning()(*ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning) { + m := &ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanningFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanningFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning(), 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. +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetStatus gets the status property value. Can be `enabled` or `disabled`. +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. Can be `enabled` or `disabled`. +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning) SetStatus(value *string)() { + m.status = value +} +// ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanningable +type ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanningable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*string) + SetStatus(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo_patch_request_body_security_and_analysis_secret_scanning_push_protection.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo_patch_request_body_security_and_analysis_secret_scanning_push_protection.go new file mode 100644 index 000000000..8e4fa99e9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_with_repo_patch_request_body_security_and_analysis_secret_scanning_push_protection.go @@ -0,0 +1,78 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." +type ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Can be `enabled` or `disabled`. + status *string +} +// NewItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection instantiates a new ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection and sets the default values. +func NewItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection()(*ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) { + m := &ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection(), 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. +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetStatus gets the status property value. Can be `enabled` or `disabled`. +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. Can be `enabled` or `disabled`. +func (m *ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) SetStatus(value *string)() { + m.status = value +} +// ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable +type ItemItemWithRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*string) + SetStatus(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_zipball_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_zipball_request_builder.go new file mode 100644 index 000000000..d6ef1521a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_zipball_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemZipballRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\zipball +type ItemItemZipballRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRef gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item.zipball.item collection +// returns a *ItemItemZipballWithRefItemRequestBuilder when successful +func (m *ItemItemZipballRequestBuilder) ByRef(ref string)(*ItemItemZipballWithRefItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if ref != "" { + urlTplParams["ref"] = ref + } + return NewItemItemZipballWithRefItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemZipballRequestBuilderInternal instantiates a new ItemItemZipballRequestBuilder and sets the default values. +func NewItemItemZipballRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemZipballRequestBuilder) { + m := &ItemItemZipballRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/zipball", pathParameters), + } + return m +} +// NewItemItemZipballRequestBuilder instantiates a new ItemItemZipballRequestBuilder and sets the default values. +func NewItemItemZipballRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemZipballRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemZipballRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_zipball_with_ref_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_zipball_with_ref_item_request_builder.go new file mode 100644 index 000000000..f7000cb56 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_item_zipball_with_ref_item_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemZipballWithRefItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\zipball\{ref} +type ItemItemZipballWithRefItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemZipballWithRefItemRequestBuilderInternal instantiates a new ItemItemZipballWithRefItemRequestBuilder and sets the default values. +func NewItemItemZipballWithRefItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemZipballWithRefItemRequestBuilder) { + m := &ItemItemZipballWithRefItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/zipball/{ref}", pathParameters), + } + return m +} +// NewItemItemZipballWithRefItemRequestBuilder instantiates a new ItemItemZipballWithRefItemRequestBuilder and sets the default values. +func NewItemItemZipballWithRefItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemZipballWithRefItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + 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. +// [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])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + 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 +func (m *ItemItemZipballWithRefItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemZipballWithRefItemRequestBuilder when successful +func (m *ItemItemZipballWithRefItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemZipballWithRefItemRequestBuilder) { + return NewItemItemZipballWithRefItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_owner_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_owner_item_request_builder.go new file mode 100644 index 000000000..b6e0e00a1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_owner_item_request_builder.go @@ -0,0 +1,456 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemOwnerItemRequestBuilder builds and executes requests for operations under \repos\{repos-id}\{Owner-id} +type ItemOwnerItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Actions the actions property +// returns a *ItemItemActionsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Actions()(*ItemItemActionsRequestBuilder) { + return NewItemItemActionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Activity the activity property +// returns a *ItemItemActivityRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Activity()(*ItemItemActivityRequestBuilder) { + return NewItemItemActivityRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Assignees the assignees property +// returns a *ItemItemAssigneesRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Assignees()(*ItemItemAssigneesRequestBuilder) { + return NewItemItemAssigneesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Autolinks the autolinks property +// returns a *ItemItemAutolinksRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Autolinks()(*ItemItemAutolinksRequestBuilder) { + return NewItemItemAutolinksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// AutomatedSecurityFixes the automatedSecurityFixes property +// returns a *ItemItemAutomatedSecurityFixesRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) AutomatedSecurityFixes()(*ItemItemAutomatedSecurityFixesRequestBuilder) { + return NewItemItemAutomatedSecurityFixesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Branches the branches property +// returns a *ItemItemBranchesRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Branches()(*ItemItemBranchesRequestBuilder) { + return NewItemItemBranchesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CheckRuns the checkRuns property +// returns a *ItemItemCheckRunsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) CheckRuns()(*ItemItemCheckRunsRequestBuilder) { + return NewItemItemCheckRunsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CheckSuites the checkSuites property +// returns a *ItemItemCheckSuitesRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) CheckSuites()(*ItemItemCheckSuitesRequestBuilder) { + return NewItemItemCheckSuitesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Codeowners the codeowners property +// returns a *ItemItemCodeownersRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Codeowners()(*ItemItemCodeownersRequestBuilder) { + return NewItemItemCodeownersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CodeScanning the codeScanning property +// returns a *ItemItemCodeScanningRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) CodeScanning()(*ItemItemCodeScanningRequestBuilder) { + return NewItemItemCodeScanningRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Codespaces the codespaces property +// returns a *ItemItemCodespacesRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Codespaces()(*ItemItemCodespacesRequestBuilder) { + return NewItemItemCodespacesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Collaborators the collaborators property +// returns a *ItemItemCollaboratorsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Collaborators()(*ItemItemCollaboratorsRequestBuilder) { + return NewItemItemCollaboratorsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +// returns a *ItemItemCommentsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Comments()(*ItemItemCommentsRequestBuilder) { + return NewItemItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Commits the commits property +// returns a *ItemItemCommitsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Commits()(*ItemItemCommitsRequestBuilder) { + return NewItemItemCommitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Community the community property +// returns a *ItemItemCommunityRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Community()(*ItemItemCommunityRequestBuilder) { + return NewItemItemCommunityRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Compare the compare property +// returns a *ItemItemCompareRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Compare()(*ItemItemCompareRequestBuilder) { + return NewItemItemCompareRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemOwnerItemRequestBuilderInternal instantiates a new ItemOwnerItemRequestBuilder and sets the default values. +func NewItemOwnerItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOwnerItemRequestBuilder) { + m := &ItemOwnerItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{repos%2Did}/{Owner%2Did}", pathParameters), + } + return m +} +// NewItemOwnerItemRequestBuilder instantiates a new ItemOwnerItemRequestBuilder and sets the default values. +func NewItemOwnerItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOwnerItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOwnerItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Contents the contents property +// returns a *ItemItemContentsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Contents()(*ItemItemContentsRequestBuilder) { + return NewItemItemContentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Contributors the contributors property +// returns a *ItemItemContributorsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Contributors()(*ItemItemContributorsRequestBuilder) { + return NewItemItemContributorsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Delete deleting a repository requires admin access.If an organization owner has configured the organization to prevent members from deleting organization-ownedrepositories, you will get a `403 Forbidden` response.OAuth app tokens and personal access tokens (classic) need the `delete_repo` scope to use this endpoint. +// returns a ItemItemOwner403Error error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#delete-a-repository +func (m *ItemOwnerItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": CreateItemItemOwner403ErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Dependabot the dependabot property +// returns a *ItemItemDependabotRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Dependabot()(*ItemItemDependabotRequestBuilder) { + return NewItemItemDependabotRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// DependencyGraph the dependencyGraph property +// returns a *ItemItemDependencyGraphRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) DependencyGraph()(*ItemItemDependencyGraphRequestBuilder) { + return NewItemItemDependencyGraphRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Deployments the deployments property +// returns a *ItemItemDeploymentsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Deployments()(*ItemItemDeploymentsRequestBuilder) { + return NewItemItemDeploymentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Dispatches the dispatches property +// returns a *ItemItemDispatchesRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Dispatches()(*ItemItemDispatchesRequestBuilder) { + return NewItemItemDispatchesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Environments the environments property +// returns a *ItemItemEnvironmentsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Environments()(*ItemItemEnvironmentsRequestBuilder) { + return NewItemItemEnvironmentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Events the events property +// returns a *ItemItemEventsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Events()(*ItemItemEventsRequestBuilder) { + return NewItemItemEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Forks the forks property +// returns a *ItemItemForksRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Forks()(*ItemItemForksRequestBuilder) { + return NewItemItemForksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Generate the generate property +// returns a *ItemItemGenerateRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Generate()(*ItemItemGenerateRequestBuilder) { + return NewItemItemGenerateRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get the `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network.**Note:** In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." +// returns a FullRepositoryable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#get-a-repository +func (m *ItemOwnerItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateFullRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable), nil +} +// Git the git property +// returns a *ItemItemGitRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Git()(*ItemItemGitRequestBuilder) { + return NewItemItemGitRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Hooks the hooks property +// returns a *ItemItemHooksRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Hooks()(*ItemItemHooksRequestBuilder) { + return NewItemItemHooksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ImportEscaped the import property +// returns a *ItemItemImportRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) ImportEscaped()(*ItemItemImportRequestBuilder) { + return NewItemItemImportRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Installation the installation property +// returns a *ItemItemInstallationRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Installation()(*ItemItemInstallationRequestBuilder) { + return NewItemItemInstallationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// InteractionLimits the interactionLimits property +// returns a *ItemItemInteractionLimitsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) InteractionLimits()(*ItemItemInteractionLimitsRequestBuilder) { + return NewItemItemInteractionLimitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Invitations the invitations property +// returns a *ItemItemInvitationsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Invitations()(*ItemItemInvitationsRequestBuilder) { + return NewItemItemInvitationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Issues the issues property +// returns a *ItemItemIssuesRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Issues()(*ItemItemIssuesRequestBuilder) { + return NewItemItemIssuesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Keys the keys property +// returns a *ItemItemKeysRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Keys()(*ItemItemKeysRequestBuilder) { + return NewItemItemKeysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Labels the labels property +// returns a *ItemItemLabelsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Labels()(*ItemItemLabelsRequestBuilder) { + return NewItemItemLabelsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Languages the languages property +// returns a *ItemItemLanguagesRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Languages()(*ItemItemLanguagesRequestBuilder) { + return NewItemItemLanguagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// License the license property +// returns a *ItemItemLicenseRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) License()(*ItemItemLicenseRequestBuilder) { + return NewItemItemLicenseRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Merges the merges property +// returns a *ItemItemMergesRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Merges()(*ItemItemMergesRequestBuilder) { + return NewItemItemMergesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// MergeUpstream the mergeUpstream property +// returns a *ItemItemMergeUpstreamRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) MergeUpstream()(*ItemItemMergeUpstreamRequestBuilder) { + return NewItemItemMergeUpstreamRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Milestones the milestones property +// returns a *ItemItemMilestonesRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Milestones()(*ItemItemMilestonesRequestBuilder) { + return NewItemItemMilestonesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Notifications the notifications property +// returns a *ItemItemNotificationsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Notifications()(*ItemItemNotificationsRequestBuilder) { + return NewItemItemNotificationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Pages the pages property +// returns a *ItemItemPagesRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Pages()(*ItemItemPagesRequestBuilder) { + return NewItemItemPagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/repos/repos#replace-all-repository-topics) endpoint. +// returns a FullRepositoryable when successful +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#update-a-repository +func (m *ItemOwnerItemRequestBuilder) Patch(ctx context.Context, body ItemItemOwnerPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateFullRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable), nil +} +// PrivateVulnerabilityReporting the privateVulnerabilityReporting property +// returns a *ItemItemPrivateVulnerabilityReportingRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) PrivateVulnerabilityReporting()(*ItemItemPrivateVulnerabilityReportingRequestBuilder) { + return NewItemItemPrivateVulnerabilityReportingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Projects the projects property +// returns a *ItemItemProjectsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Projects()(*ItemItemProjectsRequestBuilder) { + return NewItemItemProjectsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Properties the properties property +// returns a *ItemItemPropertiesRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Properties()(*ItemItemPropertiesRequestBuilder) { + return NewItemItemPropertiesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Pulls the pulls property +// returns a *ItemItemPullsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Pulls()(*ItemItemPullsRequestBuilder) { + return NewItemItemPullsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Readme the readme property +// returns a *ItemItemReadmeRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Readme()(*ItemItemReadmeRequestBuilder) { + return NewItemItemReadmeRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Releases the releases property +// returns a *ItemItemReleasesRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Releases()(*ItemItemReleasesRequestBuilder) { + return NewItemItemReleasesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rules the rules property +// returns a *ItemItemRulesRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Rules()(*ItemItemRulesRequestBuilder) { + return NewItemItemRulesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rulesets the rulesets property +// returns a *ItemItemRulesetsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Rulesets()(*ItemItemRulesetsRequestBuilder) { + return NewItemItemRulesetsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SecretScanning the secretScanning property +// returns a *ItemItemSecretScanningRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) SecretScanning()(*ItemItemSecretScanningRequestBuilder) { + return NewItemItemSecretScanningRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SecurityAdvisories the securityAdvisories property +// returns a *ItemItemSecurityAdvisoriesRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) SecurityAdvisories()(*ItemItemSecurityAdvisoriesRequestBuilder) { + return NewItemItemSecurityAdvisoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Stargazers the stargazers property +// returns a *ItemItemStargazersRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Stargazers()(*ItemItemStargazersRequestBuilder) { + return NewItemItemStargazersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Stats the stats property +// returns a *ItemItemStatsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Stats()(*ItemItemStatsRequestBuilder) { + return NewItemItemStatsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Statuses the statuses property +// returns a *ItemItemStatusesRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Statuses()(*ItemItemStatusesRequestBuilder) { + return NewItemItemStatusesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Subscribers the subscribers property +// returns a *ItemItemSubscribersRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Subscribers()(*ItemItemSubscribersRequestBuilder) { + return NewItemItemSubscribersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Subscription the subscription property +// returns a *ItemItemSubscriptionRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Subscription()(*ItemItemSubscriptionRequestBuilder) { + return NewItemItemSubscriptionRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Tags the tags property +// returns a *ItemItemTagsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Tags()(*ItemItemTagsRequestBuilder) { + return NewItemItemTagsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Tarball the tarball property +// returns a *ItemItemTarballRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Tarball()(*ItemItemTarballRequestBuilder) { + return NewItemItemTarballRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Teams the teams property +// returns a *ItemItemTeamsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Teams()(*ItemItemTeamsRequestBuilder) { + return NewItemItemTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deleting a repository requires admin access.If an organization owner has configured the organization to prevent members from deleting organization-ownedrepositories, you will get a `403 Forbidden` response.OAuth app tokens and personal access tokens (classic) need the `delete_repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOwnerItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation the `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network.**Note:** In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." +// returns a *RequestInformation when successful +func (m *ItemOwnerItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/repos/repos#replace-all-repository-topics) endpoint. +// returns a *RequestInformation when successful +func (m *ItemOwnerItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemOwnerPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// Topics the topics property +// returns a *ItemItemTopicsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Topics()(*ItemItemTopicsRequestBuilder) { + return NewItemItemTopicsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Traffic the traffic property +// returns a *ItemItemTrafficRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Traffic()(*ItemItemTrafficRequestBuilder) { + return NewItemItemTrafficRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Transfer the transfer property +// returns a *ItemItemTransferRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Transfer()(*ItemItemTransferRequestBuilder) { + return NewItemItemTransferRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// VulnerabilityAlerts the vulnerabilityAlerts property +// returns a *ItemItemVulnerabilityAlertsRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) VulnerabilityAlerts()(*ItemItemVulnerabilityAlertsRequestBuilder) { + return NewItemItemVulnerabilityAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemOwnerItemRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) WithUrl(rawUrl string)(*ItemOwnerItemRequestBuilder) { + return NewItemOwnerItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} +// Zipball the zipball property +// returns a *ItemItemZipballRequestBuilder when successful +func (m *ItemOwnerItemRequestBuilder) Zipball()(*ItemItemZipballRequestBuilder) { + return NewItemItemZipballRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_repo_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_repo_item_request_builder.go new file mode 100644 index 000000000..1e2986c67 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_repo_item_request_builder.go @@ -0,0 +1,461 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemRepoItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id} +type ItemRepoItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Actions the actions property +// returns a *ItemItemActionsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Actions()(*ItemItemActionsRequestBuilder) { + return NewItemItemActionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Activity the activity property +// returns a *ItemItemActivityRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Activity()(*ItemItemActivityRequestBuilder) { + return NewItemItemActivityRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Assignees the assignees property +// returns a *ItemItemAssigneesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Assignees()(*ItemItemAssigneesRequestBuilder) { + return NewItemItemAssigneesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Attestations the attestations property +// returns a *ItemItemAttestationsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Attestations()(*ItemItemAttestationsRequestBuilder) { + return NewItemItemAttestationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Autolinks the autolinks property +// returns a *ItemItemAutolinksRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Autolinks()(*ItemItemAutolinksRequestBuilder) { + return NewItemItemAutolinksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// AutomatedSecurityFixes the automatedSecurityFixes property +// returns a *ItemItemAutomatedSecurityFixesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) AutomatedSecurityFixes()(*ItemItemAutomatedSecurityFixesRequestBuilder) { + return NewItemItemAutomatedSecurityFixesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Branches the branches property +// returns a *ItemItemBranchesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Branches()(*ItemItemBranchesRequestBuilder) { + return NewItemItemBranchesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CheckRuns the checkRuns property +// returns a *ItemItemCheckRunsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) CheckRuns()(*ItemItemCheckRunsRequestBuilder) { + return NewItemItemCheckRunsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CheckSuites the checkSuites property +// returns a *ItemItemCheckSuitesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) CheckSuites()(*ItemItemCheckSuitesRequestBuilder) { + return NewItemItemCheckSuitesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Codeowners the codeowners property +// returns a *ItemItemCodeownersRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Codeowners()(*ItemItemCodeownersRequestBuilder) { + return NewItemItemCodeownersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CodeScanning the codeScanning property +// returns a *ItemItemCodeScanningRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) CodeScanning()(*ItemItemCodeScanningRequestBuilder) { + return NewItemItemCodeScanningRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Codespaces the codespaces property +// returns a *ItemItemCodespacesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Codespaces()(*ItemItemCodespacesRequestBuilder) { + return NewItemItemCodespacesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Collaborators the collaborators property +// returns a *ItemItemCollaboratorsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Collaborators()(*ItemItemCollaboratorsRequestBuilder) { + return NewItemItemCollaboratorsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +// returns a *ItemItemCommentsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Comments()(*ItemItemCommentsRequestBuilder) { + return NewItemItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Commits the commits property +// returns a *ItemItemCommitsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Commits()(*ItemItemCommitsRequestBuilder) { + return NewItemItemCommitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Community the community property +// returns a *ItemItemCommunityRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Community()(*ItemItemCommunityRequestBuilder) { + return NewItemItemCommunityRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Compare the compare property +// returns a *ItemItemCompareRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Compare()(*ItemItemCompareRequestBuilder) { + return NewItemItemCompareRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemRepoItemRequestBuilderInternal instantiates a new ItemRepoItemRequestBuilder and sets the default values. +func NewItemRepoItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRepoItemRequestBuilder) { + m := &ItemRepoItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}", pathParameters), + } + return m +} +// NewItemRepoItemRequestBuilder instantiates a new ItemRepoItemRequestBuilder and sets the default values. +func NewItemRepoItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRepoItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemRepoItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Contents the contents property +// returns a *ItemItemContentsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Contents()(*ItemItemContentsRequestBuilder) { + return NewItemItemContentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Contributors the contributors property +// returns a *ItemItemContributorsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Contributors()(*ItemItemContributorsRequestBuilder) { + return NewItemItemContributorsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Delete deleting a repository requires admin access.If an organization owner has configured the organization to prevent members from deleting organization-ownedrepositories, you will get a `403 Forbidden` response.OAuth app tokens and personal access tokens (classic) need the `delete_repo` scope to use this endpoint. +// returns a ItemItemRepo403Error error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#delete-a-repository +func (m *ItemRepoItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": CreateItemItemRepo403ErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Dependabot the dependabot property +// returns a *ItemItemDependabotRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Dependabot()(*ItemItemDependabotRequestBuilder) { + return NewItemItemDependabotRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// DependencyGraph the dependencyGraph property +// returns a *ItemItemDependencyGraphRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) DependencyGraph()(*ItemItemDependencyGraphRequestBuilder) { + return NewItemItemDependencyGraphRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Deployments the deployments property +// returns a *ItemItemDeploymentsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Deployments()(*ItemItemDeploymentsRequestBuilder) { + return NewItemItemDeploymentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Dispatches the dispatches property +// returns a *ItemItemDispatchesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Dispatches()(*ItemItemDispatchesRequestBuilder) { + return NewItemItemDispatchesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Environments the environments property +// returns a *ItemItemEnvironmentsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Environments()(*ItemItemEnvironmentsRequestBuilder) { + return NewItemItemEnvironmentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Events the events property +// returns a *ItemItemEventsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Events()(*ItemItemEventsRequestBuilder) { + return NewItemItemEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Forks the forks property +// returns a *ItemItemForksRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Forks()(*ItemItemForksRequestBuilder) { + return NewItemItemForksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Generate the generate property +// returns a *ItemItemGenerateRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Generate()(*ItemItemGenerateRequestBuilder) { + return NewItemItemGenerateRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get the `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network.**Note:** In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." +// returns a FullRepositoryable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#get-a-repository +func (m *ItemRepoItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateFullRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable), nil +} +// Git the git property +// returns a *ItemItemGitRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Git()(*ItemItemGitRequestBuilder) { + return NewItemItemGitRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Hooks the hooks property +// returns a *ItemItemHooksRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Hooks()(*ItemItemHooksRequestBuilder) { + return NewItemItemHooksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ImportEscaped the import property +// returns a *ItemItemImportRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) ImportEscaped()(*ItemItemImportRequestBuilder) { + return NewItemItemImportRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Installation the installation property +// returns a *ItemItemInstallationRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Installation()(*ItemItemInstallationRequestBuilder) { + return NewItemItemInstallationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// InteractionLimits the interactionLimits property +// returns a *ItemItemInteractionLimitsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) InteractionLimits()(*ItemItemInteractionLimitsRequestBuilder) { + return NewItemItemInteractionLimitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Invitations the invitations property +// returns a *ItemItemInvitationsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Invitations()(*ItemItemInvitationsRequestBuilder) { + return NewItemItemInvitationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Issues the issues property +// returns a *ItemItemIssuesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Issues()(*ItemItemIssuesRequestBuilder) { + return NewItemItemIssuesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Keys the keys property +// returns a *ItemItemKeysRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Keys()(*ItemItemKeysRequestBuilder) { + return NewItemItemKeysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Labels the labels property +// returns a *ItemItemLabelsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Labels()(*ItemItemLabelsRequestBuilder) { + return NewItemItemLabelsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Languages the languages property +// returns a *ItemItemLanguagesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Languages()(*ItemItemLanguagesRequestBuilder) { + return NewItemItemLanguagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// License the license property +// returns a *ItemItemLicenseRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) License()(*ItemItemLicenseRequestBuilder) { + return NewItemItemLicenseRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Merges the merges property +// returns a *ItemItemMergesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Merges()(*ItemItemMergesRequestBuilder) { + return NewItemItemMergesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// MergeUpstream the mergeUpstream property +// returns a *ItemItemMergeUpstreamRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) MergeUpstream()(*ItemItemMergeUpstreamRequestBuilder) { + return NewItemItemMergeUpstreamRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Milestones the milestones property +// returns a *ItemItemMilestonesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Milestones()(*ItemItemMilestonesRequestBuilder) { + return NewItemItemMilestonesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Notifications the notifications property +// returns a *ItemItemNotificationsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Notifications()(*ItemItemNotificationsRequestBuilder) { + return NewItemItemNotificationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Pages the pages property +// returns a *ItemItemPagesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Pages()(*ItemItemPagesRequestBuilder) { + return NewItemItemPagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/repos/repos#replace-all-repository-topics) endpoint. +// returns a FullRepositoryable when successful +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#update-a-repository +func (m *ItemRepoItemRequestBuilder) Patch(ctx context.Context, body ItemItemRepoPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateFullRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable), nil +} +// PrivateVulnerabilityReporting the privateVulnerabilityReporting property +// returns a *ItemItemPrivateVulnerabilityReportingRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) PrivateVulnerabilityReporting()(*ItemItemPrivateVulnerabilityReportingRequestBuilder) { + return NewItemItemPrivateVulnerabilityReportingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Projects the projects property +// returns a *ItemItemProjectsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Projects()(*ItemItemProjectsRequestBuilder) { + return NewItemItemProjectsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Properties the properties property +// returns a *ItemItemPropertiesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Properties()(*ItemItemPropertiesRequestBuilder) { + return NewItemItemPropertiesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Pulls the pulls property +// returns a *ItemItemPullsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Pulls()(*ItemItemPullsRequestBuilder) { + return NewItemItemPullsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Readme the readme property +// returns a *ItemItemReadmeRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Readme()(*ItemItemReadmeRequestBuilder) { + return NewItemItemReadmeRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Releases the releases property +// returns a *ItemItemReleasesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Releases()(*ItemItemReleasesRequestBuilder) { + return NewItemItemReleasesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rules the rules property +// returns a *ItemItemRulesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Rules()(*ItemItemRulesRequestBuilder) { + return NewItemItemRulesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rulesets the rulesets property +// returns a *ItemItemRulesetsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Rulesets()(*ItemItemRulesetsRequestBuilder) { + return NewItemItemRulesetsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SecretScanning the secretScanning property +// returns a *ItemItemSecretScanningRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) SecretScanning()(*ItemItemSecretScanningRequestBuilder) { + return NewItemItemSecretScanningRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SecurityAdvisories the securityAdvisories property +// returns a *ItemItemSecurityAdvisoriesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) SecurityAdvisories()(*ItemItemSecurityAdvisoriesRequestBuilder) { + return NewItemItemSecurityAdvisoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Stargazers the stargazers property +// returns a *ItemItemStargazersRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Stargazers()(*ItemItemStargazersRequestBuilder) { + return NewItemItemStargazersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Stats the stats property +// returns a *ItemItemStatsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Stats()(*ItemItemStatsRequestBuilder) { + return NewItemItemStatsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Statuses the statuses property +// returns a *ItemItemStatusesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Statuses()(*ItemItemStatusesRequestBuilder) { + return NewItemItemStatusesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Subscribers the subscribers property +// returns a *ItemItemSubscribersRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Subscribers()(*ItemItemSubscribersRequestBuilder) { + return NewItemItemSubscribersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Subscription the subscription property +// returns a *ItemItemSubscriptionRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Subscription()(*ItemItemSubscriptionRequestBuilder) { + return NewItemItemSubscriptionRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Tags the tags property +// returns a *ItemItemTagsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Tags()(*ItemItemTagsRequestBuilder) { + return NewItemItemTagsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Tarball the tarball property +// returns a *ItemItemTarballRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Tarball()(*ItemItemTarballRequestBuilder) { + return NewItemItemTarballRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Teams the teams property +// returns a *ItemItemTeamsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Teams()(*ItemItemTeamsRequestBuilder) { + return NewItemItemTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deleting a repository requires admin access.If an organization owner has configured the organization to prevent members from deleting organization-ownedrepositories, you will get a `403 Forbidden` response.OAuth app tokens and personal access tokens (classic) need the `delete_repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemRepoItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation the `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network.**Note:** In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." +// returns a *RequestInformation when successful +func (m *ItemRepoItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/repos/repos#replace-all-repository-topics) endpoint. +// returns a *RequestInformation when successful +func (m *ItemRepoItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemRepoPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// Topics the topics property +// returns a *ItemItemTopicsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Topics()(*ItemItemTopicsRequestBuilder) { + return NewItemItemTopicsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Traffic the traffic property +// returns a *ItemItemTrafficRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Traffic()(*ItemItemTrafficRequestBuilder) { + return NewItemItemTrafficRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Transfer the transfer property +// returns a *ItemItemTransferRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Transfer()(*ItemItemTransferRequestBuilder) { + return NewItemItemTransferRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// VulnerabilityAlerts the vulnerabilityAlerts property +// returns a *ItemItemVulnerabilityAlertsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) VulnerabilityAlerts()(*ItemItemVulnerabilityAlertsRequestBuilder) { + return NewItemItemVulnerabilityAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemRepoItemRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) WithUrl(rawUrl string)(*ItemRepoItemRequestBuilder) { + return NewItemRepoItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} +// Zipball the zipball property +// returns a *ItemItemZipballRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Zipball()(*ItemItemZipballRequestBuilder) { + return NewItemItemZipballRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_with_repo_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_with_repo_item_request_builder.go new file mode 100644 index 000000000..bcc9d5890 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/item_with_repo_item_request_builder.go @@ -0,0 +1,408 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemWithRepoItemRequestBuilder builds and executes requests for operations under \repos\{repos-id}\{Owner-id} +type ItemWithRepoItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemWithRepoItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemWithRepoItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} +// ItemWithRepoItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemWithRepoItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} +// ItemWithRepoItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemWithRepoItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} +// Actions the actions property +func (m *ItemWithRepoItemRequestBuilder) Actions()(*ItemItemActionsRequestBuilder) { + return NewItemItemActionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Activity the activity property +func (m *ItemWithRepoItemRequestBuilder) Activity()(*ItemItemActivityRequestBuilder) { + return NewItemItemActivityRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Assignees the assignees property +func (m *ItemWithRepoItemRequestBuilder) Assignees()(*ItemItemAssigneesRequestBuilder) { + return NewItemItemAssigneesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Autolinks the autolinks property +func (m *ItemWithRepoItemRequestBuilder) Autolinks()(*ItemItemAutolinksRequestBuilder) { + return NewItemItemAutolinksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// AutomatedSecurityFixes the automatedSecurityFixes property +func (m *ItemWithRepoItemRequestBuilder) AutomatedSecurityFixes()(*ItemItemAutomatedSecurityFixesRequestBuilder) { + return NewItemItemAutomatedSecurityFixesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Branches the branches property +func (m *ItemWithRepoItemRequestBuilder) Branches()(*ItemItemBranchesRequestBuilder) { + return NewItemItemBranchesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CheckRuns the checkRuns property +func (m *ItemWithRepoItemRequestBuilder) CheckRuns()(*ItemItemCheckRunsRequestBuilder) { + return NewItemItemCheckRunsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CheckSuites the checkSuites property +func (m *ItemWithRepoItemRequestBuilder) CheckSuites()(*ItemItemCheckSuitesRequestBuilder) { + return NewItemItemCheckSuitesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Codeowners the codeowners property +func (m *ItemWithRepoItemRequestBuilder) Codeowners()(*ItemItemCodeownersRequestBuilder) { + return NewItemItemCodeownersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CodeScanning the codeScanning property +func (m *ItemWithRepoItemRequestBuilder) CodeScanning()(*ItemItemCodeScanningRequestBuilder) { + return NewItemItemCodeScanningRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Codespaces the codespaces property +func (m *ItemWithRepoItemRequestBuilder) Codespaces()(*ItemItemCodespacesRequestBuilder) { + return NewItemItemCodespacesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Collaborators the collaborators property +func (m *ItemWithRepoItemRequestBuilder) Collaborators()(*ItemItemCollaboratorsRequestBuilder) { + return NewItemItemCollaboratorsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +func (m *ItemWithRepoItemRequestBuilder) Comments()(*ItemItemCommentsRequestBuilder) { + return NewItemItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Commits the commits property +func (m *ItemWithRepoItemRequestBuilder) Commits()(*ItemItemCommitsRequestBuilder) { + return NewItemItemCommitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Community the community property +func (m *ItemWithRepoItemRequestBuilder) Community()(*ItemItemCommunityRequestBuilder) { + return NewItemItemCommunityRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Compare the compare property +func (m *ItemWithRepoItemRequestBuilder) Compare()(*ItemItemCompareRequestBuilder) { + return NewItemItemCompareRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemWithRepoItemRequestBuilderInternal instantiates a new WithRepoItemRequestBuilder and sets the default values. +func NewItemWithRepoItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWithRepoItemRequestBuilder) { + m := &ItemWithRepoItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{repos%2Did}/{Owner%2Did}", pathParameters), + } + return m +} +// NewItemWithRepoItemRequestBuilder instantiates a new WithRepoItemRequestBuilder and sets the default values. +func NewItemWithRepoItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWithRepoItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemWithRepoItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Contents the contents property +func (m *ItemWithRepoItemRequestBuilder) Contents()(*ItemItemContentsRequestBuilder) { + return NewItemItemContentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Contributors the contributors property +func (m *ItemWithRepoItemRequestBuilder) Contributors()(*ItemItemContributorsRequestBuilder) { + return NewItemItemContributorsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Delete deleting a repository requires admin access. If OAuth is used, the `delete_repo` scope is required.If an organization owner has configured the organization to prevent members from deleting organization-ownedrepositories, you will get a `403 Forbidden` response. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#delete-a-repository +func (m *ItemWithRepoItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemWithRepoItemRequestBuilderDeleteRequestConfiguration)(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": CreateItemItemWithRepo403ErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Dependabot the dependabot property +func (m *ItemWithRepoItemRequestBuilder) Dependabot()(*ItemItemDependabotRequestBuilder) { + return NewItemItemDependabotRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// DependencyGraph the dependencyGraph property +func (m *ItemWithRepoItemRequestBuilder) DependencyGraph()(*ItemItemDependencyGraphRequestBuilder) { + return NewItemItemDependencyGraphRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Deployments the deployments property +func (m *ItemWithRepoItemRequestBuilder) Deployments()(*ItemItemDeploymentsRequestBuilder) { + return NewItemItemDeploymentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Dispatches the dispatches property +func (m *ItemWithRepoItemRequestBuilder) Dispatches()(*ItemItemDispatchesRequestBuilder) { + return NewItemItemDispatchesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Environments the environments property +func (m *ItemWithRepoItemRequestBuilder) Environments()(*ItemItemEnvironmentsRequestBuilder) { + return NewItemItemEnvironmentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Events the events property +func (m *ItemWithRepoItemRequestBuilder) Events()(*ItemItemEventsRequestBuilder) { + return NewItemItemEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Forks the forks property +func (m *ItemWithRepoItemRequestBuilder) Forks()(*ItemItemForksRequestBuilder) { + return NewItemItemForksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Generate the generate property +func (m *ItemWithRepoItemRequestBuilder) Generate()(*ItemItemGenerateRequestBuilder) { + return NewItemItemGenerateRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get the `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network.**Note:** In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#get-a-repository +func (m *ItemWithRepoItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemWithRepoItemRequestBuilderGetRequestConfiguration)(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateFullRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable), nil +} +// Git the git property +func (m *ItemWithRepoItemRequestBuilder) Git()(*ItemItemGitRequestBuilder) { + return NewItemItemGitRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Hooks the hooks property +func (m *ItemWithRepoItemRequestBuilder) Hooks()(*ItemItemHooksRequestBuilder) { + return NewItemItemHooksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ImportEscaped the import property +func (m *ItemWithRepoItemRequestBuilder) ImportEscaped()(*ItemItemImportRequestBuilder) { + return NewItemItemImportRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Installation the installation property +func (m *ItemWithRepoItemRequestBuilder) Installation()(*ItemItemInstallationRequestBuilder) { + return NewItemItemInstallationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// InteractionLimits the interactionLimits property +func (m *ItemWithRepoItemRequestBuilder) InteractionLimits()(*ItemItemInteractionLimitsRequestBuilder) { + return NewItemItemInteractionLimitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Invitations the invitations property +func (m *ItemWithRepoItemRequestBuilder) Invitations()(*ItemItemInvitationsRequestBuilder) { + return NewItemItemInvitationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Issues the issues property +func (m *ItemWithRepoItemRequestBuilder) Issues()(*ItemItemIssuesRequestBuilder) { + return NewItemItemIssuesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Keys the keys property +func (m *ItemWithRepoItemRequestBuilder) Keys()(*ItemItemKeysRequestBuilder) { + return NewItemItemKeysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Labels the labels property +func (m *ItemWithRepoItemRequestBuilder) Labels()(*ItemItemLabelsRequestBuilder) { + return NewItemItemLabelsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Languages the languages property +func (m *ItemWithRepoItemRequestBuilder) Languages()(*ItemItemLanguagesRequestBuilder) { + return NewItemItemLanguagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// License the license property +func (m *ItemWithRepoItemRequestBuilder) License()(*ItemItemLicenseRequestBuilder) { + return NewItemItemLicenseRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Merges the merges property +func (m *ItemWithRepoItemRequestBuilder) Merges()(*ItemItemMergesRequestBuilder) { + return NewItemItemMergesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// MergeUpstream the mergeUpstream property +func (m *ItemWithRepoItemRequestBuilder) MergeUpstream()(*ItemItemMergeUpstreamRequestBuilder) { + return NewItemItemMergeUpstreamRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Milestones the milestones property +func (m *ItemWithRepoItemRequestBuilder) Milestones()(*ItemItemMilestonesRequestBuilder) { + return NewItemItemMilestonesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Notifications the notifications property +func (m *ItemWithRepoItemRequestBuilder) Notifications()(*ItemItemNotificationsRequestBuilder) { + return NewItemItemNotificationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Pages the pages property +func (m *ItemWithRepoItemRequestBuilder) Pages()(*ItemItemPagesRequestBuilder) { + return NewItemItemPagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/repos/repos#replace-all-repository-topics) endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#update-a-repository +func (m *ItemWithRepoItemRequestBuilder) Patch(ctx context.Context, body ItemItemWithRepoPatchRequestBodyable, requestConfiguration *ItemWithRepoItemRequestBuilderPatchRequestConfiguration)(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateFullRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable), nil +} +// PrivateVulnerabilityReporting the privateVulnerabilityReporting property +func (m *ItemWithRepoItemRequestBuilder) PrivateVulnerabilityReporting()(*ItemItemPrivateVulnerabilityReportingRequestBuilder) { + return NewItemItemPrivateVulnerabilityReportingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Projects the projects property +func (m *ItemWithRepoItemRequestBuilder) Projects()(*ItemItemProjectsRequestBuilder) { + return NewItemItemProjectsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Properties the properties property +func (m *ItemWithRepoItemRequestBuilder) Properties()(*ItemItemPropertiesRequestBuilder) { + return NewItemItemPropertiesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Pulls the pulls property +func (m *ItemWithRepoItemRequestBuilder) Pulls()(*ItemItemPullsRequestBuilder) { + return NewItemItemPullsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Readme the readme property +func (m *ItemWithRepoItemRequestBuilder) Readme()(*ItemItemReadmeRequestBuilder) { + return NewItemItemReadmeRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Releases the releases property +func (m *ItemWithRepoItemRequestBuilder) Releases()(*ItemItemReleasesRequestBuilder) { + return NewItemItemReleasesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rules the rules property +func (m *ItemWithRepoItemRequestBuilder) Rules()(*ItemItemRulesRequestBuilder) { + return NewItemItemRulesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rulesets the rulesets property +func (m *ItemWithRepoItemRequestBuilder) Rulesets()(*ItemItemRulesetsRequestBuilder) { + return NewItemItemRulesetsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SecretScanning the secretScanning property +func (m *ItemWithRepoItemRequestBuilder) SecretScanning()(*ItemItemSecretScanningRequestBuilder) { + return NewItemItemSecretScanningRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SecurityAdvisories the securityAdvisories property +func (m *ItemWithRepoItemRequestBuilder) SecurityAdvisories()(*ItemItemSecurityAdvisoriesRequestBuilder) { + return NewItemItemSecurityAdvisoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Stargazers the stargazers property +func (m *ItemWithRepoItemRequestBuilder) Stargazers()(*ItemItemStargazersRequestBuilder) { + return NewItemItemStargazersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Stats the stats property +func (m *ItemWithRepoItemRequestBuilder) Stats()(*ItemItemStatsRequestBuilder) { + return NewItemItemStatsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Statuses the statuses property +func (m *ItemWithRepoItemRequestBuilder) Statuses()(*ItemItemStatusesRequestBuilder) { + return NewItemItemStatusesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Subscribers the subscribers property +func (m *ItemWithRepoItemRequestBuilder) Subscribers()(*ItemItemSubscribersRequestBuilder) { + return NewItemItemSubscribersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Subscription the subscription property +func (m *ItemWithRepoItemRequestBuilder) Subscription()(*ItemItemSubscriptionRequestBuilder) { + return NewItemItemSubscriptionRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Tags the tags property +func (m *ItemWithRepoItemRequestBuilder) Tags()(*ItemItemTagsRequestBuilder) { + return NewItemItemTagsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Tarball the tarball property +func (m *ItemWithRepoItemRequestBuilder) Tarball()(*ItemItemTarballRequestBuilder) { + return NewItemItemTarballRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Teams the teams property +func (m *ItemWithRepoItemRequestBuilder) Teams()(*ItemItemTeamsRequestBuilder) { + return NewItemItemTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deleting a repository requires admin access. If OAuth is used, the `delete_repo` scope is required.If an organization owner has configured the organization to prevent members from deleting organization-ownedrepositories, you will get a `403 Forbidden` response. +func (m *ItemWithRepoItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemWithRepoItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation the `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network.**Note:** In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." +func (m *ItemWithRepoItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemWithRepoItemRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/repos/repos#replace-all-repository-topics) endpoint. +func (m *ItemWithRepoItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemWithRepoPatchRequestBodyable, requestConfiguration *ItemWithRepoItemRequestBuilderPatchRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// Topics the topics property +func (m *ItemWithRepoItemRequestBuilder) Topics()(*ItemItemTopicsRequestBuilder) { + return NewItemItemTopicsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Traffic the traffic property +func (m *ItemWithRepoItemRequestBuilder) Traffic()(*ItemItemTrafficRequestBuilder) { + return NewItemItemTrafficRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Transfer the transfer property +func (m *ItemWithRepoItemRequestBuilder) Transfer()(*ItemItemTransferRequestBuilder) { + return NewItemItemTransferRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// VulnerabilityAlerts the vulnerabilityAlerts property +func (m *ItemWithRepoItemRequestBuilder) VulnerabilityAlerts()(*ItemItemVulnerabilityAlertsRequestBuilder) { + return NewItemItemVulnerabilityAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +func (m *ItemWithRepoItemRequestBuilder) WithUrl(rawUrl string)(*ItemWithRepoItemRequestBuilder) { + return NewItemWithRepoItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} +// Zipball the zipball property +func (m *ItemWithRepoItemRequestBuilder) Zipball()(*ItemItemZipballRequestBuilder) { + return NewItemItemZipballRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/owner_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/owner_item_request_builder.go new file mode 100644 index 000000000..b07e4f245 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/owner_item_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// OwnerItemRequestBuilder builds and executes requests for operations under \repos\{owner-id} +type OwnerItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRepoId gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item.item collection +// returns a *ItemRepoItemRequestBuilder when successful +func (m *OwnerItemRequestBuilder) ByRepoId(repoId string)(*ItemRepoItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if repoId != "" { + urlTplParams["repo%2Did"] = repoId + } + return NewItemRepoItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewOwnerItemRequestBuilderInternal instantiates a new OwnerItemRequestBuilder and sets the default values. +func NewOwnerItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OwnerItemRequestBuilder) { + m := &OwnerItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}", pathParameters), + } + return m +} +// NewOwnerItemRequestBuilder instantiates a new OwnerItemRequestBuilder and sets the default values. +func NewOwnerItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OwnerItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewOwnerItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/repos_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/repos_item_request_builder.go new file mode 100644 index 000000000..8f1d720f0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/repos_item_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ReposItemRequestBuilder builds and executes requests for operations under \repos\{repos-id} +type ReposItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByOwnerId gets an item from the github.com/octokit/go-sdk/pkg/github/.repos.item.item collection +// returns a *ItemOwnerItemRequestBuilder when successful +func (m *ReposItemRequestBuilder) ByOwnerId(ownerId string)(*ItemOwnerItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if ownerId != "" { + urlTplParams["Owner%2Did"] = ownerId + } + return NewItemOwnerItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewReposItemRequestBuilderInternal instantiates a new ReposItemRequestBuilder and sets the default values. +func NewReposItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ReposItemRequestBuilder) { + m := &ReposItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{repos%2Did}", pathParameters), + } + return m +} +// NewReposItemRequestBuilder instantiates a new ReposItemRequestBuilder and sets the default values. +func NewReposItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ReposItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewReposItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/repos_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/repos_request_builder.go new file mode 100644 index 000000000..c53f9541c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/repos_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ReposRequestBuilder builds and executes requests for operations under \repos +type ReposRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByOwnerId gets an item from the github.com/octokit/go-sdk/pkg/github.repos.item collection +// returns a *OwnerItemRequestBuilder when successful +func (m *ReposRequestBuilder) ByOwnerId(ownerId string)(*OwnerItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if ownerId != "" { + urlTplParams["owner%2Did"] = ownerId + } + return NewOwnerItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewReposRequestBuilderInternal instantiates a new ReposRequestBuilder and sets the default values. +func NewReposRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ReposRequestBuilder) { + m := &ReposRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos", pathParameters), + } + return m +} +// NewReposRequestBuilder instantiates a new ReposRequestBuilder and sets the default values. +func NewReposRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ReposRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewReposRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repos/with_owner_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repos/with_owner_item_request_builder.go new file mode 100644 index 000000000..97577d7fd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repos/with_owner_item_request_builder.go @@ -0,0 +1,34 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// WithOwnerItemRequestBuilder builds and executes requests for operations under \repos\{repos-id} +type WithOwnerItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRepo gets an item from the github.com/octokit/go-sdk/pkg/github/.repos.item.item collection +func (m *WithOwnerItemRequestBuilder) ByRepo(repo string)(*ItemWithRepoItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if repo != "" { + urlTplParams["repo"] = repo + } + return NewItemWithRepoItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewWithOwnerItemRequestBuilderInternal instantiates a new WithOwnerItemRequestBuilder and sets the default values. +func NewWithOwnerItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithOwnerItemRequestBuilder) { + m := &WithOwnerItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{repos%2Did}", pathParameters), + } + return m +} +// NewWithOwnerItemRequestBuilder instantiates a new WithOwnerItemRequestBuilder and sets the default values. +func NewWithOwnerItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithOwnerItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithOwnerItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_get_response.go new file mode 100644 index 000000000..5498f79a7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_get_response.go @@ -0,0 +1,122 @@ +package repositories + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemEnvironmentsItemSecretsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The secrets property + secrets []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable + // The total_count property + total_count *int32 +} +// NewItemEnvironmentsItemSecretsGetResponse instantiates a new ItemEnvironmentsItemSecretsGetResponse and sets the default values. +func NewItemEnvironmentsItemSecretsGetResponse()(*ItemEnvironmentsItemSecretsGetResponse) { + m := &ItemEnvironmentsItemSecretsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemEnvironmentsItemSecretsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemEnvironmentsItemSecretsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemEnvironmentsItemSecretsGetResponse(), 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 *ItemEnvironmentsItemSecretsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemEnvironmentsItemSecretsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsSecretFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable) + } + } + m.SetSecrets(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetSecrets gets the secrets property value. The secrets property +// returns a []ActionsSecretable when successful +func (m *ItemEnvironmentsItemSecretsGetResponse) GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable) { + return m.secrets +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemEnvironmentsItemSecretsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemEnvironmentsItemSecretsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecrets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSecrets())) + for i, v := range m.GetSecrets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("secrets", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemEnvironmentsItemSecretsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSecrets sets the secrets property value. The secrets property +func (m *ItemEnvironmentsItemSecretsGetResponse) SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable)() { + m.secrets = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemEnvironmentsItemSecretsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemEnvironmentsItemSecretsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable) + GetTotalCount()(*int32) + SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_item_with_secret_name_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_item_with_secret_name_put_request_body.go new file mode 100644 index 000000000..58e847229 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_item_with_secret_name_put_request_body.go @@ -0,0 +1,109 @@ +package repositories + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an environment public key](https://docs.github.com/rest/actions/secrets#get-an-environment-public-key) endpoint. + encrypted_value *string + // ID of the key you used to encrypt the secret. + key_id *string +} +// NewItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody instantiates a new ItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody and sets the default values. +func NewItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody()(*ItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) { + m := &ItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncryptedValue gets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an environment public key](https://docs.github.com/rest/actions/secrets#get-an-environment-public-key) endpoint. +// returns a *string when successful +func (m *ItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) GetEncryptedValue()(*string) { + return m.encrypted_value +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["encrypted_value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncryptedValue(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + return res +} +// GetKeyId gets the key_id property value. ID of the key you used to encrypt the secret. +// returns a *string when successful +func (m *ItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) GetKeyId()(*string) { + return m.key_id +} +// Serialize serializes information the current object +func (m *ItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("encrypted_value", m.GetEncryptedValue()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncryptedValue sets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an environment public key](https://docs.github.com/rest/actions/secrets#get-an-environment-public-key) endpoint. +func (m *ItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) SetEncryptedValue(value *string)() { + m.encrypted_value = value +} +// SetKeyId sets the key_id property value. ID of the key you used to encrypt the secret. +func (m *ItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) SetKeyId(value *string)() { + m.key_id = value +} +type ItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncryptedValue()(*string) + GetKeyId()(*string) + SetEncryptedValue(value *string)() + SetKeyId(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_public_key_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_public_key_request_builder.go new file mode 100644 index 000000000..3cb9c993c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_public_key_request_builder.go @@ -0,0 +1,57 @@ +package repositories + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemEnvironmentsItemSecretsPublicKeyRequestBuilder builds and executes requests for operations under \repositories\{repository_id}\environments\{environment_name}\secrets\public-key +type ItemEnvironmentsItemSecretsPublicKeyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemEnvironmentsItemSecretsPublicKeyRequestBuilderInternal instantiates a new ItemEnvironmentsItemSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemEnvironmentsItemSecretsPublicKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEnvironmentsItemSecretsPublicKeyRequestBuilder) { + m := &ItemEnvironmentsItemSecretsPublicKeyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repositories/{repository_id}/environments/{environment_name}/secrets/public-key", pathParameters), + } + return m +} +// NewItemEnvironmentsItemSecretsPublicKeyRequestBuilder instantiates a new ItemEnvironmentsItemSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemEnvironmentsItemSecretsPublicKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEnvironmentsItemSecretsPublicKeyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemEnvironmentsItemSecretsPublicKeyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get the public key for an environment, which you need to encrypt environmentsecrets. You need to encrypt a secret before you can create or update secrets.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsPublicKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key +func (m *ItemEnvironmentsItemSecretsPublicKeyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsPublicKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsPublicKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsPublicKeyable), nil +} +// ToGetRequestInformation get the public key for an environment, which you need to encrypt environmentsecrets. You need to encrypt a secret before you can create or update secrets.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemEnvironmentsItemSecretsPublicKeyRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemEnvironmentsItemSecretsPublicKeyRequestBuilder when successful +func (m *ItemEnvironmentsItemSecretsPublicKeyRequestBuilder) WithUrl(rawUrl string)(*ItemEnvironmentsItemSecretsPublicKeyRequestBuilder) { + return NewItemEnvironmentsItemSecretsPublicKeyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_request_builder.go new file mode 100644 index 000000000..38d1210e6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_request_builder.go @@ -0,0 +1,80 @@ +package repositories + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemEnvironmentsItemSecretsRequestBuilder builds and executes requests for operations under \repositories\{repository_id}\environments\{environment_name}\secrets +type ItemEnvironmentsItemSecretsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemEnvironmentsItemSecretsRequestBuilderGetQueryParameters lists all secrets available in an environment without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemEnvironmentsItemSecretsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// BySecret_name gets an item from the github.com/octokit/go-sdk/pkg/github/.repositories.item.environments.item.secrets.item collection +// returns a *ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemEnvironmentsItemSecretsRequestBuilder) BySecret_name(secret_name string)(*ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if secret_name != "" { + urlTplParams["secret_name"] = secret_name + } + return NewItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemEnvironmentsItemSecretsRequestBuilderInternal instantiates a new ItemEnvironmentsItemSecretsRequestBuilder and sets the default values. +func NewItemEnvironmentsItemSecretsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEnvironmentsItemSecretsRequestBuilder) { + m := &ItemEnvironmentsItemSecretsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repositories/{repository_id}/environments/{environment_name}/secrets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemEnvironmentsItemSecretsRequestBuilder instantiates a new ItemEnvironmentsItemSecretsRequestBuilder and sets the default values. +func NewItemEnvironmentsItemSecretsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEnvironmentsItemSecretsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemEnvironmentsItemSecretsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all secrets available in an environment without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemEnvironmentsItemSecretsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#list-environment-secrets +func (m *ItemEnvironmentsItemSecretsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEnvironmentsItemSecretsRequestBuilderGetQueryParameters])(ItemEnvironmentsItemSecretsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemEnvironmentsItemSecretsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemEnvironmentsItemSecretsGetResponseable), nil +} +// PublicKey the publicKey property +// returns a *ItemEnvironmentsItemSecretsPublicKeyRequestBuilder when successful +func (m *ItemEnvironmentsItemSecretsRequestBuilder) PublicKey()(*ItemEnvironmentsItemSecretsPublicKeyRequestBuilder) { + return NewItemEnvironmentsItemSecretsPublicKeyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all secrets available in an environment without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemEnvironmentsItemSecretsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEnvironmentsItemSecretsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemEnvironmentsItemSecretsRequestBuilder when successful +func (m *ItemEnvironmentsItemSecretsRequestBuilder) WithUrl(rawUrl string)(*ItemEnvironmentsItemSecretsRequestBuilder) { + return NewItemEnvironmentsItemSecretsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_response.go new file mode 100644 index 000000000..4bbc2f586 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_response.go @@ -0,0 +1,28 @@ +package repositories + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemEnvironmentsItemSecretsResponse +// Deprecated: This class is obsolete. Use secretsGetResponse instead. +type ItemEnvironmentsItemSecretsResponse struct { + ItemEnvironmentsItemSecretsGetResponse +} +// NewItemEnvironmentsItemSecretsResponse instantiates a new ItemEnvironmentsItemSecretsResponse and sets the default values. +func NewItemEnvironmentsItemSecretsResponse()(*ItemEnvironmentsItemSecretsResponse) { + m := &ItemEnvironmentsItemSecretsResponse{ + ItemEnvironmentsItemSecretsGetResponse: *NewItemEnvironmentsItemSecretsGetResponse(), + } + return m +} +// CreateItemEnvironmentsItemSecretsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemEnvironmentsItemSecretsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemEnvironmentsItemSecretsResponse(), nil +} +// ItemEnvironmentsItemSecretsResponseable +// Deprecated: This class is obsolete. Use secretsGetResponse instead. +type ItemEnvironmentsItemSecretsResponseable interface { + ItemEnvironmentsItemSecretsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_with_secret_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_with_secret_name_item_request_builder.go new file mode 100644 index 000000000..e3c820787 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_secrets_with_secret_name_item_request_builder.go @@ -0,0 +1,110 @@ +package repositories + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder builds and executes requests for operations under \repositories\{repository_id}\environments\{environment_name}\secrets\{secret_name} +type ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilderInternal instantiates a new ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) { + m := &ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}", pathParameters), + } + return m +} +// NewItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder instantiates a new ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a secret in an environment using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret +func (m *ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a single environment secret without revealing its encrypted value.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsSecretable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#get-an-environment-secret +func (m *ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsSecretFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsSecretable), nil +} +// Put creates or updates an environment secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret +func (m *ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) Put(ctx context.Context, body ItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToDeleteRequestInformation deletes a secret in an environment using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a single environment secret without revealing its encrypted value.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation creates or updates an environment secret with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) { + return NewItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_get_response.go new file mode 100644 index 000000000..79f395ea5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_get_response.go @@ -0,0 +1,122 @@ +package repositories + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemEnvironmentsItemVariablesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The total_count property + total_count *int32 + // The variables property + variables []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable +} +// NewItemEnvironmentsItemVariablesGetResponse instantiates a new ItemEnvironmentsItemVariablesGetResponse and sets the default values. +func NewItemEnvironmentsItemVariablesGetResponse()(*ItemEnvironmentsItemVariablesGetResponse) { + m := &ItemEnvironmentsItemVariablesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemEnvironmentsItemVariablesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemEnvironmentsItemVariablesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemEnvironmentsItemVariablesGetResponse(), 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 *ItemEnvironmentsItemVariablesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemEnvironmentsItemVariablesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + res["variables"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsVariableFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable) + } + } + m.SetVariables(res) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemEnvironmentsItemVariablesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// GetVariables gets the variables property value. The variables property +// returns a []ActionsVariableable when successful +func (m *ItemEnvironmentsItemVariablesGetResponse) GetVariables()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable) { + return m.variables +} +// Serialize serializes information the current object +func (m *ItemEnvironmentsItemVariablesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + if m.GetVariables() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVariables())) + for i, v := range m.GetVariables() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("variables", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemEnvironmentsItemVariablesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemEnvironmentsItemVariablesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetVariables sets the variables property value. The variables property +func (m *ItemEnvironmentsItemVariablesGetResponse) SetVariables(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable)() { + m.variables = value +} +type ItemEnvironmentsItemVariablesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalCount()(*int32) + GetVariables()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable) + SetTotalCount(value *int32)() + SetVariables(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_item_with_name_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_item_with_name_patch_request_body.go new file mode 100644 index 000000000..62b242bae --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_item_with_name_patch_request_body.go @@ -0,0 +1,109 @@ +package repositories + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemEnvironmentsItemVariablesItemWithNamePatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name of the variable. + name *string + // The value of the variable. + value *string +} +// NewItemEnvironmentsItemVariablesItemWithNamePatchRequestBody instantiates a new ItemEnvironmentsItemVariablesItemWithNamePatchRequestBody and sets the default values. +func NewItemEnvironmentsItemVariablesItemWithNamePatchRequestBody()(*ItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) { + m := &ItemEnvironmentsItemVariablesItemWithNamePatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemEnvironmentsItemVariablesItemWithNamePatchRequestBody(), 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 *ItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) GetName()(*string) { + return m.name +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name of the variable. +func (m *ItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) SetValue(value *string)() { + m.value = value +} +type ItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetValue()(*string) + SetName(value *string)() + SetValue(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_post_request_body.go new file mode 100644 index 000000000..121dc7a42 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_post_request_body.go @@ -0,0 +1,109 @@ +package repositories + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemEnvironmentsItemVariablesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The name of the variable. + name *string + // The value of the variable. + value *string +} +// NewItemEnvironmentsItemVariablesPostRequestBody instantiates a new ItemEnvironmentsItemVariablesPostRequestBody and sets the default values. +func NewItemEnvironmentsItemVariablesPostRequestBody()(*ItemEnvironmentsItemVariablesPostRequestBody) { + m := &ItemEnvironmentsItemVariablesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemEnvironmentsItemVariablesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemEnvironmentsItemVariablesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemEnvironmentsItemVariablesPostRequestBody(), 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 *ItemEnvironmentsItemVariablesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemEnvironmentsItemVariablesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ItemEnvironmentsItemVariablesPostRequestBody) GetName()(*string) { + return m.name +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ItemEnvironmentsItemVariablesPostRequestBody) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ItemEnvironmentsItemVariablesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemEnvironmentsItemVariablesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name of the variable. +func (m *ItemEnvironmentsItemVariablesPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ItemEnvironmentsItemVariablesPostRequestBody) SetValue(value *string)() { + m.value = value +} +type ItemEnvironmentsItemVariablesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetValue()(*string) + SetName(value *string)() + SetValue(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_request_builder.go new file mode 100644 index 000000000..faf5905cd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_request_builder.go @@ -0,0 +1,107 @@ +package repositories + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemEnvironmentsItemVariablesRequestBuilder builds and executes requests for operations under \repositories\{repository_id}\environments\{environment_name}\variables +type ItemEnvironmentsItemVariablesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemEnvironmentsItemVariablesRequestBuilderGetQueryParameters lists all environment variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemEnvironmentsItemVariablesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 30). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByName gets an item from the github.com/octokit/go-sdk/pkg/github/.repositories.item.environments.item.variables.item collection +// returns a *ItemEnvironmentsItemVariablesWithNameItemRequestBuilder when successful +func (m *ItemEnvironmentsItemVariablesRequestBuilder) ByName(name string)(*ItemEnvironmentsItemVariablesWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewItemEnvironmentsItemVariablesWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemEnvironmentsItemVariablesRequestBuilderInternal instantiates a new ItemEnvironmentsItemVariablesRequestBuilder and sets the default values. +func NewItemEnvironmentsItemVariablesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEnvironmentsItemVariablesRequestBuilder) { + m := &ItemEnvironmentsItemVariablesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repositories/{repository_id}/environments/{environment_name}/variables{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemEnvironmentsItemVariablesRequestBuilder instantiates a new ItemEnvironmentsItemVariablesRequestBuilder and sets the default values. +func NewItemEnvironmentsItemVariablesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEnvironmentsItemVariablesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemEnvironmentsItemVariablesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all environment variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemEnvironmentsItemVariablesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#list-environment-variables +func (m *ItemEnvironmentsItemVariablesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEnvironmentsItemVariablesRequestBuilderGetQueryParameters])(ItemEnvironmentsItemVariablesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemEnvironmentsItemVariablesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemEnvironmentsItemVariablesGetResponseable), nil +} +// Post create an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#create-an-environment-variable +func (m *ItemEnvironmentsItemVariablesRequestBuilder) Post(ctx context.Context, body ItemEnvironmentsItemVariablesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// ToGetRequestInformation lists all environment variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemEnvironmentsItemVariablesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEnvironmentsItemVariablesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation create an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemEnvironmentsItemVariablesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemEnvironmentsItemVariablesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, "{+baseurl}/repositories/{repository_id}/environments/{environment_name}/variables", m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemEnvironmentsItemVariablesRequestBuilder when successful +func (m *ItemEnvironmentsItemVariablesRequestBuilder) WithUrl(rawUrl string)(*ItemEnvironmentsItemVariablesRequestBuilder) { + return NewItemEnvironmentsItemVariablesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_response.go new file mode 100644 index 000000000..f02f46c37 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_response.go @@ -0,0 +1,28 @@ +package repositories + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemEnvironmentsItemVariablesResponse +// Deprecated: This class is obsolete. Use variablesGetResponse instead. +type ItemEnvironmentsItemVariablesResponse struct { + ItemEnvironmentsItemVariablesGetResponse +} +// NewItemEnvironmentsItemVariablesResponse instantiates a new ItemEnvironmentsItemVariablesResponse and sets the default values. +func NewItemEnvironmentsItemVariablesResponse()(*ItemEnvironmentsItemVariablesResponse) { + m := &ItemEnvironmentsItemVariablesResponse{ + ItemEnvironmentsItemVariablesGetResponse: *NewItemEnvironmentsItemVariablesGetResponse(), + } + return m +} +// CreateItemEnvironmentsItemVariablesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateItemEnvironmentsItemVariablesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemEnvironmentsItemVariablesResponse(), nil +} +// ItemEnvironmentsItemVariablesResponseable +// Deprecated: This class is obsolete. Use variablesGetResponse instead. +type ItemEnvironmentsItemVariablesResponseable interface { + ItemEnvironmentsItemVariablesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_with_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_with_name_item_request_builder.go new file mode 100644 index 000000000..44e810bdf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_item_variables_with_name_item_request_builder.go @@ -0,0 +1,105 @@ +package repositories + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemEnvironmentsItemVariablesWithNameItemRequestBuilder builds and executes requests for operations under \repositories\{repository_id}\environments\{environment_name}\variables\{name} +type ItemEnvironmentsItemVariablesWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemEnvironmentsItemVariablesWithNameItemRequestBuilderInternal instantiates a new ItemEnvironmentsItemVariablesWithNameItemRequestBuilder and sets the default values. +func NewItemEnvironmentsItemVariablesWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEnvironmentsItemVariablesWithNameItemRequestBuilder) { + m := &ItemEnvironmentsItemVariablesWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repositories/{repository_id}/environments/{environment_name}/variables/{name}", pathParameters), + } + return m +} +// NewItemEnvironmentsItemVariablesWithNameItemRequestBuilder instantiates a new ItemEnvironmentsItemVariablesWithNameItemRequestBuilder and sets the default values. +func NewItemEnvironmentsItemVariablesWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEnvironmentsItemVariablesWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemEnvironmentsItemVariablesWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes an environment variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#delete-an-environment-variable +func (m *ItemEnvironmentsItemVariablesWithNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a specific variable in an environment.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsVariableable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#get-an-environment-variable +func (m *ItemEnvironmentsItemVariablesWithNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsVariableFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsVariableable), nil +} +// Patch updates an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/actions/variables#update-an-environment-variable +func (m *ItemEnvironmentsItemVariablesWithNameItemRequestBuilder) Patch(ctx context.Context, body ItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation deletes an environment variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemEnvironmentsItemVariablesWithNameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a specific variable in an environment.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemEnvironmentsItemVariablesWithNameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemEnvironmentsItemVariablesWithNameItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemEnvironmentsItemVariablesWithNameItemRequestBuilder when successful +func (m *ItemEnvironmentsItemVariablesWithNameItemRequestBuilder) WithUrl(rawUrl string)(*ItemEnvironmentsItemVariablesWithNameItemRequestBuilder) { + return NewItemEnvironmentsItemVariablesWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_request_builder.go new file mode 100644 index 000000000..d951708e4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_request_builder.go @@ -0,0 +1,35 @@ +package repositories + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemEnvironmentsRequestBuilder builds and executes requests for operations under \repositories\{repository_id}\environments +type ItemEnvironmentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByEnvironment_name gets an item from the github.com/octokit/go-sdk/pkg/github/.repositories.item.environments.item collection +// returns a *ItemEnvironmentsWithEnvironment_nameItemRequestBuilder when successful +func (m *ItemEnvironmentsRequestBuilder) ByEnvironment_name(environment_name string)(*ItemEnvironmentsWithEnvironment_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if environment_name != "" { + urlTplParams["environment_name"] = environment_name + } + return NewItemEnvironmentsWithEnvironment_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemEnvironmentsRequestBuilderInternal instantiates a new ItemEnvironmentsRequestBuilder and sets the default values. +func NewItemEnvironmentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEnvironmentsRequestBuilder) { + m := &ItemEnvironmentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repositories/{repository_id}/environments", pathParameters), + } + return m +} +// NewItemEnvironmentsRequestBuilder instantiates a new ItemEnvironmentsRequestBuilder and sets the default values. +func NewItemEnvironmentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEnvironmentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemEnvironmentsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_with_environment_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_with_environment_name_item_request_builder.go new file mode 100644 index 000000000..e8572a070 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/item_environments_with_environment_name_item_request_builder.go @@ -0,0 +1,33 @@ +package repositories + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemEnvironmentsWithEnvironment_nameItemRequestBuilder builds and executes requests for operations under \repositories\{repository_id}\environments\{environment_name} +type ItemEnvironmentsWithEnvironment_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemEnvironmentsWithEnvironment_nameItemRequestBuilderInternal instantiates a new ItemEnvironmentsWithEnvironment_nameItemRequestBuilder and sets the default values. +func NewItemEnvironmentsWithEnvironment_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEnvironmentsWithEnvironment_nameItemRequestBuilder) { + m := &ItemEnvironmentsWithEnvironment_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repositories/{repository_id}/environments/{environment_name}", pathParameters), + } + return m +} +// NewItemEnvironmentsWithEnvironment_nameItemRequestBuilder instantiates a new ItemEnvironmentsWithEnvironment_nameItemRequestBuilder and sets the default values. +func NewItemEnvironmentsWithEnvironment_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEnvironmentsWithEnvironment_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemEnvironmentsWithEnvironment_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Secrets the secrets property +// returns a *ItemEnvironmentsItemSecretsRequestBuilder when successful +func (m *ItemEnvironmentsWithEnvironment_nameItemRequestBuilder) Secrets()(*ItemEnvironmentsItemSecretsRequestBuilder) { + return NewItemEnvironmentsItemSecretsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Variables the variables property +// returns a *ItemEnvironmentsItemVariablesRequestBuilder when successful +func (m *ItemEnvironmentsWithEnvironment_nameItemRequestBuilder) Variables()(*ItemEnvironmentsItemVariablesRequestBuilder) { + return NewItemEnvironmentsItemVariablesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repositories/repositories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/repositories_request_builder.go new file mode 100644 index 000000000..44dd1655c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/repositories_request_builder.go @@ -0,0 +1,69 @@ +package repositories + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// RepositoriesRequestBuilder builds and executes requests for operations under \repositories +type RepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// RepositoriesRequestBuilderGetQueryParameters lists all public repositories in the order that they were created.Note:- For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise.- Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of repositories. +type RepositoriesRequestBuilderGetQueryParameters struct { + // A repository ID. Only return repositories with an ID greater than this ID. + Since *int32 `uriparametername:"since"` +} +// NewRepositoriesRequestBuilderInternal instantiates a new RepositoriesRequestBuilder and sets the default values. +func NewRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RepositoriesRequestBuilder) { + m := &RepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repositories{?since*}", pathParameters), + } + return m +} +// NewRepositoriesRequestBuilder instantiates a new RepositoriesRequestBuilder and sets the default values. +func NewRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all public repositories in the order that they were created.Note:- For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise.- Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of repositories. +// returns a []MinimalRepositoryable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#list-public-repositories +func (m *RepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[RepositoriesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists all public repositories in the order that they were created.Note:- For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise.- Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of repositories. +// returns a *RequestInformation when successful +func (m *RepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[RepositoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *RepositoriesRequestBuilder when successful +func (m *RepositoriesRequestBuilder) WithUrl(rawUrl string)(*RepositoriesRequestBuilder) { + return NewRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/repositories/with_repository_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/with_repository_item_request_builder.go new file mode 100644 index 000000000..519c9987c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/repositories/with_repository_item_request_builder.go @@ -0,0 +1,28 @@ +package repositories + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// WithRepository_ItemRequestBuilder builds and executes requests for operations under \repositories\{repository_id} +type WithRepository_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithRepository_ItemRequestBuilderInternal instantiates a new WithRepository_ItemRequestBuilder and sets the default values. +func NewWithRepository_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithRepository_ItemRequestBuilder) { + m := &WithRepository_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repositories/{repository_id}", pathParameters), + } + return m +} +// NewWithRepository_ItemRequestBuilder instantiates a new WithRepository_ItemRequestBuilder and sets the default values. +func NewWithRepository_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithRepository_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithRepository_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Environments the environments property +// returns a *ItemEnvironmentsRequestBuilder when successful +func (m *WithRepository_ItemRequestBuilder) Environments()(*ItemEnvironmentsRequestBuilder) { + return NewItemEnvironmentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/code/get_order_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/code/get_order_query_parameter_type.go new file mode 100644 index 000000000..d8bb79113 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/code/get_order_query_parameter_type.go @@ -0,0 +1,36 @@ +package code +import ( + "errors" +) +type GetOrderQueryParameterType int + +const ( + DESC_GETORDERQUERYPARAMETERTYPE GetOrderQueryParameterType = iota + ASC_GETORDERQUERYPARAMETERTYPE +) + +func (i GetOrderQueryParameterType) String() string { + return []string{"desc", "asc"}[i] +} +func ParseGetOrderQueryParameterType(v string) (any, error) { + result := DESC_GETORDERQUERYPARAMETERTYPE + switch v { + case "desc": + result = DESC_GETORDERQUERYPARAMETERTYPE + case "asc": + result = ASC_GETORDERQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetOrderQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetOrderQueryParameterType(values []GetOrderQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetOrderQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/code/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/code/get_sort_query_parameter_type.go new file mode 100644 index 000000000..0fa783689 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/code/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package code +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + INDEXED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota +) + +func (i GetSortQueryParameterType) String() string { + return []string{"indexed"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := INDEXED_GETSORTQUERYPARAMETERTYPE + switch v { + case "indexed": + result = INDEXED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/code_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/code_get_response.go new file mode 100644 index 000000000..e4406cd1f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/code_get_response.go @@ -0,0 +1,151 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type CodeGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The incomplete_results property + incomplete_results *bool + // The items property + items []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSearchResultItemable + // The total_count property + total_count *int32 +} +// NewCodeGetResponse instantiates a new CodeGetResponse and sets the default values. +func NewCodeGetResponse()(*CodeGetResponse) { + m := &CodeGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeGetResponse(), 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 *CodeGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["incomplete_results"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncompleteResults(val) + } + return nil + } + res["items"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeSearchResultItemFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSearchResultItemable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSearchResultItemable) + } + } + m.SetItems(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetIncompleteResults gets the incomplete_results property value. The incomplete_results property +// returns a *bool when successful +func (m *CodeGetResponse) GetIncompleteResults()(*bool) { + return m.incomplete_results +} +// GetItems gets the items property value. The items property +// returns a []CodeSearchResultItemable when successful +func (m *CodeGetResponse) GetItems()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSearchResultItemable) { + return m.items +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *CodeGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *CodeGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("incomplete_results", m.GetIncompleteResults()) + if err != nil { + return err + } + } + if m.GetItems() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItems())) + for i, v := range m.GetItems() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("items", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CodeGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncompleteResults sets the incomplete_results property value. The incomplete_results property +func (m *CodeGetResponse) SetIncompleteResults(value *bool)() { + m.incomplete_results = value +} +// SetItems sets the items property value. The items property +func (m *CodeGetResponse) SetItems(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSearchResultItemable)() { + m.items = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *CodeGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type CodeGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncompleteResults()(*bool) + GetItems()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSearchResultItemable) + GetTotalCount()(*int32) + SetIncompleteResults(value *bool)() + SetItems(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSearchResultItemable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/code_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/code_request_builder.go new file mode 100644 index 000000000..966428c0b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/code_request_builder.go @@ -0,0 +1,81 @@ +package search + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i077352aa902c51bfc500a83132f68b8da1051f8b770660094032b189b1a9f293 "github.com/octokit/go-sdk/pkg/github/search/code" +) + +// CodeRequestBuilder builds and executes requests for operations under \search\code +type CodeRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// CodeRequestBuilderGetQueryParameters searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to find the definition of the `addClass` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this:`q=addClass+in:file+language:js+repo:jquery/jquery`This query searches for the keyword `addClass` within a file's contents. The query limits the search to files where the language is JavaScript in the `jquery/jquery` repository.Considerations for code search:Due to the complexity of searching code, there are a few restrictions on how searches are performed:* Only the _default branch_ is considered. In most cases, this will be the `master` branch.* Only files smaller than 384 KB are searchable.* You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazinglanguage:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is.This endpoint requires you to authenticate and limits you to 10 requests per minute. +type CodeRequestBuilderGetQueryParameters struct { + // **This field is deprecated.** Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. + // Deprecated: + Order *i077352aa902c51bfc500a83132f68b8da1051f8b770660094032b189b1a9f293.GetOrderQueryParameterType `uriparametername:"order"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See "[Searching code](https://docs.github.com/search-github/searching-on-github/searching-code)" for a detailed list of qualifiers. + Q *string `uriparametername:"q"` + // **This field is deprecated.** Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) + // Deprecated: + Sort *i077352aa902c51bfc500a83132f68b8da1051f8b770660094032b189b1a9f293.GetSortQueryParameterType `uriparametername:"sort"` +} +// NewCodeRequestBuilderInternal instantiates a new CodeRequestBuilder and sets the default values. +func NewCodeRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodeRequestBuilder) { + m := &CodeRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/search/code?q={q}{&order*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewCodeRequestBuilder instantiates a new CodeRequestBuilder and sets the default values. +func NewCodeRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodeRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCodeRequestBuilderInternal(urlParams, requestAdapter) +} +// Get searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to find the definition of the `addClass` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this:`q=addClass+in:file+language:js+repo:jquery/jquery`This query searches for the keyword `addClass` within a file's contents. The query limits the search to files where the language is JavaScript in the `jquery/jquery` repository.Considerations for code search:Due to the complexity of searching code, there are a few restrictions on how searches are performed:* Only the _default branch_ is considered. In most cases, this will be the `master` branch.* Only files smaller than 384 KB are searchable.* You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazinglanguage:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is.This endpoint requires you to authenticate and limits you to 10 requests per minute. +// returns a CodeGetResponseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a Code503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/search/search#search-code +func (m *CodeRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[CodeRequestBuilderGetQueryParameters])(CodeGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCode503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateCodeGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(CodeGetResponseable), nil +} +// ToGetRequestInformation searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to find the definition of the `addClass` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this:`q=addClass+in:file+language:js+repo:jquery/jquery`This query searches for the keyword `addClass` within a file's contents. The query limits the search to files where the language is JavaScript in the `jquery/jquery` repository.Considerations for code search:Due to the complexity of searching code, there are a few restrictions on how searches are performed:* Only the _default branch_ is considered. In most cases, this will be the `master` branch.* Only files smaller than 384 KB are searchable.* You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazinglanguage:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is.This endpoint requires you to authenticate and limits you to 10 requests per minute. +// returns a *RequestInformation when successful +func (m *CodeRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[CodeRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *CodeRequestBuilder when successful +func (m *CodeRequestBuilder) WithUrl(rawUrl string)(*CodeRequestBuilder) { + return NewCodeRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/code_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/code_response.go new file mode 100644 index 000000000..ea556c63e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/code_response.go @@ -0,0 +1,28 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeResponse +// Deprecated: This class is obsolete. Use codeGetResponse instead. +type CodeResponse struct { + CodeGetResponse +} +// NewCodeResponse instantiates a new CodeResponse and sets the default values. +func NewCodeResponse()(*CodeResponse) { + m := &CodeResponse{ + CodeGetResponse: *NewCodeGetResponse(), + } + return m +} +// CreateCodeResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateCodeResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeResponse(), nil +} +// CodeResponseable +// Deprecated: This class is obsolete. Use codeGetResponse instead. +type CodeResponseable interface { + CodeGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/commits/get_order_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/commits/get_order_query_parameter_type.go new file mode 100644 index 000000000..be4e597e1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/commits/get_order_query_parameter_type.go @@ -0,0 +1,36 @@ +package commits +import ( + "errors" +) +type GetOrderQueryParameterType int + +const ( + DESC_GETORDERQUERYPARAMETERTYPE GetOrderQueryParameterType = iota + ASC_GETORDERQUERYPARAMETERTYPE +) + +func (i GetOrderQueryParameterType) String() string { + return []string{"desc", "asc"}[i] +} +func ParseGetOrderQueryParameterType(v string) (any, error) { + result := DESC_GETORDERQUERYPARAMETERTYPE + switch v { + case "desc": + result = DESC_GETORDERQUERYPARAMETERTYPE + case "asc": + result = ASC_GETORDERQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetOrderQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetOrderQueryParameterType(values []GetOrderQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetOrderQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/commits/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/commits/get_sort_query_parameter_type.go new file mode 100644 index 000000000..7126aa6ee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/commits/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package commits +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + AUTHORDATE_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + COMMITTERDATE_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"author-date", "committer-date"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := AUTHORDATE_GETSORTQUERYPARAMETERTYPE + switch v { + case "author-date": + result = AUTHORDATE_GETSORTQUERYPARAMETERTYPE + case "committer-date": + result = COMMITTERDATE_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/commits_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/commits_get_response.go new file mode 100644 index 000000000..5d0d854bc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/commits_get_response.go @@ -0,0 +1,151 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type CommitsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The incomplete_results property + incomplete_results *bool + // The items property + items []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitSearchResultItemable + // The total_count property + total_count *int32 +} +// NewCommitsGetResponse instantiates a new CommitsGetResponse and sets the default values. +func NewCommitsGetResponse()(*CommitsGetResponse) { + m := &CommitsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitsGetResponse(), 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 *CommitsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CommitsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["incomplete_results"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncompleteResults(val) + } + return nil + } + res["items"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCommitSearchResultItemFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitSearchResultItemable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitSearchResultItemable) + } + } + m.SetItems(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetIncompleteResults gets the incomplete_results property value. The incomplete_results property +// returns a *bool when successful +func (m *CommitsGetResponse) GetIncompleteResults()(*bool) { + return m.incomplete_results +} +// GetItems gets the items property value. The items property +// returns a []CommitSearchResultItemable when successful +func (m *CommitsGetResponse) GetItems()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitSearchResultItemable) { + return m.items +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *CommitsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *CommitsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("incomplete_results", m.GetIncompleteResults()) + if err != nil { + return err + } + } + if m.GetItems() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItems())) + for i, v := range m.GetItems() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("items", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CommitsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncompleteResults sets the incomplete_results property value. The incomplete_results property +func (m *CommitsGetResponse) SetIncompleteResults(value *bool)() { + m.incomplete_results = value +} +// SetItems sets the items property value. The items property +func (m *CommitsGetResponse) SetItems(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitSearchResultItemable)() { + m.items = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *CommitsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type CommitsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncompleteResults()(*bool) + GetItems()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitSearchResultItemable) + GetTotalCount()(*int32) + SetIncompleteResults(value *bool)() + SetItems(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CommitSearchResultItemable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/commits_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/commits_request_builder.go new file mode 100644 index 000000000..4ddb6dd2e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/commits_request_builder.go @@ -0,0 +1,70 @@ +package search + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i625e45c268d4ab4a42a97d02ce2d6719584691128398ca7ec6cca25ecc82eda8 "github.com/octokit/go-sdk/pkg/github/search/commits" +) + +// CommitsRequestBuilder builds and executes requests for operations under \search\commits +type CommitsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// CommitsRequestBuilderGetQueryParameters find commits via various criteria on the default branch (usually `main`). This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for commits, you can get text match metadata for the **message** field when you provide the `text-match` media type. For more details about how to receive highlighted search results, see [Text matchmetadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this:`q=repo:octocat/Spoon-Knife+css` +type CommitsRequestBuilderGetQueryParameters struct { + // Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. + Order *i625e45c268d4ab4a42a97d02ce2d6719584691128398ca7ec6cca25ecc82eda8.GetOrderQueryParameterType `uriparametername:"order"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See "[Searching commits](https://docs.github.com/search-github/searching-on-github/searching-commits)" for a detailed list of qualifiers. + Q *string `uriparametername:"q"` + // Sorts the results of your query by `author-date` or `committer-date`. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) + Sort *i625e45c268d4ab4a42a97d02ce2d6719584691128398ca7ec6cca25ecc82eda8.GetSortQueryParameterType `uriparametername:"sort"` +} +// NewCommitsRequestBuilderInternal instantiates a new CommitsRequestBuilder and sets the default values. +func NewCommitsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CommitsRequestBuilder) { + m := &CommitsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/search/commits?q={q}{&order*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewCommitsRequestBuilder instantiates a new CommitsRequestBuilder and sets the default values. +func NewCommitsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CommitsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCommitsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get find commits via various criteria on the default branch (usually `main`). This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for commits, you can get text match metadata for the **message** field when you provide the `text-match` media type. For more details about how to receive highlighted search results, see [Text matchmetadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this:`q=repo:octocat/Spoon-Knife+css` +// returns a CommitsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/search/search#search-commits +func (m *CommitsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[CommitsRequestBuilderGetQueryParameters])(CommitsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateCommitsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(CommitsGetResponseable), nil +} +// ToGetRequestInformation find commits via various criteria on the default branch (usually `main`). This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for commits, you can get text match metadata for the **message** field when you provide the `text-match` media type. For more details about how to receive highlighted search results, see [Text matchmetadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this:`q=repo:octocat/Spoon-Knife+css` +// returns a *RequestInformation when successful +func (m *CommitsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[CommitsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *CommitsRequestBuilder when successful +func (m *CommitsRequestBuilder) WithUrl(rawUrl string)(*CommitsRequestBuilder) { + return NewCommitsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/commits_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/commits_response.go new file mode 100644 index 000000000..b50590dc1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/commits_response.go @@ -0,0 +1,28 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CommitsResponse +// Deprecated: This class is obsolete. Use commitsGetResponse instead. +type CommitsResponse struct { + CommitsGetResponse +} +// NewCommitsResponse instantiates a new CommitsResponse and sets the default values. +func NewCommitsResponse()(*CommitsResponse) { + m := &CommitsResponse{ + CommitsGetResponse: *NewCommitsGetResponse(), + } + return m +} +// CreateCommitsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateCommitsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitsResponse(), nil +} +// CommitsResponseable +// Deprecated: This class is obsolete. Use commitsGetResponse instead. +type CommitsResponseable interface { + CommitsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/issues/get_order_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/issues/get_order_query_parameter_type.go new file mode 100644 index 000000000..ce4e43fba --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/issues/get_order_query_parameter_type.go @@ -0,0 +1,36 @@ +package issues +import ( + "errors" +) +type GetOrderQueryParameterType int + +const ( + DESC_GETORDERQUERYPARAMETERTYPE GetOrderQueryParameterType = iota + ASC_GETORDERQUERYPARAMETERTYPE +) + +func (i GetOrderQueryParameterType) String() string { + return []string{"desc", "asc"}[i] +} +func ParseGetOrderQueryParameterType(v string) (any, error) { + result := DESC_GETORDERQUERYPARAMETERTYPE + switch v { + case "desc": + result = DESC_GETORDERQUERYPARAMETERTYPE + case "asc": + result = ASC_GETORDERQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetOrderQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetOrderQueryParameterType(values []GetOrderQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetOrderQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/issues/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/issues/get_sort_query_parameter_type.go new file mode 100644 index 000000000..9ccb41cde --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/issues/get_sort_query_parameter_type.go @@ -0,0 +1,63 @@ +package issues +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + COMMENTS_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + REACTIONS_GETSORTQUERYPARAMETERTYPE + REACTIONS_PLUS_1_GETSORTQUERYPARAMETERTYPE + REACTIONS1_GETSORTQUERYPARAMETERTYPE + REACTIONSSMILE_GETSORTQUERYPARAMETERTYPE + REACTIONSTHINKING_FACE_GETSORTQUERYPARAMETERTYPE + REACTIONSHEART_GETSORTQUERYPARAMETERTYPE + REACTIONSTADA_GETSORTQUERYPARAMETERTYPE + INTERACTIONS_GETSORTQUERYPARAMETERTYPE + CREATED_GETSORTQUERYPARAMETERTYPE + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := COMMENTS_GETSORTQUERYPARAMETERTYPE + switch v { + case "comments": + result = COMMENTS_GETSORTQUERYPARAMETERTYPE + case "reactions": + result = REACTIONS_GETSORTQUERYPARAMETERTYPE + case "reactions-+1": + result = REACTIONS_PLUS_1_GETSORTQUERYPARAMETERTYPE + case "reactions--1": + result = REACTIONS1_GETSORTQUERYPARAMETERTYPE + case "reactions-smile": + result = REACTIONSSMILE_GETSORTQUERYPARAMETERTYPE + case "reactions-thinking_face": + result = REACTIONSTHINKING_FACE_GETSORTQUERYPARAMETERTYPE + case "reactions-heart": + result = REACTIONSHEART_GETSORTQUERYPARAMETERTYPE + case "reactions-tada": + result = REACTIONSTADA_GETSORTQUERYPARAMETERTYPE + case "interactions": + result = INTERACTIONS_GETSORTQUERYPARAMETERTYPE + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/issues_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/issues_get_response.go new file mode 100644 index 000000000..1fae3149c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/issues_get_response.go @@ -0,0 +1,151 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type IssuesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The incomplete_results property + incomplete_results *bool + // The items property + items []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueSearchResultItemable + // The total_count property + total_count *int32 +} +// NewIssuesGetResponse instantiates a new IssuesGetResponse and sets the default values. +func NewIssuesGetResponse()(*IssuesGetResponse) { + m := &IssuesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssuesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssuesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssuesGetResponse(), 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 *IssuesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssuesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["incomplete_results"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncompleteResults(val) + } + return nil + } + res["items"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueSearchResultItemFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueSearchResultItemable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueSearchResultItemable) + } + } + m.SetItems(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetIncompleteResults gets the incomplete_results property value. The incomplete_results property +// returns a *bool when successful +func (m *IssuesGetResponse) GetIncompleteResults()(*bool) { + return m.incomplete_results +} +// GetItems gets the items property value. The items property +// returns a []IssueSearchResultItemable when successful +func (m *IssuesGetResponse) GetItems()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueSearchResultItemable) { + return m.items +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *IssuesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *IssuesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("incomplete_results", m.GetIncompleteResults()) + if err != nil { + return err + } + } + if m.GetItems() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItems())) + for i, v := range m.GetItems() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("items", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *IssuesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncompleteResults sets the incomplete_results property value. The incomplete_results property +func (m *IssuesGetResponse) SetIncompleteResults(value *bool)() { + m.incomplete_results = value +} +// SetItems sets the items property value. The items property +func (m *IssuesGetResponse) SetItems(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueSearchResultItemable)() { + m.items = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *IssuesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type IssuesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncompleteResults()(*bool) + GetItems()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueSearchResultItemable) + GetTotalCount()(*int32) + SetIncompleteResults(value *bool)() + SetItems(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.IssueSearchResultItemable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/issues_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/issues_request_builder.go new file mode 100644 index 000000000..bfed0293d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/issues_request_builder.go @@ -0,0 +1,79 @@ +package search + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i60f7782ca360402c5ca504d6e0a3ccd1fa72dc30352dc710edab252368039c3f "github.com/octokit/go-sdk/pkg/github/search/issues" +) + +// IssuesRequestBuilder builds and executes requests for operations under \search\issues +type IssuesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// IssuesRequestBuilderGetQueryParameters find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlightedsearch results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this.`q=windows+label:bug+language:python+state:open&sort=created&order=asc`This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results.**Note:** For requests made by GitHub Apps with a user access token, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." +type IssuesRequestBuilderGetQueryParameters struct { + // Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. + Order *i60f7782ca360402c5ca504d6e0a3ccd1fa72dc30352dc710edab252368039c3f.GetOrderQueryParameterType `uriparametername:"order"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See "[Searching issues and pull requests](https://docs.github.com/search-github/searching-on-github/searching-issues-and-pull-requests)" for a detailed list of qualifiers. + Q *string `uriparametername:"q"` + // Sorts the results of your query by the number of `comments`, `reactions`, `reactions-+1`, `reactions--1`, `reactions-smile`, `reactions-thinking_face`, `reactions-heart`, `reactions-tada`, or `interactions`. You can also sort results by how recently the items were `created` or `updated`, Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) + Sort *i60f7782ca360402c5ca504d6e0a3ccd1fa72dc30352dc710edab252368039c3f.GetSortQueryParameterType `uriparametername:"sort"` +} +// NewIssuesRequestBuilderInternal instantiates a new IssuesRequestBuilder and sets the default values. +func NewIssuesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IssuesRequestBuilder) { + m := &IssuesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/search/issues?q={q}{&order*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewIssuesRequestBuilder instantiates a new IssuesRequestBuilder and sets the default values. +func NewIssuesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IssuesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewIssuesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlightedsearch results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this.`q=windows+label:bug+language:python+state:open&sort=created&order=asc`This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results.**Note:** For requests made by GitHub Apps with a user access token, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." +// returns a IssuesGetResponseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a Issues503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/search/search#search-issues-and-pull-requests +func (m *IssuesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[IssuesRequestBuilderGetQueryParameters])(IssuesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssues503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateIssuesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(IssuesGetResponseable), nil +} +// ToGetRequestInformation find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlightedsearch results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this.`q=windows+label:bug+language:python+state:open&sort=created&order=asc`This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results.**Note:** For requests made by GitHub Apps with a user access token, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." +// returns a *RequestInformation when successful +func (m *IssuesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[IssuesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *IssuesRequestBuilder when successful +func (m *IssuesRequestBuilder) WithUrl(rawUrl string)(*IssuesRequestBuilder) { + return NewIssuesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/issues_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/issues_response.go new file mode 100644 index 000000000..1b7ae0a61 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/issues_response.go @@ -0,0 +1,28 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IssuesResponse +// Deprecated: This class is obsolete. Use issuesGetResponse instead. +type IssuesResponse struct { + IssuesGetResponse +} +// NewIssuesResponse instantiates a new IssuesResponse and sets the default values. +func NewIssuesResponse()(*IssuesResponse) { + m := &IssuesResponse{ + IssuesGetResponse: *NewIssuesGetResponse(), + } + return m +} +// CreateIssuesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateIssuesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssuesResponse(), nil +} +// IssuesResponseable +// Deprecated: This class is obsolete. Use issuesGetResponse instead. +type IssuesResponseable interface { + IssuesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/labels/get_order_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/labels/get_order_query_parameter_type.go new file mode 100644 index 000000000..b362c2e5b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/labels/get_order_query_parameter_type.go @@ -0,0 +1,36 @@ +package labels +import ( + "errors" +) +type GetOrderQueryParameterType int + +const ( + DESC_GETORDERQUERYPARAMETERTYPE GetOrderQueryParameterType = iota + ASC_GETORDERQUERYPARAMETERTYPE +) + +func (i GetOrderQueryParameterType) String() string { + return []string{"desc", "asc"}[i] +} +func ParseGetOrderQueryParameterType(v string) (any, error) { + result := DESC_GETORDERQUERYPARAMETERTYPE + switch v { + case "desc": + result = DESC_GETORDERQUERYPARAMETERTYPE + case "asc": + result = ASC_GETORDERQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetOrderQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetOrderQueryParameterType(values []GetOrderQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetOrderQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/labels/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/labels/get_sort_query_parameter_type.go new file mode 100644 index 000000000..37816f7b7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/labels/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package labels +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/labels_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/labels_get_response.go new file mode 100644 index 000000000..3213a8aa1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/labels_get_response.go @@ -0,0 +1,151 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type LabelsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The incomplete_results property + incomplete_results *bool + // The items property + items []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.LabelSearchResultItemable + // The total_count property + total_count *int32 +} +// NewLabelsGetResponse instantiates a new LabelsGetResponse and sets the default values. +func NewLabelsGetResponse()(*LabelsGetResponse) { + m := &LabelsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLabelsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabelsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLabelsGetResponse(), 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 *LabelsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LabelsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["incomplete_results"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncompleteResults(val) + } + return nil + } + res["items"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateLabelSearchResultItemFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.LabelSearchResultItemable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.LabelSearchResultItemable) + } + } + m.SetItems(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetIncompleteResults gets the incomplete_results property value. The incomplete_results property +// returns a *bool when successful +func (m *LabelsGetResponse) GetIncompleteResults()(*bool) { + return m.incomplete_results +} +// GetItems gets the items property value. The items property +// returns a []LabelSearchResultItemable when successful +func (m *LabelsGetResponse) GetItems()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.LabelSearchResultItemable) { + return m.items +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *LabelsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *LabelsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("incomplete_results", m.GetIncompleteResults()) + if err != nil { + return err + } + } + if m.GetItems() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItems())) + for i, v := range m.GetItems() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("items", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *LabelsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncompleteResults sets the incomplete_results property value. The incomplete_results property +func (m *LabelsGetResponse) SetIncompleteResults(value *bool)() { + m.incomplete_results = value +} +// SetItems sets the items property value. The items property +func (m *LabelsGetResponse) SetItems(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.LabelSearchResultItemable)() { + m.items = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *LabelsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type LabelsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncompleteResults()(*bool) + GetItems()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.LabelSearchResultItemable) + GetTotalCount()(*int32) + SetIncompleteResults(value *bool)() + SetItems(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.LabelSearchResultItemable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/labels_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/labels_request_builder.go new file mode 100644 index 000000000..c40487dc2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/labels_request_builder.go @@ -0,0 +1,81 @@ +package search + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i7add74210511a3bba07275779ce4518d4e5b8c0b4c74994de39cfb93f5b96ecf "github.com/octokit/go-sdk/pkg/github/search/labels" +) + +// LabelsRequestBuilder builds and executes requests for operations under \search\labels +type LabelsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// LabelsRequestBuilderGetQueryParameters find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to find labels in the `linguist` repository that match `bug`, `defect`, or `enhancement`. Your query might look like this:`q=bug+defect+enhancement&repository_id=64778136`The labels that best match the query appear first in the search results. +type LabelsRequestBuilderGetQueryParameters struct { + // Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. + Order *i7add74210511a3bba07275779ce4518d4e5b8c0b4c74994de39cfb93f5b96ecf.GetOrderQueryParameterType `uriparametername:"order"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The search keywords. This endpoint does not accept qualifiers in the query. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). + Q *string `uriparametername:"q"` + // The id of the repository. + Repository_id *int32 `uriparametername:"repository_id"` + // Sorts the results of your query by when the label was `created` or `updated`. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) + Sort *i7add74210511a3bba07275779ce4518d4e5b8c0b4c74994de39cfb93f5b96ecf.GetSortQueryParameterType `uriparametername:"sort"` +} +// NewLabelsRequestBuilderInternal instantiates a new LabelsRequestBuilder and sets the default values. +func NewLabelsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LabelsRequestBuilder) { + m := &LabelsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/search/labels?q={q}&repository_id={repository_id}{&order*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewLabelsRequestBuilder instantiates a new LabelsRequestBuilder and sets the default values. +func NewLabelsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LabelsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewLabelsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to find labels in the `linguist` repository that match `bug`, `defect`, or `enhancement`. Your query might look like this:`q=bug+defect+enhancement&repository_id=64778136`The labels that best match the query appear first in the search results. +// returns a LabelsGetResponseable when successful +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/search/search#search-labels +func (m *LabelsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[LabelsRequestBuilderGetQueryParameters])(LabelsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateLabelsGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(LabelsGetResponseable), nil +} +// ToGetRequestInformation find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to find labels in the `linguist` repository that match `bug`, `defect`, or `enhancement`. Your query might look like this:`q=bug+defect+enhancement&repository_id=64778136`The labels that best match the query appear first in the search results. +// returns a *RequestInformation when successful +func (m *LabelsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[LabelsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *LabelsRequestBuilder when successful +func (m *LabelsRequestBuilder) WithUrl(rawUrl string)(*LabelsRequestBuilder) { + return NewLabelsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/labels_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/labels_response.go new file mode 100644 index 000000000..d3655fea6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/labels_response.go @@ -0,0 +1,28 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// LabelsResponse +// Deprecated: This class is obsolete. Use labelsGetResponse instead. +type LabelsResponse struct { + LabelsGetResponse +} +// NewLabelsResponse instantiates a new LabelsResponse and sets the default values. +func NewLabelsResponse()(*LabelsResponse) { + m := &LabelsResponse{ + LabelsGetResponse: *NewLabelsGetResponse(), + } + return m +} +// CreateLabelsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateLabelsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLabelsResponse(), nil +} +// LabelsResponseable +// Deprecated: This class is obsolete. Use labelsGetResponse instead. +type LabelsResponseable interface { + LabelsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/repositories/get_order_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/repositories/get_order_query_parameter_type.go new file mode 100644 index 000000000..3933a58d8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/repositories/get_order_query_parameter_type.go @@ -0,0 +1,36 @@ +package repositories +import ( + "errors" +) +type GetOrderQueryParameterType int + +const ( + DESC_GETORDERQUERYPARAMETERTYPE GetOrderQueryParameterType = iota + ASC_GETORDERQUERYPARAMETERTYPE +) + +func (i GetOrderQueryParameterType) String() string { + return []string{"desc", "asc"}[i] +} +func ParseGetOrderQueryParameterType(v string) (any, error) { + result := DESC_GETORDERQUERYPARAMETERTYPE + switch v { + case "desc": + result = DESC_GETORDERQUERYPARAMETERTYPE + case "asc": + result = ASC_GETORDERQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetOrderQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetOrderQueryParameterType(values []GetOrderQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetOrderQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/repositories/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/repositories/get_sort_query_parameter_type.go new file mode 100644 index 000000000..8fcb5c26a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/repositories/get_sort_query_parameter_type.go @@ -0,0 +1,42 @@ +package repositories +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + STARS_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + FORKS_GETSORTQUERYPARAMETERTYPE + HELPWANTEDISSUES_GETSORTQUERYPARAMETERTYPE + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"stars", "forks", "help-wanted-issues", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := STARS_GETSORTQUERYPARAMETERTYPE + switch v { + case "stars": + result = STARS_GETSORTQUERYPARAMETERTYPE + case "forks": + result = FORKS_GETSORTQUERYPARAMETERTYPE + case "help-wanted-issues": + result = HELPWANTEDISSUES_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/repositories_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/repositories_get_response.go new file mode 100644 index 000000000..cc43a6630 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/repositories_get_response.go @@ -0,0 +1,151 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type RepositoriesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The incomplete_results property + incomplete_results *bool + // The items property + items []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepoSearchResultItemable + // The total_count property + total_count *int32 +} +// NewRepositoriesGetResponse instantiates a new RepositoriesGetResponse and sets the default values. +func NewRepositoriesGetResponse()(*RepositoriesGetResponse) { + m := &RepositoriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoriesGetResponse(), 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 *RepositoriesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["incomplete_results"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncompleteResults(val) + } + return nil + } + res["items"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepoSearchResultItemFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepoSearchResultItemable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepoSearchResultItemable) + } + } + m.SetItems(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetIncompleteResults gets the incomplete_results property value. The incomplete_results property +// returns a *bool when successful +func (m *RepositoriesGetResponse) GetIncompleteResults()(*bool) { + return m.incomplete_results +} +// GetItems gets the items property value. The items property +// returns a []RepoSearchResultItemable when successful +func (m *RepositoriesGetResponse) GetItems()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepoSearchResultItemable) { + return m.items +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *RepositoriesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *RepositoriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("incomplete_results", m.GetIncompleteResults()) + if err != nil { + return err + } + } + if m.GetItems() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItems())) + for i, v := range m.GetItems() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("items", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncompleteResults sets the incomplete_results property value. The incomplete_results property +func (m *RepositoriesGetResponse) SetIncompleteResults(value *bool)() { + m.incomplete_results = value +} +// SetItems sets the items property value. The items property +func (m *RepositoriesGetResponse) SetItems(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepoSearchResultItemable)() { + m.items = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *RepositoriesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type RepositoriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncompleteResults()(*bool) + GetItems()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepoSearchResultItemable) + GetTotalCount()(*int32) + SetIncompleteResults(value *bool)() + SetItems(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepoSearchResultItemable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/repositories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/repositories_request_builder.go new file mode 100644 index 000000000..719e5c799 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/repositories_request_builder.go @@ -0,0 +1,77 @@ +package search + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + if00612db3ee43f8c11c434312c0490ee1b643ea9471a2b1c2a889018d89cf8b3 "github.com/octokit/go-sdk/pkg/github/search/repositories" +) + +// RepositoriesRequestBuilder builds and executes requests for operations under \search\repositories +type RepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// RepositoriesRequestBuilderGetQueryParameters find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this:`q=tetris+language:assembly&sort=stars&order=desc`This query searches for repositories with the word `tetris` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results. +type RepositoriesRequestBuilderGetQueryParameters struct { + // Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. + Order *if00612db3ee43f8c11c434312c0490ee1b643ea9471a2b1c2a889018d89cf8b3.GetOrderQueryParameterType `uriparametername:"order"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See "[Searching for repositories](https://docs.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. + Q *string `uriparametername:"q"` + // Sorts the results of your query by number of `stars`, `forks`, or `help-wanted-issues` or how recently the items were `updated`. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) + Sort *if00612db3ee43f8c11c434312c0490ee1b643ea9471a2b1c2a889018d89cf8b3.GetSortQueryParameterType `uriparametername:"sort"` +} +// NewRepositoriesRequestBuilderInternal instantiates a new RepositoriesRequestBuilder and sets the default values. +func NewRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RepositoriesRequestBuilder) { + m := &RepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/search/repositories?q={q}{&order*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewRepositoriesRequestBuilder instantiates a new RepositoriesRequestBuilder and sets the default values. +func NewRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this:`q=tetris+language:assembly&sort=stars&order=desc`This query searches for repositories with the word `tetris` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results. +// returns a RepositoriesGetResponseable when successful +// returns a ValidationError error when the service returns a 422 status code +// returns a Repositories503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/search/search#search-repositories +func (m *RepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[RepositoriesRequestBuilderGetQueryParameters])(RepositoriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositories503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateRepositoriesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(RepositoriesGetResponseable), nil +} +// ToGetRequestInformation find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this:`q=tetris+language:assembly&sort=stars&order=desc`This query searches for repositories with the word `tetris` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results. +// returns a *RequestInformation when successful +func (m *RepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[RepositoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *RepositoriesRequestBuilder when successful +func (m *RepositoriesRequestBuilder) WithUrl(rawUrl string)(*RepositoriesRequestBuilder) { + return NewRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/repositories_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/repositories_response.go new file mode 100644 index 000000000..c06d82b13 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/repositories_response.go @@ -0,0 +1,28 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoriesResponse +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type RepositoriesResponse struct { + RepositoriesGetResponse +} +// NewRepositoriesResponse instantiates a new RepositoriesResponse and sets the default values. +func NewRepositoriesResponse()(*RepositoriesResponse) { + m := &RepositoriesResponse{ + RepositoriesGetResponse: *NewRepositoriesGetResponse(), + } + return m +} +// CreateRepositoriesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateRepositoriesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoriesResponse(), nil +} +// RepositoriesResponseable +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type RepositoriesResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + RepositoriesGetResponseable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/search_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/search_request_builder.go new file mode 100644 index 000000000..81f859ac0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/search_request_builder.go @@ -0,0 +1,58 @@ +package search + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// SearchRequestBuilder builds and executes requests for operations under \search +type SearchRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Code the code property +// returns a *CodeRequestBuilder when successful +func (m *SearchRequestBuilder) Code()(*CodeRequestBuilder) { + return NewCodeRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Commits the commits property +// returns a *CommitsRequestBuilder when successful +func (m *SearchRequestBuilder) Commits()(*CommitsRequestBuilder) { + return NewCommitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewSearchRequestBuilderInternal instantiates a new SearchRequestBuilder and sets the default values. +func NewSearchRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SearchRequestBuilder) { + m := &SearchRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/search", pathParameters), + } + return m +} +// NewSearchRequestBuilder instantiates a new SearchRequestBuilder and sets the default values. +func NewSearchRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SearchRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewSearchRequestBuilderInternal(urlParams, requestAdapter) +} +// Issues the issues property +// returns a *IssuesRequestBuilder when successful +func (m *SearchRequestBuilder) Issues()(*IssuesRequestBuilder) { + return NewIssuesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Labels the labels property +// returns a *LabelsRequestBuilder when successful +func (m *SearchRequestBuilder) Labels()(*LabelsRequestBuilder) { + return NewLabelsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repositories the repositories property +// returns a *RepositoriesRequestBuilder when successful +func (m *SearchRequestBuilder) Repositories()(*RepositoriesRequestBuilder) { + return NewRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Topics the topics property +// returns a *TopicsRequestBuilder when successful +func (m *SearchRequestBuilder) Topics()(*TopicsRequestBuilder) { + return NewTopicsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Users the users property +// returns a *UsersRequestBuilder when successful +func (m *SearchRequestBuilder) Users()(*UsersRequestBuilder) { + return NewUsersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/topics_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/topics_get_response.go new file mode 100644 index 000000000..9913aaa3c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/topics_get_response.go @@ -0,0 +1,151 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type TopicsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The incomplete_results property + incomplete_results *bool + // The items property + items []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TopicSearchResultItemable + // The total_count property + total_count *int32 +} +// NewTopicsGetResponse instantiates a new TopicsGetResponse and sets the default values. +func NewTopicsGetResponse()(*TopicsGetResponse) { + m := &TopicsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopicsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopicsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopicsGetResponse(), 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 *TopicsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TopicsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["incomplete_results"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncompleteResults(val) + } + return nil + } + res["items"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTopicSearchResultItemFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TopicSearchResultItemable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TopicSearchResultItemable) + } + } + m.SetItems(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetIncompleteResults gets the incomplete_results property value. The incomplete_results property +// returns a *bool when successful +func (m *TopicsGetResponse) GetIncompleteResults()(*bool) { + return m.incomplete_results +} +// GetItems gets the items property value. The items property +// returns a []TopicSearchResultItemable when successful +func (m *TopicsGetResponse) GetItems()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TopicSearchResultItemable) { + return m.items +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *TopicsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *TopicsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("incomplete_results", m.GetIncompleteResults()) + if err != nil { + return err + } + } + if m.GetItems() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItems())) + for i, v := range m.GetItems() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("items", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *TopicsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncompleteResults sets the incomplete_results property value. The incomplete_results property +func (m *TopicsGetResponse) SetIncompleteResults(value *bool)() { + m.incomplete_results = value +} +// SetItems sets the items property value. The items property +func (m *TopicsGetResponse) SetItems(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TopicSearchResultItemable)() { + m.items = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *TopicsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type TopicsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncompleteResults()(*bool) + GetItems()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TopicSearchResultItemable) + GetTotalCount()(*int32) + SetIncompleteResults(value *bool)() + SetItems(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TopicSearchResultItemable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/topics_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/topics_request_builder.go new file mode 100644 index 000000000..a756fa883 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/topics_request_builder.go @@ -0,0 +1,65 @@ +package search + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// TopicsRequestBuilder builds and executes requests for operations under \search\topics +type TopicsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// TopicsRequestBuilderGetQueryParameters find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api). See "[Searching topics](https://docs.github.com/articles/searching-topics/)" for a detailed list of qualifiers.When searching for topics, you can get text match metadata for the topic's **short\_description**, **description**, **name**, or **display\_name** field when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this:`q=ruby+is:featured`This query searches for topics with the keyword `ruby` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results. +type TopicsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). + Q *string `uriparametername:"q"` +} +// NewTopicsRequestBuilderInternal instantiates a new TopicsRequestBuilder and sets the default values. +func NewTopicsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TopicsRequestBuilder) { + m := &TopicsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/search/topics?q={q}{&page*,per_page*}", pathParameters), + } + return m +} +// NewTopicsRequestBuilder instantiates a new TopicsRequestBuilder and sets the default values. +func NewTopicsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TopicsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTopicsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api). See "[Searching topics](https://docs.github.com/articles/searching-topics/)" for a detailed list of qualifiers.When searching for topics, you can get text match metadata for the topic's **short\_description**, **description**, **name**, or **display\_name** field when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this:`q=ruby+is:featured`This query searches for topics with the keyword `ruby` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results. +// returns a TopicsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/search/search#search-topics +func (m *TopicsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[TopicsRequestBuilderGetQueryParameters])(TopicsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateTopicsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(TopicsGetResponseable), nil +} +// ToGetRequestInformation find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api). See "[Searching topics](https://docs.github.com/articles/searching-topics/)" for a detailed list of qualifiers.When searching for topics, you can get text match metadata for the topic's **short\_description**, **description**, **name**, or **display\_name** field when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this:`q=ruby+is:featured`This query searches for topics with the keyword `ruby` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results. +// returns a *RequestInformation when successful +func (m *TopicsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[TopicsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *TopicsRequestBuilder when successful +func (m *TopicsRequestBuilder) WithUrl(rawUrl string)(*TopicsRequestBuilder) { + return NewTopicsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/topics_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/topics_response.go new file mode 100644 index 000000000..93b11fdeb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/topics_response.go @@ -0,0 +1,28 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TopicsResponse +// Deprecated: This class is obsolete. Use topicsGetResponse instead. +type TopicsResponse struct { + TopicsGetResponse +} +// NewTopicsResponse instantiates a new TopicsResponse and sets the default values. +func NewTopicsResponse()(*TopicsResponse) { + m := &TopicsResponse{ + TopicsGetResponse: *NewTopicsGetResponse(), + } + return m +} +// CreateTopicsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateTopicsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopicsResponse(), nil +} +// TopicsResponseable +// Deprecated: This class is obsolete. Use topicsGetResponse instead. +type TopicsResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + TopicsGetResponseable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/users/get_order_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/users/get_order_query_parameter_type.go new file mode 100644 index 000000000..30eed7b67 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/users/get_order_query_parameter_type.go @@ -0,0 +1,36 @@ +package users +import ( + "errors" +) +type GetOrderQueryParameterType int + +const ( + DESC_GETORDERQUERYPARAMETERTYPE GetOrderQueryParameterType = iota + ASC_GETORDERQUERYPARAMETERTYPE +) + +func (i GetOrderQueryParameterType) String() string { + return []string{"desc", "asc"}[i] +} +func ParseGetOrderQueryParameterType(v string) (any, error) { + result := DESC_GETORDERQUERYPARAMETERTYPE + switch v { + case "desc": + result = DESC_GETORDERQUERYPARAMETERTYPE + case "asc": + result = ASC_GETORDERQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetOrderQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetOrderQueryParameterType(values []GetOrderQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetOrderQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/users/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/users/get_sort_query_parameter_type.go new file mode 100644 index 000000000..347926019 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/users/get_sort_query_parameter_type.go @@ -0,0 +1,39 @@ +package users +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + FOLLOWERS_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + REPOSITORIES_GETSORTQUERYPARAMETERTYPE + JOINED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"followers", "repositories", "joined"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := FOLLOWERS_GETSORTQUERYPARAMETERTYPE + switch v { + case "followers": + result = FOLLOWERS_GETSORTQUERYPARAMETERTYPE + case "repositories": + result = REPOSITORIES_GETSORTQUERYPARAMETERTYPE + case "joined": + result = JOINED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/users_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/users_get_response.go new file mode 100644 index 000000000..2f86d2ae2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/users_get_response.go @@ -0,0 +1,151 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type UsersGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The incomplete_results property + incomplete_results *bool + // The items property + items []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.UserSearchResultItemable + // The total_count property + total_count *int32 +} +// NewUsersGetResponse instantiates a new UsersGetResponse and sets the default values. +func NewUsersGetResponse()(*UsersGetResponse) { + m := &UsersGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUsersGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsersGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUsersGetResponse(), 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 *UsersGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UsersGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["incomplete_results"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncompleteResults(val) + } + return nil + } + res["items"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateUserSearchResultItemFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.UserSearchResultItemable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.UserSearchResultItemable) + } + } + m.SetItems(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetIncompleteResults gets the incomplete_results property value. The incomplete_results property +// returns a *bool when successful +func (m *UsersGetResponse) GetIncompleteResults()(*bool) { + return m.incomplete_results +} +// GetItems gets the items property value. The items property +// returns a []UserSearchResultItemable when successful +func (m *UsersGetResponse) GetItems()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.UserSearchResultItemable) { + return m.items +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *UsersGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *UsersGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("incomplete_results", m.GetIncompleteResults()) + if err != nil { + return err + } + } + if m.GetItems() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItems())) + for i, v := range m.GetItems() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("items", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *UsersGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncompleteResults sets the incomplete_results property value. The incomplete_results property +func (m *UsersGetResponse) SetIncompleteResults(value *bool)() { + m.incomplete_results = value +} +// SetItems sets the items property value. The items property +func (m *UsersGetResponse) SetItems(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.UserSearchResultItemable)() { + m.items = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *UsersGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type UsersGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncompleteResults()(*bool) + GetItems()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.UserSearchResultItemable) + GetTotalCount()(*int32) + SetIncompleteResults(value *bool)() + SetItems(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.UserSearchResultItemable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/users_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/users_request_builder.go new file mode 100644 index 000000000..cbb18c468 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/users_request_builder.go @@ -0,0 +1,77 @@ +package search + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i4bbf61dd92ec14fb80440b575ce08a197a518044325eb9dc0b476c3deafdcfbd "github.com/octokit/go-sdk/pkg/github/search/users" +) + +// UsersRequestBuilder builds and executes requests for operations under \search\users +type UsersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// UsersRequestBuilderGetQueryParameters find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for users, you can get text match metadata for the issue **login**, public **email**, and **name** fields when you pass the `text-match` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you're looking for a list of popular users, you might try this query:`q=tom+repos:%3E42+followers:%3E1000`This query searches for users with the name `tom`. The results are restricted to users with more than 42 repositories and over 1,000 followers.This endpoint does not accept authentication and will only include publicly visible users. As an alternative, you can use the GraphQL API. The GraphQL API requires authentication and will return private users, including Enterprise Managed Users (EMUs), that you are authorized to view. For more information, see "[GraphQL Queries](https://docs.github.com/graphql/reference/queries#search)." +type UsersRequestBuilderGetQueryParameters struct { + // Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. + Order *i4bbf61dd92ec14fb80440b575ce08a197a518044325eb9dc0b476c3deafdcfbd.GetOrderQueryParameterType `uriparametername:"order"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See "[Searching users](https://docs.github.com/search-github/searching-on-github/searching-users)" for a detailed list of qualifiers. + Q *string `uriparametername:"q"` + // Sorts the results of your query by number of `followers` or `repositories`, or when the person `joined` GitHub. Default: [best match](https://docs.github.com/rest/search/search#ranking-search-results) + Sort *i4bbf61dd92ec14fb80440b575ce08a197a518044325eb9dc0b476c3deafdcfbd.GetSortQueryParameterType `uriparametername:"sort"` +} +// NewUsersRequestBuilderInternal instantiates a new UsersRequestBuilder and sets the default values. +func NewUsersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UsersRequestBuilder) { + m := &UsersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/search/users?q={q}{&order*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewUsersRequestBuilder instantiates a new UsersRequestBuilder and sets the default values. +func NewUsersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UsersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewUsersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for users, you can get text match metadata for the issue **login**, public **email**, and **name** fields when you pass the `text-match` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you're looking for a list of popular users, you might try this query:`q=tom+repos:%3E42+followers:%3E1000`This query searches for users with the name `tom`. The results are restricted to users with more than 42 repositories and over 1,000 followers.This endpoint does not accept authentication and will only include publicly visible users. As an alternative, you can use the GraphQL API. The GraphQL API requires authentication and will return private users, including Enterprise Managed Users (EMUs), that you are authorized to view. For more information, see "[GraphQL Queries](https://docs.github.com/graphql/reference/queries#search)." +// returns a UsersGetResponseable when successful +// returns a ValidationError error when the service returns a 422 status code +// returns a Users503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/search/search#search-users +func (m *UsersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[UsersRequestBuilderGetQueryParameters])(UsersGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateUsers503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateUsersGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(UsersGetResponseable), nil +} +// ToGetRequestInformation find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).When searching for users, you can get text match metadata for the issue **login**, public **email**, and **name** fields when you pass the `text-match` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).For example, if you're looking for a list of popular users, you might try this query:`q=tom+repos:%3E42+followers:%3E1000`This query searches for users with the name `tom`. The results are restricted to users with more than 42 repositories and over 1,000 followers.This endpoint does not accept authentication and will only include publicly visible users. As an alternative, you can use the GraphQL API. The GraphQL API requires authentication and will return private users, including Enterprise Managed Users (EMUs), that you are authorized to view. For more information, see "[GraphQL Queries](https://docs.github.com/graphql/reference/queries#search)." +// returns a *RequestInformation when successful +func (m *UsersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[UsersRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *UsersRequestBuilder when successful +func (m *UsersRequestBuilder) WithUrl(rawUrl string)(*UsersRequestBuilder) { + return NewUsersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/search/users_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/search/users_response.go new file mode 100644 index 000000000..5f9298d1c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/search/users_response.go @@ -0,0 +1,28 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// UsersResponse +// Deprecated: This class is obsolete. Use usersGetResponse instead. +type UsersResponse struct { + UsersGetResponse +} +// NewUsersResponse instantiates a new UsersResponse and sets the default values. +func NewUsersResponse()(*UsersResponse) { + m := &UsersResponse{ + UsersGetResponse: *NewUsersGetResponse(), + } + return m +} +// CreateUsersResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateUsersResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUsersResponse(), nil +} +// UsersResponseable +// Deprecated: This class is obsolete. Use usersGetResponse instead. +type UsersResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + UsersGetResponseable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/get_direction_query_parameter_type.go new file mode 100644 index 000000000..9b519628c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package discussions +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/comments/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/comments/get_direction_query_parameter_type.go new file mode 100644 index 000000000..ac2550630 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/comments/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package comments +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/comments/item/reactions/get_content_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/comments/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 000000000..7aef65a2e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/comments/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,54 @@ +package reactions +import ( + "errors" +) +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + MINUS_1_GETCONTENTQUERYPARAMETERTYPE + LAUGH_GETCONTENTQUERYPARAMETERTYPE + CONFUSED_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "-1": + result = MINUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "confused": + result = CONFUSED_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetContentQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/comments/item/reactions/reactions_post_request_body_content.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/comments/item/reactions/reactions_post_request_body_content.go new file mode 100644 index 000000000..c934402d3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/comments/item/reactions/reactions_post_request_body_content.go @@ -0,0 +1,55 @@ +package reactions +import ( + "errors" +) +// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion comment. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "-1": + result = MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "confused": + result = CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return 0, errors.New("Unknown ReactionsPostRequestBody_content value: " + v) + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/reactions/get_content_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 000000000..7aef65a2e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,54 @@ +package reactions +import ( + "errors" +) +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + MINUS_1_GETCONTENTQUERYPARAMETERTYPE + LAUGH_GETCONTENTQUERYPARAMETERTYPE + CONFUSED_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "-1": + result = MINUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "confused": + result = CONFUSED_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetContentQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/reactions/reactions_post_request_body_content.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/reactions/reactions_post_request_body_content.go new file mode 100644 index 000000000..114e88e09 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/reactions/reactions_post_request_body_content.go @@ -0,0 +1,55 @@ +package reactions +import ( + "errors" +) +// The [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions) to add to the team discussion. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "-1": + result = MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "confused": + result = CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return 0, errors.New("Unknown ReactionsPostRequestBody_content value: " + v) + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/members/get_role_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/members/get_role_query_parameter_type.go new file mode 100644 index 000000000..d4e359b44 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item/members/get_role_query_parameter_type.go @@ -0,0 +1,39 @@ +package members +import ( + "errors" +) +type GetRoleQueryParameterType int + +const ( + MEMBER_GETROLEQUERYPARAMETERTYPE GetRoleQueryParameterType = iota + MAINTAINER_GETROLEQUERYPARAMETERTYPE + ALL_GETROLEQUERYPARAMETERTYPE +) + +func (i GetRoleQueryParameterType) String() string { + return []string{"member", "maintainer", "all"}[i] +} +func ParseGetRoleQueryParameterType(v string) (any, error) { + result := MEMBER_GETROLEQUERYPARAMETERTYPE + switch v { + case "member": + result = MEMBER_GETROLEQUERYPARAMETERTYPE + case "maintainer": + result = MAINTAINER_GETROLEQUERYPARAMETERTYPE + case "all": + result = ALL_GETROLEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetRoleQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetRoleQueryParameterType(values []GetRoleQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetRoleQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_item_reactions_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_item_reactions_post_request_body.go new file mode 100644 index 000000000..df7c80e73 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemDiscussionsItemCommentsItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemDiscussionsItemCommentsItemReactionsPostRequestBody instantiates a new ItemDiscussionsItemCommentsItemReactionsPostRequestBody and sets the default values. +func NewItemDiscussionsItemCommentsItemReactionsPostRequestBody()(*ItemDiscussionsItemCommentsItemReactionsPostRequestBody) { + m := &ItemDiscussionsItemCommentsItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDiscussionsItemCommentsItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDiscussionsItemCommentsItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDiscussionsItemCommentsItemReactionsPostRequestBody(), 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 *ItemDiscussionsItemCommentsItemReactionsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemDiscussionsItemCommentsItemReactionsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemDiscussionsItemCommentsItemReactionsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemDiscussionsItemCommentsItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemDiscussionsItemCommentsItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_item_reactions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_item_reactions_request_builder.go new file mode 100644 index 000000000..7a2fdae6e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_item_reactions_request_builder.go @@ -0,0 +1,106 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i9e08f9889b0fa471ab4cadbc6a2e19081aecef1726390ab7a4bb58d73a59a375 "github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/comments/item/reactions" +) + +// ItemDiscussionsItemCommentsItemReactionsRequestBuilder builds and executes requests for operations under \teams\{team_id}\discussions\{discussion_number}\comments\{comment_number}\reactions +type ItemDiscussionsItemCommentsItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemDiscussionsItemCommentsItemReactionsRequestBuilderGetQueryParameters **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint.List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +type ItemDiscussionsItemCommentsItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion comment. + Content *i9e08f9889b0fa471ab4cadbc6a2e19081aecef1726390ab7a4bb58d73a59a375.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemDiscussionsItemCommentsItemReactionsRequestBuilderInternal instantiates a new ItemDiscussionsItemCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemDiscussionsItemCommentsItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsItemCommentsItemReactionsRequestBuilder) { + m := &ItemDiscussionsItemCommentsItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemDiscussionsItemCommentsItemReactionsRequestBuilder instantiates a new ItemDiscussionsItemCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemDiscussionsItemCommentsItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsItemCommentsItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDiscussionsItemCommentsItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint.List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a []Reactionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy +func (m *ItemDiscussionsItemCommentsItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDiscussionsItemCommentsItemReactionsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable) + } + } + return val, nil +} +// Post **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint.Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a Reactionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy +func (m *ItemDiscussionsItemCommentsItemReactionsRequestBuilder) Post(ctx context.Context, body ItemDiscussionsItemCommentsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable), nil +} +// ToGetRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint.List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemCommentsItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDiscussionsItemCommentsItemReactionsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint.Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemCommentsItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemDiscussionsItemCommentsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemDiscussionsItemCommentsItemReactionsRequestBuilder when successful +func (m *ItemDiscussionsItemCommentsItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemDiscussionsItemCommentsItemReactionsRequestBuilder) { + return NewItemDiscussionsItemCommentsItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_item_with_comment_number_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_item_with_comment_number_patch_request_body.go new file mode 100644 index 000000000..74f0d6d80 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_item_with_comment_number_patch_request_body.go @@ -0,0 +1,80 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The discussion comment's body text. + body *string +} +// NewItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody instantiates a new ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody and sets the default values. +func NewItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody()(*ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) { + m := &ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody(), 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 *ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The discussion comment's body text. +// returns a *string when successful +func (m *ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The discussion comment's body text. +func (m *ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_post_request_body.go new file mode 100644 index 000000000..93b15090d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_post_request_body.go @@ -0,0 +1,80 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemDiscussionsItemCommentsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The discussion comment's body text. + body *string +} +// NewItemDiscussionsItemCommentsPostRequestBody instantiates a new ItemDiscussionsItemCommentsPostRequestBody and sets the default values. +func NewItemDiscussionsItemCommentsPostRequestBody()(*ItemDiscussionsItemCommentsPostRequestBody) { + m := &ItemDiscussionsItemCommentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDiscussionsItemCommentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDiscussionsItemCommentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDiscussionsItemCommentsPostRequestBody(), 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 *ItemDiscussionsItemCommentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The discussion comment's body text. +// returns a *string when successful +func (m *ItemDiscussionsItemCommentsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemDiscussionsItemCommentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemDiscussionsItemCommentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemDiscussionsItemCommentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The discussion comment's body text. +func (m *ItemDiscussionsItemCommentsPostRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemDiscussionsItemCommentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_request_builder.go new file mode 100644 index 000000000..e03a13e9c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_request_builder.go @@ -0,0 +1,118 @@ +package teams + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i941deefbb82fb3f01e785e3e51a0548ce708315c1471903f00d5488f323759f6 "github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/comments" +) + +// ItemDiscussionsItemCommentsRequestBuilder builds and executes requests for operations under \teams\{team_id}\discussions\{discussion_number}\comments +type ItemDiscussionsItemCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemDiscussionsItemCommentsRequestBuilderGetQueryParameters **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint.List all comments on a team discussion.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +type ItemDiscussionsItemCommentsRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i941deefbb82fb3f01e785e3e51a0548ce708315c1471903f00d5488f323759f6.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByComment_number gets an item from the github.com/octokit/go-sdk/pkg/github.teams.item.discussions.item.comments.item collection +// Deprecated: +// returns a *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder when successful +func (m *ItemDiscussionsItemCommentsRequestBuilder) ByComment_number(comment_number int32)(*ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["comment_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(comment_number), 10) + return NewItemDiscussionsItemCommentsWithComment_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDiscussionsItemCommentsRequestBuilderInternal instantiates a new ItemDiscussionsItemCommentsRequestBuilder and sets the default values. +func NewItemDiscussionsItemCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsItemCommentsRequestBuilder) { + m := &ItemDiscussionsItemCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/discussions/{discussion_number}/comments{?direction*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemDiscussionsItemCommentsRequestBuilder instantiates a new ItemDiscussionsItemCommentsRequestBuilder and sets the default values. +func NewItemDiscussionsItemCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsItemCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDiscussionsItemCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint.List all comments on a team discussion.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a []TeamDiscussionCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments-legacy +func (m *ItemDiscussionsItemCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDiscussionsItemCommentsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamDiscussionCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable) + } + } + return val, nil +} +// Post **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint.Creates a new comment on a team discussion.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a TeamDiscussionCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment-legacy +func (m *ItemDiscussionsItemCommentsRequestBuilder) Post(ctx context.Context, body ItemDiscussionsItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamDiscussionCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable), nil +} +// ToGetRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint.List all comments on a team discussion.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDiscussionsItemCommentsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint.Creates a new comment on a team discussion.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemCommentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemDiscussionsItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemDiscussionsItemCommentsRequestBuilder when successful +func (m *ItemDiscussionsItemCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemDiscussionsItemCommentsRequestBuilder) { + return NewItemDiscussionsItemCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_with_comment_number_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_with_comment_number_item_request_builder.go new file mode 100644 index 000000000..452165c69 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_comments_with_comment_number_item_request_builder.go @@ -0,0 +1,122 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder builds and executes requests for operations under \teams\{team_id}\discussions\{discussion_number}\comments\{comment_number} +type ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemDiscussionsItemCommentsWithComment_numberItemRequestBuilderInternal instantiates a new ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder and sets the default values. +func NewItemDiscussionsItemCommentsWithComment_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) { + m := &ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}", pathParameters), + } + return m +} +// NewItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder instantiates a new ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder and sets the default values. +func NewItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDiscussionsItemCommentsWithComment_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint.Deletes a comment on a team discussion.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment-legacy +func (m *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint.Get a specific comment on a team discussion.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a TeamDiscussionCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment-legacy +func (m *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamDiscussionCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable), nil +} +// Patch **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint.Edits the body text of a discussion comment.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a TeamDiscussionCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment-legacy +func (m *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) Patch(ctx context.Context, body ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamDiscussionCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionCommentable), nil +} +// Reactions the reactions property +// returns a *ItemDiscussionsItemCommentsItemReactionsRequestBuilder when successful +func (m *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) Reactions()(*ItemDiscussionsItemCommentsItemReactionsRequestBuilder) { + return NewItemDiscussionsItemCommentsItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint.Deletes a comment on a team discussion.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint.Get a specific comment on a team discussion.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint.Edits the body text of a discussion comment.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder when successful +func (m *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) { + return NewItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_reactions_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_reactions_post_request_body.go new file mode 100644 index 000000000..1745132b1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemDiscussionsItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemDiscussionsItemReactionsPostRequestBody instantiates a new ItemDiscussionsItemReactionsPostRequestBody and sets the default values. +func NewItemDiscussionsItemReactionsPostRequestBody()(*ItemDiscussionsItemReactionsPostRequestBody) { + m := &ItemDiscussionsItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDiscussionsItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDiscussionsItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDiscussionsItemReactionsPostRequestBody(), 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 *ItemDiscussionsItemReactionsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemDiscussionsItemReactionsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemDiscussionsItemReactionsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemDiscussionsItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemDiscussionsItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_reactions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_reactions_request_builder.go new file mode 100644 index 000000000..be0e95cfe --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_reactions_request_builder.go @@ -0,0 +1,106 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i6dd5ca9d4904490106446bf5042ab3041508274ee6e42e98d8ce0d837eae7dfc "github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/reactions" +) + +// ItemDiscussionsItemReactionsRequestBuilder builds and executes requests for operations under \teams\{team_id}\discussions\{discussion_number}\reactions +type ItemDiscussionsItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemDiscussionsItemReactionsRequestBuilderGetQueryParameters **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint.List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +type ItemDiscussionsItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion. + Content *i6dd5ca9d4904490106446bf5042ab3041508274ee6e42e98d8ce0d837eae7dfc.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemDiscussionsItemReactionsRequestBuilderInternal instantiates a new ItemDiscussionsItemReactionsRequestBuilder and sets the default values. +func NewItemDiscussionsItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsItemReactionsRequestBuilder) { + m := &ItemDiscussionsItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/discussions/{discussion_number}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemDiscussionsItemReactionsRequestBuilder instantiates a new ItemDiscussionsItemReactionsRequestBuilder and sets the default values. +func NewItemDiscussionsItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDiscussionsItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint.List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a []Reactionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy +func (m *ItemDiscussionsItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDiscussionsItemReactionsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable) + } + } + return val, nil +} +// Post **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint.Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).A response with an HTTP `200` status means that you already added the reaction type to this team discussion.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a Reactionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy +func (m *ItemDiscussionsItemReactionsRequestBuilder) Post(ctx context.Context, body ItemDiscussionsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateReactionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Reactionable), nil +} +// ToGetRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint.List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDiscussionsItemReactionsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint.Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).A response with an HTTP `200` status means that you already added the reaction type to this team discussion.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemDiscussionsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemDiscussionsItemReactionsRequestBuilder when successful +func (m *ItemDiscussionsItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemDiscussionsItemReactionsRequestBuilder) { + return NewItemDiscussionsItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_with_discussion_number_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_with_discussion_number_patch_request_body.go new file mode 100644 index 000000000..6922f1863 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_item_with_discussion_number_patch_request_body.go @@ -0,0 +1,109 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemDiscussionsItemWithDiscussion_numberPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The discussion post's body text. + body *string + // The discussion post's title. + title *string +} +// NewItemDiscussionsItemWithDiscussion_numberPatchRequestBody instantiates a new ItemDiscussionsItemWithDiscussion_numberPatchRequestBody and sets the default values. +func NewItemDiscussionsItemWithDiscussion_numberPatchRequestBody()(*ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) { + m := &ItemDiscussionsItemWithDiscussion_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDiscussionsItemWithDiscussion_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDiscussionsItemWithDiscussion_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDiscussionsItemWithDiscussion_numberPatchRequestBody(), 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 *ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The discussion post's body text. +// returns a *string when successful +func (m *ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetTitle gets the title property value. The discussion post's title. +// returns a *string when successful +func (m *ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The discussion post's body text. +func (m *ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) SetBody(value *string)() { + m.body = value +} +// SetTitle sets the title property value. The discussion post's title. +func (m *ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemDiscussionsItemWithDiscussion_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetTitle()(*string) + SetBody(value *string)() + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_post_request_body.go new file mode 100644 index 000000000..118eabbcb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_post_request_body.go @@ -0,0 +1,138 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemDiscussionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The discussion post's body text. + body *string + // Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. + private *bool + // The discussion post's title. + title *string +} +// NewItemDiscussionsPostRequestBody instantiates a new ItemDiscussionsPostRequestBody and sets the default values. +func NewItemDiscussionsPostRequestBody()(*ItemDiscussionsPostRequestBody) { + m := &ItemDiscussionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDiscussionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDiscussionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDiscussionsPostRequestBody(), 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 *ItemDiscussionsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The discussion post's body text. +// returns a *string when successful +func (m *ItemDiscussionsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemDiscussionsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetPrivate gets the private property value. Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. +// returns a *bool when successful +func (m *ItemDiscussionsPostRequestBody) GetPrivate()(*bool) { + return m.private +} +// GetTitle gets the title property value. The discussion post's title. +// returns a *string when successful +func (m *ItemDiscussionsPostRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemDiscussionsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemDiscussionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The discussion post's body text. +func (m *ItemDiscussionsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetPrivate sets the private property value. Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. +func (m *ItemDiscussionsPostRequestBody) SetPrivate(value *bool)() { + m.private = value +} +// SetTitle sets the title property value. The discussion post's title. +func (m *ItemDiscussionsPostRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemDiscussionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetPrivate()(*bool) + GetTitle()(*string) + SetBody(value *string)() + SetPrivate(value *bool)() + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_request_builder.go new file mode 100644 index 000000000..f21df3417 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_request_builder.go @@ -0,0 +1,118 @@ +package teams + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i52da346299abb3525b9c53189aa635a523f7fc85ce05d7504dd361e4b8b8e0e0 "github.com/octokit/go-sdk/pkg/github/teams/item/discussions" +) + +// ItemDiscussionsRequestBuilder builds and executes requests for operations under \teams\{team_id}\discussions +type ItemDiscussionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemDiscussionsRequestBuilderGetQueryParameters **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint.List all discussions on a team's page.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +type ItemDiscussionsRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i52da346299abb3525b9c53189aa635a523f7fc85ce05d7504dd361e4b8b8e0e0.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByDiscussion_number gets an item from the github.com/octokit/go-sdk/pkg/github.teams.item.discussions.item collection +// Deprecated: +// returns a *ItemDiscussionsWithDiscussion_numberItemRequestBuilder when successful +func (m *ItemDiscussionsRequestBuilder) ByDiscussion_number(discussion_number int32)(*ItemDiscussionsWithDiscussion_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["discussion_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(discussion_number), 10) + return NewItemDiscussionsWithDiscussion_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDiscussionsRequestBuilderInternal instantiates a new ItemDiscussionsRequestBuilder and sets the default values. +func NewItemDiscussionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsRequestBuilder) { + m := &ItemDiscussionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/discussions{?direction*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemDiscussionsRequestBuilder instantiates a new ItemDiscussionsRequestBuilder and sets the default values. +func NewItemDiscussionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDiscussionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint.List all discussions on a team's page.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a []TeamDiscussionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussions#list-discussions-legacy +func (m *ItemDiscussionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDiscussionsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamDiscussionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable) + } + } + return val, nil +} +// Post **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint.Creates a new discussion post on a team's page.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a TeamDiscussionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussions#create-a-discussion-legacy +func (m *ItemDiscussionsRequestBuilder) Post(ctx context.Context, body ItemDiscussionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamDiscussionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable), nil +} +// ToGetRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint.List all discussions on a team's page.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDiscussionsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint.Creates a new discussion post on a team's page.This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemDiscussionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemDiscussionsRequestBuilder when successful +func (m *ItemDiscussionsRequestBuilder) WithUrl(rawUrl string)(*ItemDiscussionsRequestBuilder) { + return NewItemDiscussionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_with_discussion_number_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_with_discussion_number_item_request_builder.go new file mode 100644 index 000000000..17361e039 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_discussions_with_discussion_number_item_request_builder.go @@ -0,0 +1,127 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemDiscussionsWithDiscussion_numberItemRequestBuilder builds and executes requests for operations under \teams\{team_id}\discussions\{discussion_number} +type ItemDiscussionsWithDiscussion_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Comments the comments property +// returns a *ItemDiscussionsItemCommentsRequestBuilder when successful +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) Comments()(*ItemDiscussionsItemCommentsRequestBuilder) { + return NewItemDiscussionsItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDiscussionsWithDiscussion_numberItemRequestBuilderInternal instantiates a new ItemDiscussionsWithDiscussion_numberItemRequestBuilder and sets the default values. +func NewItemDiscussionsWithDiscussion_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsWithDiscussion_numberItemRequestBuilder) { + m := &ItemDiscussionsWithDiscussion_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/discussions/{discussion_number}", pathParameters), + } + return m +} +// NewItemDiscussionsWithDiscussion_numberItemRequestBuilder instantiates a new ItemDiscussionsWithDiscussion_numberItemRequestBuilder and sets the default values. +func NewItemDiscussionsWithDiscussion_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsWithDiscussion_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDiscussionsWithDiscussion_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint.Delete a discussion from a team's page.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussions#delete-a-discussion-legacy +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint.Get a specific discussion on a team's page.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a TeamDiscussionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussions#get-a-discussion-legacy +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamDiscussionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable), nil +} +// Patch **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint.Edits the title and body text of a discussion post. Only the parameters you provide are updated.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a TeamDiscussionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/discussions#update-a-discussion-legacy +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) Patch(ctx context.Context, body ItemDiscussionsItemWithDiscussion_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamDiscussionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamDiscussionable), nil +} +// Reactions the reactions property +// returns a *ItemDiscussionsItemReactionsRequestBuilder when successful +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) Reactions()(*ItemDiscussionsItemReactionsRequestBuilder) { + return NewItemDiscussionsItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint.Delete a discussion from a team's page.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint.Get a specific discussion on a team's page.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint.Edits the title and body text of a discussion post. Only the parameters you provide are updated.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemDiscussionsItemWithDiscussion_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemDiscussionsWithDiscussion_numberItemRequestBuilder when successful +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemDiscussionsWithDiscussion_numberItemRequestBuilder) { + return NewItemDiscussionsWithDiscussion_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_invitations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_invitations_request_builder.go new file mode 100644 index 000000000..5578317c9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_invitations_request_builder.go @@ -0,0 +1,70 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemInvitationsRequestBuilder builds and executes requests for operations under \teams\{team_id}\invitations +type ItemInvitationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemInvitationsRequestBuilderGetQueryParameters **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint.The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. +type ItemInvitationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemInvitationsRequestBuilderInternal instantiates a new ItemInvitationsRequestBuilder and sets the default values. +func NewItemInvitationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInvitationsRequestBuilder) { + m := &ItemInvitationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/invitations{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemInvitationsRequestBuilder instantiates a new ItemInvitationsRequestBuilder and sets the default values. +func NewItemInvitationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInvitationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemInvitationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint.The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. +// Deprecated: +// returns a []OrganizationInvitationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/members#list-pending-team-invitations-legacy +func (m *ItemInvitationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemInvitationsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationInvitationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationInvitationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationInvitationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationInvitationable) + } + } + return val, nil +} +// ToGetRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint.The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemInvitationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemInvitationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemInvitationsRequestBuilder when successful +func (m *ItemInvitationsRequestBuilder) WithUrl(rawUrl string)(*ItemInvitationsRequestBuilder) { + return NewItemInvitationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_members_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_members_request_builder.go new file mode 100644 index 000000000..e83e07c77 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_members_request_builder.go @@ -0,0 +1,90 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i07b4692185bf98da4f7f935bafdccb4fb97722c77a14ee791910754a6c7b7fa4 "github.com/octokit/go-sdk/pkg/github/teams/item/members" +) + +// ItemMembersRequestBuilder builds and executes requests for operations under \teams\{team_id}\members +type ItemMembersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemMembersRequestBuilderGetQueryParameters **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint.Team members will include the members of child teams. +type ItemMembersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Filters members returned by their role in the team. + Role *i07b4692185bf98da4f7f935bafdccb4fb97722c77a14ee791910754a6c7b7fa4.GetRoleQueryParameterType `uriparametername:"role"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk/pkg/github.teams.item.members.item collection +// Deprecated: +// returns a *ItemMembersWithUsernameItemRequestBuilder when successful +func (m *ItemMembersRequestBuilder) ByUsername(username string)(*ItemMembersWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemMembersWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemMembersRequestBuilderInternal instantiates a new ItemMembersRequestBuilder and sets the default values. +func NewItemMembersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersRequestBuilder) { + m := &ItemMembersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/members{?page*,per_page*,role*}", pathParameters), + } + return m +} +// NewItemMembersRequestBuilder instantiates a new ItemMembersRequestBuilder and sets the default values. +func NewItemMembersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint.Team members will include the members of child teams. +// Deprecated: +// returns a []SimpleUserable 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/teams/members#list-team-members-legacy +func (m *ItemMembersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMembersRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint.Team members will include the members of child teams. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemMembersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMembersRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemMembersRequestBuilder when successful +func (m *ItemMembersRequestBuilder) WithUrl(rawUrl string)(*ItemMembersRequestBuilder) { + return NewItemMembersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_members_with_username_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_members_with_username_item_request_builder.go new file mode 100644 index 000000000..5a954c853 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_members_with_username_item_request_builder.go @@ -0,0 +1,108 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemMembersWithUsernameItemRequestBuilder builds and executes requests for operations under \teams\{team_id}\members\{username} +type ItemMembersWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemMembersWithUsernameItemRequestBuilderInternal instantiates a new ItemMembersWithUsernameItemRequestBuilder and sets the default values. +func NewItemMembersWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersWithUsernameItemRequestBuilder) { + m := &ItemMembersWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/members/{username}", pathParameters), + } + return m +} +// NewItemMembersWithUsernameItemRequestBuilder instantiates a new ItemMembersWithUsernameItemRequestBuilder and sets the default values. +func NewItemMembersWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembersWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete the "Remove team member" endpoint (described below) is deprecated.We recommend using the [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team.**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." +// Deprecated: +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/members#remove-team-member-legacy +func (m *ItemMembersWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get the "Get team member" endpoint (described below) is deprecated.We recommend using the [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships.To list members in a team, the team must be visible to the authenticated user. +// Deprecated: +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/members#get-team-member-legacy +func (m *ItemMembersWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put the "Add team member" endpoint (described below) is deprecated.We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization.**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." +// Deprecated: +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/members#add-team-member-legacy +func (m *ItemMembersWithUsernameItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation the "Remove team member" endpoint (described below) is deprecated.We recommend using the [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team.**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemMembersWithUsernameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation the "Get team member" endpoint (described below) is deprecated.We recommend using the [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships.To list members in a team, the team must be visible to the authenticated user. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemMembersWithUsernameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToPutRequestInformation the "Add team member" endpoint (described below) is deprecated.We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization.**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemMembersWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemMembersWithUsernameItemRequestBuilder when successful +func (m *ItemMembersWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemMembersWithUsernameItemRequestBuilder) { + return NewItemMembersWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_memberships_item_with_username_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_memberships_item_with_username_put_request_body.go new file mode 100644 index 000000000..a5846458a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_memberships_item_with_username_put_request_body.go @@ -0,0 +1,51 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemMembershipsItemWithUsernamePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemMembershipsItemWithUsernamePutRequestBody instantiates a new ItemMembershipsItemWithUsernamePutRequestBody and sets the default values. +func NewItemMembershipsItemWithUsernamePutRequestBody()(*ItemMembershipsItemWithUsernamePutRequestBody) { + m := &ItemMembershipsItemWithUsernamePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemMembershipsItemWithUsernamePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemMembershipsItemWithUsernamePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemMembershipsItemWithUsernamePutRequestBody(), 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 *ItemMembershipsItemWithUsernamePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemMembershipsItemWithUsernamePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemMembershipsItemWithUsernamePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemMembershipsItemWithUsernamePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemMembershipsItemWithUsernamePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_memberships_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_memberships_request_builder.go new file mode 100644 index 000000000..3e272e858 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_memberships_request_builder.go @@ -0,0 +1,36 @@ +package teams + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemMembershipsRequestBuilder builds and executes requests for operations under \teams\{team_id}\memberships +type ItemMembershipsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByUsername gets an item from the github.com/octokit/go-sdk/pkg/github.teams.item.memberships.item collection +// Deprecated: +// returns a *ItemMembershipsWithUsernameItemRequestBuilder when successful +func (m *ItemMembershipsRequestBuilder) ByUsername(username string)(*ItemMembershipsWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemMembershipsWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemMembershipsRequestBuilderInternal instantiates a new ItemMembershipsRequestBuilder and sets the default values. +func NewItemMembershipsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembershipsRequestBuilder) { + m := &ItemMembershipsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/memberships", pathParameters), + } + return m +} +// NewItemMembershipsRequestBuilder instantiates a new ItemMembershipsRequestBuilder and sets the default values. +func NewItemMembershipsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembershipsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembershipsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_memberships_with_username_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_memberships_with_username_item_request_builder.go new file mode 100644 index 000000000..5ddfb3597 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_memberships_with_username_item_request_builder.go @@ -0,0 +1,125 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemMembershipsWithUsernameItemRequestBuilder builds and executes requests for operations under \teams\{team_id}\memberships\{username} +type ItemMembershipsWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemMembershipsWithUsernameItemRequestBuilderInternal instantiates a new ItemMembershipsWithUsernameItemRequestBuilder and sets the default values. +func NewItemMembershipsWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembershipsWithUsernameItemRequestBuilder) { + m := &ItemMembershipsWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/memberships/{username}", pathParameters), + } + return m +} +// NewItemMembershipsWithUsernameItemRequestBuilder instantiates a new ItemMembershipsWithUsernameItemRequestBuilder and sets the default values. +func NewItemMembershipsWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembershipsWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembershipsWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." +// Deprecated: +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user-legacy +func (m *ItemMembershipsWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint.Team members will include the members of child teams.To get a user's membership with a team, the team must be visible to the authenticated user.**Note:**The response contains the `state` of the membership and the member's `role`.The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team). +// Deprecated: +// returns a TeamMembershipable 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/teams/members#get-team-membership-for-a-user-legacy +func (m *ItemMembershipsWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamMembershipable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamMembershipFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamMembershipable), nil +} +// Put **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer.**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."If the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner.If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. +// Deprecated: +// returns a TeamMembershipable 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/teams/members#add-or-update-team-membership-for-a-user-legacy +func (m *ItemMembershipsWithUsernameItemRequestBuilder) Put(ctx context.Context, body ItemMembershipsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamMembershipable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamMembershipFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamMembershipable), nil +} +// ToDeleteRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemMembershipsWithUsernameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint.Team members will include the members of child teams.To get a user's membership with a team, the team must be visible to the authenticated user.**Note:**The response contains the `state` of the membership and the member's `role`.The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team). +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemMembershipsWithUsernameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer.**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."If the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner.If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemMembershipsWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemMembershipsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemMembershipsWithUsernameItemRequestBuilder when successful +func (m *ItemMembershipsWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemMembershipsWithUsernameItemRequestBuilder) { + return NewItemMembershipsWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_projects_item_with_project_403_error.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_projects_item_with_project_403_error.go new file mode 100644 index 000000000..a05755eb4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_projects_item_with_project_403_error.go @@ -0,0 +1,117 @@ +package teams + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemProjectsItemWithProject_403Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewItemProjectsItemWithProject_403Error instantiates a new ItemProjectsItemWithProject_403Error and sets the default values. +func NewItemProjectsItemWithProject_403Error()(*ItemProjectsItemWithProject_403Error) { + m := &ItemProjectsItemWithProject_403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemProjectsItemWithProject_403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemProjectsItemWithProject_403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemProjectsItemWithProject_403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemProjectsItemWithProject_403Error) Error()(string) { + return m.ApiError.Error() +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemProjectsItemWithProject_403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ItemProjectsItemWithProject_403Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemProjectsItemWithProject_403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["documentation_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentationUrl(val) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ItemProjectsItemWithProject_403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemProjectsItemWithProject_403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + 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 *ItemProjectsItemWithProject_403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemProjectsItemWithProject_403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *ItemProjectsItemWithProject_403Error) SetMessage(value *string)() { + m.message = value +} +type ItemProjectsItemWithProject_403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_projects_item_with_project_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_projects_item_with_project_put_request_body.go new file mode 100644 index 000000000..173232ac7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_projects_item_with_project_put_request_body.go @@ -0,0 +1,51 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemProjectsItemWithProject_PutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemProjectsItemWithProject_PutRequestBody instantiates a new ItemProjectsItemWithProject_PutRequestBody and sets the default values. +func NewItemProjectsItemWithProject_PutRequestBody()(*ItemProjectsItemWithProject_PutRequestBody) { + m := &ItemProjectsItemWithProject_PutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemProjectsItemWithProject_PutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemProjectsItemWithProject_PutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemProjectsItemWithProject_PutRequestBody(), 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 *ItemProjectsItemWithProject_PutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemProjectsItemWithProject_PutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemProjectsItemWithProject_PutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemProjectsItemWithProject_PutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemProjectsItemWithProject_PutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_projects_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_projects_request_builder.go new file mode 100644 index 000000000..4c6f427b8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_projects_request_builder.go @@ -0,0 +1,86 @@ +package teams + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemProjectsRequestBuilder builds and executes requests for operations under \teams\{team_id}\projects +type ItemProjectsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemProjectsRequestBuilderGetQueryParameters **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/rest/teams/teams#list-team-projects) endpoint.Lists the organization projects for a team. +type ItemProjectsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByProject_id gets an item from the github.com/octokit/go-sdk/pkg/github.teams.item.projects.item collection +// Deprecated: +// returns a *ItemProjectsWithProject_ItemRequestBuilder when successful +func (m *ItemProjectsRequestBuilder) ByProject_id(project_id int32)(*ItemProjectsWithProject_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["project_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(project_id), 10) + return NewItemProjectsWithProject_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemProjectsRequestBuilderInternal instantiates a new ItemProjectsRequestBuilder and sets the default values. +func NewItemProjectsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProjectsRequestBuilder) { + m := &ItemProjectsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/projects{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemProjectsRequestBuilder instantiates a new ItemProjectsRequestBuilder and sets the default values. +func NewItemProjectsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProjectsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemProjectsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/rest/teams/teams#list-team-projects) endpoint.Lists the organization projects for a team. +// Deprecated: +// returns a []TeamProjectable 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/teams/teams#list-team-projects-legacy +func (m *ItemProjectsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemProjectsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamProjectable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamProjectable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamProjectable) + } + } + return val, nil +} +// ToGetRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/rest/teams/teams#list-team-projects) endpoint.Lists the organization projects for a team. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemProjectsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemProjectsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemProjectsRequestBuilder when successful +func (m *ItemProjectsRequestBuilder) WithUrl(rawUrl string)(*ItemProjectsRequestBuilder) { + return NewItemProjectsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_projects_with_project_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_projects_with_project_item_request_builder.go new file mode 100644 index 000000000..fa8dbbe6a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_projects_with_project_item_request_builder.go @@ -0,0 +1,128 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemProjectsWithProject_ItemRequestBuilder builds and executes requests for operations under \teams\{team_id}\projects\{project_id} +type ItemProjectsWithProject_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemProjectsWithProject_ItemRequestBuilderInternal instantiates a new ItemProjectsWithProject_ItemRequestBuilder and sets the default values. +func NewItemProjectsWithProject_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProjectsWithProject_ItemRequestBuilder) { + m := &ItemProjectsWithProject_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/projects/{project_id}", pathParameters), + } + return m +} +// NewItemProjectsWithProject_ItemRequestBuilder instantiates a new ItemProjectsWithProject_ItemRequestBuilder and sets the default values. +func NewItemProjectsWithProject_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProjectsWithProject_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemProjectsWithProject_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team) endpoint.Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. +// Deprecated: +// 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] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team-legacy +func (m *ItemProjectsWithProject_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project) endpoint.Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. +// Deprecated: +// returns a TeamProjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project-legacy +func (m *ItemProjectsWithProject_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamProjectable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamProjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamProjectable), nil +} +// Put **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions) endpoint.Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization. +// Deprecated: +// returns a ItemProjectsItemWithProject_403Error error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions-legacy +func (m *ItemProjectsWithProject_ItemRequestBuilder) Put(ctx context.Context, body ItemProjectsItemWithProject_PutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": CreateItemProjectsItemWithProject_403ErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team) endpoint.Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemProjectsWithProject_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project) endpoint.Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemProjectsWithProject_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions) endpoint.Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemProjectsWithProject_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemProjectsItemWithProject_PutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemProjectsWithProject_ItemRequestBuilder when successful +func (m *ItemProjectsWithProject_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemProjectsWithProject_ItemRequestBuilder) { + return NewItemProjectsWithProject_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_repos_item_item_with_repo_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_repos_item_item_with_repo_put_request_body.go new file mode 100644 index 000000000..978ca7c48 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_repos_item_item_with_repo_put_request_body.go @@ -0,0 +1,51 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemReposItemItemWithRepoPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemReposItemItemWithRepoPutRequestBody instantiates a new ItemReposItemItemWithRepoPutRequestBody and sets the default values. +func NewItemReposItemItemWithRepoPutRequestBody()(*ItemReposItemItemWithRepoPutRequestBody) { + m := &ItemReposItemItemWithRepoPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemReposItemItemWithRepoPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemReposItemItemWithRepoPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemReposItemItemWithRepoPutRequestBody(), 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 *ItemReposItemItemWithRepoPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemReposItemItemWithRepoPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemReposItemItemWithRepoPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemReposItemItemWithRepoPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemReposItemItemWithRepoPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_repos_item_with_repo_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_repos_item_with_repo_item_request_builder.go new file mode 100644 index 000000000..4ebd025e3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_repos_item_with_repo_item_request_builder.go @@ -0,0 +1,119 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemReposItemWithRepoItemRequestBuilder builds and executes requests for operations under \teams\{team_id}\repos\{owner}\{repo} +type ItemReposItemWithRepoItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemReposItemWithRepoItemRequestBuilderInternal instantiates a new ItemReposItemWithRepoItemRequestBuilder and sets the default values. +func NewItemReposItemWithRepoItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposItemWithRepoItemRequestBuilder) { + m := &ItemReposItemWithRepoItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/repos/{owner}/{repo}", pathParameters), + } + return m +} +// NewItemReposItemWithRepoItemRequestBuilder instantiates a new ItemReposItemWithRepoItemRequestBuilder and sets the default values. +func NewItemReposItemWithRepoItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposItemWithRepoItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemReposItemWithRepoItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint.If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. +// Deprecated: +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team-legacy +func (m *ItemReposItemWithRepoItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get **Note**: Repositories inherited through a parent team will also be checked.**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint.You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `Accept` header: +// Deprecated: +// returns a TeamRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository-legacy +func (m *ItemReposItemWithRepoItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamRepositoryable), nil +} +// Put **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint.To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization.Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." +// Deprecated: +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions-legacy +func (m *ItemReposItemWithRepoItemRequestBuilder) Put(ctx context.Context, body ItemReposItemItemWithRepoPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint.If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemReposItemWithRepoItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation **Note**: Repositories inherited through a parent team will also be checked.**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint.You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `Accept` header: +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemReposItemWithRepoItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint.To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization.Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemReposItemWithRepoItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemReposItemItemWithRepoPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemReposItemWithRepoItemRequestBuilder when successful +func (m *ItemReposItemWithRepoItemRequestBuilder) WithUrl(rawUrl string)(*ItemReposItemWithRepoItemRequestBuilder) { + return NewItemReposItemWithRepoItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_repos_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_repos_request_builder.go new file mode 100644 index 000000000..97c3104a3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_repos_request_builder.go @@ -0,0 +1,86 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemReposRequestBuilder builds and executes requests for operations under \teams\{team_id}\repos +type ItemReposRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemReposRequestBuilderGetQueryParameters **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint. +type ItemReposRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByOwner gets an item from the github.com/octokit/go-sdk/pkg/github.teams.item.repos.item collection +// returns a *ItemReposWithOwnerItemRequestBuilder when successful +func (m *ItemReposRequestBuilder) ByOwner(owner string)(*ItemReposWithOwnerItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if owner != "" { + urlTplParams["owner"] = owner + } + return NewItemReposWithOwnerItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemReposRequestBuilderInternal instantiates a new ItemReposRequestBuilder and sets the default values. +func NewItemReposRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposRequestBuilder) { + m := &ItemReposRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/repos{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemReposRequestBuilder instantiates a new ItemReposRequestBuilder and sets the default values. +func NewItemReposRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemReposRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint. +// Deprecated: +// returns a []MinimalRepositoryable 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/teams/teams#list-team-repositories-legacy +func (m *ItemReposRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReposRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemReposRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReposRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemReposRequestBuilder when successful +func (m *ItemReposRequestBuilder) WithUrl(rawUrl string)(*ItemReposRequestBuilder) { + return NewItemReposRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_repos_with_owner_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_repos_with_owner_item_request_builder.go new file mode 100644 index 000000000..553cab5c3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_repos_with_owner_item_request_builder.go @@ -0,0 +1,36 @@ +package teams + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemReposWithOwnerItemRequestBuilder builds and executes requests for operations under \teams\{team_id}\repos\{owner} +type ItemReposWithOwnerItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRepo gets an item from the github.com/octokit/go-sdk/pkg/github.teams.item.repos.item.item collection +// Deprecated: +// returns a *ItemReposItemWithRepoItemRequestBuilder when successful +func (m *ItemReposWithOwnerItemRequestBuilder) ByRepo(repo string)(*ItemReposItemWithRepoItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if repo != "" { + urlTplParams["repo"] = repo + } + return NewItemReposItemWithRepoItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemReposWithOwnerItemRequestBuilderInternal instantiates a new ItemReposWithOwnerItemRequestBuilder and sets the default values. +func NewItemReposWithOwnerItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposWithOwnerItemRequestBuilder) { + m := &ItemReposWithOwnerItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/repos/{owner}", pathParameters), + } + return m +} +// NewItemReposWithOwnerItemRequestBuilder instantiates a new ItemReposWithOwnerItemRequestBuilder and sets the default values. +func NewItemReposWithOwnerItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposWithOwnerItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemReposWithOwnerItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_teams_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_teams_request_builder.go new file mode 100644 index 000000000..f84caa7d3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_teams_request_builder.go @@ -0,0 +1,78 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemTeamsRequestBuilder builds and executes requests for operations under \teams\{team_id}\teams +type ItemTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsRequestBuilderGetQueryParameters **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint. +type ItemTeamsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemTeamsRequestBuilderInternal instantiates a new ItemTeamsRequestBuilder and sets the default values. +func NewItemTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsRequestBuilder) { + m := &ItemTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/teams{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemTeamsRequestBuilder instantiates a new ItemTeamsRequestBuilder and sets the default values. +func NewItemTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint. +// Deprecated: +// returns a []Teamable when successful +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#list-child-teams-legacy +func (m *ItemTeamsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Teamable) + } + } + return val, nil +} +// ToGetRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemTeamsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *ItemTeamsRequestBuilder when successful +func (m *ItemTeamsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsRequestBuilder) { + return NewItemTeamsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_with_team_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_with_team_patch_request_body.go new file mode 100644 index 000000000..f037c20e8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/item_with_team_patch_request_body.go @@ -0,0 +1,138 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemWithTeam_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The description of the team. + description *string + // The name of the team. + name *string + // The ID of a team to set as the parent team. + parent_team_id *int32 +} +// NewItemWithTeam_PatchRequestBody instantiates a new ItemWithTeam_PatchRequestBody and sets the default values. +func NewItemWithTeam_PatchRequestBody()(*ItemWithTeam_PatchRequestBody) { + m := &ItemWithTeam_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemWithTeam_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemWithTeam_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemWithTeam_PatchRequestBody(), 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 *ItemWithTeam_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description of the team. +// returns a *string when successful +func (m *ItemWithTeam_PatchRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemWithTeam_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["parent_team_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetParentTeamId(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the team. +// returns a *string when successful +func (m *ItemWithTeam_PatchRequestBody) GetName()(*string) { + return m.name +} +// GetParentTeamId gets the parent_team_id property value. The ID of a team to set as the parent team. +// returns a *int32 when successful +func (m *ItemWithTeam_PatchRequestBody) GetParentTeamId()(*int32) { + return m.parent_team_id +} +// Serialize serializes information the current object +func (m *ItemWithTeam_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("parent_team_id", m.GetParentTeamId()) + 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 *ItemWithTeam_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description of the team. +func (m *ItemWithTeam_PatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetName sets the name property value. The name of the team. +func (m *ItemWithTeam_PatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetParentTeamId sets the parent_team_id property value. The ID of a team to set as the parent team. +func (m *ItemWithTeam_PatchRequestBody) SetParentTeamId(value *int32)() { + m.parent_team_id = value +} +type ItemWithTeam_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetName()(*string) + GetParentTeamId()(*int32) + SetDescription(value *string)() + SetName(value *string)() + SetParentTeamId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/teams_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/teams_request_builder.go new file mode 100644 index 000000000..8b1630cd0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/teams_request_builder.go @@ -0,0 +1,35 @@ +package teams + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// TeamsRequestBuilder builds and executes requests for operations under \teams +type TeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByTeam_id gets an item from the github.com/octokit/go-sdk/pkg/github.teams.item collection +// Deprecated: +// returns a *WithTeam_ItemRequestBuilder when successful +func (m *TeamsRequestBuilder) ByTeam_id(team_id int32)(*WithTeam_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["team_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(team_id), 10) + return NewWithTeam_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewTeamsRequestBuilderInternal instantiates a new TeamsRequestBuilder and sets the default values. +func NewTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamsRequestBuilder) { + m := &TeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams", pathParameters), + } + return m +} +// NewTeamsRequestBuilder instantiates a new TeamsRequestBuilder and sets the default values. +func NewTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTeamsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/teams/with_team_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/teams/with_team_item_request_builder.go new file mode 100644 index 000000000..23a503ba7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/teams/with_team_item_request_builder.go @@ -0,0 +1,171 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// WithTeam_ItemRequestBuilder builds and executes requests for operations under \teams\{team_id} +type WithTeam_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithTeam_ItemRequestBuilderInternal instantiates a new WithTeam_ItemRequestBuilder and sets the default values. +func NewWithTeam_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithTeam_ItemRequestBuilder) { + m := &WithTeam_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}", pathParameters), + } + return m +} +// NewWithTeam_ItemRequestBuilder instantiates a new WithTeam_ItemRequestBuilder and sets the default values. +func NewWithTeam_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithTeam_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithTeam_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint.To delete a team, the authenticated user must be an organization owner or team maintainer.If you are an organization owner, deleting a parent team will delete all of its child teams as well. +// Deprecated: +// 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] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#delete-a-team-legacy +func (m *WithTeam_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Discussions the discussions property +// returns a *ItemDiscussionsRequestBuilder when successful +func (m *WithTeam_ItemRequestBuilder) Discussions()(*ItemDiscussionsRequestBuilder) { + return NewItemDiscussionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. +// Deprecated: +// returns a TeamFullable 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/teams/teams#get-a-team-legacy +func (m *WithTeam_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamFullable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamFullFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamFullable), nil +} +// Invitations the invitations property +// returns a *ItemInvitationsRequestBuilder when successful +func (m *WithTeam_ItemRequestBuilder) Invitations()(*ItemInvitationsRequestBuilder) { + return NewItemInvitationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Members the members property +// returns a *ItemMembersRequestBuilder when successful +func (m *WithTeam_ItemRequestBuilder) Members()(*ItemMembersRequestBuilder) { + return NewItemMembersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Memberships the memberships property +// returns a *ItemMembershipsRequestBuilder when successful +func (m *WithTeam_ItemRequestBuilder) Memberships()(*ItemMembershipsRequestBuilder) { + return NewItemMembershipsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint.To edit a team, the authenticated user must either be an organization owner or a team maintainer.**Note:** With nested teams, the `privacy` for parent teams cannot be `secret`. +// Deprecated: +// returns a TeamFullable when successful +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#update-a-team-legacy +func (m *WithTeam_ItemRequestBuilder) Patch(ctx context.Context, body ItemWithTeam_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamFullable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamFullFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamFullable), nil +} +// Projects the projects property +// returns a *ItemProjectsRequestBuilder when successful +func (m *WithTeam_ItemRequestBuilder) Projects()(*ItemProjectsRequestBuilder) { + return NewItemProjectsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repos the repos property +// returns a *ItemReposRequestBuilder when successful +func (m *WithTeam_ItemRequestBuilder) Repos()(*ItemReposRequestBuilder) { + return NewItemReposRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Teams the teams property +// returns a *ItemTeamsRequestBuilder when successful +func (m *WithTeam_ItemRequestBuilder) Teams()(*ItemTeamsRequestBuilder) { + return NewItemTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint.To delete a team, the authenticated user must be an organization owner or team maintainer.If you are an organization owner, deleting a parent team will delete all of its child teams as well. +// Deprecated: +// returns a *RequestInformation when successful +func (m *WithTeam_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *WithTeam_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint.To edit a team, the authenticated user must either be an organization owner or a team maintainer.**Note:** With nested teams, the `privacy` for parent teams cannot be `secret`. +// Deprecated: +// returns a *RequestInformation when successful +func (m *WithTeam_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemWithTeam_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: +// returns a *WithTeam_ItemRequestBuilder when successful +func (m *WithTeam_ItemRequestBuilder) WithUrl(rawUrl string)(*WithTeam_ItemRequestBuilder) { + return NewWithTeam_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/blocks_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/blocks_request_builder.go new file mode 100644 index 000000000..841e5eaf7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/blocks_request_builder.go @@ -0,0 +1,87 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// BlocksRequestBuilder builds and executes requests for operations under \user\blocks +type BlocksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// BlocksRequestBuilderGetQueryParameters list the users you've blocked on your personal account. +type BlocksRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk/pkg/github.user.blocks.item collection +// returns a *BlocksWithUsernameItemRequestBuilder when successful +func (m *BlocksRequestBuilder) ByUsername(username string)(*BlocksWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewBlocksWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewBlocksRequestBuilderInternal instantiates a new BlocksRequestBuilder and sets the default values. +func NewBlocksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*BlocksRequestBuilder) { + m := &BlocksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/blocks{?page*,per_page*}", pathParameters), + } + return m +} +// NewBlocksRequestBuilder instantiates a new BlocksRequestBuilder and sets the default values. +func NewBlocksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*BlocksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewBlocksRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the users you've blocked on your personal account. +// returns a []SimpleUserable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user +func (m *BlocksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[BlocksRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation list the users you've blocked on your personal account. +// returns a *RequestInformation when successful +func (m *BlocksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[BlocksRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *BlocksRequestBuilder when successful +func (m *BlocksRequestBuilder) WithUrl(rawUrl string)(*BlocksRequestBuilder) { + return NewBlocksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/blocks_with_username_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/blocks_with_username_item_request_builder.go new file mode 100644 index 000000000..099c0175d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/blocks_with_username_item_request_builder.go @@ -0,0 +1,125 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// BlocksWithUsernameItemRequestBuilder builds and executes requests for operations under \user\blocks\{username} +type BlocksWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewBlocksWithUsernameItemRequestBuilderInternal instantiates a new BlocksWithUsernameItemRequestBuilder and sets the default values. +func NewBlocksWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*BlocksWithUsernameItemRequestBuilder) { + m := &BlocksWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/blocks/{username}", pathParameters), + } + return m +} +// NewBlocksWithUsernameItemRequestBuilder instantiates a new BlocksWithUsernameItemRequestBuilder and sets the default values. +func NewBlocksWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*BlocksWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewBlocksWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete unblocks the given user and returns a 204. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/blocking#unblock-a-user +func (m *BlocksWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get returns a 204 if the given user is blocked by the authenticated user. Returns a 404 if the given user is not blocked by the authenticated user, or if the given user account has been identified as spam by GitHub. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user +func (m *BlocksWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put blocks the given user and returns a 204. If the authenticated user cannot block the given user a 422 is returned. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/users/blocking#block-a-user +func (m *BlocksWithUsernameItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation unblocks the given user and returns a 204. +// returns a *RequestInformation when successful +func (m *BlocksWithUsernameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation returns a 204 if the given user is blocked by the authenticated user. Returns a 404 if the given user is not blocked by the authenticated user, or if the given user account has been identified as spam by GitHub. +// returns a *RequestInformation when successful +func (m *BlocksWithUsernameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation blocks the given user and returns a 204. If the authenticated user cannot block the given user a 422 is returned. +// returns a *RequestInformation when successful +func (m *BlocksWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *BlocksWithUsernameItemRequestBuilder when successful +func (m *BlocksWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*BlocksWithUsernameItemRequestBuilder) { + return NewBlocksWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_get_response.go new file mode 100644 index 000000000..f1f77539d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_get_response.go @@ -0,0 +1,122 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type CodespacesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The codespaces property + codespaces []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable + // The total_count property + total_count *int32 +} +// NewCodespacesGetResponse instantiates a new CodespacesGetResponse and sets the default values. +func NewCodespacesGetResponse()(*CodespacesGetResponse) { + m := &CodespacesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesGetResponse(), 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 *CodespacesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCodespaces gets the codespaces property value. The codespaces property +// returns a []Codespaceable when successful +func (m *CodespacesGetResponse) GetCodespaces()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable) { + return m.codespaces +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["codespaces"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespaceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable) + } + } + m.SetCodespaces(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *CodespacesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *CodespacesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCodespaces() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCodespaces())) + for i, v := range m.GetCodespaces() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("codespaces", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CodespacesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCodespaces sets the codespaces property value. The codespaces property +func (m *CodespacesGetResponse) SetCodespaces(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable)() { + m.codespaces = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *CodespacesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type CodespacesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCodespaces()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable) + GetTotalCount()(*int32) + SetCodespaces(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_exports_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_exports_request_builder.go new file mode 100644 index 000000000..edb8db0bd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_exports_request_builder.go @@ -0,0 +1,81 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// CodespacesItemExportsRequestBuilder builds and executes requests for operations under \user\codespaces\{codespace_name}\exports +type CodespacesItemExportsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByExport_id gets an item from the github.com/octokit/go-sdk/pkg/github.user.codespaces.item.exports.item collection +// returns a *CodespacesItemExportsWithExport_ItemRequestBuilder when successful +func (m *CodespacesItemExportsRequestBuilder) ByExport_id(export_id string)(*CodespacesItemExportsWithExport_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if export_id != "" { + urlTplParams["export_id"] = export_id + } + return NewCodespacesItemExportsWithExport_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewCodespacesItemExportsRequestBuilderInternal instantiates a new CodespacesItemExportsRequestBuilder and sets the default values. +func NewCodespacesItemExportsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesItemExportsRequestBuilder) { + m := &CodespacesItemExportsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/codespaces/{codespace_name}/exports", pathParameters), + } + return m +} +// NewCodespacesItemExportsRequestBuilder instantiates a new CodespacesItemExportsRequestBuilder and sets the default values. +func NewCodespacesItemExportsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesItemExportsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCodespacesItemExportsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post triggers an export of the specified codespace and returns a URL and ID where the status of the export can be monitored.If changes cannot be pushed to the codespace's repository, they will be pushed to a new or previously-existing fork instead.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a CodespaceExportDetailsable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/codespaces#export-a-codespace-for-the-authenticated-user +func (m *CodespacesItemExportsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceExportDetailsable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespaceExportDetailsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceExportDetailsable), nil +} +// ToPostRequestInformation triggers an export of the specified codespace and returns a URL and ID where the status of the export can be monitored.If changes cannot be pushed to the codespace's repository, they will be pushed to a new or previously-existing fork instead.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesItemExportsRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *CodespacesItemExportsRequestBuilder when successful +func (m *CodespacesItemExportsRequestBuilder) WithUrl(rawUrl string)(*CodespacesItemExportsRequestBuilder) { + return NewCodespacesItemExportsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_exports_with_export_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_exports_with_export_item_request_builder.go new file mode 100644 index 000000000..a771d21b9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_exports_with_export_item_request_builder.go @@ -0,0 +1,61 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// CodespacesItemExportsWithExport_ItemRequestBuilder builds and executes requests for operations under \user\codespaces\{codespace_name}\exports\{export_id} +type CodespacesItemExportsWithExport_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewCodespacesItemExportsWithExport_ItemRequestBuilderInternal instantiates a new CodespacesItemExportsWithExport_ItemRequestBuilder and sets the default values. +func NewCodespacesItemExportsWithExport_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesItemExportsWithExport_ItemRequestBuilder) { + m := &CodespacesItemExportsWithExport_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/codespaces/{codespace_name}/exports/{export_id}", pathParameters), + } + return m +} +// NewCodespacesItemExportsWithExport_ItemRequestBuilder instantiates a new CodespacesItemExportsWithExport_ItemRequestBuilder and sets the default values. +func NewCodespacesItemExportsWithExport_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesItemExportsWithExport_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCodespacesItemExportsWithExport_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets information about an export of a codespace.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a CodespaceExportDetailsable 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/codespaces/codespaces#get-details-about-a-codespace-export +func (m *CodespacesItemExportsWithExport_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceExportDetailsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespaceExportDetailsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceExportDetailsable), nil +} +// ToGetRequestInformation gets information about an export of a codespace.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesItemExportsWithExport_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *CodespacesItemExportsWithExport_ItemRequestBuilder when successful +func (m *CodespacesItemExportsWithExport_ItemRequestBuilder) WithUrl(rawUrl string)(*CodespacesItemExportsWithExport_ItemRequestBuilder) { + return NewCodespacesItemExportsWithExport_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_machines_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_machines_get_response.go new file mode 100644 index 000000000..762bb82ed --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_machines_get_response.go @@ -0,0 +1,122 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type CodespacesItemMachinesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The machines property + machines []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceMachineable + // The total_count property + total_count *int32 +} +// NewCodespacesItemMachinesGetResponse instantiates a new CodespacesItemMachinesGetResponse and sets the default values. +func NewCodespacesItemMachinesGetResponse()(*CodespacesItemMachinesGetResponse) { + m := &CodespacesItemMachinesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesItemMachinesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesItemMachinesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesItemMachinesGetResponse(), 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 *CodespacesItemMachinesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesItemMachinesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["machines"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespaceMachineFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceMachineable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceMachineable) + } + } + m.SetMachines(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetMachines gets the machines property value. The machines property +// returns a []CodespaceMachineable when successful +func (m *CodespacesItemMachinesGetResponse) GetMachines()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceMachineable) { + return m.machines +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *CodespacesItemMachinesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *CodespacesItemMachinesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetMachines() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMachines())) + for i, v := range m.GetMachines() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("machines", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CodespacesItemMachinesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMachines sets the machines property value. The machines property +func (m *CodespacesItemMachinesGetResponse) SetMachines(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceMachineable)() { + m.machines = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *CodespacesItemMachinesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type CodespacesItemMachinesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMachines()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceMachineable) + GetTotalCount()(*int32) + SetMachines(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceMachineable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_machines_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_machines_request_builder.go new file mode 100644 index 000000000..0ec00382c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_machines_request_builder.go @@ -0,0 +1,67 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// CodespacesItemMachinesRequestBuilder builds and executes requests for operations under \user\codespaces\{codespace_name}\machines +type CodespacesItemMachinesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewCodespacesItemMachinesRequestBuilderInternal instantiates a new CodespacesItemMachinesRequestBuilder and sets the default values. +func NewCodespacesItemMachinesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesItemMachinesRequestBuilder) { + m := &CodespacesItemMachinesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/codespaces/{codespace_name}/machines", pathParameters), + } + return m +} +// NewCodespacesItemMachinesRequestBuilder instantiates a new CodespacesItemMachinesRequestBuilder and sets the default values. +func NewCodespacesItemMachinesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesItemMachinesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCodespacesItemMachinesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the machine types a codespace can transition to use.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a CodespacesItemMachinesGetResponseable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/machines#list-machine-types-for-a-codespace +func (m *CodespacesItemMachinesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(CodespacesItemMachinesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateCodespacesItemMachinesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(CodespacesItemMachinesGetResponseable), nil +} +// ToGetRequestInformation list the machine types a codespace can transition to use.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesItemMachinesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *CodespacesItemMachinesRequestBuilder when successful +func (m *CodespacesItemMachinesRequestBuilder) WithUrl(rawUrl string)(*CodespacesItemMachinesRequestBuilder) { + return NewCodespacesItemMachinesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_machines_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_machines_response.go new file mode 100644 index 000000000..d573702a3 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_machines_response.go @@ -0,0 +1,28 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodespacesItemMachinesResponse +// Deprecated: This class is obsolete. Use machinesGetResponse instead. +type CodespacesItemMachinesResponse struct { + CodespacesItemMachinesGetResponse +} +// NewCodespacesItemMachinesResponse instantiates a new CodespacesItemMachinesResponse and sets the default values. +func NewCodespacesItemMachinesResponse()(*CodespacesItemMachinesResponse) { + m := &CodespacesItemMachinesResponse{ + CodespacesItemMachinesGetResponse: *NewCodespacesItemMachinesGetResponse(), + } + return m +} +// CreateCodespacesItemMachinesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateCodespacesItemMachinesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesItemMachinesResponse(), nil +} +// CodespacesItemMachinesResponseable +// Deprecated: This class is obsolete. Use machinesGetResponse instead. +type CodespacesItemMachinesResponseable interface { + CodespacesItemMachinesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_publish_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_publish_post_request_body.go new file mode 100644 index 000000000..7f89447cd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_publish_post_request_body.go @@ -0,0 +1,109 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodespacesItemPublishPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A name for the new repository. + name *string + // Whether the new repository should be private. + private *bool +} +// NewCodespacesItemPublishPostRequestBody instantiates a new CodespacesItemPublishPostRequestBody and sets the default values. +func NewCodespacesItemPublishPostRequestBody()(*CodespacesItemPublishPostRequestBody) { + m := &CodespacesItemPublishPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesItemPublishPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesItemPublishPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesItemPublishPostRequestBody(), 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 *CodespacesItemPublishPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesItemPublishPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + return res +} +// GetName gets the name property value. A name for the new repository. +// returns a *string when successful +func (m *CodespacesItemPublishPostRequestBody) GetName()(*string) { + return m.name +} +// GetPrivate gets the private property value. Whether the new repository should be private. +// returns a *bool when successful +func (m *CodespacesItemPublishPostRequestBody) GetPrivate()(*bool) { + return m.private +} +// Serialize serializes information the current object +func (m *CodespacesItemPublishPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + 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 *CodespacesItemPublishPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. A name for the new repository. +func (m *CodespacesItemPublishPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetPrivate sets the private property value. Whether the new repository should be private. +func (m *CodespacesItemPublishPostRequestBody) SetPrivate(value *bool)() { + m.private = value +} +type CodespacesItemPublishPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetPrivate()(*bool) + SetName(value *string)() + SetPrivate(value *bool)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_publish_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_publish_request_builder.go new file mode 100644 index 000000000..d0f3d04eb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_publish_request_builder.go @@ -0,0 +1,71 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// CodespacesItemPublishRequestBuilder builds and executes requests for operations under \user\codespaces\{codespace_name}\publish +type CodespacesItemPublishRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewCodespacesItemPublishRequestBuilderInternal instantiates a new CodespacesItemPublishRequestBuilder and sets the default values. +func NewCodespacesItemPublishRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesItemPublishRequestBuilder) { + m := &CodespacesItemPublishRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/codespaces/{codespace_name}/publish", pathParameters), + } + return m +} +// NewCodespacesItemPublishRequestBuilder instantiates a new CodespacesItemPublishRequestBuilder and sets the default values. +func NewCodespacesItemPublishRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesItemPublishRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCodespacesItemPublishRequestBuilderInternal(urlParams, requestAdapter) +} +// Post publishes an unpublished codespace, creating a new repository and assigning it to the codespace.The codespace's token is granted write permissions to the repository, allowing the user to push their changes.This will fail for a codespace that is already published, meaning it has an associated repository.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a CodespaceWithFullRepositoryable 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 +// 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] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/codespaces#create-a-repository-from-an-unpublished-codespace +func (m *CodespacesItemPublishRequestBuilder) Post(ctx context.Context, body CodespacesItemPublishPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceWithFullRepositoryable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespaceWithFullRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespaceWithFullRepositoryable), nil +} +// ToPostRequestInformation publishes an unpublished codespace, creating a new repository and assigning it to the codespace.The codespace's token is granted write permissions to the repository, allowing the user to push their changes.This will fail for a codespace that is already published, meaning it has an associated repository.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesItemPublishRequestBuilder) ToPostRequestInformation(ctx context.Context, body CodespacesItemPublishPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *CodespacesItemPublishRequestBuilder when successful +func (m *CodespacesItemPublishRequestBuilder) WithUrl(rawUrl string)(*CodespacesItemPublishRequestBuilder) { + return NewCodespacesItemPublishRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_start_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_start_request_builder.go new file mode 100644 index 000000000..c381cce9b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_start_request_builder.go @@ -0,0 +1,73 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// CodespacesItemStartRequestBuilder builds and executes requests for operations under \user\codespaces\{codespace_name}\start +type CodespacesItemStartRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewCodespacesItemStartRequestBuilderInternal instantiates a new CodespacesItemStartRequestBuilder and sets the default values. +func NewCodespacesItemStartRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesItemStartRequestBuilder) { + m := &CodespacesItemStartRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/codespaces/{codespace_name}/start", pathParameters), + } + return m +} +// NewCodespacesItemStartRequestBuilder instantiates a new CodespacesItemStartRequestBuilder and sets the default values. +func NewCodespacesItemStartRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesItemStartRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCodespacesItemStartRequestBuilderInternal(urlParams, requestAdapter) +} +// Post starts a user's codespace.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a Codespaceable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 402 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/codespaces#start-a-codespace-for-the-authenticated-user +func (m *CodespacesItemStartRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "402": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespaceFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable), nil +} +// ToPostRequestInformation starts a user's codespace.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesItemStartRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *CodespacesItemStartRequestBuilder when successful +func (m *CodespacesItemStartRequestBuilder) WithUrl(rawUrl string)(*CodespacesItemStartRequestBuilder) { + return NewCodespacesItemStartRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_stop_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_stop_request_builder.go new file mode 100644 index 000000000..4a1ef3785 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_stop_request_builder.go @@ -0,0 +1,67 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// CodespacesItemStopRequestBuilder builds and executes requests for operations under \user\codespaces\{codespace_name}\stop +type CodespacesItemStopRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewCodespacesItemStopRequestBuilderInternal instantiates a new CodespacesItemStopRequestBuilder and sets the default values. +func NewCodespacesItemStopRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesItemStopRequestBuilder) { + m := &CodespacesItemStopRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/codespaces/{codespace_name}/stop", pathParameters), + } + return m +} +// NewCodespacesItemStopRequestBuilder instantiates a new CodespacesItemStopRequestBuilder and sets the default values. +func NewCodespacesItemStopRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesItemStopRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCodespacesItemStopRequestBuilderInternal(urlParams, requestAdapter) +} +// Post stops a user's codespace.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a Codespaceable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/codespaces#stop-a-codespace-for-the-authenticated-user +func (m *CodespacesItemStopRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespaceFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable), nil +} +// ToPostRequestInformation stops a user's codespace.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesItemStopRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *CodespacesItemStopRequestBuilder when successful +func (m *CodespacesItemStopRequestBuilder) WithUrl(rawUrl string)(*CodespacesItemStopRequestBuilder) { + return NewCodespacesItemStopRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_with_codespace_name_delete_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_with_codespace_name_delete_response.go new file mode 100644 index 000000000..8cb0f6e1e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_with_codespace_name_delete_response.go @@ -0,0 +1,51 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodespacesItemWithCodespace_nameDeleteResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewCodespacesItemWithCodespace_nameDeleteResponse instantiates a new CodespacesItemWithCodespace_nameDeleteResponse and sets the default values. +func NewCodespacesItemWithCodespace_nameDeleteResponse()(*CodespacesItemWithCodespace_nameDeleteResponse) { + m := &CodespacesItemWithCodespace_nameDeleteResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesItemWithCodespace_nameDeleteResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesItemWithCodespace_nameDeleteResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesItemWithCodespace_nameDeleteResponse(), 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 *CodespacesItemWithCodespace_nameDeleteResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesItemWithCodespace_nameDeleteResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *CodespacesItemWithCodespace_nameDeleteResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *CodespacesItemWithCodespace_nameDeleteResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type CodespacesItemWithCodespace_nameDeleteResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_with_codespace_name_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_with_codespace_name_patch_request_body.go new file mode 100644 index 000000000..09e4aa70e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_with_codespace_name_patch_request_body.go @@ -0,0 +1,144 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodespacesItemWithCodespace_namePatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Display name for this codespace + display_name *string + // A valid machine to transition this codespace to. + machine *string + // Recently opened folders inside the codespace. It is currently used by the clients to determine the folder path to load the codespace in. + recent_folders []string +} +// NewCodespacesItemWithCodespace_namePatchRequestBody instantiates a new CodespacesItemWithCodespace_namePatchRequestBody and sets the default values. +func NewCodespacesItemWithCodespace_namePatchRequestBody()(*CodespacesItemWithCodespace_namePatchRequestBody) { + m := &CodespacesItemWithCodespace_namePatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesItemWithCodespace_namePatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesItemWithCodespace_namePatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesItemWithCodespace_namePatchRequestBody(), 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 *CodespacesItemWithCodespace_namePatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDisplayName gets the display_name property value. Display name for this codespace +// returns a *string when successful +func (m *CodespacesItemWithCodespace_namePatchRequestBody) GetDisplayName()(*string) { + return m.display_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesItemWithCodespace_namePatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["display_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["machine"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMachine(val) + } + return nil + } + res["recent_folders"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRecentFolders(res) + } + return nil + } + return res +} +// GetMachine gets the machine property value. A valid machine to transition this codespace to. +// returns a *string when successful +func (m *CodespacesItemWithCodespace_namePatchRequestBody) GetMachine()(*string) { + return m.machine +} +// GetRecentFolders gets the recent_folders property value. Recently opened folders inside the codespace. It is currently used by the clients to determine the folder path to load the codespace in. +// returns a []string when successful +func (m *CodespacesItemWithCodespace_namePatchRequestBody) GetRecentFolders()([]string) { + return m.recent_folders +} +// Serialize serializes information the current object +func (m *CodespacesItemWithCodespace_namePatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("display_name", m.GetDisplayName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("machine", m.GetMachine()) + if err != nil { + return err + } + } + if m.GetRecentFolders() != nil { + err := writer.WriteCollectionOfStringValues("recent_folders", m.GetRecentFolders()) + 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 *CodespacesItemWithCodespace_namePatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDisplayName sets the display_name property value. Display name for this codespace +func (m *CodespacesItemWithCodespace_namePatchRequestBody) SetDisplayName(value *string)() { + m.display_name = value +} +// SetMachine sets the machine property value. A valid machine to transition this codespace to. +func (m *CodespacesItemWithCodespace_namePatchRequestBody) SetMachine(value *string)() { + m.machine = value +} +// SetRecentFolders sets the recent_folders property value. Recently opened folders inside the codespace. It is currently used by the clients to determine the folder path to load the codespace in. +func (m *CodespacesItemWithCodespace_namePatchRequestBody) SetRecentFolders(value []string)() { + m.recent_folders = value +} +type CodespacesItemWithCodespace_namePatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDisplayName()(*string) + GetMachine()(*string) + GetRecentFolders()([]string) + SetDisplayName(value *string)() + SetMachine(value *string)() + SetRecentFolders(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_with_codespace_name_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_with_codespace_name_response.go new file mode 100644 index 000000000..9d1ed807f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_item_with_codespace_name_response.go @@ -0,0 +1,28 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodespacesItemWithCodespace_nameResponse +// Deprecated: This class is obsolete. Use WithCodespace_nameDeleteResponse instead. +type CodespacesItemWithCodespace_nameResponse struct { + CodespacesItemWithCodespace_nameDeleteResponse +} +// NewCodespacesItemWithCodespace_nameResponse instantiates a new CodespacesItemWithCodespace_nameResponse and sets the default values. +func NewCodespacesItemWithCodespace_nameResponse()(*CodespacesItemWithCodespace_nameResponse) { + m := &CodespacesItemWithCodespace_nameResponse{ + CodespacesItemWithCodespace_nameDeleteResponse: *NewCodespacesItemWithCodespace_nameDeleteResponse(), + } + return m +} +// CreateCodespacesItemWithCodespace_nameResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateCodespacesItemWithCodespace_nameResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesItemWithCodespace_nameResponse(), nil +} +// CodespacesItemWithCodespace_nameResponseable +// Deprecated: This class is obsolete. Use WithCodespace_nameDeleteResponse instead. +type CodespacesItemWithCodespace_nameResponseable interface { + CodespacesItemWithCodespace_nameDeleteResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_post_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_post_request_body_member1.go new file mode 100644 index 000000000..44060a357 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_post_request_body_member1.go @@ -0,0 +1,370 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodespacesPostRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // IP for location auto-detection when proxying a request + client_ip *string + // Path to devcontainer.json config to use for this codespace + devcontainer_path *string + // Display name for this codespace + display_name *string + // Time in minutes before codespace stops from inactivity + idle_timeout_minutes *int32 + // The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. + location *string + // Machine type to use for this codespace + machine *string + // Whether to authorize requested permissions from devcontainer.json + multi_repo_permissions_opt_out *bool + // Git ref (typically a branch name) for this codespace + ref *string + // Repository id for this codespace + repository_id *int32 + // Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days). + retention_period_minutes *int32 + // Working directory for this codespace + working_directory *string +} +// NewCodespacesPostRequestBodyMember1 instantiates a new CodespacesPostRequestBodyMember1 and sets the default values. +func NewCodespacesPostRequestBodyMember1()(*CodespacesPostRequestBodyMember1) { + m := &CodespacesPostRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesPostRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesPostRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesPostRequestBodyMember1(), 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 *CodespacesPostRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientIp gets the client_ip property value. IP for location auto-detection when proxying a request +// returns a *string when successful +func (m *CodespacesPostRequestBodyMember1) GetClientIp()(*string) { + return m.client_ip +} +// GetDevcontainerPath gets the devcontainer_path property value. Path to devcontainer.json config to use for this codespace +// returns a *string when successful +func (m *CodespacesPostRequestBodyMember1) GetDevcontainerPath()(*string) { + return m.devcontainer_path +} +// GetDisplayName gets the display_name property value. Display name for this codespace +// returns a *string when successful +func (m *CodespacesPostRequestBodyMember1) GetDisplayName()(*string) { + return m.display_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesPostRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_ip"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientIp(val) + } + return nil + } + res["devcontainer_path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDevcontainerPath(val) + } + return nil + } + res["display_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["idle_timeout_minutes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetIdleTimeoutMinutes(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["machine"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMachine(val) + } + return nil + } + res["multi_repo_permissions_opt_out"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMultiRepoPermissionsOptOut(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + res["retention_period_minutes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRetentionPeriodMinutes(val) + } + return nil + } + res["working_directory"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWorkingDirectory(val) + } + return nil + } + return res +} +// GetIdleTimeoutMinutes gets the idle_timeout_minutes property value. Time in minutes before codespace stops from inactivity +// returns a *int32 when successful +func (m *CodespacesPostRequestBodyMember1) GetIdleTimeoutMinutes()(*int32) { + return m.idle_timeout_minutes +} +// GetLocation gets the location property value. The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. +// returns a *string when successful +func (m *CodespacesPostRequestBodyMember1) GetLocation()(*string) { + return m.location +} +// GetMachine gets the machine property value. Machine type to use for this codespace +// returns a *string when successful +func (m *CodespacesPostRequestBodyMember1) GetMachine()(*string) { + return m.machine +} +// GetMultiRepoPermissionsOptOut gets the multi_repo_permissions_opt_out property value. Whether to authorize requested permissions from devcontainer.json +// returns a *bool when successful +func (m *CodespacesPostRequestBodyMember1) GetMultiRepoPermissionsOptOut()(*bool) { + return m.multi_repo_permissions_opt_out +} +// GetRef gets the ref property value. Git ref (typically a branch name) for this codespace +// returns a *string when successful +func (m *CodespacesPostRequestBodyMember1) GetRef()(*string) { + return m.ref +} +// GetRepositoryId gets the repository_id property value. Repository id for this codespace +// returns a *int32 when successful +func (m *CodespacesPostRequestBodyMember1) GetRepositoryId()(*int32) { + return m.repository_id +} +// GetRetentionPeriodMinutes gets the retention_period_minutes property value. Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days). +// returns a *int32 when successful +func (m *CodespacesPostRequestBodyMember1) GetRetentionPeriodMinutes()(*int32) { + return m.retention_period_minutes +} +// GetWorkingDirectory gets the working_directory property value. Working directory for this codespace +// returns a *string when successful +func (m *CodespacesPostRequestBodyMember1) GetWorkingDirectory()(*string) { + return m.working_directory +} +// Serialize serializes information the current object +func (m *CodespacesPostRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("client_ip", m.GetClientIp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("devcontainer_path", m.GetDevcontainerPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("display_name", m.GetDisplayName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("idle_timeout_minutes", m.GetIdleTimeoutMinutes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("machine", m.GetMachine()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("multi_repo_permissions_opt_out", m.GetMultiRepoPermissionsOptOut()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("retention_period_minutes", m.GetRetentionPeriodMinutes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("working_directory", m.GetWorkingDirectory()) + 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 *CodespacesPostRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientIp sets the client_ip property value. IP for location auto-detection when proxying a request +func (m *CodespacesPostRequestBodyMember1) SetClientIp(value *string)() { + m.client_ip = value +} +// SetDevcontainerPath sets the devcontainer_path property value. Path to devcontainer.json config to use for this codespace +func (m *CodespacesPostRequestBodyMember1) SetDevcontainerPath(value *string)() { + m.devcontainer_path = value +} +// SetDisplayName sets the display_name property value. Display name for this codespace +func (m *CodespacesPostRequestBodyMember1) SetDisplayName(value *string)() { + m.display_name = value +} +// SetIdleTimeoutMinutes sets the idle_timeout_minutes property value. Time in minutes before codespace stops from inactivity +func (m *CodespacesPostRequestBodyMember1) SetIdleTimeoutMinutes(value *int32)() { + m.idle_timeout_minutes = value +} +// SetLocation sets the location property value. The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. +func (m *CodespacesPostRequestBodyMember1) SetLocation(value *string)() { + m.location = value +} +// SetMachine sets the machine property value. Machine type to use for this codespace +func (m *CodespacesPostRequestBodyMember1) SetMachine(value *string)() { + m.machine = value +} +// SetMultiRepoPermissionsOptOut sets the multi_repo_permissions_opt_out property value. Whether to authorize requested permissions from devcontainer.json +func (m *CodespacesPostRequestBodyMember1) SetMultiRepoPermissionsOptOut(value *bool)() { + m.multi_repo_permissions_opt_out = value +} +// SetRef sets the ref property value. Git ref (typically a branch name) for this codespace +func (m *CodespacesPostRequestBodyMember1) SetRef(value *string)() { + m.ref = value +} +// SetRepositoryId sets the repository_id property value. Repository id for this codespace +func (m *CodespacesPostRequestBodyMember1) SetRepositoryId(value *int32)() { + m.repository_id = value +} +// SetRetentionPeriodMinutes sets the retention_period_minutes property value. Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days). +func (m *CodespacesPostRequestBodyMember1) SetRetentionPeriodMinutes(value *int32)() { + m.retention_period_minutes = value +} +// SetWorkingDirectory sets the working_directory property value. Working directory for this codespace +func (m *CodespacesPostRequestBodyMember1) SetWorkingDirectory(value *string)() { + m.working_directory = value +} +type CodespacesPostRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientIp()(*string) + GetDevcontainerPath()(*string) + GetDisplayName()(*string) + GetIdleTimeoutMinutes()(*int32) + GetLocation()(*string) + GetMachine()(*string) + GetMultiRepoPermissionsOptOut()(*bool) + GetRef()(*string) + GetRepositoryId()(*int32) + GetRetentionPeriodMinutes()(*int32) + GetWorkingDirectory()(*string) + SetClientIp(value *string)() + SetDevcontainerPath(value *string)() + SetDisplayName(value *string)() + SetIdleTimeoutMinutes(value *int32)() + SetLocation(value *string)() + SetMachine(value *string)() + SetMultiRepoPermissionsOptOut(value *bool)() + SetRef(value *string)() + SetRepositoryId(value *int32)() + SetRetentionPeriodMinutes(value *int32)() + SetWorkingDirectory(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_post_request_body_member2.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_post_request_body_member2.go new file mode 100644 index 000000000..d8962ccdb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_post_request_body_member2.go @@ -0,0 +1,225 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodespacesPostRequestBodyMember2 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Path to devcontainer.json config to use for this codespace + devcontainer_path *string + // Time in minutes before codespace stops from inactivity + idle_timeout_minutes *int32 + // The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. + location *string + // Machine type to use for this codespace + machine *string + // Pull request number for this codespace + pull_request CodespacesPostRequestBodyMember2_pull_requestable + // Working directory for this codespace + working_directory *string +} +// NewCodespacesPostRequestBodyMember2 instantiates a new CodespacesPostRequestBodyMember2 and sets the default values. +func NewCodespacesPostRequestBodyMember2()(*CodespacesPostRequestBodyMember2) { + m := &CodespacesPostRequestBodyMember2{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesPostRequestBodyMember2FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesPostRequestBodyMember2FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesPostRequestBodyMember2(), 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 *CodespacesPostRequestBodyMember2) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDevcontainerPath gets the devcontainer_path property value. Path to devcontainer.json config to use for this codespace +// returns a *string when successful +func (m *CodespacesPostRequestBodyMember2) GetDevcontainerPath()(*string) { + return m.devcontainer_path +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesPostRequestBodyMember2) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["devcontainer_path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDevcontainerPath(val) + } + return nil + } + res["idle_timeout_minutes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetIdleTimeoutMinutes(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["machine"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMachine(val) + } + return nil + } + res["pull_request"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodespacesPostRequestBodyMember2_pull_requestFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPullRequest(val.(CodespacesPostRequestBodyMember2_pull_requestable)) + } + return nil + } + res["working_directory"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWorkingDirectory(val) + } + return nil + } + return res +} +// GetIdleTimeoutMinutes gets the idle_timeout_minutes property value. Time in minutes before codespace stops from inactivity +// returns a *int32 when successful +func (m *CodespacesPostRequestBodyMember2) GetIdleTimeoutMinutes()(*int32) { + return m.idle_timeout_minutes +} +// GetLocation gets the location property value. The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. +// returns a *string when successful +func (m *CodespacesPostRequestBodyMember2) GetLocation()(*string) { + return m.location +} +// GetMachine gets the machine property value. Machine type to use for this codespace +// returns a *string when successful +func (m *CodespacesPostRequestBodyMember2) GetMachine()(*string) { + return m.machine +} +// GetPullRequest gets the pull_request property value. Pull request number for this codespace +// returns a CodespacesPostRequestBodyMember2_pull_requestable when successful +func (m *CodespacesPostRequestBodyMember2) GetPullRequest()(CodespacesPostRequestBodyMember2_pull_requestable) { + return m.pull_request +} +// GetWorkingDirectory gets the working_directory property value. Working directory for this codespace +// returns a *string when successful +func (m *CodespacesPostRequestBodyMember2) GetWorkingDirectory()(*string) { + return m.working_directory +} +// Serialize serializes information the current object +func (m *CodespacesPostRequestBodyMember2) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("devcontainer_path", m.GetDevcontainerPath()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("idle_timeout_minutes", m.GetIdleTimeoutMinutes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("machine", m.GetMachine()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pull_request", m.GetPullRequest()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("working_directory", m.GetWorkingDirectory()) + 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 *CodespacesPostRequestBodyMember2) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDevcontainerPath sets the devcontainer_path property value. Path to devcontainer.json config to use for this codespace +func (m *CodespacesPostRequestBodyMember2) SetDevcontainerPath(value *string)() { + m.devcontainer_path = value +} +// SetIdleTimeoutMinutes sets the idle_timeout_minutes property value. Time in minutes before codespace stops from inactivity +func (m *CodespacesPostRequestBodyMember2) SetIdleTimeoutMinutes(value *int32)() { + m.idle_timeout_minutes = value +} +// SetLocation sets the location property value. The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. +func (m *CodespacesPostRequestBodyMember2) SetLocation(value *string)() { + m.location = value +} +// SetMachine sets the machine property value. Machine type to use for this codespace +func (m *CodespacesPostRequestBodyMember2) SetMachine(value *string)() { + m.machine = value +} +// SetPullRequest sets the pull_request property value. Pull request number for this codespace +func (m *CodespacesPostRequestBodyMember2) SetPullRequest(value CodespacesPostRequestBodyMember2_pull_requestable)() { + m.pull_request = value +} +// SetWorkingDirectory sets the working_directory property value. Working directory for this codespace +func (m *CodespacesPostRequestBodyMember2) SetWorkingDirectory(value *string)() { + m.working_directory = value +} +type CodespacesPostRequestBodyMember2able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDevcontainerPath()(*string) + GetIdleTimeoutMinutes()(*int32) + GetLocation()(*string) + GetMachine()(*string) + GetPullRequest()(CodespacesPostRequestBodyMember2_pull_requestable) + GetWorkingDirectory()(*string) + SetDevcontainerPath(value *string)() + SetIdleTimeoutMinutes(value *int32)() + SetLocation(value *string)() + SetMachine(value *string)() + SetPullRequest(value CodespacesPostRequestBodyMember2_pull_requestable)() + SetWorkingDirectory(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_post_request_body_member2_pull_request.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_post_request_body_member2_pull_request.go new file mode 100644 index 000000000..5d4e3b9a6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_post_request_body_member2_pull_request.go @@ -0,0 +1,110 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodespacesPostRequestBodyMember2_pull_request pull request number for this codespace +type CodespacesPostRequestBodyMember2_pull_request struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Pull request number + pull_request_number *int32 + // Repository id for this codespace + repository_id *int32 +} +// NewCodespacesPostRequestBodyMember2_pull_request instantiates a new CodespacesPostRequestBodyMember2_pull_request and sets the default values. +func NewCodespacesPostRequestBodyMember2_pull_request()(*CodespacesPostRequestBodyMember2_pull_request) { + m := &CodespacesPostRequestBodyMember2_pull_request{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesPostRequestBodyMember2_pull_requestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesPostRequestBodyMember2_pull_requestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesPostRequestBodyMember2_pull_request(), 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 *CodespacesPostRequestBodyMember2_pull_request) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesPostRequestBodyMember2_pull_request) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["pull_request_number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestNumber(val) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + return res +} +// GetPullRequestNumber gets the pull_request_number property value. Pull request number +// returns a *int32 when successful +func (m *CodespacesPostRequestBodyMember2_pull_request) GetPullRequestNumber()(*int32) { + return m.pull_request_number +} +// GetRepositoryId gets the repository_id property value. Repository id for this codespace +// returns a *int32 when successful +func (m *CodespacesPostRequestBodyMember2_pull_request) GetRepositoryId()(*int32) { + return m.repository_id +} +// Serialize serializes information the current object +func (m *CodespacesPostRequestBodyMember2_pull_request) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("pull_request_number", m.GetPullRequestNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + 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 *CodespacesPostRequestBodyMember2_pull_request) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPullRequestNumber sets the pull_request_number property value. Pull request number +func (m *CodespacesPostRequestBodyMember2_pull_request) SetPullRequestNumber(value *int32)() { + m.pull_request_number = value +} +// SetRepositoryId sets the repository_id property value. Repository id for this codespace +func (m *CodespacesPostRequestBodyMember2_pull_request) SetRepositoryId(value *int32)() { + m.repository_id = value +} +type CodespacesPostRequestBodyMember2_pull_requestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPullRequestNumber()(*int32) + GetRepositoryId()(*int32) + SetPullRequestNumber(value *int32)() + SetRepositoryId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_request_builder.go new file mode 100644 index 000000000..a1a284dca --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_request_builder.go @@ -0,0 +1,254 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// CodespacesRequestBuilder builds and executes requests for operations under \user\codespaces +type CodespacesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// CodespacesPostRequestBody composed type wrapper for classes CodespacesPostRequestBodyMember1able, CodespacesPostRequestBodyMember2able +type CodespacesPostRequestBody struct { + // Composed type representation for type CodespacesPostRequestBodyMember1able + codespacesPostRequestBodyCodespacesPostRequestBodyMember1 CodespacesPostRequestBodyMember1able + // Composed type representation for type CodespacesPostRequestBodyMember2able + codespacesPostRequestBodyCodespacesPostRequestBodyMember2 CodespacesPostRequestBodyMember2able + // Composed type representation for type CodespacesPostRequestBodyMember1able + codespacesPostRequestBodyMember1 CodespacesPostRequestBodyMember1able + // Composed type representation for type CodespacesPostRequestBodyMember2able + codespacesPostRequestBodyMember2 CodespacesPostRequestBodyMember2able +} +// NewCodespacesPostRequestBody instantiates a new CodespacesPostRequestBody and sets the default values. +func NewCodespacesPostRequestBody()(*CodespacesPostRequestBody) { + m := &CodespacesPostRequestBody{ + } + return m +} +// CreateCodespacesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewCodespacesPostRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + return result, nil +} +// GetCodespacesPostRequestBodyCodespacesPostRequestBodyMember1 gets the CodespacesPostRequestBodyMember1 property value. Composed type representation for type CodespacesPostRequestBodyMember1able +// returns a CodespacesPostRequestBodyMember1able when successful +func (m *CodespacesPostRequestBody) GetCodespacesPostRequestBodyCodespacesPostRequestBodyMember1()(CodespacesPostRequestBodyMember1able) { + return m.codespacesPostRequestBodyCodespacesPostRequestBodyMember1 +} +// GetCodespacesPostRequestBodyCodespacesPostRequestBodyMember2 gets the CodespacesPostRequestBodyMember2 property value. Composed type representation for type CodespacesPostRequestBodyMember2able +// returns a CodespacesPostRequestBodyMember2able when successful +func (m *CodespacesPostRequestBody) GetCodespacesPostRequestBodyCodespacesPostRequestBodyMember2()(CodespacesPostRequestBodyMember2able) { + return m.codespacesPostRequestBodyCodespacesPostRequestBodyMember2 +} +// GetCodespacesPostRequestBodyMember1 gets the CodespacesPostRequestBodyMember1 property value. Composed type representation for type CodespacesPostRequestBodyMember1able +// returns a CodespacesPostRequestBodyMember1able when successful +func (m *CodespacesPostRequestBody) GetCodespacesPostRequestBodyMember1()(CodespacesPostRequestBodyMember1able) { + return m.codespacesPostRequestBodyMember1 +} +// GetCodespacesPostRequestBodyMember2 gets the CodespacesPostRequestBodyMember2 property value. Composed type representation for type CodespacesPostRequestBodyMember2able +// returns a CodespacesPostRequestBodyMember2able when successful +func (m *CodespacesPostRequestBody) GetCodespacesPostRequestBodyMember2()(CodespacesPostRequestBodyMember2able) { + return m.codespacesPostRequestBodyMember2 +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *CodespacesPostRequestBody) GetIsComposedType()(bool) { + return true +} +// Serialize serializes information the current object +func (m *CodespacesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCodespacesPostRequestBodyCodespacesPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetCodespacesPostRequestBodyCodespacesPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetCodespacesPostRequestBodyCodespacesPostRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetCodespacesPostRequestBodyCodespacesPostRequestBodyMember2()) + if err != nil { + return err + } + } else if m.GetCodespacesPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetCodespacesPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetCodespacesPostRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetCodespacesPostRequestBodyMember2()) + if err != nil { + return err + } + } + return nil +} +// SetCodespacesPostRequestBodyCodespacesPostRequestBodyMember1 sets the CodespacesPostRequestBodyMember1 property value. Composed type representation for type CodespacesPostRequestBodyMember1able +func (m *CodespacesPostRequestBody) SetCodespacesPostRequestBodyCodespacesPostRequestBodyMember1(value CodespacesPostRequestBodyMember1able)() { + m.codespacesPostRequestBodyCodespacesPostRequestBodyMember1 = value +} +// SetCodespacesPostRequestBodyCodespacesPostRequestBodyMember2 sets the CodespacesPostRequestBodyMember2 property value. Composed type representation for type CodespacesPostRequestBodyMember2able +func (m *CodespacesPostRequestBody) SetCodespacesPostRequestBodyCodespacesPostRequestBodyMember2(value CodespacesPostRequestBodyMember2able)() { + m.codespacesPostRequestBodyCodespacesPostRequestBodyMember2 = value +} +// SetCodespacesPostRequestBodyMember1 sets the CodespacesPostRequestBodyMember1 property value. Composed type representation for type CodespacesPostRequestBodyMember1able +func (m *CodespacesPostRequestBody) SetCodespacesPostRequestBodyMember1(value CodespacesPostRequestBodyMember1able)() { + m.codespacesPostRequestBodyMember1 = value +} +// SetCodespacesPostRequestBodyMember2 sets the CodespacesPostRequestBodyMember2 property value. Composed type representation for type CodespacesPostRequestBodyMember2able +func (m *CodespacesPostRequestBody) SetCodespacesPostRequestBodyMember2(value CodespacesPostRequestBodyMember2able)() { + m.codespacesPostRequestBodyMember2 = value +} +// CodespacesRequestBuilderGetQueryParameters lists the authenticated user's codespaces.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +type CodespacesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // ID of the Repository to filter on + Repository_id *int32 `uriparametername:"repository_id"` +} +type CodespacesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCodespacesPostRequestBodyCodespacesPostRequestBodyMember1()(CodespacesPostRequestBodyMember1able) + GetCodespacesPostRequestBodyCodespacesPostRequestBodyMember2()(CodespacesPostRequestBodyMember2able) + GetCodespacesPostRequestBodyMember1()(CodespacesPostRequestBodyMember1able) + GetCodespacesPostRequestBodyMember2()(CodespacesPostRequestBodyMember2able) + SetCodespacesPostRequestBodyCodespacesPostRequestBodyMember1(value CodespacesPostRequestBodyMember1able)() + SetCodespacesPostRequestBodyCodespacesPostRequestBodyMember2(value CodespacesPostRequestBodyMember2able)() + SetCodespacesPostRequestBodyMember1(value CodespacesPostRequestBodyMember1able)() + SetCodespacesPostRequestBodyMember2(value CodespacesPostRequestBodyMember2able)() +} +// ByCodespace_name gets an item from the github.com/octokit/go-sdk/pkg/github.user.codespaces.item collection +// returns a *CodespacesWithCodespace_nameItemRequestBuilder when successful +func (m *CodespacesRequestBuilder) ByCodespace_name(codespace_name string)(*CodespacesWithCodespace_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if codespace_name != "" { + urlTplParams["codespace_name"] = codespace_name + } + return NewCodespacesWithCodespace_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewCodespacesRequestBuilderInternal instantiates a new CodespacesRequestBuilder and sets the default values. +func NewCodespacesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesRequestBuilder) { + m := &CodespacesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/codespaces{?page*,per_page*,repository_id*}", pathParameters), + } + return m +} +// NewCodespacesRequestBuilder instantiates a new CodespacesRequestBuilder and sets the default values. +func NewCodespacesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCodespacesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the authenticated user's codespaces.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a CodespacesGetResponseable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-for-the-authenticated-user +func (m *CodespacesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[CodespacesRequestBuilderGetQueryParameters])(CodespacesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateCodespacesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(CodespacesGetResponseable), nil +} +// Post creates a new codespace, owned by the authenticated user.This endpoint requires either a `repository_id` OR a `pull_request` but not both.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a Codespaceable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a Codespace503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-for-the-authenticated-user +func (m *CodespacesRequestBuilder) Post(ctx context.Context, body CodespacesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespace503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespaceFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable), nil +} +// Secrets the secrets property +// returns a *CodespacesSecretsRequestBuilder when successful +func (m *CodespacesRequestBuilder) Secrets()(*CodespacesSecretsRequestBuilder) { + return NewCodespacesSecretsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists the authenticated user's codespaces.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[CodespacesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a new codespace, owned by the authenticated user.This endpoint requires either a `repository_id` OR a `pull_request` but not both.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesRequestBuilder) ToPostRequestInformation(ctx context.Context, body CodespacesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *CodespacesRequestBuilder when successful +func (m *CodespacesRequestBuilder) WithUrl(rawUrl string)(*CodespacesRequestBuilder) { + return NewCodespacesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_response.go new file mode 100644 index 000000000..3368a7385 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_response.go @@ -0,0 +1,28 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodespacesResponse +// Deprecated: This class is obsolete. Use codespacesGetResponse instead. +type CodespacesResponse struct { + CodespacesGetResponse +} +// NewCodespacesResponse instantiates a new CodespacesResponse and sets the default values. +func NewCodespacesResponse()(*CodespacesResponse) { + m := &CodespacesResponse{ + CodespacesGetResponse: *NewCodespacesGetResponse(), + } + return m +} +// CreateCodespacesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateCodespacesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesResponse(), nil +} +// CodespacesResponseable +// Deprecated: This class is obsolete. Use codespacesGetResponse instead. +type CodespacesResponseable interface { + CodespacesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_get_response.go new file mode 100644 index 000000000..b86703fc1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_get_response.go @@ -0,0 +1,122 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type CodespacesSecretsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The secrets property + secrets []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesSecretable + // The total_count property + total_count *int32 +} +// NewCodespacesSecretsGetResponse instantiates a new CodespacesSecretsGetResponse and sets the default values. +func NewCodespacesSecretsGetResponse()(*CodespacesSecretsGetResponse) { + m := &CodespacesSecretsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesSecretsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesSecretsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesSecretsGetResponse(), 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 *CodespacesSecretsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesSecretsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespacesSecretFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesSecretable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesSecretable) + } + } + m.SetSecrets(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetSecrets gets the secrets property value. The secrets property +// returns a []CodespacesSecretable when successful +func (m *CodespacesSecretsGetResponse) GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesSecretable) { + return m.secrets +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *CodespacesSecretsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *CodespacesSecretsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecrets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSecrets())) + for i, v := range m.GetSecrets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("secrets", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CodespacesSecretsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSecrets sets the secrets property value. The secrets property +func (m *CodespacesSecretsGetResponse) SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesSecretable)() { + m.secrets = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *CodespacesSecretsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type CodespacesSecretsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecrets()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesSecretable) + GetTotalCount()(*int32) + SetSecrets(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesSecretable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_repositories_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_repositories_get_response.go new file mode 100644 index 000000000..682b8137b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_repositories_get_response.go @@ -0,0 +1,122 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type CodespacesSecretsItemRepositoriesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The repositories property + repositories []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable + // The total_count property + total_count *int32 +} +// NewCodespacesSecretsItemRepositoriesGetResponse instantiates a new CodespacesSecretsItemRepositoriesGetResponse and sets the default values. +func NewCodespacesSecretsItemRepositoriesGetResponse()(*CodespacesSecretsItemRepositoriesGetResponse) { + m := &CodespacesSecretsItemRepositoriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesSecretsItemRepositoriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesSecretsItemRepositoriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesSecretsItemRepositoriesGetResponse(), 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 *CodespacesSecretsItemRepositoriesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesSecretsItemRepositoriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []MinimalRepositoryable when successful +func (m *CodespacesSecretsItemRepositoriesGetResponse) GetRepositories()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) { + return m.repositories +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *CodespacesSecretsItemRepositoriesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *CodespacesSecretsItemRepositoriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CodespacesSecretsItemRepositoriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *CodespacesSecretsItemRepositoriesGetResponse) SetRepositories(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable)() { + m.repositories = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *CodespacesSecretsItemRepositoriesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type CodespacesSecretsItemRepositoriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositories()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + GetTotalCount()(*int32) + SetRepositories(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_repositories_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_repositories_put_request_body.go new file mode 100644 index 000000000..84721fbd4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_repositories_put_request_body.go @@ -0,0 +1,86 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodespacesSecretsItemRepositoriesPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // An array of repository ids for which a codespace can access the secret. You can manage the list of selected repositories using the [List selected repositories for a user secret](https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret), [Add a selected repository to a user secret](https://docs.github.com/rest/codespaces/secrets#add-a-selected-repository-to-a-user-secret), and [Remove a selected repository from a user secret](https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret) endpoints. + selected_repository_ids []int32 +} +// NewCodespacesSecretsItemRepositoriesPutRequestBody instantiates a new CodespacesSecretsItemRepositoriesPutRequestBody and sets the default values. +func NewCodespacesSecretsItemRepositoriesPutRequestBody()(*CodespacesSecretsItemRepositoriesPutRequestBody) { + m := &CodespacesSecretsItemRepositoriesPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesSecretsItemRepositoriesPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesSecretsItemRepositoriesPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesSecretsItemRepositoriesPutRequestBody(), 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 *CodespacesSecretsItemRepositoriesPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesSecretsItemRepositoriesPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["selected_repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetSelectedRepositoryIds(res) + } + return nil + } + return res +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository ids for which a codespace can access the secret. You can manage the list of selected repositories using the [List selected repositories for a user secret](https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret), [Add a selected repository to a user secret](https://docs.github.com/rest/codespaces/secrets#add-a-selected-repository-to-a-user-secret), and [Remove a selected repository from a user secret](https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret) endpoints. +// returns a []int32 when successful +func (m *CodespacesSecretsItemRepositoriesPutRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *CodespacesSecretsItemRepositoriesPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + 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 *CodespacesSecretsItemRepositoriesPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository ids for which a codespace can access the secret. You can manage the list of selected repositories using the [List selected repositories for a user secret](https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret), [Add a selected repository to a user secret](https://docs.github.com/rest/codespaces/secrets#add-a-selected-repository-to-a-user-secret), and [Remove a selected repository from a user secret](https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret) endpoints. +func (m *CodespacesSecretsItemRepositoriesPutRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +type CodespacesSecretsItemRepositoriesPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedRepositoryIds()([]int32) + SetSelectedRepositoryIds(value []int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_repositories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_repositories_request_builder.go new file mode 100644 index 000000000..6fd60392d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_repositories_request_builder.go @@ -0,0 +1,115 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// CodespacesSecretsItemRepositoriesRequestBuilder builds and executes requests for operations under \user\codespaces\secrets\{secret_name}\repositories +type CodespacesSecretsItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRepository_id gets an item from the github.com/octokit/go-sdk/pkg/github.user.codespaces.secrets.item.repositories.item collection +// returns a *CodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *CodespacesSecretsItemRepositoriesRequestBuilder) ByRepository_id(repository_id int32)(*CodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["repository_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(repository_id), 10) + return NewCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewCodespacesSecretsItemRepositoriesRequestBuilderInternal instantiates a new CodespacesSecretsItemRepositoriesRequestBuilder and sets the default values. +func NewCodespacesSecretsItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesSecretsItemRepositoriesRequestBuilder) { + m := &CodespacesSecretsItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/codespaces/secrets/{secret_name}/repositories", pathParameters), + } + return m +} +// NewCodespacesSecretsItemRepositoriesRequestBuilder instantiates a new CodespacesSecretsItemRepositoriesRequestBuilder and sets the default values. +func NewCodespacesSecretsItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesSecretsItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCodespacesSecretsItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the repositories that have been granted the ability to use a user's development environment secret.The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// returns a CodespacesSecretsItemRepositoriesGetResponseable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret +func (m *CodespacesSecretsItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(CodespacesSecretsItemRepositoriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateCodespacesSecretsItemRepositoriesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(CodespacesSecretsItemRepositoriesGetResponseable), nil +} +// Put select the repositories that will use a user's development environment secret.The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/secrets#set-selected-repositories-for-a-user-secret +func (m *CodespacesSecretsItemRepositoriesRequestBuilder) Put(ctx context.Context, body CodespacesSecretsItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation list the repositories that have been granted the ability to use a user's development environment secret.The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesSecretsItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation select the repositories that will use a user's development environment secret.The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesSecretsItemRepositoriesRequestBuilder) ToPutRequestInformation(ctx context.Context, body CodespacesSecretsItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *CodespacesSecretsItemRepositoriesRequestBuilder when successful +func (m *CodespacesSecretsItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*CodespacesSecretsItemRepositoriesRequestBuilder) { + return NewCodespacesSecretsItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_repositories_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_repositories_response.go new file mode 100644 index 000000000..67b98d864 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_repositories_response.go @@ -0,0 +1,28 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodespacesSecretsItemRepositoriesResponse +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type CodespacesSecretsItemRepositoriesResponse struct { + CodespacesSecretsItemRepositoriesGetResponse +} +// NewCodespacesSecretsItemRepositoriesResponse instantiates a new CodespacesSecretsItemRepositoriesResponse and sets the default values. +func NewCodespacesSecretsItemRepositoriesResponse()(*CodespacesSecretsItemRepositoriesResponse) { + m := &CodespacesSecretsItemRepositoriesResponse{ + CodespacesSecretsItemRepositoriesGetResponse: *NewCodespacesSecretsItemRepositoriesGetResponse(), + } + return m +} +// CreateCodespacesSecretsItemRepositoriesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateCodespacesSecretsItemRepositoriesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesSecretsItemRepositoriesResponse(), nil +} +// CodespacesSecretsItemRepositoriesResponseable +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type CodespacesSecretsItemRepositoriesResponseable interface { + CodespacesSecretsItemRepositoriesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_repositories_with_repository_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_repositories_with_repository_item_request_builder.go new file mode 100644 index 000000000..e770441eb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_repositories_with_repository_item_request_builder.go @@ -0,0 +1,96 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// CodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder builds and executes requests for operations under \user\codespaces\secrets\{secret_name}\repositories\{repository_id} +type CodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal instantiates a new CodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + m := &CodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/codespaces/secrets/{secret_name}/repositories/{repository_id}", pathParameters), + } + return m +} +// NewCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder instantiates a new CodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a repository from the selected repositories for a user's development environment secret.The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret +func (m *CodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put adds a repository to the selected repositories for a user's development environment secret.The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/secrets#add-a-selected-repository-to-a-user-secret +func (m *CodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a repository from the selected repositories for a user's development environment secret.The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation adds a repository to the selected repositories for a user's development environment secret.The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *CodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *CodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) WithUrl(rawUrl string)(*CodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + return NewCodespacesSecretsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_with_secret_name_put_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_with_secret_name_put_request_body.go new file mode 100644 index 000000000..72dcfd085 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_item_with_secret_name_put_request_body.go @@ -0,0 +1,144 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodespacesSecretsItemWithSecret_namePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get the public key for the authenticated user](https://docs.github.com/rest/codespaces/secrets#get-public-key-for-the-authenticated-user) endpoint. + encrypted_value *string + // ID of the key you used to encrypt the secret. + key_id *string + // An array of repository ids that can access the user secret. You can manage the list of selected repositories using the [List selected repositories for a user secret](https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret), [Set selected repositories for a user secret](https://docs.github.com/rest/codespaces/secrets#set-selected-repositories-for-a-user-secret), and [Remove a selected repository from a user secret](https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret) endpoints. + selected_repository_ids []int32 +} +// NewCodespacesSecretsItemWithSecret_namePutRequestBody instantiates a new CodespacesSecretsItemWithSecret_namePutRequestBody and sets the default values. +func NewCodespacesSecretsItemWithSecret_namePutRequestBody()(*CodespacesSecretsItemWithSecret_namePutRequestBody) { + m := &CodespacesSecretsItemWithSecret_namePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodespacesSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodespacesSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesSecretsItemWithSecret_namePutRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CodespacesSecretsItemWithSecret_namePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncryptedValue gets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get the public key for the authenticated user](https://docs.github.com/rest/codespaces/secrets#get-public-key-for-the-authenticated-user) endpoint. +// returns a *string when successful +func (m *CodespacesSecretsItemWithSecret_namePutRequestBody) GetEncryptedValue()(*string) { + return m.encrypted_value +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodespacesSecretsItemWithSecret_namePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["encrypted_value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncryptedValue(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + res["selected_repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetSelectedRepositoryIds(res) + } + return nil + } + return res +} +// GetKeyId gets the key_id property value. ID of the key you used to encrypt the secret. +// returns a *string when successful +func (m *CodespacesSecretsItemWithSecret_namePutRequestBody) GetKeyId()(*string) { + return m.key_id +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository ids that can access the user secret. You can manage the list of selected repositories using the [List selected repositories for a user secret](https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret), [Set selected repositories for a user secret](https://docs.github.com/rest/codespaces/secrets#set-selected-repositories-for-a-user-secret), and [Remove a selected repository from a user secret](https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret) endpoints. +// returns a []int32 when successful +func (m *CodespacesSecretsItemWithSecret_namePutRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *CodespacesSecretsItemWithSecret_namePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("encrypted_value", m.GetEncryptedValue()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + 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 *CodespacesSecretsItemWithSecret_namePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncryptedValue sets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get the public key for the authenticated user](https://docs.github.com/rest/codespaces/secrets#get-public-key-for-the-authenticated-user) endpoint. +func (m *CodespacesSecretsItemWithSecret_namePutRequestBody) SetEncryptedValue(value *string)() { + m.encrypted_value = value +} +// SetKeyId sets the key_id property value. ID of the key you used to encrypt the secret. +func (m *CodespacesSecretsItemWithSecret_namePutRequestBody) SetKeyId(value *string)() { + m.key_id = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository ids that can access the user secret. You can manage the list of selected repositories using the [List selected repositories for a user secret](https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret), [Set selected repositories for a user secret](https://docs.github.com/rest/codespaces/secrets#set-selected-repositories-for-a-user-secret), and [Remove a selected repository from a user secret](https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret) endpoints. +func (m *CodespacesSecretsItemWithSecret_namePutRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +type CodespacesSecretsItemWithSecret_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncryptedValue()(*string) + GetKeyId()(*string) + GetSelectedRepositoryIds()([]int32) + SetEncryptedValue(value *string)() + SetKeyId(value *string)() + SetSelectedRepositoryIds(value []int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_public_key_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_public_key_request_builder.go new file mode 100644 index 000000000..9d81a2b8b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_public_key_request_builder.go @@ -0,0 +1,57 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// CodespacesSecretsPublicKeyRequestBuilder builds and executes requests for operations under \user\codespaces\secrets\public-key +type CodespacesSecretsPublicKeyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewCodespacesSecretsPublicKeyRequestBuilderInternal instantiates a new CodespacesSecretsPublicKeyRequestBuilder and sets the default values. +func NewCodespacesSecretsPublicKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesSecretsPublicKeyRequestBuilder) { + m := &CodespacesSecretsPublicKeyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/codespaces/secrets/public-key", pathParameters), + } + return m +} +// NewCodespacesSecretsPublicKeyRequestBuilder instantiates a new CodespacesSecretsPublicKeyRequestBuilder and sets the default values. +func NewCodespacesSecretsPublicKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesSecretsPublicKeyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCodespacesSecretsPublicKeyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets.The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// returns a CodespacesUserPublicKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/secrets#get-public-key-for-the-authenticated-user +func (m *CodespacesSecretsPublicKeyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesUserPublicKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespacesUserPublicKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesUserPublicKeyable), nil +} +// ToGetRequestInformation gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets.The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesSecretsPublicKeyRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *CodespacesSecretsPublicKeyRequestBuilder when successful +func (m *CodespacesSecretsPublicKeyRequestBuilder) WithUrl(rawUrl string)(*CodespacesSecretsPublicKeyRequestBuilder) { + return NewCodespacesSecretsPublicKeyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_request_builder.go new file mode 100644 index 000000000..c7a9b8af2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_request_builder.go @@ -0,0 +1,80 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// CodespacesSecretsRequestBuilder builds and executes requests for operations under \user\codespaces\secrets +type CodespacesSecretsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// CodespacesSecretsRequestBuilderGetQueryParameters lists all development environment secrets available for a user's codespaces without revealing theirencrypted values.The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +type CodespacesSecretsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// BySecret_name gets an item from the github.com/octokit/go-sdk/pkg/github.user.codespaces.secrets.item collection +// returns a *CodespacesSecretsWithSecret_nameItemRequestBuilder when successful +func (m *CodespacesSecretsRequestBuilder) BySecret_name(secret_name string)(*CodespacesSecretsWithSecret_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if secret_name != "" { + urlTplParams["secret_name"] = secret_name + } + return NewCodespacesSecretsWithSecret_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewCodespacesSecretsRequestBuilderInternal instantiates a new CodespacesSecretsRequestBuilder and sets the default values. +func NewCodespacesSecretsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesSecretsRequestBuilder) { + m := &CodespacesSecretsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/codespaces/secrets{?page*,per_page*}", pathParameters), + } + return m +} +// NewCodespacesSecretsRequestBuilder instantiates a new CodespacesSecretsRequestBuilder and sets the default values. +func NewCodespacesSecretsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesSecretsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCodespacesSecretsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all development environment secrets available for a user's codespaces without revealing theirencrypted values.The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// returns a CodespacesSecretsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/secrets#list-secrets-for-the-authenticated-user +func (m *CodespacesSecretsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[CodespacesSecretsRequestBuilderGetQueryParameters])(CodespacesSecretsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateCodespacesSecretsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(CodespacesSecretsGetResponseable), nil +} +// PublicKey the publicKey property +// returns a *CodespacesSecretsPublicKeyRequestBuilder when successful +func (m *CodespacesSecretsRequestBuilder) PublicKey()(*CodespacesSecretsPublicKeyRequestBuilder) { + return NewCodespacesSecretsPublicKeyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all development environment secrets available for a user's codespaces without revealing theirencrypted values.The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesSecretsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[CodespacesSecretsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *CodespacesSecretsRequestBuilder when successful +func (m *CodespacesSecretsRequestBuilder) WithUrl(rawUrl string)(*CodespacesSecretsRequestBuilder) { + return NewCodespacesSecretsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_response.go new file mode 100644 index 000000000..d0cf1a601 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_response.go @@ -0,0 +1,28 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodespacesSecretsResponse +// Deprecated: This class is obsolete. Use secretsGetResponse instead. +type CodespacesSecretsResponse struct { + CodespacesSecretsGetResponse +} +// NewCodespacesSecretsResponse instantiates a new CodespacesSecretsResponse and sets the default values. +func NewCodespacesSecretsResponse()(*CodespacesSecretsResponse) { + m := &CodespacesSecretsResponse{ + CodespacesSecretsGetResponse: *NewCodespacesSecretsGetResponse(), + } + return m +} +// CreateCodespacesSecretsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateCodespacesSecretsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodespacesSecretsResponse(), nil +} +// CodespacesSecretsResponseable +// Deprecated: This class is obsolete. Use secretsGetResponse instead. +type CodespacesSecretsResponseable interface { + CodespacesSecretsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_with_secret_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_with_secret_name_item_request_builder.go new file mode 100644 index 000000000..44472ef07 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_secrets_with_secret_name_item_request_builder.go @@ -0,0 +1,121 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// CodespacesSecretsWithSecret_nameItemRequestBuilder builds and executes requests for operations under \user\codespaces\secrets\{secret_name} +type CodespacesSecretsWithSecret_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewCodespacesSecretsWithSecret_nameItemRequestBuilderInternal instantiates a new CodespacesSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewCodespacesSecretsWithSecret_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesSecretsWithSecret_nameItemRequestBuilder) { + m := &CodespacesSecretsWithSecret_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/codespaces/secrets/{secret_name}", pathParameters), + } + return m +} +// NewCodespacesSecretsWithSecret_nameItemRequestBuilder instantiates a new CodespacesSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewCodespacesSecretsWithSecret_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesSecretsWithSecret_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCodespacesSecretsWithSecret_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a development environment secret from a user's codespaces using the secret name. Deleting the secret will remove access from all codespaces that were allowed to access the secret.The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/secrets#delete-a-secret-for-the-authenticated-user +func (m *CodespacesSecretsWithSecret_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a development environment secret available to a user's codespaces without revealing its encrypted value.The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// returns a CodespacesSecretable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/secrets#get-a-secret-for-the-authenticated-user +func (m *CodespacesSecretsWithSecret_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesSecretable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespacesSecretFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodespacesSecretable), nil +} +// Put creates or updates a development environment secret for a user's codespace with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// returns a EmptyObjectable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/secrets#create-or-update-a-secret-for-the-authenticated-user +func (m *CodespacesSecretsWithSecret_nameItemRequestBuilder) Put(ctx context.Context, body CodespacesSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmptyObjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.EmptyObjectable), nil +} +// Repositories the repositories property +// returns a *CodespacesSecretsItemRepositoriesRequestBuilder when successful +func (m *CodespacesSecretsWithSecret_nameItemRequestBuilder) Repositories()(*CodespacesSecretsItemRepositoriesRequestBuilder) { + return NewCodespacesSecretsItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a development environment secret from a user's codespaces using the secret name. Deleting the secret will remove access from all codespaces that were allowed to access the secret.The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesSecretsWithSecret_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation gets a development environment secret available to a user's codespaces without revealing its encrypted value.The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesSecretsWithSecret_nameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation creates or updates a development environment secret for a user's codespace with an encrypted value. Encrypt your secret using[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."The authenticated user must have Codespaces access to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesSecretsWithSecret_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body CodespacesSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *CodespacesSecretsWithSecret_nameItemRequestBuilder when successful +func (m *CodespacesSecretsWithSecret_nameItemRequestBuilder) WithUrl(rawUrl string)(*CodespacesSecretsWithSecret_nameItemRequestBuilder) { + return NewCodespacesSecretsWithSecret_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_with_codespace_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_with_codespace_name_item_request_builder.go new file mode 100644 index 000000000..e0e3b646f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/codespaces_with_codespace_name_item_request_builder.go @@ -0,0 +1,168 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// CodespacesWithCodespace_nameItemRequestBuilder builds and executes requests for operations under \user\codespaces\{codespace_name} +type CodespacesWithCodespace_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewCodespacesWithCodespace_nameItemRequestBuilderInternal instantiates a new CodespacesWithCodespace_nameItemRequestBuilder and sets the default values. +func NewCodespacesWithCodespace_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesWithCodespace_nameItemRequestBuilder) { + m := &CodespacesWithCodespace_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/codespaces/{codespace_name}", pathParameters), + } + return m +} +// NewCodespacesWithCodespace_nameItemRequestBuilder instantiates a new CodespacesWithCodespace_nameItemRequestBuilder and sets the default values. +func NewCodespacesWithCodespace_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodespacesWithCodespace_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCodespacesWithCodespace_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a user's codespace.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a CodespacesItemWithCodespace_nameDeleteResponseable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/codespaces#delete-a-codespace-for-the-authenticated-user +func (m *CodespacesWithCodespace_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(CodespacesItemWithCodespace_nameDeleteResponseable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateCodespacesItemWithCodespace_nameDeleteResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(CodespacesItemWithCodespace_nameDeleteResponseable), nil +} +// Exports the exports property +// returns a *CodespacesItemExportsRequestBuilder when successful +func (m *CodespacesWithCodespace_nameItemRequestBuilder) Exports()(*CodespacesItemExportsRequestBuilder) { + return NewCodespacesItemExportsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get gets information about a user's codespace.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a Codespaceable 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 +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/codespaces#get-a-codespace-for-the-authenticated-user +func (m *CodespacesWithCodespace_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespaceFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable), nil +} +// Machines the machines property +// returns a *CodespacesItemMachinesRequestBuilder when successful +func (m *CodespacesWithCodespace_nameItemRequestBuilder) Machines()(*CodespacesItemMachinesRequestBuilder) { + return NewCodespacesItemMachinesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch updates a codespace owned by the authenticated user. Currently only the codespace's machine type and recent folders can be modified using this endpoint.If you specify a new machine type it will be applied the next time your codespace is started.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a Codespaceable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/codespaces/codespaces#update-a-codespace-for-the-authenticated-user +func (m *CodespacesWithCodespace_nameItemRequestBuilder) Patch(ctx context.Context, body CodespacesItemWithCodespace_namePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodespaceFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Codespaceable), nil +} +// Publish the publish property +// returns a *CodespacesItemPublishRequestBuilder when successful +func (m *CodespacesWithCodespace_nameItemRequestBuilder) Publish()(*CodespacesItemPublishRequestBuilder) { + return NewCodespacesItemPublishRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Start the start property +// returns a *CodespacesItemStartRequestBuilder when successful +func (m *CodespacesWithCodespace_nameItemRequestBuilder) Start()(*CodespacesItemStartRequestBuilder) { + return NewCodespacesItemStartRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Stop the stop property +// returns a *CodespacesItemStopRequestBuilder when successful +func (m *CodespacesWithCodespace_nameItemRequestBuilder) Stop()(*CodespacesItemStopRequestBuilder) { + return NewCodespacesItemStopRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a user's codespace.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesWithCodespace_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets information about a user's codespace.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesWithCodespace_nameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates a codespace owned by the authenticated user. Currently only the codespace's machine type and recent folders can be modified using this endpoint.If you specify a new machine type it will be applied the next time your codespace is started.OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *CodespacesWithCodespace_nameItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body CodespacesItemWithCodespace_namePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *CodespacesWithCodespace_nameItemRequestBuilder when successful +func (m *CodespacesWithCodespace_nameItemRequestBuilder) WithUrl(rawUrl string)(*CodespacesWithCodespace_nameItemRequestBuilder) { + return NewCodespacesWithCodespace_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/docker_conflicts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/docker_conflicts_request_builder.go new file mode 100644 index 000000000..4320f2681 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/docker_conflicts_request_builder.go @@ -0,0 +1,60 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// DockerConflictsRequestBuilder builds and executes requests for operations under \user\docker\conflicts +type DockerConflictsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewDockerConflictsRequestBuilderInternal instantiates a new DockerConflictsRequestBuilder and sets the default values. +func NewDockerConflictsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*DockerConflictsRequestBuilder) { + m := &DockerConflictsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/docker/conflicts", pathParameters), + } + return m +} +// NewDockerConflictsRequestBuilder instantiates a new DockerConflictsRequestBuilder and sets the default values. +func NewDockerConflictsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*DockerConflictsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewDockerConflictsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all packages that are owned by the authenticated user within the user's namespace, and that encountered a conflict during a Docker migration.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. +// returns a []PackageEscapedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-authenticated-user +func (m *DockerConflictsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePackageEscapedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable) + } + } + return val, nil +} +// ToGetRequestInformation lists all packages that are owned by the authenticated user within the user's namespace, and that encountered a conflict during a Docker migration.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *DockerConflictsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *DockerConflictsRequestBuilder when successful +func (m *DockerConflictsRequestBuilder) WithUrl(rawUrl string)(*DockerConflictsRequestBuilder) { + return NewDockerConflictsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/docker_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/docker_request_builder.go new file mode 100644 index 000000000..b099b53a6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/docker_request_builder.go @@ -0,0 +1,28 @@ +package user + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// DockerRequestBuilder builds and executes requests for operations under \user\docker +type DockerRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Conflicts the conflicts property +// returns a *DockerConflictsRequestBuilder when successful +func (m *DockerRequestBuilder) Conflicts()(*DockerConflictsRequestBuilder) { + return NewDockerConflictsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewDockerRequestBuilderInternal instantiates a new DockerRequestBuilder and sets the default values. +func NewDockerRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*DockerRequestBuilder) { + m := &DockerRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/docker", pathParameters), + } + return m +} +// NewDockerRequestBuilder instantiates a new DockerRequestBuilder and sets the default values. +func NewDockerRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*DockerRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewDockerRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/email_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/email_request_builder.go new file mode 100644 index 000000000..b9f58a2d0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/email_request_builder.go @@ -0,0 +1,28 @@ +package user + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// EmailRequestBuilder builds and executes requests for operations under \user\email +type EmailRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewEmailRequestBuilderInternal instantiates a new EmailRequestBuilder and sets the default values. +func NewEmailRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EmailRequestBuilder) { + m := &EmailRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/email", pathParameters), + } + return m +} +// NewEmailRequestBuilder instantiates a new EmailRequestBuilder and sets the default values. +func NewEmailRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EmailRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewEmailRequestBuilderInternal(urlParams, requestAdapter) +} +// Visibility the visibility property +// returns a *EmailVisibilityRequestBuilder when successful +func (m *EmailRequestBuilder) Visibility()(*EmailVisibilityRequestBuilder) { + return NewEmailVisibilityRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/email_visibility_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/email_visibility_patch_request_body.go new file mode 100644 index 000000000..e34aa0425 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/email_visibility_patch_request_body.go @@ -0,0 +1,51 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EmailVisibilityPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewEmailVisibilityPatchRequestBody instantiates a new EmailVisibilityPatchRequestBody and sets the default values. +func NewEmailVisibilityPatchRequestBody()(*EmailVisibilityPatchRequestBody) { + m := &EmailVisibilityPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEmailVisibilityPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEmailVisibilityPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEmailVisibilityPatchRequestBody(), 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 *EmailVisibilityPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EmailVisibilityPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *EmailVisibilityPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *EmailVisibilityPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type EmailVisibilityPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/email_visibility_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/email_visibility_request_builder.go new file mode 100644 index 000000000..001f80ddc --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/email_visibility_request_builder.go @@ -0,0 +1,74 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// EmailVisibilityRequestBuilder builds and executes requests for operations under \user\email\visibility +type EmailVisibilityRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewEmailVisibilityRequestBuilderInternal instantiates a new EmailVisibilityRequestBuilder and sets the default values. +func NewEmailVisibilityRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EmailVisibilityRequestBuilder) { + m := &EmailVisibilityRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/email/visibility", pathParameters), + } + return m +} +// NewEmailVisibilityRequestBuilder instantiates a new EmailVisibilityRequestBuilder and sets the default values. +func NewEmailVisibilityRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EmailVisibilityRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewEmailVisibilityRequestBuilderInternal(urlParams, requestAdapter) +} +// Patch sets the visibility for your primary email addresses. +// returns a []Emailable 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 +// 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] +// +// [API method documentation]: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user +func (m *EmailVisibilityRequestBuilder) Patch(ctx context.Context, body EmailVisibilityPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Emailable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmailFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Emailable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Emailable) + } + } + return val, nil +} +// ToPatchRequestInformation sets the visibility for your primary email addresses. +// returns a *RequestInformation when successful +func (m *EmailVisibilityRequestBuilder) ToPatchRequestInformation(ctx context.Context, body EmailVisibilityPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *EmailVisibilityRequestBuilder when successful +func (m *EmailVisibilityRequestBuilder) WithUrl(rawUrl string)(*EmailVisibilityRequestBuilder) { + return NewEmailVisibilityRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/emails_delete_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/emails_delete_request_body_member1.go new file mode 100644 index 000000000..f9fc2a77e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/emails_delete_request_body_member1.go @@ -0,0 +1,87 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// EmailsDeleteRequestBodyMember1 deletes one or more email addresses from your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an `array` of emails addresses directly, but we recommend that you pass an object using the `emails` key. +type EmailsDeleteRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Email addresses associated with the GitHub user account. + emails []string +} +// NewEmailsDeleteRequestBodyMember1 instantiates a new EmailsDeleteRequestBodyMember1 and sets the default values. +func NewEmailsDeleteRequestBodyMember1()(*EmailsDeleteRequestBodyMember1) { + m := &EmailsDeleteRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEmailsDeleteRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEmailsDeleteRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEmailsDeleteRequestBodyMember1(), 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 *EmailsDeleteRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmails gets the emails property value. Email addresses associated with the GitHub user account. +// returns a []string when successful +func (m *EmailsDeleteRequestBodyMember1) GetEmails()([]string) { + return m.emails +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EmailsDeleteRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["emails"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetEmails(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *EmailsDeleteRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEmails() != nil { + err := writer.WriteCollectionOfStringValues("emails", m.GetEmails()) + 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 *EmailsDeleteRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmails sets the emails property value. Email addresses associated with the GitHub user account. +func (m *EmailsDeleteRequestBodyMember1) SetEmails(value []string)() { + m.emails = value +} +type EmailsDeleteRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmails()([]string) + SetEmails(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/emails_post_request_body_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/emails_post_request_body_member1.go new file mode 100644 index 000000000..a43702bb0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/emails_post_request_body_member1.go @@ -0,0 +1,86 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EmailsPostRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Adds one or more email addresses to your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an `array` of emails addresses directly, but we recommend that you pass an object using the `emails` key. + emails []string +} +// NewEmailsPostRequestBodyMember1 instantiates a new EmailsPostRequestBodyMember1 and sets the default values. +func NewEmailsPostRequestBodyMember1()(*EmailsPostRequestBodyMember1) { + m := &EmailsPostRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEmailsPostRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEmailsPostRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEmailsPostRequestBodyMember1(), 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 *EmailsPostRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmails gets the emails property value. Adds one or more email addresses to your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an `array` of emails addresses directly, but we recommend that you pass an object using the `emails` key. +// returns a []string when successful +func (m *EmailsPostRequestBodyMember1) GetEmails()([]string) { + return m.emails +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EmailsPostRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["emails"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetEmails(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *EmailsPostRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEmails() != nil { + err := writer.WriteCollectionOfStringValues("emails", m.GetEmails()) + 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 *EmailsPostRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmails sets the emails property value. Adds one or more email addresses to your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an `array` of emails addresses directly, but we recommend that you pass an object using the `emails` key. +func (m *EmailsPostRequestBodyMember1) SetEmails(value []string)() { + m.emails = value +} +type EmailsPostRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmails()([]string) + SetEmails(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/emails_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/emails_request_builder.go new file mode 100644 index 000000000..63d70dd1b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/emails_request_builder.go @@ -0,0 +1,417 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// EmailsRequestBuilder builds and executes requests for operations under \user\emails +type EmailsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// EmailsDeleteRequestBody composed type wrapper for classes EmailsDeleteRequestBodyMember1able, string +type EmailsDeleteRequestBody struct { + // Composed type representation for type EmailsDeleteRequestBodyMember1able + emailsDeleteRequestBodyEmailsDeleteRequestBodyMember1 EmailsDeleteRequestBodyMember1able + // Composed type representation for type EmailsDeleteRequestBodyMember1able + emailsDeleteRequestBodyMember1 EmailsDeleteRequestBodyMember1able + // Composed type representation for type string + emailsDeleteRequestBodyString *string + // Composed type representation for type string + string *string +} +// NewEmailsDeleteRequestBody instantiates a new EmailsDeleteRequestBody and sets the default values. +func NewEmailsDeleteRequestBody()(*EmailsDeleteRequestBody) { + m := &EmailsDeleteRequestBody{ + } + return m +} +// CreateEmailsDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEmailsDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewEmailsDeleteRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetEmailsDeleteRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetEmailsDeleteRequestBodyEmailsDeleteRequestBodyMember1 gets the EmailsDeleteRequestBodyMember1 property value. Composed type representation for type EmailsDeleteRequestBodyMember1able +// returns a EmailsDeleteRequestBodyMember1able when successful +func (m *EmailsDeleteRequestBody) GetEmailsDeleteRequestBodyEmailsDeleteRequestBodyMember1()(EmailsDeleteRequestBodyMember1able) { + return m.emailsDeleteRequestBodyEmailsDeleteRequestBodyMember1 +} +// GetEmailsDeleteRequestBodyMember1 gets the EmailsDeleteRequestBodyMember1 property value. Composed type representation for type EmailsDeleteRequestBodyMember1able +// returns a EmailsDeleteRequestBodyMember1able when successful +func (m *EmailsDeleteRequestBody) GetEmailsDeleteRequestBodyMember1()(EmailsDeleteRequestBodyMember1able) { + return m.emailsDeleteRequestBodyMember1 +} +// GetEmailsDeleteRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *EmailsDeleteRequestBody) GetEmailsDeleteRequestBodyString()(*string) { + return m.emailsDeleteRequestBodyString +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EmailsDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *EmailsDeleteRequestBody) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *EmailsDeleteRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *EmailsDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEmailsDeleteRequestBodyEmailsDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetEmailsDeleteRequestBodyEmailsDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetEmailsDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetEmailsDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetEmailsDeleteRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetEmailsDeleteRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetEmailsDeleteRequestBodyEmailsDeleteRequestBodyMember1 sets the EmailsDeleteRequestBodyMember1 property value. Composed type representation for type EmailsDeleteRequestBodyMember1able +func (m *EmailsDeleteRequestBody) SetEmailsDeleteRequestBodyEmailsDeleteRequestBodyMember1(value EmailsDeleteRequestBodyMember1able)() { + m.emailsDeleteRequestBodyEmailsDeleteRequestBodyMember1 = value +} +// SetEmailsDeleteRequestBodyMember1 sets the EmailsDeleteRequestBodyMember1 property value. Composed type representation for type EmailsDeleteRequestBodyMember1able +func (m *EmailsDeleteRequestBody) SetEmailsDeleteRequestBodyMember1(value EmailsDeleteRequestBodyMember1able)() { + m.emailsDeleteRequestBodyMember1 = value +} +// SetEmailsDeleteRequestBodyString sets the string property value. Composed type representation for type string +func (m *EmailsDeleteRequestBody) SetEmailsDeleteRequestBodyString(value *string)() { + m.emailsDeleteRequestBodyString = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *EmailsDeleteRequestBody) SetString(value *string)() { + m.string = value +} +// EmailsPostRequestBody composed type wrapper for classes EmailsPostRequestBodyMember1able, string +type EmailsPostRequestBody struct { + // Composed type representation for type EmailsPostRequestBodyMember1able + emailsPostRequestBodyEmailsPostRequestBodyMember1 EmailsPostRequestBodyMember1able + // Composed type representation for type EmailsPostRequestBodyMember1able + emailsPostRequestBodyMember1 EmailsPostRequestBodyMember1able + // Composed type representation for type string + emailsPostRequestBodyString *string + // Composed type representation for type string + string *string +} +// NewEmailsPostRequestBody instantiates a new EmailsPostRequestBody and sets the default values. +func NewEmailsPostRequestBody()(*EmailsPostRequestBody) { + m := &EmailsPostRequestBody{ + } + return m +} +// CreateEmailsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEmailsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewEmailsPostRequestBody() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetEmailsPostRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetEmailsPostRequestBodyEmailsPostRequestBodyMember1 gets the EmailsPostRequestBodyMember1 property value. Composed type representation for type EmailsPostRequestBodyMember1able +// returns a EmailsPostRequestBodyMember1able when successful +func (m *EmailsPostRequestBody) GetEmailsPostRequestBodyEmailsPostRequestBodyMember1()(EmailsPostRequestBodyMember1able) { + return m.emailsPostRequestBodyEmailsPostRequestBodyMember1 +} +// GetEmailsPostRequestBodyMember1 gets the EmailsPostRequestBodyMember1 property value. Composed type representation for type EmailsPostRequestBodyMember1able +// returns a EmailsPostRequestBodyMember1able when successful +func (m *EmailsPostRequestBody) GetEmailsPostRequestBodyMember1()(EmailsPostRequestBodyMember1able) { + return m.emailsPostRequestBodyMember1 +} +// GetEmailsPostRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *EmailsPostRequestBody) GetEmailsPostRequestBodyString()(*string) { + return m.emailsPostRequestBodyString +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EmailsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *EmailsPostRequestBody) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *EmailsPostRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *EmailsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEmailsPostRequestBodyEmailsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetEmailsPostRequestBodyEmailsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetEmailsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetEmailsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetEmailsPostRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetEmailsPostRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetEmailsPostRequestBodyEmailsPostRequestBodyMember1 sets the EmailsPostRequestBodyMember1 property value. Composed type representation for type EmailsPostRequestBodyMember1able +func (m *EmailsPostRequestBody) SetEmailsPostRequestBodyEmailsPostRequestBodyMember1(value EmailsPostRequestBodyMember1able)() { + m.emailsPostRequestBodyEmailsPostRequestBodyMember1 = value +} +// SetEmailsPostRequestBodyMember1 sets the EmailsPostRequestBodyMember1 property value. Composed type representation for type EmailsPostRequestBodyMember1able +func (m *EmailsPostRequestBody) SetEmailsPostRequestBodyMember1(value EmailsPostRequestBodyMember1able)() { + m.emailsPostRequestBodyMember1 = value +} +// SetEmailsPostRequestBodyString sets the string property value. Composed type representation for type string +func (m *EmailsPostRequestBody) SetEmailsPostRequestBodyString(value *string)() { + m.emailsPostRequestBodyString = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *EmailsPostRequestBody) SetString(value *string)() { + m.string = value +} +// EmailsRequestBuilderGetQueryParameters lists all of your email addresses, and specifies which one is visibleto the public.OAuth app tokens and personal access tokens (classic) need the `user:email` scope to use this endpoint. +type EmailsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +type EmailsDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmailsDeleteRequestBodyEmailsDeleteRequestBodyMember1()(EmailsDeleteRequestBodyMember1able) + GetEmailsDeleteRequestBodyMember1()(EmailsDeleteRequestBodyMember1able) + GetEmailsDeleteRequestBodyString()(*string) + GetString()(*string) + SetEmailsDeleteRequestBodyEmailsDeleteRequestBodyMember1(value EmailsDeleteRequestBodyMember1able)() + SetEmailsDeleteRequestBodyMember1(value EmailsDeleteRequestBodyMember1able)() + SetEmailsDeleteRequestBodyString(value *string)() + SetString(value *string)() +} +type EmailsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmailsPostRequestBodyEmailsPostRequestBodyMember1()(EmailsPostRequestBodyMember1able) + GetEmailsPostRequestBodyMember1()(EmailsPostRequestBodyMember1able) + GetEmailsPostRequestBodyString()(*string) + GetString()(*string) + SetEmailsPostRequestBodyEmailsPostRequestBodyMember1(value EmailsPostRequestBodyMember1able)() + SetEmailsPostRequestBodyMember1(value EmailsPostRequestBodyMember1able)() + SetEmailsPostRequestBodyString(value *string)() + SetString(value *string)() +} +// NewEmailsRequestBuilderInternal instantiates a new EmailsRequestBuilder and sets the default values. +func NewEmailsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EmailsRequestBuilder) { + m := &EmailsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/emails{?page*,per_page*}", pathParameters), + } + return m +} +// NewEmailsRequestBuilder instantiates a new EmailsRequestBuilder and sets the default values. +func NewEmailsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EmailsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewEmailsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete oAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/users/emails#delete-an-email-address-for-the-authenticated-user +func (m *EmailsRequestBuilder) Delete(ctx context.Context, body EmailsDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get lists all of your email addresses, and specifies which one is visibleto the public.OAuth app tokens and personal access tokens (classic) need the `user:email` scope to use this endpoint. +// returns a []Emailable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user +func (m *EmailsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[EmailsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Emailable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmailFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Emailable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Emailable) + } + } + return val, nil +} +// Post oAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a []Emailable 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 +// 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] +// +// [API method documentation]: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user +func (m *EmailsRequestBuilder) Post(ctx context.Context, body EmailsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Emailable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmailFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Emailable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Emailable) + } + } + return val, nil +} +// ToDeleteRequestInformation oAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *EmailsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body EmailsDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToGetRequestInformation lists all of your email addresses, and specifies which one is visibleto the public.OAuth app tokens and personal access tokens (classic) need the `user:email` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *EmailsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[EmailsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation oAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *EmailsRequestBuilder) ToPostRequestInformation(ctx context.Context, body EmailsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *EmailsRequestBuilder when successful +func (m *EmailsRequestBuilder) WithUrl(rawUrl string)(*EmailsRequestBuilder) { + return NewEmailsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/followers_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/followers_request_builder.go new file mode 100644 index 000000000..3b0416141 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/followers_request_builder.go @@ -0,0 +1,73 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// FollowersRequestBuilder builds and executes requests for operations under \user\followers +type FollowersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// FollowersRequestBuilderGetQueryParameters lists the people following the authenticated user. +type FollowersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewFollowersRequestBuilderInternal instantiates a new FollowersRequestBuilder and sets the default values. +func NewFollowersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*FollowersRequestBuilder) { + m := &FollowersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/followers{?page*,per_page*}", pathParameters), + } + return m +} +// NewFollowersRequestBuilder instantiates a new FollowersRequestBuilder and sets the default values. +func NewFollowersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*FollowersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewFollowersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the people following the authenticated user. +// returns a []SimpleUserable 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/users/followers#list-followers-of-the-authenticated-user +func (m *FollowersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[FollowersRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation lists the people following the authenticated user. +// returns a *RequestInformation when successful +func (m *FollowersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[FollowersRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *FollowersRequestBuilder when successful +func (m *FollowersRequestBuilder) WithUrl(rawUrl string)(*FollowersRequestBuilder) { + return NewFollowersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/following_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/following_request_builder.go new file mode 100644 index 000000000..79e6372f7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/following_request_builder.go @@ -0,0 +1,85 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// FollowingRequestBuilder builds and executes requests for operations under \user\following +type FollowingRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// FollowingRequestBuilderGetQueryParameters lists the people who the authenticated user follows. +type FollowingRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk/pkg/github.user.following.item collection +// returns a *FollowingWithUsernameItemRequestBuilder when successful +func (m *FollowingRequestBuilder) ByUsername(username string)(*FollowingWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewFollowingWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewFollowingRequestBuilderInternal instantiates a new FollowingRequestBuilder and sets the default values. +func NewFollowingRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*FollowingRequestBuilder) { + m := &FollowingRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/following{?page*,per_page*}", pathParameters), + } + return m +} +// NewFollowingRequestBuilder instantiates a new FollowingRequestBuilder and sets the default values. +func NewFollowingRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*FollowingRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewFollowingRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the people who the authenticated user follows. +// returns a []SimpleUserable 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/users/followers#list-the-people-the-authenticated-user-follows +func (m *FollowingRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[FollowingRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation lists the people who the authenticated user follows. +// returns a *RequestInformation when successful +func (m *FollowingRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[FollowingRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *FollowingRequestBuilder when successful +func (m *FollowingRequestBuilder) WithUrl(rawUrl string)(*FollowingRequestBuilder) { + return NewFollowingRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/following_with_username_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/following_with_username_item_request_builder.go new file mode 100644 index 000000000..44b926dba --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/following_with_username_item_request_builder.go @@ -0,0 +1,122 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// FollowingWithUsernameItemRequestBuilder builds and executes requests for operations under \user\following\{username} +type FollowingWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewFollowingWithUsernameItemRequestBuilderInternal instantiates a new FollowingWithUsernameItemRequestBuilder and sets the default values. +func NewFollowingWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*FollowingWithUsernameItemRequestBuilder) { + m := &FollowingWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/following/{username}", pathParameters), + } + return m +} +// NewFollowingWithUsernameItemRequestBuilder instantiates a new FollowingWithUsernameItemRequestBuilder and sets the default values. +func NewFollowingWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*FollowingWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewFollowingWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete oAuth app tokens and personal access tokens (classic) need the `user:follow` scope to use this endpoint. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/followers#unfollow-a-user +func (m *FollowingWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get check if a person is followed by the authenticated user +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user +func (m *FollowingWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)."OAuth app tokens and personal access tokens (classic) need the `user:follow` scope to use this endpoint. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/followers#follow-a-user +func (m *FollowingWithUsernameItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation oAuth app tokens and personal access tokens (classic) need the `user:follow` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *FollowingWithUsernameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *FollowingWithUsernameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)."OAuth app tokens and personal access tokens (classic) need the `user:follow` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *FollowingWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *FollowingWithUsernameItemRequestBuilder when successful +func (m *FollowingWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*FollowingWithUsernameItemRequestBuilder) { + return NewFollowingWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/gpg_keys_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/gpg_keys_post_request_body.go new file mode 100644 index 000000000..2e080f98c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/gpg_keys_post_request_body.go @@ -0,0 +1,109 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Gpg_keysPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GPG key in ASCII-armored format. + armored_public_key *string + // A descriptive name for the new key. + name *string +} +// NewGpg_keysPostRequestBody instantiates a new Gpg_keysPostRequestBody and sets the default values. +func NewGpg_keysPostRequestBody()(*Gpg_keysPostRequestBody) { + m := &Gpg_keysPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGpg_keysPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGpg_keysPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGpg_keysPostRequestBody(), 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 *Gpg_keysPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArmoredPublicKey gets the armored_public_key property value. A GPG key in ASCII-armored format. +// returns a *string when successful +func (m *Gpg_keysPostRequestBody) GetArmoredPublicKey()(*string) { + return m.armored_public_key +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Gpg_keysPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["armored_public_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArmoredPublicKey(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. A descriptive name for the new key. +// returns a *string when successful +func (m *Gpg_keysPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *Gpg_keysPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("armored_public_key", m.GetArmoredPublicKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *Gpg_keysPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArmoredPublicKey sets the armored_public_key property value. A GPG key in ASCII-armored format. +func (m *Gpg_keysPostRequestBody) SetArmoredPublicKey(value *string)() { + m.armored_public_key = value +} +// SetName sets the name property value. A descriptive name for the new key. +func (m *Gpg_keysPostRequestBody) SetName(value *string)() { + m.name = value +} +type Gpg_keysPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArmoredPublicKey()(*string) + GetName()(*string) + SetArmoredPublicKey(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/gpg_keys_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/gpg_keys_request_builder.go new file mode 100644 index 000000000..9f26857be --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/gpg_keys_request_builder.go @@ -0,0 +1,127 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// Gpg_keysRequestBuilder builds and executes requests for operations under \user\gpg_keys +type Gpg_keysRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Gpg_keysRequestBuilderGetQueryParameters lists the current user's GPG keys.OAuth app tokens and personal access tokens (classic) need the `read:gpg_key` scope to use this endpoint. +type Gpg_keysRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByGpg_key_id gets an item from the github.com/octokit/go-sdk/pkg/github.user.gpg_keys.item collection +// returns a *Gpg_keysWithGpg_key_ItemRequestBuilder when successful +func (m *Gpg_keysRequestBuilder) ByGpg_key_id(gpg_key_id int32)(*Gpg_keysWithGpg_key_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["gpg_key_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(gpg_key_id), 10) + return NewGpg_keysWithGpg_key_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewGpg_keysRequestBuilderInternal instantiates a new Gpg_keysRequestBuilder and sets the default values. +func NewGpg_keysRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Gpg_keysRequestBuilder) { + m := &Gpg_keysRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/gpg_keys{?page*,per_page*}", pathParameters), + } + return m +} +// NewGpg_keysRequestBuilder instantiates a new Gpg_keysRequestBuilder and sets the default values. +func NewGpg_keysRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Gpg_keysRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewGpg_keysRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the current user's GPG keys.OAuth app tokens and personal access tokens (classic) need the `read:gpg_key` scope to use this endpoint. +// returns a []GpgKeyable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user +func (m *Gpg_keysRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Gpg_keysRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GpgKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGpgKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GpgKeyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GpgKeyable) + } + } + return val, nil +} +// Post adds a GPG key to the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `write:gpg_key` scope to use this endpoint. +// returns a GpgKeyable 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 +// 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] +// +// [API method documentation]: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user +func (m *Gpg_keysRequestBuilder) Post(ctx context.Context, body Gpg_keysPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GpgKeyable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGpgKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GpgKeyable), nil +} +// ToGetRequestInformation lists the current user's GPG keys.OAuth app tokens and personal access tokens (classic) need the `read:gpg_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Gpg_keysRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Gpg_keysRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation adds a GPG key to the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `write:gpg_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Gpg_keysRequestBuilder) ToPostRequestInformation(ctx context.Context, body Gpg_keysPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *Gpg_keysRequestBuilder when successful +func (m *Gpg_keysRequestBuilder) WithUrl(rawUrl string)(*Gpg_keysRequestBuilder) { + return NewGpg_keysRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/gpg_keys_with_gpg_key_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/gpg_keys_with_gpg_key_item_request_builder.go new file mode 100644 index 000000000..1823d59de --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/gpg_keys_with_gpg_key_item_request_builder.go @@ -0,0 +1,98 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// Gpg_keysWithGpg_key_ItemRequestBuilder builds and executes requests for operations under \user\gpg_keys\{gpg_key_id} +type Gpg_keysWithGpg_key_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewGpg_keysWithGpg_key_ItemRequestBuilderInternal instantiates a new Gpg_keysWithGpg_key_ItemRequestBuilder and sets the default values. +func NewGpg_keysWithGpg_key_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Gpg_keysWithGpg_key_ItemRequestBuilder) { + m := &Gpg_keysWithGpg_key_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/gpg_keys/{gpg_key_id}", pathParameters), + } + return m +} +// NewGpg_keysWithGpg_key_ItemRequestBuilder instantiates a new Gpg_keysWithGpg_key_ItemRequestBuilder and sets the default values. +func NewGpg_keysWithGpg_key_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Gpg_keysWithGpg_key_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewGpg_keysWithGpg_key_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a GPG key from the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `admin:gpg_key` scope to use this endpoint. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user +func (m *Gpg_keysWithGpg_key_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get view extended details for a single GPG key.OAuth app tokens and personal access tokens (classic) need the `read:gpg_key` scope to use this endpoint. +// returns a GpgKeyable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user +func (m *Gpg_keysWithGpg_key_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GpgKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGpgKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GpgKeyable), nil +} +// ToDeleteRequestInformation removes a GPG key from the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `admin:gpg_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Gpg_keysWithGpg_key_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation view extended details for a single GPG key.OAuth app tokens and personal access tokens (classic) need the `read:gpg_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Gpg_keysWithGpg_key_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *Gpg_keysWithGpg_key_ItemRequestBuilder when successful +func (m *Gpg_keysWithGpg_key_ItemRequestBuilder) WithUrl(rawUrl string)(*Gpg_keysWithGpg_key_ItemRequestBuilder) { + return NewGpg_keysWithGpg_key_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_get_response.go new file mode 100644 index 000000000..8ab5e6a1a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_get_response.go @@ -0,0 +1,122 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type InstallationsGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The installations property + installations []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable + // The total_count property + total_count *int32 +} +// NewInstallationsGetResponse instantiates a new InstallationsGetResponse and sets the default values. +func NewInstallationsGetResponse()(*InstallationsGetResponse) { + m := &InstallationsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateInstallationsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInstallationsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInstallationsGetResponse(), 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 *InstallationsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *InstallationsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["installations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateInstallationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable) + } + } + m.SetInstallations(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetInstallations gets the installations property value. The installations property +// returns a []Installationable when successful +func (m *InstallationsGetResponse) GetInstallations()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable) { + return m.installations +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *InstallationsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *InstallationsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInstallations() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetInstallations())) + for i, v := range m.GetInstallations() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("installations", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *InstallationsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetInstallations sets the installations property value. The installations property +func (m *InstallationsGetResponse) SetInstallations(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable)() { + m.installations = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *InstallationsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type InstallationsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInstallations()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable) + GetTotalCount()(*int32) + SetInstallations(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_item_repositories_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_item_repositories_get_response.go new file mode 100644 index 000000000..60ba5dca4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_item_repositories_get_response.go @@ -0,0 +1,151 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type InstallationsItemRepositoriesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The repositories property + repositories []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable + // The repository_selection property + repository_selection *string + // The total_count property + total_count *int32 +} +// NewInstallationsItemRepositoriesGetResponse instantiates a new InstallationsItemRepositoriesGetResponse and sets the default values. +func NewInstallationsItemRepositoriesGetResponse()(*InstallationsItemRepositoriesGetResponse) { + m := &InstallationsItemRepositoriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateInstallationsItemRepositoriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInstallationsItemRepositoriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInstallationsItemRepositoriesGetResponse(), 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 *InstallationsItemRepositoriesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *InstallationsItemRepositoriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["repository_selection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositorySelection(val) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []Repositoryable when successful +func (m *InstallationsItemRepositoriesGetResponse) GetRepositories()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable) { + return m.repositories +} +// GetRepositorySelection gets the repository_selection property value. The repository_selection property +// returns a *string when successful +func (m *InstallationsItemRepositoriesGetResponse) GetRepositorySelection()(*string) { + return m.repository_selection +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *InstallationsItemRepositoriesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *InstallationsItemRepositoriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_selection", m.GetRepositorySelection()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *InstallationsItemRepositoriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *InstallationsItemRepositoriesGetResponse) SetRepositories(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable)() { + m.repositories = value +} +// SetRepositorySelection sets the repository_selection property value. The repository_selection property +func (m *InstallationsItemRepositoriesGetResponse) SetRepositorySelection(value *string)() { + m.repository_selection = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *InstallationsItemRepositoriesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type InstallationsItemRepositoriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositories()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable) + GetRepositorySelection()(*string) + GetTotalCount()(*int32) + SetRepositories(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable)() + SetRepositorySelection(value *string)() + SetTotalCount(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_item_repositories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_item_repositories_request_builder.go new file mode 100644 index 000000000..5b778c13a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_item_repositories_request_builder.go @@ -0,0 +1,81 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// InstallationsItemRepositoriesRequestBuilder builds and executes requests for operations under \user\installations\{installation_id}\repositories +type InstallationsItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// InstallationsItemRepositoriesRequestBuilderGetQueryParameters list repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access for an installation.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.The access the user has to each repository is included in the hash under the `permissions` key. +type InstallationsItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRepository_id gets an item from the github.com/octokit/go-sdk/pkg/github.user.installations.item.repositories.item collection +// returns a *InstallationsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *InstallationsItemRepositoriesRequestBuilder) ByRepository_id(repository_id int32)(*InstallationsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["repository_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(repository_id), 10) + return NewInstallationsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewInstallationsItemRepositoriesRequestBuilderInternal instantiates a new InstallationsItemRepositoriesRequestBuilder and sets the default values. +func NewInstallationsItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsItemRepositoriesRequestBuilder) { + m := &InstallationsItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/installations/{installation_id}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewInstallationsItemRepositoriesRequestBuilder instantiates a new InstallationsItemRepositoriesRequestBuilder and sets the default values. +func NewInstallationsItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationsItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access for an installation.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.The access the user has to each repository is included in the hash under the `permissions` key. +// returns a InstallationsItemRepositoriesGetResponseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token +func (m *InstallationsItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[InstallationsItemRepositoriesRequestBuilderGetQueryParameters])(InstallationsItemRepositoriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateInstallationsItemRepositoriesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(InstallationsItemRepositoriesGetResponseable), nil +} +// ToGetRequestInformation list repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access for an installation.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.The access the user has to each repository is included in the hash under the `permissions` key. +// returns a *RequestInformation when successful +func (m *InstallationsItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[InstallationsItemRepositoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *InstallationsItemRepositoriesRequestBuilder when successful +func (m *InstallationsItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*InstallationsItemRepositoriesRequestBuilder) { + return NewInstallationsItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_item_repositories_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_item_repositories_response.go new file mode 100644 index 000000000..ac6a70862 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_item_repositories_response.go @@ -0,0 +1,28 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// InstallationsItemRepositoriesResponse +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type InstallationsItemRepositoriesResponse struct { + InstallationsItemRepositoriesGetResponse +} +// NewInstallationsItemRepositoriesResponse instantiates a new InstallationsItemRepositoriesResponse and sets the default values. +func NewInstallationsItemRepositoriesResponse()(*InstallationsItemRepositoriesResponse) { + m := &InstallationsItemRepositoriesResponse{ + InstallationsItemRepositoriesGetResponse: *NewInstallationsItemRepositoriesGetResponse(), + } + return m +} +// CreateInstallationsItemRepositoriesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateInstallationsItemRepositoriesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInstallationsItemRepositoriesResponse(), nil +} +// InstallationsItemRepositoriesResponseable +// Deprecated: This class is obsolete. Use repositoriesGetResponse instead. +type InstallationsItemRepositoriesResponseable interface { + InstallationsItemRepositoriesGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_item_repositories_with_repository_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_item_repositories_with_repository_item_request_builder.go new file mode 100644 index 000000000..764e9bc8f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_item_repositories_with_repository_item_request_builder.go @@ -0,0 +1,88 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// InstallationsItemRepositoriesWithRepository_ItemRequestBuilder builds and executes requests for operations under \user\installations\{installation_id}\repositories\{repository_id} +type InstallationsItemRepositoriesWithRepository_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewInstallationsItemRepositoriesWithRepository_ItemRequestBuilderInternal instantiates a new InstallationsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewInstallationsItemRepositoriesWithRepository_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsItemRepositoriesWithRepository_ItemRequestBuilder) { + m := &InstallationsItemRepositoriesWithRepository_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/installations/{installation_id}/repositories/{repository_id}", pathParameters), + } + return m +} +// NewInstallationsItemRepositoriesWithRepository_ItemRequestBuilder instantiates a new InstallationsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewInstallationsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the `repository_selection` of `selected`. This endpoint only works for PATs (classic) with the `repo` scope. +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation +func (m *InstallationsItemRepositoriesWithRepository_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put add a single repository to an installation. The authenticated user must have admin access to the repository. This endpoint only works for PATs (classic) with the `repo` scope. +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation +func (m *InstallationsItemRepositoriesWithRepository_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the `repository_selection` of `selected`. This endpoint only works for PATs (classic) with the `repo` scope. +// returns a *RequestInformation when successful +func (m *InstallationsItemRepositoriesWithRepository_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation add a single repository to an installation. The authenticated user must have admin access to the repository. This endpoint only works for PATs (classic) with the `repo` scope. +// returns a *RequestInformation when successful +func (m *InstallationsItemRepositoriesWithRepository_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *InstallationsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *InstallationsItemRepositoriesWithRepository_ItemRequestBuilder) WithUrl(rawUrl string)(*InstallationsItemRepositoriesWithRepository_ItemRequestBuilder) { + return NewInstallationsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_request_builder.go new file mode 100644 index 000000000..805228a2f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_request_builder.go @@ -0,0 +1,81 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// InstallationsRequestBuilder builds and executes requests for operations under \user\installations +type InstallationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// InstallationsRequestBuilderGetQueryParameters lists installations of your GitHub App that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.You can find the permissions for the installation under the `permissions` key. +type InstallationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByInstallation_id gets an item from the github.com/octokit/go-sdk/pkg/github.user.installations.item collection +// returns a *InstallationsWithInstallation_ItemRequestBuilder when successful +func (m *InstallationsRequestBuilder) ByInstallation_id(installation_id int32)(*InstallationsWithInstallation_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["installation_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(installation_id), 10) + return NewInstallationsWithInstallation_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewInstallationsRequestBuilderInternal instantiates a new InstallationsRequestBuilder and sets the default values. +func NewInstallationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsRequestBuilder) { + m := &InstallationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/installations{?page*,per_page*}", pathParameters), + } + return m +} +// NewInstallationsRequestBuilder instantiates a new InstallationsRequestBuilder and sets the default values. +func NewInstallationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists installations of your GitHub App that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.You can find the permissions for the installation under the `permissions` key. +// returns a InstallationsGetResponseable 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/apps/installations#list-app-installations-accessible-to-the-user-access-token +func (m *InstallationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[InstallationsRequestBuilderGetQueryParameters])(InstallationsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateInstallationsGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(InstallationsGetResponseable), nil +} +// ToGetRequestInformation lists installations of your GitHub App that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.You can find the permissions for the installation under the `permissions` key. +// returns a *RequestInformation when successful +func (m *InstallationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[InstallationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *InstallationsRequestBuilder when successful +func (m *InstallationsRequestBuilder) WithUrl(rawUrl string)(*InstallationsRequestBuilder) { + return NewInstallationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_response.go new file mode 100644 index 000000000..2add5ad2e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_response.go @@ -0,0 +1,28 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// InstallationsResponse +// Deprecated: This class is obsolete. Use installationsGetResponse instead. +type InstallationsResponse struct { + InstallationsGetResponse +} +// NewInstallationsResponse instantiates a new InstallationsResponse and sets the default values. +func NewInstallationsResponse()(*InstallationsResponse) { + m := &InstallationsResponse{ + InstallationsGetResponse: *NewInstallationsGetResponse(), + } + return m +} +// CreateInstallationsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateInstallationsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInstallationsResponse(), nil +} +// InstallationsResponseable +// Deprecated: This class is obsolete. Use installationsGetResponse instead. +type InstallationsResponseable interface { + InstallationsGetResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_with_installation_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_with_installation_item_request_builder.go new file mode 100644 index 000000000..e69d370c8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/installations_with_installation_item_request_builder.go @@ -0,0 +1,28 @@ +package user + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// InstallationsWithInstallation_ItemRequestBuilder builds and executes requests for operations under \user\installations\{installation_id} +type InstallationsWithInstallation_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewInstallationsWithInstallation_ItemRequestBuilderInternal instantiates a new InstallationsWithInstallation_ItemRequestBuilder and sets the default values. +func NewInstallationsWithInstallation_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsWithInstallation_ItemRequestBuilder) { + m := &InstallationsWithInstallation_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/installations/{installation_id}", pathParameters), + } + return m +} +// NewInstallationsWithInstallation_ItemRequestBuilder instantiates a new InstallationsWithInstallation_ItemRequestBuilder and sets the default values. +func NewInstallationsWithInstallation_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsWithInstallation_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationsWithInstallation_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Repositories the repositories property +// returns a *InstallationsItemRepositoriesRequestBuilder when successful +func (m *InstallationsWithInstallation_ItemRequestBuilder) Repositories()(*InstallationsItemRepositoriesRequestBuilder) { + return NewInstallationsItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/interaction_limits_get_response_member1.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/interaction_limits_get_response_member1.go new file mode 100644 index 000000000..1f2341f38 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/interaction_limits_get_response_member1.go @@ -0,0 +1,32 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// InteractionLimitsGetResponseMember1 +type InteractionLimitsGetResponseMember1 struct { +} +// NewInteractionLimitsGetResponseMember1 instantiates a new InteractionLimitsGetResponseMember1 and sets the default values. +func NewInteractionLimitsGetResponseMember1()(*InteractionLimitsGetResponseMember1) { + m := &InteractionLimitsGetResponseMember1{ + } + return m +} +// CreateInteractionLimitsGetResponseMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateInteractionLimitsGetResponseMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInteractionLimitsGetResponseMember1(), nil +} +// GetFieldDeserializers the deserialization information for the current model +func (m *InteractionLimitsGetResponseMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *InteractionLimitsGetResponseMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// InteractionLimitsGetResponseMember1able +type InteractionLimitsGetResponseMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/interaction_limits_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/interaction_limits_request_builder.go new file mode 100644 index 000000000..f0f7ca8e0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/interaction_limits_request_builder.go @@ -0,0 +1,114 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// InteractionLimitsRequestBuilder builds and executes requests for operations under \user\interaction-limits +type InteractionLimitsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewInteractionLimitsRequestBuilderInternal instantiates a new InteractionLimitsRequestBuilder and sets the default values. +func NewInteractionLimitsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InteractionLimitsRequestBuilder) { + m := &InteractionLimitsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/interaction-limits", pathParameters), + } + return m +} +// NewInteractionLimitsRequestBuilder instantiates a new InteractionLimitsRequestBuilder and sets the default values. +func NewInteractionLimitsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InteractionLimitsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInteractionLimitsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes any interaction restrictions from your public repositories. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/interactions/user#remove-interaction-restrictions-from-your-public-repositories +func (m *InteractionLimitsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get shows which type of GitHub user can interact with your public repositories and when the restriction expires. +// returns a InteractionLimitResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/interactions/user#get-interaction-restrictions-for-your-public-repositories +func (m *InteractionLimitsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateInteractionLimitResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitResponseable), nil +} +// Put temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user. +// returns a InteractionLimitResponseable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/interactions/user#set-interaction-restrictions-for-your-public-repositories +func (m *InteractionLimitsRequestBuilder) Put(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateInteractionLimitResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitResponseable), nil +} +// ToDeleteRequestInformation removes any interaction restrictions from your public repositories. +// returns a *RequestInformation when successful +func (m *InteractionLimitsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// ToGetRequestInformation shows which type of GitHub user can interact with your public repositories and when the restriction expires. +// returns a *RequestInformation when successful +func (m *InteractionLimitsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user. +// returns a *RequestInformation when successful +func (m *InteractionLimitsRequestBuilder) ToPutRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.InteractionLimitable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *InteractionLimitsRequestBuilder when successful +func (m *InteractionLimitsRequestBuilder) WithUrl(rawUrl string)(*InteractionLimitsRequestBuilder) { + return NewInteractionLimitsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/issues/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/issues/get_direction_query_parameter_type.go new file mode 100644 index 000000000..6aca6ecb9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/issues/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package issues +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/issues/get_filter_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/issues/get_filter_query_parameter_type.go new file mode 100644 index 000000000..bd35fa09b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/issues/get_filter_query_parameter_type.go @@ -0,0 +1,48 @@ +package issues +import ( + "errors" +) +type GetFilterQueryParameterType int + +const ( + ASSIGNED_GETFILTERQUERYPARAMETERTYPE GetFilterQueryParameterType = iota + CREATED_GETFILTERQUERYPARAMETERTYPE + MENTIONED_GETFILTERQUERYPARAMETERTYPE + SUBSCRIBED_GETFILTERQUERYPARAMETERTYPE + REPOS_GETFILTERQUERYPARAMETERTYPE + ALL_GETFILTERQUERYPARAMETERTYPE +) + +func (i GetFilterQueryParameterType) String() string { + return []string{"assigned", "created", "mentioned", "subscribed", "repos", "all"}[i] +} +func ParseGetFilterQueryParameterType(v string) (any, error) { + result := ASSIGNED_GETFILTERQUERYPARAMETERTYPE + switch v { + case "assigned": + result = ASSIGNED_GETFILTERQUERYPARAMETERTYPE + case "created": + result = CREATED_GETFILTERQUERYPARAMETERTYPE + case "mentioned": + result = MENTIONED_GETFILTERQUERYPARAMETERTYPE + case "subscribed": + result = SUBSCRIBED_GETFILTERQUERYPARAMETERTYPE + case "repos": + result = REPOS_GETFILTERQUERYPARAMETERTYPE + case "all": + result = ALL_GETFILTERQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetFilterQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetFilterQueryParameterType(values []GetFilterQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetFilterQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/issues/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/issues/get_sort_query_parameter_type.go new file mode 100644 index 000000000..ba962acfb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/issues/get_sort_query_parameter_type.go @@ -0,0 +1,39 @@ +package issues +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + COMMENTS_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "comments"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "comments": + result = COMMENTS_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/issues/get_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/issues/get_state_query_parameter_type.go new file mode 100644 index 000000000..554151074 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/issues/get_state_query_parameter_type.go @@ -0,0 +1,39 @@ +package issues +import ( + "errors" +) +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/issues_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/issues_request_builder.go new file mode 100644 index 000000000..0fb725f1d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/issues_request_builder.go @@ -0,0 +1,85 @@ +package user + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i4ff4b7a4d09875186c447aac75fb9ce4cc99e7c847ea443e2165c288b294b0c9 "github.com/octokit/go-sdk/pkg/github/user/issues" +) + +// IssuesRequestBuilder builds and executes requests for operations under \user\issues +type IssuesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// IssuesRequestBuilderGetQueryParameters list issues across owned and member repositories assigned to the authenticated user.**Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For thisreason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests bythe `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pullrequest id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type IssuesRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i4ff4b7a4d09875186c447aac75fb9ce4cc99e7c847ea443e2165c288b294b0c9.GetDirectionQueryParameterType `uriparametername:"direction"` + // Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation. + Filter *i4ff4b7a4d09875186c447aac75fb9ce4cc99e7c847ea443e2165c288b294b0c9.GetFilterQueryParameterType `uriparametername:"filter"` + // A list of comma separated label names. Example: `bug,ui,@high` + Labels *string `uriparametername:"labels"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + // What to sort results by. + Sort *i4ff4b7a4d09875186c447aac75fb9ce4cc99e7c847ea443e2165c288b294b0c9.GetSortQueryParameterType `uriparametername:"sort"` + // Indicates the state of the issues to return. + State *i4ff4b7a4d09875186c447aac75fb9ce4cc99e7c847ea443e2165c288b294b0c9.GetStateQueryParameterType `uriparametername:"state"` +} +// NewIssuesRequestBuilderInternal instantiates a new IssuesRequestBuilder and sets the default values. +func NewIssuesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IssuesRequestBuilder) { + m := &IssuesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/issues{?direction*,filter*,labels*,page*,per_page*,since*,sort*,state*}", pathParameters), + } + return m +} +// NewIssuesRequestBuilder instantiates a new IssuesRequestBuilder and sets the default values. +func NewIssuesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IssuesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewIssuesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list issues across owned and member repositories assigned to the authenticated user.**Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For thisreason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests bythe `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pullrequest id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []Issueable 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/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user +func (m *IssuesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[IssuesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateIssueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Issueable) + } + } + return val, nil +} +// ToGetRequestInformation list issues across owned and member repositories assigned to the authenticated user.**Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For thisreason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests bythe `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pullrequest id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *IssuesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[IssuesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *IssuesRequestBuilder when successful +func (m *IssuesRequestBuilder) WithUrl(rawUrl string)(*IssuesRequestBuilder) { + return NewIssuesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/keys_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/keys_post_request_body.go new file mode 100644 index 000000000..be7c1d2c6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/keys_post_request_body.go @@ -0,0 +1,109 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type KeysPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The public SSH key to add to your GitHub account. + key *string + // A descriptive name for the new key. + title *string +} +// NewKeysPostRequestBody instantiates a new KeysPostRequestBody and sets the default values. +func NewKeysPostRequestBody()(*KeysPostRequestBody) { + m := &KeysPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateKeysPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateKeysPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewKeysPostRequestBody(), 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 *KeysPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *KeysPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The public SSH key to add to your GitHub account. +// returns a *string when successful +func (m *KeysPostRequestBody) GetKey()(*string) { + return m.key +} +// GetTitle gets the title property value. A descriptive name for the new key. +// returns a *string when successful +func (m *KeysPostRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *KeysPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *KeysPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The public SSH key to add to your GitHub account. +func (m *KeysPostRequestBody) SetKey(value *string)() { + m.key = value +} +// SetTitle sets the title property value. A descriptive name for the new key. +func (m *KeysPostRequestBody) SetTitle(value *string)() { + m.title = value +} +type KeysPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetTitle()(*string) + SetKey(value *string)() + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/keys_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/keys_request_builder.go new file mode 100644 index 000000000..07b2dedcf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/keys_request_builder.go @@ -0,0 +1,127 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// KeysRequestBuilder builds and executes requests for operations under \user\keys +type KeysRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// KeysRequestBuilderGetQueryParameters lists the public SSH keys for the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `read:public_key` scope to use this endpoint. +type KeysRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByKey_id gets an item from the github.com/octokit/go-sdk/pkg/github.user.keys.item collection +// returns a *KeysWithKey_ItemRequestBuilder when successful +func (m *KeysRequestBuilder) ByKey_id(key_id int32)(*KeysWithKey_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["key_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(key_id), 10) + return NewKeysWithKey_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewKeysRequestBuilderInternal instantiates a new KeysRequestBuilder and sets the default values. +func NewKeysRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*KeysRequestBuilder) { + m := &KeysRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/keys{?page*,per_page*}", pathParameters), + } + return m +} +// NewKeysRequestBuilder instantiates a new KeysRequestBuilder and sets the default values. +func NewKeysRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*KeysRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewKeysRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the public SSH keys for the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `read:public_key` scope to use this endpoint. +// returns a []Keyable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user +func (m *KeysRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[KeysRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Keyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Keyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Keyable) + } + } + return val, nil +} +// Post adds a public SSH key to the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `write:gpg_key` scope to use this endpoint. +// returns a Keyable 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 +// 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] +// +// [API method documentation]: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user +func (m *KeysRequestBuilder) Post(ctx context.Context, body KeysPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Keyable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Keyable), nil +} +// ToGetRequestInformation lists the public SSH keys for the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `read:public_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *KeysRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[KeysRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation adds a public SSH key to the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `write:gpg_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *KeysRequestBuilder) ToPostRequestInformation(ctx context.Context, body KeysPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *KeysRequestBuilder when successful +func (m *KeysRequestBuilder) WithUrl(rawUrl string)(*KeysRequestBuilder) { + return NewKeysRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/keys_with_key_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/keys_with_key_item_request_builder.go new file mode 100644 index 000000000..9b7475f94 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/keys_with_key_item_request_builder.go @@ -0,0 +1,96 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// KeysWithKey_ItemRequestBuilder builds and executes requests for operations under \user\keys\{key_id} +type KeysWithKey_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewKeysWithKey_ItemRequestBuilderInternal instantiates a new KeysWithKey_ItemRequestBuilder and sets the default values. +func NewKeysWithKey_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*KeysWithKey_ItemRequestBuilder) { + m := &KeysWithKey_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/keys/{key_id}", pathParameters), + } + return m +} +// NewKeysWithKey_ItemRequestBuilder instantiates a new KeysWithKey_ItemRequestBuilder and sets the default values. +func NewKeysWithKey_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*KeysWithKey_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewKeysWithKey_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a public SSH key from the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `admin:public_key` scope to use this endpoint. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user +func (m *KeysWithKey_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get view extended details for a single public SSH key.OAuth app tokens and personal access tokens (classic) need the `read:public_key` scope to use this endpoint. +// returns a Keyable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user +func (m *KeysWithKey_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Keyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Keyable), nil +} +// ToDeleteRequestInformation removes a public SSH key from the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `admin:public_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *KeysWithKey_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation view extended details for a single public SSH key.OAuth app tokens and personal access tokens (classic) need the `read:public_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *KeysWithKey_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *KeysWithKey_ItemRequestBuilder when successful +func (m *KeysWithKey_ItemRequestBuilder) WithUrl(rawUrl string)(*KeysWithKey_ItemRequestBuilder) { + return NewKeysWithKey_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/marketplace_purchases_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/marketplace_purchases_request_builder.go new file mode 100644 index 000000000..305358da9 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/marketplace_purchases_request_builder.go @@ -0,0 +1,78 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// Marketplace_purchasesRequestBuilder builds and executes requests for operations under \user\marketplace_purchases +type Marketplace_purchasesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Marketplace_purchasesRequestBuilderGetQueryParameters lists the active subscriptions for the authenticated user. +type Marketplace_purchasesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewMarketplace_purchasesRequestBuilderInternal instantiates a new Marketplace_purchasesRequestBuilder and sets the default values. +func NewMarketplace_purchasesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Marketplace_purchasesRequestBuilder) { + m := &Marketplace_purchasesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/marketplace_purchases{?page*,per_page*}", pathParameters), + } + return m +} +// NewMarketplace_purchasesRequestBuilder instantiates a new Marketplace_purchasesRequestBuilder and sets the default values. +func NewMarketplace_purchasesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Marketplace_purchasesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMarketplace_purchasesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the active subscriptions for the authenticated user. +// returns a []UserMarketplacePurchaseable when successful +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user +func (m *Marketplace_purchasesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Marketplace_purchasesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.UserMarketplacePurchaseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateUserMarketplacePurchaseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.UserMarketplacePurchaseable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.UserMarketplacePurchaseable) + } + } + return val, nil +} +// Stubbed the stubbed property +// returns a *Marketplace_purchasesStubbedRequestBuilder when successful +func (m *Marketplace_purchasesRequestBuilder) Stubbed()(*Marketplace_purchasesStubbedRequestBuilder) { + return NewMarketplace_purchasesStubbedRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists the active subscriptions for the authenticated user. +// returns a *RequestInformation when successful +func (m *Marketplace_purchasesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Marketplace_purchasesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *Marketplace_purchasesRequestBuilder when successful +func (m *Marketplace_purchasesRequestBuilder) WithUrl(rawUrl string)(*Marketplace_purchasesRequestBuilder) { + return NewMarketplace_purchasesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/marketplace_purchases_stubbed_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/marketplace_purchases_stubbed_request_builder.go new file mode 100644 index 000000000..285e197f8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/marketplace_purchases_stubbed_request_builder.go @@ -0,0 +1,71 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// Marketplace_purchasesStubbedRequestBuilder builds and executes requests for operations under \user\marketplace_purchases\stubbed +type Marketplace_purchasesStubbedRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Marketplace_purchasesStubbedRequestBuilderGetQueryParameters lists the active subscriptions for the authenticated user. +type Marketplace_purchasesStubbedRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewMarketplace_purchasesStubbedRequestBuilderInternal instantiates a new Marketplace_purchasesStubbedRequestBuilder and sets the default values. +func NewMarketplace_purchasesStubbedRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Marketplace_purchasesStubbedRequestBuilder) { + m := &Marketplace_purchasesStubbedRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/marketplace_purchases/stubbed{?page*,per_page*}", pathParameters), + } + return m +} +// NewMarketplace_purchasesStubbedRequestBuilder instantiates a new Marketplace_purchasesStubbedRequestBuilder and sets the default values. +func NewMarketplace_purchasesStubbedRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Marketplace_purchasesStubbedRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMarketplace_purchasesStubbedRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the active subscriptions for the authenticated user. +// returns a []UserMarketplacePurchaseable when successful +// returns a BasicError error when the service returns a 401 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed +func (m *Marketplace_purchasesStubbedRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Marketplace_purchasesStubbedRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.UserMarketplacePurchaseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateUserMarketplacePurchaseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.UserMarketplacePurchaseable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.UserMarketplacePurchaseable) + } + } + return val, nil +} +// ToGetRequestInformation lists the active subscriptions for the authenticated user. +// returns a *RequestInformation when successful +func (m *Marketplace_purchasesStubbedRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Marketplace_purchasesStubbedRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *Marketplace_purchasesStubbedRequestBuilder when successful +func (m *Marketplace_purchasesStubbedRequestBuilder) WithUrl(rawUrl string)(*Marketplace_purchasesStubbedRequestBuilder) { + return NewMarketplace_purchasesStubbedRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/memberships/orgs/get_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/memberships/orgs/get_state_query_parameter_type.go new file mode 100644 index 000000000..d160652ee --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/memberships/orgs/get_state_query_parameter_type.go @@ -0,0 +1,36 @@ +package orgs +import ( + "errors" +) +type GetStateQueryParameterType int + +const ( + ACTIVE_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + PENDING_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"active", "pending"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := ACTIVE_GETSTATEQUERYPARAMETERTYPE + switch v { + case "active": + result = ACTIVE_GETSTATEQUERYPARAMETERTYPE + case "pending": + result = PENDING_GETSTATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/memberships_orgs_item_with_org_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/memberships_orgs_item_with_org_patch_request_body.go new file mode 100644 index 000000000..1fc6debe7 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/memberships_orgs_item_with_org_patch_request_body.go @@ -0,0 +1,51 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MembershipsOrgsItemWithOrgPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewMembershipsOrgsItemWithOrgPatchRequestBody instantiates a new MembershipsOrgsItemWithOrgPatchRequestBody and sets the default values. +func NewMembershipsOrgsItemWithOrgPatchRequestBody()(*MembershipsOrgsItemWithOrgPatchRequestBody) { + m := &MembershipsOrgsItemWithOrgPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMembershipsOrgsItemWithOrgPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMembershipsOrgsItemWithOrgPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMembershipsOrgsItemWithOrgPatchRequestBody(), 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 *MembershipsOrgsItemWithOrgPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MembershipsOrgsItemWithOrgPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *MembershipsOrgsItemWithOrgPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *MembershipsOrgsItemWithOrgPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type MembershipsOrgsItemWithOrgPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/memberships_orgs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/memberships_orgs_request_builder.go new file mode 100644 index 000000000..b22b62405 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/memberships_orgs_request_builder.go @@ -0,0 +1,90 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i6248a706a395d319f3e66611fac0b2654fe48b61e0e7152b109cc83e1d984972 "github.com/octokit/go-sdk/pkg/github/user/memberships/orgs" +) + +// MembershipsOrgsRequestBuilder builds and executes requests for operations under \user\memberships\orgs +type MembershipsOrgsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// MembershipsOrgsRequestBuilderGetQueryParameters lists all of the authenticated user's organization memberships. +type MembershipsOrgsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Indicates the state of the memberships to return. If not specified, the API returns both active and pending memberships. + State *i6248a706a395d319f3e66611fac0b2654fe48b61e0e7152b109cc83e1d984972.GetStateQueryParameterType `uriparametername:"state"` +} +// ByOrg gets an item from the github.com/octokit/go-sdk/pkg/github.user.memberships.orgs.item collection +// returns a *MembershipsOrgsWithOrgItemRequestBuilder when successful +func (m *MembershipsOrgsRequestBuilder) ByOrg(org string)(*MembershipsOrgsWithOrgItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if org != "" { + urlTplParams["org"] = org + } + return NewMembershipsOrgsWithOrgItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewMembershipsOrgsRequestBuilderInternal instantiates a new MembershipsOrgsRequestBuilder and sets the default values. +func NewMembershipsOrgsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MembershipsOrgsRequestBuilder) { + m := &MembershipsOrgsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/memberships/orgs{?page*,per_page*,state*}", pathParameters), + } + return m +} +// NewMembershipsOrgsRequestBuilder instantiates a new MembershipsOrgsRequestBuilder and sets the default values. +func NewMembershipsOrgsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MembershipsOrgsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMembershipsOrgsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all of the authenticated user's organization memberships. +// returns a []OrgMembershipable 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 +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/members#list-organization-memberships-for-the-authenticated-user +func (m *MembershipsOrgsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[MembershipsOrgsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgMembershipable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgMembershipFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgMembershipable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgMembershipable) + } + } + return val, nil +} +// ToGetRequestInformation lists all of the authenticated user's organization memberships. +// returns a *RequestInformation when successful +func (m *MembershipsOrgsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[MembershipsOrgsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *MembershipsOrgsRequestBuilder when successful +func (m *MembershipsOrgsRequestBuilder) WithUrl(rawUrl string)(*MembershipsOrgsRequestBuilder) { + return NewMembershipsOrgsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/memberships_orgs_with_org_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/memberships_orgs_with_org_item_request_builder.go new file mode 100644 index 000000000..ff4f1f81e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/memberships_orgs_with_org_item_request_builder.go @@ -0,0 +1,102 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// MembershipsOrgsWithOrgItemRequestBuilder builds and executes requests for operations under \user\memberships\orgs\{org} +type MembershipsOrgsWithOrgItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewMembershipsOrgsWithOrgItemRequestBuilderInternal instantiates a new MembershipsOrgsWithOrgItemRequestBuilder and sets the default values. +func NewMembershipsOrgsWithOrgItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MembershipsOrgsWithOrgItemRequestBuilder) { + m := &MembershipsOrgsWithOrgItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/memberships/orgs/{org}", pathParameters), + } + return m +} +// NewMembershipsOrgsWithOrgItemRequestBuilder instantiates a new MembershipsOrgsWithOrgItemRequestBuilder and sets the default values. +func NewMembershipsOrgsWithOrgItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MembershipsOrgsWithOrgItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMembershipsOrgsWithOrgItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get if the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a `404` is returned. This endpoint will return a `403` if the request is made by a GitHub App that is blocked by the organization. +// returns a OrgMembershipable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user +func (m *MembershipsOrgsWithOrgItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgMembershipable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgMembershipFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgMembershipable), nil +} +// Patch converts the authenticated user to an active member of the organization, if that user has a pending invitation from the organization. +// returns a OrgMembershipable when successful +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user +func (m *MembershipsOrgsWithOrgItemRequestBuilder) Patch(ctx context.Context, body MembershipsOrgsItemWithOrgPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgMembershipable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgMembershipFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgMembershipable), nil +} +// ToGetRequestInformation if the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a `404` is returned. This endpoint will return a `403` if the request is made by a GitHub App that is blocked by the organization. +// returns a *RequestInformation when successful +func (m *MembershipsOrgsWithOrgItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation converts the authenticated user to an active member of the organization, if that user has a pending invitation from the organization. +// returns a *RequestInformation when successful +func (m *MembershipsOrgsWithOrgItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body MembershipsOrgsItemWithOrgPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *MembershipsOrgsWithOrgItemRequestBuilder when successful +func (m *MembershipsOrgsWithOrgItemRequestBuilder) WithUrl(rawUrl string)(*MembershipsOrgsWithOrgItemRequestBuilder) { + return NewMembershipsOrgsWithOrgItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/memberships_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/memberships_request_builder.go new file mode 100644 index 000000000..f865a111c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/memberships_request_builder.go @@ -0,0 +1,28 @@ +package user + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// MembershipsRequestBuilder builds and executes requests for operations under \user\memberships +type MembershipsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewMembershipsRequestBuilderInternal instantiates a new MembershipsRequestBuilder and sets the default values. +func NewMembershipsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MembershipsRequestBuilder) { + m := &MembershipsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/memberships", pathParameters), + } + return m +} +// NewMembershipsRequestBuilder instantiates a new MembershipsRequestBuilder and sets the default values. +func NewMembershipsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MembershipsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMembershipsRequestBuilderInternal(urlParams, requestAdapter) +} +// Orgs the orgs property +// returns a *MembershipsOrgsRequestBuilder when successful +func (m *MembershipsRequestBuilder) Orgs()(*MembershipsOrgsRequestBuilder) { + return NewMembershipsOrgsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_item_archive_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_item_archive_request_builder.go new file mode 100644 index 000000000..6fcde9e65 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_item_archive_request_builder.go @@ -0,0 +1,90 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// MigrationsItemArchiveRequestBuilder builds and executes requests for operations under \user\migrations\{migration_id}\archive +type MigrationsItemArchiveRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewMigrationsItemArchiveRequestBuilderInternal instantiates a new MigrationsItemArchiveRequestBuilder and sets the default values. +func NewMigrationsItemArchiveRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsItemArchiveRequestBuilder) { + m := &MigrationsItemArchiveRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/migrations/{migration_id}/archive", pathParameters), + } + return m +} +// NewMigrationsItemArchiveRequestBuilder instantiates a new MigrationsItemArchiveRequestBuilder and sets the default values. +func NewMigrationsItemArchiveRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsItemArchiveRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMigrationsItemArchiveRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete 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 BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/migrations/users#delete-a-user-migration-archive +func (m *MigrationsItemArchiveRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + 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 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])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + 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 +func (m *MigrationsItemArchiveRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation 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 *RequestInformation when successful +func (m *MigrationsItemArchiveRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *MigrationsItemArchiveRequestBuilder when successful +func (m *MigrationsItemArchiveRequestBuilder) WithUrl(rawUrl string)(*MigrationsItemArchiveRequestBuilder) { + return NewMigrationsItemArchiveRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_item_repos_item_lock_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_item_repos_item_lock_request_builder.go new file mode 100644 index 000000000..00d778f1a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_item_repos_item_lock_request_builder.go @@ -0,0 +1,61 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// MigrationsItemReposItemLockRequestBuilder builds and executes requests for operations under \user\migrations\{migration_id}\repos\{repo_name}\lock +type MigrationsItemReposItemLockRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewMigrationsItemReposItemLockRequestBuilderInternal instantiates a new MigrationsItemReposItemLockRequestBuilder and sets the default values. +func NewMigrationsItemReposItemLockRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsItemReposItemLockRequestBuilder) { + m := &MigrationsItemReposItemLockRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/migrations/{migration_id}/repos/{repo_name}/lock", pathParameters), + } + return m +} +// NewMigrationsItemReposItemLockRequestBuilder instantiates a new MigrationsItemReposItemLockRequestBuilder and sets the default values. +func NewMigrationsItemReposItemLockRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsItemReposItemLockRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMigrationsItemReposItemLockRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete unlocks a repository. You can lock repositories when you [start a user migration](https://docs.github.com/rest/migrations/users#start-a-user-migration). Once the migration is complete you can unlock each repository to begin using it again or [delete the repository](https://docs.github.com/rest/repos/repos#delete-a-repository) if you no longer need the source data. Returns a status of `404 Not Found` if the repository is not locked. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/migrations/users#unlock-a-user-repository +func (m *MigrationsItemReposItemLockRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation unlocks a repository. You can lock repositories when you [start a user migration](https://docs.github.com/rest/migrations/users#start-a-user-migration). Once the migration is complete you can unlock each repository to begin using it again or [delete the repository](https://docs.github.com/rest/repos/repos#delete-a-repository) if you no longer need the source data. Returns a status of `404 Not Found` if the repository is not locked. +// returns a *RequestInformation when successful +func (m *MigrationsItemReposItemLockRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *MigrationsItemReposItemLockRequestBuilder when successful +func (m *MigrationsItemReposItemLockRequestBuilder) WithUrl(rawUrl string)(*MigrationsItemReposItemLockRequestBuilder) { + return NewMigrationsItemReposItemLockRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_item_repos_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_item_repos_request_builder.go new file mode 100644 index 000000000..f60f7308f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_item_repos_request_builder.go @@ -0,0 +1,35 @@ +package user + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// MigrationsItemReposRequestBuilder builds and executes requests for operations under \user\migrations\{migration_id}\repos +type MigrationsItemReposRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRepo_name gets an item from the github.com/octokit/go-sdk/pkg/github.user.migrations.item.repos.item collection +// returns a *MigrationsItemReposWithRepo_nameItemRequestBuilder when successful +func (m *MigrationsItemReposRequestBuilder) ByRepo_name(repo_name string)(*MigrationsItemReposWithRepo_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if repo_name != "" { + urlTplParams["repo_name"] = repo_name + } + return NewMigrationsItemReposWithRepo_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewMigrationsItemReposRequestBuilderInternal instantiates a new MigrationsItemReposRequestBuilder and sets the default values. +func NewMigrationsItemReposRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsItemReposRequestBuilder) { + m := &MigrationsItemReposRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/migrations/{migration_id}/repos", pathParameters), + } + return m +} +// NewMigrationsItemReposRequestBuilder instantiates a new MigrationsItemReposRequestBuilder and sets the default values. +func NewMigrationsItemReposRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsItemReposRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMigrationsItemReposRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_item_repos_with_repo_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_item_repos_with_repo_name_item_request_builder.go new file mode 100644 index 000000000..f4232cd8e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_item_repos_with_repo_name_item_request_builder.go @@ -0,0 +1,28 @@ +package user + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// MigrationsItemReposWithRepo_nameItemRequestBuilder builds and executes requests for operations under \user\migrations\{migration_id}\repos\{repo_name} +type MigrationsItemReposWithRepo_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewMigrationsItemReposWithRepo_nameItemRequestBuilderInternal instantiates a new MigrationsItemReposWithRepo_nameItemRequestBuilder and sets the default values. +func NewMigrationsItemReposWithRepo_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsItemReposWithRepo_nameItemRequestBuilder) { + m := &MigrationsItemReposWithRepo_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/migrations/{migration_id}/repos/{repo_name}", pathParameters), + } + return m +} +// NewMigrationsItemReposWithRepo_nameItemRequestBuilder instantiates a new MigrationsItemReposWithRepo_nameItemRequestBuilder and sets the default values. +func NewMigrationsItemReposWithRepo_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsItemReposWithRepo_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMigrationsItemReposWithRepo_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Lock the lock property +// returns a *MigrationsItemReposItemLockRequestBuilder when successful +func (m *MigrationsItemReposWithRepo_nameItemRequestBuilder) Lock()(*MigrationsItemReposItemLockRequestBuilder) { + return NewMigrationsItemReposItemLockRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_item_repositories_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_item_repositories_request_builder.go new file mode 100644 index 000000000..0bff0c61d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_item_repositories_request_builder.go @@ -0,0 +1,71 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// MigrationsItemRepositoriesRequestBuilder builds and executes requests for operations under \user\migrations\{migration_id}\repositories +type MigrationsItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// MigrationsItemRepositoriesRequestBuilderGetQueryParameters lists all the repositories for this user migration. +type MigrationsItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewMigrationsItemRepositoriesRequestBuilderInternal instantiates a new MigrationsItemRepositoriesRequestBuilder and sets the default values. +func NewMigrationsItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsItemRepositoriesRequestBuilder) { + m := &MigrationsItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/migrations/{migration_id}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewMigrationsItemRepositoriesRequestBuilder instantiates a new MigrationsItemRepositoriesRequestBuilder and sets the default values. +func NewMigrationsItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMigrationsItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all the repositories for this user migration. +// returns a []MinimalRepositoryable 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/users#list-repositories-for-a-user-migration +func (m *MigrationsItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[MigrationsItemRepositoriesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists all the repositories for this user migration. +// returns a *RequestInformation when successful +func (m *MigrationsItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[MigrationsItemRepositoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *MigrationsItemRepositoriesRequestBuilder when successful +func (m *MigrationsItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*MigrationsItemRepositoriesRequestBuilder) { + return NewMigrationsItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_post_request_body.go new file mode 100644 index 000000000..29914cc5c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_post_request_body.go @@ -0,0 +1,289 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MigrationsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Do not include attachments in the migration + exclude_attachments *bool + // Indicates whether the repository git data should be excluded from the migration. + exclude_git_data *bool + // Indicates whether metadata should be excluded and only git source should be included for the migration. + exclude_metadata *bool + // Indicates whether projects owned by the organization or users should be excluded. + exclude_owner_projects *bool + // Do not include releases in the migration + exclude_releases *bool + // Lock the repositories being migrated at the start of the migration + lock_repositories *bool + // Indicates whether this should only include organization metadata (repositories array should be empty and will ignore other flags). + org_metadata_only *bool + // The repositories property + repositories []string +} +// NewMigrationsPostRequestBody instantiates a new MigrationsPostRequestBody and sets the default values. +func NewMigrationsPostRequestBody()(*MigrationsPostRequestBody) { + m := &MigrationsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMigrationsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMigrationsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMigrationsPostRequestBody(), 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 *MigrationsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetExcludeAttachments gets the exclude_attachments property value. Do not include attachments in the migration +// returns a *bool when successful +func (m *MigrationsPostRequestBody) GetExcludeAttachments()(*bool) { + return m.exclude_attachments +} +// GetExcludeGitData gets the exclude_git_data property value. Indicates whether the repository git data should be excluded from the migration. +// returns a *bool when successful +func (m *MigrationsPostRequestBody) GetExcludeGitData()(*bool) { + return m.exclude_git_data +} +// GetExcludeMetadata gets the exclude_metadata property value. Indicates whether metadata should be excluded and only git source should be included for the migration. +// returns a *bool when successful +func (m *MigrationsPostRequestBody) GetExcludeMetadata()(*bool) { + return m.exclude_metadata +} +// GetExcludeOwnerProjects gets the exclude_owner_projects property value. Indicates whether projects owned by the organization or users should be excluded. +// returns a *bool when successful +func (m *MigrationsPostRequestBody) GetExcludeOwnerProjects()(*bool) { + return m.exclude_owner_projects +} +// GetExcludeReleases gets the exclude_releases property value. Do not include releases in the migration +// returns a *bool when successful +func (m *MigrationsPostRequestBody) GetExcludeReleases()(*bool) { + return m.exclude_releases +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MigrationsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["exclude_attachments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeAttachments(val) + } + return nil + } + res["exclude_git_data"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeGitData(val) + } + return nil + } + res["exclude_metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeMetadata(val) + } + return nil + } + res["exclude_owner_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeOwnerProjects(val) + } + return nil + } + res["exclude_releases"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeReleases(val) + } + return nil + } + res["lock_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLockRepositories(val) + } + return nil + } + res["org_metadata_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetOrgMetadataOnly(val) + } + return nil + } + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetRepositories(res) + } + return nil + } + return res +} +// GetLockRepositories gets the lock_repositories property value. Lock the repositories being migrated at the start of the migration +// returns a *bool when successful +func (m *MigrationsPostRequestBody) GetLockRepositories()(*bool) { + return m.lock_repositories +} +// GetOrgMetadataOnly gets the org_metadata_only property value. Indicates whether this should only include organization metadata (repositories array should be empty and will ignore other flags). +// returns a *bool when successful +func (m *MigrationsPostRequestBody) GetOrgMetadataOnly()(*bool) { + return m.org_metadata_only +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []string when successful +func (m *MigrationsPostRequestBody) GetRepositories()([]string) { + return m.repositories +} +// Serialize serializes information the current object +func (m *MigrationsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("exclude_attachments", m.GetExcludeAttachments()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_git_data", m.GetExcludeGitData()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_metadata", m.GetExcludeMetadata()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_owner_projects", m.GetExcludeOwnerProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_releases", m.GetExcludeReleases()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("lock_repositories", m.GetLockRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("org_metadata_only", m.GetOrgMetadataOnly()) + if err != nil { + return err + } + } + if m.GetRepositories() != nil { + err := writer.WriteCollectionOfStringValues("repositories", m.GetRepositories()) + 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 *MigrationsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetExcludeAttachments sets the exclude_attachments property value. Do not include attachments in the migration +func (m *MigrationsPostRequestBody) SetExcludeAttachments(value *bool)() { + m.exclude_attachments = value +} +// SetExcludeGitData sets the exclude_git_data property value. Indicates whether the repository git data should be excluded from the migration. +func (m *MigrationsPostRequestBody) SetExcludeGitData(value *bool)() { + m.exclude_git_data = value +} +// SetExcludeMetadata sets the exclude_metadata property value. Indicates whether metadata should be excluded and only git source should be included for the migration. +func (m *MigrationsPostRequestBody) SetExcludeMetadata(value *bool)() { + m.exclude_metadata = value +} +// SetExcludeOwnerProjects sets the exclude_owner_projects property value. Indicates whether projects owned by the organization or users should be excluded. +func (m *MigrationsPostRequestBody) SetExcludeOwnerProjects(value *bool)() { + m.exclude_owner_projects = value +} +// SetExcludeReleases sets the exclude_releases property value. Do not include releases in the migration +func (m *MigrationsPostRequestBody) SetExcludeReleases(value *bool)() { + m.exclude_releases = value +} +// SetLockRepositories sets the lock_repositories property value. Lock the repositories being migrated at the start of the migration +func (m *MigrationsPostRequestBody) SetLockRepositories(value *bool)() { + m.lock_repositories = value +} +// SetOrgMetadataOnly sets the org_metadata_only property value. Indicates whether this should only include organization metadata (repositories array should be empty and will ignore other flags). +func (m *MigrationsPostRequestBody) SetOrgMetadataOnly(value *bool)() { + m.org_metadata_only = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *MigrationsPostRequestBody) SetRepositories(value []string)() { + m.repositories = value +} +type MigrationsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetExcludeAttachments()(*bool) + GetExcludeGitData()(*bool) + GetExcludeMetadata()(*bool) + GetExcludeOwnerProjects()(*bool) + GetExcludeReleases()(*bool) + GetLockRepositories()(*bool) + GetOrgMetadataOnly()(*bool) + GetRepositories()([]string) + SetExcludeAttachments(value *bool)() + SetExcludeGitData(value *bool)() + SetExcludeMetadata(value *bool)() + SetExcludeOwnerProjects(value *bool)() + SetExcludeReleases(value *bool)() + SetLockRepositories(value *bool)() + SetOrgMetadataOnly(value *bool)() + SetRepositories(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_request_builder.go new file mode 100644 index 000000000..cdd537832 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_request_builder.go @@ -0,0 +1,123 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// MigrationsRequestBuilder builds and executes requests for operations under \user\migrations +type MigrationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// MigrationsRequestBuilderGetQueryParameters lists all migrations a user has started. +type MigrationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByMigration_id gets an item from the github.com/octokit/go-sdk/pkg/github.user.migrations.item collection +// returns a *MigrationsWithMigration_ItemRequestBuilder when successful +func (m *MigrationsRequestBuilder) ByMigration_id(migration_id int32)(*MigrationsWithMigration_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["migration_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(migration_id), 10) + return NewMigrationsWithMigration_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewMigrationsRequestBuilderInternal instantiates a new MigrationsRequestBuilder and sets the default values. +func NewMigrationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsRequestBuilder) { + m := &MigrationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/migrations{?page*,per_page*}", pathParameters), + } + return m +} +// NewMigrationsRequestBuilder instantiates a new MigrationsRequestBuilder and sets the default values. +func NewMigrationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMigrationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all migrations a user has started. +// returns a []Migrationable 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#list-user-migrations +func (m *MigrationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[MigrationsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Migrationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMigrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Migrationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Migrationable) + } + } + return val, nil +} +// Post initiates the generation of a user migration archive. +// returns a Migrationable 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 +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/migrations/users#start-a-user-migration +func (m *MigrationsRequestBuilder) Post(ctx context.Context, body MigrationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Migrationable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMigrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Migrationable), nil +} +// ToGetRequestInformation lists all migrations a user has started. +// returns a *RequestInformation when successful +func (m *MigrationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[MigrationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation initiates the generation of a user migration archive. +// returns a *RequestInformation when successful +func (m *MigrationsRequestBuilder) ToPostRequestInformation(ctx context.Context, body MigrationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *MigrationsRequestBuilder when successful +func (m *MigrationsRequestBuilder) WithUrl(rawUrl string)(*MigrationsRequestBuilder) { + return NewMigrationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_with_migration_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_with_migration_item_request_builder.go new file mode 100644 index 000000000..69a5bdf27 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/migrations_with_migration_item_request_builder.go @@ -0,0 +1,84 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// MigrationsWithMigration_ItemRequestBuilder builds and executes requests for operations under \user\migrations\{migration_id} +type MigrationsWithMigration_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// MigrationsWithMigration_ItemRequestBuilderGetQueryParameters fetches a single user migration. The response includes the `state` of the migration, which can be one of the following values:* `pending` - the migration hasn't started yet.* `exporting` - the migration is in progress.* `exported` - the migration finished successfully.* `failed` - the migration failed.Once the migration has been `exported` you can [download the migration archive](https://docs.github.com/rest/migrations/users#download-a-user-migration-archive). +type MigrationsWithMigration_ItemRequestBuilderGetQueryParameters struct { + Exclude []string `uriparametername:"exclude"` +} +// Archive the archive property +// returns a *MigrationsItemArchiveRequestBuilder when successful +func (m *MigrationsWithMigration_ItemRequestBuilder) Archive()(*MigrationsItemArchiveRequestBuilder) { + return NewMigrationsItemArchiveRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewMigrationsWithMigration_ItemRequestBuilderInternal instantiates a new MigrationsWithMigration_ItemRequestBuilder and sets the default values. +func NewMigrationsWithMigration_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsWithMigration_ItemRequestBuilder) { + m := &MigrationsWithMigration_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/migrations/{migration_id}{?exclude*}", pathParameters), + } + return m +} +// NewMigrationsWithMigration_ItemRequestBuilder instantiates a new MigrationsWithMigration_ItemRequestBuilder and sets the default values. +func NewMigrationsWithMigration_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsWithMigration_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMigrationsWithMigration_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get fetches a single user migration. The response includes the `state` of the migration, which can be one of the following values:* `pending` - the migration hasn't started yet.* `exporting` - the migration is in progress.* `exported` - the migration finished successfully.* `failed` - the migration failed.Once the migration has been `exported` you can [download the migration archive](https://docs.github.com/rest/migrations/users#download-a-user-migration-archive). +// returns a Migrationable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/migrations/users#get-a-user-migration-status +func (m *MigrationsWithMigration_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[MigrationsWithMigration_ItemRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Migrationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMigrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Migrationable), nil +} +// Repos the repos property +// returns a *MigrationsItemReposRequestBuilder when successful +func (m *MigrationsWithMigration_ItemRequestBuilder) Repos()(*MigrationsItemReposRequestBuilder) { + return NewMigrationsItemReposRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repositories the repositories property +// returns a *MigrationsItemRepositoriesRequestBuilder when successful +func (m *MigrationsWithMigration_ItemRequestBuilder) Repositories()(*MigrationsItemRepositoriesRequestBuilder) { + return NewMigrationsItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation fetches a single user migration. The response includes the `state` of the migration, which can be one of the following values:* `pending` - the migration hasn't started yet.* `exporting` - the migration is in progress.* `exported` - the migration finished successfully.* `failed` - the migration failed.Once the migration has been `exported` you can [download the migration archive](https://docs.github.com/rest/migrations/users#download-a-user-migration-archive). +// returns a *RequestInformation when successful +func (m *MigrationsWithMigration_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[MigrationsWithMigration_ItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *MigrationsWithMigration_ItemRequestBuilder when successful +func (m *MigrationsWithMigration_ItemRequestBuilder) WithUrl(rawUrl string)(*MigrationsWithMigration_ItemRequestBuilder) { + return NewMigrationsWithMigration_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/orgs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/orgs_request_builder.go new file mode 100644 index 000000000..cad3e8191 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/orgs_request_builder.go @@ -0,0 +1,73 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// OrgsRequestBuilder builds and executes requests for operations under \user\orgs +type OrgsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// OrgsRequestBuilderGetQueryParameters list organizations for the authenticated user.For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a `403 Forbidden` response. +type OrgsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewOrgsRequestBuilderInternal instantiates a new OrgsRequestBuilder and sets the default values. +func NewOrgsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OrgsRequestBuilder) { + m := &OrgsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/orgs{?page*,per_page*}", pathParameters), + } + return m +} +// NewOrgsRequestBuilder instantiates a new OrgsRequestBuilder and sets the default values. +func NewOrgsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OrgsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewOrgsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list organizations for the authenticated user.For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a `403 Forbidden` response. +// returns a []OrganizationSimpleable 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/orgs/orgs#list-organizations-for-the-authenticated-user +func (m *OrgsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[OrgsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationSimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationSimpleable) + } + } + return val, nil +} +// ToGetRequestInformation list organizations for the authenticated user.For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a `403 Forbidden` response. +// returns a *RequestInformation when successful +func (m *OrgsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[OrgsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *OrgsRequestBuilder when successful +func (m *OrgsRequestBuilder) WithUrl(rawUrl string)(*OrgsRequestBuilder) { + return NewOrgsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/packages/get_package_type_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages/get_package_type_query_parameter_type.go new file mode 100644 index 000000000..ae4025d39 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages/get_package_type_query_parameter_type.go @@ -0,0 +1,48 @@ +package packages +import ( + "errors" +) +type GetPackage_typeQueryParameterType int + +const ( + NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE GetPackage_typeQueryParameterType = iota + MAVEN_GETPACKAGE_TYPEQUERYPARAMETERTYPE + RUBYGEMS_GETPACKAGE_TYPEQUERYPARAMETERTYPE + DOCKER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + NUGET_GETPACKAGE_TYPEQUERYPARAMETERTYPE + CONTAINER_GETPACKAGE_TYPEQUERYPARAMETERTYPE +) + +func (i GetPackage_typeQueryParameterType) String() string { + return []string{"npm", "maven", "rubygems", "docker", "nuget", "container"}[i] +} +func ParseGetPackage_typeQueryParameterType(v string) (any, error) { + result := NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE + switch v { + case "npm": + result = NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "maven": + result = MAVEN_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "rubygems": + result = RUBYGEMS_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "docker": + result = DOCKER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "nuget": + result = NUGET_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "container": + result = CONTAINER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetPackage_typeQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetPackage_typeQueryParameterType(values []GetPackage_typeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetPackage_typeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/packages/get_visibility_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages/get_visibility_query_parameter_type.go new file mode 100644 index 000000000..daf1c43e6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages/get_visibility_query_parameter_type.go @@ -0,0 +1,39 @@ +package packages +import ( + "errors" +) +type GetVisibilityQueryParameterType int + +const ( + PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE GetVisibilityQueryParameterType = iota + PRIVATE_GETVISIBILITYQUERYPARAMETERTYPE + INTERNAL_GETVISIBILITYQUERYPARAMETERTYPE +) + +func (i GetVisibilityQueryParameterType) String() string { + return []string{"public", "private", "internal"}[i] +} +func ParseGetVisibilityQueryParameterType(v string) (any, error) { + result := PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE + switch v { + case "public": + result = PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE + case "private": + result = PRIVATE_GETVISIBILITYQUERYPARAMETERTYPE + case "internal": + result = INTERNAL_GETVISIBILITYQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetVisibilityQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetVisibilityQueryParameterType(values []GetVisibilityQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetVisibilityQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/packages/item/item/versions/get_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages/item/item/versions/get_state_query_parameter_type.go new file mode 100644 index 000000000..cf4ef3c82 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages/item/item/versions/get_state_query_parameter_type.go @@ -0,0 +1,36 @@ +package versions +import ( + "errors" +) +type GetStateQueryParameterType int + +const ( + ACTIVE_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + DELETED_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"active", "deleted"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := ACTIVE_GETSTATEQUERYPARAMETERTYPE + switch v { + case "active": + result = ACTIVE_GETSTATEQUERYPARAMETERTYPE + case "deleted": + result = DELETED_GETSTATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_item_item_restore_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_item_item_restore_request_builder.go new file mode 100644 index 000000000..de96d45f6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_item_item_restore_request_builder.go @@ -0,0 +1,66 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// PackagesItemItemRestoreRequestBuilder builds and executes requests for operations under \user\packages\{package_type}\{package_name}\restore +type PackagesItemItemRestoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// PackagesItemItemRestoreRequestBuilderPostQueryParameters restores a package owned by the authenticated user.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +type PackagesItemItemRestoreRequestBuilderPostQueryParameters struct { + // package token + Token *string `uriparametername:"token"` +} +// NewPackagesItemItemRestoreRequestBuilderInternal instantiates a new PackagesItemItemRestoreRequestBuilder and sets the default values. +func NewPackagesItemItemRestoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemItemRestoreRequestBuilder) { + m := &PackagesItemItemRestoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/packages/{package_type}/{package_name}/restore{?token*}", pathParameters), + } + return m +} +// NewPackagesItemItemRestoreRequestBuilder instantiates a new PackagesItemItemRestoreRequestBuilder and sets the default values. +func NewPackagesItemItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemItemRestoreRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPackagesItemItemRestoreRequestBuilderInternal(urlParams, requestAdapter) +} +// Post restores a package owned by the authenticated user.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user +func (m *PackagesItemItemRestoreRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PackagesItemItemRestoreRequestBuilderPostQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation restores a package owned by the authenticated user.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *PackagesItemItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PackagesItemItemRestoreRequestBuilderPostQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *PackagesItemItemRestoreRequestBuilder when successful +func (m *PackagesItemItemRestoreRequestBuilder) WithUrl(rawUrl string)(*PackagesItemItemRestoreRequestBuilder) { + return NewPackagesItemItemRestoreRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_item_item_versions_item_restore_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_item_item_versions_item_restore_request_builder.go new file mode 100644 index 000000000..240f18b46 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_item_item_versions_item_restore_request_builder.go @@ -0,0 +1,61 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// PackagesItemItemVersionsItemRestoreRequestBuilder builds and executes requests for operations under \user\packages\{package_type}\{package_name}\versions\{package_version_id}\restore +type PackagesItemItemVersionsItemRestoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewPackagesItemItemVersionsItemRestoreRequestBuilderInternal instantiates a new PackagesItemItemVersionsItemRestoreRequestBuilder and sets the default values. +func NewPackagesItemItemVersionsItemRestoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemItemVersionsItemRestoreRequestBuilder) { + m := &PackagesItemItemVersionsItemRestoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore", pathParameters), + } + return m +} +// NewPackagesItemItemVersionsItemRestoreRequestBuilder instantiates a new PackagesItemItemVersionsItemRestoreRequestBuilder and sets the default values. +func NewPackagesItemItemVersionsItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemItemVersionsItemRestoreRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPackagesItemItemVersionsItemRestoreRequestBuilderInternal(urlParams, requestAdapter) +} +// Post restores a package version owned by the authenticated user.You can restore a deleted package version under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user +func (m *PackagesItemItemVersionsItemRestoreRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation restores a package version owned by the authenticated user.You can restore a deleted package version under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *PackagesItemItemVersionsItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *PackagesItemItemVersionsItemRestoreRequestBuilder when successful +func (m *PackagesItemItemVersionsItemRestoreRequestBuilder) WithUrl(rawUrl string)(*PackagesItemItemVersionsItemRestoreRequestBuilder) { + return NewPackagesItemItemVersionsItemRestoreRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_item_item_versions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_item_item_versions_request_builder.go new file mode 100644 index 000000000..12cd42b28 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_item_item_versions_request_builder.go @@ -0,0 +1,89 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i74b3087dddecf30253e135889419530355ad6be6bee6d9ec44ce931f8f78bc3f "github.com/octokit/go-sdk/pkg/github/user/packages/item/item/versions" +) + +// PackagesItemItemVersionsRequestBuilder builds and executes requests for operations under \user\packages\{package_type}\{package_name}\versions +type PackagesItemItemVersionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// PackagesItemItemVersionsRequestBuilderGetQueryParameters lists package versions for a package owned by the authenticated user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +type PackagesItemItemVersionsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The state of the package, either active or deleted. + State *i74b3087dddecf30253e135889419530355ad6be6bee6d9ec44ce931f8f78bc3f.GetStateQueryParameterType `uriparametername:"state"` +} +// ByPackage_version_id gets an item from the github.com/octokit/go-sdk/pkg/github.user.packages.item.item.versions.item collection +// returns a *PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder when successful +func (m *PackagesItemItemVersionsRequestBuilder) ByPackage_version_id(package_version_id int32)(*PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["package_version_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(package_version_id), 10) + return NewPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewPackagesItemItemVersionsRequestBuilderInternal instantiates a new PackagesItemItemVersionsRequestBuilder and sets the default values. +func NewPackagesItemItemVersionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemItemVersionsRequestBuilder) { + m := &PackagesItemItemVersionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/packages/{package_type}/{package_name}/versions{?page*,per_page*,state*}", pathParameters), + } + return m +} +// NewPackagesItemItemVersionsRequestBuilder instantiates a new PackagesItemItemVersionsRequestBuilder and sets the default values. +func NewPackagesItemItemVersionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemItemVersionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPackagesItemItemVersionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists package versions for a package owned by the authenticated user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a []PackageVersionable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user +func (m *PackagesItemItemVersionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PackagesItemItemVersionsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageVersionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePackageVersionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageVersionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageVersionable) + } + } + return val, nil +} +// ToGetRequestInformation lists package versions for a package owned by the authenticated user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *PackagesItemItemVersionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PackagesItemItemVersionsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *PackagesItemItemVersionsRequestBuilder when successful +func (m *PackagesItemItemVersionsRequestBuilder) WithUrl(rawUrl string)(*PackagesItemItemVersionsRequestBuilder) { + return NewPackagesItemItemVersionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_item_item_versions_with_package_version_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_item_item_versions_with_package_version_item_request_builder.go new file mode 100644 index 000000000..36eb53d0f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_item_item_versions_with_package_version_item_request_builder.go @@ -0,0 +1,93 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder builds and executes requests for operations under \user\packages\{package_type}\{package_name}\versions\{package_version_id} +type PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal instantiates a new PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder and sets the default values. +func NewPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + m := &PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/packages/{package_type}/{package_name}/versions/{package_version_id}", pathParameters), + } + return m +} +// NewPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder instantiates a new PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder and sets the default values. +func NewPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a specific package version for a package owned by the authenticated user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.The authenticated user must have admin permissions in the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user +func (m *PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a specific package version for a package owned by the authenticated user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a PackageVersionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user +func (m *PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageVersionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePackageVersionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageVersionable), nil +} +// Restore the restore property +// returns a *PackagesItemItemVersionsItemRestoreRequestBuilder when successful +func (m *PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) Restore()(*PackagesItemItemVersionsItemRestoreRequestBuilder) { + return NewPackagesItemItemVersionsItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a specific package version for a package owned by the authenticated user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.The authenticated user must have admin permissions in the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets a specific package version for a package owned by the authenticated user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder when successful +func (m *PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) WithUrl(rawUrl string)(*PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + return NewPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_item_with_package_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_item_with_package_name_item_request_builder.go new file mode 100644 index 000000000..fdc77530c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_item_with_package_name_item_request_builder.go @@ -0,0 +1,98 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// PackagesItemWithPackage_nameItemRequestBuilder builds and executes requests for operations under \user\packages\{package_type}\{package_name} +type PackagesItemWithPackage_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewPackagesItemWithPackage_nameItemRequestBuilderInternal instantiates a new PackagesItemWithPackage_nameItemRequestBuilder and sets the default values. +func NewPackagesItemWithPackage_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemWithPackage_nameItemRequestBuilder) { + m := &PackagesItemWithPackage_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/packages/{package_type}/{package_name}", pathParameters), + } + return m +} +// NewPackagesItemWithPackage_nameItemRequestBuilder instantiates a new PackagesItemWithPackage_nameItemRequestBuilder and sets the default values. +func NewPackagesItemWithPackage_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemWithPackage_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPackagesItemWithPackage_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, `repo` scope is also required. For the list these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user +func (m *PackagesItemWithPackage_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a specific package for a package owned by the authenticated user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a PackageEscapedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user +func (m *PackagesItemWithPackage_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePackageEscapedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable), nil +} +// Restore the restore property +// returns a *PackagesItemItemRestoreRequestBuilder when successful +func (m *PackagesItemWithPackage_nameItemRequestBuilder) Restore()(*PackagesItemItemRestoreRequestBuilder) { + return NewPackagesItemItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, `repo` scope is also required. For the list these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *PackagesItemWithPackage_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets a specific package for a package owned by the authenticated user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *PackagesItemWithPackage_nameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// Versions the versions property +// returns a *PackagesItemItemVersionsRequestBuilder when successful +func (m *PackagesItemWithPackage_nameItemRequestBuilder) Versions()(*PackagesItemItemVersionsRequestBuilder) { + return NewPackagesItemItemVersionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *PackagesItemWithPackage_nameItemRequestBuilder when successful +func (m *PackagesItemWithPackage_nameItemRequestBuilder) WithUrl(rawUrl string)(*PackagesItemWithPackage_nameItemRequestBuilder) { + return NewPackagesItemWithPackage_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_request_builder.go new file mode 100644 index 000000000..17c6c864e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_request_builder.go @@ -0,0 +1,84 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + ia90ad7174ccc536446ffbf323e44f93ad4e7b5bc6ecfa01a7999e03949929e86 "github.com/octokit/go-sdk/pkg/github/user/packages" +) + +// PackagesRequestBuilder builds and executes requests for operations under \user\packages +type PackagesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// PackagesRequestBuilderGetQueryParameters lists packages owned by the authenticated user within the user's namespace.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +type PackagesRequestBuilderGetQueryParameters struct { + // The type of supported package. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. + Package_type *ia90ad7174ccc536446ffbf323e44f93ad4e7b5bc6ecfa01a7999e03949929e86.GetPackage_typeQueryParameterType `uriparametername:"package_type"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The selected visibility of the packages. This parameter is optional and only filters an existing result set.The `internal` visibility is only supported for GitHub Packages registries that allow for granular permissions. For other ecosystems `internal` is synonymous with `private`.For the list of GitHub Packages registries that support granular permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." + Visibility *ia90ad7174ccc536446ffbf323e44f93ad4e7b5bc6ecfa01a7999e03949929e86.GetVisibilityQueryParameterType `uriparametername:"visibility"` +} +// ByPackage_type gets an item from the github.com/octokit/go-sdk/pkg/github.user.packages.item collection +// returns a *PackagesWithPackage_typeItemRequestBuilder when successful +func (m *PackagesRequestBuilder) ByPackage_type(package_type string)(*PackagesWithPackage_typeItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if package_type != "" { + urlTplParams["package_type"] = package_type + } + return NewPackagesWithPackage_typeItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewPackagesRequestBuilderInternal instantiates a new PackagesRequestBuilder and sets the default values. +func NewPackagesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesRequestBuilder) { + m := &PackagesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/packages?package_type={package_type}{&page*,per_page*,visibility*}", pathParameters), + } + return m +} +// NewPackagesRequestBuilder instantiates a new PackagesRequestBuilder and sets the default values. +func NewPackagesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPackagesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists packages owned by the authenticated user within the user's namespace.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a []PackageEscapedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace +func (m *PackagesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PackagesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePackageEscapedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable) + } + } + return val, nil +} +// ToGetRequestInformation lists packages owned by the authenticated user within the user's namespace.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *PackagesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PackagesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *PackagesRequestBuilder when successful +func (m *PackagesRequestBuilder) WithUrl(rawUrl string)(*PackagesRequestBuilder) { + return NewPackagesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_with_package_type_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_with_package_type_item_request_builder.go new file mode 100644 index 000000000..bf582e58d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/packages_with_package_type_item_request_builder.go @@ -0,0 +1,35 @@ +package user + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// PackagesWithPackage_typeItemRequestBuilder builds and executes requests for operations under \user\packages\{package_type} +type PackagesWithPackage_typeItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByPackage_name gets an item from the github.com/octokit/go-sdk/pkg/github.user.packages.item.item collection +// returns a *PackagesItemWithPackage_nameItemRequestBuilder when successful +func (m *PackagesWithPackage_typeItemRequestBuilder) ByPackage_name(package_name string)(*PackagesItemWithPackage_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if package_name != "" { + urlTplParams["package_name"] = package_name + } + return NewPackagesItemWithPackage_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewPackagesWithPackage_typeItemRequestBuilderInternal instantiates a new PackagesWithPackage_typeItemRequestBuilder and sets the default values. +func NewPackagesWithPackage_typeItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesWithPackage_typeItemRequestBuilder) { + m := &PackagesWithPackage_typeItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/packages/{package_type}", pathParameters), + } + return m +} +// NewPackagesWithPackage_typeItemRequestBuilder instantiates a new PackagesWithPackage_typeItemRequestBuilder and sets the default values. +func NewPackagesWithPackage_typeItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesWithPackage_typeItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPackagesWithPackage_typeItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/projects_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/projects_post_request_body.go new file mode 100644 index 000000000..1c18aca39 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/projects_post_request_body.go @@ -0,0 +1,109 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProjectsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Body of the project + body *string + // Name of the project + name *string +} +// NewProjectsPostRequestBody instantiates a new ProjectsPostRequestBody and sets the default values. +func NewProjectsPostRequestBody()(*ProjectsPostRequestBody) { + m := &ProjectsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProjectsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProjectsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProjectsPostRequestBody(), 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 *ProjectsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. Body of the project +// returns a *string when successful +func (m *ProjectsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProjectsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. Name of the project +// returns a *string when successful +func (m *ProjectsPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ProjectsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ProjectsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. Body of the project +func (m *ProjectsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetName sets the name property value. Name of the project +func (m *ProjectsPostRequestBody) SetName(value *string)() { + m.name = value +} +type ProjectsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetName()(*string) + SetBody(value *string)() + SetName(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/projects_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/projects_request_builder.go new file mode 100644 index 000000000..a8c42a802 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/projects_request_builder.go @@ -0,0 +1,69 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ProjectsRequestBuilder builds and executes requests for operations under \user\projects +type ProjectsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewProjectsRequestBuilderInternal instantiates a new ProjectsRequestBuilder and sets the default values. +func NewProjectsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ProjectsRequestBuilder) { + m := &ProjectsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/projects", pathParameters), + } + return m +} +// NewProjectsRequestBuilder instantiates a new ProjectsRequestBuilder and sets the default values. +func NewProjectsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ProjectsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewProjectsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates a user project board. Returns a `410 Gone` status if the user does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a Projectable 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 +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/projects/projects#create-a-user-project +func (m *ProjectsRequestBuilder) Post(ctx context.Context, body ProjectsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable), nil +} +// ToPostRequestInformation creates a user project board. Returns a `410 Gone` status if the user does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a *RequestInformation when successful +func (m *ProjectsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ProjectsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ProjectsRequestBuilder when successful +func (m *ProjectsRequestBuilder) WithUrl(rawUrl string)(*ProjectsRequestBuilder) { + return NewProjectsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/public_emails_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/public_emails_request_builder.go new file mode 100644 index 000000000..336b8ad4a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/public_emails_request_builder.go @@ -0,0 +1,75 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// Public_emailsRequestBuilder builds and executes requests for operations under \user\public_emails +type Public_emailsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Public_emailsRequestBuilderGetQueryParameters lists your publicly visible email address, which you can set with the[Set primary email visibility for the authenticated user](https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user)endpoint.OAuth app tokens and personal access tokens (classic) need the `user:email` scope to use this endpoint. +type Public_emailsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewPublic_emailsRequestBuilderInternal instantiates a new Public_emailsRequestBuilder and sets the default values. +func NewPublic_emailsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Public_emailsRequestBuilder) { + m := &Public_emailsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/public_emails{?page*,per_page*}", pathParameters), + } + return m +} +// NewPublic_emailsRequestBuilder instantiates a new Public_emailsRequestBuilder and sets the default values. +func NewPublic_emailsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Public_emailsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPublic_emailsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists your publicly visible email address, which you can set with the[Set primary email visibility for the authenticated user](https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user)endpoint.OAuth app tokens and personal access tokens (classic) need the `user:email` scope to use this endpoint. +// returns a []Emailable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/emails#list-public-email-addresses-for-the-authenticated-user +func (m *Public_emailsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Public_emailsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Emailable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEmailFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Emailable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Emailable) + } + } + return val, nil +} +// ToGetRequestInformation lists your publicly visible email address, which you can set with the[Set primary email visibility for the authenticated user](https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user)endpoint.OAuth app tokens and personal access tokens (classic) need the `user:email` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Public_emailsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Public_emailsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *Public_emailsRequestBuilder when successful +func (m *Public_emailsRequestBuilder) WithUrl(rawUrl string)(*Public_emailsRequestBuilder) { + return NewPublic_emailsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/get_direction_query_parameter_type.go new file mode 100644 index 000000000..afa5d0fa6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package repos +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/get_sort_query_parameter_type.go new file mode 100644 index 000000000..8dee1bb8c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/get_sort_query_parameter_type.go @@ -0,0 +1,42 @@ +package repos +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + PUSHED_GETSORTQUERYPARAMETERTYPE + FULL_NAME_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "pushed", "full_name"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "pushed": + result = PUSHED_GETSORTQUERYPARAMETERTYPE + case "full_name": + result = FULL_NAME_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/get_type_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/get_type_query_parameter_type.go new file mode 100644 index 000000000..9272720c1 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/get_type_query_parameter_type.go @@ -0,0 +1,45 @@ +package repos +import ( + "errors" +) +type GetTypeQueryParameterType int + +const ( + ALL_GETTYPEQUERYPARAMETERTYPE GetTypeQueryParameterType = iota + OWNER_GETTYPEQUERYPARAMETERTYPE + PUBLIC_GETTYPEQUERYPARAMETERTYPE + PRIVATE_GETTYPEQUERYPARAMETERTYPE + MEMBER_GETTYPEQUERYPARAMETERTYPE +) + +func (i GetTypeQueryParameterType) String() string { + return []string{"all", "owner", "public", "private", "member"}[i] +} +func ParseGetTypeQueryParameterType(v string) (any, error) { + result := ALL_GETTYPEQUERYPARAMETERTYPE + switch v { + case "all": + result = ALL_GETTYPEQUERYPARAMETERTYPE + case "owner": + result = OWNER_GETTYPEQUERYPARAMETERTYPE + case "public": + result = PUBLIC_GETTYPEQUERYPARAMETERTYPE + case "private": + result = PRIVATE_GETTYPEQUERYPARAMETERTYPE + case "member": + result = MEMBER_GETTYPEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetTypeQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetTypeQueryParameterType(values []GetTypeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetTypeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/get_visibility_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/get_visibility_query_parameter_type.go new file mode 100644 index 000000000..73b634102 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/get_visibility_query_parameter_type.go @@ -0,0 +1,39 @@ +package repos +import ( + "errors" +) +type GetVisibilityQueryParameterType int + +const ( + ALL_GETVISIBILITYQUERYPARAMETERTYPE GetVisibilityQueryParameterType = iota + PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE + PRIVATE_GETVISIBILITYQUERYPARAMETERTYPE +) + +func (i GetVisibilityQueryParameterType) String() string { + return []string{"all", "public", "private"}[i] +} +func ParseGetVisibilityQueryParameterType(v string) (any, error) { + result := ALL_GETVISIBILITYQUERYPARAMETERTYPE + switch v { + case "all": + result = ALL_GETVISIBILITYQUERYPARAMETERTYPE + case "public": + result = PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE + case "private": + result = PRIVATE_GETVISIBILITYQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetVisibilityQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetVisibilityQueryParameterType(values []GetVisibilityQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetVisibilityQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/repos_post_request_body_merge_commit_message.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/repos_post_request_body_merge_commit_message.go new file mode 100644 index 000000000..50a0ccf4f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/repos_post_request_body_merge_commit_message.go @@ -0,0 +1,40 @@ +package repos +import ( + "errors" +) +// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +type ReposPostRequestBody_merge_commit_message int + +const ( + PR_BODY_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE ReposPostRequestBody_merge_commit_message = iota + PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + BLANK_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE +) + +func (i ReposPostRequestBody_merge_commit_message) String() string { + return []string{"PR_BODY", "PR_TITLE", "BLANK"}[i] +} +func ParseReposPostRequestBody_merge_commit_message(v string) (any, error) { + result := PR_BODY_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + case "PR_TITLE": + result = PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + default: + return 0, errors.New("Unknown ReposPostRequestBody_merge_commit_message value: " + v) + } + return &result, nil +} +func SerializeReposPostRequestBody_merge_commit_message(values []ReposPostRequestBody_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/repos_post_request_body_merge_commit_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/repos_post_request_body_merge_commit_title.go new file mode 100644 index 000000000..dd1e4b9d6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/repos_post_request_body_merge_commit_title.go @@ -0,0 +1,37 @@ +package repos +import ( + "errors" +) +// The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +type ReposPostRequestBody_merge_commit_title int + +const ( + PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE ReposPostRequestBody_merge_commit_title = iota + MERGE_MESSAGE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE +) + +func (i ReposPostRequestBody_merge_commit_title) String() string { + return []string{"PR_TITLE", "MERGE_MESSAGE"}[i] +} +func ParseReposPostRequestBody_merge_commit_title(v string) (any, error) { + result := PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE + case "MERGE_MESSAGE": + result = MERGE_MESSAGE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE + default: + return 0, errors.New("Unknown ReposPostRequestBody_merge_commit_title value: " + v) + } + return &result, nil +} +func SerializeReposPostRequestBody_merge_commit_title(values []ReposPostRequestBody_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/repos_post_request_body_squash_merge_commit_message.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/repos_post_request_body_squash_merge_commit_message.go new file mode 100644 index 000000000..0ecd209b2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/repos_post_request_body_squash_merge_commit_message.go @@ -0,0 +1,40 @@ +package repos +import ( + "errors" +) +// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +type ReposPostRequestBody_squash_merge_commit_message int + +const ( + PR_BODY_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE ReposPostRequestBody_squash_merge_commit_message = iota + COMMIT_MESSAGES_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + BLANK_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE +) + +func (i ReposPostRequestBody_squash_merge_commit_message) String() string { + return []string{"PR_BODY", "COMMIT_MESSAGES", "BLANK"}[i] +} +func ParseReposPostRequestBody_squash_merge_commit_message(v string) (any, error) { + result := PR_BODY_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + case "COMMIT_MESSAGES": + result = COMMIT_MESSAGES_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + default: + return 0, errors.New("Unknown ReposPostRequestBody_squash_merge_commit_message value: " + v) + } + return &result, nil +} +func SerializeReposPostRequestBody_squash_merge_commit_message(values []ReposPostRequestBody_squash_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_squash_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/repos_post_request_body_squash_merge_commit_title.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/repos_post_request_body_squash_merge_commit_title.go new file mode 100644 index 000000000..51ceb4f65 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos/repos_post_request_body_squash_merge_commit_title.go @@ -0,0 +1,37 @@ +package repos +import ( + "errors" +) +// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +type ReposPostRequestBody_squash_merge_commit_title int + +const ( + PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE ReposPostRequestBody_squash_merge_commit_title = iota + COMMIT_OR_PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE +) + +func (i ReposPostRequestBody_squash_merge_commit_title) String() string { + return []string{"PR_TITLE", "COMMIT_OR_PR_TITLE"}[i] +} +func ParseReposPostRequestBody_squash_merge_commit_title(v string) (any, error) { + result := PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE + case "COMMIT_OR_PR_TITLE": + result = COMMIT_OR_PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE + default: + return 0, errors.New("Unknown ReposPostRequestBody_squash_merge_commit_title value: " + v) + } + return &result, nil +} +func SerializeReposPostRequestBody_squash_merge_commit_title(values []ReposPostRequestBody_squash_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_squash_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/repos_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos_post_request_body.go new file mode 100644 index 000000000..eddc2cf28 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos_post_request_body.go @@ -0,0 +1,602 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ReposPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether to allow Auto-merge to be used on pull requests. + allow_auto_merge *bool + // Whether to allow merge commits for pull requests. + allow_merge_commit *bool + // Whether to allow rebase merges for pull requests. + allow_rebase_merge *bool + // Whether to allow squash merges for pull requests. + allow_squash_merge *bool + // Whether the repository is initialized with a minimal README. + auto_init *bool + // Whether to delete head branches when pull requests are merged + delete_branch_on_merge *bool + // A short description of the repository. + description *string + // The desired language or platform to apply to the .gitignore. + gitignore_template *string + // Whether discussions are enabled. + has_discussions *bool + // Whether downloads are enabled. + has_downloads *bool + // Whether issues are enabled. + has_issues *bool + // Whether projects are enabled. + has_projects *bool + // Whether the wiki is enabled. + has_wiki *bool + // A URL with more information about the repository. + homepage *string + // Whether this repository acts as a template that can be used to generate new repositories. + is_template *bool + // The license keyword of the open source license for this repository. + license_template *string + // The name of the repository. + name *string + // Whether the repository is private. + private *bool + // The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. + team_id *int32 +} +// NewReposPostRequestBody instantiates a new ReposPostRequestBody and sets the default values. +func NewReposPostRequestBody()(*ReposPostRequestBody) { + m := &ReposPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReposPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReposPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReposPostRequestBody(), 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 *ReposPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. Whether to allow Auto-merge to be used on pull requests. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowMergeCommit gets the allow_merge_commit property value. Whether to allow merge commits for pull requests. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. Whether to allow rebase merges for pull requests. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. Whether to allow squash merges for pull requests. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetAutoInit gets the auto_init property value. Whether the repository is initialized with a minimal README. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetAutoInit()(*bool) { + return m.auto_init +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged +// returns a *bool when successful +func (m *ReposPostRequestBody) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDescription gets the description property value. A short description of the repository. +// returns a *string when successful +func (m *ReposPostRequestBody) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReposPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["auto_init"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAutoInit(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["gitignore_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitignoreTemplate(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["license_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLicenseTemplate(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["team_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTeamId(val) + } + return nil + } + return res +} +// GetGitignoreTemplate gets the gitignore_template property value. The desired language or platform to apply to the .gitignore. +// returns a *string when successful +func (m *ReposPostRequestBody) GetGitignoreTemplate()(*string) { + return m.gitignore_template +} +// GetHasDiscussions gets the has_discussions property value. Whether discussions are enabled. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. Whether downloads are enabled. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. Whether issues are enabled. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasProjects gets the has_projects property value. Whether projects are enabled. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. Whether the wiki is enabled. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. A URL with more information about the repository. +// returns a *string when successful +func (m *ReposPostRequestBody) GetHomepage()(*string) { + return m.homepage +} +// GetIsTemplate gets the is_template property value. Whether this repository acts as a template that can be used to generate new repositories. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetIsTemplate()(*bool) { + return m.is_template +} +// GetLicenseTemplate gets the license_template property value. The license keyword of the open source license for this repository. +// returns a *string when successful +func (m *ReposPostRequestBody) GetLicenseTemplate()(*string) { + return m.license_template +} +// GetName gets the name property value. The name of the repository. +// returns a *string when successful +func (m *ReposPostRequestBody) GetName()(*string) { + return m.name +} +// GetPrivate gets the private property value. Whether the repository is private. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetPrivate()(*bool) { + return m.private +} +// GetTeamId gets the team_id property value. The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. +// returns a *int32 when successful +func (m *ReposPostRequestBody) GetTeamId()(*int32) { + return m.team_id +} +// Serialize serializes information the current object +func (m *ReposPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("auto_init", m.GetAutoInit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gitignore_template", m.GetGitignoreTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("license_template", m.GetLicenseTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("team_id", m.GetTeamId()) + 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 *ReposPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. Whether to allow Auto-merge to be used on pull requests. +func (m *ReposPostRequestBody) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. Whether to allow merge commits for pull requests. +func (m *ReposPostRequestBody) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. Whether to allow rebase merges for pull requests. +func (m *ReposPostRequestBody) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. Whether to allow squash merges for pull requests. +func (m *ReposPostRequestBody) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetAutoInit sets the auto_init property value. Whether the repository is initialized with a minimal README. +func (m *ReposPostRequestBody) SetAutoInit(value *bool)() { + m.auto_init = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged +func (m *ReposPostRequestBody) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDescription sets the description property value. A short description of the repository. +func (m *ReposPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetGitignoreTemplate sets the gitignore_template property value. The desired language or platform to apply to the .gitignore. +func (m *ReposPostRequestBody) SetGitignoreTemplate(value *string)() { + m.gitignore_template = value +} +// SetHasDiscussions sets the has_discussions property value. Whether discussions are enabled. +func (m *ReposPostRequestBody) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. Whether downloads are enabled. +func (m *ReposPostRequestBody) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. Whether issues are enabled. +func (m *ReposPostRequestBody) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasProjects sets the has_projects property value. Whether projects are enabled. +func (m *ReposPostRequestBody) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. Whether the wiki is enabled. +func (m *ReposPostRequestBody) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. A URL with more information about the repository. +func (m *ReposPostRequestBody) SetHomepage(value *string)() { + m.homepage = value +} +// SetIsTemplate sets the is_template property value. Whether this repository acts as a template that can be used to generate new repositories. +func (m *ReposPostRequestBody) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetLicenseTemplate sets the license_template property value. The license keyword of the open source license for this repository. +func (m *ReposPostRequestBody) SetLicenseTemplate(value *string)() { + m.license_template = value +} +// SetName sets the name property value. The name of the repository. +func (m *ReposPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetPrivate sets the private property value. Whether the repository is private. +func (m *ReposPostRequestBody) SetPrivate(value *bool)() { + m.private = value +} +// SetTeamId sets the team_id property value. The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. +func (m *ReposPostRequestBody) SetTeamId(value *int32)() { + m.team_id = value +} +type ReposPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetAutoInit()(*bool) + GetDeleteBranchOnMerge()(*bool) + GetDescription()(*string) + GetGitignoreTemplate()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetIsTemplate()(*bool) + GetLicenseTemplate()(*string) + GetName()(*string) + GetPrivate()(*bool) + GetTeamId()(*int32) + SetAllowAutoMerge(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetAutoInit(value *bool)() + SetDeleteBranchOnMerge(value *bool)() + SetDescription(value *string)() + SetGitignoreTemplate(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetIsTemplate(value *bool)() + SetLicenseTemplate(value *string)() + SetName(value *string)() + SetPrivate(value *bool)() + SetTeamId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/repos_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos_request_builder.go new file mode 100644 index 000000000..f8d850258 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/repos_request_builder.go @@ -0,0 +1,134 @@ +package user + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + ic41ef9159df965bc9bcc557811709320ac0b4b0d40eefb8bfc234c584bcd174e "github.com/octokit/go-sdk/pkg/github/user/repos" +) + +// ReposRequestBuilder builds and executes requests for operations under \user\repos +type ReposRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ReposRequestBuilderGetQueryParameters lists repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. +type ReposRequestBuilderGetQueryParameters struct { + // Comma-separated list of values. Can include: * `owner`: Repositories that are owned by the authenticated user. * `collaborator`: Repositories that the user has been added to as a collaborator. * `organization_member`: Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on. + Affiliation *string `uriparametername:"affiliation"` + // Only show repositories updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Before *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"before"` + // The order to sort by. Default: `asc` when using `full_name`, otherwise `desc`. + Direction *ic41ef9159df965bc9bcc557811709320ac0b4b0d40eefb8bfc234c584bcd174e.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show repositories updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + // The property to sort the results by. + Sort *ic41ef9159df965bc9bcc557811709320ac0b4b0d40eefb8bfc234c584bcd174e.GetSortQueryParameterType `uriparametername:"sort"` + // Limit results to repositories of the specified type. Will cause a `422` error if used in the same request as **visibility** or **affiliation**. + Type *ic41ef9159df965bc9bcc557811709320ac0b4b0d40eefb8bfc234c584bcd174e.GetTypeQueryParameterType `uriparametername:"type"` + // Limit results to repositories with the specified visibility. + Visibility *ic41ef9159df965bc9bcc557811709320ac0b4b0d40eefb8bfc234c584bcd174e.GetVisibilityQueryParameterType `uriparametername:"visibility"` +} +// NewReposRequestBuilderInternal instantiates a new ReposRequestBuilder and sets the default values. +func NewReposRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ReposRequestBuilder) { + m := &ReposRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/repos{?affiliation*,before*,direction*,page*,per_page*,since*,sort*,type*,visibility*}", pathParameters), + } + return m +} +// NewReposRequestBuilder instantiates a new ReposRequestBuilder and sets the default values. +func NewReposRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ReposRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewReposRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. +// returns a []Repositoryable 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 +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user +func (m *ReposRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ReposRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable) + } + } + return val, nil +} +// Post creates a new repository for the authenticated user.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository. +// returns a FullRepositoryable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user +func (m *ReposRequestBuilder) Post(ctx context.Context, body ReposPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateFullRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.FullRepositoryable), nil +} +// ToGetRequestInformation lists repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. +// returns a *RequestInformation when successful +func (m *ReposRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ReposRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a new repository for the authenticated user.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository. +// returns a *RequestInformation when successful +func (m *ReposRequestBuilder) ToPostRequestInformation(ctx context.Context, body ReposPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ReposRequestBuilder when successful +func (m *ReposRequestBuilder) WithUrl(rawUrl string)(*ReposRequestBuilder) { + return NewReposRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/repository_invitations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/repository_invitations_request_builder.go new file mode 100644 index 000000000..bdb36492a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/repository_invitations_request_builder.go @@ -0,0 +1,86 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// Repository_invitationsRequestBuilder builds and executes requests for operations under \user\repository_invitations +type Repository_invitationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Repository_invitationsRequestBuilderGetQueryParameters when authenticating as a user, this endpoint will list all currently open repository invitations for that user. +type Repository_invitationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByInvitation_id gets an item from the github.com/octokit/go-sdk/pkg/github.user.repository_invitations.item collection +// returns a *Repository_invitationsWithInvitation_ItemRequestBuilder when successful +func (m *Repository_invitationsRequestBuilder) ByInvitation_id(invitation_id int32)(*Repository_invitationsWithInvitation_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["invitation_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(invitation_id), 10) + return NewRepository_invitationsWithInvitation_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewRepository_invitationsRequestBuilderInternal instantiates a new Repository_invitationsRequestBuilder and sets the default values. +func NewRepository_invitationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Repository_invitationsRequestBuilder) { + m := &Repository_invitationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/repository_invitations{?page*,per_page*}", pathParameters), + } + return m +} +// NewRepository_invitationsRequestBuilder instantiates a new Repository_invitationsRequestBuilder and sets the default values. +func NewRepository_invitationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Repository_invitationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewRepository_invitationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get when authenticating as a user, this endpoint will list all currently open repository invitations for that user. +// returns a []RepositoryInvitationable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user +func (m *Repository_invitationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Repository_invitationsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryInvitationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryInvitationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryInvitationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryInvitationable) + } + } + return val, nil +} +// ToGetRequestInformation when authenticating as a user, this endpoint will list all currently open repository invitations for that user. +// returns a *RequestInformation when successful +func (m *Repository_invitationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Repository_invitationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *Repository_invitationsRequestBuilder when successful +func (m *Repository_invitationsRequestBuilder) WithUrl(rawUrl string)(*Repository_invitationsRequestBuilder) { + return NewRepository_invitationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/repository_invitations_with_invitation_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/repository_invitations_with_invitation_item_request_builder.go new file mode 100644 index 000000000..abed830a0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/repository_invitations_with_invitation_item_request_builder.go @@ -0,0 +1,90 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// Repository_invitationsWithInvitation_ItemRequestBuilder builds and executes requests for operations under \user\repository_invitations\{invitation_id} +type Repository_invitationsWithInvitation_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewRepository_invitationsWithInvitation_ItemRequestBuilderInternal instantiates a new Repository_invitationsWithInvitation_ItemRequestBuilder and sets the default values. +func NewRepository_invitationsWithInvitation_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Repository_invitationsWithInvitation_ItemRequestBuilder) { + m := &Repository_invitationsWithInvitation_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/repository_invitations/{invitation_id}", pathParameters), + } + return m +} +// NewRepository_invitationsWithInvitation_ItemRequestBuilder instantiates a new Repository_invitationsWithInvitation_ItemRequestBuilder and sets the default values. +func NewRepository_invitationsWithInvitation_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Repository_invitationsWithInvitation_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewRepository_invitationsWithInvitation_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete decline a repository invitation +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation +func (m *Repository_invitationsWithInvitation_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Patch accept a repository invitation +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation +func (m *Repository_invitationsWithInvitation_ItemRequestBuilder) Patch(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// returns a *RequestInformation when successful +func (m *Repository_invitationsWithInvitation_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *Repository_invitationsWithInvitation_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *Repository_invitationsWithInvitation_ItemRequestBuilder when successful +func (m *Repository_invitationsWithInvitation_ItemRequestBuilder) WithUrl(rawUrl string)(*Repository_invitationsWithInvitation_ItemRequestBuilder) { + return NewRepository_invitationsWithInvitation_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/social_accounts_delete_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/social_accounts_delete_request_body.go new file mode 100644 index 000000000..90237df88 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/social_accounts_delete_request_body.go @@ -0,0 +1,86 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Social_accountsDeleteRequestBody struct { + // Full URLs for the social media profiles to delete. + account_urls []string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewSocial_accountsDeleteRequestBody instantiates a new Social_accountsDeleteRequestBody and sets the default values. +func NewSocial_accountsDeleteRequestBody()(*Social_accountsDeleteRequestBody) { + m := &Social_accountsDeleteRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSocial_accountsDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSocial_accountsDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSocial_accountsDeleteRequestBody(), nil +} +// GetAccountUrls gets the account_urls property value. Full URLs for the social media profiles to delete. +// returns a []string when successful +func (m *Social_accountsDeleteRequestBody) GetAccountUrls()([]string) { + return m.account_urls +} +// 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 *Social_accountsDeleteRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Social_accountsDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["account_urls"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetAccountUrls(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *Social_accountsDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAccountUrls() != nil { + err := writer.WriteCollectionOfStringValues("account_urls", m.GetAccountUrls()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccountUrls sets the account_urls property value. Full URLs for the social media profiles to delete. +func (m *Social_accountsDeleteRequestBody) SetAccountUrls(value []string)() { + m.account_urls = value +} +// 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 *Social_accountsDeleteRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type Social_accountsDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccountUrls()([]string) + SetAccountUrls(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/social_accounts_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/social_accounts_post_request_body.go new file mode 100644 index 000000000..37aeb9d6b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/social_accounts_post_request_body.go @@ -0,0 +1,86 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Social_accountsPostRequestBody struct { + // Full URLs for the social media profiles to add. + account_urls []string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewSocial_accountsPostRequestBody instantiates a new Social_accountsPostRequestBody and sets the default values. +func NewSocial_accountsPostRequestBody()(*Social_accountsPostRequestBody) { + m := &Social_accountsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSocial_accountsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSocial_accountsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSocial_accountsPostRequestBody(), nil +} +// GetAccountUrls gets the account_urls property value. Full URLs for the social media profiles to add. +// returns a []string when successful +func (m *Social_accountsPostRequestBody) GetAccountUrls()([]string) { + return m.account_urls +} +// 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 *Social_accountsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Social_accountsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["account_urls"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetAccountUrls(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *Social_accountsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAccountUrls() != nil { + err := writer.WriteCollectionOfStringValues("account_urls", m.GetAccountUrls()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccountUrls sets the account_urls property value. Full URLs for the social media profiles to add. +func (m *Social_accountsPostRequestBody) SetAccountUrls(value []string)() { + m.account_urls = value +} +// 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 *Social_accountsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type Social_accountsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccountUrls()([]string) + SetAccountUrls(value []string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/social_accounts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/social_accounts_request_builder.go new file mode 100644 index 000000000..b92d90e27 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/social_accounts_request_builder.go @@ -0,0 +1,156 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// Social_accountsRequestBuilder builds and executes requests for operations under \user\social_accounts +type Social_accountsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Social_accountsRequestBuilderGetQueryParameters lists all of your social accounts. +type Social_accountsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewSocial_accountsRequestBuilderInternal instantiates a new Social_accountsRequestBuilder and sets the default values. +func NewSocial_accountsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Social_accountsRequestBuilder) { + m := &Social_accountsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/social_accounts{?page*,per_page*}", pathParameters), + } + return m +} +// NewSocial_accountsRequestBuilder instantiates a new Social_accountsRequestBuilder and sets the default values. +func NewSocial_accountsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Social_accountsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewSocial_accountsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes one or more social accounts from the authenticated user's profile.OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// 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] +// +// [API method documentation]: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user +func (m *Social_accountsRequestBuilder) Delete(ctx context.Context, body Social_accountsDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get lists all of your social accounts. +// returns a []SocialAccountable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user +func (m *Social_accountsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Social_accountsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SocialAccountable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSocialAccountFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SocialAccountable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SocialAccountable) + } + } + return val, nil +} +// Post add one or more social accounts to the authenticated user's profile.OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a []SocialAccountable 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 +// 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] +// +// [API method documentation]: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user +func (m *Social_accountsRequestBuilder) Post(ctx context.Context, body Social_accountsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SocialAccountable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSocialAccountFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SocialAccountable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SocialAccountable) + } + } + return val, nil +} +// ToDeleteRequestInformation deletes one or more social accounts from the authenticated user's profile.OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Social_accountsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body Social_accountsDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToGetRequestInformation lists all of your social accounts. +// returns a *RequestInformation when successful +func (m *Social_accountsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Social_accountsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation add one or more social accounts to the authenticated user's profile.OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Social_accountsRequestBuilder) ToPostRequestInformation(ctx context.Context, body Social_accountsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *Social_accountsRequestBuilder when successful +func (m *Social_accountsRequestBuilder) WithUrl(rawUrl string)(*Social_accountsRequestBuilder) { + return NewSocial_accountsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/ssh_signing_keys_post_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/ssh_signing_keys_post_request_body.go new file mode 100644 index 000000000..e9d9fc90f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/ssh_signing_keys_post_request_body.go @@ -0,0 +1,109 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Ssh_signing_keysPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The public SSH key to add to your GitHub account. For more information, see "[Checking for existing SSH keys](https://docs.github.com/authentication/connecting-to-github-with-ssh/checking-for-existing-ssh-keys)." + key *string + // A descriptive name for the new key. + title *string +} +// NewSsh_signing_keysPostRequestBody instantiates a new Ssh_signing_keysPostRequestBody and sets the default values. +func NewSsh_signing_keysPostRequestBody()(*Ssh_signing_keysPostRequestBody) { + m := &Ssh_signing_keysPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSsh_signing_keysPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSsh_signing_keysPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSsh_signing_keysPostRequestBody(), 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 *Ssh_signing_keysPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Ssh_signing_keysPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The public SSH key to add to your GitHub account. For more information, see "[Checking for existing SSH keys](https://docs.github.com/authentication/connecting-to-github-with-ssh/checking-for-existing-ssh-keys)." +// returns a *string when successful +func (m *Ssh_signing_keysPostRequestBody) GetKey()(*string) { + return m.key +} +// GetTitle gets the title property value. A descriptive name for the new key. +// returns a *string when successful +func (m *Ssh_signing_keysPostRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *Ssh_signing_keysPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *Ssh_signing_keysPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The public SSH key to add to your GitHub account. For more information, see "[Checking for existing SSH keys](https://docs.github.com/authentication/connecting-to-github-with-ssh/checking-for-existing-ssh-keys)." +func (m *Ssh_signing_keysPostRequestBody) SetKey(value *string)() { + m.key = value +} +// SetTitle sets the title property value. A descriptive name for the new key. +func (m *Ssh_signing_keysPostRequestBody) SetTitle(value *string)() { + m.title = value +} +type Ssh_signing_keysPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetTitle()(*string) + SetKey(value *string)() + SetTitle(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/ssh_signing_keys_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/ssh_signing_keys_request_builder.go new file mode 100644 index 000000000..656642ba0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/ssh_signing_keys_request_builder.go @@ -0,0 +1,127 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// Ssh_signing_keysRequestBuilder builds and executes requests for operations under \user\ssh_signing_keys +type Ssh_signing_keysRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Ssh_signing_keysRequestBuilderGetQueryParameters lists the SSH signing keys for the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `read:ssh_signing_key` scope to use this endpoint. +type Ssh_signing_keysRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// BySsh_signing_key_id gets an item from the github.com/octokit/go-sdk/pkg/github.user.ssh_signing_keys.item collection +// returns a *Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder when successful +func (m *Ssh_signing_keysRequestBuilder) BySsh_signing_key_id(ssh_signing_key_id int32)(*Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["ssh_signing_key_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(ssh_signing_key_id), 10) + return NewSsh_signing_keysWithSsh_signing_key_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewSsh_signing_keysRequestBuilderInternal instantiates a new Ssh_signing_keysRequestBuilder and sets the default values. +func NewSsh_signing_keysRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Ssh_signing_keysRequestBuilder) { + m := &Ssh_signing_keysRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/ssh_signing_keys{?page*,per_page*}", pathParameters), + } + return m +} +// NewSsh_signing_keysRequestBuilder instantiates a new Ssh_signing_keysRequestBuilder and sets the default values. +func NewSsh_signing_keysRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Ssh_signing_keysRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewSsh_signing_keysRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the SSH signing keys for the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `read:ssh_signing_key` scope to use this endpoint. +// returns a []SshSigningKeyable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user +func (m *Ssh_signing_keysRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Ssh_signing_keysRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SshSigningKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSshSigningKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SshSigningKeyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SshSigningKeyable) + } + } + return val, nil +} +// Post creates an SSH signing key for the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `write:ssh_signing_key` scope to use this endpoint. +// returns a SshSigningKeyable 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 +// 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] +// +// [API method documentation]: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user +func (m *Ssh_signing_keysRequestBuilder) Post(ctx context.Context, body Ssh_signing_keysPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SshSigningKeyable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSshSigningKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SshSigningKeyable), nil +} +// ToGetRequestInformation lists the SSH signing keys for the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `read:ssh_signing_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Ssh_signing_keysRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Ssh_signing_keysRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates an SSH signing key for the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `write:ssh_signing_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Ssh_signing_keysRequestBuilder) ToPostRequestInformation(ctx context.Context, body Ssh_signing_keysPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *Ssh_signing_keysRequestBuilder when successful +func (m *Ssh_signing_keysRequestBuilder) WithUrl(rawUrl string)(*Ssh_signing_keysRequestBuilder) { + return NewSsh_signing_keysRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/ssh_signing_keys_with_ssh_signing_key_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/ssh_signing_keys_with_ssh_signing_key_item_request_builder.go new file mode 100644 index 000000000..47958edad --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/ssh_signing_keys_with_ssh_signing_key_item_request_builder.go @@ -0,0 +1,96 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder builds and executes requests for operations under \user\ssh_signing_keys\{ssh_signing_key_id} +type Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewSsh_signing_keysWithSsh_signing_key_ItemRequestBuilderInternal instantiates a new Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder and sets the default values. +func NewSsh_signing_keysWithSsh_signing_key_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder) { + m := &Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/ssh_signing_keys/{ssh_signing_key_id}", pathParameters), + } + return m +} +// NewSsh_signing_keysWithSsh_signing_key_ItemRequestBuilder instantiates a new Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder and sets the default values. +func NewSsh_signing_keysWithSsh_signing_key_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewSsh_signing_keysWithSsh_signing_key_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes an SSH signing key from the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `admin:ssh_signing_key` scope to use this endpoint. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user +func (m *Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets extended details for an SSH signing key.OAuth app tokens and personal access tokens (classic) need the `read:ssh_signing_key` scope to use this endpoint. +// returns a SshSigningKeyable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user +func (m *Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SshSigningKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSshSigningKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SshSigningKeyable), nil +} +// ToDeleteRequestInformation deletes an SSH signing key from the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `admin:ssh_signing_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets extended details for an SSH signing key.OAuth app tokens and personal access tokens (classic) need the `read:ssh_signing_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder when successful +func (m *Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder) WithUrl(rawUrl string)(*Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder) { + return NewSsh_signing_keysWithSsh_signing_key_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/starred/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/starred/get_direction_query_parameter_type.go new file mode 100644 index 000000000..3ac3d71e4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/starred/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package starred +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/starred/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/starred/get_sort_query_parameter_type.go new file mode 100644 index 000000000..604bb061e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/starred/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package starred +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/starred_item_with_repo_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/starred_item_with_repo_item_request_builder.go new file mode 100644 index 000000000..fb62ee862 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/starred_item_with_repo_item_request_builder.go @@ -0,0 +1,123 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// StarredItemWithRepoItemRequestBuilder builds and executes requests for operations under \user\starred\{owner}\{repo} +type StarredItemWithRepoItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewStarredItemWithRepoItemRequestBuilderInternal instantiates a new StarredItemWithRepoItemRequestBuilder and sets the default values. +func NewStarredItemWithRepoItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StarredItemWithRepoItemRequestBuilder) { + m := &StarredItemWithRepoItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/starred/{owner}/{repo}", pathParameters), + } + return m +} +// NewStarredItemWithRepoItemRequestBuilder instantiates a new StarredItemWithRepoItemRequestBuilder and sets the default values. +func NewStarredItemWithRepoItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StarredItemWithRepoItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStarredItemWithRepoItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete unstar a repository that the authenticated user has previously starred. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user +func (m *StarredItemWithRepoItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get whether the authenticated user has starred the repository. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user +func (m *StarredItemWithRepoItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user +func (m *StarredItemWithRepoItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation unstar a repository that the authenticated user has previously starred. +// returns a *RequestInformation when successful +func (m *StarredItemWithRepoItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation whether the authenticated user has starred the repository. +// returns a *RequestInformation when successful +func (m *StarredItemWithRepoItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPutRequestInformation note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." +// returns a *RequestInformation when successful +func (m *StarredItemWithRepoItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *StarredItemWithRepoItemRequestBuilder when successful +func (m *StarredItemWithRepoItemRequestBuilder) WithUrl(rawUrl string)(*StarredItemWithRepoItemRequestBuilder) { + return NewStarredItemWithRepoItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/starred_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/starred_request_builder.go new file mode 100644 index 000000000..15134a7ae --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/starred_request_builder.go @@ -0,0 +1,90 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + ib70b7407366e940878b2bf2a2ba5d70a3ff5c77a8b73175161353f0ca9989d8b "github.com/octokit/go-sdk/pkg/github/user/starred" +) + +// StarredRequestBuilder builds and executes requests for operations under \user\starred +type StarredRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// StarredRequestBuilderGetQueryParameters lists repositories the authenticated user has starred.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +type StarredRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *ib70b7407366e940878b2bf2a2ba5d70a3ff5c77a8b73175161353f0ca9989d8b.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The property to sort the results by. `created` means when the repository was starred. `updated` means when the repository was last pushed to. + Sort *ib70b7407366e940878b2bf2a2ba5d70a3ff5c77a8b73175161353f0ca9989d8b.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByOwner gets an item from the github.com/octokit/go-sdk/pkg/github.user.starred.item collection +// returns a *StarredWithOwnerItemRequestBuilder when successful +func (m *StarredRequestBuilder) ByOwner(owner string)(*StarredWithOwnerItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if owner != "" { + urlTplParams["owner"] = owner + } + return NewStarredWithOwnerItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewStarredRequestBuilderInternal instantiates a new StarredRequestBuilder and sets the default values. +func NewStarredRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StarredRequestBuilder) { + m := &StarredRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/starred{?direction*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewStarredRequestBuilder instantiates a new StarredRequestBuilder and sets the default values. +func NewStarredRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StarredRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStarredRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists repositories the authenticated user has starred.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +// returns a []Repositoryable 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/activity/starring#list-repositories-starred-by-the-authenticated-user +func (m *StarredRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[StarredRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Repositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists repositories the authenticated user has starred.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +// returns a *RequestInformation when successful +func (m *StarredRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[StarredRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *StarredRequestBuilder when successful +func (m *StarredRequestBuilder) WithUrl(rawUrl string)(*StarredRequestBuilder) { + return NewStarredRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/starred_with_owner_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/starred_with_owner_item_request_builder.go new file mode 100644 index 000000000..4301923ff --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/starred_with_owner_item_request_builder.go @@ -0,0 +1,35 @@ +package user + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// StarredWithOwnerItemRequestBuilder builds and executes requests for operations under \user\starred\{owner} +type StarredWithOwnerItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRepo gets an item from the github.com/octokit/go-sdk/pkg/github.user.starred.item.item collection +// returns a *StarredItemWithRepoItemRequestBuilder when successful +func (m *StarredWithOwnerItemRequestBuilder) ByRepo(repo string)(*StarredItemWithRepoItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if repo != "" { + urlTplParams["repo"] = repo + } + return NewStarredItemWithRepoItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewStarredWithOwnerItemRequestBuilderInternal instantiates a new StarredWithOwnerItemRequestBuilder and sets the default values. +func NewStarredWithOwnerItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StarredWithOwnerItemRequestBuilder) { + m := &StarredWithOwnerItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/starred/{owner}", pathParameters), + } + return m +} +// NewStarredWithOwnerItemRequestBuilder instantiates a new StarredWithOwnerItemRequestBuilder and sets the default values. +func NewStarredWithOwnerItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StarredWithOwnerItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStarredWithOwnerItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/subscriptions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/subscriptions_request_builder.go new file mode 100644 index 000000000..64d62fe68 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/subscriptions_request_builder.go @@ -0,0 +1,73 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// SubscriptionsRequestBuilder builds and executes requests for operations under \user\subscriptions +type SubscriptionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// SubscriptionsRequestBuilderGetQueryParameters lists repositories the authenticated user is watching. +type SubscriptionsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewSubscriptionsRequestBuilderInternal instantiates a new SubscriptionsRequestBuilder and sets the default values. +func NewSubscriptionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SubscriptionsRequestBuilder) { + m := &SubscriptionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/subscriptions{?page*,per_page*}", pathParameters), + } + return m +} +// NewSubscriptionsRequestBuilder instantiates a new SubscriptionsRequestBuilder and sets the default values. +func NewSubscriptionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SubscriptionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewSubscriptionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists repositories the authenticated user is watching. +// returns a []MinimalRepositoryable 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/activity/watching#list-repositories-watched-by-the-authenticated-user +func (m *SubscriptionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[SubscriptionsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists repositories the authenticated user is watching. +// returns a *RequestInformation when successful +func (m *SubscriptionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[SubscriptionsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *SubscriptionsRequestBuilder when successful +func (m *SubscriptionsRequestBuilder) WithUrl(rawUrl string)(*SubscriptionsRequestBuilder) { + return NewSubscriptionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/teams_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/teams_request_builder.go new file mode 100644 index 000000000..2849a3b49 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/teams_request_builder.go @@ -0,0 +1,73 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// TeamsRequestBuilder builds and executes requests for operations under \user\teams +type TeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// TeamsRequestBuilderGetQueryParameters list all of the teams across all of the organizations to which the authenticateduser belongs.OAuth app tokens and personal access tokens (classic) need the `user`, `repo`, or `read:org` scope to use this endpoint.When using a fine-grained personal access token, the resource owner of the token must be a single organization, and the response will only include the teams from that organization. +type TeamsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewTeamsRequestBuilderInternal instantiates a new TeamsRequestBuilder and sets the default values. +func NewTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamsRequestBuilder) { + m := &TeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/teams{?page*,per_page*}", pathParameters), + } + return m +} +// NewTeamsRequestBuilder instantiates a new TeamsRequestBuilder and sets the default values. +func NewTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTeamsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all of the teams across all of the organizations to which the authenticateduser belongs.OAuth app tokens and personal access tokens (classic) need the `user`, `repo`, or `read:org` scope to use this endpoint.When using a fine-grained personal access token, the resource owner of the token must be a single organization, and the response will only include the teams from that organization. +// returns a []TeamFullable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user +func (m *TeamsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[TeamsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamFullable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateTeamFullFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamFullable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.TeamFullable) + } + } + return val, nil +} +// ToGetRequestInformation list all of the teams across all of the organizations to which the authenticateduser belongs.OAuth app tokens and personal access tokens (classic) need the `user`, `repo`, or `read:org` scope to use this endpoint.When using a fine-grained personal access token, the resource owner of the token must be a single organization, and the response will only include the teams from that organization. +// returns a *RequestInformation when successful +func (m *TeamsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[TeamsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *TeamsRequestBuilder when successful +func (m *TeamsRequestBuilder) WithUrl(rawUrl string)(*TeamsRequestBuilder) { + return NewTeamsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/user_patch_request_body.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/user_patch_request_body.go new file mode 100644 index 000000000..03387dc1d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/user_patch_request_body.go @@ -0,0 +1,283 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type UserPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The new short biography of the user. + bio *string + // The new blog URL of the user. + blog *string + // The new company of the user. + company *string + // The publicly visible email address of the user. + email *string + // The new hiring availability of the user. + hireable *bool + // The new location of the user. + location *string + // The new name of the user. + name *string + // The new Twitter username of the user. + twitter_username *string +} +// NewUserPatchRequestBody instantiates a new UserPatchRequestBody and sets the default values. +func NewUserPatchRequestBody()(*UserPatchRequestBody) { + m := &UserPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUserPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUserPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUserPatchRequestBody(), 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 *UserPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBio gets the bio property value. The new short biography of the user. +// returns a *string when successful +func (m *UserPatchRequestBody) GetBio()(*string) { + return m.bio +} +// GetBlog gets the blog property value. The new blog URL of the user. +// returns a *string when successful +func (m *UserPatchRequestBody) GetBlog()(*string) { + return m.blog +} +// GetCompany gets the company property value. The new company of the user. +// returns a *string when successful +func (m *UserPatchRequestBody) GetCompany()(*string) { + return m.company +} +// GetEmail gets the email property value. The publicly visible email address of the user. +// returns a *string when successful +func (m *UserPatchRequestBody) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UserPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bio"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBio(val) + } + return nil + } + res["blog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlog(val) + } + return nil + } + res["company"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompany(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["hireable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHireable(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["twitter_username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTwitterUsername(val) + } + return nil + } + return res +} +// GetHireable gets the hireable property value. The new hiring availability of the user. +// returns a *bool when successful +func (m *UserPatchRequestBody) GetHireable()(*bool) { + return m.hireable +} +// GetLocation gets the location property value. The new location of the user. +// returns a *string when successful +func (m *UserPatchRequestBody) GetLocation()(*string) { + return m.location +} +// GetName gets the name property value. The new name of the user. +// returns a *string when successful +func (m *UserPatchRequestBody) GetName()(*string) { + return m.name +} +// GetTwitterUsername gets the twitter_username property value. The new Twitter username of the user. +// returns a *string when successful +func (m *UserPatchRequestBody) GetTwitterUsername()(*string) { + return m.twitter_username +} +// Serialize serializes information the current object +func (m *UserPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("bio", m.GetBio()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blog", m.GetBlog()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("company", m.GetCompany()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("hireable", m.GetHireable()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("twitter_username", m.GetTwitterUsername()) + 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 *UserPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBio sets the bio property value. The new short biography of the user. +func (m *UserPatchRequestBody) SetBio(value *string)() { + m.bio = value +} +// SetBlog sets the blog property value. The new blog URL of the user. +func (m *UserPatchRequestBody) SetBlog(value *string)() { + m.blog = value +} +// SetCompany sets the company property value. The new company of the user. +func (m *UserPatchRequestBody) SetCompany(value *string)() { + m.company = value +} +// SetEmail sets the email property value. The publicly visible email address of the user. +func (m *UserPatchRequestBody) SetEmail(value *string)() { + m.email = value +} +// SetHireable sets the hireable property value. The new hiring availability of the user. +func (m *UserPatchRequestBody) SetHireable(value *bool)() { + m.hireable = value +} +// SetLocation sets the location property value. The new location of the user. +func (m *UserPatchRequestBody) SetLocation(value *string)() { + m.location = value +} +// SetName sets the name property value. The new name of the user. +func (m *UserPatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetTwitterUsername sets the twitter_username property value. The new Twitter username of the user. +func (m *UserPatchRequestBody) SetTwitterUsername(value *string)() { + m.twitter_username = value +} +type UserPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBio()(*string) + GetBlog()(*string) + GetCompany()(*string) + GetEmail()(*string) + GetHireable()(*bool) + GetLocation()(*string) + GetName()(*string) + GetTwitterUsername()(*string) + SetBio(value *string)() + SetBlog(value *string)() + SetCompany(value *string)() + SetEmail(value *string)() + SetHireable(value *bool)() + SetLocation(value *string)() + SetName(value *string)() + SetTwitterUsername(value *string)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/user_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/user_request_builder.go new file mode 100644 index 000000000..41c2fec85 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/user_request_builder.go @@ -0,0 +1,329 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// UserRequestBuilder builds and executes requests for operations under \user +type UserRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// UserGetResponse composed type wrapper for classes i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable +type UserGetResponse struct { + // Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable + privateUser i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable + // Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable + publicUser i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable +} +// NewUserGetResponse instantiates a new UserGetResponse and sets the default values. +func NewUserGetResponse()(*UserGetResponse) { + m := &UserGetResponse{ + } + return m +} +// CreateUserGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUserGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewUserGetResponse() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UserGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *UserGetResponse) GetIsComposedType()(bool) { + return true +} +// GetPrivateUser gets the privateUser property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable +// returns a PrivateUserable when successful +func (m *UserGetResponse) GetPrivateUser()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable) { + return m.privateUser +} +// GetPublicUser gets the publicUser property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable +// returns a PublicUserable when successful +func (m *UserGetResponse) GetPublicUser()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable) { + return m.publicUser +} +// Serialize serializes information the current object +func (m *UserGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetPrivateUser() != nil { + err := writer.WriteObjectValue("", m.GetPrivateUser()) + if err != nil { + return err + } + } else if m.GetPublicUser() != nil { + err := writer.WriteObjectValue("", m.GetPublicUser()) + if err != nil { + return err + } + } + return nil +} +// SetPrivateUser sets the privateUser property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable +func (m *UserGetResponse) SetPrivateUser(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable)() { + m.privateUser = value +} +// SetPublicUser sets the publicUser property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable +func (m *UserGetResponse) SetPublicUser(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable)() { + m.publicUser = value +} +type UserGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPrivateUser()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable) + GetPublicUser()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable) + SetPrivateUser(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable)() + SetPublicUser(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable)() +} +// Blocks the blocks property +// returns a *BlocksRequestBuilder when successful +func (m *UserRequestBuilder) Blocks()(*BlocksRequestBuilder) { + return NewBlocksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ByAccount_id gets an item from the github.com/octokit/go-sdk/pkg/github.user.item collection +// returns a *WithAccount_ItemRequestBuilder when successful +func (m *UserRequestBuilder) ByAccount_id(account_id int32)(*WithAccount_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["account_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(account_id), 10) + return NewWithAccount_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// Codespaces the codespaces property +// returns a *CodespacesRequestBuilder when successful +func (m *UserRequestBuilder) Codespaces()(*CodespacesRequestBuilder) { + return NewCodespacesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewUserRequestBuilderInternal instantiates a new UserRequestBuilder and sets the default values. +func NewUserRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UserRequestBuilder) { + m := &UserRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user", pathParameters), + } + return m +} +// NewUserRequestBuilder instantiates a new UserRequestBuilder and sets the default values. +func NewUserRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UserRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewUserRequestBuilderInternal(urlParams, requestAdapter) +} +// Docker the docker property +// returns a *DockerRequestBuilder when successful +func (m *UserRequestBuilder) Docker()(*DockerRequestBuilder) { + return NewDockerRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Email the email property +// returns a *EmailRequestBuilder when successful +func (m *UserRequestBuilder) Email()(*EmailRequestBuilder) { + return NewEmailRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Emails the emails property +// returns a *EmailsRequestBuilder when successful +func (m *UserRequestBuilder) Emails()(*EmailsRequestBuilder) { + return NewEmailsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Followers the followers property +// returns a *FollowersRequestBuilder when successful +func (m *UserRequestBuilder) Followers()(*FollowersRequestBuilder) { + return NewFollowersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Following the following property +// returns a *FollowingRequestBuilder when successful +func (m *UserRequestBuilder) Following()(*FollowingRequestBuilder) { + return NewFollowingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get oAuth app tokens and personal access tokens (classic) need the `user` scope in order for the response to include private profile information. +// returns a UserGetResponseable 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/users/users#get-the-authenticated-user +func (m *UserRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(UserGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateUserGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(UserGetResponseable), nil +} +// Gpg_keys the gpg_keys property +// returns a *Gpg_keysRequestBuilder when successful +func (m *UserRequestBuilder) Gpg_keys()(*Gpg_keysRequestBuilder) { + return NewGpg_keysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Installations the installations property +// returns a *InstallationsRequestBuilder when successful +func (m *UserRequestBuilder) Installations()(*InstallationsRequestBuilder) { + return NewInstallationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// InteractionLimits the interactionLimits property +// returns a *InteractionLimitsRequestBuilder when successful +func (m *UserRequestBuilder) InteractionLimits()(*InteractionLimitsRequestBuilder) { + return NewInteractionLimitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Issues the issues property +// returns a *IssuesRequestBuilder when successful +func (m *UserRequestBuilder) Issues()(*IssuesRequestBuilder) { + return NewIssuesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Keys the keys property +// returns a *KeysRequestBuilder when successful +func (m *UserRequestBuilder) Keys()(*KeysRequestBuilder) { + return NewKeysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Marketplace_purchases the marketplace_purchases property +// returns a *Marketplace_purchasesRequestBuilder when successful +func (m *UserRequestBuilder) Marketplace_purchases()(*Marketplace_purchasesRequestBuilder) { + return NewMarketplace_purchasesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Memberships the memberships property +// returns a *MembershipsRequestBuilder when successful +func (m *UserRequestBuilder) Memberships()(*MembershipsRequestBuilder) { + return NewMembershipsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Migrations the migrations property +// returns a *MigrationsRequestBuilder when successful +func (m *UserRequestBuilder) Migrations()(*MigrationsRequestBuilder) { + return NewMigrationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Orgs the orgs property +// returns a *OrgsRequestBuilder when successful +func (m *UserRequestBuilder) Orgs()(*OrgsRequestBuilder) { + return NewOrgsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Packages the packages property +// returns a *PackagesRequestBuilder when successful +func (m *UserRequestBuilder) Packages()(*PackagesRequestBuilder) { + return NewPackagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch **Note:** If your email is set to private and you send an `email` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API. +// returns a PrivateUserable 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 +// 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] +// +// [API method documentation]: https://docs.github.com/rest/users/users#update-the-authenticated-user +func (m *UserRequestBuilder) Patch(ctx context.Context, body UserPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePrivateUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable), nil +} +// Projects the projects property +// returns a *ProjectsRequestBuilder when successful +func (m *UserRequestBuilder) Projects()(*ProjectsRequestBuilder) { + return NewProjectsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Public_emails the public_emails property +// returns a *Public_emailsRequestBuilder when successful +func (m *UserRequestBuilder) Public_emails()(*Public_emailsRequestBuilder) { + return NewPublic_emailsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repos the repos property +// returns a *ReposRequestBuilder when successful +func (m *UserRequestBuilder) Repos()(*ReposRequestBuilder) { + return NewReposRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repository_invitations the repository_invitations property +// returns a *Repository_invitationsRequestBuilder when successful +func (m *UserRequestBuilder) Repository_invitations()(*Repository_invitationsRequestBuilder) { + return NewRepository_invitationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Social_accounts the social_accounts property +// returns a *Social_accountsRequestBuilder when successful +func (m *UserRequestBuilder) Social_accounts()(*Social_accountsRequestBuilder) { + return NewSocial_accountsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Ssh_signing_keys the ssh_signing_keys property +// returns a *Ssh_signing_keysRequestBuilder when successful +func (m *UserRequestBuilder) Ssh_signing_keys()(*Ssh_signing_keysRequestBuilder) { + return NewSsh_signing_keysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Starred the starred property +// returns a *StarredRequestBuilder when successful +func (m *UserRequestBuilder) Starred()(*StarredRequestBuilder) { + return NewStarredRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Subscriptions the subscriptions property +// returns a *SubscriptionsRequestBuilder when successful +func (m *UserRequestBuilder) Subscriptions()(*SubscriptionsRequestBuilder) { + return NewSubscriptionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Teams the teams property +// returns a *TeamsRequestBuilder when successful +func (m *UserRequestBuilder) Teams()(*TeamsRequestBuilder) { + return NewTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation oAuth app tokens and personal access tokens (classic) need the `user` scope in order for the response to include private profile information. +// returns a *RequestInformation when successful +func (m *UserRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation **Note:** If your email is set to private and you send an `email` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API. +// returns a *RequestInformation when successful +func (m *UserRequestBuilder) ToPatchRequestInformation(ctx context.Context, body UserPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *UserRequestBuilder when successful +func (m *UserRequestBuilder) WithUrl(rawUrl string)(*UserRequestBuilder) { + return NewUserRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/user/with_account_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/user/with_account_item_request_builder.go new file mode 100644 index 000000000..51abed088 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/user/with_account_item_request_builder.go @@ -0,0 +1,145 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// WithAccount_ItemRequestBuilder builds and executes requests for operations under \user\{account_id} +type WithAccount_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// WithAccount_GetResponse composed type wrapper for classes i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable +type WithAccount_GetResponse struct { + // Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable + privateUser i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable + // Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable + publicUser i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable +} +// NewWithAccount_GetResponse instantiates a new WithAccount_GetResponse and sets the default values. +func NewWithAccount_GetResponse()(*WithAccount_GetResponse) { + m := &WithAccount_GetResponse{ + } + return m +} +// CreateWithAccount_GetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWithAccount_GetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewWithAccount_GetResponse() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WithAccount_GetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *WithAccount_GetResponse) GetIsComposedType()(bool) { + return true +} +// GetPrivateUser gets the privateUser property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable +// returns a PrivateUserable when successful +func (m *WithAccount_GetResponse) GetPrivateUser()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable) { + return m.privateUser +} +// GetPublicUser gets the publicUser property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable +// returns a PublicUserable when successful +func (m *WithAccount_GetResponse) GetPublicUser()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable) { + return m.publicUser +} +// Serialize serializes information the current object +func (m *WithAccount_GetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetPrivateUser() != nil { + err := writer.WriteObjectValue("", m.GetPrivateUser()) + if err != nil { + return err + } + } else if m.GetPublicUser() != nil { + err := writer.WriteObjectValue("", m.GetPublicUser()) + if err != nil { + return err + } + } + return nil +} +// SetPrivateUser sets the privateUser property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable +func (m *WithAccount_GetResponse) SetPrivateUser(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable)() { + m.privateUser = value +} +// SetPublicUser sets the publicUser property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable +func (m *WithAccount_GetResponse) SetPublicUser(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable)() { + m.publicUser = value +} +type WithAccount_GetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPrivateUser()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable) + GetPublicUser()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable) + SetPrivateUser(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable)() + SetPublicUser(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable)() +} +// NewWithAccount_ItemRequestBuilderInternal instantiates a new WithAccount_ItemRequestBuilder and sets the default values. +func NewWithAccount_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithAccount_ItemRequestBuilder) { + m := &WithAccount_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/{account_id}", pathParameters), + } + return m +} +// NewWithAccount_ItemRequestBuilder instantiates a new WithAccount_ItemRequestBuilder and sets the default values. +func NewWithAccount_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithAccount_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithAccount_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get provides publicly available information about someone with a GitHub account. This method takes their durable user `ID` instead of their `login`, which can change over time.The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication).The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/users/emails)". +// returns a WithAccount_GetResponseable 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/users/users#get-a-user-using-their-id +func (m *WithAccount_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(WithAccount_GetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateWithAccount_GetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(WithAccount_GetResponseable), nil +} +// ToGetRequestInformation provides publicly available information about someone with a GitHub account. This method takes their durable user `ID` instead of their `login`, which can change over time.The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication).The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/users/emails)". +// returns a *RequestInformation when successful +func (m *WithAccount_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *WithAccount_ItemRequestBuilder when successful +func (m *WithAccount_ItemRequestBuilder) WithUrl(rawUrl string)(*WithAccount_ItemRequestBuilder) { + return NewWithAccount_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item/hovercard/get_subject_type_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/hovercard/get_subject_type_query_parameter_type.go new file mode 100644 index 000000000..d9ad67a0c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/hovercard/get_subject_type_query_parameter_type.go @@ -0,0 +1,42 @@ +package hovercard +import ( + "errors" +) +type GetSubject_typeQueryParameterType int + +const ( + ORGANIZATION_GETSUBJECT_TYPEQUERYPARAMETERTYPE GetSubject_typeQueryParameterType = iota + REPOSITORY_GETSUBJECT_TYPEQUERYPARAMETERTYPE + ISSUE_GETSUBJECT_TYPEQUERYPARAMETERTYPE + PULL_REQUEST_GETSUBJECT_TYPEQUERYPARAMETERTYPE +) + +func (i GetSubject_typeQueryParameterType) String() string { + return []string{"organization", "repository", "issue", "pull_request"}[i] +} +func ParseGetSubject_typeQueryParameterType(v string) (any, error) { + result := ORGANIZATION_GETSUBJECT_TYPEQUERYPARAMETERTYPE + switch v { + case "organization": + result = ORGANIZATION_GETSUBJECT_TYPEQUERYPARAMETERTYPE + case "repository": + result = REPOSITORY_GETSUBJECT_TYPEQUERYPARAMETERTYPE + case "issue": + result = ISSUE_GETSUBJECT_TYPEQUERYPARAMETERTYPE + case "pull_request": + result = PULL_REQUEST_GETSUBJECT_TYPEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSubject_typeQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSubject_typeQueryParameterType(values []GetSubject_typeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSubject_typeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item/packages/get_package_type_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/packages/get_package_type_query_parameter_type.go new file mode 100644 index 000000000..ae4025d39 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/packages/get_package_type_query_parameter_type.go @@ -0,0 +1,48 @@ +package packages +import ( + "errors" +) +type GetPackage_typeQueryParameterType int + +const ( + NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE GetPackage_typeQueryParameterType = iota + MAVEN_GETPACKAGE_TYPEQUERYPARAMETERTYPE + RUBYGEMS_GETPACKAGE_TYPEQUERYPARAMETERTYPE + DOCKER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + NUGET_GETPACKAGE_TYPEQUERYPARAMETERTYPE + CONTAINER_GETPACKAGE_TYPEQUERYPARAMETERTYPE +) + +func (i GetPackage_typeQueryParameterType) String() string { + return []string{"npm", "maven", "rubygems", "docker", "nuget", "container"}[i] +} +func ParseGetPackage_typeQueryParameterType(v string) (any, error) { + result := NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE + switch v { + case "npm": + result = NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "maven": + result = MAVEN_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "rubygems": + result = RUBYGEMS_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "docker": + result = DOCKER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "nuget": + result = NUGET_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "container": + result = CONTAINER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetPackage_typeQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetPackage_typeQueryParameterType(values []GetPackage_typeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetPackage_typeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item/packages/get_visibility_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/packages/get_visibility_query_parameter_type.go new file mode 100644 index 000000000..daf1c43e6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/packages/get_visibility_query_parameter_type.go @@ -0,0 +1,39 @@ +package packages +import ( + "errors" +) +type GetVisibilityQueryParameterType int + +const ( + PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE GetVisibilityQueryParameterType = iota + PRIVATE_GETVISIBILITYQUERYPARAMETERTYPE + INTERNAL_GETVISIBILITYQUERYPARAMETERTYPE +) + +func (i GetVisibilityQueryParameterType) String() string { + return []string{"public", "private", "internal"}[i] +} +func ParseGetVisibilityQueryParameterType(v string) (any, error) { + result := PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE + switch v { + case "public": + result = PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE + case "private": + result = PRIVATE_GETVISIBILITYQUERYPARAMETERTYPE + case "internal": + result = INTERNAL_GETVISIBILITYQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetVisibilityQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetVisibilityQueryParameterType(values []GetVisibilityQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetVisibilityQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item/projects/get_state_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/projects/get_state_query_parameter_type.go new file mode 100644 index 000000000..985374b5e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/projects/get_state_query_parameter_type.go @@ -0,0 +1,39 @@ +package projects +import ( + "errors" +) +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetStateQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item/repos/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/repos/get_direction_query_parameter_type.go new file mode 100644 index 000000000..afa5d0fa6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/repos/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package repos +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item/repos/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/repos/get_sort_query_parameter_type.go new file mode 100644 index 000000000..8dee1bb8c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/repos/get_sort_query_parameter_type.go @@ -0,0 +1,42 @@ +package repos +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + PUSHED_GETSORTQUERYPARAMETERTYPE + FULL_NAME_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "pushed", "full_name"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "pushed": + result = PUSHED_GETSORTQUERYPARAMETERTYPE + case "full_name": + result = FULL_NAME_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item/repos/get_type_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/repos/get_type_query_parameter_type.go new file mode 100644 index 000000000..6ae776fdb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/repos/get_type_query_parameter_type.go @@ -0,0 +1,39 @@ +package repos +import ( + "errors" +) +type GetTypeQueryParameterType int + +const ( + ALL_GETTYPEQUERYPARAMETERTYPE GetTypeQueryParameterType = iota + OWNER_GETTYPEQUERYPARAMETERTYPE + MEMBER_GETTYPEQUERYPARAMETERTYPE +) + +func (i GetTypeQueryParameterType) String() string { + return []string{"all", "owner", "member"}[i] +} +func ParseGetTypeQueryParameterType(v string) (any, error) { + result := ALL_GETTYPEQUERYPARAMETERTYPE + switch v { + case "all": + result = ALL_GETTYPEQUERYPARAMETERTYPE + case "owner": + result = OWNER_GETTYPEQUERYPARAMETERTYPE + case "member": + result = MEMBER_GETTYPEQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetTypeQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetTypeQueryParameterType(values []GetTypeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetTypeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item/starred/get_direction_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/starred/get_direction_query_parameter_type.go new file mode 100644 index 000000000..3ac3d71e4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/starred/get_direction_query_parameter_type.go @@ -0,0 +1,36 @@ +package starred +import ( + "errors" +) +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetDirectionQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item/starred/get_sort_query_parameter_type.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/starred/get_sort_query_parameter_type.go new file mode 100644 index 000000000..604bb061e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item/starred/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package starred +import ( + "errors" +) +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return 0, errors.New("Unknown GetSortQueryParameterType value: " + v) + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_attestations_item_with_subject_digest_get_response.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_attestations_item_with_subject_digest_get_response.go new file mode 100644 index 000000000..8ede31c83 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_attestations_item_with_subject_digest_get_response.go @@ -0,0 +1,92 @@ +package users + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemAttestationsItemWithSubject_digestGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The attestations property + attestations []ItemAttestationsItemWithSubject_digestGetResponse_attestationsable +} +// NewItemAttestationsItemWithSubject_digestGetResponse instantiates a new ItemAttestationsItemWithSubject_digestGetResponse and sets the default values. +func NewItemAttestationsItemWithSubject_digestGetResponse()(*ItemAttestationsItemWithSubject_digestGetResponse) { + m := &ItemAttestationsItemWithSubject_digestGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemAttestationsItemWithSubject_digestGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemAttestationsItemWithSubject_digestGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemAttestationsItemWithSubject_digestGetResponse(), 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 *ItemAttestationsItemWithSubject_digestGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAttestations gets the attestations property value. The attestations property +// returns a []ItemAttestationsItemWithSubject_digestGetResponse_attestationsable when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse) GetAttestations()([]ItemAttestationsItemWithSubject_digestGetResponse_attestationsable) { + return m.attestations +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["attestations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemAttestationsItemWithSubject_digestGetResponse_attestationsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemAttestationsItemWithSubject_digestGetResponse_attestationsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemAttestationsItemWithSubject_digestGetResponse_attestationsable) + } + } + m.SetAttestations(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemAttestationsItemWithSubject_digestGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAttestations() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAttestations())) + for i, v := range m.GetAttestations() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("attestations", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemAttestationsItemWithSubject_digestGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAttestations sets the attestations property value. The attestations property +func (m *ItemAttestationsItemWithSubject_digestGetResponse) SetAttestations(value []ItemAttestationsItemWithSubject_digestGetResponse_attestationsable)() { + m.attestations = value +} +type ItemAttestationsItemWithSubject_digestGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAttestations()([]ItemAttestationsItemWithSubject_digestGetResponse_attestationsable) + SetAttestations(value []ItemAttestationsItemWithSubject_digestGetResponse_attestationsable)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_attestations_item_with_subject_digest_get_response_attestations.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_attestations_item_with_subject_digest_get_response_attestations.go new file mode 100644 index 000000000..36d436ebe --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_attestations_item_with_subject_digest_get_response_attestations.go @@ -0,0 +1,110 @@ +package users + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemAttestationsItemWithSubject_digestGetResponse_attestations struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Sigstore Bundle v0.1 + bundle i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SigstoreBundle0able + // The repository_id property + repository_id *int32 +} +// NewItemAttestationsItemWithSubject_digestGetResponse_attestations instantiates a new ItemAttestationsItemWithSubject_digestGetResponse_attestations and sets the default values. +func NewItemAttestationsItemWithSubject_digestGetResponse_attestations()(*ItemAttestationsItemWithSubject_digestGetResponse_attestations) { + m := &ItemAttestationsItemWithSubject_digestGetResponse_attestations{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemAttestationsItemWithSubject_digestGetResponse_attestationsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemAttestationsItemWithSubject_digestGetResponse_attestationsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemAttestationsItemWithSubject_digestGetResponse_attestations(), 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 *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBundle gets the bundle property value. Sigstore Bundle v0.1 +// returns a SigstoreBundle0able when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetBundle()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SigstoreBundle0able) { + return m.bundle +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bundle"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSigstoreBundle0FromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBundle(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SigstoreBundle0able)) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + return res +} +// GetRepositoryId gets the repository_id property value. The repository_id property +// returns a *int32 when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetRepositoryId()(*int32) { + return m.repository_id +} +// Serialize serializes information the current object +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("bundle", m.GetBundle()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + 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 *ItemAttestationsItemWithSubject_digestGetResponse_attestations) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBundle sets the bundle property value. Sigstore Bundle v0.1 +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) SetBundle(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SigstoreBundle0able)() { + m.bundle = value +} +// SetRepositoryId sets the repository_id property value. The repository_id property +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) SetRepositoryId(value *int32)() { + m.repository_id = value +} +type ItemAttestationsItemWithSubject_digestGetResponse_attestationsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBundle()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SigstoreBundle0able) + GetRepositoryId()(*int32) + SetBundle(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SigstoreBundle0able)() + SetRepositoryId(value *int32)() +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_attestations_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_attestations_request_builder.go new file mode 100644 index 000000000..7a4bb2d2c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_attestations_request_builder.go @@ -0,0 +1,35 @@ +package users + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemAttestationsRequestBuilder builds and executes requests for operations under \users\{username}\attestations +type ItemAttestationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// BySubject_digest gets an item from the github.com/octokit/go-sdk/pkg/github.users.item.attestations.item collection +// returns a *ItemAttestationsWithSubject_digestItemRequestBuilder when successful +func (m *ItemAttestationsRequestBuilder) BySubject_digest(subject_digest string)(*ItemAttestationsWithSubject_digestItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if subject_digest != "" { + urlTplParams["subject_digest"] = subject_digest + } + return NewItemAttestationsWithSubject_digestItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemAttestationsRequestBuilderInternal instantiates a new ItemAttestationsRequestBuilder and sets the default values. +func NewItemAttestationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAttestationsRequestBuilder) { + m := &ItemAttestationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/attestations", pathParameters), + } + return m +} +// NewItemAttestationsRequestBuilder instantiates a new ItemAttestationsRequestBuilder and sets the default values. +func NewItemAttestationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAttestationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemAttestationsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_attestations_with_subject_digest_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_attestations_with_subject_digest_item_request_builder.go new file mode 100644 index 000000000..8f2924e0b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_attestations_with_subject_digest_item_request_builder.go @@ -0,0 +1,70 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemAttestationsWithSubject_digestItemRequestBuilder builds and executes requests for operations under \users\{username}\attestations\{subject_digest} +type ItemAttestationsWithSubject_digestItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemAttestationsWithSubject_digestItemRequestBuilderGetQueryParameters list a collection of artifact attestations with a given subject digest that are associated with repositories owned by a user.The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required.**Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). +type ItemAttestationsWithSubject_digestItemRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. 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)." + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. 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)." + Before *string `uriparametername:"before"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemAttestationsWithSubject_digestItemRequestBuilderInternal instantiates a new ItemAttestationsWithSubject_digestItemRequestBuilder and sets the default values. +func NewItemAttestationsWithSubject_digestItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAttestationsWithSubject_digestItemRequestBuilder) { + m := &ItemAttestationsWithSubject_digestItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/attestations/{subject_digest}{?after*,before*,per_page*}", pathParameters), + } + return m +} +// NewItemAttestationsWithSubject_digestItemRequestBuilder instantiates a new ItemAttestationsWithSubject_digestItemRequestBuilder and sets the default values. +func NewItemAttestationsWithSubject_digestItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAttestationsWithSubject_digestItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemAttestationsWithSubject_digestItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list a collection of artifact attestations with a given subject digest that are associated with repositories owned by a user.The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required.**Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). +// returns a ItemAttestationsItemWithSubject_digestGetResponseable 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/users/attestations#list-attestations +func (m *ItemAttestationsWithSubject_digestItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemAttestationsWithSubject_digestItemRequestBuilderGetQueryParameters])(ItemAttestationsItemWithSubject_digestGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemAttestationsItemWithSubject_digestGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemAttestationsItemWithSubject_digestGetResponseable), nil +} +// ToGetRequestInformation list a collection of artifact attestations with a given subject digest that are associated with repositories owned by a user.The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required.**Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). +// returns a *RequestInformation when successful +func (m *ItemAttestationsWithSubject_digestItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemAttestationsWithSubject_digestItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemAttestationsWithSubject_digestItemRequestBuilder when successful +func (m *ItemAttestationsWithSubject_digestItemRequestBuilder) WithUrl(rawUrl string)(*ItemAttestationsWithSubject_digestItemRequestBuilder) { + return NewItemAttestationsWithSubject_digestItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_docker_conflicts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_docker_conflicts_request_builder.go new file mode 100644 index 000000000..840178b2a --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_docker_conflicts_request_builder.go @@ -0,0 +1,66 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemDockerConflictsRequestBuilder builds and executes requests for operations under \users\{username}\docker\conflicts +type ItemDockerConflictsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemDockerConflictsRequestBuilderInternal instantiates a new ItemDockerConflictsRequestBuilder and sets the default values. +func NewItemDockerConflictsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDockerConflictsRequestBuilder) { + m := &ItemDockerConflictsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/docker/conflicts", pathParameters), + } + return m +} +// NewItemDockerConflictsRequestBuilder instantiates a new ItemDockerConflictsRequestBuilder and sets the default values. +func NewItemDockerConflictsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDockerConflictsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDockerConflictsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all packages that are in a specific user's namespace, that the requesting user has access to, and that encountered a conflict during Docker migration.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. +// returns a []PackageEscapedable 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/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-user +func (m *ItemDockerConflictsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePackageEscapedFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable) + } + } + return val, nil +} +// ToGetRequestInformation lists all packages that are in a specific user's namespace, that the requesting user has access to, and that encountered a conflict during Docker migration.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDockerConflictsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemDockerConflictsRequestBuilder when successful +func (m *ItemDockerConflictsRequestBuilder) WithUrl(rawUrl string)(*ItemDockerConflictsRequestBuilder) { + return NewItemDockerConflictsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_docker_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_docker_request_builder.go new file mode 100644 index 000000000..7b9159d26 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_docker_request_builder.go @@ -0,0 +1,28 @@ +package users + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemDockerRequestBuilder builds and executes requests for operations under \users\{username}\docker +type ItemDockerRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Conflicts the conflicts property +// returns a *ItemDockerConflictsRequestBuilder when successful +func (m *ItemDockerRequestBuilder) Conflicts()(*ItemDockerConflictsRequestBuilder) { + return NewItemDockerConflictsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDockerRequestBuilderInternal instantiates a new ItemDockerRequestBuilder and sets the default values. +func NewItemDockerRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDockerRequestBuilder) { + m := &ItemDockerRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/docker", pathParameters), + } + return m +} +// NewItemDockerRequestBuilder instantiates a new ItemDockerRequestBuilder and sets the default values. +func NewItemDockerRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDockerRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDockerRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_events_orgs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_events_orgs_request_builder.go new file mode 100644 index 000000000..e5dded437 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_events_orgs_request_builder.go @@ -0,0 +1,35 @@ +package users + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemEventsOrgsRequestBuilder builds and executes requests for operations under \users\{username}\events\orgs +type ItemEventsOrgsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByOrg gets an item from the github.com/octokit/go-sdk/pkg/github.users.item.events.orgs.item collection +// returns a *ItemEventsOrgsWithOrgItemRequestBuilder when successful +func (m *ItemEventsOrgsRequestBuilder) ByOrg(org string)(*ItemEventsOrgsWithOrgItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if org != "" { + urlTplParams["org"] = org + } + return NewItemEventsOrgsWithOrgItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemEventsOrgsRequestBuilderInternal instantiates a new ItemEventsOrgsRequestBuilder and sets the default values. +func NewItemEventsOrgsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsOrgsRequestBuilder) { + m := &ItemEventsOrgsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/events/orgs", pathParameters), + } + return m +} +// NewItemEventsOrgsRequestBuilder instantiates a new ItemEventsOrgsRequestBuilder and sets the default values. +func NewItemEventsOrgsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsOrgsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemEventsOrgsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_events_orgs_with_org_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_events_orgs_with_org_item_request_builder.go new file mode 100644 index 000000000..0a01e888e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_events_orgs_with_org_item_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemEventsOrgsWithOrgItemRequestBuilder builds and executes requests for operations under \users\{username}\events\orgs\{org} +type ItemEventsOrgsWithOrgItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemEventsOrgsWithOrgItemRequestBuilderGetQueryParameters this is the user's organization dashboard. You must be authenticated as the user to view this. +type ItemEventsOrgsWithOrgItemRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemEventsOrgsWithOrgItemRequestBuilderInternal instantiates a new ItemEventsOrgsWithOrgItemRequestBuilder and sets the default values. +func NewItemEventsOrgsWithOrgItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsOrgsWithOrgItemRequestBuilder) { + m := &ItemEventsOrgsWithOrgItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/events/orgs/{org}{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemEventsOrgsWithOrgItemRequestBuilder instantiates a new ItemEventsOrgsWithOrgItemRequestBuilder and sets the default values. +func NewItemEventsOrgsWithOrgItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsOrgsWithOrgItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemEventsOrgsWithOrgItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get this is the user's organization dashboard. You must be authenticated as the user to view this. +// returns a []Eventable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user +func (m *ItemEventsOrgsWithOrgItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEventsOrgsWithOrgItemRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEventFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable) + } + } + return val, nil +} +// ToGetRequestInformation this is the user's organization dashboard. You must be authenticated as the user to view this. +// returns a *RequestInformation when successful +func (m *ItemEventsOrgsWithOrgItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEventsOrgsWithOrgItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemEventsOrgsWithOrgItemRequestBuilder when successful +func (m *ItemEventsOrgsWithOrgItemRequestBuilder) WithUrl(rawUrl string)(*ItemEventsOrgsWithOrgItemRequestBuilder) { + return NewItemEventsOrgsWithOrgItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_events_public_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_events_public_request_builder.go new file mode 100644 index 000000000..ebb49bdaf --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_events_public_request_builder.go @@ -0,0 +1,66 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemEventsPublicRequestBuilder builds and executes requests for operations under \users\{username}\events\public +type ItemEventsPublicRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemEventsPublicRequestBuilderGetQueryParameters list public events for a user +type ItemEventsPublicRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemEventsPublicRequestBuilderInternal instantiates a new ItemEventsPublicRequestBuilder and sets the default values. +func NewItemEventsPublicRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsPublicRequestBuilder) { + m := &ItemEventsPublicRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/events/public{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemEventsPublicRequestBuilder instantiates a new ItemEventsPublicRequestBuilder and sets the default values. +func NewItemEventsPublicRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsPublicRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemEventsPublicRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list public events for a user +// returns a []Eventable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/events#list-public-events-for-a-user +func (m *ItemEventsPublicRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEventsPublicRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEventFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable) + } + } + return val, nil +} +// returns a *RequestInformation when successful +func (m *ItemEventsPublicRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEventsPublicRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemEventsPublicRequestBuilder when successful +func (m *ItemEventsPublicRequestBuilder) WithUrl(rawUrl string)(*ItemEventsPublicRequestBuilder) { + return NewItemEventsPublicRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_events_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_events_request_builder.go new file mode 100644 index 000000000..f03f608c6 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_events_request_builder.go @@ -0,0 +1,77 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemEventsRequestBuilder builds and executes requests for operations under \users\{username}\events +type ItemEventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemEventsRequestBuilderGetQueryParameters if you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. +type ItemEventsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemEventsRequestBuilderInternal instantiates a new ItemEventsRequestBuilder and sets the default values. +func NewItemEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsRequestBuilder) { + m := &ItemEventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/events{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemEventsRequestBuilder instantiates a new ItemEventsRequestBuilder and sets the default values. +func NewItemEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemEventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get if you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. +// returns a []Eventable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user +func (m *ItemEventsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEventsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEventFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable) + } + } + return val, nil +} +// Orgs the orgs property +// returns a *ItemEventsOrgsRequestBuilder when successful +func (m *ItemEventsRequestBuilder) Orgs()(*ItemEventsOrgsRequestBuilder) { + return NewItemEventsOrgsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Public the public property +// returns a *ItemEventsPublicRequestBuilder when successful +func (m *ItemEventsRequestBuilder) Public()(*ItemEventsPublicRequestBuilder) { + return NewItemEventsPublicRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation if you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. +// returns a *RequestInformation when successful +func (m *ItemEventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEventsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemEventsRequestBuilder when successful +func (m *ItemEventsRequestBuilder) WithUrl(rawUrl string)(*ItemEventsRequestBuilder) { + return NewItemEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_followers_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_followers_request_builder.go new file mode 100644 index 000000000..d3813a926 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_followers_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemFollowersRequestBuilder builds and executes requests for operations under \users\{username}\followers +type ItemFollowersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemFollowersRequestBuilderGetQueryParameters lists the people following the specified user. +type ItemFollowersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemFollowersRequestBuilderInternal instantiates a new ItemFollowersRequestBuilder and sets the default values. +func NewItemFollowersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemFollowersRequestBuilder) { + m := &ItemFollowersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/followers{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemFollowersRequestBuilder instantiates a new ItemFollowersRequestBuilder and sets the default values. +func NewItemFollowersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemFollowersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemFollowersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the people following the specified user. +// returns a []SimpleUserable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/followers#list-followers-of-a-user +func (m *ItemFollowersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemFollowersRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation lists the people following the specified user. +// returns a *RequestInformation when successful +func (m *ItemFollowersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemFollowersRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemFollowersRequestBuilder when successful +func (m *ItemFollowersRequestBuilder) WithUrl(rawUrl string)(*ItemFollowersRequestBuilder) { + return NewItemFollowersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_following_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_following_request_builder.go new file mode 100644 index 000000000..b45ba9c44 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_following_request_builder.go @@ -0,0 +1,79 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemFollowingRequestBuilder builds and executes requests for operations under \users\{username}\following +type ItemFollowingRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemFollowingRequestBuilderGetQueryParameters lists the people who the specified user follows. +type ItemFollowingRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByTarget_user gets an item from the github.com/octokit/go-sdk/pkg/github.users.item.following.item collection +// returns a *ItemFollowingWithTarget_userItemRequestBuilder when successful +func (m *ItemFollowingRequestBuilder) ByTarget_user(target_user string)(*ItemFollowingWithTarget_userItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if target_user != "" { + urlTplParams["target_user"] = target_user + } + return NewItemFollowingWithTarget_userItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemFollowingRequestBuilderInternal instantiates a new ItemFollowingRequestBuilder and sets the default values. +func NewItemFollowingRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemFollowingRequestBuilder) { + m := &ItemFollowingRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/following{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemFollowingRequestBuilder instantiates a new ItemFollowingRequestBuilder and sets the default values. +func NewItemFollowingRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemFollowingRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemFollowingRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the people who the specified user follows. +// returns a []SimpleUserable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows +func (m *ItemFollowingRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemFollowingRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation lists the people who the specified user follows. +// returns a *RequestInformation when successful +func (m *ItemFollowingRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemFollowingRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemFollowingRequestBuilder when successful +func (m *ItemFollowingRequestBuilder) WithUrl(rawUrl string)(*ItemFollowingRequestBuilder) { + return NewItemFollowingRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_following_with_target_user_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_following_with_target_user_item_request_builder.go new file mode 100644 index 000000000..26cfcbd15 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_following_with_target_user_item_request_builder.go @@ -0,0 +1,50 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemFollowingWithTarget_userItemRequestBuilder builds and executes requests for operations under \users\{username}\following\{target_user} +type ItemFollowingWithTarget_userItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemFollowingWithTarget_userItemRequestBuilderInternal instantiates a new ItemFollowingWithTarget_userItemRequestBuilder and sets the default values. +func NewItemFollowingWithTarget_userItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemFollowingWithTarget_userItemRequestBuilder) { + m := &ItemFollowingWithTarget_userItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/following/{target_user}", pathParameters), + } + return m +} +// NewItemFollowingWithTarget_userItemRequestBuilder instantiates a new ItemFollowingWithTarget_userItemRequestBuilder and sets the default values. +func NewItemFollowingWithTarget_userItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemFollowingWithTarget_userItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemFollowingWithTarget_userItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get check if a user follows another user +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user +func (m *ItemFollowingWithTarget_userItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// returns a *RequestInformation when successful +func (m *ItemFollowingWithTarget_userItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemFollowingWithTarget_userItemRequestBuilder when successful +func (m *ItemFollowingWithTarget_userItemRequestBuilder) WithUrl(rawUrl string)(*ItemFollowingWithTarget_userItemRequestBuilder) { + return NewItemFollowingWithTarget_userItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_gists_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_gists_request_builder.go new file mode 100644 index 000000000..deeb0010c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_gists_request_builder.go @@ -0,0 +1,74 @@ +package users + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemGistsRequestBuilder builds and executes requests for operations under \users\{username}\gists +type ItemGistsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemGistsRequestBuilderGetQueryParameters lists public gists for the specified user: +type ItemGistsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` +} +// NewItemGistsRequestBuilderInternal instantiates a new ItemGistsRequestBuilder and sets the default values. +func NewItemGistsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemGistsRequestBuilder) { + m := &ItemGistsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/gists{?page*,per_page*,since*}", pathParameters), + } + return m +} +// NewItemGistsRequestBuilder instantiates a new ItemGistsRequestBuilder and sets the default values. +func NewItemGistsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemGistsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemGistsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists public gists for the specified user: +// returns a []BaseGistable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/gists/gists#list-gists-for-a-user +func (m *ItemGistsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemGistsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BaseGistable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBaseGistFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BaseGistable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.BaseGistable) + } + } + return val, nil +} +// ToGetRequestInformation lists public gists for the specified user: +// returns a *RequestInformation when successful +func (m *ItemGistsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemGistsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemGistsRequestBuilder when successful +func (m *ItemGistsRequestBuilder) WithUrl(rawUrl string)(*ItemGistsRequestBuilder) { + return NewItemGistsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_gpg_keys_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_gpg_keys_request_builder.go new file mode 100644 index 000000000..d59296ef2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_gpg_keys_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemGpg_keysRequestBuilder builds and executes requests for operations under \users\{username}\gpg_keys +type ItemGpg_keysRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemGpg_keysRequestBuilderGetQueryParameters lists the GPG keys for a user. This information is accessible by anyone. +type ItemGpg_keysRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemGpg_keysRequestBuilderInternal instantiates a new ItemGpg_keysRequestBuilder and sets the default values. +func NewItemGpg_keysRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemGpg_keysRequestBuilder) { + m := &ItemGpg_keysRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/gpg_keys{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemGpg_keysRequestBuilder instantiates a new ItemGpg_keysRequestBuilder and sets the default values. +func NewItemGpg_keysRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemGpg_keysRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemGpg_keysRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the GPG keys for a user. This information is accessible by anyone. +// returns a []GpgKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user +func (m *ItemGpg_keysRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemGpg_keysRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GpgKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateGpgKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GpgKeyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.GpgKeyable) + } + } + return val, nil +} +// ToGetRequestInformation lists the GPG keys for a user. This information is accessible by anyone. +// returns a *RequestInformation when successful +func (m *ItemGpg_keysRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemGpg_keysRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemGpg_keysRequestBuilder when successful +func (m *ItemGpg_keysRequestBuilder) WithUrl(rawUrl string)(*ItemGpg_keysRequestBuilder) { + return NewItemGpg_keysRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_hovercard_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_hovercard_request_builder.go new file mode 100644 index 000000000..044894852 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_hovercard_request_builder.go @@ -0,0 +1,71 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i86be503ed361dd89062cf612d6874879b1dd1f54504dee2f25e28c35ee69cfa2 "github.com/octokit/go-sdk/pkg/github/users/item/hovercard" +) + +// ItemHovercardRequestBuilder builds and executes requests for operations under \users\{username}\hovercard +type ItemHovercardRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemHovercardRequestBuilderGetQueryParameters provides hovercard information. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations. The `subject_type` and `subject_id` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about `octocat` who owns the `Spoon-Knife` repository, you would use a `subject_type` value of `repository` and a `subject_id` value of `1300192` (the ID of the `Spoon-Knife` repository).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemHovercardRequestBuilderGetQueryParameters struct { + // Uses the ID for the `subject_type` you specified. **Required** when using `subject_type`. + Subject_id *string `uriparametername:"subject_id"` + // Identifies which additional information you'd like to receive about the person's hovercard. Can be `organization`, `repository`, `issue`, `pull_request`. **Required** when using `subject_id`. + Subject_type *i86be503ed361dd89062cf612d6874879b1dd1f54504dee2f25e28c35ee69cfa2.GetSubject_typeQueryParameterType `uriparametername:"subject_type"` +} +// NewItemHovercardRequestBuilderInternal instantiates a new ItemHovercardRequestBuilder and sets the default values. +func NewItemHovercardRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHovercardRequestBuilder) { + m := &ItemHovercardRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/hovercard{?subject_id*,subject_type*}", pathParameters), + } + return m +} +// NewItemHovercardRequestBuilder instantiates a new ItemHovercardRequestBuilder and sets the default values. +func NewItemHovercardRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHovercardRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemHovercardRequestBuilderInternal(urlParams, requestAdapter) +} +// Get provides hovercard information. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations. The `subject_type` and `subject_id` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about `octocat` who owns the `Spoon-Knife` repository, you would use a `subject_type` value of `repository` and a `subject_id` value of `1300192` (the ID of the `Spoon-Knife` repository).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a Hovercardable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user +func (m *ItemHovercardRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemHovercardRequestBuilderGetQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Hovercardable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateHovercardFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Hovercardable), nil +} +// ToGetRequestInformation provides hovercard information. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations. The `subject_type` and `subject_id` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about `octocat` who owns the `Spoon-Knife` repository, you would use a `subject_type` value of `repository` and a `subject_id` value of `1300192` (the ID of the `Spoon-Knife` repository).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemHovercardRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemHovercardRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemHovercardRequestBuilder when successful +func (m *ItemHovercardRequestBuilder) WithUrl(rawUrl string)(*ItemHovercardRequestBuilder) { + return NewItemHovercardRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_installation_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_installation_request_builder.go new file mode 100644 index 000000000..b5bfb6a9f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_installation_request_builder.go @@ -0,0 +1,57 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemInstallationRequestBuilder builds and executes requests for operations under \users\{username}\installation +type ItemInstallationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemInstallationRequestBuilderInternal instantiates a new ItemInstallationRequestBuilder and sets the default values. +func NewItemInstallationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInstallationRequestBuilder) { + m := &ItemInstallationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/installation", pathParameters), + } + return m +} +// NewItemInstallationRequestBuilder instantiates a new ItemInstallationRequestBuilder and sets the default values. +func NewItemInstallationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInstallationRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemInstallationRequestBuilderInternal(urlParams, requestAdapter) +} +// Get enables an authenticated GitHub App to find the user’s installation information.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a Installationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app +func (m *ItemInstallationRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateInstallationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Installationable), nil +} +// ToGetRequestInformation enables an authenticated GitHub App to find the user’s installation information.You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *ItemInstallationRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemInstallationRequestBuilder when successful +func (m *ItemInstallationRequestBuilder) WithUrl(rawUrl string)(*ItemInstallationRequestBuilder) { + return NewItemInstallationRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_keys_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_keys_request_builder.go new file mode 100644 index 000000000..91f08886b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_keys_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemKeysRequestBuilder builds and executes requests for operations under \users\{username}\keys +type ItemKeysRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemKeysRequestBuilderGetQueryParameters lists the _verified_ public SSH keys for a user. This is accessible by anyone. +type ItemKeysRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemKeysRequestBuilderInternal instantiates a new ItemKeysRequestBuilder and sets the default values. +func NewItemKeysRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemKeysRequestBuilder) { + m := &ItemKeysRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/keys{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemKeysRequestBuilder instantiates a new ItemKeysRequestBuilder and sets the default values. +func NewItemKeysRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemKeysRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemKeysRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the _verified_ public SSH keys for a user. This is accessible by anyone. +// returns a []KeySimpleable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user +func (m *ItemKeysRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemKeysRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.KeySimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateKeySimpleFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.KeySimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.KeySimpleable) + } + } + return val, nil +} +// ToGetRequestInformation lists the _verified_ public SSH keys for a user. This is accessible by anyone. +// returns a *RequestInformation when successful +func (m *ItemKeysRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemKeysRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemKeysRequestBuilder when successful +func (m *ItemKeysRequestBuilder) WithUrl(rawUrl string)(*ItemKeysRequestBuilder) { + return NewItemKeysRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_orgs_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_orgs_request_builder.go new file mode 100644 index 000000000..3761cae3b --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_orgs_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemOrgsRequestBuilder builds and executes requests for operations under \users\{username}\orgs +type ItemOrgsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemOrgsRequestBuilderGetQueryParameters list [public organization memberships](https://docs.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user.This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user) API instead. +type ItemOrgsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemOrgsRequestBuilderInternal instantiates a new ItemOrgsRequestBuilder and sets the default values. +func NewItemOrgsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrgsRequestBuilder) { + m := &ItemOrgsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/orgs{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemOrgsRequestBuilder instantiates a new ItemOrgsRequestBuilder and sets the default values. +func NewItemOrgsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrgsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrgsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list [public organization memberships](https://docs.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user.This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user) API instead. +// returns a []OrganizationSimpleable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user +func (m *ItemOrgsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemOrgsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrganizationSimpleFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationSimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrganizationSimpleable) + } + } + return val, nil +} +// ToGetRequestInformation list [public organization memberships](https://docs.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user.This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user) API instead. +// returns a *RequestInformation when successful +func (m *ItemOrgsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemOrgsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemOrgsRequestBuilder when successful +func (m *ItemOrgsRequestBuilder) WithUrl(rawUrl string)(*ItemOrgsRequestBuilder) { + return NewItemOrgsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_item_item_restore_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_item_item_restore_request_builder.go new file mode 100644 index 000000000..ae9c126bd --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_item_item_restore_request_builder.go @@ -0,0 +1,66 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPackagesItemItemRestoreRequestBuilder builds and executes requests for operations under \users\{username}\packages\{package_type}\{package_name}\restore +type ItemPackagesItemItemRestoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPackagesItemItemRestoreRequestBuilderPostQueryParameters restores an entire package for a user.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +type ItemPackagesItemItemRestoreRequestBuilderPostQueryParameters struct { + // package token + Token *string `uriparametername:"token"` +} +// NewItemPackagesItemItemRestoreRequestBuilderInternal instantiates a new ItemPackagesItemItemRestoreRequestBuilder and sets the default values. +func NewItemPackagesItemItemRestoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemRestoreRequestBuilder) { + m := &ItemPackagesItemItemRestoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/packages/{package_type}/{package_name}/restore{?token*}", pathParameters), + } + return m +} +// NewItemPackagesItemItemRestoreRequestBuilder instantiates a new ItemPackagesItemItemRestoreRequestBuilder and sets the default values. +func NewItemPackagesItemItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemRestoreRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemItemRestoreRequestBuilderInternal(urlParams, requestAdapter) +} +// Post restores an entire package for a user.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user +func (m *ItemPackagesItemItemRestoreRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesItemItemRestoreRequestBuilderPostQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation restores an entire package for a user.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesItemItemRestoreRequestBuilderPostQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPackagesItemItemRestoreRequestBuilder when successful +func (m *ItemPackagesItemItemRestoreRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemItemRestoreRequestBuilder) { + return NewItemPackagesItemItemRestoreRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_item_item_versions_item_restore_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_item_item_versions_item_restore_request_builder.go new file mode 100644 index 000000000..3347c6383 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_item_item_versions_item_restore_request_builder.go @@ -0,0 +1,61 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPackagesItemItemVersionsItemRestoreRequestBuilder builds and executes requests for operations under \users\{username}\packages\{package_type}\{package_name}\versions\{package_version_id}\restore +type ItemPackagesItemItemVersionsItemRestoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPackagesItemItemVersionsItemRestoreRequestBuilderInternal instantiates a new ItemPackagesItemItemVersionsItemRestoreRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsItemRestoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsItemRestoreRequestBuilder) { + m := &ItemPackagesItemItemVersionsItemRestoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore", pathParameters), + } + return m +} +// NewItemPackagesItemItemVersionsItemRestoreRequestBuilder instantiates a new ItemPackagesItemItemVersionsItemRestoreRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsItemRestoreRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemItemVersionsItemRestoreRequestBuilderInternal(urlParams, requestAdapter) +} +// Post restores a specific package version for a user.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user +func (m *ItemPackagesItemItemVersionsItemRestoreRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation restores a specific package version for a user.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemVersionsItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPackagesItemItemVersionsItemRestoreRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsItemRestoreRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemItemVersionsItemRestoreRequestBuilder) { + return NewItemPackagesItemItemVersionsItemRestoreRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_item_item_versions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_item_item_versions_request_builder.go new file mode 100644 index 000000000..ee4f5cd1f --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_item_item_versions_request_builder.go @@ -0,0 +1,79 @@ +package users + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPackagesItemItemVersionsRequestBuilder builds and executes requests for operations under \users\{username}\packages\{package_type}\{package_name}\versions +type ItemPackagesItemItemVersionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByPackage_version_id gets an item from the github.com/octokit/go-sdk/pkg/github.users.item.packages.item.item.versions.item collection +// returns a *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsRequestBuilder) ByPackage_version_id(package_version_id int32)(*ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["package_version_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(package_version_id), 10) + return NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPackagesItemItemVersionsRequestBuilderInternal instantiates a new ItemPackagesItemItemVersionsRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsRequestBuilder) { + m := &ItemPackagesItemItemVersionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/packages/{package_type}/{package_name}/versions", pathParameters), + } + return m +} +// NewItemPackagesItemItemVersionsRequestBuilder instantiates a new ItemPackagesItemItemVersionsRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemItemVersionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists package versions for a public package owned by a specified user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a []PackageVersionable 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 +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user +func (m *ItemPackagesItemItemVersionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageVersionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePackageVersionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageVersionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageVersionable) + } + } + return val, nil +} +// ToGetRequestInformation lists package versions for a public package owned by a specified user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemVersionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPackagesItemItemVersionsRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemItemVersionsRequestBuilder) { + return NewItemPackagesItemItemVersionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_item_item_versions_with_package_version_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_item_item_versions_with_package_version_item_request_builder.go new file mode 100644 index 000000000..1751aa97d --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_item_item_versions_with_package_version_item_request_builder.go @@ -0,0 +1,93 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder builds and executes requests for operations under \users\{username}\packages\{package_type}\{package_name}\versions\{package_version_id} +type ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal instantiates a new ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + m := &ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}", pathParameters), + } + return m +} +// NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder instantiates a new ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a specific package version for a user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a specific package version for a public package owned by a specified user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a PackageVersionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageVersionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePackageVersionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageVersionable), nil +} +// Restore the restore property +// returns a *ItemPackagesItemItemVersionsItemRestoreRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) Restore()(*ItemPackagesItemItemVersionsItemRestoreRequestBuilder) { + return NewItemPackagesItemItemVersionsItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a specific package version for a user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets a specific package version for a public package owned by a specified user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + return NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_item_with_package_name_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_item_with_package_name_item_request_builder.go new file mode 100644 index 000000000..8c64ef585 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_item_with_package_name_item_request_builder.go @@ -0,0 +1,98 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPackagesItemWithPackage_nameItemRequestBuilder builds and executes requests for operations under \users\{username}\packages\{package_type}\{package_name} +type ItemPackagesItemWithPackage_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPackagesItemWithPackage_nameItemRequestBuilderInternal instantiates a new ItemPackagesItemWithPackage_nameItemRequestBuilder and sets the default values. +func NewItemPackagesItemWithPackage_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemWithPackage_nameItemRequestBuilder) { + m := &ItemPackagesItemWithPackage_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/packages/{package_type}/{package_name}", pathParameters), + } + return m +} +// NewItemPackagesItemWithPackage_nameItemRequestBuilder instantiates a new ItemPackagesItemWithPackage_nameItemRequestBuilder and sets the default values. +func NewItemPackagesItemWithPackage_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemWithPackage_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemWithPackage_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes an entire package for a user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a specific package metadata for a public package owned by a user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a PackageEscapedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePackageEscapedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable), nil +} +// Restore the restore property +// returns a *ItemPackagesItemItemRestoreRequestBuilder when successful +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) Restore()(*ItemPackagesItemItemRestoreRequestBuilder) { + return NewItemPackagesItemItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes an entire package for a user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets a specific package metadata for a public package owned by a user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// Versions the versions property +// returns a *ItemPackagesItemItemVersionsRequestBuilder when successful +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) Versions()(*ItemPackagesItemItemVersionsRequestBuilder) { + return NewItemPackagesItemItemVersionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPackagesItemWithPackage_nameItemRequestBuilder when successful +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemWithPackage_nameItemRequestBuilder) { + return NewItemPackagesItemWithPackage_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_request_builder.go new file mode 100644 index 000000000..de2b399f5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_request_builder.go @@ -0,0 +1,90 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i0db6aa605b66c3e026e578c21909de97874d74c479b878696174db88d81a5b36 "github.com/octokit/go-sdk/pkg/github/users/item/packages" +) + +// ItemPackagesRequestBuilder builds and executes requests for operations under \users\{username}\packages +type ItemPackagesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPackagesRequestBuilderGetQueryParameters lists all packages in a user's namespace for which the requesting user has access.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +type ItemPackagesRequestBuilderGetQueryParameters struct { + // The type of supported package. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. + Package_type *i0db6aa605b66c3e026e578c21909de97874d74c479b878696174db88d81a5b36.GetPackage_typeQueryParameterType `uriparametername:"package_type"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The selected visibility of the packages. This parameter is optional and only filters an existing result set.The `internal` visibility is only supported for GitHub Packages registries that allow for granular permissions. For other ecosystems `internal` is synonymous with `private`.For the list of GitHub Packages registries that support granular permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." + Visibility *i0db6aa605b66c3e026e578c21909de97874d74c479b878696174db88d81a5b36.GetVisibilityQueryParameterType `uriparametername:"visibility"` +} +// ByPackage_type gets an item from the github.com/octokit/go-sdk/pkg/github.users.item.packages.item collection +// returns a *ItemPackagesWithPackage_typeItemRequestBuilder when successful +func (m *ItemPackagesRequestBuilder) ByPackage_type(package_type string)(*ItemPackagesWithPackage_typeItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if package_type != "" { + urlTplParams["package_type"] = package_type + } + return NewItemPackagesWithPackage_typeItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPackagesRequestBuilderInternal instantiates a new ItemPackagesRequestBuilder and sets the default values. +func NewItemPackagesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesRequestBuilder) { + m := &ItemPackagesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/packages?package_type={package_type}{&page*,per_page*,visibility*}", pathParameters), + } + return m +} +// NewItemPackagesRequestBuilder instantiates a new ItemPackagesRequestBuilder and sets the default values. +func NewItemPackagesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all packages in a user's namespace for which the requesting user has access.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a []PackageEscapedable 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/packages/packages#list-packages-for-a-user +func (m *ItemPackagesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePackageEscapedFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackageEscapedable) + } + } + return val, nil +} +// ToGetRequestInformation lists all packages in a user's namespace for which the requesting user has access.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPackagesRequestBuilder when successful +func (m *ItemPackagesRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesRequestBuilder) { + return NewItemPackagesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_with_package_type_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_with_package_type_item_request_builder.go new file mode 100644 index 000000000..4a136116e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_packages_with_package_type_item_request_builder.go @@ -0,0 +1,35 @@ +package users + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemPackagesWithPackage_typeItemRequestBuilder builds and executes requests for operations under \users\{username}\packages\{package_type} +type ItemPackagesWithPackage_typeItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByPackage_name gets an item from the github.com/octokit/go-sdk/pkg/github.users.item.packages.item.item collection +// returns a *ItemPackagesItemWithPackage_nameItemRequestBuilder when successful +func (m *ItemPackagesWithPackage_typeItemRequestBuilder) ByPackage_name(package_name string)(*ItemPackagesItemWithPackage_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if package_name != "" { + urlTplParams["package_name"] = package_name + } + return NewItemPackagesItemWithPackage_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPackagesWithPackage_typeItemRequestBuilderInternal instantiates a new ItemPackagesWithPackage_typeItemRequestBuilder and sets the default values. +func NewItemPackagesWithPackage_typeItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesWithPackage_typeItemRequestBuilder) { + m := &ItemPackagesWithPackage_typeItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/packages/{package_type}", pathParameters), + } + return m +} +// NewItemPackagesWithPackage_typeItemRequestBuilder instantiates a new ItemPackagesWithPackage_typeItemRequestBuilder and sets the default values. +func NewItemPackagesWithPackage_typeItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesWithPackage_typeItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesWithPackage_typeItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_projects_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_projects_request_builder.go new file mode 100644 index 000000000..8530c3844 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_projects_request_builder.go @@ -0,0 +1,74 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + icca4326a4d3967039c59fe33a86af8ae6f2286dcd8769ed1c103306e802c277c "github.com/octokit/go-sdk/pkg/github/users/item/projects" +) + +// ItemProjectsRequestBuilder builds and executes requests for operations under \users\{username}\projects +type ItemProjectsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemProjectsRequestBuilderGetQueryParameters lists projects for a user. +type ItemProjectsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Indicates the state of the projects to return. + State *icca4326a4d3967039c59fe33a86af8ae6f2286dcd8769ed1c103306e802c277c.GetStateQueryParameterType `uriparametername:"state"` +} +// NewItemProjectsRequestBuilderInternal instantiates a new ItemProjectsRequestBuilder and sets the default values. +func NewItemProjectsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProjectsRequestBuilder) { + m := &ItemProjectsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/projects{?page*,per_page*,state*}", pathParameters), + } + return m +} +// NewItemProjectsRequestBuilder instantiates a new ItemProjectsRequestBuilder and sets the default values. +func NewItemProjectsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProjectsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemProjectsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists projects for a user. +// returns a []Projectable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/projects/projects#list-user-projects +func (m *ItemProjectsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemProjectsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Projectable) + } + } + return val, nil +} +// ToGetRequestInformation lists projects for a user. +// returns a *RequestInformation when successful +func (m *ItemProjectsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemProjectsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemProjectsRequestBuilder when successful +func (m *ItemProjectsRequestBuilder) WithUrl(rawUrl string)(*ItemProjectsRequestBuilder) { + return NewItemProjectsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_received_events_public_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_received_events_public_request_builder.go new file mode 100644 index 000000000..8871fe3db --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_received_events_public_request_builder.go @@ -0,0 +1,66 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemReceived_eventsPublicRequestBuilder builds and executes requests for operations under \users\{username}\received_events\public +type ItemReceived_eventsPublicRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemReceived_eventsPublicRequestBuilderGetQueryParameters list public events received by a user +type ItemReceived_eventsPublicRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemReceived_eventsPublicRequestBuilderInternal instantiates a new ItemReceived_eventsPublicRequestBuilder and sets the default values. +func NewItemReceived_eventsPublicRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReceived_eventsPublicRequestBuilder) { + m := &ItemReceived_eventsPublicRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/received_events/public{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemReceived_eventsPublicRequestBuilder instantiates a new ItemReceived_eventsPublicRequestBuilder and sets the default values. +func NewItemReceived_eventsPublicRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReceived_eventsPublicRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemReceived_eventsPublicRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list public events received by a user +// returns a []Eventable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user +func (m *ItemReceived_eventsPublicRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReceived_eventsPublicRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEventFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable) + } + } + return val, nil +} +// returns a *RequestInformation when successful +func (m *ItemReceived_eventsPublicRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReceived_eventsPublicRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemReceived_eventsPublicRequestBuilder when successful +func (m *ItemReceived_eventsPublicRequestBuilder) WithUrl(rawUrl string)(*ItemReceived_eventsPublicRequestBuilder) { + return NewItemReceived_eventsPublicRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_received_events_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_received_events_request_builder.go new file mode 100644 index 000000000..1bdf00762 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_received_events_request_builder.go @@ -0,0 +1,72 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemReceived_eventsRequestBuilder builds and executes requests for operations under \users\{username}\received_events +type ItemReceived_eventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemReceived_eventsRequestBuilderGetQueryParameters these are events that you've received by watching repositories and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events. +type ItemReceived_eventsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemReceived_eventsRequestBuilderInternal instantiates a new ItemReceived_eventsRequestBuilder and sets the default values. +func NewItemReceived_eventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReceived_eventsRequestBuilder) { + m := &ItemReceived_eventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/received_events{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemReceived_eventsRequestBuilder instantiates a new ItemReceived_eventsRequestBuilder and sets the default values. +func NewItemReceived_eventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReceived_eventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemReceived_eventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get these are events that you've received by watching repositories and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events. +// returns a []Eventable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user +func (m *ItemReceived_eventsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReceived_eventsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateEventFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.Eventable) + } + } + return val, nil +} +// Public the public property +// returns a *ItemReceived_eventsPublicRequestBuilder when successful +func (m *ItemReceived_eventsRequestBuilder) Public()(*ItemReceived_eventsPublicRequestBuilder) { + return NewItemReceived_eventsPublicRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation these are events that you've received by watching repositories and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events. +// returns a *RequestInformation when successful +func (m *ItemReceived_eventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReceived_eventsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemReceived_eventsRequestBuilder when successful +func (m *ItemReceived_eventsRequestBuilder) WithUrl(rawUrl string)(*ItemReceived_eventsRequestBuilder) { + return NewItemReceived_eventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_repos_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_repos_request_builder.go new file mode 100644 index 000000000..27a94a9d4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_repos_request_builder.go @@ -0,0 +1,74 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" + i487dd991a050255d595716157a2da48d14b5f796b611f60abee72f569fd2147b "github.com/octokit/go-sdk/pkg/github/users/item/repos" +) + +// ItemReposRequestBuilder builds and executes requests for operations under \users\{username}\repos +type ItemReposRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemReposRequestBuilderGetQueryParameters lists public repositories for the specified user. +type ItemReposRequestBuilderGetQueryParameters struct { + // The order to sort by. Default: `asc` when using `full_name`, otherwise `desc`. + Direction *i487dd991a050255d595716157a2da48d14b5f796b611f60abee72f569fd2147b.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The property to sort the results by. + Sort *i487dd991a050255d595716157a2da48d14b5f796b611f60abee72f569fd2147b.GetSortQueryParameterType `uriparametername:"sort"` + // Limit results to repositories of the specified type. + Type *i487dd991a050255d595716157a2da48d14b5f796b611f60abee72f569fd2147b.GetTypeQueryParameterType `uriparametername:"type"` +} +// NewItemReposRequestBuilderInternal instantiates a new ItemReposRequestBuilder and sets the default values. +func NewItemReposRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposRequestBuilder) { + m := &ItemReposRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/repos{?direction*,page*,per_page*,sort*,type*}", pathParameters), + } + return m +} +// NewItemReposRequestBuilder instantiates a new ItemReposRequestBuilder and sets the default values. +func NewItemReposRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemReposRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists public repositories for the specified user. +// returns a []MinimalRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user +func (m *ItemReposRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReposRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists public repositories for the specified user. +// returns a *RequestInformation when successful +func (m *ItemReposRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReposRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemReposRequestBuilder when successful +func (m *ItemReposRequestBuilder) WithUrl(rawUrl string)(*ItemReposRequestBuilder) { + return NewItemReposRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_settings_billing_actions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_settings_billing_actions_request_builder.go new file mode 100644 index 000000000..a9119525c --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_settings_billing_actions_request_builder.go @@ -0,0 +1,57 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemSettingsBillingActionsRequestBuilder builds and executes requests for operations under \users\{username}\settings\billing\actions +type ItemSettingsBillingActionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemSettingsBillingActionsRequestBuilderInternal instantiates a new ItemSettingsBillingActionsRequestBuilder and sets the default values. +func NewItemSettingsBillingActionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingActionsRequestBuilder) { + m := &ItemSettingsBillingActionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/settings/billing/actions", pathParameters), + } + return m +} +// NewItemSettingsBillingActionsRequestBuilder instantiates a new ItemSettingsBillingActionsRequestBuilder and sets the default values. +func NewItemSettingsBillingActionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingActionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSettingsBillingActionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the summary of the free and paid GitHub Actions minutes used.Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)".OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a ActionsBillingUsageable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-a-user +func (m *ItemSettingsBillingActionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsBillingUsageable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateActionsBillingUsageFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ActionsBillingUsageable), nil +} +// ToGetRequestInformation gets the summary of the free and paid GitHub Actions minutes used.Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)".OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemSettingsBillingActionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemSettingsBillingActionsRequestBuilder when successful +func (m *ItemSettingsBillingActionsRequestBuilder) WithUrl(rawUrl string)(*ItemSettingsBillingActionsRequestBuilder) { + return NewItemSettingsBillingActionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_settings_billing_packages_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_settings_billing_packages_request_builder.go new file mode 100644 index 000000000..d76cdb5b8 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_settings_billing_packages_request_builder.go @@ -0,0 +1,57 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemSettingsBillingPackagesRequestBuilder builds and executes requests for operations under \users\{username}\settings\billing\packages +type ItemSettingsBillingPackagesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemSettingsBillingPackagesRequestBuilderInternal instantiates a new ItemSettingsBillingPackagesRequestBuilder and sets the default values. +func NewItemSettingsBillingPackagesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingPackagesRequestBuilder) { + m := &ItemSettingsBillingPackagesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/settings/billing/packages", pathParameters), + } + return m +} +// NewItemSettingsBillingPackagesRequestBuilder instantiates a new ItemSettingsBillingPackagesRequestBuilder and sets the default values. +func NewItemSettingsBillingPackagesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingPackagesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSettingsBillingPackagesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the free and paid storage used for GitHub Packages in gigabytes.Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)."OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a PackagesBillingUsageable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-a-user +func (m *ItemSettingsBillingPackagesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackagesBillingUsageable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreatePackagesBillingUsageFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PackagesBillingUsageable), nil +} +// ToGetRequestInformation gets the free and paid storage used for GitHub Packages in gigabytes.Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)."OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemSettingsBillingPackagesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemSettingsBillingPackagesRequestBuilder when successful +func (m *ItemSettingsBillingPackagesRequestBuilder) WithUrl(rawUrl string)(*ItemSettingsBillingPackagesRequestBuilder) { + return NewItemSettingsBillingPackagesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_settings_billing_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_settings_billing_request_builder.go new file mode 100644 index 000000000..f4b8a95e0 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_settings_billing_request_builder.go @@ -0,0 +1,38 @@ +package users + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSettingsBillingRequestBuilder builds and executes requests for operations under \users\{username}\settings\billing +type ItemSettingsBillingRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Actions the actions property +// returns a *ItemSettingsBillingActionsRequestBuilder when successful +func (m *ItemSettingsBillingRequestBuilder) Actions()(*ItemSettingsBillingActionsRequestBuilder) { + return NewItemSettingsBillingActionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemSettingsBillingRequestBuilderInternal instantiates a new ItemSettingsBillingRequestBuilder and sets the default values. +func NewItemSettingsBillingRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingRequestBuilder) { + m := &ItemSettingsBillingRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/settings/billing", pathParameters), + } + return m +} +// NewItemSettingsBillingRequestBuilder instantiates a new ItemSettingsBillingRequestBuilder and sets the default values. +func NewItemSettingsBillingRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSettingsBillingRequestBuilderInternal(urlParams, requestAdapter) +} +// Packages the packages property +// returns a *ItemSettingsBillingPackagesRequestBuilder when successful +func (m *ItemSettingsBillingRequestBuilder) Packages()(*ItemSettingsBillingPackagesRequestBuilder) { + return NewItemSettingsBillingPackagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SharedStorage the sharedStorage property +// returns a *ItemSettingsBillingSharedStorageRequestBuilder when successful +func (m *ItemSettingsBillingRequestBuilder) SharedStorage()(*ItemSettingsBillingSharedStorageRequestBuilder) { + return NewItemSettingsBillingSharedStorageRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_settings_billing_shared_storage_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_settings_billing_shared_storage_request_builder.go new file mode 100644 index 000000000..e59566bd5 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_settings_billing_shared_storage_request_builder.go @@ -0,0 +1,57 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemSettingsBillingSharedStorageRequestBuilder builds and executes requests for operations under \users\{username}\settings\billing\shared-storage +type ItemSettingsBillingSharedStorageRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemSettingsBillingSharedStorageRequestBuilderInternal instantiates a new ItemSettingsBillingSharedStorageRequestBuilder and sets the default values. +func NewItemSettingsBillingSharedStorageRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingSharedStorageRequestBuilder) { + m := &ItemSettingsBillingSharedStorageRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/settings/billing/shared-storage", pathParameters), + } + return m +} +// NewItemSettingsBillingSharedStorageRequestBuilder instantiates a new ItemSettingsBillingSharedStorageRequestBuilder and sets the default values. +func NewItemSettingsBillingSharedStorageRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingSharedStorageRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSettingsBillingSharedStorageRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages.Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)."OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a CombinedBillingUsageable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-a-user +func (m *ItemSettingsBillingSharedStorageRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CombinedBillingUsageable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCombinedBillingUsageFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CombinedBillingUsageable), nil +} +// ToGetRequestInformation gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages.Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)."OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemSettingsBillingSharedStorageRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemSettingsBillingSharedStorageRequestBuilder when successful +func (m *ItemSettingsBillingSharedStorageRequestBuilder) WithUrl(rawUrl string)(*ItemSettingsBillingSharedStorageRequestBuilder) { + return NewItemSettingsBillingSharedStorageRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_settings_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_settings_request_builder.go new file mode 100644 index 000000000..e93e18693 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_settings_request_builder.go @@ -0,0 +1,28 @@ +package users + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSettingsRequestBuilder builds and executes requests for operations under \users\{username}\settings +type ItemSettingsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Billing the billing property +// returns a *ItemSettingsBillingRequestBuilder when successful +func (m *ItemSettingsRequestBuilder) Billing()(*ItemSettingsBillingRequestBuilder) { + return NewItemSettingsBillingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemSettingsRequestBuilderInternal instantiates a new ItemSettingsRequestBuilder and sets the default values. +func NewItemSettingsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsRequestBuilder) { + m := &ItemSettingsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/settings", pathParameters), + } + return m +} +// NewItemSettingsRequestBuilder instantiates a new ItemSettingsRequestBuilder and sets the default values. +func NewItemSettingsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSettingsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_social_accounts_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_social_accounts_request_builder.go new file mode 100644 index 000000000..4a0cca7fb --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_social_accounts_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemSocial_accountsRequestBuilder builds and executes requests for operations under \users\{username}\social_accounts +type ItemSocial_accountsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemSocial_accountsRequestBuilderGetQueryParameters lists social media accounts for a user. This endpoint is accessible by anyone. +type ItemSocial_accountsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemSocial_accountsRequestBuilderInternal instantiates a new ItemSocial_accountsRequestBuilder and sets the default values. +func NewItemSocial_accountsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSocial_accountsRequestBuilder) { + m := &ItemSocial_accountsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/social_accounts{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemSocial_accountsRequestBuilder instantiates a new ItemSocial_accountsRequestBuilder and sets the default values. +func NewItemSocial_accountsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSocial_accountsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSocial_accountsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists social media accounts for a user. This endpoint is accessible by anyone. +// returns a []SocialAccountable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user +func (m *ItemSocial_accountsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSocial_accountsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SocialAccountable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSocialAccountFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SocialAccountable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SocialAccountable) + } + } + return val, nil +} +// ToGetRequestInformation lists social media accounts for a user. This endpoint is accessible by anyone. +// returns a *RequestInformation when successful +func (m *ItemSocial_accountsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSocial_accountsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemSocial_accountsRequestBuilder when successful +func (m *ItemSocial_accountsRequestBuilder) WithUrl(rawUrl string)(*ItemSocial_accountsRequestBuilder) { + return NewItemSocial_accountsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_ssh_signing_keys_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_ssh_signing_keys_request_builder.go new file mode 100644 index 000000000..8a34d6bc2 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_ssh_signing_keys_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemSsh_signing_keysRequestBuilder builds and executes requests for operations under \users\{username}\ssh_signing_keys +type ItemSsh_signing_keysRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemSsh_signing_keysRequestBuilderGetQueryParameters lists the SSH signing keys for a user. This operation is accessible by anyone. +type ItemSsh_signing_keysRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemSsh_signing_keysRequestBuilderInternal instantiates a new ItemSsh_signing_keysRequestBuilder and sets the default values. +func NewItemSsh_signing_keysRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSsh_signing_keysRequestBuilder) { + m := &ItemSsh_signing_keysRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/ssh_signing_keys{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemSsh_signing_keysRequestBuilder instantiates a new ItemSsh_signing_keysRequestBuilder and sets the default values. +func NewItemSsh_signing_keysRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSsh_signing_keysRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSsh_signing_keysRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the SSH signing keys for a user. This operation is accessible by anyone. +// returns a []SshSigningKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user +func (m *ItemSsh_signing_keysRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSsh_signing_keysRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SshSigningKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSshSigningKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SshSigningKeyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SshSigningKeyable) + } + } + return val, nil +} +// ToGetRequestInformation lists the SSH signing keys for a user. This operation is accessible by anyone. +// returns a *RequestInformation when successful +func (m *ItemSsh_signing_keysRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSsh_signing_keysRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemSsh_signing_keysRequestBuilder when successful +func (m *ItemSsh_signing_keysRequestBuilder) WithUrl(rawUrl string)(*ItemSsh_signing_keysRequestBuilder) { + return NewItemSsh_signing_keysRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_starred_repository.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_starred_repository.go new file mode 100644 index 000000000..4bb848401 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_starred_repository.go @@ -0,0 +1,51 @@ +package users + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemStarredRepository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemStarredRepository instantiates a new ItemStarredRepository and sets the default values. +func NewItemStarredRepository()(*ItemStarredRepository) { + m := &ItemStarredRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemStarredRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemStarredRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemStarredRepository(), 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 *ItemStarredRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemStarredRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemStarredRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemStarredRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemStarredRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_starred_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_starred_request_builder.go new file mode 100644 index 000000000..2011bea94 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_starred_request_builder.go @@ -0,0 +1,175 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i79bee196f908e2ec3c0a95608a335c04823e48e52984cbf48aa57b354fe8088c "github.com/octokit/go-sdk/pkg/github/users/item/starred" +) + +// ItemStarredRequestBuilder builds and executes requests for operations under \users\{username}\starred +type ItemStarredRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemStarredRequestBuilderGetQueryParameters lists repositories a user has starred.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +type ItemStarredRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i79bee196f908e2ec3c0a95608a335c04823e48e52984cbf48aa57b354fe8088c.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The property to sort the results by. `created` means when the repository was starred. `updated` means when the repository was last pushed to. + Sort *i79bee196f908e2ec3c0a95608a335c04823e48e52984cbf48aa57b354fe8088c.GetSortQueryParameterType `uriparametername:"sort"` +} +// StarredGetResponse composed type wrapper for classes []ItemStarredRepositoryable, []ItemStarredRepositoryable +type StarredGetResponse struct { + // Composed type representation for type []ItemStarredRepositoryable + itemStarredRepository []ItemStarredRepositoryable + // Composed type representation for type []ItemStarredRepositoryable + starredGetResponseItemStarredRepository []ItemStarredRepositoryable +} +// NewStarredGetResponse instantiates a new StarredGetResponse and sets the default values. +func NewStarredGetResponse()(*StarredGetResponse) { + m := &StarredGetResponse{ + } + return m +} +// CreateStarredGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateStarredGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewStarredGetResponse() + if parseNode != nil { + if val, err := parseNode.GetCollectionOfObjectValues(CreateItemStarredRepositoryFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]ItemStarredRepositoryable, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(ItemStarredRepositoryable) + } + } + result.SetItemStarredRepository(cast) + } else if val, err := parseNode.GetCollectionOfObjectValues(CreateItemStarredRepositoryFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]ItemStarredRepositoryable, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(ItemStarredRepositoryable) + } + } + result.SetStarredGetResponseItemStarredRepository(cast) + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *StarredGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *StarredGetResponse) GetIsComposedType()(bool) { + return true +} +// GetItemStarredRepository gets the ItemStarredRepository property value. Composed type representation for type []ItemStarredRepositoryable +// returns a []ItemStarredRepositoryable when successful +func (m *StarredGetResponse) GetItemStarredRepository()([]ItemStarredRepositoryable) { + return m.itemStarredRepository +} +// GetStarredGetResponseItemStarredRepository gets the ItemStarredRepository property value. Composed type representation for type []ItemStarredRepositoryable +// returns a []ItemStarredRepositoryable when successful +func (m *StarredGetResponse) GetStarredGetResponseItemStarredRepository()([]ItemStarredRepositoryable) { + return m.starredGetResponseItemStarredRepository +} +// Serialize serializes information the current object +func (m *StarredGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemStarredRepository() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItemStarredRepository())) + for i, v := range m.GetItemStarredRepository() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } else if m.GetStarredGetResponseItemStarredRepository() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetStarredGetResponseItemStarredRepository())) + for i, v := range m.GetStarredGetResponseItemStarredRepository() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } + return nil +} +// SetItemStarredRepository sets the ItemStarredRepository property value. Composed type representation for type []ItemStarredRepositoryable +func (m *StarredGetResponse) SetItemStarredRepository(value []ItemStarredRepositoryable)() { + m.itemStarredRepository = value +} +// SetStarredGetResponseItemStarredRepository sets the ItemStarredRepository property value. Composed type representation for type []ItemStarredRepositoryable +func (m *StarredGetResponse) SetStarredGetResponseItemStarredRepository(value []ItemStarredRepositoryable)() { + m.starredGetResponseItemStarredRepository = value +} +type StarredGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemStarredRepository()([]ItemStarredRepositoryable) + GetStarredGetResponseItemStarredRepository()([]ItemStarredRepositoryable) + SetItemStarredRepository(value []ItemStarredRepositoryable)() + SetStarredGetResponseItemStarredRepository(value []ItemStarredRepositoryable)() +} +// NewItemStarredRequestBuilderInternal instantiates a new ItemStarredRequestBuilder and sets the default values. +func NewItemStarredRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemStarredRequestBuilder) { + m := &ItemStarredRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/starred{?direction*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewItemStarredRequestBuilder instantiates a new ItemStarredRequestBuilder and sets the default values. +func NewItemStarredRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemStarredRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemStarredRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists repositories a user has starred.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +// returns a StarredGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user +func (m *ItemStarredRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemStarredRequestBuilderGetQueryParameters])(StarredGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateStarredGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(StarredGetResponseable), nil +} +// ToGetRequestInformation lists repositories a user has starred.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +// returns a *RequestInformation when successful +func (m *ItemStarredRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemStarredRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemStarredRequestBuilder when successful +func (m *ItemStarredRequestBuilder) WithUrl(rawUrl string)(*ItemStarredRequestBuilder) { + return NewItemStarredRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/item_subscriptions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_subscriptions_request_builder.go new file mode 100644 index 000000000..728d17399 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/item_subscriptions_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemSubscriptionsRequestBuilder builds and executes requests for operations under \users\{username}\subscriptions +type ItemSubscriptionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemSubscriptionsRequestBuilderGetQueryParameters lists repositories a user is watching. +type ItemSubscriptionsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemSubscriptionsRequestBuilderInternal instantiates a new ItemSubscriptionsRequestBuilder and sets the default values. +func NewItemSubscriptionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSubscriptionsRequestBuilder) { + m := &ItemSubscriptionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/subscriptions{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemSubscriptionsRequestBuilder instantiates a new ItemSubscriptionsRequestBuilder and sets the default values. +func NewItemSubscriptionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSubscriptionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSubscriptionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists repositories a user is watching. +// returns a []MinimalRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user +func (m *ItemSubscriptionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSubscriptionsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateMinimalRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists repositories a user is watching. +// returns a *RequestInformation when successful +func (m *ItemSubscriptionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSubscriptionsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemSubscriptionsRequestBuilder when successful +func (m *ItemSubscriptionsRequestBuilder) WithUrl(rawUrl string)(*ItemSubscriptionsRequestBuilder) { + return NewItemSubscriptionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/users_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/users_request_builder.go new file mode 100644 index 000000000..664edab2e --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/users_request_builder.go @@ -0,0 +1,79 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// UsersRequestBuilder builds and executes requests for operations under \users +type UsersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// UsersRequestBuilderGetQueryParameters lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts.Note: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of users. +type UsersRequestBuilderGetQueryParameters struct { + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // A user ID. Only return users with an ID greater than this ID. + Since *int32 `uriparametername:"since"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk/pkg/github.users.item collection +// returns a *WithUsernameItemRequestBuilder when successful +func (m *UsersRequestBuilder) ByUsername(username string)(*WithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewUsersRequestBuilderInternal instantiates a new UsersRequestBuilder and sets the default values. +func NewUsersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UsersRequestBuilder) { + m := &UsersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users{?per_page*,since*}", pathParameters), + } + return m +} +// NewUsersRequestBuilder instantiates a new UsersRequestBuilder and sets the default values. +func NewUsersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UsersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewUsersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts.Note: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of users. +// returns a []SimpleUserable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/users/users#list-users +func (m *UsersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[UsersRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSimpleUserFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts.Note: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of users. +// returns a *RequestInformation when successful +func (m *UsersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[UsersRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *UsersRequestBuilder when successful +func (m *UsersRequestBuilder) WithUrl(rawUrl string)(*UsersRequestBuilder) { + return NewUsersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/users/with_username_item_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/users/with_username_item_request_builder.go new file mode 100644 index 000000000..55cad4fad --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/users/with_username_item_request_builder.go @@ -0,0 +1,245 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// WithUsernameItemRequestBuilder builds and executes requests for operations under \users\{username} +type WithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// WithUsernameGetResponse composed type wrapper for classes i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable +type WithUsernameGetResponse struct { + // Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable + privateUser i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable + // Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable + publicUser i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable +} +// NewWithUsernameGetResponse instantiates a new WithUsernameGetResponse and sets the default values. +func NewWithUsernameGetResponse()(*WithUsernameGetResponse) { + m := &WithUsernameGetResponse{ + } + return m +} +// CreateWithUsernameGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWithUsernameGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewWithUsernameGetResponse() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WithUsernameGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *WithUsernameGetResponse) GetIsComposedType()(bool) { + return true +} +// GetPrivateUser gets the privateUser property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable +// returns a PrivateUserable when successful +func (m *WithUsernameGetResponse) GetPrivateUser()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable) { + return m.privateUser +} +// GetPublicUser gets the publicUser property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable +// returns a PublicUserable when successful +func (m *WithUsernameGetResponse) GetPublicUser()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable) { + return m.publicUser +} +// Serialize serializes information the current object +func (m *WithUsernameGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetPrivateUser() != nil { + err := writer.WriteObjectValue("", m.GetPrivateUser()) + if err != nil { + return err + } + } else if m.GetPublicUser() != nil { + err := writer.WriteObjectValue("", m.GetPublicUser()) + if err != nil { + return err + } + } + return nil +} +// SetPrivateUser sets the privateUser property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable +func (m *WithUsernameGetResponse) SetPrivateUser(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable)() { + m.privateUser = value +} +// SetPublicUser sets the publicUser property value. Composed type representation for type i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable +func (m *WithUsernameGetResponse) SetPublicUser(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable)() { + m.publicUser = value +} +type WithUsernameGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPrivateUser()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable) + GetPublicUser()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable) + SetPrivateUser(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PrivateUserable)() + SetPublicUser(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.PublicUserable)() +} +// Attestations the attestations property +// returns a *ItemAttestationsRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Attestations()(*ItemAttestationsRequestBuilder) { + return NewItemAttestationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewWithUsernameItemRequestBuilderInternal instantiates a new WithUsernameItemRequestBuilder and sets the default values. +func NewWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithUsernameItemRequestBuilder) { + m := &WithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}", pathParameters), + } + return m +} +// NewWithUsernameItemRequestBuilder instantiates a new WithUsernameItemRequestBuilder and sets the default values. +func NewWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Docker the docker property +// returns a *ItemDockerRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Docker()(*ItemDockerRequestBuilder) { + return NewItemDockerRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Events the events property +// returns a *ItemEventsRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Events()(*ItemEventsRequestBuilder) { + return NewItemEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Followers the followers property +// returns a *ItemFollowersRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Followers()(*ItemFollowersRequestBuilder) { + return NewItemFollowersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Following the following property +// returns a *ItemFollowingRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Following()(*ItemFollowingRequestBuilder) { + return NewItemFollowingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get provides publicly available information about someone with a GitHub account.The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication).The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/users/emails)". +// returns a WithUsernameGetResponseable 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/users/users#get-a-user +func (m *WithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(WithUsernameGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateWithUsernameGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(WithUsernameGetResponseable), nil +} +// Gists the gists property +// returns a *ItemGistsRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Gists()(*ItemGistsRequestBuilder) { + return NewItemGistsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Gpg_keys the gpg_keys property +// returns a *ItemGpg_keysRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Gpg_keys()(*ItemGpg_keysRequestBuilder) { + return NewItemGpg_keysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Hovercard the hovercard property +// returns a *ItemHovercardRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Hovercard()(*ItemHovercardRequestBuilder) { + return NewItemHovercardRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Installation the installation property +// returns a *ItemInstallationRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Installation()(*ItemInstallationRequestBuilder) { + return NewItemInstallationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Keys the keys property +// returns a *ItemKeysRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Keys()(*ItemKeysRequestBuilder) { + return NewItemKeysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Orgs the orgs property +// returns a *ItemOrgsRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Orgs()(*ItemOrgsRequestBuilder) { + return NewItemOrgsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Packages the packages property +// returns a *ItemPackagesRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Packages()(*ItemPackagesRequestBuilder) { + return NewItemPackagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Projects the projects property +// returns a *ItemProjectsRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Projects()(*ItemProjectsRequestBuilder) { + return NewItemProjectsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Received_events the received_events property +// returns a *ItemReceived_eventsRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Received_events()(*ItemReceived_eventsRequestBuilder) { + return NewItemReceived_eventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repos the repos property +// returns a *ItemReposRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Repos()(*ItemReposRequestBuilder) { + return NewItemReposRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Settings the settings property +// returns a *ItemSettingsRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Settings()(*ItemSettingsRequestBuilder) { + return NewItemSettingsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Social_accounts the social_accounts property +// returns a *ItemSocial_accountsRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Social_accounts()(*ItemSocial_accountsRequestBuilder) { + return NewItemSocial_accountsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Ssh_signing_keys the ssh_signing_keys property +// returns a *ItemSsh_signing_keysRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Ssh_signing_keys()(*ItemSsh_signing_keysRequestBuilder) { + return NewItemSsh_signing_keysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Starred the starred property +// returns a *ItemStarredRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Starred()(*ItemStarredRequestBuilder) { + return NewItemStarredRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Subscriptions the subscriptions property +// returns a *ItemSubscriptionsRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Subscriptions()(*ItemSubscriptionsRequestBuilder) { + return NewItemSubscriptionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation provides publicly available information about someone with a GitHub account.The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication).The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/users/emails)". +// returns a *RequestInformation when successful +func (m *WithUsernameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *WithUsernameItemRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*WithUsernameItemRequestBuilder) { + return NewWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/versions/versions_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/versions/versions_request_builder.go new file mode 100644 index 000000000..dc93191d4 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/versions/versions_request_builder.go @@ -0,0 +1,65 @@ +package versions + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// VersionsRequestBuilder builds and executes requests for operations under \versions +type VersionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewVersionsRequestBuilderInternal instantiates a new VersionsRequestBuilder and sets the default values. +func NewVersionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*VersionsRequestBuilder) { + m := &VersionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/versions", pathParameters), + } + return m +} +// NewVersionsRequestBuilder instantiates a new VersionsRequestBuilder and sets the default values. +func NewVersionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*VersionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewVersionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get all supported GitHub API versions. +// returns a []DateOnly 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/meta/meta#get-all-api-versions +func (m *VersionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitiveCollection(ctx, requestInfo, "dateonly", errorMapping) + if err != nil { + return nil, err + } + val := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly, len(res)) + for i, v := range res { + if v != nil { + val[i] = *(v.(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly)) + } + } + return val, nil +} +// ToGetRequestInformation get all supported GitHub API versions. +// returns a *RequestInformation when successful +func (m *VersionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *VersionsRequestBuilder when successful +func (m *VersionsRequestBuilder) WithUrl(rawUrl string)(*VersionsRequestBuilder) { + return NewVersionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/github/zen/zen_request_builder.go b/vendor/github.com/octokit/go-sdk/pkg/github/zen/zen_request_builder.go new file mode 100644 index 000000000..a9a08bdff --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/github/zen/zen_request_builder.go @@ -0,0 +1,56 @@ +package zen + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ZenRequestBuilder builds and executes requests for operations under \zen +type ZenRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewZenRequestBuilderInternal instantiates a new ZenRequestBuilder and sets the default values. +func NewZenRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ZenRequestBuilder) { + m := &ZenRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/zen", pathParameters), + } + return m +} +// NewZenRequestBuilder instantiates a new ZenRequestBuilder and sets the default values. +func NewZenRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ZenRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewZenRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get a random sentence from the Zen of GitHub +// returns a *string when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/meta/meta#get-the-zen-of-github +func (m *ZenRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*string, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "string", nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*string), nil +} +// ToGetRequestInformation get a random sentence from the Zen of GitHub +// returns a *RequestInformation when successful +func (m *ZenRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ZenRequestBuilder when successful +func (m *ZenRequestBuilder) WithUrl(rawUrl string)(*ZenRequestBuilder) { + return NewZenRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/handlers/rate_limit_handler.go b/vendor/github.com/octokit/go-sdk/pkg/handlers/rate_limit_handler.go new file mode 100644 index 000000000..436489b33 --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/handlers/rate_limit_handler.go @@ -0,0 +1,177 @@ +package handlers + +import ( + "context" + "fmt" + "log" + netHttp "net/http" + "strconv" + "time" + + abs "github.com/microsoft/kiota-abstractions-go" + kiotaHttp "github.com/microsoft/kiota-http-go" + "github.com/octokit/go-sdk/pkg/headers" +) + +// RateLimitHandler is a middleware that detects primary and secondary rate +// limits and retries requests after the appropriate time when necessary. +type RateLimitHandler struct { + options RateLimitHandlerOptions +} + +// RateLimitHandlerOptions is a struct that holds options for the RateLimitHandler. +// In the future, this could hold different strategies for handling rate limits: +// e.g. exponential backoff, jitter, throttling, etc. +type RateLimitHandlerOptions struct{} + +// rateLimitHandlerOptions (lowercase, private) that RateLimitHandlerOptions +// (uppercase, public) implements. +type rateLimitHandlerOptions interface { + abs.RequestOption + IsRateLimited() func(req *netHttp.Request, res *netHttp.Response) RateLimitType +} + +// RateLimitType is an enum that represents either None, Primary, +// or Secondary rate limiting +type RateLimitType int + +const ( + None RateLimitType = iota + Primary + Secondary +) + +var rateLimitKeyValue = abs.RequestOptionKey{ + Key: "RateLimitHandler", +} + +// GetKey returns the unique RateLimitHandler key, used by Kiota to store +// request options. +func (options *RateLimitHandlerOptions) GetKey() abs.RequestOptionKey { + return rateLimitKeyValue +} + +// IsRateLimited returns a function that determines if an HTTP response was +// rate-limited, and if so, what type of rate limit was hit. +func (options *RateLimitHandlerOptions) IsRateLimited() func(req *netHttp.Request, resp *netHttp.Response) RateLimitType { + return func(req *netHttp.Request, resp *netHttp.Response) RateLimitType { + if resp.StatusCode != 429 && resp.StatusCode != 403 { + return None + } + + if resp.Header.Get(headers.RetryAfterKey) != "" { + return Secondary // secondary rate limits are abuse limits + } + + if resp.Header.Get(headers.XRateLimitRemainingKey) == "0" { + return Primary + } + + return None + } +} + +// NewRateLimitHandler creates a new RateLimitHandler with default options. +func NewRateLimitHandler() *RateLimitHandler { + return &RateLimitHandler{} +} + +// Intercept tries a request. If the response shows it was rate-limited, it +// retries the request after the appropriate period of time. +func (handler RateLimitHandler) Intercept(pipeline kiotaHttp.Pipeline, middlewareIndex int, request *netHttp.Request) (*netHttp.Response, error) { + resp, err := pipeline.Next(request, middlewareIndex) + if err != nil { + return resp, err + } + + rateLimit := handler.options.IsRateLimited()(request, resp) + + if rateLimit == Primary || rateLimit == Secondary { + reqOption, ok := request.Context().Value(rateLimitKeyValue).(rateLimitHandlerOptions) + if !ok { + reqOption = &handler.options + } + return handler.retryRequest(request.Context(), pipeline, middlewareIndex, reqOption, rateLimit, request, resp) + } + return resp, nil +} + +// retryRequest retries a request if it has been rate-limited. +func (handler RateLimitHandler) retryRequest(ctx context.Context, pipeline kiotaHttp.Pipeline, middlewareIndex int, + options rateLimitHandlerOptions, rateLimitType RateLimitType, request *netHttp.Request, resp *netHttp.Response) (*netHttp.Response, error) { + + if rateLimitType == Secondary || rateLimitType == Primary { + retryAfterDuration, err := parseRateLimit(resp) + if err != nil { + return nil, fmt.Errorf("failed to parse retry-after header into duration: %v", err) + } + if *retryAfterDuration < 0 { + log.Printf("retry-after duration is negative: %s; sleeping until next request will be a no-op", *retryAfterDuration) + } + if rateLimitType == Secondary { + log.Printf("Abuse detection mechanism (secondary rate limit) triggered, sleeping for %s before retrying\n", *retryAfterDuration) + } else if rateLimitType == Primary { + log.Printf("Primary rate limit (reset: %s) reached, sleeping for %s before retrying\n", resp.Header.Get(headers.XRateLimitResetKey), *retryAfterDuration) + log.Printf("Rate limit information: %s: %s, %s: %s, %s: %s\n", headers.XRateLimitLimitKey, resp.Header.Get(headers.XRateLimitLimitKey), headers.XRateLimitUsedKey, resp.Header.Get(headers.XRateLimitUsedKey), headers.XRateLimitResourceKey, resp.Header.Get(headers.XRateLimitResourceKey)) + } + time.Sleep(*retryAfterDuration) + log.Printf("Retrying request after rate limit sleep\n") + return handler.Intercept(pipeline, middlewareIndex, request) + } + + return handler.retryRequest(ctx, pipeline, middlewareIndex, options, rateLimitType, request, resp) +} + +// parseRateLimit parses rate-limit related headers and returns an appropriate +// time.Duration to retry the request after based on the header information. +// Much of this code was taken from the google/go-github library: +// see https://github.com/google/go-github/blob/0e3ab5807f0e9bc6ea690f1b49e94b78259f3681/github/github.go +// Note that "Retry-After" headers correspond to secondary rate limits and +// "x-ratelimit-reset" headers to primary rate limits. +// Docs for rate limit headers: +// https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#handle-rate-limit-errors-appropriately +func parseRateLimit(r *netHttp.Response) (*time.Duration, error) { + + // "If the retry-after response header is present, you should not retry + // your request until after that many seconds has elapsed." + // (see docs link above) + if v := r.Header.Get(headers.RetryAfterKey); v != "" { + return parseRetryAfter(v) + } + + // "If the x-ratelimit-remaining header is 0, you should not make another + // request until after the time specified by the x-ratelimit-reset + // header. The x-ratelimit-reset header is in UTC epoch seconds."" + // (see docs link above) + if v := r.Header.Get(headers.XRateLimitResetKey); v != "" { + return parseXRateLimitReset(v) + } + + return nil, nil +} + +// parseRetryAfter parses the "Retry-After" header used for secondary +// rate limits. +func parseRetryAfter(retryAfterValue string) (*time.Duration, error) { + if retryAfterValue == "" { + return nil, fmt.Errorf("could not parse emtpy RetryAfter string") + } + + retryAfterSeconds, err := strconv.ParseInt(retryAfterValue, 10, 64) + if err != nil { + return nil, fmt.Errorf("failed to parse retry-after header into duration: %v", err) + } + retryAfter := time.Duration(retryAfterSeconds) * time.Second + return &retryAfter, nil +} + +// parseXRateLimitReset parses the "x-ratelimit-reset" header used for primary +// rate limits +func parseXRateLimitReset(rateLimitResetValue string) (*time.Duration, error) { + secondsSinceEpoch, err := strconv.ParseInt(rateLimitResetValue, 10, 64) + if err != nil { + return nil, fmt.Errorf("failed to parse x-ratelimit-reset header into duration: %v", err) + } + retryAfter := time.Until(time.Unix(secondsSinceEpoch, 0)) + return &retryAfter, nil +} diff --git a/vendor/github.com/octokit/go-sdk/pkg/headers/header_contents.go b/vendor/github.com/octokit/go-sdk/pkg/headers/header_contents.go new file mode 100644 index 000000000..53d7f3dec --- /dev/null +++ b/vendor/github.com/octokit/go-sdk/pkg/headers/header_contents.go @@ -0,0 +1,23 @@ +package headers + +const AuthorizationKey = "Authorization" +const AuthType = "bearer" +const UserAgentKey = "User-Agent" + +// TODO(kfcampbell): get the version and binary name from build settings rather than hard-coding +const UserAgentValue = "go-sdk@v0.0.0" + +const APIVersionKey = "X-GitHub-Api-Version" + +// TODO(kfcampbell): get the version from the generated code somehow +const APIVersionValue = "2022-11-28" + +// documentation on rate limit headers is available here: +// https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#checking-the-status-of-your-rate-limit +const XRateLimitRemainingKey = "X-Ratelimit-Remaining" +const XRateLimitResetKey = "X-Ratelimit-Reset" +const RetryAfterKey = "Retry-After" + +const XRateLimitLimitKey = "X-Ratelimit-Limit" +const XRateLimitUsedKey = "X-Ratelimit-Used" +const XRateLimitResourceKey = "X-Ratelimit-Resource" diff --git a/vendor/github.com/std-uritemplate/std-uritemplate/go/.gitignore b/vendor/github.com/std-uritemplate/std-uritemplate/go/.gitignore new file mode 100644 index 000000000..1d4361da8 --- /dev/null +++ b/vendor/github.com/std-uritemplate/std-uritemplate/go/.gitignore @@ -0,0 +1,3 @@ +test/stduritemplate +test/go.mod +test/go.sum diff --git a/vendor/github.com/std-uritemplate/std-uritemplate/go/.golangci.yml b/vendor/github.com/std-uritemplate/std-uritemplate/go/.golangci.yml new file mode 100644 index 000000000..e0af5b34b --- /dev/null +++ b/vendor/github.com/std-uritemplate/std-uritemplate/go/.golangci.yml @@ -0,0 +1,70 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +linters-settings: + lll: + line-length: 170 + goconst: + ignore-tests: true +linters: + enable-all: true + disable: + - forcetypeassert + - cyclop + - dupl + - exhaustive + - exhaustivestruct + - exhaustruct + - forbidigo + - funlen + - gci + - gochecknoglobals + - gochecknoinits + - gocognit + - goconst + - gocyclo + - godox + - goerr113 + - gofumpt + - golint + - gomnd + - gomoddirectives + - interfacer + - ireturn + - lll + - maligned + - nakedret + - nestif + - nilnil + - nlreturn + - nosnakecase + - paralleltest + - rowserrcheck + - scopelint + - structcheck + - sqlclosecheck + - tagliatelle + - tenv + - testpackage + - varnamelen + - wastedassign + - whitespace + - wrapcheck + - wsl + - varcheck + - deadcode + - ifshort diff --git a/vendor/github.com/std-uritemplate/std-uritemplate/go/LICENSE b/vendor/github.com/std-uritemplate/std-uritemplate/go/LICENSE new file mode 100644 index 000000000..a8117d072 --- /dev/null +++ b/vendor/github.com/std-uritemplate/std-uritemplate/go/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2022 Red Hat + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/std-uritemplate/std-uritemplate/go/init.sh b/vendor/github.com/std-uritemplate/std-uritemplate/go/init.sh new file mode 100644 index 000000000..510d12403 --- /dev/null +++ b/vendor/github.com/std-uritemplate/std-uritemplate/go/init.sh @@ -0,0 +1,13 @@ +#! /bin/bash + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +# This is intended to be a customizable entrypoint for each language, it has to be generic enough +( + cd ${SCRIPT_DIR}/test && \ + rm -f go.mod stduritemplate && \ + go mod init stduritemplate && \ + go mod edit -replace github.com/std-uritemplate/std-uritemplate/go=../ && \ + go mod tidy && \ + go build +) diff --git a/vendor/github.com/std-uritemplate/std-uritemplate/go/stduritemplate.go b/vendor/github.com/std-uritemplate/std-uritemplate/go/stduritemplate.go new file mode 100644 index 000000000..68ed6b305 --- /dev/null +++ b/vendor/github.com/std-uritemplate/std-uritemplate/go/stduritemplate.go @@ -0,0 +1,732 @@ +package stduritemplate + +import ( + "fmt" + "net/url" + "sort" + "strconv" + "strings" + "time" + "unicode/utf8" +) + +type Substitutions map[string]any + +// Public API +func Expand(template string, substitutions Substitutions) (string, error) { + return expandImpl(template, substitutions) +} + +// Private implementation +type Op rune + +const ( + OpUndefined Op = 0 + OpNone Op = -1 + OpPlus Op = '+' + OpHash Op = '#' + OpDot Op = '.' + OpSlash Op = '/' + OpSemicolon Op = ';' + OpQuestionMark Op = '?' + OpAmp Op = '&' +) + +const ( + SubstitutionTypeEmpty = "EMPTY" + SubstitutionTypeString = "STRING" + SubstitutionTypeList = "LIST" + SubstitutionTypeMap = "MAP" +) + +func validateLiteral(c rune, col int) error { + switch c { + case '+', '#', '/', ';', '?', '&', ' ', '!', '=', '$', '|', '*', ':', '~', '-': + return fmt.Errorf("illegal character identified in the token at col: %d", col) + default: + return nil + } +} + +func getMaxChar(buffer *strings.Builder, col int) (int, error) { + if buffer == nil || buffer.Len() == 0 { + return -1, nil + } + value := buffer.String() + + if value == "" { + return -1, nil + } + + maxChar, err := strconv.Atoi(value) + if err != nil { + return 0, fmt.Errorf("cannot parse max chars at col: %d", col) + } + return maxChar, nil +} + +func getOperator(c rune, token *strings.Builder, col int) (Op, error) { + switch c { + case '+': + return OpPlus, nil + case '#': + return OpHash, nil + case '.': + return OpDot, nil + case '/': + return OpSlash, nil + case ';': + return OpSemicolon, nil + case '?': + return OpQuestionMark, nil + case '&': + return OpAmp, nil + default: + err := validateLiteral(c, col) + if err != nil { + return OpUndefined, err + } + token.WriteRune(c) + return OpNone, nil + } +} + +func expandImpl(str string, substitutions Substitutions) (string, error) { + var result strings.Builder + + var token = &strings.Builder{} + var toToken = false + var operator = OpUndefined + var composite bool + var maxCharBuffer = &strings.Builder{} + var toMaxCharBuffer = false + var firstToken = true + + for i, character := range str { + switch character { + case '{': + toToken = true + token.Reset() + firstToken = true + case '}': + if toToken { + maxChar, err := getMaxChar(maxCharBuffer, i) + if err != nil { + return "", err + } + expanded, err := expandToken(operator, token.String(), composite, maxChar, firstToken, substitutions, &result, i) + if err != nil { + return "", err + } + if expanded && firstToken { + firstToken = false + } + toToken = false + token.Reset() + operator = OpUndefined + composite = false + toMaxCharBuffer = false + maxCharBuffer.Reset() + } else { + return "", fmt.Errorf("failed to expand token, invalid at col: %d", i) + } + case ',': + if toToken { + maxChar, err := getMaxChar(maxCharBuffer, i) + if err != nil { + return "", err + } + expanded, err := expandToken(operator, token.String(), composite, maxChar, firstToken, substitutions, &result, i) + if err != nil { + return "", err + } + if expanded && firstToken { + firstToken = false + } + token.Reset() + composite = false + toMaxCharBuffer = false + maxCharBuffer.Reset() + break + } + // Intentional fall-through for commas outside the {} + fallthrough + default: + if toToken { + switch { + case operator == OpUndefined: + var err error + operator, err = getOperator(character, token, i) + if err != nil { + return "", err + } + case toMaxCharBuffer: + if _, err := strconv.Atoi(string(character)); err == nil { + maxCharBuffer.WriteRune(character) + } else { + return "", fmt.Errorf("illegal character identified in the token at col: %d", i) + } + default: + switch character { + case ':': + toMaxCharBuffer = true + maxCharBuffer.Reset() + case '*': + composite = true + default: + if err := validateLiteral(character, i); err != nil { + return "", err + } + token.WriteRune(character) + } + } + } else { + result.WriteRune(character) + } + } + } + + if !toToken { + return result.String(), nil + } + + return "", fmt.Errorf("unterminated token") +} + +func addPrefix(op Op, result *strings.Builder) { + switch op { + case OpHash, OpDot, OpSlash, OpSemicolon, OpQuestionMark, OpAmp: + result.WriteRune(rune(op)) + default: + return + } +} + +func addSeparator(op Op, result *strings.Builder) { + switch op { + case OpDot, OpSlash, OpSemicolon: + result.WriteRune(rune(op)) + case OpQuestionMark, OpAmp: + result.WriteByte('&') + default: + result.WriteByte(',') + return + } +} + +func addValue(op Op, token string, value string, result *strings.Builder, maxChar int) { + switch op { + case OpPlus, OpHash: + addExpandedValue("", value, result, maxChar, false) + case OpQuestionMark, OpAmp: + result.WriteString(token + "=") + addExpandedValue("", value, result, maxChar, true) + case OpSemicolon: + result.WriteString(token) + if value != "" { + result.WriteByte('=') + } + addExpandedValue("", value, result, maxChar, true) + case OpDot, OpSlash, OpNone: + addExpandedValue("", value, result, maxChar, true) + } +} + +func addValueElement(op Op, _, value string, result *strings.Builder, maxChar int) { + switch op { + case OpPlus, OpHash: + addExpandedValue("", value, result, maxChar, false) + case OpQuestionMark, OpAmp, OpSemicolon, OpDot, OpSlash, OpNone: + addExpandedValue("", value, result, maxChar, true) + } +} + +func isSurrogate(str string) bool { + _, width := utf8.DecodeRuneInString(str) + return width > 1 +} + +func isIprivate(cp rune) bool { + return 0xE000 <= cp && cp <= 0xF8FF +} + +func isUcschar(cp rune) bool { + return (0xA0 <= cp && cp <= 0xD7FF) || + (0xF900 <= cp && cp <= 0xFDCF) || + (0xFDF0 <= cp && cp <= 0xFFEF) +} + +func addExpandedValue(prefix string, value string, result *strings.Builder, maxChar int, replaceReserved bool) { + max := maxChar + if maxChar == -1 || maxChar > len(value) { + max = len(value) + } + reservedBuffer := &strings.Builder{} + toReserved := false + + if max > 0 && prefix != "" { + result.WriteString(prefix) + } + + for i, character := range value { + if i >= max { + break + } + + if character == '%' && !replaceReserved { + reservedBuffer.Reset() + toReserved = true + } + + toAppend := string(character) + if isSurrogate(toAppend) || replaceReserved || isUcschar(character) || isIprivate(character) { + toAppend = url.QueryEscape(toAppend) + } + + if toReserved { + reservedBuffer.WriteString(toAppend) + + if reservedBuffer.Len() == 3 { + encoded := true + reserved := reservedBuffer.String() + unescaped, err := url.QueryUnescape(reserved) + if err != nil { + encoded = (reserved == unescaped) + } + + if encoded { + result.WriteString(reserved) + } else { + result.WriteString("%25") + // only if !replaceReserved + result.WriteString(reservedBuffer.String()[1:]) + } + reservedBuffer.Reset() + toReserved = false + } + } else { + switch character { + case ' ': + result.WriteString("%20") + case '%': + result.WriteString("%25") + default: + result.WriteString(toAppend) + } + } + } + + if toReserved { + result.WriteString("%25") + result.WriteString(reservedBuffer.String()[1:]) + } +} + +func getSubstitutionType(value any, col int) string { + switch value.(type) { + case nil: + return SubstitutionTypeEmpty + case string, float32, float64, int, int8, int16, int32, int64, bool, time.Time: + return SubstitutionTypeString + case []string, []float32, []float64, []int, []int8, []int16, []int32, []int64, []bool, []time.Time, []any: + return SubstitutionTypeList + case map[string]string, map[string]float32, map[string]float64, map[string]int, map[string]int8, map[string]int16, map[string]int32, map[string]int64, map[string]bool, map[string]time.Time, map[string]any: + return SubstitutionTypeMap + default: + return fmt.Sprintf("illegal class passed as substitution, found %T at col: %d", value, col) + } +} + +func isEmpty(substType string, value any) bool { + switch substType { + case SubstitutionTypeString: + switch value.(type) { + case string: + return value == nil + default: // primitives are value types + return false + } + case SubstitutionTypeList: + return getListLength(value) == 0 + case SubstitutionTypeMap: + return getMapLength(value) == 0 + default: + return true + } +} + +func getListLength(value any) int { + switch value.(type) { + case []string: + return len(value.([]string)) + case []float32: + return len(value.([]float32)) + case []float64: + return len(value.([]float64)) + case []int: + return len(value.([]int)) + case []int8: + return len(value.([]int8)) + case []int16: + return len(value.([]int16)) + case []int32: + return len(value.([]int32)) + case []int64: + return len(value.([]int64)) + case []bool: + return len(value.([]bool)) + case []time.Time: + return len(value.([]time.Time)) + case []any: + return len(value.([]any)) + } + return 0 +} + +func getMapLength(value any) int { + switch value.(type) { + case map[string]string: + return len(value.(map[string]string)) + case map[string]float32: + return len(value.(map[string]float32)) + case map[string]float64: + return len(value.(map[string]float64)) + case map[string]int: + return len(value.(map[string]int)) + case map[string]int8: + return len(value.(map[string]int8)) + case map[string]int16: + return len(value.(map[string]int16)) + case map[string]int32: + return len(value.(map[string]int32)) + case map[string]int64: + return len(value.(map[string]int64)) + case map[string]bool: + return len(value.(map[string]bool)) + case map[string]time.Time: + return len(value.(map[string]time.Time)) + case map[string]any: + return len(value.(map[string]any)) + } + return 0 +} + +func convertNativeList(value any) ([]string, error) { + var stringList = make([]string, getListLength(value)) + switch value.(type) { + case []string: + for index, val := range value.([]string) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringList[index] = str + } + case []float32: + for index, val := range value.([]float32) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringList[index] = str + } + case []float64: + for index, val := range value.([]float64) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringList[index] = str + } + case []int: + for index, val := range value.([]int) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringList[index] = str + } + case []int8: + for index, val := range value.([]int8) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringList[index] = str + } + case []int16: + for index, val := range value.([]int16) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringList[index] = str + } + case []int32: + for index, val := range value.([]int32) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringList[index] = str + } + case []int64: + for index, val := range value.([]int64) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringList[index] = str + } + case []bool: + for index, val := range value.([]bool) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringList[index] = str + } + case []time.Time: + for index, val := range value.([]time.Time) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringList[index] = str + } + case []any: + for index, val := range value.([]any) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringList[index] = str + } + default: + return nil, fmt.Errorf("unrecognized type: %s", value) + } + return stringList, nil +} + +func convertNativeMap(value any) (map[string]string, error) { + var stringMap = make(map[string]string, getMapLength(value)) + switch value.(type) { + case map[string]string: + for key, val := range value.(map[string]string) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringMap[key] = str + } + case map[string]float32: + for key, val := range value.(map[string]float32) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringMap[key] = str + } + case map[string]float64: + for key, val := range value.(map[string]float64) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringMap[key] = str + } + case map[string]int: + for key, val := range value.(map[string]int) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringMap[key] = str + } + case map[string]int8: + for key, val := range value.(map[string]int8) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringMap[key] = str + } + case map[string]int16: + for key, val := range value.(map[string]int16) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringMap[key] = str + } + case map[string]int32: + for key, val := range value.(map[string]int32) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringMap[key] = str + } + case map[string]int64: + for key, val := range value.(map[string]int64) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringMap[key] = str + } + case map[string]bool: + for key, val := range value.(map[string]bool) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringMap[key] = str + } + case map[string]time.Time: + for key, val := range value.(map[string]time.Time) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringMap[key] = str + } + case map[string]any: + for key, val := range value.(map[string]any) { + str, err := convertNativeTypes(val) + if err != nil { + return nil, err + } + stringMap[key] = str + } + default: + return nil, fmt.Errorf("unrecognized type: %s", value) + } + return stringMap, nil +} + +func convertNativeTypes(value any) (string, error) { + switch value.(type) { + case string, float32, float64, int, int8, int16, int32, int64, bool: + return fmt.Sprintf("%v", value), nil + case time.Time: + return value.(time.Time).Format(time.RFC3339), nil + default: + return "", fmt.Errorf("unrecognized type: %s", value) + } +} + +func expandToken( + operator Op, + token string, + composite bool, + maxChar int, + firstToken bool, + substitutions Substitutions, + result *strings.Builder, + col int, +) (bool, error) { + if len(token) == 0 { + return false, fmt.Errorf("found an empty token at col: %d", col) + } + + value, ok := substitutions[token] + if !ok { + return false, nil + } + + substType := getSubstitutionType(value, col) + if substType == SubstitutionTypeEmpty || isEmpty(substType, value) { + return false, nil + } + + if firstToken { + addPrefix(operator, result) + } else { + addSeparator(operator, result) + } + + switch substType { + case SubstitutionTypeString: + stringValue, err := convertNativeTypes(value) + if err != nil { + return false, err + } + addStringValue(operator, token, stringValue, result, maxChar) + case SubstitutionTypeList: + listValue, err := convertNativeList(value) + if err != nil { + return false, err + } + addListValue(operator, token, listValue, result, maxChar, composite) + case SubstitutionTypeMap: + mapValue, err := convertNativeMap(value) + if err != nil { + return false, err + } + err = addMapValue(operator, token, mapValue, result, maxChar, composite) + if err != nil { + return false, err + } + } + + return true, nil +} + +func addStringValue(operator Op, token string, value string, result *strings.Builder, maxChar int) { + addValue(operator, token, value, result, maxChar) +} + +func addListValue(operator Op, token string, value []string, result *strings.Builder, maxChar int, composite bool) { + first := true + for _, v := range value { + if first { + addValue(operator, token, v, result, maxChar) + first = false + } else { + if composite { + addSeparator(operator, result) + addValue(operator, token, v, result, maxChar) + } else { + result.WriteString(",") + addValueElement(operator, token, v, result, maxChar) + } + } + } +} + +func addMapValue(operator Op, token string, value map[string]string, result *strings.Builder, maxChar int, composite bool) error { + if maxChar != -1 { + return fmt.Errorf("value trimming is not allowed on Maps") + } + + // workaround to make Map ordering not random + // https://github.com/uri-templates/uritemplate-test/pull/58#issuecomment-1640029982 + keys := make([]string, 0, len(value)) + for k := range value { + keys = append(keys, k) + } + sort.Strings(keys) + for i := range keys { + k := keys[i] + v := value[k] + + if composite { + if i > 0 { + addSeparator(operator, result) + } + addValueElement(operator, token, k, result, maxChar) + result.WriteString("=") + } else { + if i == 0 { + addValue(operator, token, k, result, maxChar) + } else { + result.WriteString(",") + addValueElement(operator, token, k, result, maxChar) + } + result.WriteString(",") + } + addValueElement(operator, token, v, result, maxChar) + } + return nil +} diff --git a/vendor/github.com/std-uritemplate/std-uritemplate/go/test.sh b/vendor/github.com/std-uritemplate/std-uritemplate/go/test.sh new file mode 100644 index 000000000..14d1a3d30 --- /dev/null +++ b/vendor/github.com/std-uritemplate/std-uritemplate/go/test.sh @@ -0,0 +1,9 @@ +#! /bin/bash + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +# This is intended to be a customizable entrypoint for each language, it has to be generic enough +( + cd ${SCRIPT_DIR} && \ + ./test/stduritemplate $@ +) diff --git a/vendor/go.opentelemetry.io/otel/.codespellignore b/vendor/go.opentelemetry.io/otel/.codespellignore new file mode 100644 index 000000000..120b63a9c --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.codespellignore @@ -0,0 +1,7 @@ +ot +fo +te +collison +consequentially +ans +nam diff --git a/vendor/go.opentelemetry.io/otel/.codespellrc b/vendor/go.opentelemetry.io/otel/.codespellrc new file mode 100644 index 000000000..4afbb1fb3 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.codespellrc @@ -0,0 +1,10 @@ +# https://github.com/codespell-project/codespell +[codespell] +builtin = clear,rare,informal +check-filenames = +check-hidden = +ignore-words = .codespellignore +interactive = 1 +skip = .git,go.mod,go.sum,semconv,venv,.tools +uri-ignore-words-list = * +write = diff --git a/vendor/go.opentelemetry.io/otel/.gitattributes b/vendor/go.opentelemetry.io/otel/.gitattributes new file mode 100644 index 000000000..314766e91 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.gitattributes @@ -0,0 +1,3 @@ +* text=auto eol=lf +*.{cmd,[cC][mM][dD]} text eol=crlf +*.{bat,[bB][aA][tT]} text eol=crlf diff --git a/vendor/go.opentelemetry.io/otel/.gitignore b/vendor/go.opentelemetry.io/otel/.gitignore new file mode 100644 index 000000000..895c7664b --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.gitignore @@ -0,0 +1,22 @@ +.DS_Store +Thumbs.db + +.tools/ +venv/ +.idea/ +.vscode/ +*.iml +*.so +coverage.* +go.work +go.work.sum + +gen/ + +/example/dice/dice +/example/namedtracer/namedtracer +/example/otel-collector/otel-collector +/example/opencensus/opencensus +/example/passthrough/passthrough +/example/prometheus/prometheus +/example/zipkin/zipkin diff --git a/vendor/go.opentelemetry.io/otel/.gitmodules b/vendor/go.opentelemetry.io/otel/.gitmodules new file mode 100644 index 000000000..38a1f5698 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.gitmodules @@ -0,0 +1,3 @@ +[submodule "opentelemetry-proto"] + path = exporters/otlp/internal/opentelemetry-proto + url = https://github.com/open-telemetry/opentelemetry-proto diff --git a/vendor/go.opentelemetry.io/otel/.golangci.yml b/vendor/go.opentelemetry.io/otel/.golangci.yml new file mode 100644 index 000000000..a62511f38 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.golangci.yml @@ -0,0 +1,296 @@ +# See https://github.com/golangci/golangci-lint#config-file +run: + issues-exit-code: 1 #Default + tests: true #Default + +linters: + # Disable everything by default so upgrades to not include new "default + # enabled" linters. + disable-all: true + # Specifically enable linters we want to use. + enable: + - depguard + - errcheck + - godot + - gofumpt + - goimports + - gosec + - gosimple + - govet + - ineffassign + - misspell + - revive + - staticcheck + - typecheck + - unused + +issues: + # Maximum issues count per one linter. + # Set to 0 to disable. + # Default: 50 + # Setting to unlimited so the linter only is run once to debug all issues. + max-issues-per-linter: 0 + # Maximum count of issues with the same text. + # Set to 0 to disable. + # Default: 3 + # Setting to unlimited so the linter only is run once to debug all issues. + max-same-issues: 0 + # Excluding configuration per-path, per-linter, per-text and per-source. + exclude-rules: + # TODO: Having appropriate comments for exported objects helps development, + # even for objects in internal packages. Appropriate comments for all + # exported objects should be added and this exclusion removed. + - path: '.*internal/.*' + text: "exported (method|function|type|const) (.+) should have comment or be unexported" + linters: + - revive + # Yes, they are, but it's okay in a test. + - path: _test\.go + text: "exported func.*returns unexported type.*which can be annoying to use" + linters: + - revive + # Example test functions should be treated like main. + - path: example.*_test\.go + text: "calls to (.+) only in main[(][)] or init[(][)] functions" + linters: + - revive + # It's okay to not run gosec in a test. + - path: _test\.go + linters: + - gosec + # Igonoring gosec G404: Use of weak random number generator (math/rand instead of crypto/rand) + # as we commonly use it in tests and examples. + - text: "G404:" + linters: + - gosec + # Igonoring gosec G402: TLS MinVersion too low + # as the https://pkg.go.dev/crypto/tls#Config handles MinVersion default well. + - text: "G402: TLS MinVersion too low." + linters: + - gosec + include: + # revive exported should have comment or be unexported. + - EXC0012 + # revive package comment should be of the form ... + - EXC0013 + +linters-settings: + depguard: + rules: + non-tests: + files: + - "!$test" + - "!**/*test/*.go" + - "!**/internal/matchers/*.go" + deny: + - pkg: "testing" + - pkg: "github.com/stretchr/testify" + - pkg: "crypto/md5" + - pkg: "crypto/sha1" + - pkg: "crypto/**/pkix" + otlp-internal: + files: + - "!**/exporters/otlp/internal/**/*.go" + deny: + - pkg: "go.opentelemetry.io/otel/exporters/otlp/internal" + desc: Do not use cross-module internal packages. + otlptrace-internal: + files: + - "!**/exporters/otlp/otlptrace/*.go" + - "!**/exporters/otlp/otlptrace/internal/**.go" + deny: + - pkg: "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal" + desc: Do not use cross-module internal packages. + otlpmetric-internal: + files: + - "!**/exporters/otlp/otlpmetric/internal/*.go" + - "!**/exporters/otlp/otlpmetric/internal/**/*.go" + deny: + - pkg: "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal" + desc: Do not use cross-module internal packages. + otel-internal: + files: + - "**/sdk/*.go" + - "**/sdk/**/*.go" + - "**/exporters/*.go" + - "**/exporters/**/*.go" + - "**/schema/*.go" + - "**/schema/**/*.go" + - "**/metric/*.go" + - "**/metric/**/*.go" + - "**/bridge/*.go" + - "**/bridge/**/*.go" + - "**/example/*.go" + - "**/example/**/*.go" + - "**/trace/*.go" + - "**/trace/**/*.go" + deny: + - pkg: "go.opentelemetry.io/otel/internal$" + desc: Do not use cross-module internal packages. + - pkg: "go.opentelemetry.io/otel/internal/attribute" + desc: Do not use cross-module internal packages. + - pkg: "go.opentelemetry.io/otel/internal/internaltest" + desc: Do not use cross-module internal packages. + - pkg: "go.opentelemetry.io/otel/internal/matchers" + desc: Do not use cross-module internal packages. + godot: + exclude: + # Exclude links. + - '^ *\[[^]]+\]:' + # Exclude sentence fragments for lists. + - '^[ ]*[-•]' + # Exclude sentences prefixing a list. + - ':$' + goimports: + local-prefixes: go.opentelemetry.io + misspell: + locale: US + ignore-words: + - cancelled + revive: + # Sets the default failure confidence. + # This means that linting errors with less than 0.8 confidence will be ignored. + # Default: 0.8 + confidence: 0.01 + rules: + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#blank-imports + - name: blank-imports + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr + - name: bool-literal-in-expr + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#constant-logical-expr + - name: constant-logical-expr + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-as-argument + # TODO (#3372) re-enable linter when it is compatible. https://github.com/golangci/golangci-lint/issues/3280 + - name: context-as-argument + disabled: true + arguments: + allowTypesBefore: "*testing.T" + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-keys-type + - name: context-keys-type + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#deep-exit + - name: deep-exit + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#defer + - name: defer + disabled: false + arguments: + - ["call-chain", "loop"] + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#dot-imports + - name: dot-imports + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#duplicated-imports + - name: duplicated-imports + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#early-return + - name: early-return + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-block + - name: empty-block + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-lines + - name: empty-lines + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-naming + - name: error-naming + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-return + - name: error-return + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-strings + - name: error-strings + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#errorf + - name: errorf + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#exported + - name: exported + disabled: false + arguments: + - "sayRepetitiveInsteadOfStutters" + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#flag-parameter + - name: flag-parameter + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#identical-branches + - name: identical-branches + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#if-return + - name: if-return + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#increment-decrement + - name: increment-decrement + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#indent-error-flow + - name: indent-error-flow + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#import-shadowing + - name: import-shadowing + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#package-comments + - name: package-comments + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range + - name: range + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-in-closure + - name: range-val-in-closure + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-address + - name: range-val-address + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redefines-builtin-id + - name: redefines-builtin-id + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-format + - name: string-format + disabled: false + arguments: + - - panic + - '/^[^\n]*$/' + - must not contain line breaks + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#struct-tag + - name: struct-tag + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#superfluous-else + - name: superfluous-else + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#time-equal + - name: time-equal + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-naming + - name: var-naming + disabled: false + arguments: + - ["ID"] # AllowList + - ["Otel", "Aws", "Gcp"] # DenyList + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-declaration + - name: var-declaration + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unconditional-recursion + - name: unconditional-recursion + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-return + - name: unexported-return + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error + - name: unhandled-error + disabled: false + arguments: + - "fmt.Fprint" + - "fmt.Fprintf" + - "fmt.Fprintln" + - "fmt.Print" + - "fmt.Printf" + - "fmt.Println" + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unnecessary-stmt + - name: unnecessary-stmt + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break + - name: useless-break + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#waitgroup-by-value + - name: waitgroup-by-value + disabled: false diff --git a/vendor/go.opentelemetry.io/otel/.lycheeignore b/vendor/go.opentelemetry.io/otel/.lycheeignore new file mode 100644 index 000000000..40d62fa2e --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.lycheeignore @@ -0,0 +1,6 @@ +http://localhost +http://jaeger-collector +https://github.com/open-telemetry/opentelemetry-go/milestone/ +https://github.com/open-telemetry/opentelemetry-go/projects +file:///home/runner/work/opentelemetry-go/opentelemetry-go/libraries +file:///home/runner/work/opentelemetry-go/opentelemetry-go/manual diff --git a/vendor/go.opentelemetry.io/otel/.markdownlint.yaml b/vendor/go.opentelemetry.io/otel/.markdownlint.yaml new file mode 100644 index 000000000..3202496c3 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.markdownlint.yaml @@ -0,0 +1,29 @@ +# Default state for all rules +default: true + +# ul-style +MD004: false + +# hard-tabs +MD010: false + +# line-length +MD013: false + +# no-duplicate-header +MD024: + siblings_only: true + +#single-title +MD025: false + +# ol-prefix +MD029: + style: ordered + +# no-inline-html +MD033: false + +# fenced-code-language +MD040: false + diff --git a/vendor/go.opentelemetry.io/otel/CHANGELOG.md b/vendor/go.opentelemetry.io/otel/CHANGELOG.md new file mode 100644 index 000000000..98f2d2043 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/CHANGELOG.md @@ -0,0 +1,2939 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). + +This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [1.24.0/0.46.0/0.0.1-alpha] 2024-02-23 + +This release is the last to support [Go 1.20]. +The next release will require at least [Go 1.21]. + +### Added + +- Support [Go 1.22]. (#4890) +- Add exemplar support to `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4900) +- Add exemplar support to `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4900) +- The `go.opentelemetry.io/otel/log` module is added. + This module includes OpenTelemetry Go's implementation of the Logs Bridge API. + This module is in an alpha state, it is subject to breaking changes. + See our [versioning policy](./VERSIONING.md) for more info. (#4961) + +### Fixed + +- Fix registration of multiple callbacks when using the global meter provider from `go.opentelemetry.io/otel`. (#4945) +- Fix negative buckets in output of exponential histograms. (#4956) + +## [1.23.1] 2024-02-07 + +### Fixed + +- Register all callbacks passed during observable instrument creation instead of just the last one multiple times in `go.opentelemetry.io/otel/sdk/metric`. (#4888) + +## [1.23.0] 2024-02-06 + +This release contains the first stable, `v1`, release of the following modules: + +- `go.opentelemetry.io/otel/bridge/opencensus` +- `go.opentelemetry.io/otel/bridge/opencensus/test` +- `go.opentelemetry.io/otel/example/opencensus` +- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` +- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` +- `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` + +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Added + +- Add `WithEndpointURL` option to the `exporters/otlp/otlpmetric/otlpmetricgrpc`, `exporters/otlp/otlpmetric/otlpmetrichttp`, `exporters/otlp/otlptrace/otlptracegrpc` and `exporters/otlp/otlptrace/otlptracehttp` packages. (#4808) +- Experimental exemplar exporting is added to the metric SDK. + See [metric documentation](./sdk/metric/internal/x/README.md#exemplars) for more information about this feature and how to enable it. (#4871) +- `ErrSchemaURLConflict` is added to `go.opentelemetry.io/otel/sdk/resource`. + This error is returned when a merge of two `Resource`s with different (non-empty) schema URL is attempted. (#4876) + +### Changed + +- The `Merge` and `New` functions in `go.opentelemetry.io/otel/sdk/resource` now returns a partial result if there is a schema URL merge conflict. + Instead of returning `nil` when two `Resource`s with different (non-empty) schema URLs are merged the merged `Resource`, along with the new `ErrSchemaURLConflict` error, is returned. + It is up to the user to decide if they want to use the returned `Resource` or not. + It may have desired attributes overwritten or include stale semantic conventions. (#4876) + +### Fixed + +- Fix `ContainerID` resource detection on systemd when cgroup path has a colon. (#4449) +- Fix `go.opentelemetry.io/otel/sdk/metric` to cache instruments to avoid leaking memory when the same instrument is created multiple times. (#4820) +- Fix missing `Mix` and `Max` values for `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` by introducing `MarshalText` and `MarshalJSON` for the `Extrema` type in `go.opentelemetry.io/sdk/metric/metricdata`. (#4827) + +## [1.23.0-rc.1] 2024-01-18 + +This is a release candidate for the v1.23.0 release. +That release is expected to include the `v1` release of the following modules: + +- `go.opentelemetry.io/otel/bridge/opencensus` +- `go.opentelemetry.io/otel/bridge/opencensus/test` +- `go.opentelemetry.io/otel/example/opencensus` +- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` +- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` +- `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` + +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +## [1.22.0/0.45.0] 2024-01-17 + +### Added + +- The `go.opentelemetry.io/otel/semconv/v1.22.0` package. + The package contains semantic conventions from the `v1.22.0` version of the OpenTelemetry Semantic Conventions. (#4735) +- The `go.opentelemetry.io/otel/semconv/v1.23.0` package. + The package contains semantic conventions from the `v1.23.0` version of the OpenTelemetry Semantic Conventions. (#4746) +- The `go.opentelemetry.io/otel/semconv/v1.23.1` package. + The package contains semantic conventions from the `v1.23.1` version of the OpenTelemetry Semantic Conventions. (#4749) +- The `go.opentelemetry.io/otel/semconv/v1.24.0` package. + The package contains semantic conventions from the `v1.24.0` version of the OpenTelemetry Semantic Conventions. (#4770) +- Add `WithResourceAsConstantLabels` option to apply resource attributes for every metric emitted by the Prometheus exporter. (#4733) +- Experimental cardinality limiting is added to the metric SDK. + See [metric documentation](./sdk/metric/internal/x/README.md#cardinality-limit) for more information about this feature and how to enable it. (#4457) +- Add `NewMemberRaw` and `NewKeyValuePropertyRaw` in `go.opentelemetry.io/otel/baggage`. (#4804) + +### Changed + +- Upgrade all use of `go.opentelemetry.io/otel/semconv` to use `v1.24.0`. (#4754) +- Update transformations in `go.opentelemetry.io/otel/exporters/zipkin` to follow `v1.24.0` version of the OpenTelemetry specification. (#4754) +- Record synchronous measurements when the passed context is canceled instead of dropping in `go.opentelemetry.io/otel/sdk/metric`. + If you do not want to make a measurement when the context is cancelled, you need to handle it yourself (e.g `if ctx.Err() != nil`). (#4671) +- Improve `go.opentelemetry.io/otel/trace.TraceState`'s performance. (#4722) +- Improve `go.opentelemetry.io/otel/propagation.TraceContext`'s performance. (#4721) +- Improve `go.opentelemetry.io/otel/baggage` performance. (#4743) +- Improve performance of the `(*Set).Filter` method in `go.opentelemetry.io/otel/attribute` when the passed filter does not filter out any attributes from the set. (#4774) +- `Member.String` in `go.opentelemetry.io/otel/baggage` percent-encodes only when necessary. (#4775) +- Improve `go.opentelemetry.io/otel/trace.Span`'s performance when adding multiple attributes. (#4818) +- `Property.Value` in `go.opentelemetry.io/otel/baggage` now returns a raw string instead of a percent-encoded value. (#4804) + +### Fixed + +- Fix `Parse` in `go.opentelemetry.io/otel/baggage` to validate member value before percent-decoding. (#4755) +- Fix whitespace encoding of `Member.String` in `go.opentelemetry.io/otel/baggage`. (#4756) +- Fix observable not registered error when the asynchronous instrument has a drop aggregation in `go.opentelemetry.io/otel/sdk/metric`. (#4772) +- Fix baggage item key so that it is not canonicalized in `go.opentelemetry.io/otel/bridge/opentracing`. (#4776) +- Fix `go.opentelemetry.io/otel/bridge/opentracing` to properly handle baggage values that requires escaping during propagation. (#4804) +- Fix a bug where using multiple readers resulted in incorrect asynchronous counter values in `go.opentelemetry.io/otel/sdk/metric`. (#4742) + +## [1.21.0/0.44.0] 2023-11-16 + +### Removed + +- Remove the deprecated `go.opentelemetry.io/otel/bridge/opencensus.NewTracer`. (#4706) +- Remove the deprecated `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` module. (#4707) +- Remove the deprecated `go.opentelemetry.io/otel/example/view` module. (#4708) +- Remove the deprecated `go.opentelemetry.io/otel/example/fib` module. (#4723) + +### Fixed + +- Do not parse non-protobuf responses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4719) +- Do not parse non-protobuf responses in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4719) + +## [1.20.0/0.43.0] 2023-11-10 + +This release brings a breaking change for custom trace API implementations. Some interfaces (`TracerProvider`, `Tracer`, `Span`) now embed the `go.opentelemetry.io/otel/trace/embedded` types. Implementors need to update their implementations based on what they want the default behavior to be. See the "API Implementations" section of the [trace API] package documentation for more information about how to accomplish this. + +### Added + +- Add `go.opentelemetry.io/otel/bridge/opencensus.InstallTraceBridge`, which installs the OpenCensus trace bridge, and replaces `opencensus.NewTracer`. (#4567) +- Add scope version to trace and metric bridges in `go.opentelemetry.io/otel/bridge/opencensus`. (#4584) +- Add the `go.opentelemetry.io/otel/trace/embedded` package to be embedded in the exported trace API interfaces. (#4620) +- Add the `go.opentelemetry.io/otel/trace/noop` package as a default no-op implementation of the trace API. (#4620) +- Add context propagation in `go.opentelemetry.io/otel/example/dice`. (#4644) +- Add view configuration to `go.opentelemetry.io/otel/example/prometheus`. (#4649) +- Add `go.opentelemetry.io/otel/metric.WithExplicitBucketBoundaries`, which allows defining default explicit bucket boundaries when creating histogram instruments. (#4603) +- Add `Version` function in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4660) +- Add `Version` function in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4660) +- Add Summary, SummaryDataPoint, and QuantileValue to `go.opentelemetry.io/sdk/metric/metricdata`. (#4622) +- `go.opentelemetry.io/otel/bridge/opencensus.NewMetricProducer` now supports exemplars from OpenCensus. (#4585) +- Add support for `WithExplicitBucketBoundaries` in `go.opentelemetry.io/otel/sdk/metric`. (#4605) +- Add support for Summary metrics in `go.opentelemetry.io/otel/bridge/opencensus`. (#4668) + +### Deprecated + +- Deprecate `go.opentelemetry.io/otel/bridge/opencensus.NewTracer` in favor of `opencensus.InstallTraceBridge`. (#4567) +- Deprecate `go.opentelemetry.io/otel/example/fib` package is in favor of `go.opentelemetry.io/otel/example/dice`. (#4618) +- Deprecate `go.opentelemetry.io/otel/trace.NewNoopTracerProvider`. + Use the added `NewTracerProvider` function in `go.opentelemetry.io/otel/trace/noop` instead. (#4620) +- Deprecate `go.opentelemetry.io/otel/example/view` package in favor of `go.opentelemetry.io/otel/example/prometheus`. (#4649) +- Deprecate `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4693) + +### Changed + +- `go.opentelemetry.io/otel/bridge/opencensus.NewMetricProducer` returns a `*MetricProducer` struct instead of the metric.Producer interface. (#4583) +- The `TracerProvider` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.TracerProvider` type. + This extends the `TracerProvider` interface and is is a breaking change for any existing implementation. + Implementors need to update their implementations based on what they want the default behavior of the interface to be. + See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620) +- The `Tracer` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.Tracer` type. + This extends the `Tracer` interface and is is a breaking change for any existing implementation. + Implementors need to update their implementations based on what they want the default behavior of the interface to be. + See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620) +- The `Span` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.Span` type. + This extends the `Span` interface and is is a breaking change for any existing implementation. + Implementors need to update their implementations based on what they want the default behavior of the interface to be. + See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620) +- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` does no longer depend on `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4660) +- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` does no longer depend on `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4660) +- Retry for `502 Bad Gateway` and `504 Gateway Timeout` HTTP statuses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4670) +- Retry for `502 Bad Gateway` and `504 Gateway Timeout` HTTP statuses in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4670) +- Retry for `RESOURCE_EXHAUSTED` only if RetryInfo is returned in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4669) +- Retry for `RESOURCE_EXHAUSTED` only if RetryInfo is returned in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#4669) +- Retry temporary HTTP request failures in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4679) +- Retry temporary HTTP request failures in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4679) + +### Fixed + +- Fix improper parsing of characters such us `+`, `/` by `Parse` in `go.opentelemetry.io/otel/baggage` as they were rendered as a whitespace. (#4667) +- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_RESOURCE_ATTRIBUTES` in `go.opentelemetry.io/otel/sdk/resource` as they were rendered as a whitespace. (#4699) +- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_METRICS_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` as they were rendered as a whitespace. (#4699) +- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_METRICS_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` as they were rendered as a whitespace. (#4699) +- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_TRACES_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlptracegrpc` as they were rendered as a whitespace. (#4699) +- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_TRACES_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlptracehttp` as they were rendered as a whitespace. (#4699) +- In `go.opentelemetry.op/otel/exporters/prometheus`, the exporter no longer `Collect`s metrics after `Shutdown` is invoked. (#4648) +- Fix documentation for `WithCompressor` in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#4695) +- Fix documentation for `WithCompressor` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4695) + +## [1.19.0/0.42.0/0.0.7] 2023-09-28 + +This release contains the first stable release of the OpenTelemetry Go [metric SDK]. +Our project stability guarantees now apply to the `go.opentelemetry.io/otel/sdk/metric` package. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Added + +- Add the "Roll the dice" getting started application example in `go.opentelemetry.io/otel/example/dice`. (#4539) +- The `WithWriter` and `WithPrettyPrint` options to `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` to set a custom `io.Writer`, and allow displaying the output in human-readable JSON. (#4507) + +### Changed + +- Allow '/' characters in metric instrument names. (#4501) +- The exporter in `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` does not prettify its output by default anymore. (#4507) +- Upgrade `gopkg.io/yaml` from `v2` to `v3` in `go.opentelemetry.io/otel/schema`. (#4535) + +### Fixed + +- In `go.opentelemetry.op/otel/exporters/prometheus`, don't try to create the Prometheus metric on every `Collect` if we know the scope is invalid. (#4499) + +### Removed + +- Remove `"go.opentelemetry.io/otel/bridge/opencensus".NewMetricExporter`, which is replaced by `NewMetricProducer`. (#4566) + +## [1.19.0-rc.1/0.42.0-rc.1] 2023-09-14 + +This is a release candidate for the v1.19.0/v0.42.0 release. +That release is expected to include the `v1` release of the OpenTelemetry Go metric SDK and will provide stability guarantees of that SDK. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Changed + +- Allow '/' characters in metric instrument names. (#4501) + +### Fixed + +- In `go.opentelemetry.op/otel/exporters/prometheus`, don't try to create the prometheus metric on every `Collect` if we know the scope is invalid. (#4499) + +## [1.18.0/0.41.0/0.0.6] 2023-09-12 + +This release drops the compatibility guarantee of [Go 1.19]. + +### Added + +- Add `WithProducer` option in `go.opentelemetry.op/otel/exporters/prometheus` to restore the ability to register producers on the prometheus exporter's manual reader. (#4473) +- Add `IgnoreValue` option in `go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest` to allow ignoring values when comparing metrics. (#4447) + +### Changed + +- Use a `TestingT` interface instead of `*testing.T` struct in `go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest`. (#4483) + +### Deprecated + +- The `NewMetricExporter` in `go.opentelemetry.io/otel/bridge/opencensus` was deprecated in `v0.35.0` (#3541). + The deprecation notice format for the function has been corrected to trigger Go documentation and build tooling. (#4470) + +### Removed + +- Removed the deprecated `go.opentelemetry.io/otel/exporters/jaeger` package. (#4467) +- Removed the deprecated `go.opentelemetry.io/otel/example/jaeger` package. (#4467) +- Removed the deprecated `go.opentelemetry.io/otel/sdk/metric/aggregation` package. (#4468) +- Removed the deprecated internal packages in `go.opentelemetry.io/otel/exporters/otlp` and its sub-packages. (#4469) +- Dropped guaranteed support for versions of Go less than 1.20. (#4481) + +## [1.17.0/0.40.0/0.0.5] 2023-08-28 + +### Added + +- Export the `ManualReader` struct in `go.opentelemetry.io/otel/sdk/metric`. (#4244) +- Export the `PeriodicReader` struct in `go.opentelemetry.io/otel/sdk/metric`. (#4244) +- Add support for exponential histogram aggregations. + A histogram can be configured as an exponential histogram using a view with `"go.opentelemetry.io/otel/sdk/metric".ExponentialHistogram` as the aggregation. (#4245) +- Export the `Exporter` struct in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4272) +- Export the `Exporter` struct in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4272) +- The exporters in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` now support the `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` environment variable. (#4287) +- Add `WithoutCounterSuffixes` option in `go.opentelemetry.io/otel/exporters/prometheus` to disable addition of `_total` suffixes. (#4306) +- Add info and debug logging to the metric SDK in `go.opentelemetry.io/otel/sdk/metric`. (#4315) +- The `go.opentelemetry.io/otel/semconv/v1.21.0` package. + The package contains semantic conventions from the `v1.21.0` version of the OpenTelemetry Semantic Conventions. (#4362) +- Accept 201 to 299 HTTP status as success in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` and `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4365) +- Document the `Temporality` and `Aggregation` methods of the `"go.opentelemetry.io/otel/sdk/metric".Exporter"` need to be concurrent safe. (#4381) +- Expand the set of units supported by the Prometheus exporter, and don't add unit suffixes if they are already present in `go.opentelemetry.op/otel/exporters/prometheus` (#4374) +- Move the `Aggregation` interface and its implementations from `go.opentelemetry.io/otel/sdk/metric/aggregation` to `go.opentelemetry.io/otel/sdk/metric`. (#4435) +- The exporters in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` now support the `OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION` environment variable. (#4437) +- Add the `NewAllowKeysFilter` and `NewDenyKeysFilter` functions to `go.opentelemetry.io/otel/attribute` to allow convenient creation of allow-keys and deny-keys filters. (#4444) +- Support Go 1.21. (#4463) + +### Changed + +- Starting from `v1.21.0` of semantic conventions, `go.opentelemetry.io/otel/semconv/{version}/httpconv` and `go.opentelemetry.io/otel/semconv/{version}/netconv` packages will no longer be published. (#4145) +- Log duplicate instrument conflict at a warning level instead of info in `go.opentelemetry.io/otel/sdk/metric`. (#4202) +- Return an error on the creation of new instruments in `go.opentelemetry.io/otel/sdk/metric` if their name doesn't pass regexp validation. (#4210) +- `NewManualReader` in `go.opentelemetry.io/otel/sdk/metric` returns `*ManualReader` instead of `Reader`. (#4244) +- `NewPeriodicReader` in `go.opentelemetry.io/otel/sdk/metric` returns `*PeriodicReader` instead of `Reader`. (#4244) +- Count the Collect time in the `PeriodicReader` timeout in `go.opentelemetry.io/otel/sdk/metric`. (#4221) +- The function `New` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` returns `*Exporter` instead of `"go.opentelemetry.io/otel/sdk/metric".Exporter`. (#4272) +- The function `New` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` returns `*Exporter` instead of `"go.opentelemetry.io/otel/sdk/metric".Exporter`. (#4272) +- If an attribute set is omitted from an async callback, the previous value will no longer be exported in `go.opentelemetry.io/otel/sdk/metric`. (#4290) +- If an attribute set is observed multiple times in an async callback in `go.opentelemetry.io/otel/sdk/metric`, the values will be summed instead of the last observation winning. (#4289) +- Allow the explicit bucket histogram aggregation to be used for the up-down counter, observable counter, observable up-down counter, and observable gauge in the `go.opentelemetry.io/otel/sdk/metric` package. (#4332) +- Restrict `Meter`s in `go.opentelemetry.io/otel/sdk/metric` to only register and collect instruments it created. (#4333) +- `PeriodicReader.Shutdown` and `PeriodicReader.ForceFlush` in `go.opentelemetry.io/otel/sdk/metric` now apply the periodic reader's timeout to the operation if the user provided context does not contain a deadline. (#4356, #4377) +- Upgrade all use of `go.opentelemetry.io/otel/semconv` to use `v1.21.0`. (#4408) +- Increase instrument name maximum length from 63 to 255 characters in `go.opentelemetry.io/otel/sdk/metric`. (#4434) +- Add `go.opentelemetry.op/otel/sdk/metric.WithProducer` as an `Option` for `"go.opentelemetry.io/otel/sdk/metric".NewManualReader` and `"go.opentelemetry.io/otel/sdk/metric".NewPeriodicReader`. (#4346) + +### Removed + +- Remove `Reader.RegisterProducer` in `go.opentelemetry.io/otel/metric`. + Use the added `WithProducer` option instead. (#4346) +- Remove `Reader.ForceFlush` in `go.opentelemetry.io/otel/metric`. + Notice that `PeriodicReader.ForceFlush` is still available. (#4375) + +### Fixed + +- Correctly format log messages from the `go.opentelemetry.io/otel/exporters/zipkin` exporter. (#4143) +- Log an error for calls to `NewView` in `go.opentelemetry.io/otel/sdk/metric` that have empty criteria. (#4307) +- Fix `"go.opentelemetry.io/otel/sdk/resource".WithHostID()` to not set an empty `host.id`. (#4317) +- Use the instrument identifying fields to cache aggregators and determine duplicate instrument registrations in `go.opentelemetry.io/otel/sdk/metric`. (#4337) +- Detect duplicate instruments for case-insensitive names in `go.opentelemetry.io/otel/sdk/metric`. (#4338) +- The `ManualReader` will not panic if `AggregationSelector` returns `nil` in `go.opentelemetry.io/otel/sdk/metric`. (#4350) +- If a `Reader`'s `AggregationSelector` returns `nil` or `DefaultAggregation` the pipeline will use the default aggregation. (#4350) +- Log a suggested view that fixes instrument conflicts in `go.opentelemetry.io/otel/sdk/metric`. (#4349) +- Fix possible panic, deadlock and race condition in batch span processor in `go.opentelemetry.io/otel/sdk/trace`. (#4353) +- Improve context cancellation handling in batch span processor's `ForceFlush` in `go.opentelemetry.io/otel/sdk/trace`. (#4369) +- Decouple `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` using gotmpl. (#4397, #3846) +- Decouple `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal` using gotmpl. (#4404, #3846) +- Decouple `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal` using gotmpl. (#4407, #3846) +- Decouple `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` and `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal` using gotmpl. (#4400, #3846) +- Decouple `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` and `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal` using gotmpl. (#4401, #3846) +- Do not block the metric SDK when OTLP metric exports are blocked in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#3925, #4395) +- Do not append `_total` if the counter already has that suffix for the Prometheus exproter in `go.opentelemetry.io/otel/exporter/prometheus`. (#4373) +- Fix resource detection data race in `go.opentelemetry.io/otel/sdk/resource`. (#4409) +- Use the first-seen instrument name during instrument name conflicts in `go.opentelemetry.io/otel/sdk/metric`. (#4428) + +### Deprecated + +- The `go.opentelemetry.io/otel/exporters/jaeger` package is deprecated. + OpenTelemetry dropped support for Jaeger exporter in July 2023. + Use `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` + or `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` instead. (#4423) +- The `go.opentelemetry.io/otel/example/jaeger` package is deprecated. (#4423) +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal` package is deprecated. (#4420) +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal/oconf` package is deprecated. (#4420) +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal/otest` package is deprecated. (#4420) +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal/transform` package is deprecated. (#4420) +- The `go.opentelemetry.io/otel/exporters/otlp/internal` package is deprecated. (#4421) +- The `go.opentelemetry.io/otel/exporters/otlp/internal/envconfig` package is deprecated. (#4421) +- The `go.opentelemetry.io/otel/exporters/otlp/internal/retry` package is deprecated. (#4421) +- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal` package is deprecated. (#4425) +- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/envconfig` package is deprecated. (#4425) +- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig` package is deprecated. (#4425) +- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlptracetest` package is deprecated. (#4425) +- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/retry` package is deprecated. (#4425) +- The `go.opentelemetry.io/otel/sdk/metric/aggregation` package is deprecated. + Use the aggregation types added to `go.opentelemetry.io/otel/sdk/metric` instead. (#4435) + +## [1.16.0/0.39.0] 2023-05-18 + +This release contains the first stable release of the OpenTelemetry Go [metric API]. +Our project stability guarantees now apply to the `go.opentelemetry.io/otel/metric` package. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Added + +- The `go.opentelemetry.io/otel/semconv/v1.19.0` package. + The package contains semantic conventions from the `v1.19.0` version of the OpenTelemetry specification. (#3848) +- The `go.opentelemetry.io/otel/semconv/v1.20.0` package. + The package contains semantic conventions from the `v1.20.0` version of the OpenTelemetry specification. (#4078) +- The Exponential Histogram data types in `go.opentelemetry.io/otel/sdk/metric/metricdata`. (#4165) +- OTLP metrics exporter now supports the Exponential Histogram Data Type. (#4222) +- Fix serialization of `time.Time` zero values in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` packages. (#4271) + +### Changed + +- Use `strings.Cut()` instead of `string.SplitN()` for better readability and memory use. (#4049) +- `MeterProvider` returns noop meters once it has been shutdown. (#4154) + +### Removed + +- The deprecated `go.opentelemetry.io/otel/metric/instrument` package is removed. + Use `go.opentelemetry.io/otel/metric` instead. (#4055) + +### Fixed + +- Fix build for BSD based systems in `go.opentelemetry.io/otel/sdk/resource`. (#4077) + +## [1.16.0-rc.1/0.39.0-rc.1] 2023-05-03 + +This is a release candidate for the v1.16.0/v0.39.0 release. +That release is expected to include the `v1` release of the OpenTelemetry Go metric API and will provide stability guarantees of that API. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Added + +- Support global `MeterProvider` in `go.opentelemetry.io/otel`. (#4039) + - Use `Meter` for a `metric.Meter` from the global `metric.MeterProvider`. + - Use `GetMeterProivder` for a global `metric.MeterProvider`. + - Use `SetMeterProivder` to set the global `metric.MeterProvider`. + +### Changed + +- Move the `go.opentelemetry.io/otel/metric` module to the `stable-v1` module set. + This stages the metric API to be released as a stable module. (#4038) + +### Removed + +- The `go.opentelemetry.io/otel/metric/global` package is removed. + Use `go.opentelemetry.io/otel` instead. (#4039) + +## [1.15.1/0.38.1] 2023-05-02 + +### Fixed + +- Remove unused imports from `sdk/resource/host_id_bsd.go` which caused build failures. (#4040, #4041) + +## [1.15.0/0.38.0] 2023-04-27 + +### Added + +- The `go.opentelemetry.io/otel/metric/embedded` package. (#3916) +- The `Version` function to `go.opentelemetry.io/otel/sdk` to return the SDK version. (#3949) +- Add a `WithNamespace` option to `go.opentelemetry.io/otel/exporters/prometheus` to allow users to prefix metrics with a namespace. (#3970) +- The following configuration types were added to `go.opentelemetry.io/otel/metric/instrument` to be used in the configuration of measurement methods. (#3971) + - The `AddConfig` used to hold configuration for addition measurements + - `NewAddConfig` used to create a new `AddConfig` + - `AddOption` used to configure an `AddConfig` + - The `RecordConfig` used to hold configuration for recorded measurements + - `NewRecordConfig` used to create a new `RecordConfig` + - `RecordOption` used to configure a `RecordConfig` + - The `ObserveConfig` used to hold configuration for observed measurements + - `NewObserveConfig` used to create a new `ObserveConfig` + - `ObserveOption` used to configure an `ObserveConfig` +- `WithAttributeSet` and `WithAttributes` are added to `go.opentelemetry.io/otel/metric/instrument`. + They return an option used during a measurement that defines the attribute Set associated with the measurement. (#3971) +- The `Version` function to `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` to return the OTLP metrics client version. (#3956) +- The `Version` function to `go.opentelemetry.io/otel/exporters/otlp/otlptrace` to return the OTLP trace client version. (#3956) + +### Changed + +- The `Extrema` in `go.opentelemetry.io/otel/sdk/metric/metricdata` is redefined with a generic argument of `[N int64 | float64]`. (#3870) +- Update all exported interfaces from `go.opentelemetry.io/otel/metric` to embed their corresponding interface from `go.opentelemetry.io/otel/metric/embedded`. + This adds an implementation requirement to set the interface default behavior for unimplemented methods. (#3916) +- Move No-Op implementation from `go.opentelemetry.io/otel/metric` into its own package `go.opentelemetry.io/otel/metric/noop`. (#3941) + - `metric.NewNoopMeterProvider` is replaced with `noop.NewMeterProvider` +- Add all the methods from `"go.opentelemetry.io/otel/trace".SpanContext` to `bridgeSpanContext` by embedding `otel.SpanContext` in `bridgeSpanContext`. (#3966) +- Wrap `UploadMetrics` error in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/` to improve error message when encountering generic grpc errors. (#3974) +- The measurement methods for all instruments in `go.opentelemetry.io/otel/metric/instrument` accept an option instead of the variadic `"go.opentelemetry.io/otel/attribute".KeyValue`. (#3971) + - The `Int64Counter.Add` method now accepts `...AddOption` + - The `Float64Counter.Add` method now accepts `...AddOption` + - The `Int64UpDownCounter.Add` method now accepts `...AddOption` + - The `Float64UpDownCounter.Add` method now accepts `...AddOption` + - The `Int64Histogram.Record` method now accepts `...RecordOption` + - The `Float64Histogram.Record` method now accepts `...RecordOption` + - The `Int64Observer.Observe` method now accepts `...ObserveOption` + - The `Float64Observer.Observe` method now accepts `...ObserveOption` +- The `Observer` methods in `go.opentelemetry.io/otel/metric` accept an option instead of the variadic `"go.opentelemetry.io/otel/attribute".KeyValue`. (#3971) + - The `Observer.ObserveInt64` method now accepts `...ObserveOption` + - The `Observer.ObserveFloat64` method now accepts `...ObserveOption` +- Move global metric back to `go.opentelemetry.io/otel/metric/global` from `go.opentelemetry.io/otel`. (#3986) + +### Fixed + +- `TracerProvider` allows calling `Tracer()` while it's shutting down. + It used to deadlock. (#3924) +- Use the SDK version for the Telemetry SDK resource detector in `go.opentelemetry.io/otel/sdk/resource`. (#3949) +- Fix a data race in `SpanProcessor` returned by `NewSimpleSpanProcessor` in `go.opentelemetry.io/otel/sdk/trace`. (#3951) +- Automatically figure out the default aggregation with `aggregation.Default`. (#3967) + +### Deprecated + +- The `go.opentelemetry.io/otel/metric/instrument` package is deprecated. + Use the equivalent types added to `go.opentelemetry.io/otel/metric` instead. (#4018) + +## [1.15.0-rc.2/0.38.0-rc.2] 2023-03-23 + +This is a release candidate for the v1.15.0/v0.38.0 release. +That release will include the `v1` release of the OpenTelemetry Go metric API and will provide stability guarantees of that API. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Added + +- The `WithHostID` option to `go.opentelemetry.io/otel/sdk/resource`. (#3812) +- The `WithoutTimestamps` option to `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` to sets all timestamps to zero. (#3828) +- The new `Exemplar` type is added to `go.opentelemetry.io/otel/sdk/metric/metricdata`. + Both the `DataPoint` and `HistogramDataPoint` types from that package have a new field of `Exemplars` containing the sampled exemplars for their timeseries. (#3849) +- Configuration for each metric instrument in `go.opentelemetry.io/otel/sdk/metric/instrument`. (#3895) +- The internal logging introduces a warning level verbosity equal to `V(1)`. (#3900) +- Added a log message warning about usage of `SimpleSpanProcessor` in production environments. (#3854) + +### Changed + +- Optimize memory allocation when creation a new `Set` using `NewSet` or `NewSetWithFiltered` in `go.opentelemetry.io/otel/attribute`. (#3832) +- Optimize memory allocation when creation new metric instruments in `go.opentelemetry.io/otel/sdk/metric`. (#3832) +- Avoid creating new objects on all calls to `WithDeferredSetup` and `SkipContextSetup` in OpenTracing bridge. (#3833) +- The `New` and `Detect` functions from `go.opentelemetry.io/otel/sdk/resource` return errors that wrap underlying errors instead of just containing the underlying error strings. (#3844) +- Both the `Histogram` and `HistogramDataPoint` are redefined with a generic argument of `[N int64 | float64]` in `go.opentelemetry.io/otel/sdk/metric/metricdata`. (#3849) +- The metric `Export` interface from `go.opentelemetry.io/otel/sdk/metric` accepts a `*ResourceMetrics` instead of `ResourceMetrics`. (#3853) +- Rename `Asynchronous` to `Observable` in `go.opentelemetry.io/otel/metric/instrument`. (#3892) +- Rename `Int64ObserverOption` to `Int64ObservableOption` in `go.opentelemetry.io/otel/metric/instrument`. (#3895) +- Rename `Float64ObserverOption` to `Float64ObservableOption` in `go.opentelemetry.io/otel/metric/instrument`. (#3895) +- The internal logging changes the verbosity level of info to `V(4)`, the verbosity level of debug to `V(8)`. (#3900) + +### Fixed + +- `TracerProvider` consistently doesn't allow to register a `SpanProcessor` after shutdown. (#3845) + +### Removed + +- The deprecated `go.opentelemetry.io/otel/metric/global` package is removed. (#3829) +- The unneeded `Synchronous` interface in `go.opentelemetry.io/otel/metric/instrument` was removed. (#3892) +- The `Float64ObserverConfig` and `NewFloat64ObserverConfig` in `go.opentelemetry.io/otel/sdk/metric/instrument`. + Use the added `float64` instrument configuration instead. (#3895) +- The `Int64ObserverConfig` and `NewInt64ObserverConfig` in `go.opentelemetry.io/otel/sdk/metric/instrument`. + Use the added `int64` instrument configuration instead. (#3895) +- The `NewNoopMeter` function in `go.opentelemetry.io/otel/metric`, use `NewMeterProvider().Meter("")` instead. (#3893) + +## [1.15.0-rc.1/0.38.0-rc.1] 2023-03-01 + +This is a release candidate for the v1.15.0/v0.38.0 release. +That release will include the `v1` release of the OpenTelemetry Go metric API and will provide stability guarantees of that API. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +This release drops the compatibility guarantee of [Go 1.18]. + +### Added + +- Support global `MeterProvider` in `go.opentelemetry.io/otel`. (#3818) + - Use `Meter` for a `metric.Meter` from the global `metric.MeterProvider`. + - Use `GetMeterProivder` for a global `metric.MeterProvider`. + - Use `SetMeterProivder` to set the global `metric.MeterProvider`. + +### Changed + +- Dropped compatibility testing for [Go 1.18]. + The project no longer guarantees support for this version of Go. (#3813) + +### Fixed + +- Handle empty environment variable as it they were not set. (#3764) +- Clarify the `httpconv` and `netconv` packages in `go.opentelemetry.io/otel/semconv/*` provide tracing semantic conventions. (#3823) +- Fix race conditions in `go.opentelemetry.io/otel/exporters/metric/prometheus` that could cause a panic. (#3899) +- Fix sending nil `scopeInfo` to metrics channel in `go.opentelemetry.io/otel/exporters/metric/prometheus` that could cause a panic in `github.com/prometheus/client_golang/prometheus`. (#3899) + +### Deprecated + +- The `go.opentelemetry.io/otel/metric/global` package is deprecated. + Use `go.opentelemetry.io/otel` instead. (#3818) + +### Removed + +- The deprecated `go.opentelemetry.io/otel/metric/unit` package is removed. (#3814) + +## [1.14.0/0.37.0/0.0.4] 2023-02-27 + +This release is the last to support [Go 1.18]. +The next release will require at least [Go 1.19]. + +### Added + +- The `event` type semantic conventions are added to `go.opentelemetry.io/otel/semconv/v1.17.0`. (#3697) +- Support [Go 1.20]. (#3693) +- The `go.opentelemetry.io/otel/semconv/v1.18.0` package. + The package contains semantic conventions from the `v1.18.0` version of the OpenTelemetry specification. (#3719) + - The following `const` renames from `go.opentelemetry.io/otel/semconv/v1.17.0` are included: + - `OtelScopeNameKey` -> `OTelScopeNameKey` + - `OtelScopeVersionKey` -> `OTelScopeVersionKey` + - `OtelLibraryNameKey` -> `OTelLibraryNameKey` + - `OtelLibraryVersionKey` -> `OTelLibraryVersionKey` + - `OtelStatusCodeKey` -> `OTelStatusCodeKey` + - `OtelStatusDescriptionKey` -> `OTelStatusDescriptionKey` + - `OtelStatusCodeOk` -> `OTelStatusCodeOk` + - `OtelStatusCodeError` -> `OTelStatusCodeError` + - The following `func` renames from `go.opentelemetry.io/otel/semconv/v1.17.0` are included: + - `OtelScopeName` -> `OTelScopeName` + - `OtelScopeVersion` -> `OTelScopeVersion` + - `OtelLibraryName` -> `OTelLibraryName` + - `OtelLibraryVersion` -> `OTelLibraryVersion` + - `OtelStatusDescription` -> `OTelStatusDescription` +- A `IsSampled` method is added to the `SpanContext` implementation in `go.opentelemetry.io/otel/bridge/opentracing` to expose the span sampled state. + See the [README](./bridge/opentracing/README.md) for more information. (#3570) +- The `WithInstrumentationAttributes` option to `go.opentelemetry.io/otel/metric`. (#3738) +- The `WithInstrumentationAttributes` option to `go.opentelemetry.io/otel/trace`. (#3739) +- The following environment variables are supported by the periodic `Reader` in `go.opentelemetry.io/otel/sdk/metric`. (#3763) + - `OTEL_METRIC_EXPORT_INTERVAL` sets the time between collections and exports. + - `OTEL_METRIC_EXPORT_TIMEOUT` sets the timeout an export is attempted. + +### Changed + +- Fall-back to `TextMapCarrier` when it's not `HttpHeader`s in `go.opentelemetry.io/otel/bridge/opentracing`. (#3679) +- The `Collect` method of the `"go.opentelemetry.io/otel/sdk/metric".Reader` interface is updated to accept the `metricdata.ResourceMetrics` value the collection will be made into. + This change is made to enable memory reuse by SDK users. (#3732) +- The `WithUnit` option in `go.opentelemetry.io/otel/sdk/metric/instrument` is updated to accept a `string` for the unit value. (#3776) + +### Fixed + +- Ensure `go.opentelemetry.io/otel` does not use generics. (#3723, #3725) +- Multi-reader `MeterProvider`s now export metrics for all readers, instead of just the first reader. (#3720, #3724) +- Remove use of deprecated `"math/rand".Seed` in `go.opentelemetry.io/otel/example/prometheus`. (#3733) +- Do not silently drop unknown schema data with `Parse` in `go.opentelemetry.io/otel/schema/v1.1`. (#3743) +- Data race issue in OTLP exporter retry mechanism. (#3755, #3756) +- Wrapping empty errors when exporting in `go.opentelemetry.io/otel/sdk/metric`. (#3698, #3772) +- Incorrect "all" and "resource" definition for schema files in `go.opentelemetry.io/otel/schema/v1.1`. (#3777) + +### Deprecated + +- The `go.opentelemetry.io/otel/metric/unit` package is deprecated. + Use the equivalent unit string instead. (#3776) + - Use `"1"` instead of `unit.Dimensionless` + - Use `"By"` instead of `unit.Bytes` + - Use `"ms"` instead of `unit.Milliseconds` + +## [1.13.0/0.36.0] 2023-02-07 + +### Added + +- Attribute `KeyValue` creations functions to `go.opentelemetry.io/otel/semconv/v1.17.0` for all non-enum semantic conventions. + These functions ensure semantic convention type correctness. (#3675) + +### Fixed + +- Removed the `http.target` attribute from being added by `ServerRequest` in the following packages. (#3687) + - `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv` + - `go.opentelemetry.io/otel/semconv/v1.14.0/httpconv` + - `go.opentelemetry.io/otel/semconv/v1.15.0/httpconv` + - `go.opentelemetry.io/otel/semconv/v1.16.0/httpconv` + - `go.opentelemetry.io/otel/semconv/v1.17.0/httpconv` + +### Removed + +- The deprecated `go.opentelemetry.io/otel/metric/instrument/asyncfloat64` package is removed. (#3631) +- The deprecated `go.opentelemetry.io/otel/metric/instrument/asyncint64` package is removed. (#3631) +- The deprecated `go.opentelemetry.io/otel/metric/instrument/syncfloat64` package is removed. (#3631) +- The deprecated `go.opentelemetry.io/otel/metric/instrument/syncint64` package is removed. (#3631) + +## [1.12.0/0.35.0] 2023-01-28 + +### Added + +- The `WithInt64Callback` option to `go.opentelemetry.io/otel/metric/instrument`. + This options is used to configure `int64` Observer callbacks during their creation. (#3507) +- The `WithFloat64Callback` option to `go.opentelemetry.io/otel/metric/instrument`. + This options is used to configure `float64` Observer callbacks during their creation. (#3507) +- The `Producer` interface and `Reader.RegisterProducer(Producer)` to `go.opentelemetry.io/otel/sdk/metric`. + These additions are used to enable external metric Producers. (#3524) +- The `Callback` function type to `go.opentelemetry.io/otel/metric`. + This new named function type is registered with a `Meter`. (#3564) +- The `go.opentelemetry.io/otel/semconv/v1.13.0` package. + The package contains semantic conventions from the `v1.13.0` version of the OpenTelemetry specification. (#3499) + - The `EndUserAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is merged into `ClientRequest` and `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `HTTPAttributesFromHTTPStatusCode` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is merged into `ClientResponse` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `HTTPClientAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ClientRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `HTTPServerAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `HTTPServerMetricAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `NetAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is split into `Transport` in `go.opentelemetry.io/otel/semconv/v1.13.0/netconv` and `ClientRequest` or `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `SpanStatusFromHTTPStatusCode` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ClientStatus` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `SpanStatusFromHTTPStatusCodeAndSpanKind` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is split into `ClientStatus` and `ServerStatus` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `Client` function is included in `go.opentelemetry.io/otel/semconv/v1.13.0/netconv` to generate attributes for a `net.Conn`. + - The `Server` function is included in `go.opentelemetry.io/otel/semconv/v1.13.0/netconv` to generate attributes for a `net.Listener`. +- The `go.opentelemetry.io/otel/semconv/v1.14.0` package. + The package contains semantic conventions from the `v1.14.0` version of the OpenTelemetry specification. (#3566) +- The `go.opentelemetry.io/otel/semconv/v1.15.0` package. + The package contains semantic conventions from the `v1.15.0` version of the OpenTelemetry specification. (#3578) +- The `go.opentelemetry.io/otel/semconv/v1.16.0` package. + The package contains semantic conventions from the `v1.16.0` version of the OpenTelemetry specification. (#3579) +- Metric instruments to `go.opentelemetry.io/otel/metric/instrument`. + These instruments are use as replacements of the deprecated `go.opentelemetry.io/otel/metric/instrument/{asyncfloat64,asyncint64,syncfloat64,syncint64}` packages.(#3575, #3586) + - `Float64ObservableCounter` replaces the `asyncfloat64.Counter` + - `Float64ObservableUpDownCounter` replaces the `asyncfloat64.UpDownCounter` + - `Float64ObservableGauge` replaces the `asyncfloat64.Gauge` + - `Int64ObservableCounter` replaces the `asyncint64.Counter` + - `Int64ObservableUpDownCounter` replaces the `asyncint64.UpDownCounter` + - `Int64ObservableGauge` replaces the `asyncint64.Gauge` + - `Float64Counter` replaces the `syncfloat64.Counter` + - `Float64UpDownCounter` replaces the `syncfloat64.UpDownCounter` + - `Float64Histogram` replaces the `syncfloat64.Histogram` + - `Int64Counter` replaces the `syncint64.Counter` + - `Int64UpDownCounter` replaces the `syncint64.UpDownCounter` + - `Int64Histogram` replaces the `syncint64.Histogram` +- `NewTracerProvider` to `go.opentelemetry.io/otel/bridge/opentracing`. + This is used to create `WrapperTracer` instances from a `TracerProvider`. (#3116) +- The `Extrema` type to `go.opentelemetry.io/otel/sdk/metric/metricdata`. + This type is used to represent min/max values and still be able to distinguish unset and zero values. (#3487) +- The `go.opentelemetry.io/otel/semconv/v1.17.0` package. + The package contains semantic conventions from the `v1.17.0` version of the OpenTelemetry specification. (#3599) + +### Changed + +- Jaeger and Zipkin exporter use `github.com/go-logr/logr` as the logging interface, and add the `WithLogr` option. (#3497, #3500) +- Instrument configuration in `go.opentelemetry.io/otel/metric/instrument` is split into specific options and configuration based on the instrument type. (#3507) + - Use the added `Int64Option` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/syncint64`. + - Use the added `Float64Option` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/syncfloat64`. + - Use the added `Int64ObserverOption` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/asyncint64`. + - Use the added `Float64ObserverOption` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/asyncfloat64`. +- Return a `Registration` from the `RegisterCallback` method of a `Meter` in the `go.opentelemetry.io/otel/metric` package. + This `Registration` can be used to unregister callbacks. (#3522) +- Global error handler uses an atomic value instead of a mutex. (#3543) +- Add `NewMetricProducer` to `go.opentelemetry.io/otel/bridge/opencensus`, which can be used to pass OpenCensus metrics to an OpenTelemetry Reader. (#3541) +- Global logger uses an atomic value instead of a mutex. (#3545) +- The `Shutdown` method of the `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` releases all computational resources when called the first time. (#3551) +- The `Sampler` returned from `TraceIDRatioBased` `go.opentelemetry.io/otel/sdk/trace` now uses the rightmost bits for sampling decisions. + This fixes random sampling when using ID generators like `xray.IDGenerator` and increasing parity with other language implementations. (#3557) +- Errors from `go.opentelemetry.io/otel/exporters/otlp/otlptrace` exporters are wrapped in errors identifying their signal name. + Existing users of the exporters attempting to identify specific errors will need to use `errors.Unwrap()` to get the underlying error. (#3516) +- Exporters from `go.opentelemetry.io/otel/exporters/otlp` will print the final retryable error message when attempts to retry time out. (#3514) +- The instrument kind names in `go.opentelemetry.io/otel/sdk/metric` are updated to match the API. (#3562) + - `InstrumentKindSyncCounter` is renamed to `InstrumentKindCounter` + - `InstrumentKindSyncUpDownCounter` is renamed to `InstrumentKindUpDownCounter` + - `InstrumentKindSyncHistogram` is renamed to `InstrumentKindHistogram` + - `InstrumentKindAsyncCounter` is renamed to `InstrumentKindObservableCounter` + - `InstrumentKindAsyncUpDownCounter` is renamed to `InstrumentKindObservableUpDownCounter` + - `InstrumentKindAsyncGauge` is renamed to `InstrumentKindObservableGauge` +- The `RegisterCallback` method of the `Meter` in `go.opentelemetry.io/otel/metric` changed. + - The named `Callback` replaces the inline function parameter. (#3564) + - `Callback` is required to return an error. (#3576) + - `Callback` accepts the added `Observer` parameter added. + This new parameter is used by `Callback` implementations to observe values for asynchronous instruments instead of calling the `Observe` method of the instrument directly. (#3584) + - The slice of `instrument.Asynchronous` is now passed as a variadic argument. (#3587) +- The exporter from `go.opentelemetry.io/otel/exporters/zipkin` is updated to use the `v1.16.0` version of semantic conventions. + This means it no longer uses the removed `net.peer.ip` or `http.host` attributes to determine the remote endpoint. + Instead it uses the `net.sock.peer` attributes. (#3581) +- The `Min` and `Max` fields of the `HistogramDataPoint` in `go.opentelemetry.io/otel/sdk/metric/metricdata` are now defined with the added `Extrema` type instead of a `*float64`. (#3487) + +### Fixed + +- Asynchronous instruments that use sum aggregators and attribute filters correctly add values from equivalent attribute sets that have been filtered. (#3439, #3549) +- The `RegisterCallback` method of the `Meter` from `go.opentelemetry.io/otel/sdk/metric` only registers a callback for instruments created by that meter. + Trying to register a callback with instruments from a different meter will result in an error being returned. (#3584) + +### Deprecated + +- The `NewMetricExporter` in `go.opentelemetry.io/otel/bridge/opencensus` is deprecated. + Use `NewMetricProducer` instead. (#3541) +- The `go.opentelemetry.io/otel/metric/instrument/asyncfloat64` package is deprecated. + Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575) +- The `go.opentelemetry.io/otel/metric/instrument/asyncint64` package is deprecated. + Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575) +- The `go.opentelemetry.io/otel/metric/instrument/syncfloat64` package is deprecated. + Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575) +- The `go.opentelemetry.io/otel/metric/instrument/syncint64` package is deprecated. + Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575) +- The `NewWrappedTracerProvider` in `go.opentelemetry.io/otel/bridge/opentracing` is now deprecated. + Use `NewTracerProvider` instead. (#3116) + +### Removed + +- The deprecated `go.opentelemetry.io/otel/sdk/metric/view` package is removed. (#3520) +- The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/asyncint64` is removed. + Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530) + - The `Counter` method is replaced by `Meter.Int64ObservableCounter` + - The `UpDownCounter` method is replaced by `Meter.Int64ObservableUpDownCounter` + - The `Gauge` method is replaced by `Meter.Int64ObservableGauge` +- The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/asyncfloat64` is removed. + Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530) + - The `Counter` method is replaced by `Meter.Float64ObservableCounter` + - The `UpDownCounter` method is replaced by `Meter.Float64ObservableUpDownCounter` + - The `Gauge` method is replaced by `Meter.Float64ObservableGauge` +- The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/syncint64` is removed. + Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530) + - The `Counter` method is replaced by `Meter.Int64Counter` + - The `UpDownCounter` method is replaced by `Meter.Int64UpDownCounter` + - The `Histogram` method is replaced by `Meter.Int64Histogram` +- The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/syncfloat64` is removed. + Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530) + - The `Counter` method is replaced by `Meter.Float64Counter` + - The `UpDownCounter` method is replaced by `Meter.Float64UpDownCounter` + - The `Histogram` method is replaced by `Meter.Float64Histogram` + +## [1.11.2/0.34.0] 2022-12-05 + +### Added + +- The `WithView` `Option` is added to the `go.opentelemetry.io/otel/sdk/metric` package. + This option is used to configure the view(s) a `MeterProvider` will use for all `Reader`s that are registered with it. (#3387) +- Add Instrumentation Scope and Version as info metric and label in Prometheus exporter. + This can be disabled using the `WithoutScopeInfo()` option added to that package.(#3273, #3357) +- OTLP exporters now recognize: (#3363) + - `OTEL_EXPORTER_OTLP_INSECURE` + - `OTEL_EXPORTER_OTLP_TRACES_INSECURE` + - `OTEL_EXPORTER_OTLP_METRICS_INSECURE` + - `OTEL_EXPORTER_OTLP_CLIENT_KEY` + - `OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY` + - `OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY` + - `OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE` + - `OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE` + - `OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE` +- The `View` type and related `NewView` function to create a view according to the OpenTelemetry specification are added to `go.opentelemetry.io/otel/sdk/metric`. + These additions are replacements for the `View` type and `New` function from `go.opentelemetry.io/otel/sdk/metric/view`. (#3459) +- The `Instrument` and `InstrumentKind` type are added to `go.opentelemetry.io/otel/sdk/metric`. + These additions are replacements for the `Instrument` and `InstrumentKind` types from `go.opentelemetry.io/otel/sdk/metric/view`. (#3459) +- The `Stream` type is added to `go.opentelemetry.io/otel/sdk/metric` to define a metric data stream a view will produce. (#3459) +- The `AssertHasAttributes` allows instrument authors to test that datapoints returned have appropriate attributes. (#3487) + +### Changed + +- The `"go.opentelemetry.io/otel/sdk/metric".WithReader` option no longer accepts views to associate with the `Reader`. + Instead, views are now registered directly with the `MeterProvider` via the new `WithView` option. + The views registered with the `MeterProvider` apply to all `Reader`s. (#3387) +- The `Temporality(view.InstrumentKind) metricdata.Temporality` and `Aggregation(view.InstrumentKind) aggregation.Aggregation` methods are added to the `"go.opentelemetry.io/otel/sdk/metric".Exporter` interface. (#3260) +- The `Temporality(view.InstrumentKind) metricdata.Temporality` and `Aggregation(view.InstrumentKind) aggregation.Aggregation` methods are added to the `"go.opentelemetry.io/otel/exporters/otlp/otlpmetric".Client` interface. (#3260) +- The `WithTemporalitySelector` and `WithAggregationSelector` `ReaderOption`s have been changed to `ManualReaderOption`s in the `go.opentelemetry.io/otel/sdk/metric` package. (#3260) +- The periodic reader in the `go.opentelemetry.io/otel/sdk/metric` package now uses the temporality and aggregation selectors from its configured exporter instead of accepting them as options. (#3260) + +### Fixed + +- The `go.opentelemetry.io/otel/exporters/prometheus` exporter fixes duplicated `_total` suffixes. (#3369) +- Remove comparable requirement for `Reader`s. (#3387) +- Cumulative metrics from the OpenCensus bridge (`go.opentelemetry.io/otel/bridge/opencensus`) are defined as monotonic sums, instead of non-monotonic. (#3389) +- Asynchronous counters (`Counter` and `UpDownCounter`) from the metric SDK now produce delta sums when configured with delta temporality. (#3398) +- Exported `Status` codes in the `go.opentelemetry.io/otel/exporters/zipkin` exporter are now exported as all upper case values. (#3340) +- `Aggregation`s from `go.opentelemetry.io/otel/sdk/metric` with no data are not exported. (#3394, #3436) +- Re-enabled Attribute Filters in the Metric SDK. (#3396) +- Asynchronous callbacks are only called if they are registered with at least one instrument that does not use drop aggragation. (#3408) +- Do not report empty partial-success responses in the `go.opentelemetry.io/otel/exporters/otlp` exporters. (#3438, #3432) +- Handle partial success responses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` exporters. (#3162, #3440) +- Prevent duplicate Prometheus description, unit, and type. (#3469) +- Prevents panic when using incorrect `attribute.Value.As[Type]Slice()`. (#3489) + +### Removed + +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric.Client` interface is removed. (#3486) +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric.New` function is removed. Use the `otlpmetric[http|grpc].New` directly. (#3486) + +### Deprecated + +- The `go.opentelemetry.io/otel/sdk/metric/view` package is deprecated. + Use `Instrument`, `InstrumentKind`, `View`, and `NewView` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3476) + +## [1.11.1/0.33.0] 2022-10-19 + +### Added + +- The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` registers with a Prometheus registerer on creation. + By default, it will register with the default Prometheus registerer. + A non-default registerer can be used by passing the `WithRegisterer` option. (#3239) +- Added the `WithAggregationSelector` option to the `go.opentelemetry.io/otel/exporters/prometheus` package to change the default `AggregationSelector` used. (#3341) +- The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` converts the `Resource` associated with metric exports into a `target_info` metric. (#3285) + +### Changed + +- The `"go.opentelemetry.io/otel/exporters/prometheus".New` function is updated to return an error. + It will return an error if the exporter fails to register with Prometheus. (#3239) + +### Fixed + +- The URL-encoded values from the `OTEL_RESOURCE_ATTRIBUTES` environment variable are decoded. (#2963) +- The `baggage.NewMember` function decodes the `value` parameter instead of directly using it. + This fixes the implementation to be compliant with the W3C specification. (#3226) +- Slice attributes of the `attribute` package are now comparable based on their value, not instance. (#3108 #3252) +- The `Shutdown` and `ForceFlush` methods of the `"go.opentelemetry.io/otel/sdk/trace".TraceProvider` no longer return an error when no processor is registered. (#3268) +- The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` cumulatively sums histogram buckets. (#3281) +- The sum of each histogram data point is now uniquely exported by the `go.opentelemetry.io/otel/exporters/otlpmetric` exporters. (#3284, #3293) +- Recorded values for asynchronous counters (`Counter` and `UpDownCounter`) are interpreted as exact, not incremental, sum values by the metric SDK. (#3350, #3278) +- `UpDownCounters` are now correctly output as Prometheus gauges in the `go.opentelemetry.io/otel/exporters/prometheus` exporter. (#3358) +- The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` no longer describes the metrics it will send to Prometheus on startup. + Instead the exporter is defined as an "unchecked" collector for Prometheus. + This fixes the `reader is not registered` warning currently emitted on startup. (#3291 #3342) +- The `go.opentelemetry.io/otel/exporters/prometheus` exporter now correctly adds `_total` suffixes to counter metrics. (#3360) +- The `go.opentelemetry.io/otel/exporters/prometheus` exporter now adds a unit suffix to metric names. + This can be disabled using the `WithoutUnits()` option added to that package. (#3352) + +## [1.11.0/0.32.3] 2022-10-12 + +### Added + +- Add default User-Agent header to OTLP exporter requests (`go.opentelemetry.io/otel/exporters/otlptrace/otlptracegrpc` and `go.opentelemetry.io/otel/exporters/otlptrace/otlptracehttp`). (#3261) + +### Changed + +- `span.SetStatus` has been updated such that calls that lower the status are now no-ops. (#3214) +- Upgrade `golang.org/x/sys/unix` from `v0.0.0-20210423185535-09eb48e85fd7` to `v0.0.0-20220919091848-fb04ddd9f9c8`. + This addresses [GO-2022-0493](https://pkg.go.dev/vuln/GO-2022-0493). (#3235) + +## [0.32.2] Metric SDK (Alpha) - 2022-10-11 + +### Added + +- Added an example of using metric views to customize instruments. (#3177) +- Add default User-Agent header to OTLP exporter requests (`go.opentelemetry.io/otel/exporters/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlpmetric/otlpmetrichttp`). (#3261) + +### Changed + +- Flush pending measurements with the `PeriodicReader` in the `go.opentelemetry.io/otel/sdk/metric` when `ForceFlush` or `Shutdown` are called. (#3220) +- Update histogram default bounds to match the requirements of the latest specification. (#3222) +- Encode the HTTP status code in the OpenTracing bridge (`go.opentelemetry.io/otel/bridge/opentracing`) as an integer. (#3265) + +### Fixed + +- Use default view if instrument does not match any registered view of a reader. (#3224, #3237) +- Return the same instrument every time a user makes the exact same instrument creation call. (#3229, #3251) +- Return the existing instrument when a view transforms a creation call to match an existing instrument. (#3240, #3251) +- Log a warning when a conflicting instrument (e.g. description, unit, data-type) is created instead of returning an error. (#3251) +- The OpenCensus bridge no longer sends empty batches of metrics. (#3263) + +## [0.32.1] Metric SDK (Alpha) - 2022-09-22 + +### Changed + +- The Prometheus exporter sanitizes OpenTelemetry instrument names when exporting. + Invalid characters are replaced with `_`. (#3212) + +### Added + +- The metric portion of the OpenCensus bridge (`go.opentelemetry.io/otel/bridge/opencensus`) has been reintroduced. (#3192) +- The OpenCensus bridge example (`go.opentelemetry.io/otel/example/opencensus`) has been reintroduced. (#3206) + +### Fixed + +- Updated go.mods to point to valid versions of the sdk. (#3216) +- Set the `MeterProvider` resource on all exported metric data. (#3218) + +## [0.32.0] Revised Metric SDK (Alpha) - 2022-09-18 + +### Changed + +- The metric SDK in `go.opentelemetry.io/otel/sdk/metric` is completely refactored to comply with the OpenTelemetry specification. + Please see the package documentation for how the new SDK is initialized and configured. (#3175) +- Update the minimum supported go version to go1.18. Removes support for go1.17 (#3179) + +### Removed + +- The metric portion of the OpenCensus bridge (`go.opentelemetry.io/otel/bridge/opencensus`) has been removed. + A new bridge compliant with the revised metric SDK will be added back in a future release. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/aggregator/histogram` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/aggregator/sum` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/aggregator` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/controller/basic` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/controller/controllertest` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/controller/time` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/export/aggregation` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/export` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/metrictest` package is removed. + A replacement package that supports the new metric SDK will be added back in a future release. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/number` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/processor/basic` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/processor/processortest` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/processor/reducer` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/registry` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/sdkapi` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/selector/simple` package is removed, see the new metric SDK. (#3175) +- The `"go.opentelemetry.io/otel/sdk/metric".ErrUninitializedInstrument` variable was removed. (#3175) +- The `"go.opentelemetry.io/otel/sdk/metric".ErrBadInstrument` variable was removed. (#3175) +- The `"go.opentelemetry.io/otel/sdk/metric".Accumulator` type was removed, see the `MeterProvider`in the new metric SDK. (#3175) +- The `"go.opentelemetry.io/otel/sdk/metric".NewAccumulator` function was removed, see `NewMeterProvider`in the new metric SDK. (#3175) +- The deprecated `"go.opentelemetry.io/otel/sdk/metric".AtomicFieldOffsets` function was removed. (#3175) + +## [1.10.0] - 2022-09-09 + +### Added + +- Support Go 1.19. (#3077) + Include compatibility testing and document support. (#3077) +- Support the OTLP ExportTracePartialSuccess response; these are passed to the registered error handler. (#3106) +- Upgrade go.opentelemetry.io/proto/otlp from v0.18.0 to v0.19.0 (#3107) + +### Changed + +- Fix misidentification of OpenTelemetry `SpanKind` in OpenTracing bridge (`go.opentelemetry.io/otel/bridge/opentracing`). (#3096) +- Attempting to start a span with a nil `context` will no longer cause a panic. (#3110) +- All exporters will be shutdown even if one reports an error (#3091) +- Ensure valid UTF-8 when truncating over-length attribute values. (#3156) + +## [1.9.0/0.0.3] - 2022-08-01 + +### Added + +- Add support for Schema Files format 1.1.x (metric "split" transform) with the new `go.opentelemetry.io/otel/schema/v1.1` package. (#2999) +- Add the `go.opentelemetry.io/otel/semconv/v1.11.0` package. + The package contains semantic conventions from the `v1.11.0` version of the OpenTelemetry specification. (#3009) +- Add the `go.opentelemetry.io/otel/semconv/v1.12.0` package. + The package contains semantic conventions from the `v1.12.0` version of the OpenTelemetry specification. (#3010) +- Add the `http.method` attribute to HTTP server metric from all `go.opentelemetry.io/otel/semconv/*` packages. (#3018) + +### Fixed + +- Invalid warning for context setup being deferred in `go.opentelemetry.io/otel/bridge/opentracing` package. (#3029) + +## [1.8.0/0.31.0] - 2022-07-08 + +### Added + +- Add support for `opentracing.TextMap` format in the `Inject` and `Extract` methods +of the `"go.opentelemetry.io/otel/bridge/opentracing".BridgeTracer` type. (#2911) + +### Changed + +- The `crosslink` make target has been updated to use the `go.opentelemetry.io/build-tools/crosslink` package. (#2886) +- In the `go.opentelemetry.io/otel/sdk/instrumentation` package rename `Library` to `Scope` and alias `Library` as `Scope` (#2976) +- Move metric no-op implementation form `nonrecording` to `metric` package. (#2866) + +### Removed + +- Support for go1.16. Support is now only for go1.17 and go1.18 (#2917) + +### Deprecated + +- The `Library` struct in the `go.opentelemetry.io/otel/sdk/instrumentation` package is deprecated. + Use the equivalent `Scope` struct instead. (#2977) +- The `ReadOnlySpan.InstrumentationLibrary` method from the `go.opentelemetry.io/otel/sdk/trace` package is deprecated. + Use the equivalent `ReadOnlySpan.InstrumentationScope` method instead. (#2977) + +## [1.7.0/0.30.0] - 2022-04-28 + +### Added + +- Add the `go.opentelemetry.io/otel/semconv/v1.8.0` package. + The package contains semantic conventions from the `v1.8.0` version of the OpenTelemetry specification. (#2763) +- Add the `go.opentelemetry.io/otel/semconv/v1.9.0` package. + The package contains semantic conventions from the `v1.9.0` version of the OpenTelemetry specification. (#2792) +- Add the `go.opentelemetry.io/otel/semconv/v1.10.0` package. + The package contains semantic conventions from the `v1.10.0` version of the OpenTelemetry specification. (#2842) +- Added an in-memory exporter to metrictest to aid testing with a full SDK. (#2776) + +### Fixed + +- Globally delegated instruments are unwrapped before delegating asynchronous callbacks. (#2784) +- Remove import of `testing` package in non-tests builds of the `go.opentelemetry.io/otel` package. (#2786) + +### Changed + +- The `WithLabelEncoder` option from the `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` package is renamed to `WithAttributeEncoder`. (#2790) +- The `LabelFilterSelector` interface from `go.opentelemetry.io/otel/sdk/metric/processor/reducer` is renamed to `AttributeFilterSelector`. + The method included in the renamed interface also changed from `LabelFilterFor` to `AttributeFilterFor`. (#2790) +- The `Metadata.Labels` method from the `go.opentelemetry.io/otel/sdk/metric/export` package is renamed to `Metadata.Attributes`. + Consequentially, the `Record` type from the same package also has had the embedded method renamed. (#2790) + +### Deprecated + +- The `Iterator.Label` method in the `go.opentelemetry.io/otel/attribute` package is deprecated. + Use the equivalent `Iterator.Attribute` method instead. (#2790) +- The `Iterator.IndexedLabel` method in the `go.opentelemetry.io/otel/attribute` package is deprecated. + Use the equivalent `Iterator.IndexedAttribute` method instead. (#2790) +- The `MergeIterator.Label` method in the `go.opentelemetry.io/otel/attribute` package is deprecated. + Use the equivalent `MergeIterator.Attribute` method instead. (#2790) + +### Removed + +- Removed the `Batch` type from the `go.opentelemetry.io/otel/sdk/metric/metrictest` package. (#2864) +- Removed the `Measurement` type from the `go.opentelemetry.io/otel/sdk/metric/metrictest` package. (#2864) + +## [0.29.0] - 2022-04-11 + +### Added + +- The metrics global package was added back into several test files. (#2764) +- The `Meter` function is added back to the `go.opentelemetry.io/otel/metric/global` package. + This function is a convenience function equivalent to calling `global.MeterProvider().Meter(...)`. (#2750) + +### Removed + +- Removed module the `go.opentelemetry.io/otel/sdk/export/metric`. + Use the `go.opentelemetry.io/otel/sdk/metric` module instead. (#2720) + +### Changed + +- Don't panic anymore when setting a global MeterProvider to itself. (#2749) +- Upgrade `go.opentelemetry.io/proto/otlp` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` from `v0.12.1` to `v0.15.0`. + This replaces the use of the now deprecated `InstrumentationLibrary` and `InstrumentationLibraryMetrics` types and fields in the proto library with the equivalent `InstrumentationScope` and `ScopeMetrics`. (#2748) + +## [1.6.3] - 2022-04-07 + +### Fixed + +- Allow non-comparable global `MeterProvider`, `TracerProvider`, and `TextMapPropagator` types to be set. (#2772, #2773) + +## [1.6.2] - 2022-04-06 + +### Changed + +- Don't panic anymore when setting a global TracerProvider or TextMapPropagator to itself. (#2749) +- Upgrade `go.opentelemetry.io/proto/otlp` in `go.opentelemetry.io/otel/exporters/otlp/otlptrace` from `v0.12.1` to `v0.15.0`. + This replaces the use of the now deprecated `InstrumentationLibrary` and `InstrumentationLibrarySpans` types and fields in the proto library with the equivalent `InstrumentationScope` and `ScopeSpans`. (#2748) + +## [1.6.1] - 2022-03-28 + +### Fixed + +- The `go.opentelemetry.io/otel/schema/*` packages now use the correct schema URL for their `SchemaURL` constant. + Instead of using `"https://opentelemetry.io/schemas/v"` they now use the correct URL without a `v` prefix, `"https://opentelemetry.io/schemas/"`. (#2743, #2744) + +### Security + +- Upgrade `go.opentelemetry.io/proto/otlp` from `v0.12.0` to `v0.12.1`. + This includes an indirect upgrade of `github.com/grpc-ecosystem/grpc-gateway` which resolves [a vulnerability](https://nvd.nist.gov/vuln/detail/CVE-2019-11254) from `gopkg.in/yaml.v2` in version `v2.2.3`. (#2724, #2728) + +## [1.6.0/0.28.0] - 2022-03-23 + +### ⚠️ Notice ⚠️ + +This update is a breaking change of the unstable Metrics API. +Code instrumented with the `go.opentelemetry.io/otel/metric` will need to be modified. + +### Added + +- Add metrics exponential histogram support. + New mapping functions have been made available in `sdk/metric/aggregator/exponential/mapping` for other OpenTelemetry projects to take dependencies on. (#2502) +- Add Go 1.18 to our compatibility tests. (#2679) +- Allow configuring the Sampler with the `OTEL_TRACES_SAMPLER` and `OTEL_TRACES_SAMPLER_ARG` environment variables. (#2305, #2517) +- Add the `metric/global` for obtaining and setting the global `MeterProvider`. (#2660) + +### Changed + +- The metrics API has been significantly changed to match the revised OpenTelemetry specification. + High-level changes include: + + - Synchronous and asynchronous instruments are now handled by independent `InstrumentProvider`s. + These `InstrumentProvider`s are managed with a `Meter`. + - Synchronous and asynchronous instruments are grouped into their own packages based on value types. + - Asynchronous callbacks can now be registered with a `Meter`. + + Be sure to check out the metric module documentation for more information on how to use the revised API. (#2587, #2660) + +### Fixed + +- Fallback to general attribute limits when span specific ones are not set in the environment. (#2675, #2677) + +## [1.5.0] - 2022-03-16 + +### Added + +- Log the Exporters configuration in the TracerProviders message. (#2578) +- Added support to configure the span limits with environment variables. + The following environment variables are supported. (#2606, #2637) + - `OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT` + - `OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT` + - `OTEL_SPAN_EVENT_COUNT_LIMIT` + - `OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT` + - `OTEL_SPAN_LINK_COUNT_LIMIT` + - `OTEL_LINK_ATTRIBUTE_COUNT_LIMIT` + + If the provided environment variables are invalid (negative), the default values would be used. +- Rename the `gc` runtime name to `go` (#2560) +- Add resource container ID detection. (#2418) +- Add span attribute value length limit. + The new `AttributeValueLengthLimit` field is added to the `"go.opentelemetry.io/otel/sdk/trace".SpanLimits` type to configure this limit for a `TracerProvider`. + The default limit for this resource is "unlimited". (#2637) +- Add the `WithRawSpanLimits` option to `go.opentelemetry.io/otel/sdk/trace`. + This option replaces the `WithSpanLimits` option. + Zero or negative values will not be changed to the default value like `WithSpanLimits` does. + Setting a limit to zero will effectively disable the related resource it limits and setting to a negative value will mean that resource is unlimited. + Consequentially, limits should be constructed using `NewSpanLimits` and updated accordingly. (#2637) + +### Changed + +- Drop oldest tracestate `Member` when capacity is reached. (#2592) +- Add event and link drop counts to the exported data from the `oltptrace` exporter. (#2601) +- Unify path cleaning functionally in the `otlpmetric` and `otlptrace` configuration. (#2639) +- Change the debug message from the `sdk/trace.BatchSpanProcessor` to reflect the count is cumulative. (#2640) +- Introduce new internal `envconfig` package for OTLP exporters. (#2608) +- If `http.Request.Host` is empty, fall back to use `URL.Host` when populating `http.host` in the `semconv` packages. (#2661) + +### Fixed + +- Remove the OTLP trace exporter limit of SpanEvents when exporting. (#2616) +- Default to port `4318` instead of `4317` for the `otlpmetrichttp` and `otlptracehttp` client. (#2614, #2625) +- Unlimited span limits are now supported (negative values). (#2636, #2637) + +### Deprecated + +- Deprecated `"go.opentelemetry.io/otel/sdk/trace".WithSpanLimits`. + Use `WithRawSpanLimits` instead. + That option allows setting unlimited and zero limits, this option does not. + This option will be kept until the next major version incremented release. (#2637) + +## [1.4.1] - 2022-02-16 + +### Fixed + +- Fix race condition in reading the dropped spans number for the `BatchSpanProcessor`. (#2615) + +## [1.4.0] - 2022-02-11 + +### Added + +- Use `OTEL_EXPORTER_ZIPKIN_ENDPOINT` environment variable to specify zipkin collector endpoint. (#2490) +- Log the configuration of `TracerProvider`s, and `Tracer`s for debugging. + To enable use a logger with Verbosity (V level) `>=1`. (#2500) +- Added support to configure the batch span-processor with environment variables. + The following environment variables are used. (#2515) + - `OTEL_BSP_SCHEDULE_DELAY` + - `OTEL_BSP_EXPORT_TIMEOUT` + - `OTEL_BSP_MAX_QUEUE_SIZE`. + - `OTEL_BSP_MAX_EXPORT_BATCH_SIZE` + +### Changed + +- Zipkin exporter exports `Resource` attributes in the `Tags` field. (#2589) + +### Deprecated + +- Deprecate module the `go.opentelemetry.io/otel/sdk/export/metric`. + Use the `go.opentelemetry.io/otel/sdk/metric` module instead. (#2382) +- Deprecate `"go.opentelemetry.io/otel/sdk/metric".AtomicFieldOffsets`. (#2445) + +### Fixed + +- Fixed the instrument kind for noop async instruments to correctly report an implementation. (#2461) +- Fix UDP packets overflowing with Jaeger payloads. (#2489, #2512) +- Change the `otlpmetric.Client` interface's `UploadMetrics` method to accept a single `ResourceMetrics` instead of a slice of them. (#2491) +- Specify explicit buckets in Prometheus example, fixing issue where example only has `+inf` bucket. (#2419, #2493) +- W3C baggage will now decode urlescaped values. (#2529) +- Baggage members are now only validated once, when calling `NewMember` and not also when adding it to the baggage itself. (#2522) +- The order attributes are dropped from spans in the `go.opentelemetry.io/otel/sdk/trace` package when capacity is reached is fixed to be in compliance with the OpenTelemetry specification. + Instead of dropping the least-recently-used attribute, the last added attribute is dropped. + This drop order still only applies to attributes with unique keys not already contained in the span. + If an attribute is added with a key already contained in the span, that attribute is updated to the new value being added. (#2576) + +### Removed + +- Updated `go.opentelemetry.io/proto/otlp` from `v0.11.0` to `v0.12.0`. This version removes a number of deprecated methods. (#2546) + - [`Metric.GetIntGauge()`](https://pkg.go.dev/go.opentelemetry.io/proto/otlp@v0.11.0/metrics/v1#Metric.GetIntGauge) + - [`Metric.GetIntHistogram()`](https://pkg.go.dev/go.opentelemetry.io/proto/otlp@v0.11.0/metrics/v1#Metric.GetIntHistogram) + - [`Metric.GetIntSum()`](https://pkg.go.dev/go.opentelemetry.io/proto/otlp@v0.11.0/metrics/v1#Metric.GetIntSum) + +## [1.3.0] - 2021-12-10 + +### ⚠️ Notice ⚠️ + +We have updated the project minimum supported Go version to 1.16 + +### Added + +- Added an internal Logger. + This can be used by the SDK and API to provide users with feedback of the internal state. + To enable verbose logs configure the logger which will print V(1) logs. For debugging information configure to print V(5) logs. (#2343) +- Add the `WithRetry` `Option` and the `RetryConfig` type to the `go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetrichttp` package to specify retry behavior consistently. (#2425) +- Add `SpanStatusFromHTTPStatusCodeAndSpanKind` to all `semconv` packages to return a span status code similar to `SpanStatusFromHTTPStatusCode`, but exclude `4XX` HTTP errors as span errors if the span is of server kind. (#2296) + +### Changed + +- The `"go.opentelemetry.io/otel/exporter/otel/otlptrace/otlptracegrpc".Client` now uses the underlying gRPC `ClientConn` to handle name resolution, TCP connection establishment (with retries and backoff) and TLS handshakes, and handling errors on established connections by re-resolving the name and reconnecting. (#2329) +- The `"go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetricgrpc".Client` now uses the underlying gRPC `ClientConn` to handle name resolution, TCP connection establishment (with retries and backoff) and TLS handshakes, and handling errors on established connections by re-resolving the name and reconnecting. (#2425) +- The `"go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetricgrpc".RetrySettings` type is renamed to `RetryConfig`. (#2425) +- The `go.opentelemetry.io/otel/exporter/otel/*` gRPC exporters now default to using the host's root CA set if none are provided by the user and `WithInsecure` is not specified. (#2432) +- Change `resource.Default` to be evaluated the first time it is called, rather than on import. This allows the caller the option to update `OTEL_RESOURCE_ATTRIBUTES` first, such as with `os.Setenv`. (#2371) + +### Fixed + +- The `go.opentelemetry.io/otel/exporter/otel/*` exporters are updated to handle per-signal and universal endpoints according to the OpenTelemetry specification. + Any per-signal endpoint set via an `OTEL_EXPORTER_OTLP__ENDPOINT` environment variable is now used without modification of the path. + When `OTEL_EXPORTER_OTLP_ENDPOINT` is set, if it contains a path, that path is used as a base path which per-signal paths are appended to. (#2433) +- Basic metric controller updated to use sync.Map to avoid blocking calls (#2381) +- The `go.opentelemetry.io/otel/exporter/jaeger` correctly sets the `otel.status_code` value to be a string of `ERROR` or `OK` instead of an integer code. (#2439, #2440) + +### Deprecated + +- Deprecated the `"go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetrichttp".WithMaxAttempts` `Option`, use the new `WithRetry` `Option` instead. (#2425) +- Deprecated the `"go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetrichttp".WithBackoff` `Option`, use the new `WithRetry` `Option` instead. (#2425) + +### Removed + +- Remove the metric Processor's ability to convert cumulative to delta aggregation temporality. (#2350) +- Remove the metric Bound Instruments interface and implementations. (#2399) +- Remove the metric MinMaxSumCount kind aggregation and the corresponding OTLP export path. (#2423) +- Metric SDK removes the "exact" aggregator for histogram instruments, as it performed a non-standard aggregation for OTLP export (creating repeated Gauge points) and worked its way into a number of confusing examples. (#2348) + +## [1.2.0] - 2021-11-12 + +### Changed + +- Metric SDK `export.ExportKind`, `export.ExportKindSelector` types have been renamed to `aggregation.Temporality` and `aggregation.TemporalitySelector` respectively to keep in line with current specification and protocol along with built-in selectors (e.g., `aggregation.CumulativeTemporalitySelector`, ...). (#2274) +- The Metric `Exporter` interface now requires a `TemporalitySelector` method instead of an `ExportKindSelector`. (#2274) +- Metrics API cleanup. The `metric/sdkapi` package has been created to relocate the API-to-SDK interface: + - The following interface types simply moved from `metric` to `metric/sdkapi`: `Descriptor`, `MeterImpl`, `InstrumentImpl`, `SyncImpl`, `BoundSyncImpl`, `AsyncImpl`, `AsyncRunner`, `AsyncSingleRunner`, and `AsyncBatchRunner` + - The following struct types moved and are replaced with type aliases, since they are exposed to the user: `Observation`, `Measurement`. + - The No-op implementations of sync and async instruments are no longer exported, new functions `sdkapi.NewNoopAsyncInstrument()` and `sdkapi.NewNoopSyncInstrument()` are provided instead. (#2271) +- Update the SDK `BatchSpanProcessor` to export all queued spans when `ForceFlush` is called. (#2080, #2335) + +### Added + +- Add the `"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc".WithGRPCConn` option so the exporter can reuse an existing gRPC connection. (#2002) +- Added a new `schema` module to help parse Schema Files in OTEP 0152 format. (#2267) +- Added a new `MapCarrier` to the `go.opentelemetry.io/otel/propagation` package to hold propagated cross-cutting concerns as a `map[string]string` held in memory. (#2334) + +## [1.1.0] - 2021-10-27 + +### Added + +- Add the `"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc".WithGRPCConn` option so the exporter can reuse an existing gRPC connection. (#2002) +- Add the `go.opentelemetry.io/otel/semconv/v1.7.0` package. + The package contains semantic conventions from the `v1.7.0` version of the OpenTelemetry specification. (#2320) +- Add the `go.opentelemetry.io/otel/semconv/v1.6.1` package. + The package contains semantic conventions from the `v1.6.1` version of the OpenTelemetry specification. (#2321) +- Add the `go.opentelemetry.io/otel/semconv/v1.5.0` package. + The package contains semantic conventions from the `v1.5.0` version of the OpenTelemetry specification. (#2322) + - When upgrading from the `semconv/v1.4.0` package note the following name changes: + - `K8SReplicasetUIDKey` -> `K8SReplicaSetUIDKey` + - `K8SReplicasetNameKey` -> `K8SReplicaSetNameKey` + - `K8SStatefulsetUIDKey` -> `K8SStatefulSetUIDKey` + - `k8SStatefulsetNameKey` -> `K8SStatefulSetNameKey` + - `K8SDaemonsetUIDKey` -> `K8SDaemonSetUIDKey` + - `K8SDaemonsetNameKey` -> `K8SDaemonSetNameKey` + +### Changed + +- Links added to a span will be dropped by the SDK if they contain an invalid span context (#2275). + +### Fixed + +- The `"go.opentelemetry.io/otel/semconv/v1.4.0".HTTPServerAttributesFromHTTPRequest` now correctly only sets the HTTP client IP attribute even if the connection was routed with proxies and there are multiple addresses in the `X-Forwarded-For` header. (#2282, #2284) +- The `"go.opentelemetry.io/otel/semconv/v1.4.0".NetAttributesFromHTTPRequest` function correctly handles IPv6 addresses as IP addresses and sets the correct net peer IP instead of the net peer hostname attribute. (#2283, #2285) +- The simple span processor shutdown method deterministically returns the exporter error status if it simultaneously finishes when the deadline is reached. (#2290, #2289) + +## [1.0.1] - 2021-10-01 + +### Fixed + +- json stdout exporter no longer crashes due to concurrency bug. (#2265) + +## [Metrics 0.24.0] - 2021-10-01 + +### Changed + +- NoopMeterProvider is now private and NewNoopMeterProvider must be used to obtain a noopMeterProvider. (#2237) +- The Metric SDK `Export()` function takes a new two-level reader interface for iterating over results one instrumentation library at a time. (#2197) + - The former `"go.opentelemetry.io/otel/sdk/export/metric".CheckpointSet` is renamed `Reader`. + - The new interface is named `"go.opentelemetry.io/otel/sdk/export/metric".InstrumentationLibraryReader`. + +## [1.0.0] - 2021-09-20 + +This is the first stable release for the project. +This release includes an API and SDK for the tracing signal that will comply with the stability guarantees defined by the projects [versioning policy](./VERSIONING.md). + +### Added + +- OTLP trace exporter now sets the `SchemaURL` field in the exported telemetry if the Tracer has `WithSchemaURL` option. (#2242) + +### Fixed + +- Slice-valued attributes can correctly be used as map keys. (#2223) + +### Removed + +- Removed the `"go.opentelemetry.io/otel/exporters/zipkin".WithSDKOptions` function. (#2248) +- Removed the deprecated package `go.opentelemetry.io/otel/oteltest`. (#2234) +- Removed the deprecated package `go.opentelemetry.io/otel/bridge/opencensus/utils`. (#2233) +- Removed deprecated functions, types, and methods from `go.opentelemetry.io/otel/attribute` package. + Use the typed functions and methods added to the package instead. (#2235) + - The `Key.Array` method is removed. + - The `Array` function is removed. + - The `Any` function is removed. + - The `ArrayValue` function is removed. + - The `AsArray` function is removed. + +## [1.0.0-RC3] - 2021-09-02 + +### Added + +- Added `ErrorHandlerFunc` to use a function as an `"go.opentelemetry.io/otel".ErrorHandler`. (#2149) +- Added `"go.opentelemetry.io/otel/trace".WithStackTrace` option to add a stack trace when using `span.RecordError` or when panic is handled in `span.End`. (#2163) +- Added typed slice attribute types and functionality to the `go.opentelemetry.io/otel/attribute` package to replace the existing array type and functions. (#2162) + - `BoolSlice`, `IntSlice`, `Int64Slice`, `Float64Slice`, and `StringSlice` replace the use of the `Array` function in the package. +- Added the `go.opentelemetry.io/otel/example/fib` example package. + Included is an example application that computes Fibonacci numbers. (#2203) + +### Changed + +- Metric instruments have been renamed to match the (feature-frozen) metric API specification: + - ValueRecorder becomes Histogram + - ValueObserver becomes Gauge + - SumObserver becomes CounterObserver + - UpDownSumObserver becomes UpDownCounterObserver + The API exported from this project is still considered experimental. (#2202) +- Metric SDK/API implementation type `InstrumentKind` moves into `sdkapi` sub-package. (#2091) +- The Metrics SDK export record no longer contains a Resource pointer, the SDK `"go.opentelemetry.io/otel/sdk/trace/export/metric".Exporter.Export()` function for push-based exporters now takes a single Resource argument, pull-based exporters use `"go.opentelemetry.io/otel/sdk/metric/controller/basic".Controller.Resource()`. (#2120) +- The JSON output of the `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` is harmonized now such that the output is "plain" JSON objects after each other of the form `{ ... } { ... } { ... }`. Earlier the JSON objects describing a span were wrapped in a slice for each `Exporter.ExportSpans` call, like `[ { ... } ][ { ... } { ... } ]`. Outputting JSON object directly after each other is consistent with JSON loggers, and a bit easier to parse and read. (#2196) +- Update the `NewTracerConfig`, `NewSpanStartConfig`, `NewSpanEndConfig`, and `NewEventConfig` function in the `go.opentelemetry.io/otel/trace` package to return their respective configurations as structs instead of pointers to the struct. (#2212) + +### Deprecated + +- The `go.opentelemetry.io/otel/bridge/opencensus/utils` package is deprecated. + All functionality from this package now exists in the `go.opentelemetry.io/otel/bridge/opencensus` package. + The functions from that package should be used instead. (#2166) +- The `"go.opentelemetry.io/otel/attribute".Array` function and the related `ARRAY` value type is deprecated. + Use the typed `*Slice` functions and types added to the package instead. (#2162) +- The `"go.opentelemetry.io/otel/attribute".Any` function is deprecated. + Use the typed functions instead. (#2181) +- The `go.opentelemetry.io/otel/oteltest` package is deprecated. + The `"go.opentelemetry.io/otel/sdk/trace/tracetest".SpanRecorder` can be registered with the default SDK (`go.opentelemetry.io/otel/sdk/trace`) as a `SpanProcessor` and used as a replacement for this deprecated package. (#2188) + +### Removed + +- Removed metrics test package `go.opentelemetry.io/otel/sdk/export/metric/metrictest`. (#2105) + +### Fixed + +- The `fromEnv` detector no longer throws an error when `OTEL_RESOURCE_ATTRIBUTES` environment variable is not set or empty. (#2138) +- Setting the global `ErrorHandler` with `"go.opentelemetry.io/otel".SetErrorHandler` multiple times is now supported. (#2160, #2140) +- The `"go.opentelemetry.io/otel/attribute".Any` function now supports `int32` values. (#2169) +- Multiple calls to `"go.opentelemetry.io/otel/sdk/metric/controller/basic".WithResource()` are handled correctly, and when no resources are provided `"go.opentelemetry.io/otel/sdk/resource".Default()` is used. (#2120) +- The `WithoutTimestamps` option for the `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` exporter causes the exporter to correctly omit timestamps. (#2195) +- Fixed typos in resources.go. (#2201) + +## [1.0.0-RC2] - 2021-07-26 + +### Added + +- Added `WithOSDescription` resource configuration option to set OS (Operating System) description resource attribute (`os.description`). (#1840) +- Added `WithOS` resource configuration option to set all OS (Operating System) resource attributes at once. (#1840) +- Added the `WithRetry` option to the `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` package. + This option is a replacement for the removed `WithMaxAttempts` and `WithBackoff` options. (#2095) +- Added API `LinkFromContext` to return Link which encapsulates SpanContext from provided context and also encapsulates attributes. (#2115) +- Added a new `Link` type under the SDK `otel/sdk/trace` package that counts the number of attributes that were dropped for surpassing the `AttributePerLinkCountLimit` configured in the Span's `SpanLimits`. + This new type replaces the equal-named API `Link` type found in the `otel/trace` package for most usages within the SDK. + For example, instances of this type are now returned by the `Links()` function of `ReadOnlySpan`s provided in places like the `OnEnd` function of `SpanProcessor` implementations. (#2118) +- Added the `SpanRecorder` type to the `go.opentelemetry.io/otel/skd/trace/tracetest` package. + This type can be used with the default SDK as a `SpanProcessor` during testing. (#2132) + +### Changed + +- The `SpanModels` function is now exported from the `go.opentelemetry.io/otel/exporters/zipkin` package to convert OpenTelemetry spans into Zipkin model spans. (#2027) +- Rename the `"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc".RetrySettings` to `RetryConfig`. (#2095) + +### Deprecated + +- The `TextMapCarrier` and `TextMapPropagator` from the `go.opentelemetry.io/otel/oteltest` package and their associated creation functions (`TextMapCarrier`, `NewTextMapPropagator`) are deprecated. (#2114) +- The `Harness` type from the `go.opentelemetry.io/otel/oteltest` package and its associated creation function, `NewHarness` are deprecated and will be removed in the next release. (#2123) +- The `TraceStateFromKeyValues` function from the `go.opentelemetry.io/otel/oteltest` package is deprecated. + Use the `trace.ParseTraceState` function instead. (#2122) + +### Removed + +- Removed the deprecated package `go.opentelemetry.io/otel/exporters/trace/jaeger`. (#2020) +- Removed the deprecated package `go.opentelemetry.io/otel/exporters/trace/zipkin`. (#2020) +- Removed the `"go.opentelemetry.io/otel/sdk/resource".WithBuiltinDetectors` function. + The explicit `With*` options for every built-in detector should be used instead. (#2026 #2097) +- Removed the `WithMaxAttempts` and `WithBackoff` options from the `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` package. + The retry logic of the package has been updated to match the `otlptracegrpc` package and accordingly a `WithRetry` option is added that should be used instead. (#2095) +- Removed `DroppedAttributeCount` field from `otel/trace.Link` struct. (#2118) + +### Fixed + +- When using WithNewRoot, don't use the parent context for making sampling decisions. (#2032) +- `oteltest.Tracer` now creates a valid `SpanContext` when using `WithNewRoot`. (#2073) +- OS type detector now sets the correct `dragonflybsd` value for DragonFly BSD. (#2092) +- The OTel span status is correctly transformed into the OTLP status in the `go.opentelemetry.io/otel/exporters/otlp/otlptrace` package. + This fix will by default set the status to `Unset` if it is not explicitly set to `Ok` or `Error`. (#2099 #2102) +- The `Inject` method for the `"go.opentelemetry.io/otel/propagation".TraceContext` type no longer injects empty `tracestate` values. (#2108) +- Use `6831` as default Jaeger agent port instead of `6832`. (#2131) + +## [Experimental Metrics v0.22.0] - 2021-07-19 + +### Added + +- Adds HTTP support for OTLP metrics exporter. (#2022) + +### Removed + +- Removed the deprecated package `go.opentelemetry.io/otel/exporters/metric/prometheus`. (#2020) + +## [1.0.0-RC1] / 0.21.0 - 2021-06-18 + +With this release we are introducing a split in module versions. The tracing API and SDK are entering the `v1.0.0` Release Candidate phase with `v1.0.0-RC1` +while the experimental metrics API and SDK continue with `v0.x` releases at `v0.21.0`. Modules at major version 1 or greater will not depend on modules +with major version 0. + +### Added + +- Adds `otlpgrpc.WithRetry`option for configuring the retry policy for transient errors on the otlp/gRPC exporter. (#1832) + - The following status codes are defined as transient errors: + | gRPC Status Code | Description | + | ---------------- | ----------- | + | 1 | Cancelled | + | 4 | Deadline Exceeded | + | 8 | Resource Exhausted | + | 10 | Aborted | + | 10 | Out of Range | + | 14 | Unavailable | + | 15 | Data Loss | +- Added `Status` type to the `go.opentelemetry.io/otel/sdk/trace` package to represent the status of a span. (#1874) +- Added `SpanStub` type and its associated functions to the `go.opentelemetry.io/otel/sdk/trace/tracetest` package. + This type can be used as a testing replacement for the `SpanSnapshot` that was removed from the `go.opentelemetry.io/otel/sdk/trace` package. (#1873) +- Adds support for scheme in `OTEL_EXPORTER_OTLP_ENDPOINT` according to the spec. (#1886) +- Adds `trace.WithSchemaURL` option for configuring the tracer with a Schema URL. (#1889) +- Added an example of using OpenTelemetry Go as a trace context forwarder. (#1912) +- `ParseTraceState` is added to the `go.opentelemetry.io/otel/trace` package. + It can be used to decode a `TraceState` from a `tracestate` header string value. (#1937) +- Added `Len` method to the `TraceState` type in the `go.opentelemetry.io/otel/trace` package. + This method returns the number of list-members the `TraceState` holds. (#1937) +- Creates package `go.opentelemetry.io/otel/exporters/otlp/otlptrace` that defines a trace exporter that uses a `otlptrace.Client` to send data. + Creates package `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` implementing a gRPC `otlptrace.Client` and offers convenience functions, `NewExportPipeline` and `InstallNewPipeline`, to setup and install a `otlptrace.Exporter` in tracing .(#1922) +- Added `Baggage`, `Member`, and `Property` types to the `go.opentelemetry.io/otel/baggage` package along with their related functions. (#1967) +- Added `ContextWithBaggage`, `ContextWithoutBaggage`, and `FromContext` functions to the `go.opentelemetry.io/otel/baggage` package. + These functions replace the `Set`, `Value`, `ContextWithValue`, `ContextWithoutValue`, and `ContextWithEmpty` functions from that package and directly work with the new `Baggage` type. (#1967) +- The `OTEL_SERVICE_NAME` environment variable is the preferred source for `service.name`, used by the environment resource detector if a service name is present both there and in `OTEL_RESOURCE_ATTRIBUTES`. (#1969) +- Creates package `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` implementing an HTTP `otlptrace.Client` and offers convenience functions, `NewExportPipeline` and `InstallNewPipeline`, to setup and install a `otlptrace.Exporter` in tracing. (#1963) +- Changes `go.opentelemetry.io/otel/sdk/resource.NewWithAttributes` to require a schema URL. The old function is still available as `resource.NewSchemaless`. This is a breaking change. (#1938) +- Several builtin resource detectors now correctly populate the schema URL. (#1938) +- Creates package `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` that defines a metrics exporter that uses a `otlpmetric.Client` to send data. +- Creates package `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` implementing a gRPC `otlpmetric.Client` and offers convenience functions, `New` and `NewUnstarted`, to create an `otlpmetric.Exporter`.(#1991) +- Added `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` exporter. (#2005) +- Added `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` exporter. (#2005) +- Added a `TracerProvider()` method to the `"go.opentelemetry.io/otel/trace".Span` interface. This can be used to obtain a `TracerProvider` from a given span that utilizes the same trace processing pipeline. (#2009) + +### Changed + +- Make `NewSplitDriver` from `go.opentelemetry.io/otel/exporters/otlp` take variadic arguments instead of a `SplitConfig` item. + `NewSplitDriver` now automatically implements an internal `noopDriver` for `SplitConfig` fields that are not initialized. (#1798) +- `resource.New()` now creates a Resource without builtin detectors. Previous behavior is now achieved by using `WithBuiltinDetectors` Option. (#1810) +- Move the `Event` type from the `go.opentelemetry.io/otel` package to the `go.opentelemetry.io/otel/sdk/trace` package. (#1846) +- CI builds validate against last two versions of Go, dropping 1.14 and adding 1.16. (#1865) +- BatchSpanProcessor now report export failures when calling `ForceFlush()` method. (#1860) +- `Set.Encoded(Encoder)` no longer caches the result of an encoding. (#1855) +- Renamed `CloudZoneKey` to `CloudAvailabilityZoneKey` in Resource semantic conventions according to spec. (#1871) +- The `StatusCode` and `StatusMessage` methods of the `ReadOnlySpan` interface and the `Span` produced by the `go.opentelemetry.io/otel/sdk/trace` package have been replaced with a single `Status` method. + This method returns the status of a span using the new `Status` type. (#1874) +- Updated `ExportSpans` method of the`SpanExporter` interface type to accept `ReadOnlySpan`s instead of the removed `SpanSnapshot`. + This brings the export interface into compliance with the specification in that it now accepts an explicitly immutable type instead of just an implied one. (#1873) +- Unembed `SpanContext` in `Link`. (#1877) +- Generate Semantic conventions from the specification YAML. (#1891) +- Spans created by the global `Tracer` obtained from `go.opentelemetry.io/otel`, prior to a functioning `TracerProvider` being set, now propagate the span context from their parent if one exists. (#1901) +- The `"go.opentelemetry.io/otel".Tracer` function now accepts tracer options. (#1902) +- Move the `go.opentelemetry.io/otel/unit` package to `go.opentelemetry.io/otel/metric/unit`. (#1903) +- Changed `go.opentelemetry.io/otel/trace.TracerConfig` to conform to the [Contributing guidelines](CONTRIBUTING.md#config.) (#1921) +- Changed `go.opentelemetry.io/otel/trace.SpanConfig` to conform to the [Contributing guidelines](CONTRIBUTING.md#config). (#1921) +- Changed `span.End()` now only accepts Options that are allowed at `End()`. (#1921) +- Changed `go.opentelemetry.io/otel/metric.InstrumentConfig` to conform to the [Contributing guidelines](CONTRIBUTING.md#config). (#1921) +- Changed `go.opentelemetry.io/otel/metric.MeterConfig` to conform to the [Contributing guidelines](CONTRIBUTING.md#config). (#1921) +- Refactored option types according to the contribution style guide. (#1882) +- Move the `go.opentelemetry.io/otel/trace.TraceStateFromKeyValues` function to the `go.opentelemetry.io/otel/oteltest` package. + This function is preserved for testing purposes where it may be useful to create a `TraceState` from `attribute.KeyValue`s, but it is not intended for production use. + The new `ParseTraceState` function should be used to create a `TraceState`. (#1931) +- Updated `MarshalJSON` method of the `go.opentelemetry.io/otel/trace.TraceState` type to marshal the type into the string representation of the `TraceState`. (#1931) +- The `TraceState.Delete` method from the `go.opentelemetry.io/otel/trace` package no longer returns an error in addition to a `TraceState`. (#1931) +- Updated `Get` method of the `TraceState` type from the `go.opentelemetry.io/otel/trace` package to accept a `string` instead of an `attribute.Key` type. (#1931) +- Updated `Insert` method of the `TraceState` type from the `go.opentelemetry.io/otel/trace` package to accept a pair of `string`s instead of an `attribute.KeyValue` type. (#1931) +- Updated `Delete` method of the `TraceState` type from the `go.opentelemetry.io/otel/trace` package to accept a `string` instead of an `attribute.Key` type. (#1931) +- Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/stdout` package. (#1985) +- Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/metric/prometheus` package. (#1985) +- Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/trace/jaeger` package. (#1985) +- Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/trace/zipkin` package. (#1985) +- Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/otlp` package. (#1985) +- Renamed `NewUnstartedExporter` to `NewUnstarted` in the `go.opentelemetry.io/otel/exporters/otlp` package. (#1985) +- The `go.opentelemetry.io/otel/semconv` package has been moved to `go.opentelemetry.io/otel/semconv/v1.4.0` to allow for multiple [telemetry schema](https://github.com/open-telemetry/oteps/blob/main/text/0152-telemetry-schemas.md) versions to be used concurrently. (#1987) +- Metrics test helpers in `go.opentelemetry.io/otel/oteltest` have been moved to `go.opentelemetry.io/otel/metric/metrictest`. (#1988) + +### Deprecated + +- The `go.opentelemetry.io/otel/exporters/metric/prometheus` is deprecated, use `go.opentelemetry.io/otel/exporters/prometheus` instead. (#1993) +- The `go.opentelemetry.io/otel/exporters/trace/jaeger` is deprecated, use `go.opentelemetry.io/otel/exporters/jaeger` instead. (#1993) +- The `go.opentelemetry.io/otel/exporters/trace/zipkin` is deprecated, use `go.opentelemetry.io/otel/exporters/zipkin` instead. (#1993) + +### Removed + +- Removed `resource.WithoutBuiltin()`. Use `resource.New()`. (#1810) +- Unexported types `resource.FromEnv`, `resource.Host`, and `resource.TelemetrySDK`, Use the corresponding `With*()` to use individually. (#1810) +- Removed the `Tracer` and `IsRecording` method from the `ReadOnlySpan` in the `go.opentelemetry.io/otel/sdk/trace`. + The `Tracer` method is not a required to be included in this interface and given the mutable nature of the tracer that is associated with a span, this method is not appropriate. + The `IsRecording` method returns if the span is recording or not. + A read-only span value does not need to know if updates to it will be recorded or not. + By definition, it cannot be updated so there is no point in communicating if an update is recorded. (#1873) +- Removed the `SpanSnapshot` type from the `go.opentelemetry.io/otel/sdk/trace` package. + The use of this type has been replaced with the use of the explicitly immutable `ReadOnlySpan` type. + When a concrete representation of a read-only span is needed for testing, the newly added `SpanStub` in the `go.opentelemetry.io/otel/sdk/trace/tracetest` package should be used. (#1873) +- Removed the `Tracer` method from the `Span` interface in the `go.opentelemetry.io/otel/trace` package. + Using the same tracer that created a span introduces the error where an instrumentation library's `Tracer` is used by other code instead of their own. + The `"go.opentelemetry.io/otel".Tracer` function or a `TracerProvider` should be used to acquire a library specific `Tracer` instead. (#1900) + - The `TracerProvider()` method on the `Span` interface may also be used to obtain a `TracerProvider` using the same trace processing pipeline. (#2009) +- The `http.url` attribute generated by `HTTPClientAttributesFromHTTPRequest` will no longer include username or password information. (#1919) +- Removed `IsEmpty` method of the `TraceState` type in the `go.opentelemetry.io/otel/trace` package in favor of using the added `TraceState.Len` method. (#1931) +- Removed `Set`, `Value`, `ContextWithValue`, `ContextWithoutValue`, and `ContextWithEmpty` functions in the `go.opentelemetry.io/otel/baggage` package. + Handling of baggage is now done using the added `Baggage` type and related context functions (`ContextWithBaggage`, `ContextWithoutBaggage`, and `FromContext`) in that package. (#1967) +- The `InstallNewPipeline` and `NewExportPipeline` creation functions in all the exporters (prometheus, otlp, stdout, jaeger, and zipkin) have been removed. + These functions were deemed premature attempts to provide convenience that did not achieve this aim. (#1985) +- The `go.opentelemetry.io/otel/exporters/otlp` exporter has been removed. Use `go.opentelemetry.io/otel/exporters/otlp/otlptrace` instead. (#1990) +- The `go.opentelemetry.io/otel/exporters/stdout` exporter has been removed. Use `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` or `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` instead. (#2005) + +### Fixed + +- Only report errors from the `"go.opentelemetry.io/otel/sdk/resource".Environment` function when they are not `nil`. (#1850, #1851) +- The `Shutdown` method of the simple `SpanProcessor` in the `go.opentelemetry.io/otel/sdk/trace` package now honors the context deadline or cancellation. (#1616, #1856) +- BatchSpanProcessor now drops span batches that failed to be exported. (#1860) +- Use `http://localhost:14268/api/traces` as default Jaeger collector endpoint instead of `http://localhost:14250`. (#1898) +- Allow trailing and leading whitespace in the parsing of a `tracestate` header. (#1931) +- Add logic to determine if the channel is closed to fix Jaeger exporter test panic with close closed channel. (#1870, #1973) +- Avoid transport security when OTLP endpoint is a Unix socket. (#2001) + +### Security + +## [0.20.0] - 2021-04-23 + +### Added + +- The OTLP exporter now has two new convenience functions, `NewExportPipeline` and `InstallNewPipeline`, setup and install the exporter in tracing and metrics pipelines. (#1373) +- Adds semantic conventions for exceptions. (#1492) +- Added Jaeger Environment variables: `OTEL_EXPORTER_JAEGER_AGENT_HOST`, `OTEL_EXPORTER_JAEGER_AGENT_PORT` + These environment variables can be used to override Jaeger agent hostname and port (#1752) +- Option `ExportTimeout` was added to batch span processor. (#1755) +- `trace.TraceFlags` is now a defined type over `byte` and `WithSampled(bool) TraceFlags` and `IsSampled() bool` methods have been added to it. (#1770) +- The `Event` and `Link` struct types from the `go.opentelemetry.io/otel` package now include a `DroppedAttributeCount` field to record the number of attributes that were not recorded due to configured limits being reached. (#1771) +- The Jaeger exporter now reports dropped attributes for a Span event in the exported log. (#1771) +- Adds test to check BatchSpanProcessor ignores `OnEnd` and `ForceFlush` post `Shutdown`. (#1772) +- Extract resource attributes from the `OTEL_RESOURCE_ATTRIBUTES` environment variable and merge them with the `resource.Default` resource as well as resources provided to the `TracerProvider` and metric `Controller`. (#1785) +- Added `WithOSType` resource configuration option to set OS (Operating System) type resource attribute (`os.type`). (#1788) +- Added `WithProcess*` resource configuration options to set Process resource attributes. (#1788) + - `process.pid` + - `process.executable.name` + - `process.executable.path` + - `process.command_args` + - `process.owner` + - `process.runtime.name` + - `process.runtime.version` + - `process.runtime.description` +- Adds `k8s.node.name` and `k8s.node.uid` attribute keys to the `semconv` package. (#1789) +- Added support for configuring OTLP/HTTP and OTLP/gRPC Endpoints, TLS Certificates, Headers, Compression and Timeout via Environment Variables. (#1758, #1769 and #1811) + - `OTEL_EXPORTER_OTLP_ENDPOINT` + - `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` + - `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` + - `OTEL_EXPORTER_OTLP_HEADERS` + - `OTEL_EXPORTER_OTLP_TRACES_HEADERS` + - `OTEL_EXPORTER_OTLP_METRICS_HEADERS` + - `OTEL_EXPORTER_OTLP_COMPRESSION` + - `OTEL_EXPORTER_OTLP_TRACES_COMPRESSION` + - `OTEL_EXPORTER_OTLP_METRICS_COMPRESSION` + - `OTEL_EXPORTER_OTLP_TIMEOUT` + - `OTEL_EXPORTER_OTLP_TRACES_TIMEOUT` + - `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT` + - `OTEL_EXPORTER_OTLP_CERTIFICATE` + - `OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE` + - `OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE` +- Adds `otlpgrpc.WithTimeout` option for configuring timeout to the otlp/gRPC exporter. (#1821) +- Adds `jaeger.WithMaxPacketSize` option for configuring maximum UDP packet size used when connecting to the Jaeger agent. (#1853) + +### Fixed + +- The `Span.IsRecording` implementation from `go.opentelemetry.io/otel/sdk/trace` always returns false when not being sampled. (#1750) +- The Jaeger exporter now correctly sets tags for the Span status code and message. + This means it uses the correct tag keys (`"otel.status_code"`, `"otel.status_description"`) and does not set the status message as a tag unless it is set on the span. (#1761) +- The Jaeger exporter now correctly records Span event's names using the `"event"` key for a tag. + Additionally, this tag is overridden, as specified in the OTel specification, if the event contains an attribute with that key. (#1768) +- Zipkin Exporter: Ensure mapping between OTel and Zipkin span data complies with the specification. (#1688) +- Fixed typo for default service name in Jaeger Exporter. (#1797) +- Fix flaky OTLP for the reconnnection of the client connection. (#1527, #1814) +- Fix Jaeger exporter dropping of span batches that exceed the UDP packet size limit. + Instead, the exporter now splits the batch into smaller sendable batches. (#1828) + +### Changed + +- Span `RecordError` now records an `exception` event to comply with the semantic convention specification. (#1492) +- Jaeger exporter was updated to use thrift v0.14.1. (#1712) +- Migrate from using internally built and maintained version of the OTLP to the one hosted at `go.opentelemetry.io/proto/otlp`. (#1713) +- Migrate from using `github.com/gogo/protobuf` to `google.golang.org/protobuf` to match `go.opentelemetry.io/proto/otlp`. (#1713) +- The storage of a local or remote Span in a `context.Context` using its SpanContext is unified to store just the current Span. + The Span's SpanContext can now self-identify as being remote or not. + This means that `"go.opentelemetry.io/otel/trace".ContextWithRemoteSpanContext` will now overwrite any existing current Span, not just existing remote Spans, and make it the current Span in a `context.Context`. (#1731) +- Improve OTLP/gRPC exporter connection errors. (#1737) +- Information about a parent span context in a `"go.opentelemetry.io/otel/export/trace".SpanSnapshot` is unified in a new `Parent` field. + The existing `ParentSpanID` and `HasRemoteParent` fields are removed in favor of this. (#1748) +- The `ParentContext` field of the `"go.opentelemetry.io/otel/sdk/trace".SamplingParameters` is updated to hold a `context.Context` containing the parent span. + This changes it to make `SamplingParameters` conform with the OpenTelemetry specification. (#1749) +- Updated Jaeger Environment Variables: `JAEGER_ENDPOINT`, `JAEGER_USER`, `JAEGER_PASSWORD` + to `OTEL_EXPORTER_JAEGER_ENDPOINT`, `OTEL_EXPORTER_JAEGER_USER`, `OTEL_EXPORTER_JAEGER_PASSWORD` in compliance with OTel specification. (#1752) +- Modify `BatchSpanProcessor.ForceFlush` to abort after timeout/cancellation. (#1757) +- The `DroppedAttributeCount` field of the `Span` in the `go.opentelemetry.io/otel` package now only represents the number of attributes dropped for the span itself. + It no longer is a conglomerate of itself, events, and link attributes that have been dropped. (#1771) +- Make `ExportSpans` in Jaeger Exporter honor context deadline. (#1773) +- Modify Zipkin Exporter default service name, use default resource's serviceName instead of empty. (#1777) +- The `go.opentelemetry.io/otel/sdk/export/trace` package is merged into the `go.opentelemetry.io/otel/sdk/trace` package. (#1778) +- The prometheus.InstallNewPipeline example is moved from comment to example test (#1796) +- The convenience functions for the stdout exporter have been updated to return the `TracerProvider` implementation and enable the shutdown of the exporter. (#1800) +- Replace the flush function returned from the Jaeger exporter's convenience creation functions (`InstallNewPipeline` and `NewExportPipeline`) with the `TracerProvider` implementation they create. + This enables the caller to shutdown and flush using the related `TracerProvider` methods. (#1822) +- Updated the Jaeger exporter to have a default endpoint, `http://localhost:14250`, for the collector. (#1824) +- Changed the function `WithCollectorEndpoint` in the Jaeger exporter to no longer accept an endpoint as an argument. + The endpoint can be passed with the `CollectorEndpointOption` using the `WithEndpoint` function or by setting the `OTEL_EXPORTER_JAEGER_ENDPOINT` environment variable value appropriately. (#1824) +- The Jaeger exporter no longer batches exported spans itself, instead it relies on the SDK's `BatchSpanProcessor` for this functionality. (#1830) +- The Jaeger exporter creation functions (`NewRawExporter`, `NewExportPipeline`, and `InstallNewPipeline`) no longer accept the removed `Option` type as a variadic argument. (#1830) + +### Removed + +- Removed Jaeger Environment variables: `JAEGER_SERVICE_NAME`, `JAEGER_DISABLED`, `JAEGER_TAGS` + These environment variables will no longer be used to override values of the Jaeger exporter (#1752) +- No longer set the links for a `Span` in `go.opentelemetry.io/otel/sdk/trace` that is configured to be a new root. + This is unspecified behavior that the OpenTelemetry community plans to standardize in the future. + To prevent backwards incompatible changes when it is specified, these links are removed. (#1726) +- Setting error status while recording error with Span from oteltest package. (#1729) +- The concept of a remote and local Span stored in a context is unified to just the current Span. + Because of this `"go.opentelemetry.io/otel/trace".RemoteSpanContextFromContext` is removed as it is no longer needed. + Instead, `"go.opentelemetry.io/otel/trace".SpanContextFromContex` can be used to return the current Span. + If needed, that Span's `SpanContext.IsRemote()` can then be used to determine if it is remote or not. (#1731) +- The `HasRemoteParent` field of the `"go.opentelemetry.io/otel/sdk/trace".SamplingParameters` is removed. + This field is redundant to the information returned from the `Remote` method of the `SpanContext` held in the `ParentContext` field. (#1749) +- The `trace.FlagsDebug` and `trace.FlagsDeferred` constants have been removed and will be localized to the B3 propagator. (#1770) +- Remove `Process` configuration, `WithProcessFromEnv` and `ProcessFromEnv`, and type from the Jaeger exporter package. + The information that could be configured in the `Process` struct should be configured in a `Resource` instead. (#1776, #1804) +- Remove the `WithDisabled` option from the Jaeger exporter. + To disable the exporter unregister it from the `TracerProvider` or use a no-operation `TracerProvider`. (#1806) +- Removed the functions `CollectorEndpointFromEnv` and `WithCollectorEndpointOptionFromEnv` from the Jaeger exporter. + These functions for retrieving specific environment variable values are redundant of other internal functions and + are not intended for end user use. (#1824) +- Removed the Jaeger exporter `WithSDKOptions` `Option`. + This option was used to set SDK options for the exporter creation convenience functions. + These functions are provided as a way to easily setup or install the exporter with what are deemed reasonable SDK settings for common use cases. + If the SDK needs to be configured differently, the `NewRawExporter` function and direct setup of the SDK with the desired settings should be used. (#1825) +- The `WithBufferMaxCount` and `WithBatchMaxCount` `Option`s from the Jaeger exporter are removed. + The exporter no longer batches exports, instead relying on the SDK's `BatchSpanProcessor` for this functionality. (#1830) +- The Jaeger exporter `Option` type is removed. + The type is no longer used by the exporter to configure anything. + All the previous configurations these options provided were duplicates of SDK configuration. + They have been removed in favor of using the SDK configuration and focuses the exporter configuration to be only about the endpoints it will send telemetry to. (#1830) + +## [0.19.0] - 2021-03-18 + +### Added + +- Added `Marshaler` config option to `otlphttp` to enable otlp over json or protobufs. (#1586) +- A `ForceFlush` method to the `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` to flush all registered `SpanProcessor`s. (#1608) +- Added `WithSampler` and `WithSpanLimits` to tracer provider. (#1633, #1702) +- `"go.opentelemetry.io/otel/trace".SpanContext` now has a `remote` property, and `IsRemote()` predicate, that is true when the `SpanContext` has been extracted from remote context data. (#1701) +- A `Valid` method to the `"go.opentelemetry.io/otel/attribute".KeyValue` type. (#1703) + +### Changed + +- `trace.SpanContext` is now immutable and has no exported fields. (#1573) + - `trace.NewSpanContext()` can be used in conjunction with the `trace.SpanContextConfig` struct to initialize a new `SpanContext` where all values are known. +- Update the `ForceFlush` method signature to the `"go.opentelemetry.io/otel/sdk/trace".SpanProcessor` to accept a `context.Context` and return an error. (#1608) +- Update the `Shutdown` method to the `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` return an error on shutdown failure. (#1608) +- The SimpleSpanProcessor will now shut down the enclosed `SpanExporter` and gracefully ignore subsequent calls to `OnEnd` after `Shutdown` is called. (#1612) +- `"go.opentelemetry.io/sdk/metric/controller.basic".WithPusher` is replaced with `WithExporter` to provide consistent naming across project. (#1656) +- Added non-empty string check for trace `Attribute` keys. (#1659) +- Add `description` to SpanStatus only when `StatusCode` is set to error. (#1662) +- Jaeger exporter falls back to `resource.Default`'s `service.name` if the exported Span does not have one. (#1673) +- Jaeger exporter populates Jaeger's Span Process from Resource. (#1673) +- Renamed the `LabelSet` method of `"go.opentelemetry.io/otel/sdk/resource".Resource` to `Set`. (#1692) +- Changed `WithSDK` to `WithSDKOptions` to accept variadic arguments of `TracerProviderOption` type in `go.opentelemetry.io/otel/exporters/trace/jaeger` package. (#1693) +- Changed `WithSDK` to `WithSDKOptions` to accept variadic arguments of `TracerProviderOption` type in `go.opentelemetry.io/otel/exporters/trace/zipkin` package. (#1693) + +### Removed + +- Removed `serviceName` parameter from Zipkin exporter and uses resource instead. (#1549) +- Removed `WithConfig` from tracer provider to avoid overriding configuration. (#1633) +- Removed the exported `SimpleSpanProcessor` and `BatchSpanProcessor` structs. + These are now returned as a SpanProcessor interface from their respective constructors. (#1638) +- Removed `WithRecord()` from `trace.SpanOption` when creating a span. (#1660) +- Removed setting status to `Error` while recording an error as a span event in `RecordError`. (#1663) +- Removed `jaeger.WithProcess` configuration option. (#1673) +- Removed `ApplyConfig` method from `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` and the now unneeded `Config` struct. (#1693) + +### Fixed + +- Jaeger Exporter: Ensure mapping between OTEL and Jaeger span data complies with the specification. (#1626) +- `SamplingResult.TraceState` is correctly propagated to a newly created span's `SpanContext`. (#1655) +- The `otel-collector` example now correctly flushes metric events prior to shutting down the exporter. (#1678) +- Do not set span status message in `SpanStatusFromHTTPStatusCode` if it can be inferred from `http.status_code`. (#1681) +- Synchronization issues in global trace delegate implementation. (#1686) +- Reduced excess memory usage by global `TracerProvider`. (#1687) + +## [0.18.0] - 2021-03-03 + +### Added + +- Added `resource.Default()` for use with meter and tracer providers. (#1507) +- `AttributePerEventCountLimit` and `AttributePerLinkCountLimit` for `SpanLimits`. (#1535) +- Added `Keys()` method to `propagation.TextMapCarrier` and `propagation.HeaderCarrier` to adapt `http.Header` to this interface. (#1544) +- Added `code` attributes to `go.opentelemetry.io/otel/semconv` package. (#1558) +- Compatibility testing suite in the CI system for the following systems. (#1567) + | OS | Go Version | Architecture | + | ------- | ---------- | ------------ | + | Ubuntu | 1.15 | amd64 | + | Ubuntu | 1.14 | amd64 | + | Ubuntu | 1.15 | 386 | + | Ubuntu | 1.14 | 386 | + | MacOS | 1.15 | amd64 | + | MacOS | 1.14 | amd64 | + | Windows | 1.15 | amd64 | + | Windows | 1.14 | amd64 | + | Windows | 1.15 | 386 | + | Windows | 1.14 | 386 | + +### Changed + +- Replaced interface `oteltest.SpanRecorder` with its existing implementation + `StandardSpanRecorder`. (#1542) +- Default span limit values to 128. (#1535) +- Rename `MaxEventsPerSpan`, `MaxAttributesPerSpan` and `MaxLinksPerSpan` to `EventCountLimit`, `AttributeCountLimit` and `LinkCountLimit`, and move these fields into `SpanLimits`. (#1535) +- Renamed the `otel/label` package to `otel/attribute`. (#1541) +- Vendor the Jaeger exporter's dependency on Apache Thrift. (#1551) +- Parallelize the CI linting and testing. (#1567) +- Stagger timestamps in exact aggregator tests. (#1569) +- Changed all examples to use `WithBatchTimeout(5 * time.Second)` rather than `WithBatchTimeout(5)`. (#1621) +- Prevent end-users from implementing some interfaces (#1575) + + ``` + "otel/exporters/otlp/otlphttp".Option + "otel/exporters/stdout".Option + "otel/oteltest".Option + "otel/trace".TracerOption + "otel/trace".SpanOption + "otel/trace".EventOption + "otel/trace".LifeCycleOption + "otel/trace".InstrumentationOption + "otel/sdk/resource".Option + "otel/sdk/trace".ParentBasedSamplerOption + "otel/sdk/trace".ReadOnlySpan + "otel/sdk/trace".ReadWriteSpan + ``` + +### Removed + +- Removed attempt to resample spans upon changing the span name with `span.SetName()`. (#1545) +- The `test-benchmark` is no longer a dependency of the `precommit` make target. (#1567) +- Removed the `test-386` make target. + This was replaced with a full compatibility testing suite (i.e. multi OS/arch) in the CI system. (#1567) + +### Fixed + +- The sequential timing check of timestamps in the stdout exporter are now setup explicitly to be sequential (#1571). (#1572) +- Windows build of Jaeger tests now compiles with OS specific functions (#1576). (#1577) +- The sequential timing check of timestamps of go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue are now setup explicitly to be sequential (#1578). (#1579) +- Validate tracestate header keys with vendors according to the W3C TraceContext specification (#1475). (#1581) +- The OTLP exporter includes related labels for translations of a GaugeArray (#1563). (#1570) + +## [0.17.0] - 2021-02-12 + +### Changed + +- Rename project default branch from `master` to `main`. (#1505) +- Reverse order in which `Resource` attributes are merged, per change in spec. (#1501) +- Add tooling to maintain "replace" directives in go.mod files automatically. (#1528) +- Create new modules: otel/metric, otel/trace, otel/oteltest, otel/sdk/export/metric, otel/sdk/metric (#1528) +- Move metric-related public global APIs from otel to otel/metric/global. (#1528) + +## Fixed + +- Fixed otlpgrpc reconnection issue. +- The example code in the README.md of `go.opentelemetry.io/otel/exporters/otlp` is moved to a compiled example test and used the new `WithAddress` instead of `WithEndpoint`. (#1513) +- The otel-collector example now uses the default OTLP receiver port of the collector. + +## [0.16.0] - 2021-01-13 + +### Added + +- Add the `ReadOnlySpan` and `ReadWriteSpan` interfaces to provide better control for accessing span data. (#1360) +- `NewGRPCDriver` function returns a `ProtocolDriver` that maintains a single gRPC connection to the collector. (#1369) +- Added documentation about the project's versioning policy. (#1388) +- Added `NewSplitDriver` for OTLP exporter that allows sending traces and metrics to different endpoints. (#1418) +- Added codeql workflow to GitHub Actions (#1428) +- Added Gosec workflow to GitHub Actions (#1429) +- Add new HTTP driver for OTLP exporter in `exporters/otlp/otlphttp`. Currently it only supports the binary protobuf payloads. (#1420) +- Add an OpenCensus exporter bridge. (#1444) + +### Changed + +- Rename `internal/testing` to `internal/internaltest`. (#1449) +- Rename `export.SpanData` to `export.SpanSnapshot` and use it only for exporting spans. (#1360) +- Store the parent's full `SpanContext` rather than just its span ID in the `span` struct. (#1360) +- Improve span duration accuracy. (#1360) +- Migrated CI/CD from CircleCI to GitHub Actions (#1382) +- Remove duplicate checkout from GitHub Actions workflow (#1407) +- Metric `array` aggregator renamed `exact` to match its `aggregation.Kind` (#1412) +- Metric `exact` aggregator includes per-point timestamps (#1412) +- Metric stdout exporter uses MinMaxSumCount aggregator for ValueRecorder instruments (#1412) +- `NewExporter` from `exporters/otlp` now takes a `ProtocolDriver` as a parameter. (#1369) +- Many OTLP Exporter options became gRPC ProtocolDriver options. (#1369) +- Unify endpoint API that related to OTel exporter. (#1401) +- Optimize metric histogram aggregator to re-use its slice of buckets. (#1435) +- Metric aggregator Count() and histogram Bucket.Counts are consistently `uint64`. (1430) +- Histogram aggregator accepts functional options, uses default boundaries if none given. (#1434) +- `SamplingResult` now passed a `Tracestate` from the parent `SpanContext` (#1432) +- Moved gRPC driver for OTLP exporter to `exporters/otlp/otlpgrpc`. (#1420) +- The `TraceContext` propagator now correctly propagates `TraceState` through the `SpanContext`. (#1447) +- Metric Push and Pull Controller components are combined into a single "basic" Controller: + - `WithExporter()` and `Start()` to configure Push behavior + - `Start()` is optional; use `Collect()` and `ForEach()` for Pull behavior + - `Start()` and `Stop()` accept Context. (#1378) +- The `Event` type is moved from the `otel/sdk/export/trace` package to the `otel/trace` API package. (#1452) + +### Removed + +- Remove `errUninitializedSpan` as its only usage is now obsolete. (#1360) +- Remove Metric export functionality related to quantiles and summary data points: this is not specified (#1412) +- Remove DDSketch metric aggregator; our intention is to re-introduce this as an option of the histogram aggregator after [new OTLP histogram data types](https://github.com/open-telemetry/opentelemetry-proto/pull/226) are released (#1412) + +### Fixed + +- `BatchSpanProcessor.Shutdown()` will now shutdown underlying `export.SpanExporter`. (#1443) + +## [0.15.0] - 2020-12-10 + +### Added + +- The `WithIDGenerator` `TracerProviderOption` is added to the `go.opentelemetry.io/otel/trace` package to configure an `IDGenerator` for the `TracerProvider`. (#1363) + +### Changed + +- The Zipkin exporter now uses the Span status code to determine. (#1328) +- `NewExporter` and `Start` functions in `go.opentelemetry.io/otel/exporters/otlp` now receive `context.Context` as a first parameter. (#1357) +- Move the OpenCensus example into `example` directory. (#1359) +- Moved the SDK's `internal.IDGenerator` interface in to the `sdk/trace` package to enable support for externally-defined ID generators. (#1363) +- Bump `github.com/google/go-cmp` from 0.5.3 to 0.5.4 (#1374) +- Bump `github.com/golangci/golangci-lint` in `/internal/tools` (#1375) + +### Fixed + +- Metric SDK `SumObserver` and `UpDownSumObserver` instruments correctness fixes. (#1381) + +## [0.14.0] - 2020-11-19 + +### Added + +- An `EventOption` and the related `NewEventConfig` function are added to the `go.opentelemetry.io/otel` package to configure Span events. (#1254) +- A `TextMapPropagator` and associated `TextMapCarrier` are added to the `go.opentelemetry.io/otel/oteltest` package to test `TextMap` type propagators and their use. (#1259) +- `SpanContextFromContext` returns `SpanContext` from context. (#1255) +- `TraceState` has been added to `SpanContext`. (#1340) +- `DeploymentEnvironmentKey` added to `go.opentelemetry.io/otel/semconv` package. (#1323) +- Add an OpenCensus to OpenTelemetry tracing bridge. (#1305) +- Add a parent context argument to `SpanProcessor.OnStart` to follow the specification. (#1333) +- Add missing tests for `sdk/trace/attributes_map.go`. (#1337) + +### Changed + +- Move the `go.opentelemetry.io/otel/api/trace` package into `go.opentelemetry.io/otel/trace` with the following changes. (#1229) (#1307) + - `ID` has been renamed to `TraceID`. + - `IDFromHex` has been renamed to `TraceIDFromHex`. + - `EmptySpanContext` is removed. +- Move the `go.opentelemetry.io/otel/api/trace/tracetest` package into `go.opentelemetry.io/otel/oteltest`. (#1229) +- OTLP Exporter updates: + - supports OTLP v0.6.0 (#1230, #1354) + - supports configurable aggregation temporality (default: Cumulative, optional: Stateless). (#1296) +- The Sampler is now called on local child spans. (#1233) +- The `Kind` type from the `go.opentelemetry.io/otel/api/metric` package was renamed to `InstrumentKind` to more specifically describe what it is and avoid semantic ambiguity. (#1240) +- The `MetricKind` method of the `Descriptor` type in the `go.opentelemetry.io/otel/api/metric` package was renamed to `Descriptor.InstrumentKind`. + This matches the returned type and fixes misuse of the term metric. (#1240) +- Move test harness from the `go.opentelemetry.io/otel/api/apitest` package into `go.opentelemetry.io/otel/oteltest`. (#1241) +- Move the `go.opentelemetry.io/otel/api/metric/metrictest` package into `go.opentelemetry.io/oteltest` as part of #964. (#1252) +- Move the `go.opentelemetry.io/otel/api/metric` package into `go.opentelemetry.io/otel/metric` as part of #1303. (#1321) +- Move the `go.opentelemetry.io/otel/api/metric/registry` package into `go.opentelemetry.io/otel/metric/registry` as a part of #1303. (#1316) +- Move the `Number` type (together with related functions) from `go.opentelemetry.io/otel/api/metric` package into `go.opentelemetry.io/otel/metric/number` as a part of #1303. (#1316) +- The function signature of the Span `AddEvent` method in `go.opentelemetry.io/otel` is updated to no longer take an unused context and instead take a required name and a variable number of `EventOption`s. (#1254) +- The function signature of the Span `RecordError` method in `go.opentelemetry.io/otel` is updated to no longer take an unused context and instead take a required error value and a variable number of `EventOption`s. (#1254) +- Move the `go.opentelemetry.io/otel/api/global` package to `go.opentelemetry.io/otel`. (#1262) (#1330) +- Move the `Version` function from `go.opentelemetry.io/otel/sdk` to `go.opentelemetry.io/otel`. (#1330) +- Rename correlation context header from `"otcorrelations"` to `"baggage"` to match the OpenTelemetry specification. (#1267) +- Fix `Code.UnmarshalJSON` to work with valid JSON only. (#1276) +- The `resource.New()` method changes signature to support builtin attributes and functional options, including `telemetry.sdk.*` and + `host.name` semantic conventions; the former method is renamed `resource.NewWithAttributes`. (#1235) +- The Prometheus exporter now exports non-monotonic counters (i.e. `UpDownCounter`s) as gauges. (#1210) +- Correct the `Span.End` method documentation in the `otel` API to state updates are not allowed on a span after it has ended. (#1310) +- Updated span collection limits for attribute, event and link counts to 1000 (#1318) +- Renamed `semconv.HTTPUrlKey` to `semconv.HTTPURLKey`. (#1338) + +### Removed + +- The `ErrInvalidHexID`, `ErrInvalidTraceIDLength`, `ErrInvalidSpanIDLength`, `ErrInvalidSpanIDLength`, or `ErrNilSpanID` from the `go.opentelemetry.io/otel` package are unexported now. (#1243) +- The `AddEventWithTimestamp` method on the `Span` interface in `go.opentelemetry.io/otel` is removed due to its redundancy. + It is replaced by using the `AddEvent` method with a `WithTimestamp` option. (#1254) +- The `MockSpan` and `MockTracer` types are removed from `go.opentelemetry.io/otel/oteltest`. + `Tracer` and `Span` from the same module should be used in their place instead. (#1306) +- `WorkerCount` option is removed from `go.opentelemetry.io/otel/exporters/otlp`. (#1350) +- Remove the following labels types: INT32, UINT32, UINT64 and FLOAT32. (#1314) + +### Fixed + +- Rename `MergeItererator` to `MergeIterator` in the `go.opentelemetry.io/otel/label` package. (#1244) +- The `go.opentelemetry.io/otel/api/global` packages global TextMapPropagator now delegates functionality to a globally set delegate for all previously returned propagators. (#1258) +- Fix condition in `label.Any`. (#1299) +- Fix global `TracerProvider` to pass options to its configured provider. (#1329) +- Fix missing handler for `ExactKind` aggregator in OTLP metrics transformer (#1309) + +## [0.13.0] - 2020-10-08 + +### Added + +- OTLP Metric exporter supports Histogram aggregation. (#1209) +- The `Code` struct from the `go.opentelemetry.io/otel/codes` package now supports JSON marshaling and unmarshaling as well as implements the `Stringer` interface. (#1214) +- A Baggage API to implement the OpenTelemetry specification. (#1217) +- Add Shutdown method to sdk/trace/provider, shutdown processors in the order they were registered. (#1227) + +### Changed + +- Set default propagator to no-op propagator. (#1184) +- The `HTTPSupplier`, `HTTPExtractor`, `HTTPInjector`, and `HTTPPropagator` from the `go.opentelemetry.io/otel/api/propagation` package were replaced with unified `TextMapCarrier` and `TextMapPropagator` in the `go.opentelemetry.io/otel/propagation` package. (#1212) (#1325) +- The `New` function from the `go.opentelemetry.io/otel/api/propagation` package was replaced with `NewCompositeTextMapPropagator` in the `go.opentelemetry.io/otel` package. (#1212) +- The status codes of the `go.opentelemetry.io/otel/codes` package have been updated to match the latest OpenTelemetry specification. + They now are `Unset`, `Error`, and `Ok`. + They no longer track the gRPC codes. (#1214) +- The `StatusCode` field of the `SpanData` struct in the `go.opentelemetry.io/otel/sdk/export/trace` package now uses the codes package from this package instead of the gRPC project. (#1214) +- Move the `go.opentelemetry.io/otel/api/baggage` package into `go.opentelemetry.io/otel/baggage`. (#1217) (#1325) +- A `Shutdown` method of `SpanProcessor` and all its implementations receives a context and returns an error. (#1264) + +### Fixed + +- Copies of data from arrays and slices passed to `go.opentelemetry.io/otel/label.ArrayValue()` are now used in the returned `Value` instead of using the mutable data itself. (#1226) + +### Removed + +- The `ExtractHTTP` and `InjectHTTP` functions from the `go.opentelemetry.io/otel/api/propagation` package were removed. (#1212) +- The `Propagators` interface from the `go.opentelemetry.io/otel/api/propagation` package was removed to conform to the OpenTelemetry specification. + The explicit `TextMapPropagator` type can be used in its place as this is the `Propagator` type the specification defines. (#1212) +- The `SetAttribute` method of the `Span` from the `go.opentelemetry.io/otel/api/trace` package was removed given its redundancy with the `SetAttributes` method. (#1216) +- The internal implementation of Baggage storage is removed in favor of using the new Baggage API functionality. (#1217) +- Remove duplicate hostname key `HostHostNameKey` in Resource semantic conventions. (#1219) +- Nested array/slice support has been removed. (#1226) + +## [0.12.0] - 2020-09-24 + +### Added + +- A `SpanConfigure` function in `go.opentelemetry.io/otel/api/trace` to create a new `SpanConfig` from `SpanOption`s. (#1108) +- In the `go.opentelemetry.io/otel/api/trace` package, `NewTracerConfig` was added to construct new `TracerConfig`s. + This addition was made to conform with our project option conventions. (#1155) +- Instrumentation library information was added to the Zipkin exporter. (#1119) +- The `SpanProcessor` interface now has a `ForceFlush()` method. (#1166) +- More semantic conventions for k8s as resource attributes. (#1167) + +### Changed + +- Add reconnecting udp connection type to Jaeger exporter. + This change adds a new optional implementation of the udp conn interface used to detect changes to an agent's host dns record. + It then adopts the new destination address to ensure the exporter doesn't get stuck. This change was ported from jaegertracing/jaeger-client-go#520. (#1063) +- Replace `StartOption` and `EndOption` in `go.opentelemetry.io/otel/api/trace` with `SpanOption`. + This change is matched by replacing the `StartConfig` and `EndConfig` with a unified `SpanConfig`. (#1108) +- Replace the `LinkedTo` span option in `go.opentelemetry.io/otel/api/trace` with `WithLinks`. + This is be more consistent with our other option patterns, i.e. passing the item to be configured directly instead of its component parts, and provides a cleaner function signature. (#1108) +- The `go.opentelemetry.io/otel/api/trace` `TracerOption` was changed to an interface to conform to project option conventions. (#1109) +- Move the `B3` and `TraceContext` from within the `go.opentelemetry.io/otel/api/trace` package to their own `go.opentelemetry.io/otel/propagators` package. + This removal of the propagators is reflective of the OpenTelemetry specification for these propagators as well as cleans up the `go.opentelemetry.io/otel/api/trace` API. (#1118) +- Rename Jaeger tags used for instrumentation library information to reflect changes in OpenTelemetry specification. (#1119) +- Rename `ProbabilitySampler` to `TraceIDRatioBased` and change semantics to ignore parent span sampling status. (#1115) +- Move `tools` package under `internal`. (#1141) +- Move `go.opentelemetry.io/otel/api/correlation` package to `go.opentelemetry.io/otel/api/baggage`. (#1142) + The `correlation.CorrelationContext` propagator has been renamed `baggage.Baggage`. Other exported functions and types are unchanged. +- Rename `ParentOrElse` sampler to `ParentBased` and allow setting samplers depending on parent span. (#1153) +- In the `go.opentelemetry.io/otel/api/trace` package, `SpanConfigure` was renamed to `NewSpanConfig`. (#1155) +- Change `dependabot.yml` to add a `Skip Changelog` label to dependabot-sourced PRs. (#1161) +- The [configuration style guide](https://github.com/open-telemetry/opentelemetry-go/blob/master/CONTRIBUTING.md#config) has been updated to + recommend the use of `newConfig()` instead of `configure()`. (#1163) +- The `otlp.Config` type has been unexported and changed to `otlp.config`, along with its initializer. (#1163) +- Ensure exported interface types include parameter names and update the + Style Guide to reflect this styling rule. (#1172) +- Don't consider unset environment variable for resource detection to be an error. (#1170) +- Rename `go.opentelemetry.io/otel/api/metric.ConfigureInstrument` to `NewInstrumentConfig` and + `go.opentelemetry.io/otel/api/metric.ConfigureMeter` to `NewMeterConfig`. +- ValueObserver instruments use LastValue aggregator by default. (#1165) +- OTLP Metric exporter supports LastValue aggregation. (#1165) +- Move the `go.opentelemetry.io/otel/api/unit` package to `go.opentelemetry.io/otel/unit`. (#1185) +- Rename `Provider` to `MeterProvider` in the `go.opentelemetry.io/otel/api/metric` package. (#1190) +- Rename `NoopProvider` to `NoopMeterProvider` in the `go.opentelemetry.io/otel/api/metric` package. (#1190) +- Rename `NewProvider` to `NewMeterProvider` in the `go.opentelemetry.io/otel/api/metric/metrictest` package. (#1190) +- Rename `Provider` to `MeterProvider` in the `go.opentelemetry.io/otel/api/metric/registry` package. (#1190) +- Rename `NewProvider` to `NewMeterProvider` in the `go.opentelemetry.io/otel/api/metri/registryc` package. (#1190) +- Rename `Provider` to `TracerProvider` in the `go.opentelemetry.io/otel/api/trace` package. (#1190) +- Rename `NoopProvider` to `NoopTracerProvider` in the `go.opentelemetry.io/otel/api/trace` package. (#1190) +- Rename `Provider` to `TracerProvider` in the `go.opentelemetry.io/otel/api/trace/tracetest` package. (#1190) +- Rename `NewProvider` to `NewTracerProvider` in the `go.opentelemetry.io/otel/api/trace/tracetest` package. (#1190) +- Rename `WrapperProvider` to `WrapperTracerProvider` in the `go.opentelemetry.io/otel/bridge/opentracing` package. (#1190) +- Rename `NewWrapperProvider` to `NewWrapperTracerProvider` in the `go.opentelemetry.io/otel/bridge/opentracing` package. (#1190) +- Rename `Provider` method of the pull controller to `MeterProvider` in the `go.opentelemetry.io/otel/sdk/metric/controller/pull` package. (#1190) +- Rename `Provider` method of the push controller to `MeterProvider` in the `go.opentelemetry.io/otel/sdk/metric/controller/push` package. (#1190) +- Rename `ProviderOptions` to `TracerProviderConfig` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) +- Rename `ProviderOption` to `TracerProviderOption` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) +- Rename `Provider` to `TracerProvider` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) +- Rename `NewProvider` to `NewTracerProvider` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) +- Renamed `SamplingDecision` values to comply with OpenTelemetry specification change. (#1192) +- Renamed Zipkin attribute names from `ot.status_code & ot.status_description` to `otel.status_code & otel.status_description`. (#1201) +- The default SDK now invokes registered `SpanProcessor`s in the order they were registered with the `TracerProvider`. (#1195) +- Add test of spans being processed by the `SpanProcessor`s in the order they were registered. (#1203) + +### Removed + +- Remove the B3 propagator from `go.opentelemetry.io/otel/propagators`. It is now located in the + `go.opentelemetry.io/contrib/propagators/` module. (#1191) +- Remove the semantic convention for HTTP status text, `HTTPStatusTextKey` from package `go.opentelemetry.io/otel/semconv`. (#1194) + +### Fixed + +- Zipkin example no longer mentions `ParentSampler`, corrected to `ParentBased`. (#1171) +- Fix missing shutdown processor in otel-collector example. (#1186) +- Fix missing shutdown processor in basic and namedtracer examples. (#1197) + +## [0.11.0] - 2020-08-24 + +### Added + +- Support for exporting array-valued attributes via OTLP. (#992) +- `Noop` and `InMemory` `SpanBatcher` implementations to help with testing integrations. (#994) +- Support for filtering metric label sets. (#1047) +- A dimensionality-reducing metric Processor. (#1057) +- Integration tests for more OTel Collector Attribute types. (#1062) +- A new `WithSpanProcessor` `ProviderOption` is added to the `go.opentelemetry.io/otel/sdk/trace` package to create a `Provider` and automatically register the `SpanProcessor`. (#1078) + +### Changed + +- Rename `sdk/metric/processor/test` to `sdk/metric/processor/processortest`. (#1049) +- Rename `sdk/metric/controller/test` to `sdk/metric/controller/controllertest`. (#1049) +- Rename `api/testharness` to `api/apitest`. (#1049) +- Rename `api/trace/testtrace` to `api/trace/tracetest`. (#1049) +- Change Metric Processor to merge multiple observations. (#1024) +- The `go.opentelemetry.io/otel/bridge/opentracing` bridge package has been made into its own module. + This removes the package dependencies of this bridge from the rest of the OpenTelemetry based project. (#1038) +- Renamed `go.opentelemetry.io/otel/api/standard` package to `go.opentelemetry.io/otel/semconv` to avoid the ambiguous and generic name `standard` and better describe the package as containing OpenTelemetry semantic conventions. (#1016) +- The environment variable used for resource detection has been changed from `OTEL_RESOURCE_LABELS` to `OTEL_RESOURCE_ATTRIBUTES` (#1042) +- Replace `WithSyncer` with `WithBatcher` in examples. (#1044) +- Replace the `google.golang.org/grpc/codes` dependency in the API with an equivalent `go.opentelemetry.io/otel/codes` package. (#1046) +- Merge the `go.opentelemetry.io/otel/api/label` and `go.opentelemetry.io/otel/api/kv` into the new `go.opentelemetry.io/otel/label` package. (#1060) +- Unify Callback Function Naming. + Rename `*Callback` with `*Func`. (#1061) +- CI builds validate against last two versions of Go, dropping 1.13 and adding 1.15. (#1064) +- The `go.opentelemetry.io/otel/sdk/export/trace` interfaces `SpanSyncer` and `SpanBatcher` have been replaced with a specification compliant `Exporter` interface. + This interface still supports the export of `SpanData`, but only as a slice. + Implementation are also required now to return any error from `ExportSpans` if one occurs as well as implement a `Shutdown` method for exporter clean-up. (#1078) +- The `go.opentelemetry.io/otel/sdk/trace` `NewBatchSpanProcessor` function no longer returns an error. + If a `nil` exporter is passed as an argument to this function, instead of it returning an error, it now returns a `BatchSpanProcessor` that handles the export of `SpanData` by not taking any action. (#1078) +- The `go.opentelemetry.io/otel/sdk/trace` `NewProvider` function to create a `Provider` no longer returns an error, instead only a `*Provider`. + This change is related to `NewBatchSpanProcessor` not returning an error which was the only error this function would return. (#1078) + +### Removed + +- Duplicate, unused API sampler interface. (#999) + Use the [`Sampler` interface](https://github.com/open-telemetry/opentelemetry-go/blob/v0.11.0/sdk/trace/sampling.go) provided by the SDK instead. +- The `grpctrace` instrumentation was moved to the `go.opentelemetry.io/contrib` repository and out of this repository. + This move includes moving the `grpc` example to the `go.opentelemetry.io/contrib` as well. (#1027) +- The `WithSpan` method of the `Tracer` interface. + The functionality this method provided was limited compared to what a user can provide themselves. + It was removed with the understanding that if there is sufficient user need it can be added back based on actual user usage. (#1043) +- The `RegisterSpanProcessor` and `UnregisterSpanProcessor` functions. + These were holdovers from an approach prior to the TracerProvider design. They were not used anymore. (#1077) +- The `oterror` package. (#1026) +- The `othttp` and `httptrace` instrumentations were moved to `go.opentelemetry.io/contrib`. (#1032) + +### Fixed + +- The `semconv.HTTPServerMetricAttributesFromHTTPRequest()` function no longer generates the high-cardinality `http.request.content.length` label. (#1031) +- Correct instrumentation version tag in Jaeger exporter. (#1037) +- The SDK span will now set an error event if the `End` method is called during a panic (i.e. it was deferred). (#1043) +- Move internally generated protobuf code from the `go.opentelemetry.io/otel` to the OTLP exporter to reduce dependency overhead. (#1050) +- The `otel-collector` example referenced outdated collector processors. (#1006) + +## [0.10.0] - 2020-07-29 + +This release migrates the default OpenTelemetry SDK into its own Go module, decoupling the SDK from the API and reducing dependencies for instrumentation packages. + +### Added + +- The Zipkin exporter now has `NewExportPipeline` and `InstallNewPipeline` constructor functions to match the common pattern. + These function build a new exporter with default SDK options and register the exporter with the `global` package respectively. (#944) +- Add propagator option for gRPC instrumentation. (#986) +- The `testtrace` package now tracks the `trace.SpanKind` for each span. (#987) + +### Changed + +- Replace the `RegisterGlobal` `Option` in the Jaeger exporter with an `InstallNewPipeline` constructor function. + This matches the other exporter constructor patterns and will register a new exporter after building it with default configuration. (#944) +- The trace (`go.opentelemetry.io/otel/exporters/trace/stdout`) and metric (`go.opentelemetry.io/otel/exporters/metric/stdout`) `stdout` exporters are now merged into a single exporter at `go.opentelemetry.io/otel/exporters/stdout`. + This new exporter was made into its own Go module to follow the pattern of all exporters and decouple it from the `go.opentelemetry.io/otel` module. (#956, #963) +- Move the `go.opentelemetry.io/otel/exporters/test` test package to `go.opentelemetry.io/otel/sdk/export/metric/metrictest`. (#962) +- The `go.opentelemetry.io/otel/api/kv/value` package was merged into the parent `go.opentelemetry.io/otel/api/kv` package. (#968) + - `value.Bool` was replaced with `kv.BoolValue`. + - `value.Int64` was replaced with `kv.Int64Value`. + - `value.Uint64` was replaced with `kv.Uint64Value`. + - `value.Float64` was replaced with `kv.Float64Value`. + - `value.Int32` was replaced with `kv.Int32Value`. + - `value.Uint32` was replaced with `kv.Uint32Value`. + - `value.Float32` was replaced with `kv.Float32Value`. + - `value.String` was replaced with `kv.StringValue`. + - `value.Int` was replaced with `kv.IntValue`. + - `value.Uint` was replaced with `kv.UintValue`. + - `value.Array` was replaced with `kv.ArrayValue`. +- Rename `Infer` to `Any` in the `go.opentelemetry.io/otel/api/kv` package. (#972) +- Change `othttp` to use the `httpsnoop` package to wrap the `ResponseWriter` so that optional interfaces (`http.Hijacker`, `http.Flusher`, etc.) that are implemented by the original `ResponseWriter`are also implemented by the wrapped `ResponseWriter`. (#979) +- Rename `go.opentelemetry.io/otel/sdk/metric/aggregator/test` package to `go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest`. (#980) +- Make the SDK into its own Go module called `go.opentelemetry.io/otel/sdk`. (#985) +- Changed the default trace `Sampler` from `AlwaysOn` to `ParentOrElse(AlwaysOn)`. (#989) + +### Removed + +- The `IndexedAttribute` function from the `go.opentelemetry.io/otel/api/label` package was removed in favor of `IndexedLabel` which it was synonymous with. (#970) + +### Fixed + +- Bump github.com/golangci/golangci-lint from 1.28.3 to 1.29.0 in /tools. (#953) +- Bump github.com/google/go-cmp from 0.5.0 to 0.5.1. (#957) +- Use `global.Handle` for span export errors in the OTLP exporter. (#946) +- Correct Go language formatting in the README documentation. (#961) +- Remove default SDK dependencies from the `go.opentelemetry.io/otel/api` package. (#977) +- Remove default SDK dependencies from the `go.opentelemetry.io/otel/instrumentation` package. (#983) +- Move documented examples for `go.opentelemetry.io/otel/instrumentation/grpctrace` interceptors into Go example tests. (#984) + +## [0.9.0] - 2020-07-20 + +### Added + +- A new Resource Detector interface is included to allow resources to be automatically detected and included. (#939) +- A Detector to automatically detect resources from an environment variable. (#939) +- Github action to generate protobuf Go bindings locally in `internal/opentelemetry-proto-gen`. (#938) +- OTLP .proto files from `open-telemetry/opentelemetry-proto` imported as a git submodule under `internal/opentelemetry-proto`. + References to `github.com/open-telemetry/opentelemetry-proto` changed to `go.opentelemetry.io/otel/internal/opentelemetry-proto-gen`. (#942) + +### Changed + +- Non-nil value `struct`s for key-value pairs will be marshalled using JSON rather than `Sprintf`. (#948) + +### Removed + +- Removed dependency on `github.com/open-telemetry/opentelemetry-collector`. (#943) + +## [0.8.0] - 2020-07-09 + +### Added + +- The `B3Encoding` type to represent the B3 encoding(s) the B3 propagator can inject. + A value for HTTP supported encodings (Multiple Header: `MultipleHeader`, Single Header: `SingleHeader`) are included. (#882) +- The `FlagsDeferred` trace flag to indicate if the trace sampling decision has been deferred. (#882) +- The `FlagsDebug` trace flag to indicate if the trace is a debug trace. (#882) +- Add `peer.service` semantic attribute. (#898) +- Add database-specific semantic attributes. (#899) +- Add semantic convention for `faas.coldstart` and `container.id`. (#909) +- Add http content size semantic conventions. (#905) +- Include `http.request_content_length` in HTTP request basic attributes. (#905) +- Add semantic conventions for operating system process resource attribute keys. (#919) +- The Jaeger exporter now has a `WithBatchMaxCount` option to specify the maximum number of spans sent in a batch. (#931) + +### Changed + +- Update `CONTRIBUTING.md` to ask for updates to `CHANGELOG.md` with each pull request. (#879) +- Use lowercase header names for B3 Multiple Headers. (#881) +- The B3 propagator `SingleHeader` field has been replaced with `InjectEncoding`. + This new field can be set to combinations of the `B3Encoding` bitmasks and will inject trace information in these encodings. + If no encoding is set, the propagator will default to `MultipleHeader` encoding. (#882) +- The B3 propagator now extracts from either HTTP encoding of B3 (Single Header or Multiple Header) based on what is contained in the header. + Preference is given to Single Header encoding with Multiple Header being the fallback if Single Header is not found or is invalid. + This behavior change is made to dynamically support all correctly encoded traces received instead of having to guess the expected encoding prior to receiving. (#882) +- Extend semantic conventions for RPC. (#900) +- To match constant naming conventions in the `api/standard` package, the `FaaS*` key names are appended with a suffix of `Key`. (#920) + - `"api/standard".FaaSName` -> `FaaSNameKey` + - `"api/standard".FaaSID` -> `FaaSIDKey` + - `"api/standard".FaaSVersion` -> `FaaSVersionKey` + - `"api/standard".FaaSInstance` -> `FaaSInstanceKey` + +### Removed + +- The `FlagsUnused` trace flag is removed. + The purpose of this flag was to act as the inverse of `FlagsSampled`, the inverse of `FlagsSampled` is used instead. (#882) +- The B3 header constants (`B3SingleHeader`, `B3DebugFlagHeader`, `B3TraceIDHeader`, `B3SpanIDHeader`, `B3SampledHeader`, `B3ParentSpanIDHeader`) are removed. + If B3 header keys are needed [the authoritative OpenZipkin package constants](https://pkg.go.dev/github.com/openzipkin/zipkin-go@v0.2.2/propagation/b3?tab=doc#pkg-constants) should be used instead. (#882) + +### Fixed + +- The B3 Single Header name is now correctly `b3` instead of the previous `X-B3`. (#881) +- The B3 propagator now correctly supports sampling only values (`b3: 0`, `b3: 1`, or `b3: d`) for a Single B3 Header. (#882) +- The B3 propagator now propagates the debug flag. + This removes the behavior of changing the debug flag into a set sampling bit. + Instead, this now follow the B3 specification and omits the `X-B3-Sampling` header. (#882) +- The B3 propagator now tracks "unset" sampling state (meaning "defer the decision") and does not set the `X-B3-Sampling` header when injecting. (#882) +- Bump github.com/itchyny/gojq from 0.10.3 to 0.10.4 in /tools. (#883) +- Bump github.com/opentracing/opentracing-go from v1.1.1-0.20190913142402-a7454ce5950e to v1.2.0. (#885) +- The tracing time conversion for OTLP spans is now correctly set to `UnixNano`. (#896) +- Ensure span status is not set to `Unknown` when no HTTP status code is provided as it is assumed to be `200 OK`. (#908) +- Ensure `httptrace.clientTracer` closes `http.headers` span. (#912) +- Prometheus exporter will not apply stale updates or forget inactive metrics. (#903) +- Add test for api.standard `HTTPClientAttributesFromHTTPRequest`. (#905) +- Bump github.com/golangci/golangci-lint from 1.27.0 to 1.28.1 in /tools. (#901, #913) +- Update otel-colector example to use the v0.5.0 collector. (#915) +- The `grpctrace` instrumentation uses a span name conforming to the OpenTelemetry semantic conventions (does not contain a leading slash (`/`)). (#922) +- The `grpctrace` instrumentation includes an `rpc.method` attribute now set to the gRPC method name. (#900, #922) +- The `grpctrace` instrumentation `rpc.service` attribute now contains the package name if one exists. + This is in accordance with OpenTelemetry semantic conventions. (#922) +- Correlation Context extractor will no longer insert an empty map into the returned context when no valid values are extracted. (#923) +- Bump google.golang.org/api from 0.28.0 to 0.29.0 in /exporters/trace/jaeger. (#925) +- Bump github.com/itchyny/gojq from 0.10.4 to 0.11.0 in /tools. (#926) +- Bump github.com/golangci/golangci-lint from 1.28.1 to 1.28.2 in /tools. (#930) + +## [0.7.0] - 2020-06-26 + +This release implements the v0.5.0 version of the OpenTelemetry specification. + +### Added + +- The othttp instrumentation now includes default metrics. (#861) +- This CHANGELOG file to track all changes in the project going forward. +- Support for array type attributes. (#798) +- Apply transitive dependabot go.mod dependency updates as part of a new automatic Github workflow. (#844) +- Timestamps are now passed to exporters for each export. (#835) +- Add new `Accumulation` type to metric SDK to transport telemetry from `Accumulator`s to `Processor`s. + This replaces the prior `Record` `struct` use for this purpose. (#835) +- New dependabot integration to automate package upgrades. (#814) +- `Meter` and `Tracer` implementations accept instrumentation version version as an optional argument. + This instrumentation version is passed on to exporters. (#811) (#805) (#802) +- The OTLP exporter includes the instrumentation version in telemetry it exports. (#811) +- Environment variables for Jaeger exporter are supported. (#796) +- New `aggregation.Kind` in the export metric API. (#808) +- New example that uses OTLP and the collector. (#790) +- Handle errors in the span `SetName` during span initialization. (#791) +- Default service config to enable retries for retry-able failed requests in the OTLP exporter and an option to override this default. (#777) +- New `go.opentelemetry.io/otel/api/oterror` package to uniformly support error handling and definitions for the project. (#778) +- New `global` default implementation of the `go.opentelemetry.io/otel/api/oterror.Handler` interface to be used to handle errors prior to an user defined `Handler`. + There is also functionality for the user to register their `Handler` as well as a convenience function `Handle` to handle an error with this global `Handler`(#778) +- Options to specify propagators for httptrace and grpctrace instrumentation. (#784) +- The required `application/json` header for the Zipkin exporter is included in all exports. (#774) +- Integrate HTTP semantics helpers from the contrib repository into the `api/standard` package. #769 + +### Changed + +- Rename `Integrator` to `Processor` in the metric SDK. (#863) +- Rename `AggregationSelector` to `AggregatorSelector`. (#859) +- Rename `SynchronizedCopy` to `SynchronizedMove`. (#858) +- Rename `simple` integrator to `basic` integrator. (#857) +- Merge otlp collector examples. (#841) +- Change the metric SDK to support cumulative, delta, and pass-through exporters directly. + With these changes, cumulative and delta specific exporters are able to request the correct kind of aggregation from the SDK. (#840) +- The `Aggregator.Checkpoint` API is renamed to `SynchronizedCopy` and adds an argument, a different `Aggregator` into which the copy is stored. (#812) +- The `export.Aggregator` contract is that `Update()` and `SynchronizedCopy()` are synchronized with each other. + All the aggregation interfaces (`Sum`, `LastValue`, ...) are not meant to be synchronized, as the caller is expected to synchronize aggregators at a higher level after the `Accumulator`. + Some of the `Aggregators` used unnecessary locking and that has been cleaned up. (#812) +- Use of `metric.Number` was replaced by `int64` now that we use `sync.Mutex` in the `MinMaxSumCount` and `Histogram` `Aggregators`. (#812) +- Replace `AlwaysParentSample` with `ParentSample(fallback)` to match the OpenTelemetry v0.5.0 specification. (#810) +- Rename `sdk/export/metric/aggregator` to `sdk/export/metric/aggregation`. #808 +- Send configured headers with every request in the OTLP exporter, instead of just on connection creation. (#806) +- Update error handling for any one off error handlers, replacing, instead, with the `global.Handle` function. (#791) +- Rename `plugin` directory to `instrumentation` to match the OpenTelemetry specification. (#779) +- Makes the argument order to Histogram and DDSketch `New()` consistent. (#781) + +### Removed + +- `Uint64NumberKind` and related functions from the API. (#864) +- Context arguments from `Aggregator.Checkpoint` and `Integrator.Process` as they were unused. (#803) +- `SpanID` is no longer included in parameters for sampling decision to match the OpenTelemetry specification. (#775) + +### Fixed + +- Upgrade OTLP exporter to opentelemetry-proto matching the opentelemetry-collector v0.4.0 release. (#866) +- Allow changes to `go.sum` and `go.mod` when running dependabot tidy-up. (#871) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1. (#824) +- Bump github.com/prometheus/client_golang from 1.7.0 to 1.7.1 in /exporters/metric/prometheus. (#867) +- Bump google.golang.org/grpc from 1.29.1 to 1.30.0 in /exporters/trace/jaeger. (#853) +- Bump google.golang.org/grpc from 1.29.1 to 1.30.0 in /exporters/trace/zipkin. (#854) +- Bumps github.com/golang/protobuf from 1.3.2 to 1.4.2 (#848) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/otlp (#817) +- Bump github.com/golangci/golangci-lint from 1.25.1 to 1.27.0 in /tools (#828) +- Bump github.com/prometheus/client_golang from 1.5.0 to 1.7.0 in /exporters/metric/prometheus (#838) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/trace/jaeger (#829) +- Bump github.com/benbjohnson/clock from 1.0.0 to 1.0.3 (#815) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/trace/zipkin (#823) +- Bump github.com/itchyny/gojq from 0.10.1 to 0.10.3 in /tools (#830) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/metric/prometheus (#822) +- Bump google.golang.org/grpc from 1.27.1 to 1.29.1 in /exporters/trace/zipkin (#820) +- Bump google.golang.org/grpc from 1.27.1 to 1.29.1 in /exporters/trace/jaeger (#831) +- Bump github.com/google/go-cmp from 0.4.0 to 0.5.0 (#836) +- Bump github.com/google/go-cmp from 0.4.0 to 0.5.0 in /exporters/trace/jaeger (#837) +- Bump github.com/google/go-cmp from 0.4.0 to 0.5.0 in /exporters/otlp (#839) +- Bump google.golang.org/api from 0.20.0 to 0.28.0 in /exporters/trace/jaeger (#843) +- Set span status from HTTP status code in the othttp instrumentation. (#832) +- Fixed typo in push controller comment. (#834) +- The `Aggregator` testing has been updated and cleaned. (#812) +- `metric.Number(0)` expressions are replaced by `0` where possible. (#812) +- Fixed `global` `handler_test.go` test failure. #804 +- Fixed `BatchSpanProcessor.Shutdown` to wait until all spans are processed. (#766) +- Fixed OTLP example's accidental early close of exporter. (#807) +- Ensure zipkin exporter reads and closes response body. (#788) +- Update instrumentation to use `api/standard` keys instead of custom keys. (#782) +- Clean up tools and RELEASING documentation. (#762) + +## [0.6.0] - 2020-05-21 + +### Added + +- Support for `Resource`s in the prometheus exporter. (#757) +- New pull controller. (#751) +- New `UpDownSumObserver` instrument. (#750) +- OpenTelemetry collector demo. (#711) +- New `SumObserver` instrument. (#747) +- New `UpDownCounter` instrument. (#745) +- New timeout `Option` and configuration function `WithTimeout` to the push controller. (#742) +- New `api/standards` package to implement semantic conventions and standard key-value generation. (#731) + +### Changed + +- Rename `Register*` functions in the metric API to `New*` for all `Observer` instruments. (#761) +- Use `[]float64` for histogram boundaries, not `[]metric.Number`. (#758) +- Change OTLP example to use exporter as a trace `Syncer` instead of as an unneeded `Batcher`. (#756) +- Replace `WithResourceAttributes()` with `WithResource()` in the trace SDK. (#754) +- The prometheus exporter now uses the new pull controller. (#751) +- Rename `ScheduleDelayMillis` to `BatchTimeout` in the trace `BatchSpanProcessor`.(#752) +- Support use of synchronous instruments in asynchronous callbacks (#725) +- Move `Resource` from the `Export` method parameter into the metric export `Record`. (#739) +- Rename `Observer` instrument to `ValueObserver`. (#734) +- The push controller now has a method (`Provider()`) to return a `metric.Provider` instead of the old `Meter` method that acted as a `metric.Provider`. (#738) +- Replace `Measure` instrument by `ValueRecorder` instrument. (#732) +- Rename correlation context header from `"Correlation-Context"` to `"otcorrelations"` to match the OpenTelemetry specification. (#727) + +### Fixed + +- Ensure gRPC `ClientStream` override methods do not panic in grpctrace package. (#755) +- Disable parts of `BatchSpanProcessor` test until a fix is found. (#743) +- Fix `string` case in `kv` `Infer` function. (#746) +- Fix panic in grpctrace client interceptors. (#740) +- Refactor the `api/metrics` push controller and add `CheckpointSet` synchronization. (#737) +- Rewrite span batch process queue batching logic. (#719) +- Remove the push controller named Meter map. (#738) +- Fix Histogram aggregator initial state (fix #735). (#736) +- Ensure golang alpine image is running `golang-1.14` for examples. (#733) +- Added test for grpctrace `UnaryInterceptorClient`. (#695) +- Rearrange `api/metric` code layout. (#724) + +## [0.5.0] - 2020-05-13 + +### Added + +- Batch `Observer` callback support. (#717) +- Alias `api` types to root package of project. (#696) +- Create basic `othttp.Transport` for simple client instrumentation. (#678) +- `SetAttribute(string, interface{})` to the trace API. (#674) +- Jaeger exporter option that allows user to specify custom http client. (#671) +- `Stringer` and `Infer` methods to `key`s. (#662) + +### Changed + +- Rename `NewKey` in the `kv` package to just `Key`. (#721) +- Move `core` and `key` to `kv` package. (#720) +- Make the metric API `Meter` a `struct` so the abstract `MeterImpl` can be passed and simplify implementation. (#709) +- Rename SDK `Batcher` to `Integrator` to match draft OpenTelemetry SDK specification. (#710) +- Rename SDK `Ungrouped` integrator to `simple.Integrator` to match draft OpenTelemetry SDK specification. (#710) +- Rename SDK `SDK` `struct` to `Accumulator` to match draft OpenTelemetry SDK specification. (#710) +- Move `Number` from `core` to `api/metric` package. (#706) +- Move `SpanContext` from `core` to `trace` package. (#692) +- Change traceparent header from `Traceparent` to `traceparent` to implement the W3C specification. (#681) + +### Fixed + +- Update tooling to run generators in all submodules. (#705) +- gRPC interceptor regexp to match methods without a service name. (#683) +- Use a `const` for padding 64-bit B3 trace IDs. (#701) +- Update `mockZipkin` listen address from `:0` to `127.0.0.1:0`. (#700) +- Left-pad 64-bit B3 trace IDs with zero. (#698) +- Propagate at least the first W3C tracestate header. (#694) +- Remove internal `StateLocker` implementation. (#688) +- Increase instance size CI system uses. (#690) +- Add a `key` benchmark and use reflection in `key.Infer()`. (#679) +- Fix internal `global` test by using `global.Meter` with `RecordBatch()`. (#680) +- Reimplement histogram using mutex instead of `StateLocker`. (#669) +- Switch `MinMaxSumCount` to a mutex lock implementation instead of `StateLocker`. (#667) +- Update documentation to not include any references to `WithKeys`. (#672) +- Correct misspelling. (#668) +- Fix clobbering of the span context if extraction fails. (#656) +- Bump `golangci-lint` and work around the corrupting bug. (#666) (#670) + +## [0.4.3] - 2020-04-24 + +### Added + +- `Dockerfile` and `docker-compose.yml` to run example code. (#635) +- New `grpctrace` package that provides gRPC client and server interceptors for both unary and stream connections. (#621) +- New `api/label` package, providing common label set implementation. (#651) +- Support for JSON marshaling of `Resources`. (#654) +- `TraceID` and `SpanID` implementations for `Stringer` interface. (#642) +- `RemoteAddrKey` in the othttp plugin to include the HTTP client address in top-level spans. (#627) +- `WithSpanFormatter` option to the othttp plugin. (#617) +- Updated README to include section for compatible libraries and include reference to the contrib repository. (#612) +- The prometheus exporter now supports exporting histograms. (#601) +- A `String` method to the `Resource` to return a hashable identifier for a now unique resource. (#613) +- An `Iter` method to the `Resource` to return an array `AttributeIterator`. (#613) +- An `Equal` method to the `Resource` test the equivalence of resources. (#613) +- An iterable structure (`AttributeIterator`) for `Resource` attributes. + +### Changed + +- zipkin export's `NewExporter` now requires a `serviceName` argument to ensure this needed values is provided. (#644) +- Pass `Resources` through the metrics export pipeline. (#659) + +### Removed + +- `WithKeys` option from the metric API. (#639) + +### Fixed + +- Use the `label.Set.Equivalent` value instead of an encoding in the batcher. (#658) +- Correct typo `trace.Exporter` to `trace.SpanSyncer` in comments. (#653) +- Use type names for return values in jaeger exporter. (#648) +- Increase the visibility of the `api/key` package by updating comments and fixing usages locally. (#650) +- `Checkpoint` only after `Update`; Keep records in the `sync.Map` longer. (#647) +- Do not cache `reflect.ValueOf()` in metric Labels. (#649) +- Batch metrics exported from the OTLP exporter based on `Resource` and labels. (#626) +- Add error wrapping to the prometheus exporter. (#631) +- Update the OTLP exporter batching of traces to use a unique `string` representation of an associated `Resource` as the batching key. (#623) +- Update OTLP `SpanData` transform to only include the `ParentSpanID` if one exists. (#614) +- Update `Resource` internal representation to uniquely and reliably identify resources. (#613) +- Check return value from `CheckpointSet.ForEach` in prometheus exporter. (#622) +- Ensure spans created by httptrace client tracer reflect operation structure. (#618) +- Create a new recorder rather than reuse when multiple observations in same epoch for asynchronous instruments. #610 +- The default port the OTLP exporter uses to connect to the OpenTelemetry collector is updated to match the one the collector listens on by default. (#611) + +## [0.4.2] - 2020-03-31 + +### Fixed + +- Fix `pre_release.sh` to update version in `sdk/opentelemetry.go`. (#607) +- Fix time conversion from internal to OTLP in OTLP exporter. (#606) + +## [0.4.1] - 2020-03-31 + +### Fixed + +- Update `tag.sh` to create signed tags. (#604) + +## [0.4.0] - 2020-03-30 + +### Added + +- New API package `api/metric/registry` that exposes a `MeterImpl` wrapper for use by SDKs to generate unique instruments. (#580) +- Script to verify examples after a new release. (#579) + +### Removed + +- The dogstatsd exporter due to lack of support. + This additionally removes support for statsd. (#591) +- `LabelSet` from the metric API. + This is replaced by a `[]core.KeyValue` slice. (#595) +- `Labels` from the metric API's `Meter` interface. (#595) + +### Changed + +- The metric `export.Labels` became an interface which the SDK implements and the `export` package provides a simple, immutable implementation of this interface intended for testing purposes. (#574) +- Renamed `internal/metric.Meter` to `MeterImpl`. (#580) +- Renamed `api/global/internal.obsImpl` to `asyncImpl`. (#580) + +### Fixed + +- Corrected missing return in mock span. (#582) +- Update License header for all source files to match CNCF guidelines and include a test to ensure it is present. (#586) (#596) +- Update to v0.3.0 of the OTLP in the OTLP exporter. (#588) +- Update pre-release script to be compatible between GNU and BSD based systems. (#592) +- Add a `RecordBatch` benchmark. (#594) +- Moved span transforms of the OTLP exporter to the internal package. (#593) +- Build both go-1.13 and go-1.14 in circleci to test for all supported versions of Go. (#569) +- Removed unneeded allocation on empty labels in OLTP exporter. (#597) +- Update `BatchedSpanProcessor` to process the queue until no data but respect max batch size. (#599) +- Update project documentation godoc.org links to pkg.go.dev. (#602) + +## [0.3.0] - 2020-03-21 + +This is a first official beta release, which provides almost fully complete metrics, tracing, and context propagation functionality. +There is still a possibility of breaking changes. + +### Added + +- Add `Observer` metric instrument. (#474) +- Add global `Propagators` functionality to enable deferred initialization for propagators registered before the first Meter SDK is installed. (#494) +- Simplified export setup pipeline for the jaeger exporter to match other exporters. (#459) +- The zipkin trace exporter. (#495) +- The OTLP exporter to export metric and trace telemetry to the OpenTelemetry collector. (#497) (#544) (#545) +- Add `StatusMessage` field to the trace `Span`. (#524) +- Context propagation in OpenTracing bridge in terms of OpenTelemetry context propagation. (#525) +- The `Resource` type was added to the SDK. (#528) +- The global API now supports a `Tracer` and `Meter` function as shortcuts to getting a global `*Provider` and calling these methods directly. (#538) +- The metric API now defines a generic `MeterImpl` interface to support general purpose `Meter` construction. + Additionally, `SyncImpl` and `AsyncImpl` are added to support general purpose instrument construction. (#560) +- A metric `Kind` is added to represent the `MeasureKind`, `ObserverKind`, and `CounterKind`. (#560) +- Scripts to better automate the release process. (#576) + +### Changed + +- Default to to use `AlwaysSampler` instead of `ProbabilitySampler` to match OpenTelemetry specification. (#506) +- Renamed `AlwaysSampleSampler` to `AlwaysOnSampler` in the trace API. (#511) +- Renamed `NeverSampleSampler` to `AlwaysOffSampler` in the trace API. (#511) +- The `Status` field of the `Span` was changed to `StatusCode` to disambiguate with the added `StatusMessage`. (#524) +- Updated the trace `Sampler` interface conform to the OpenTelemetry specification. (#531) +- Rename metric API `Options` to `Config`. (#541) +- Rename metric `Counter` aggregator to be `Sum`. (#541) +- Unify metric options into `Option` from instrument specific options. (#541) +- The trace API's `TraceProvider` now support `Resource`s. (#545) +- Correct error in zipkin module name. (#548) +- The jaeger trace exporter now supports `Resource`s. (#551) +- Metric SDK now supports `Resource`s. + The `WithResource` option was added to configure a `Resource` on creation and the `Resource` method was added to the metric `Descriptor` to return the associated `Resource`. (#552) +- Replace `ErrNoLastValue` and `ErrEmptyDataSet` by `ErrNoData` in the metric SDK. (#557) +- The stdout trace exporter now supports `Resource`s. (#558) +- The metric `Descriptor` is now included at the API instead of the SDK. (#560) +- Replace `Ordered` with an iterator in `export.Labels`. (#567) + +### Removed + +- The vendor specific Stackdriver. It is now hosted on 3rd party vendor infrastructure. (#452) +- The `Unregister` method for metric observers as it is not in the OpenTelemetry specification. (#560) +- `GetDescriptor` from the metric SDK. (#575) +- The `Gauge` instrument from the metric API. (#537) + +### Fixed + +- Make histogram aggregator checkpoint consistent. (#438) +- Update README with import instructions and how to build and test. (#505) +- The default label encoding was updated to be unique. (#508) +- Use `NewRoot` in the othttp plugin for public endpoints. (#513) +- Fix data race in `BatchedSpanProcessor`. (#518) +- Skip test-386 for Mac OS 10.15.x (Catalina and upwards). #521 +- Use a variable-size array to represent ordered labels in maps. (#523) +- Update the OTLP protobuf and update changed import path. (#532) +- Use `StateLocker` implementation in `MinMaxSumCount`. (#546) +- Eliminate goroutine leak in histogram stress test. (#547) +- Update OTLP exporter with latest protobuf. (#550) +- Add filters to the othttp plugin. (#556) +- Provide an implementation of the `Header*` filters that do not depend on Go 1.14. (#565) +- Encode labels once during checkpoint. + The checkpoint function is executed in a single thread so we can do the encoding lazily before passing the encoded version of labels to the exporter. + This is a cheap and quick way to avoid encoding the labels on every collection interval. (#572) +- Run coverage over all packages in `COVERAGE_MOD_DIR`. (#573) + +## [0.2.3] - 2020-03-04 + +### Added + +- `RecordError` method on `Span`s in the trace API to Simplify adding error events to spans. (#473) +- Configurable push frequency for exporters setup pipeline. (#504) + +### Changed + +- Rename the `exporter` directory to `exporters`. + The `go.opentelemetry.io/otel/exporter/trace/jaeger` package was mistakenly released with a `v1.0.0` tag instead of `v0.1.0`. + This resulted in all subsequent releases not becoming the default latest. + A consequence of this was that all `go get`s pulled in the incompatible `v0.1.0` release of that package when pulling in more recent packages from other otel packages. + Renaming the `exporter` directory to `exporters` fixes this issue by renaming the package and therefore clearing any existing dependency tags. + Consequentially, this action also renames *all* exporter packages. (#502) + +### Removed + +- The `CorrelationContextHeader` constant in the `correlation` package is no longer exported. (#503) + +## [0.2.2] - 2020-02-27 + +### Added + +- `HTTPSupplier` interface in the propagation API to specify methods to retrieve and store a single value for a key to be associated with a carrier. (#467) +- `HTTPExtractor` interface in the propagation API to extract information from an `HTTPSupplier` into a context. (#467) +- `HTTPInjector` interface in the propagation API to inject information into an `HTTPSupplier.` (#467) +- `Config` and configuring `Option` to the propagator API. (#467) +- `Propagators` interface in the propagation API to contain the set of injectors and extractors for all supported carrier formats. (#467) +- `HTTPPropagator` interface in the propagation API to inject and extract from an `HTTPSupplier.` (#467) +- `WithInjectors` and `WithExtractors` functions to the propagator API to configure injectors and extractors to use. (#467) +- `ExtractHTTP` and `InjectHTTP` functions to apply configured HTTP extractors and injectors to a passed context. (#467) +- Histogram aggregator. (#433) +- `DefaultPropagator` function and have it return `trace.TraceContext` as the default context propagator. (#456) +- `AlwaysParentSample` sampler to the trace API. (#455) +- `WithNewRoot` option function to the trace API to specify the created span should be considered a root span. (#451) + +### Changed + +- Renamed `WithMap` to `ContextWithMap` in the correlation package. (#481) +- Renamed `FromContext` to `MapFromContext` in the correlation package. (#481) +- Move correlation context propagation to correlation package. (#479) +- Do not default to putting remote span context into links. (#480) +- `Tracer.WithSpan` updated to accept `StartOptions`. (#472) +- Renamed `MetricKind` to `Kind` to not stutter in the type usage. (#432) +- Renamed the `export` package to `metric` to match directory structure. (#432) +- Rename the `api/distributedcontext` package to `api/correlation`. (#444) +- Rename the `api/propagators` package to `api/propagation`. (#444) +- Move the propagators from the `propagators` package into the `trace` API package. (#444) +- Update `Float64Gauge`, `Int64Gauge`, `Float64Counter`, `Int64Counter`, `Float64Measure`, and `Int64Measure` metric methods to use value receivers instead of pointers. (#462) +- Moved all dependencies of tools package to a tools directory. (#466) + +### Removed + +- Binary propagators. (#467) +- NOOP propagator. (#467) + +### Fixed + +- Upgraded `github.com/golangci/golangci-lint` from `v1.21.0` to `v1.23.6` in `tools/`. (#492) +- Fix a possible nil-dereference crash (#478) +- Correct comments for `InstallNewPipeline` in the stdout exporter. (#483) +- Correct comments for `InstallNewPipeline` in the dogstatsd exporter. (#484) +- Correct comments for `InstallNewPipeline` in the prometheus exporter. (#482) +- Initialize `onError` based on `Config` in prometheus exporter. (#486) +- Correct module name in prometheus exporter README. (#475) +- Removed tracer name prefix from span names. (#430) +- Fix `aggregator_test.go` import package comment. (#431) +- Improved detail in stdout exporter. (#436) +- Fix a dependency issue (generate target should depend on stringer, not lint target) in Makefile. (#442) +- Reorders the Makefile targets within `precommit` target so we generate files and build the code before doing linting, so we can get much nicer errors about syntax errors from the compiler. (#442) +- Reword function documentation in gRPC plugin. (#446) +- Send the `span.kind` tag to Jaeger from the jaeger exporter. (#441) +- Fix `metadataSupplier` in the jaeger exporter to overwrite the header if existing instead of appending to it. (#441) +- Upgraded to Go 1.13 in CI. (#465) +- Correct opentelemetry.io URL in trace SDK documentation. (#464) +- Refactored reference counting logic in SDK determination of stale records. (#468) +- Add call to `runtime.Gosched` in instrument `acquireHandle` logic to not block the collector. (#469) + +## [0.2.1.1] - 2020-01-13 + +### Fixed + +- Use stateful batcher on Prometheus exporter fixing regression introduced in #395. (#428) + +## [0.2.1] - 2020-01-08 + +### Added + +- Global meter forwarding implementation. + This enables deferred initialization for metric instruments registered before the first Meter SDK is installed. (#392) +- Global trace forwarding implementation. + This enables deferred initialization for tracers registered before the first Trace SDK is installed. (#406) +- Standardize export pipeline creation in all exporters. (#395) +- A testing, organization, and comments for 64-bit field alignment. (#418) +- Script to tag all modules in the project. (#414) + +### Changed + +- Renamed `propagation` package to `propagators`. (#362) +- Renamed `B3Propagator` propagator to `B3`. (#362) +- Renamed `TextFormatPropagator` propagator to `TextFormat`. (#362) +- Renamed `BinaryPropagator` propagator to `Binary`. (#362) +- Renamed `BinaryFormatPropagator` propagator to `BinaryFormat`. (#362) +- Renamed `NoopTextFormatPropagator` propagator to `NoopTextFormat`. (#362) +- Renamed `TraceContextPropagator` propagator to `TraceContext`. (#362) +- Renamed `SpanOption` to `StartOption` in the trace API. (#369) +- Renamed `StartOptions` to `StartConfig` in the trace API. (#369) +- Renamed `EndOptions` to `EndConfig` in the trace API. (#369) +- `Number` now has a pointer receiver for its methods. (#375) +- Renamed `CurrentSpan` to `SpanFromContext` in the trace API. (#379) +- Renamed `SetCurrentSpan` to `ContextWithSpan` in the trace API. (#379) +- Renamed `Message` in Event to `Name` in the trace API. (#389) +- Prometheus exporter no longer aggregates metrics, instead it only exports them. (#385) +- Renamed `HandleImpl` to `BoundInstrumentImpl` in the metric API. (#400) +- Renamed `Float64CounterHandle` to `Float64CounterBoundInstrument` in the metric API. (#400) +- Renamed `Int64CounterHandle` to `Int64CounterBoundInstrument` in the metric API. (#400) +- Renamed `Float64GaugeHandle` to `Float64GaugeBoundInstrument` in the metric API. (#400) +- Renamed `Int64GaugeHandle` to `Int64GaugeBoundInstrument` in the metric API. (#400) +- Renamed `Float64MeasureHandle` to `Float64MeasureBoundInstrument` in the metric API. (#400) +- Renamed `Int64MeasureHandle` to `Int64MeasureBoundInstrument` in the metric API. (#400) +- Renamed `Release` method for bound instruments in the metric API to `Unbind`. (#400) +- Renamed `AcquireHandle` method for bound instruments in the metric API to `Bind`. (#400) +- Renamed the `File` option in the stdout exporter to `Writer`. (#404) +- Renamed all `Options` to `Config` for all metric exports where this wasn't already the case. + +### Fixed + +- Aggregator import path corrected. (#421) +- Correct links in README. (#368) +- The README was updated to match latest code changes in its examples. (#374) +- Don't capitalize error statements. (#375) +- Fix ignored errors. (#375) +- Fix ambiguous variable naming. (#375) +- Removed unnecessary type casting. (#375) +- Use named parameters. (#375) +- Updated release schedule. (#378) +- Correct http-stackdriver example module name. (#394) +- Removed the `http.request` span in `httptrace` package. (#397) +- Add comments in the metrics SDK (#399) +- Initialize checkpoint when creating ddsketch aggregator to prevent panic when merging into a empty one. (#402) (#403) +- Add documentation of compatible exporters in the README. (#405) +- Typo fix. (#408) +- Simplify span check logic in SDK tracer implementation. (#419) + +## [0.2.0] - 2019-12-03 + +### Added + +- Unary gRPC tracing example. (#351) +- Prometheus exporter. (#334) +- Dogstatsd metrics exporter. (#326) + +### Changed + +- Rename `MaxSumCount` aggregation to `MinMaxSumCount` and add the `Min` interface for this aggregation. (#352) +- Rename `GetMeter` to `Meter`. (#357) +- Rename `HTTPTraceContextPropagator` to `TraceContextPropagator`. (#355) +- Rename `HTTPB3Propagator` to `B3Propagator`. (#355) +- Rename `HTTPTraceContextPropagator` to `TraceContextPropagator`. (#355) +- Move `/global` package to `/api/global`. (#356) +- Rename `GetTracer` to `Tracer`. (#347) + +### Removed + +- `SetAttribute` from the `Span` interface in the trace API. (#361) +- `AddLink` from the `Span` interface in the trace API. (#349) +- `Link` from the `Span` interface in the trace API. (#349) + +### Fixed + +- Exclude example directories from coverage report. (#365) +- Lint make target now implements automatic fixes with `golangci-lint` before a second run to report the remaining issues. (#360) +- Drop `GO111MODULE` environment variable in Makefile as Go 1.13 is the project specified minimum version and this is environment variable is not needed for that version of Go. (#359) +- Run the race checker for all test. (#354) +- Redundant commands in the Makefile are removed. (#354) +- Split the `generate` and `lint` targets of the Makefile. (#354) +- Renames `circle-ci` target to more generic `ci` in Makefile. (#354) +- Add example Prometheus binary to gitignore. (#358) +- Support negative numbers with the `MaxSumCount`. (#335) +- Resolve race conditions in `push_test.go` identified in #339. (#340) +- Use `/usr/bin/env bash` as a shebang in scripts rather than `/bin/bash`. (#336) +- Trace benchmark now tests both `AlwaysSample` and `NeverSample`. + Previously it was testing `AlwaysSample` twice. (#325) +- Trace benchmark now uses a `[]byte` for `TraceID` to fix failing test. (#325) +- Added a trace benchmark to test variadic functions in `setAttribute` vs `setAttributes` (#325) +- The `defaultkeys` batcher was only using the encoded label set as its map key while building a checkpoint. + This allowed distinct label sets through, but any metrics sharing a label set could be overwritten or merged incorrectly. + This was corrected. (#333) + +## [0.1.2] - 2019-11-18 + +### Fixed + +- Optimized the `simplelru` map for attributes to reduce the number of allocations. (#328) +- Removed unnecessary unslicing of parameters that are already a slice. (#324) + +## [0.1.1] - 2019-11-18 + +This release contains a Metrics SDK with stdout exporter and supports basic aggregations such as counter, gauges, array, maxsumcount, and ddsketch. + +### Added + +- Metrics stdout export pipeline. (#265) +- Array aggregation for raw measure metrics. (#282) +- The core.Value now have a `MarshalJSON` method. (#281) + +### Removed + +- `WithService`, `WithResources`, and `WithComponent` methods of tracers. (#314) +- Prefix slash in `Tracer.Start()` for the Jaeger example. (#292) + +### Changed + +- Allocation in LabelSet construction to reduce GC overhead. (#318) +- `trace.WithAttributes` to append values instead of replacing (#315) +- Use a formula for tolerance in sampling tests. (#298) +- Move export types into trace and metric-specific sub-directories. (#289) +- `SpanKind` back to being based on an `int` type. (#288) + +### Fixed + +- URL to OpenTelemetry website in README. (#323) +- Name of othttp default tracer. (#321) +- `ExportSpans` for the stackdriver exporter now handles `nil` context. (#294) +- CI modules cache to correctly restore/save from/to the cache. (#316) +- Fix metric SDK race condition between `LoadOrStore` and the assignment `rec.recorder = i.meter.exporter.AggregatorFor(rec)`. (#293) +- README now reflects the new code structure introduced with these changes. (#291) +- Make the basic example work. (#279) + +## [0.1.0] - 2019-11-04 + +This is the first release of open-telemetry go library. +It contains api and sdk for trace and meter. + +### Added + +- Initial OpenTelemetry trace and metric API prototypes. +- Initial OpenTelemetry trace, metric, and export SDK packages. +- A wireframe bridge to support compatibility with OpenTracing. +- Example code for a basic, http-stackdriver, http, jaeger, and named tracer setup. +- Exporters for Jaeger, Stackdriver, and stdout. +- Propagators for binary, B3, and trace-context protocols. +- Project information and guidelines in the form of a README and CONTRIBUTING. +- Tools to build the project and a Makefile to automate the process. +- Apache-2.0 license. +- CircleCI build CI manifest files. +- CODEOWNERS file to track owners of this project. + +[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.24.0...HEAD +[1.24.0/0.46.0/0.0.1-alpha]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.24.0 +[1.23.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.1 +[1.23.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.0 +[1.23.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.0-rc.1 +[1.22.0/0.45.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.22.0 +[1.21.0/0.44.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.21.0 +[1.20.0/0.43.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.20.0 +[1.19.0/0.42.0/0.0.7]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.19.0 +[1.19.0-rc.1/0.42.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.19.0-rc.1 +[1.18.0/0.41.0/0.0.6]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.18.0 +[1.17.0/0.40.0/0.0.5]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.17.0 +[1.16.0/0.39.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.16.0 +[1.16.0-rc.1/0.39.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.16.0-rc.1 +[1.15.1/0.38.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.15.1 +[1.15.0/0.38.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.15.0 +[1.15.0-rc.2/0.38.0-rc.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.15.0-rc.2 +[1.15.0-rc.1/0.38.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.15.0-rc.1 +[1.14.0/0.37.0/0.0.4]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.14.0 +[1.13.0/0.36.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.13.0 +[1.12.0/0.35.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.12.0 +[1.11.2/0.34.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.2 +[1.11.1/0.33.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.1 +[1.11.0/0.32.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.0 +[0.32.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/sdk/metric/v0.32.2 +[0.32.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/sdk/metric/v0.32.1 +[0.32.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/sdk/metric/v0.32.0 +[1.10.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.10.0 +[1.9.0/0.0.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.9.0 +[1.8.0/0.31.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.8.0 +[1.7.0/0.30.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.7.0 +[0.29.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/metric/v0.29.0 +[1.6.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.6.3 +[1.6.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.6.2 +[1.6.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.6.1 +[1.6.0/0.28.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.6.0 +[1.5.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.5.0 +[1.4.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.4.1 +[1.4.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.4.0 +[1.3.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.3.0 +[1.2.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.2.0 +[1.1.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.1.0 +[1.0.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.1 +[Metrics 0.24.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/metric/v0.24.0 +[1.0.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.0 +[1.0.0-RC3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.0-RC3 +[1.0.0-RC2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.0-RC2 +[Experimental Metrics v0.22.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/metric/v0.22.0 +[1.0.0-RC1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.0-RC1 +[0.20.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.20.0 +[0.19.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.19.0 +[0.18.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.18.0 +[0.17.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.17.0 +[0.16.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.16.0 +[0.15.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.15.0 +[0.14.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.14.0 +[0.13.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.13.0 +[0.12.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.12.0 +[0.11.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.11.0 +[0.10.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.10.0 +[0.9.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.9.0 +[0.8.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.8.0 +[0.7.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.7.0 +[0.6.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.6.0 +[0.5.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.5.0 +[0.4.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.3 +[0.4.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.2 +[0.4.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.1 +[0.4.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.0 +[0.3.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.3.0 +[0.2.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.3 +[0.2.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.2 +[0.2.1.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.1.1 +[0.2.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.1 +[0.2.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.0 +[0.1.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.2 +[0.1.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.1 +[0.1.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.0 + +[Go 1.22]: https://go.dev/doc/go1.22 +[Go 1.21]: https://go.dev/doc/go1.21 +[Go 1.20]: https://go.dev/doc/go1.20 +[Go 1.19]: https://go.dev/doc/go1.19 +[Go 1.18]: https://go.dev/doc/go1.18 + +[metric API]:https://pkg.go.dev/go.opentelemetry.io/otel/metric +[metric SDK]:https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric +[trace API]:https://pkg.go.dev/go.opentelemetry.io/otel/trace diff --git a/vendor/go.opentelemetry.io/otel/CODEOWNERS b/vendor/go.opentelemetry.io/otel/CODEOWNERS new file mode 100644 index 000000000..31d336d92 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/CODEOWNERS @@ -0,0 +1,17 @@ +##################################################### +# +# List of approvers for this repository +# +##################################################### +# +# Learn about membership in OpenTelemetry community: +# https://github.com/open-telemetry/community/blob/main/community-membership.md +# +# +# Learn about CODEOWNERS file format: +# https://help.github.com/en/articles/about-code-owners +# + +* @MrAlias @Aneurysm9 @evantorrie @XSAM @dashpole @MadVikingGod @pellared @hanyuancheung @dmathieu + +CODEOWNERS @MrAlias @MadVikingGod @pellared @dashpole \ No newline at end of file diff --git a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md new file mode 100644 index 000000000..c9f2bac55 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md @@ -0,0 +1,645 @@ +# Contributing to opentelemetry-go + +The Go special interest group (SIG) meets regularly. See the +OpenTelemetry +[community](https://github.com/open-telemetry/community#golang-sdk) +repo for information on this and other language SIGs. + +See the [public meeting +notes](https://docs.google.com/document/d/1E5e7Ld0NuU1iVvf-42tOBpu2VBBLYnh73GJuITGJTTU/edit) +for a summary description of past meetings. To request edit access, +join the meeting or get in touch on +[Slack](https://cloud-native.slack.com/archives/C01NPAXACKT). + +## Development + +You can view and edit the source code by cloning this repository: + +```sh +git clone https://github.com/open-telemetry/opentelemetry-go.git +``` + +Run `make test` to run the tests instead of `go test`. + +There are some generated files checked into the repo. To make sure +that the generated files are up-to-date, run `make` (or `make +precommit` - the `precommit` target is the default). + +The `precommit` target also fixes the formatting of the code and +checks the status of the go module files. + +Additionally, there is a `codespell` target that checks for common +typos in the code. It is not run by default, but you can run it +manually with `make codespell`. It will set up a virtual environment +in `venv` and install `codespell` there. + +If after running `make precommit` the output of `git status` contains +`nothing to commit, working tree clean` then it means that everything +is up-to-date and properly formatted. + +## Pull Requests + +### How to Send Pull Requests + +Everyone is welcome to contribute code to `opentelemetry-go` via +GitHub pull requests (PRs). + +To create a new PR, fork the project in GitHub and clone the upstream +repo: + +```sh +go get -d go.opentelemetry.io/otel +``` + +(This may print some warning about "build constraints exclude all Go +files", just ignore it.) + +This will put the project in `${GOPATH}/src/go.opentelemetry.io/otel`. You +can alternatively use `git` directly with: + +```sh +git clone https://github.com/open-telemetry/opentelemetry-go +``` + +(Note that `git clone` is *not* using the `go.opentelemetry.io/otel` name - +that name is a kind of a redirector to GitHub that `go get` can +understand, but `git` does not.) + +This would put the project in the `opentelemetry-go` directory in +current working directory. + +Enter the newly created directory and add your fork as a new remote: + +```sh +git remote add git@github.com:/opentelemetry-go +``` + +Check out a new branch, make modifications, run linters and tests, update +`CHANGELOG.md`, and push the branch to your fork: + +```sh +git checkout -b +# edit files +# update changelog +make precommit +git add -p +git commit +git push +``` + +Open a pull request against the main `opentelemetry-go` repo. Be sure to add the pull +request ID to the entry you added to `CHANGELOG.md`. + +Avoid rebasing and force-pushing to your branch to facilitate reviewing the pull request. +Rewriting Git history makes it difficult to keep track of iterations during code review. +All pull requests are squashed to a single commit upon merge to `main`. + +### How to Receive Comments + +* If the PR is not ready for review, please put `[WIP]` in the title, + tag it as `work-in-progress`, or mark it as + [`draft`](https://github.blog/2019-02-14-introducing-draft-pull-requests/). +* Make sure CLA is signed and CI is clear. + +### How to Get PRs Merged + +A PR is considered **ready to merge** when: + +* It has received two qualified approvals[^1]. + + This is not enforced through automation, but needs to be validated by the + maintainer merging. + * The qualified approvals need to be from [Approver]s/[Maintainer]s + affiliated with different companies. Two qualified approvals from + [Approver]s or [Maintainer]s affiliated with the same company counts as a + single qualified approval. + * PRs introducing changes that have already been discussed and consensus + reached only need one qualified approval. The discussion and resolution + needs to be linked to the PR. + * Trivial changes[^2] only need one qualified approval. + +* All feedback has been addressed. + * All PR comments and suggestions are resolved. + * All GitHub Pull Request reviews with a status of "Request changes" have + been addressed. Another review by the objecting reviewer with a different + status can be submitted to clear the original review, or the review can be + dismissed by a [Maintainer] when the issues from the original review have + been addressed. + * Any comments or reviews that cannot be resolved between the PR author and + reviewers can be submitted to the community [Approver]s and [Maintainer]s + during the weekly SIG meeting. If consensus is reached among the + [Approver]s and [Maintainer]s during the SIG meeting the objections to the + PR may be dismissed or resolved or the PR closed by a [Maintainer]. + * Any substantive changes to the PR require existing Approval reviews be + cleared unless the approver explicitly states that their approval persists + across changes. This includes changes resulting from other feedback. + [Approver]s and [Maintainer]s can help in clearing reviews and they should + be consulted if there are any questions. + +* The PR branch is up to date with the base branch it is merging into. + * To ensure this does not block the PR, it should be configured to allow + maintainers to update it. + +* It has been open for review for at least one working day. This gives people + reasonable time to review. + * Trivial changes[^2] do not have to wait for one day and may be merged with + a single [Maintainer]'s approval. + +* All required GitHub workflows have succeeded. +* Urgent fix can take exception as long as it has been actively communicated + among [Maintainer]s. + +Any [Maintainer] can merge the PR once the above criteria have been met. + +[^1]: A qualified approval is a GitHub Pull Request review with "Approve" + status from an OpenTelemetry Go [Approver] or [Maintainer]. +[^2]: Trivial changes include: typo corrections, cosmetic non-substantive + changes, documentation corrections or updates, dependency updates, etc. + +## Design Choices + +As with other OpenTelemetry clients, opentelemetry-go follows the +[OpenTelemetry Specification](https://opentelemetry.io/docs/specs/otel). + +It's especially valuable to read through the [library +guidelines](https://opentelemetry.io/docs/specs/otel/library-guidelines). + +### Focus on Capabilities, Not Structure Compliance + +OpenTelemetry is an evolving specification, one where the desires and +use cases are clear, but the method to satisfy those uses cases are +not. + +As such, Contributions should provide functionality and behavior that +conforms to the specification, but the interface and structure is +flexible. + +It is preferable to have contributions follow the idioms of the +language rather than conform to specific API names or argument +patterns in the spec. + +For a deeper discussion, see +[this](https://github.com/open-telemetry/opentelemetry-specification/issues/165). + +## Documentation + +Each (non-internal, non-test) package must be documented using +[Go Doc Comments](https://go.dev/doc/comment), +preferably in a `doc.go` file. + +Prefer using [Examples](https://pkg.go.dev/testing#hdr-Examples) +instead of putting code snippets in Go doc comments. +In some cases, you can even create [Testable Examples](https://go.dev/blog/examples). + +You can install and run a "local Go Doc site" in the following way: + + ```sh + go install golang.org/x/pkgsite/cmd/pkgsite@latest + pkgsite + ``` + +[`go.opentelemetry.io/otel/metric`](https://pkg.go.dev/go.opentelemetry.io/otel/metric) +is an example of a very well-documented package. + +## Style Guide + +One of the primary goals of this project is that it is actually used by +developers. With this goal in mind the project strives to build +user-friendly and idiomatic Go code adhering to the Go community's best +practices. + +For a non-comprehensive but foundational overview of these best practices +the [Effective Go](https://golang.org/doc/effective_go.html) documentation +is an excellent starting place. + +As a convenience for developers building this project the `make precommit` +will format, lint, validate, and in some cases fix the changes you plan to +submit. This check will need to pass for your changes to be able to be +merged. + +In addition to idiomatic Go, the project has adopted certain standards for +implementations of common patterns. These standards should be followed as a +default, and if they are not followed documentation needs to be included as +to the reasons why. + +### Configuration + +When creating an instantiation function for a complex `type T struct`, it is +useful to allow variable number of options to be applied. However, the strong +type system of Go restricts the function design options. There are a few ways +to solve this problem, but we have landed on the following design. + +#### `config` + +Configuration should be held in a `struct` named `config`, or prefixed with +specific type name this Configuration applies to if there are multiple +`config` in the package. This type must contain configuration options. + +```go +// config contains configuration options for a thing. +type config struct { + // options ... +} +``` + +In general the `config` type will not need to be used externally to the +package and should be unexported. If, however, it is expected that the user +will likely want to build custom options for the configuration, the `config` +should be exported. Please, include in the documentation for the `config` +how the user can extend the configuration. + +It is important that internal `config` are not shared across package boundaries. +Meaning a `config` from one package should not be directly used by another. The +one exception is the API packages. The configs from the base API, eg. +`go.opentelemetry.io/otel/trace.TracerConfig` and +`go.opentelemetry.io/otel/metric.InstrumentConfig`, are intended to be consumed +by the SDK therefore it is expected that these are exported. + +When a config is exported we want to maintain forward and backward +compatibility, to achieve this no fields should be exported but should +instead be accessed by methods. + +Optionally, it is common to include a `newConfig` function (with the same +naming scheme). This function wraps any defaults setting and looping over +all options to create a configured `config`. + +```go +// newConfig returns an appropriately configured config. +func newConfig(options ...Option) config { + // Set default values for config. + config := config{/* […] */} + for _, option := range options { + config = option.apply(config) + } + // Perform any validation here. + return config +} +``` + +If validation of the `config` options is also performed this can return an +error as well that is expected to be handled by the instantiation function +or propagated to the user. + +Given the design goal of not having the user need to work with the `config`, +the `newConfig` function should also be unexported. + +#### `Option` + +To set the value of the options a `config` contains, a corresponding +`Option` interface type should be used. + +```go +type Option interface { + apply(config) config +} +``` + +Having `apply` unexported makes sure that it will not be used externally. +Moreover, the interface becomes sealed so the user cannot easily implement +the interface on its own. + +The `apply` method should return a modified version of the passed config. +This approach, instead of passing a pointer, is used to prevent the config from being allocated to the heap. + +The name of the interface should be prefixed in the same way the +corresponding `config` is (if at all). + +#### Options + +All user configurable options for a `config` must have a related unexported +implementation of the `Option` interface and an exported configuration +function that wraps this implementation. + +The wrapping function name should be prefixed with `With*` (or in the +special case of a boolean options `Without*`) and should have the following +function signature. + +```go +func With*(…) Option { … } +``` + +##### `bool` Options + +```go +type defaultFalseOption bool + +func (o defaultFalseOption) apply(c config) config { + c.Bool = bool(o) + return c +} + +// WithOption sets a T to have an option included. +func WithOption() Option { + return defaultFalseOption(true) +} +``` + +```go +type defaultTrueOption bool + +func (o defaultTrueOption) apply(c config) config { + c.Bool = bool(o) + return c +} + +// WithoutOption sets a T to have Bool option excluded. +func WithoutOption() Option { + return defaultTrueOption(false) +} +``` + +##### Declared Type Options + +```go +type myTypeOption struct { + MyType MyType +} + +func (o myTypeOption) apply(c config) config { + c.MyType = o.MyType + return c +} + +// WithMyType sets T to have include MyType. +func WithMyType(t MyType) Option { + return myTypeOption{t} +} +``` + +##### Functional Options + +```go +type optionFunc func(config) config + +func (fn optionFunc) apply(c config) config { + return fn(c) +} + +// WithMyType sets t as MyType. +func WithMyType(t MyType) Option { + return optionFunc(func(c config) config { + c.MyType = t + return c + }) +} +``` + +#### Instantiation + +Using this configuration pattern to configure instantiation with a `NewT` +function. + +```go +func NewT(options ...Option) T {…} +``` + +Any required parameters can be declared before the variadic `options`. + +#### Dealing with Overlap + +Sometimes there are multiple complex `struct` that share common +configuration and also have distinct configuration. To avoid repeated +portions of `config`s, a common `config` can be used with the union of +options being handled with the `Option` interface. + +For example. + +```go +// config holds options for all animals. +type config struct { + Weight float64 + Color string + MaxAltitude float64 +} + +// DogOption apply Dog specific options. +type DogOption interface { + applyDog(config) config +} + +// BirdOption apply Bird specific options. +type BirdOption interface { + applyBird(config) config +} + +// Option apply options for all animals. +type Option interface { + BirdOption + DogOption +} + +type weightOption float64 + +func (o weightOption) applyDog(c config) config { + c.Weight = float64(o) + return c +} + +func (o weightOption) applyBird(c config) config { + c.Weight = float64(o) + return c +} + +func WithWeight(w float64) Option { return weightOption(w) } + +type furColorOption string + +func (o furColorOption) applyDog(c config) config { + c.Color = string(o) + return c +} + +func WithFurColor(c string) DogOption { return furColorOption(c) } + +type maxAltitudeOption float64 + +func (o maxAltitudeOption) applyBird(c config) config { + c.MaxAltitude = float64(o) + return c +} + +func WithMaxAltitude(a float64) BirdOption { return maxAltitudeOption(a) } + +func NewDog(name string, o ...DogOption) Dog {…} +func NewBird(name string, o ...BirdOption) Bird {…} +``` + +### Interfaces + +To allow other developers to better comprehend the code, it is important +to ensure it is sufficiently documented. One simple measure that contributes +to this aim is self-documenting by naming method parameters. Therefore, +where appropriate, methods of every exported interface type should have +their parameters appropriately named. + +#### Interface Stability + +All exported stable interfaces that include the following warning in their +documentation are allowed to be extended with additional methods. + +> Warning: methods may be added to this interface in minor releases. + +These interfaces are defined by the OpenTelemetry specification and will be +updated as the specification evolves. + +Otherwise, stable interfaces MUST NOT be modified. + +#### How to Change Specification Interfaces + +When an API change must be made, we will update the SDK with the new method one +release before the API change. This will allow the SDK one version before the +API change to work seamlessly with the new API. + +If an incompatible version of the SDK is used with the new API the application +will fail to compile. + +#### How Not to Change Specification Interfaces + +We have explored using a v2 of the API to change interfaces and found that there +was no way to introduce a v2 and have it work seamlessly with the v1 of the API. +Problems happened with libraries that upgraded to v2 when an application did not, +and would not produce any telemetry. + +More detail of the approaches considered and their limitations can be found in +the [Use a V2 API to evolve interfaces](https://github.com/open-telemetry/opentelemetry-go/issues/3920) +issue. + +#### How to Change Other Interfaces + +If new functionality is needed for an interface that cannot be changed it MUST +be added by including an additional interface. That added interface can be a +simple interface for the specific functionality that you want to add or it can +be a super-set of the original interface. For example, if you wanted to a +`Close` method to the `Exporter` interface: + +```go +type Exporter interface { + Export() +} +``` + +A new interface, `Closer`, can be added: + +```go +type Closer interface { + Close() +} +``` + +Code that is passed the `Exporter` interface can now check to see if the passed +value also satisfies the new interface. E.g. + +```go +func caller(e Exporter) { + /* ... */ + if c, ok := e.(Closer); ok { + c.Close() + } + /* ... */ +} +``` + +Alternatively, a new type that is the super-set of an `Exporter` can be created. + +```go +type ClosingExporter struct { + Exporter + Close() +} +``` + +This new type can be used similar to the simple interface above in that a +passed `Exporter` type can be asserted to satisfy the `ClosingExporter` type +and the `Close` method called. + +This super-set approach can be useful if there is explicit behavior that needs +to be coupled with the original type and passed as a unified type to a new +function, but, because of this coupling, it also limits the applicability of +the added functionality. If there exist other interfaces where this +functionality should be added, each one will need their own super-set +interfaces and will duplicate the pattern. For this reason, the simple targeted +interface that defines the specific functionality should be preferred. + +### Testing + +The tests should never leak goroutines. + +Use the term `ConcurrentSafe` in the test name when it aims to verify the +absence of race conditions. + +### Internal packages + +The use of internal packages should be scoped to a single module. A sub-module +should never import from a parent internal package. This creates a coupling +between the two modules where a user can upgrade the parent without the child +and if the internal package API has changed it will fail to upgrade[^3]. + +There are two known exceptions to this rule: + +- `go.opentelemetry.io/otel/internal/global` + - This package manages global state for all of opentelemetry-go. It needs to + be a single package in order to ensure the uniqueness of the global state. +- `go.opentelemetry.io/otel/internal/baggage` + - This package provides values in a `context.Context` that need to be + recognized by `go.opentelemetry.io/otel/baggage` and + `go.opentelemetry.io/otel/bridge/opentracing` but remain private. + +If you have duplicate code in multiple modules, make that code into a Go +template stored in `go.opentelemetry.io/otel/internal/shared` and use [gotmpl] +to render the templates in the desired locations. See [#4404] for an example of +this. + +[^3]: https://github.com/open-telemetry/opentelemetry-go/issues/3548 + +### Ignoring context cancellation + +OpenTelemetry API implementations need to ignore the cancellation of the context that are +passed when recording a value (e.g. starting a span, recording a measurement, emitting a log). +Recording methods should not return an error describing the cancellation state of the context +when they complete, nor should they abort any work. + +This rule may not apply if the OpenTelemetry specification defines a timeout mechanism for +the method. In that case the context cancellation can be used for the timeout with the +restriction that this behavior is documented for the method. Otherwise, timeouts +are expected to be handled by the user calling the API, not the implementation. + +Stoppage of the telemetry pipeline is handled by calling the appropriate `Shutdown` method +of a provider. It is assumed the context passed from a user is not used for this purpose. + +Outside of the direct recording of telemetry from the API (e.g. exporting telemetry, +force flushing telemetry, shutting down a signal provider) the context cancellation +should be honored. This means all work done on behalf of the user provided context +should be canceled. + +## Approvers and Maintainers + +### Approvers + +- [Evan Torrie](https://github.com/evantorrie), Verizon Media +- [Sam Xie](https://github.com/XSAM), Cisco/AppDynamics +- [Chester Cheung](https://github.com/hanyuancheung), Tencent +- [Damien Mathieu](https://github.com/dmathieu), Elastic +- [Anthony Mirabella](https://github.com/Aneurysm9), AWS + +### Maintainers + +- [David Ashpole](https://github.com/dashpole), Google +- [Aaron Clawson](https://github.com/MadVikingGod), LightStep +- [Robert Pająk](https://github.com/pellared), Splunk +- [Tyler Yahn](https://github.com/MrAlias), Splunk + +### Emeritus + +- [Liz Fong-Jones](https://github.com/lizthegrey), Honeycomb +- [Gustavo Silva Paiva](https://github.com/paivagustavo), LightStep +- [Josh MacDonald](https://github.com/jmacd), LightStep + +### Become an Approver or a Maintainer + +See the [community membership document in OpenTelemetry community +repo](https://github.com/open-telemetry/community/blob/main/community-membership.md). + +[Approver]: #approvers +[Maintainer]: #maintainers +[gotmpl]: https://pkg.go.dev/go.opentelemetry.io/build-tools/gotmpl +[#4404]: https://github.com/open-telemetry/opentelemetry-go/pull/4404 diff --git a/vendor/go.opentelemetry.io/otel/LICENSE b/vendor/go.opentelemetry.io/otel/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/go.opentelemetry.io/otel/Makefile b/vendor/go.opentelemetry.io/otel/Makefile new file mode 100644 index 000000000..6de95219b --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/Makefile @@ -0,0 +1,318 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +TOOLS_MOD_DIR := ./internal/tools + +ALL_DOCS := $(shell find . -name '*.md' -type f | sort) +ALL_GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort) +OTEL_GO_MOD_DIRS := $(filter-out $(TOOLS_MOD_DIR), $(ALL_GO_MOD_DIRS)) +ALL_COVERAGE_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | grep -E -v '^./example|^$(TOOLS_MOD_DIR)' | sort) + +GO = go +TIMEOUT = 60 + +.DEFAULT_GOAL := precommit + +.PHONY: precommit ci +precommit: generate dependabot-generate license-check misspell go-mod-tidy golangci-lint-fix test-default +ci: generate dependabot-check license-check lint vanity-import-check build test-default check-clean-work-tree test-coverage + +# Tools + +TOOLS = $(CURDIR)/.tools + +$(TOOLS): + @mkdir -p $@ +$(TOOLS)/%: | $(TOOLS) + cd $(TOOLS_MOD_DIR) && \ + $(GO) build -o $@ $(PACKAGE) + +MULTIMOD = $(TOOLS)/multimod +$(TOOLS)/multimod: PACKAGE=go.opentelemetry.io/build-tools/multimod + +SEMCONVGEN = $(TOOLS)/semconvgen +$(TOOLS)/semconvgen: PACKAGE=go.opentelemetry.io/build-tools/semconvgen + +CROSSLINK = $(TOOLS)/crosslink +$(TOOLS)/crosslink: PACKAGE=go.opentelemetry.io/build-tools/crosslink + +SEMCONVKIT = $(TOOLS)/semconvkit +$(TOOLS)/semconvkit: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/semconvkit + +DBOTCONF = $(TOOLS)/dbotconf +$(TOOLS)/dbotconf: PACKAGE=go.opentelemetry.io/build-tools/dbotconf + +GOLANGCI_LINT = $(TOOLS)/golangci-lint +$(TOOLS)/golangci-lint: PACKAGE=github.com/golangci/golangci-lint/cmd/golangci-lint + +MISSPELL = $(TOOLS)/misspell +$(TOOLS)/misspell: PACKAGE=github.com/client9/misspell/cmd/misspell + +GOCOVMERGE = $(TOOLS)/gocovmerge +$(TOOLS)/gocovmerge: PACKAGE=github.com/wadey/gocovmerge + +STRINGER = $(TOOLS)/stringer +$(TOOLS)/stringer: PACKAGE=golang.org/x/tools/cmd/stringer + +PORTO = $(TOOLS)/porto +$(TOOLS)/porto: PACKAGE=github.com/jcchavezs/porto/cmd/porto + +GOJQ = $(TOOLS)/gojq +$(TOOLS)/gojq: PACKAGE=github.com/itchyny/gojq/cmd/gojq + +GOTMPL = $(TOOLS)/gotmpl +$(GOTMPL): PACKAGE=go.opentelemetry.io/build-tools/gotmpl + +GORELEASE = $(TOOLS)/gorelease +$(GORELEASE): PACKAGE=golang.org/x/exp/cmd/gorelease + +GOVULNCHECK = $(TOOLS)/govulncheck +$(TOOLS)/govulncheck: PACKAGE=golang.org/x/vuln/cmd/govulncheck + +.PHONY: tools +tools: $(CROSSLINK) $(DBOTCONF) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(GOJQ) $(SEMCONVGEN) $(MULTIMOD) $(SEMCONVKIT) $(GOTMPL) $(GORELEASE) + +# Virtualized python tools via docker + +# The directory where the virtual environment is created. +VENVDIR := venv + +# The directory where the python tools are installed. +PYTOOLS := $(VENVDIR)/bin + +# The pip executable in the virtual environment. +PIP := $(PYTOOLS)/pip + +# The directory in the docker image where the current directory is mounted. +WORKDIR := /workdir + +# The python image to use for the virtual environment. +PYTHONIMAGE := python:3.11.3-slim-bullseye + +# Run the python image with the current directory mounted. +DOCKERPY := docker run --rm -v "$(CURDIR):$(WORKDIR)" -w $(WORKDIR) $(PYTHONIMAGE) + +# Create a virtual environment for Python tools. +$(PYTOOLS): +# The `--upgrade` flag is needed to ensure that the virtual environment is +# created with the latest pip version. + @$(DOCKERPY) bash -c "python3 -m venv $(VENVDIR) && $(PIP) install --upgrade pip" + +# Install python packages into the virtual environment. +$(PYTOOLS)/%: | $(PYTOOLS) + @$(DOCKERPY) $(PIP) install -r requirements.txt + +CODESPELL = $(PYTOOLS)/codespell +$(CODESPELL): PACKAGE=codespell + +# Generate + +.PHONY: generate +generate: go-generate vanity-import-fix + +.PHONY: go-generate +go-generate: $(OTEL_GO_MOD_DIRS:%=go-generate/%) +go-generate/%: DIR=$* +go-generate/%: | $(STRINGER) $(GOTMPL) + @echo "$(GO) generate $(DIR)/..." \ + && cd $(DIR) \ + && PATH="$(TOOLS):$${PATH}" $(GO) generate ./... + +.PHONY: vanity-import-fix +vanity-import-fix: | $(PORTO) + @$(PORTO) --include-internal -w . + +# Generate go.work file for local development. +.PHONY: go-work +go-work: | $(CROSSLINK) + $(CROSSLINK) work --root=$(shell pwd) + +# Build + +.PHONY: build + +build: $(OTEL_GO_MOD_DIRS:%=build/%) $(OTEL_GO_MOD_DIRS:%=build-tests/%) +build/%: DIR=$* +build/%: + @echo "$(GO) build $(DIR)/..." \ + && cd $(DIR) \ + && $(GO) build ./... + +build-tests/%: DIR=$* +build-tests/%: + @echo "$(GO) build tests $(DIR)/..." \ + && cd $(DIR) \ + && $(GO) list ./... \ + | grep -v third_party \ + | xargs $(GO) test -vet=off -run xxxxxMatchNothingxxxxx >/dev/null + +# Tests + +TEST_TARGETS := test-default test-bench test-short test-verbose test-race +.PHONY: $(TEST_TARGETS) test +test-default test-race: ARGS=-race +test-bench: ARGS=-run=xxxxxMatchNothingxxxxx -test.benchtime=1ms -bench=. +test-short: ARGS=-short +test-verbose: ARGS=-v -race +$(TEST_TARGETS): test +test: $(OTEL_GO_MOD_DIRS:%=test/%) +test/%: DIR=$* +test/%: + @echo "$(GO) test -timeout $(TIMEOUT)s $(ARGS) $(DIR)/..." \ + && cd $(DIR) \ + && $(GO) list ./... \ + | grep -v third_party \ + | xargs $(GO) test -timeout $(TIMEOUT)s $(ARGS) + +COVERAGE_MODE = atomic +COVERAGE_PROFILE = coverage.out +.PHONY: test-coverage +test-coverage: | $(GOCOVMERGE) + @set -e; \ + printf "" > coverage.txt; \ + for dir in $(ALL_COVERAGE_MOD_DIRS); do \ + echo "$(GO) test -coverpkg=go.opentelemetry.io/otel/... -covermode=$(COVERAGE_MODE) -coverprofile="$(COVERAGE_PROFILE)" $${dir}/..."; \ + (cd "$${dir}" && \ + $(GO) list ./... \ + | grep -v third_party \ + | grep -v 'semconv/v.*' \ + | xargs $(GO) test -coverpkg=./... -covermode=$(COVERAGE_MODE) -coverprofile="$(COVERAGE_PROFILE)" && \ + $(GO) tool cover -html=coverage.out -o coverage.html); \ + done; \ + $(GOCOVMERGE) $$(find . -name coverage.out) > coverage.txt + +# Adding a directory will include all benchmarks in that directory if a filter is not specified. +BENCHMARK_TARGETS := sdk/trace +.PHONY: benchmark +benchmark: $(BENCHMARK_TARGETS:%=benchmark/%) +BENCHMARK_FILTER = . +# You can override the filter for a particular directory by adding a rule here. +benchmark/sdk/trace: BENCHMARK_FILTER = SpanWithAttributes_8/AlwaysSample +benchmark/%: + @echo "$(GO) test -timeout $(TIMEOUT)s -run=xxxxxMatchNothingxxxxx -bench=$(BENCHMARK_FILTER) $*..." \ + && cd $* \ + $(foreach filter, $(BENCHMARK_FILTER), && $(GO) test -timeout $(TIMEOUT)s -run=xxxxxMatchNothingxxxxx -bench=$(filter)) + +.PHONY: golangci-lint golangci-lint-fix +golangci-lint-fix: ARGS=--fix +golangci-lint-fix: golangci-lint +golangci-lint: $(OTEL_GO_MOD_DIRS:%=golangci-lint/%) +golangci-lint/%: DIR=$* +golangci-lint/%: | $(GOLANGCI_LINT) + @echo 'golangci-lint $(if $(ARGS),$(ARGS) ,)$(DIR)' \ + && cd $(DIR) \ + && $(GOLANGCI_LINT) run --allow-serial-runners $(ARGS) + +.PHONY: crosslink +crosslink: | $(CROSSLINK) + @echo "Updating intra-repository dependencies in all go modules" \ + && $(CROSSLINK) --root=$(shell pwd) --prune + +.PHONY: go-mod-tidy +go-mod-tidy: $(ALL_GO_MOD_DIRS:%=go-mod-tidy/%) +go-mod-tidy/%: DIR=$* +go-mod-tidy/%: | crosslink + @echo "$(GO) mod tidy in $(DIR)" \ + && cd $(DIR) \ + && $(GO) mod tidy -compat=1.20 + +.PHONY: lint-modules +lint-modules: go-mod-tidy + +.PHONY: lint +lint: misspell lint-modules golangci-lint govulncheck + +.PHONY: vanity-import-check +vanity-import-check: | $(PORTO) + @$(PORTO) --include-internal -l . || ( echo "(run: make vanity-import-fix)"; exit 1 ) + +.PHONY: misspell +misspell: | $(MISSPELL) + @$(MISSPELL) -w $(ALL_DOCS) + +.PHONY: govulncheck +govulncheck: $(OTEL_GO_MOD_DIRS:%=govulncheck/%) +govulncheck/%: DIR=$* +govulncheck/%: | $(GOVULNCHECK) + @echo "govulncheck ./... in $(DIR)" \ + && cd $(DIR) \ + && $(GOVULNCHECK) ./... + +.PHONY: codespell +codespell: | $(CODESPELL) + @$(DOCKERPY) $(CODESPELL) + +.PHONY: license-check +license-check: + @licRes=$$(for f in $$(find . -type f \( -iname '*.go' -o -iname '*.sh' \) ! -path '**/third_party/*' ! -path './.git/*' ) ; do \ + awk '/Copyright The OpenTelemetry Authors|generated|GENERATED/ && NR<=4 { found=1; next } END { if (!found) print FILENAME }' $$f; \ + done); \ + if [ -n "$${licRes}" ]; then \ + echo "license header checking failed:"; echo "$${licRes}"; \ + exit 1; \ + fi + +DEPENDABOT_CONFIG = .github/dependabot.yml +.PHONY: dependabot-check +dependabot-check: | $(DBOTCONF) + @$(DBOTCONF) verify $(DEPENDABOT_CONFIG) || ( echo "(run: make dependabot-generate)"; exit 1 ) + +.PHONY: dependabot-generate +dependabot-generate: | $(DBOTCONF) + @$(DBOTCONF) generate > $(DEPENDABOT_CONFIG) + +.PHONY: check-clean-work-tree +check-clean-work-tree: + @if ! git diff --quiet; then \ + echo; \ + echo 'Working tree is not clean, did you forget to run "make precommit"?'; \ + echo; \ + git status; \ + exit 1; \ + fi + +SEMCONVPKG ?= "semconv/" +.PHONY: semconv-generate +semconv-generate: | $(SEMCONVGEN) $(SEMCONVKIT) + [ "$(TAG)" ] || ( echo "TAG unset: missing opentelemetry semantic-conventions tag"; exit 1 ) + [ "$(OTEL_SEMCONV_REPO)" ] || ( echo "OTEL_SEMCONV_REPO unset: missing path to opentelemetry semantic-conventions repo"; exit 1 ) + $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=span -p conventionType=trace -f trace.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)" + $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=attribute_group -p conventionType=trace -f attribute_group.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)" + $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=event -p conventionType=event -f event.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)" + $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=resource -p conventionType=resource -f resource.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)" + $(SEMCONVKIT) -output "$(SEMCONVPKG)/$(TAG)" -tag "$(TAG)" + +.PHONY: gorelease +gorelease: $(OTEL_GO_MOD_DIRS:%=gorelease/%) +gorelease/%: DIR=$* +gorelease/%:| $(GORELEASE) + @echo "gorelease in $(DIR):" \ + && cd $(DIR) \ + && $(GORELEASE) \ + || echo "" + +.PHONY: prerelease +prerelease: | $(MULTIMOD) + @[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 ) + $(MULTIMOD) verify && $(MULTIMOD) prerelease -m ${MODSET} + +COMMIT ?= "HEAD" +.PHONY: add-tags +add-tags: | $(MULTIMOD) + @[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 ) + $(MULTIMOD) verify && $(MULTIMOD) tag -m ${MODSET} -c ${COMMIT} + +.PHONY: lint-markdown +lint-markdown: + docker run -v "$(CURDIR):$(WORKDIR)" avtodev/markdown-lint:v1 -c $(WORKDIR)/.markdownlint.yaml $(WORKDIR)/**/*.md diff --git a/vendor/go.opentelemetry.io/otel/README.md b/vendor/go.opentelemetry.io/otel/README.md new file mode 100644 index 000000000..7766259a5 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/README.md @@ -0,0 +1,112 @@ +# OpenTelemetry-Go + +[![CI](https://github.com/open-telemetry/opentelemetry-go/workflows/ci/badge.svg)](https://github.com/open-telemetry/opentelemetry-go/actions?query=workflow%3Aci+branch%3Amain) +[![codecov.io](https://codecov.io/gh/open-telemetry/opentelemetry-go/coverage.svg?branch=main)](https://app.codecov.io/gh/open-telemetry/opentelemetry-go?branch=main) +[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel)](https://pkg.go.dev/go.opentelemetry.io/otel) +[![Go Report Card](https://goreportcard.com/badge/go.opentelemetry.io/otel)](https://goreportcard.com/report/go.opentelemetry.io/otel) +[![Slack](https://img.shields.io/badge/slack-@cncf/otel--go-brightgreen.svg?logo=slack)](https://cloud-native.slack.com/archives/C01NPAXACKT) + +OpenTelemetry-Go is the [Go](https://golang.org/) implementation of [OpenTelemetry](https://opentelemetry.io/). +It provides a set of APIs to directly measure performance and behavior of your software and send this data to observability platforms. + +## Project Status + +| Signal | Status | +|---------|--------------------| +| Traces | Stable | +| Metrics | Stable | +| Logs | In development[^1] | + +Progress and status specific to this repository is tracked in our +[project boards](https://github.com/open-telemetry/opentelemetry-go/projects) +and +[milestones](https://github.com/open-telemetry/opentelemetry-go/milestones). + +Project versioning information and stability guarantees can be found in the +[versioning documentation](VERSIONING.md). + +[^1]: https://github.com/orgs/open-telemetry/projects/43 + +### Compatibility + +OpenTelemetry-Go ensures compatibility with the current supported versions of +the [Go language](https://golang.org/doc/devel/release#policy): + +> Each major Go release is supported until there are two newer major releases. +> For example, Go 1.5 was supported until the Go 1.7 release, and Go 1.6 was supported until the Go 1.8 release. + +For versions of Go that are no longer supported upstream, opentelemetry-go will +stop ensuring compatibility with these versions in the following manner: + +- A minor release of opentelemetry-go will be made to add support for the new + supported release of Go. +- The following minor release of opentelemetry-go will remove compatibility + testing for the oldest (now archived upstream) version of Go. This, and + future, releases of opentelemetry-go may include features only supported by + the currently supported versions of Go. + +Currently, this project supports the following environments. + +| OS | Go Version | Architecture | +|---------|------------|--------------| +| Ubuntu | 1.22 | amd64 | +| Ubuntu | 1.21 | amd64 | +| Ubuntu | 1.20 | amd64 | +| Ubuntu | 1.22 | 386 | +| Ubuntu | 1.21 | 386 | +| Ubuntu | 1.20 | 386 | +| MacOS | 1.22 | amd64 | +| MacOS | 1.21 | amd64 | +| MacOS | 1.20 | amd64 | +| Windows | 1.22 | amd64 | +| Windows | 1.21 | amd64 | +| Windows | 1.20 | amd64 | +| Windows | 1.22 | 386 | +| Windows | 1.21 | 386 | +| Windows | 1.20 | 386 | + +While this project should work for other systems, no compatibility guarantees +are made for those systems currently. + +## Getting Started + +You can find a getting started guide on [opentelemetry.io](https://opentelemetry.io/docs/languages/go/getting-started/). + +OpenTelemetry's goal is to provide a single set of APIs to capture distributed +traces and metrics from your application and send them to an observability +platform. This project allows you to do just that for applications written in +Go. There are two steps to this process: instrument your application, and +configure an exporter. + +### Instrumentation + +To start capturing distributed traces and metric events from your application +it first needs to be instrumented. The easiest way to do this is by using an +instrumentation library for your code. Be sure to check out [the officially +supported instrumentation +libraries](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation). + +If you need to extend the telemetry an instrumentation library provides or want +to build your own instrumentation for your application directly you will need +to use the +[Go otel](https://pkg.go.dev/go.opentelemetry.io/otel) +package. The included [examples](./example/) are a good way to see some +practical uses of this process. + +### Export + +Now that your application is instrumented to collect telemetry, it needs an +export pipeline to send that telemetry to an observability platform. + +All officially supported exporters for the OpenTelemetry project are contained in the [exporters directory](./exporters). + +| Exporter | Metrics | Traces | +|---------------------------------------|:-------:|:------:| +| [OTLP](./exporters/otlp/) | ✓ | ✓ | +| [Prometheus](./exporters/prometheus/) | ✓ | | +| [stdout](./exporters/stdout/) | ✓ | ✓ | +| [Zipkin](./exporters/zipkin/) | | ✓ | + +## Contributing + +See the [contributing documentation](CONTRIBUTING.md). diff --git a/vendor/go.opentelemetry.io/otel/RELEASING.md b/vendor/go.opentelemetry.io/otel/RELEASING.md new file mode 100644 index 000000000..d2691d0bd --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/RELEASING.md @@ -0,0 +1,139 @@ +# Release Process + +## Semantic Convention Generation + +New versions of the [OpenTelemetry Semantic Conventions] mean new versions of the `semconv` package need to be generated. +The `semconv-generate` make target is used for this. + +1. Checkout a local copy of the [OpenTelemetry Semantic Conventions] to the desired release tag. +2. Pull the latest `otel/semconvgen` image: `docker pull otel/semconvgen:latest` +3. Run the `make semconv-generate ...` target from this repository. + +For example, + +```sh +export TAG="v1.21.0" # Change to the release version you are generating. +export OTEL_SEMCONV_REPO="/absolute/path/to/opentelemetry/semantic-conventions" +docker pull otel/semconvgen:latest +make semconv-generate # Uses the exported TAG and OTEL_SEMCONV_REPO. +``` + +This should create a new sub-package of [`semconv`](./semconv). +Ensure things look correct before submitting a pull request to include the addition. + +## Breaking changes validation + +You can run `make gorelease` that runs [gorelease](https://pkg.go.dev/golang.org/x/exp/cmd/gorelease) to ensure that there are no unwanted changes done in the public API. + +You can check/report problems with `gorelease` [here](https://golang.org/issues/26420). + +## Pre-Release + +First, decide which module sets will be released and update their versions +in `versions.yaml`. Commit this change to a new branch. + +Update go.mod for submodules to depend on the new release which will happen in the next step. + +1. Run the `prerelease` make target. It creates a branch + `prerelease__` that will contain all release changes. + + ``` + make prerelease MODSET= + ``` + +2. Verify the changes. + + ``` + git diff ...prerelease__ + ``` + + This should have changed the version for all modules to be ``. + If these changes look correct, merge them into your pre-release branch: + + ```go + git merge prerelease__ + ``` + +3. Update the [Changelog](./CHANGELOG.md). + - Make sure all relevant changes for this release are included and are in language that non-contributors to the project can understand. + To verify this, you can look directly at the commits since the ``. + + ``` + git --no-pager log --pretty=oneline "..HEAD" + ``` + + - Move all the `Unreleased` changes into a new section following the title scheme (`[] - `). + - Update all the appropriate links at the bottom. + +4. Push the changes to upstream and create a Pull Request on GitHub. + Be sure to include the curated changes from the [Changelog](./CHANGELOG.md) in the description. + +## Tag + +Once the Pull Request with all the version changes has been approved and merged it is time to tag the merged commit. + +***IMPORTANT***: It is critical you use the same tag that you used in the Pre-Release step! +Failure to do so will leave things in a broken state. As long as you do not +change `versions.yaml` between pre-release and this step, things should be fine. + +***IMPORTANT***: [There is currently no way to remove an incorrectly tagged version of a Go module](https://github.com/golang/go/issues/34189). +It is critical you make sure the version you push upstream is correct. +[Failure to do so will lead to minor emergencies and tough to work around](https://github.com/open-telemetry/opentelemetry-go/issues/331). + +1. For each module set that will be released, run the `add-tags` make target + using the `` of the commit on the main branch for the merged Pull Request. + + ``` + make add-tags MODSET= COMMIT= + ``` + + It should only be necessary to provide an explicit `COMMIT` value if the + current `HEAD` of your working directory is not the correct commit. + +2. Push tags to the upstream remote (not your fork: `github.com/open-telemetry/opentelemetry-go.git`). + Make sure you push all sub-modules as well. + + ``` + git push upstream + git push upstream + ... + ``` + +## Release + +Finally create a Release for the new `` on GitHub. +The release body should include all the release notes from the Changelog for this release. + +## Verify Examples + +After releasing verify that examples build outside of the repository. + +``` +./verify_examples.sh +``` + +The script copies examples into a different directory removes any `replace` declarations in `go.mod` and builds them. +This ensures they build with the published release, not the local copy. + +## Post-Release + +### Contrib Repository + +Once verified be sure to [make a release for the `contrib` repository](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/RELEASING.md) that uses this release. + +### Website Documentation + +Update the [Go instrumentation documentation] in the OpenTelemetry website under [content/en/docs/languages/go]. +Importantly, bump any package versions referenced to be the latest one you just released and ensure all code examples still compile and are accurate. + +[OpenTelemetry Semantic Conventions]: https://github.com/open-telemetry/semantic-conventions +[Go instrumentation documentation]: https://opentelemetry.io/docs/languages/go/ +[content/en/docs/languages/go]: https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/languages/go + +### Demo Repository + +Bump the dependencies in the following Go services: + +- [`accountingservice`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/accountingservice) +- [`checkoutservice`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/checkoutservice) +- [`productcatalogservice`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/productcatalogservice) diff --git a/vendor/go.opentelemetry.io/otel/VERSIONING.md b/vendor/go.opentelemetry.io/otel/VERSIONING.md new file mode 100644 index 000000000..412f1e362 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/VERSIONING.md @@ -0,0 +1,224 @@ +# Versioning + +This document describes the versioning policy for this repository. This policy +is designed so the following goals can be achieved. + +**Users are provided a codebase of value that is stable and secure.** + +## Policy + +* Versioning of this project will be idiomatic of a Go project using [Go + modules](https://github.com/golang/go/wiki/Modules). + * [Semantic import + versioning](https://github.com/golang/go/wiki/Modules#semantic-import-versioning) + will be used. + * Versions will comply with [semver + 2.0](https://semver.org/spec/v2.0.0.html) with the following exceptions. + * New methods may be added to exported API interfaces. All exported + interfaces that fall within this exception will include the following + paragraph in their public documentation. + + > Warning: methods may be added to this interface in minor releases. + + * If a module is version `v2` or higher, the major version of the module + must be included as a `/vN` at the end of the module paths used in + `go.mod` files (e.g., `module go.opentelemetry.io/otel/v2`, `require + go.opentelemetry.io/otel/v2 v2.0.1`) and in the package import path + (e.g., `import "go.opentelemetry.io/otel/v2/trace"`). This includes the + paths used in `go get` commands (e.g., `go get + go.opentelemetry.io/otel/v2@v2.0.1`. Note there is both a `/v2` and a + `@v2.0.1` in that example. One way to think about it is that the module + name now includes the `/v2`, so include `/v2` whenever you are using the + module name). + * If a module is version `v0` or `v1`, do not include the major version in + either the module path or the import path. + * Modules will be used to encapsulate signals and components. + * Experimental modules still under active development will be versioned at + `v0` to imply the stability guarantee defined by + [semver](https://semver.org/spec/v2.0.0.html#spec-item-4). + + > Major version zero (0.y.z) is for initial development. Anything MAY + > change at any time. The public API SHOULD NOT be considered stable. + + * Mature modules for which we guarantee a stable public API will be versioned + with a major version greater than `v0`. + * The decision to make a module stable will be made on a case-by-case + basis by the maintainers of this project. + * Experimental modules will start their versioning at `v0.0.0` and will + increment their minor version when backwards incompatible changes are + released and increment their patch version when backwards compatible + changes are released. + * All stable modules that use the same major version number will use the + same entire version number. + * Stable modules may be released with an incremented minor or patch + version even though that module has not been changed, but rather so + that it will remain at the same version as other stable modules that + did undergo change. + * When an experimental module becomes stable a new stable module version + will be released and will include this now stable module. The new + stable module version will be an increment of the minor version number + and will be applied to all existing stable modules as well as the newly + stable module being released. +* Versioning of the associated [contrib + repository](https://github.com/open-telemetry/opentelemetry-go-contrib) of + this project will be idiomatic of a Go project using [Go + modules](https://github.com/golang/go/wiki/Modules). + * [Semantic import + versioning](https://github.com/golang/go/wiki/Modules#semantic-import-versioning) + will be used. + * Versions will comply with [semver 2.0](https://semver.org/spec/v2.0.0.html). + * If a module is version `v2` or higher, the + major version of the module must be included as a `/vN` at the end of the + module paths used in `go.mod` files (e.g., `module + go.opentelemetry.io/contrib/instrumentation/host/v2`, `require + go.opentelemetry.io/contrib/instrumentation/host/v2 v2.0.1`) and in the + package import path (e.g., `import + "go.opentelemetry.io/contrib/instrumentation/host/v2"`). This includes + the paths used in `go get` commands (e.g., `go get + go.opentelemetry.io/contrib/instrumentation/host/v2@v2.0.1`. Note there + is both a `/v2` and a `@v2.0.1` in that example. One way to think about + it is that the module name now includes the `/v2`, so include `/v2` + whenever you are using the module name). + * If a module is version `v0` or `v1`, do not include the major version + in either the module path or the import path. + * In addition to public APIs, telemetry produced by stable instrumentation + will remain stable and backwards compatible. This is to avoid breaking + alerts and dashboard. + * Modules will be used to encapsulate instrumentation, detectors, exporters, + propagators, and any other independent sets of related components. + * Experimental modules still under active development will be versioned at + `v0` to imply the stability guarantee defined by + [semver](https://semver.org/spec/v2.0.0.html#spec-item-4). + + > Major version zero (0.y.z) is for initial development. Anything MAY + > change at any time. The public API SHOULD NOT be considered stable. + + * Mature modules for which we guarantee a stable public API and telemetry will + be versioned with a major version greater than `v0`. + * Experimental modules will start their versioning at `v0.0.0` and will + increment their minor version when backwards incompatible changes are + released and increment their patch version when backwards compatible + changes are released. + * Stable contrib modules cannot depend on experimental modules from this + project. + * All stable contrib modules of the same major version with this project + will use the same entire version as this project. + * Stable modules may be released with an incremented minor or patch + version even though that module's code has not been changed. Instead + the only change that will have been included is to have updated that + modules dependency on this project's stable APIs. + * When an experimental module in contrib becomes stable a new stable + module version will be released and will include this now stable + module. The new stable module version will be an increment of the minor + version number and will be applied to all existing stable contrib + modules, this project's modules, and the newly stable module being + released. + * Contrib modules will be kept up to date with this project's releases. + * Due to the dependency contrib modules will implicitly have on this + project's modules the release of stable contrib modules to match the + released version number will be staggered after this project's release. + There is no explicit time guarantee for how long after this projects + release the contrib release will be. Effort should be made to keep them + as close in time as possible. + * No additional stable release in this project can be made until the + contrib repository has a matching stable release. + * No release can be made in the contrib repository after this project's + stable release except for a stable release of the contrib repository. +* GitHub releases will be made for all releases. +* Go modules will be made available at Go package mirrors. + +## Example Versioning Lifecycle + +To better understand the implementation of the above policy the following +example is provided. This project is simplified to include only the following +modules and their versions: + +* `otel`: `v0.14.0` +* `otel/trace`: `v0.14.0` +* `otel/metric`: `v0.14.0` +* `otel/baggage`: `v0.14.0` +* `otel/sdk/trace`: `v0.14.0` +* `otel/sdk/metric`: `v0.14.0` + +These modules have been developed to a point where the `otel/trace`, +`otel/baggage`, and `otel/sdk/trace` modules have reached a point that they +should be considered for a stable release. The `otel/metric` and +`otel/sdk/metric` are still under active development and the `otel` module +depends on both `otel/trace` and `otel/metric`. + +The `otel` package is refactored to remove its dependencies on `otel/metric` so +it can be released as stable as well. With that done the following release +candidates are made: + +* `otel`: `v1.0.0-RC1` +* `otel/trace`: `v1.0.0-RC1` +* `otel/baggage`: `v1.0.0-RC1` +* `otel/sdk/trace`: `v1.0.0-RC1` + +The `otel/metric` and `otel/sdk/metric` modules remain at `v0.14.0`. + +A few minor issues are discovered in the `otel/trace` package. These issues are +resolved with some minor, but backwards incompatible, changes and are released +as a second release candidate: + +* `otel`: `v1.0.0-RC2` +* `otel/trace`: `v1.0.0-RC2` +* `otel/baggage`: `v1.0.0-RC2` +* `otel/sdk/trace`: `v1.0.0-RC2` + +Notice that all module version numbers are incremented to adhere to our +versioning policy. + +After these release candidates have been evaluated to satisfaction, they are +released as version `v1.0.0`. + +* `otel`: `v1.0.0` +* `otel/trace`: `v1.0.0` +* `otel/baggage`: `v1.0.0` +* `otel/sdk/trace`: `v1.0.0` + +Since both the `go` utility and the Go module system support [the semantic +versioning definition of +precedence](https://semver.org/spec/v2.0.0.html#spec-item-11), this release +will correctly be interpreted as the successor to the previous release +candidates. + +Active development of this project continues. The `otel/metric` module now has +backwards incompatible changes to its API that need to be released and the +`otel/baggage` module has a minor bug fix that needs to be released. The +following release is made: + +* `otel`: `v1.0.1` +* `otel/trace`: `v1.0.1` +* `otel/metric`: `v0.15.0` +* `otel/baggage`: `v1.0.1` +* `otel/sdk/trace`: `v1.0.1` +* `otel/sdk/metric`: `v0.15.0` + +Notice that, again, all stable module versions are incremented in unison and +the `otel/sdk/metric` package, which depends on the `otel/metric` package, also +bumped its version. This bump of the `otel/sdk/metric` package makes sense +given their coupling, though it is not explicitly required by our versioning +policy. + +As we progress, the `otel/metric` and `otel/sdk/metric` packages have reached a +point where they should be evaluated for stability. The `otel` module is +reintegrated with the `otel/metric` package and the following release is made: + +* `otel`: `v1.1.0-RC1` +* `otel/trace`: `v1.1.0-RC1` +* `otel/metric`: `v1.1.0-RC1` +* `otel/baggage`: `v1.1.0-RC1` +* `otel/sdk/trace`: `v1.1.0-RC1` +* `otel/sdk/metric`: `v1.1.0-RC1` + +All the modules are evaluated and determined to a viable stable release. They +are then released as version `v1.1.0` (the minor version is incremented to +indicate the addition of new signal). + +* `otel`: `v1.1.0` +* `otel/trace`: `v1.1.0` +* `otel/metric`: `v1.1.0` +* `otel/baggage`: `v1.1.0` +* `otel/sdk/trace`: `v1.1.0` +* `otel/sdk/metric`: `v1.1.0` diff --git a/vendor/go.opentelemetry.io/otel/attribute/doc.go b/vendor/go.opentelemetry.io/otel/attribute/doc.go new file mode 100644 index 000000000..dafe7424d --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/doc.go @@ -0,0 +1,16 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package attribute provides key and value attributes. +package attribute // import "go.opentelemetry.io/otel/attribute" diff --git a/vendor/go.opentelemetry.io/otel/attribute/encoder.go b/vendor/go.opentelemetry.io/otel/attribute/encoder.go new file mode 100644 index 000000000..fe2bc5766 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/encoder.go @@ -0,0 +1,146 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +import ( + "bytes" + "sync" + "sync/atomic" +) + +type ( + // Encoder is a mechanism for serializing an attribute set into a specific + // string representation that supports caching, to avoid repeated + // serialization. An example could be an exporter encoding the attribute + // set into a wire representation. + Encoder interface { + // Encode returns the serialized encoding of the attribute set using + // its Iterator. This result may be cached by a attribute.Set. + Encode(iterator Iterator) string + + // ID returns a value that is unique for each class of attribute + // encoder. Attribute encoders allocate these using `NewEncoderID`. + ID() EncoderID + } + + // EncoderID is used to identify distinct Encoder + // implementations, for caching encoded results. + EncoderID struct { + value uint64 + } + + // defaultAttrEncoder uses a sync.Pool of buffers to reduce the number of + // allocations used in encoding attributes. This implementation encodes a + // comma-separated list of key=value, with '/'-escaping of '=', ',', and + // '\'. + defaultAttrEncoder struct { + // pool is a pool of attribute set builders. The buffers in this pool + // grow to a size that most attribute encodings will not allocate new + // memory. + pool sync.Pool // *bytes.Buffer + } +) + +// escapeChar is used to ensure uniqueness of the attribute encoding where +// keys or values contain either '=' or ','. Since there is no parser needed +// for this encoding and its only requirement is to be unique, this choice is +// arbitrary. Users will see these in some exporters (e.g., stdout), so the +// backslash ('\') is used as a conventional choice. +const escapeChar = '\\' + +var ( + _ Encoder = &defaultAttrEncoder{} + + // encoderIDCounter is for generating IDs for other attribute encoders. + encoderIDCounter uint64 + + defaultEncoderOnce sync.Once + defaultEncoderID = NewEncoderID() + defaultEncoderInstance *defaultAttrEncoder +) + +// NewEncoderID returns a unique attribute encoder ID. It should be called +// once per each type of attribute encoder. Preferably in init() or in var +// definition. +func NewEncoderID() EncoderID { + return EncoderID{value: atomic.AddUint64(&encoderIDCounter, 1)} +} + +// DefaultEncoder returns an attribute encoder that encodes attributes in such +// a way that each escaped attribute's key is followed by an equal sign and +// then by an escaped attribute's value. All key-value pairs are separated by +// a comma. +// +// Escaping is done by prepending a backslash before either a backslash, equal +// sign or a comma. +func DefaultEncoder() Encoder { + defaultEncoderOnce.Do(func() { + defaultEncoderInstance = &defaultAttrEncoder{ + pool: sync.Pool{ + New: func() interface{} { + return &bytes.Buffer{} + }, + }, + } + }) + return defaultEncoderInstance +} + +// Encode is a part of an implementation of the AttributeEncoder interface. +func (d *defaultAttrEncoder) Encode(iter Iterator) string { + buf := d.pool.Get().(*bytes.Buffer) + defer d.pool.Put(buf) + buf.Reset() + + for iter.Next() { + i, keyValue := iter.IndexedAttribute() + if i > 0 { + _, _ = buf.WriteRune(',') + } + copyAndEscape(buf, string(keyValue.Key)) + + _, _ = buf.WriteRune('=') + + if keyValue.Value.Type() == STRING { + copyAndEscape(buf, keyValue.Value.AsString()) + } else { + _, _ = buf.WriteString(keyValue.Value.Emit()) + } + } + return buf.String() +} + +// ID is a part of an implementation of the AttributeEncoder interface. +func (*defaultAttrEncoder) ID() EncoderID { + return defaultEncoderID +} + +// copyAndEscape escapes `=`, `,` and its own escape character (`\`), +// making the default encoding unique. +func copyAndEscape(buf *bytes.Buffer, val string) { + for _, ch := range val { + switch ch { + case '=', ',', escapeChar: + _, _ = buf.WriteRune(escapeChar) + } + _, _ = buf.WriteRune(ch) + } +} + +// Valid returns true if this encoder ID was allocated by +// `NewEncoderID`. Invalid encoder IDs will not be cached. +func (id EncoderID) Valid() bool { + return id.value != 0 +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/filter.go b/vendor/go.opentelemetry.io/otel/attribute/filter.go new file mode 100644 index 000000000..638c213d5 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/filter.go @@ -0,0 +1,60 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +// Filter supports removing certain attributes from attribute sets. When +// the filter returns true, the attribute will be kept in the filtered +// attribute set. When the filter returns false, the attribute is excluded +// from the filtered attribute set, and the attribute instead appears in +// the removed list of excluded attributes. +type Filter func(KeyValue) bool + +// NewAllowKeysFilter returns a Filter that only allows attributes with one of +// the provided keys. +// +// If keys is empty a deny-all filter is returned. +func NewAllowKeysFilter(keys ...Key) Filter { + if len(keys) <= 0 { + return func(kv KeyValue) bool { return false } + } + + allowed := make(map[Key]struct{}) + for _, k := range keys { + allowed[k] = struct{}{} + } + return func(kv KeyValue) bool { + _, ok := allowed[kv.Key] + return ok + } +} + +// NewDenyKeysFilter returns a Filter that only allows attributes +// that do not have one of the provided keys. +// +// If keys is empty an allow-all filter is returned. +func NewDenyKeysFilter(keys ...Key) Filter { + if len(keys) <= 0 { + return func(kv KeyValue) bool { return true } + } + + forbid := make(map[Key]struct{}) + for _, k := range keys { + forbid[k] = struct{}{} + } + return func(kv KeyValue) bool { + _, ok := forbid[kv.Key] + return !ok + } +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/iterator.go b/vendor/go.opentelemetry.io/otel/attribute/iterator.go new file mode 100644 index 000000000..841b271fb --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/iterator.go @@ -0,0 +1,161 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +// Iterator allows iterating over the set of attributes in order, sorted by +// key. +type Iterator struct { + storage *Set + idx int +} + +// MergeIterator supports iterating over two sets of attributes while +// eliminating duplicate values from the combined set. The first iterator +// value takes precedence. +type MergeIterator struct { + one oneIterator + two oneIterator + current KeyValue +} + +type oneIterator struct { + iter Iterator + done bool + attr KeyValue +} + +// Next moves the iterator to the next position. Returns false if there are no +// more attributes. +func (i *Iterator) Next() bool { + i.idx++ + return i.idx < i.Len() +} + +// Label returns current KeyValue. Must be called only after Next returns +// true. +// +// Deprecated: Use Attribute instead. +func (i *Iterator) Label() KeyValue { + return i.Attribute() +} + +// Attribute returns the current KeyValue of the Iterator. It must be called +// only after Next returns true. +func (i *Iterator) Attribute() KeyValue { + kv, _ := i.storage.Get(i.idx) + return kv +} + +// IndexedLabel returns current index and attribute. Must be called only +// after Next returns true. +// +// Deprecated: Use IndexedAttribute instead. +func (i *Iterator) IndexedLabel() (int, KeyValue) { + return i.idx, i.Attribute() +} + +// IndexedAttribute returns current index and attribute. Must be called only +// after Next returns true. +func (i *Iterator) IndexedAttribute() (int, KeyValue) { + return i.idx, i.Attribute() +} + +// Len returns a number of attributes in the iterated set. +func (i *Iterator) Len() int { + return i.storage.Len() +} + +// ToSlice is a convenience function that creates a slice of attributes from +// the passed iterator. The iterator is set up to start from the beginning +// before creating the slice. +func (i *Iterator) ToSlice() []KeyValue { + l := i.Len() + if l == 0 { + return nil + } + i.idx = -1 + slice := make([]KeyValue, 0, l) + for i.Next() { + slice = append(slice, i.Attribute()) + } + return slice +} + +// NewMergeIterator returns a MergeIterator for merging two attribute sets. +// Duplicates are resolved by taking the value from the first set. +func NewMergeIterator(s1, s2 *Set) MergeIterator { + mi := MergeIterator{ + one: makeOne(s1.Iter()), + two: makeOne(s2.Iter()), + } + return mi +} + +func makeOne(iter Iterator) oneIterator { + oi := oneIterator{ + iter: iter, + } + oi.advance() + return oi +} + +func (oi *oneIterator) advance() { + if oi.done = !oi.iter.Next(); !oi.done { + oi.attr = oi.iter.Attribute() + } +} + +// Next returns true if there is another attribute available. +func (m *MergeIterator) Next() bool { + if m.one.done && m.two.done { + return false + } + if m.one.done { + m.current = m.two.attr + m.two.advance() + return true + } + if m.two.done { + m.current = m.one.attr + m.one.advance() + return true + } + if m.one.attr.Key == m.two.attr.Key { + m.current = m.one.attr // first iterator attribute value wins + m.one.advance() + m.two.advance() + return true + } + if m.one.attr.Key < m.two.attr.Key { + m.current = m.one.attr + m.one.advance() + return true + } + m.current = m.two.attr + m.two.advance() + return true +} + +// Label returns the current value after Next() returns true. +// +// Deprecated: Use Attribute instead. +func (m *MergeIterator) Label() KeyValue { + return m.current +} + +// Attribute returns the current value after Next() returns true. +func (m *MergeIterator) Attribute() KeyValue { + return m.current +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/key.go b/vendor/go.opentelemetry.io/otel/attribute/key.go new file mode 100644 index 000000000..0656a04e4 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/key.go @@ -0,0 +1,134 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +// Key represents the key part in key-value pairs. It's a string. The +// allowed character set in the key depends on the use of the key. +type Key string + +// Bool creates a KeyValue instance with a BOOL Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Bool(name, value). +func (k Key) Bool(v bool) KeyValue { + return KeyValue{ + Key: k, + Value: BoolValue(v), + } +} + +// BoolSlice creates a KeyValue instance with a BOOLSLICE Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- BoolSlice(name, value). +func (k Key) BoolSlice(v []bool) KeyValue { + return KeyValue{ + Key: k, + Value: BoolSliceValue(v), + } +} + +// Int creates a KeyValue instance with an INT64 Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Int(name, value). +func (k Key) Int(v int) KeyValue { + return KeyValue{ + Key: k, + Value: IntValue(v), + } +} + +// IntSlice creates a KeyValue instance with an INT64SLICE Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- IntSlice(name, value). +func (k Key) IntSlice(v []int) KeyValue { + return KeyValue{ + Key: k, + Value: IntSliceValue(v), + } +} + +// Int64 creates a KeyValue instance with an INT64 Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Int64(name, value). +func (k Key) Int64(v int64) KeyValue { + return KeyValue{ + Key: k, + Value: Int64Value(v), + } +} + +// Int64Slice creates a KeyValue instance with an INT64SLICE Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Int64Slice(name, value). +func (k Key) Int64Slice(v []int64) KeyValue { + return KeyValue{ + Key: k, + Value: Int64SliceValue(v), + } +} + +// Float64 creates a KeyValue instance with a FLOAT64 Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Float64(name, value). +func (k Key) Float64(v float64) KeyValue { + return KeyValue{ + Key: k, + Value: Float64Value(v), + } +} + +// Float64Slice creates a KeyValue instance with a FLOAT64SLICE Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Float64(name, value). +func (k Key) Float64Slice(v []float64) KeyValue { + return KeyValue{ + Key: k, + Value: Float64SliceValue(v), + } +} + +// String creates a KeyValue instance with a STRING Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- String(name, value). +func (k Key) String(v string) KeyValue { + return KeyValue{ + Key: k, + Value: StringValue(v), + } +} + +// StringSlice creates a KeyValue instance with a STRINGSLICE Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- StringSlice(name, value). +func (k Key) StringSlice(v []string) KeyValue { + return KeyValue{ + Key: k, + Value: StringSliceValue(v), + } +} + +// Defined returns true for non-empty keys. +func (k Key) Defined() bool { + return len(k) != 0 +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/kv.go b/vendor/go.opentelemetry.io/otel/attribute/kv.go new file mode 100644 index 000000000..1ddf3ce05 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/kv.go @@ -0,0 +1,86 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +import ( + "fmt" +) + +// KeyValue holds a key and value pair. +type KeyValue struct { + Key Key + Value Value +} + +// Valid returns if kv is a valid OpenTelemetry attribute. +func (kv KeyValue) Valid() bool { + return kv.Key.Defined() && kv.Value.Type() != INVALID +} + +// Bool creates a KeyValue with a BOOL Value type. +func Bool(k string, v bool) KeyValue { + return Key(k).Bool(v) +} + +// BoolSlice creates a KeyValue with a BOOLSLICE Value type. +func BoolSlice(k string, v []bool) KeyValue { + return Key(k).BoolSlice(v) +} + +// Int creates a KeyValue with an INT64 Value type. +func Int(k string, v int) KeyValue { + return Key(k).Int(v) +} + +// IntSlice creates a KeyValue with an INT64SLICE Value type. +func IntSlice(k string, v []int) KeyValue { + return Key(k).IntSlice(v) +} + +// Int64 creates a KeyValue with an INT64 Value type. +func Int64(k string, v int64) KeyValue { + return Key(k).Int64(v) +} + +// Int64Slice creates a KeyValue with an INT64SLICE Value type. +func Int64Slice(k string, v []int64) KeyValue { + return Key(k).Int64Slice(v) +} + +// Float64 creates a KeyValue with a FLOAT64 Value type. +func Float64(k string, v float64) KeyValue { + return Key(k).Float64(v) +} + +// Float64Slice creates a KeyValue with a FLOAT64SLICE Value type. +func Float64Slice(k string, v []float64) KeyValue { + return Key(k).Float64Slice(v) +} + +// String creates a KeyValue with a STRING Value type. +func String(k, v string) KeyValue { + return Key(k).String(v) +} + +// StringSlice creates a KeyValue with a STRINGSLICE Value type. +func StringSlice(k string, v []string) KeyValue { + return Key(k).StringSlice(v) +} + +// Stringer creates a new key-value pair with a passed name and a string +// value generated by the passed Stringer interface. +func Stringer(k string, v fmt.Stringer) KeyValue { + return Key(k).String(v.String()) +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/set.go b/vendor/go.opentelemetry.io/otel/attribute/set.go new file mode 100644 index 000000000..fb6da5145 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/set.go @@ -0,0 +1,452 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +import ( + "encoding/json" + "reflect" + "sort" + "sync" +) + +type ( + // Set is the representation for a distinct attribute set. It manages an + // immutable set of attributes, with an internal cache for storing + // attribute encodings. + // + // This type supports the Equivalent method of comparison using values of + // type Distinct. + Set struct { + equivalent Distinct + } + + // Distinct wraps a variable-size array of KeyValue, constructed with keys + // in sorted order. This can be used as a map key or for equality checking + // between Sets. + Distinct struct { + iface interface{} + } + + // Sortable implements sort.Interface, used for sorting KeyValue. This is + // an exported type to support a memory optimization. A pointer to one of + // these is needed for the call to sort.Stable(), which the caller may + // provide in order to avoid an allocation. See NewSetWithSortable(). + Sortable []KeyValue +) + +var ( + // keyValueType is used in computeDistinctReflect. + keyValueType = reflect.TypeOf(KeyValue{}) + + // emptySet is returned for empty attribute sets. + emptySet = &Set{ + equivalent: Distinct{ + iface: [0]KeyValue{}, + }, + } + + // sortables is a pool of Sortables used to create Sets with a user does + // not provide one. + sortables = sync.Pool{ + New: func() interface{} { return new(Sortable) }, + } +) + +// EmptySet returns a reference to a Set with no elements. +// +// This is a convenience provided for optimized calling utility. +func EmptySet() *Set { + return emptySet +} + +// reflectValue abbreviates reflect.ValueOf(d). +func (d Distinct) reflectValue() reflect.Value { + return reflect.ValueOf(d.iface) +} + +// Valid returns true if this value refers to a valid Set. +func (d Distinct) Valid() bool { + return d.iface != nil +} + +// Len returns the number of attributes in this set. +func (l *Set) Len() int { + if l == nil || !l.equivalent.Valid() { + return 0 + } + return l.equivalent.reflectValue().Len() +} + +// Get returns the KeyValue at ordered position idx in this set. +func (l *Set) Get(idx int) (KeyValue, bool) { + if l == nil || !l.equivalent.Valid() { + return KeyValue{}, false + } + value := l.equivalent.reflectValue() + + if idx >= 0 && idx < value.Len() { + // Note: The Go compiler successfully avoids an allocation for + // the interface{} conversion here: + return value.Index(idx).Interface().(KeyValue), true + } + + return KeyValue{}, false +} + +// Value returns the value of a specified key in this set. +func (l *Set) Value(k Key) (Value, bool) { + if l == nil || !l.equivalent.Valid() { + return Value{}, false + } + rValue := l.equivalent.reflectValue() + vlen := rValue.Len() + + idx := sort.Search(vlen, func(idx int) bool { + return rValue.Index(idx).Interface().(KeyValue).Key >= k + }) + if idx >= vlen { + return Value{}, false + } + keyValue := rValue.Index(idx).Interface().(KeyValue) + if k == keyValue.Key { + return keyValue.Value, true + } + return Value{}, false +} + +// HasValue tests whether a key is defined in this set. +func (l *Set) HasValue(k Key) bool { + if l == nil { + return false + } + _, ok := l.Value(k) + return ok +} + +// Iter returns an iterator for visiting the attributes in this set. +func (l *Set) Iter() Iterator { + return Iterator{ + storage: l, + idx: -1, + } +} + +// ToSlice returns the set of attributes belonging to this set, sorted, where +// keys appear no more than once. +func (l *Set) ToSlice() []KeyValue { + iter := l.Iter() + return iter.ToSlice() +} + +// Equivalent returns a value that may be used as a map key. The Distinct type +// guarantees that the result will equal the equivalent. Distinct value of any +// attribute set with the same elements as this, where sets are made unique by +// choosing the last value in the input for any given key. +func (l *Set) Equivalent() Distinct { + if l == nil || !l.equivalent.Valid() { + return emptySet.equivalent + } + return l.equivalent +} + +// Equals returns true if the argument set is equivalent to this set. +func (l *Set) Equals(o *Set) bool { + return l.Equivalent() == o.Equivalent() +} + +// Encoded returns the encoded form of this set, according to encoder. +func (l *Set) Encoded(encoder Encoder) string { + if l == nil || encoder == nil { + return "" + } + + return encoder.Encode(l.Iter()) +} + +func empty() Set { + return Set{ + equivalent: emptySet.equivalent, + } +} + +// NewSet returns a new Set. See the documentation for +// NewSetWithSortableFiltered for more details. +// +// Except for empty sets, this method adds an additional allocation compared +// with calls that include a Sortable. +func NewSet(kvs ...KeyValue) Set { + // Check for empty set. + if len(kvs) == 0 { + return empty() + } + srt := sortables.Get().(*Sortable) + s, _ := NewSetWithSortableFiltered(kvs, srt, nil) + sortables.Put(srt) + return s +} + +// NewSetWithSortable returns a new Set. See the documentation for +// NewSetWithSortableFiltered for more details. +// +// This call includes a Sortable option as a memory optimization. +func NewSetWithSortable(kvs []KeyValue, tmp *Sortable) Set { + // Check for empty set. + if len(kvs) == 0 { + return empty() + } + s, _ := NewSetWithSortableFiltered(kvs, tmp, nil) + return s +} + +// NewSetWithFiltered returns a new Set. See the documentation for +// NewSetWithSortableFiltered for more details. +// +// This call includes a Filter to include/exclude attribute keys from the +// return value. Excluded keys are returned as a slice of attribute values. +func NewSetWithFiltered(kvs []KeyValue, filter Filter) (Set, []KeyValue) { + // Check for empty set. + if len(kvs) == 0 { + return empty(), nil + } + srt := sortables.Get().(*Sortable) + s, filtered := NewSetWithSortableFiltered(kvs, srt, filter) + sortables.Put(srt) + return s, filtered +} + +// NewSetWithSortableFiltered returns a new Set. +// +// Duplicate keys are eliminated by taking the last value. This +// re-orders the input slice so that unique last-values are contiguous +// at the end of the slice. +// +// This ensures the following: +// +// - Last-value-wins semantics +// - Caller sees the reordering, but doesn't lose values +// - Repeated call preserve last-value wins. +// +// Note that methods are defined on Set, although this returns Set. Callers +// can avoid memory allocations by: +// +// - allocating a Sortable for use as a temporary in this method +// - allocating a Set for storing the return value of this constructor. +// +// The result maintains a cache of encoded attributes, by attribute.EncoderID. +// This value should not be copied after its first use. +// +// The second []KeyValue return value is a list of attributes that were +// excluded by the Filter (if non-nil). +func NewSetWithSortableFiltered(kvs []KeyValue, tmp *Sortable, filter Filter) (Set, []KeyValue) { + // Check for empty set. + if len(kvs) == 0 { + return empty(), nil + } + + *tmp = kvs + + // Stable sort so the following de-duplication can implement + // last-value-wins semantics. + sort.Stable(tmp) + + *tmp = nil + + position := len(kvs) - 1 + offset := position - 1 + + // The requirements stated above require that the stable + // result be placed in the end of the input slice, while + // overwritten values are swapped to the beginning. + // + // De-duplicate with last-value-wins semantics. Preserve + // duplicate values at the beginning of the input slice. + for ; offset >= 0; offset-- { + if kvs[offset].Key == kvs[position].Key { + continue + } + position-- + kvs[offset], kvs[position] = kvs[position], kvs[offset] + } + kvs = kvs[position:] + + if filter != nil { + if div := filteredToFront(kvs, filter); div != 0 { + return Set{equivalent: computeDistinct(kvs[div:])}, kvs[:div] + } + } + return Set{equivalent: computeDistinct(kvs)}, nil +} + +// filteredToFront filters slice in-place using keep function. All KeyValues that need to +// be removed are moved to the front. All KeyValues that need to be kept are +// moved (in-order) to the back. The index for the first KeyValue to be kept is +// returned. +func filteredToFront(slice []KeyValue, keep Filter) int { + n := len(slice) + j := n + for i := n - 1; i >= 0; i-- { + if keep(slice[i]) { + j-- + slice[i], slice[j] = slice[j], slice[i] + } + } + return j +} + +// Filter returns a filtered copy of this Set. See the documentation for +// NewSetWithSortableFiltered for more details. +func (l *Set) Filter(re Filter) (Set, []KeyValue) { + if re == nil { + return *l, nil + } + + // Iterate in reverse to the first attribute that will be filtered out. + n := l.Len() + first := n - 1 + for ; first >= 0; first-- { + kv, _ := l.Get(first) + if !re(kv) { + break + } + } + + // No attributes will be dropped, return the immutable Set l and nil. + if first < 0 { + return *l, nil + } + + // Copy now that we know we need to return a modified set. + // + // Do not do this in-place on the underlying storage of *Set l. Sets are + // immutable and filtering should not change this. + slice := l.ToSlice() + + // Don't re-iterate the slice if only slice[0] is filtered. + if first == 0 { + // It is safe to assume len(slice) >= 1 given we found at least one + // attribute above that needs to be filtered out. + return Set{equivalent: computeDistinct(slice[1:])}, slice[:1] + } + + // Move the filtered slice[first] to the front (preserving order). + kv := slice[first] + copy(slice[1:first+1], slice[:first]) + slice[0] = kv + + // Do not re-evaluate re(slice[first+1:]). + div := filteredToFront(slice[1:first+1], re) + 1 + return Set{equivalent: computeDistinct(slice[div:])}, slice[:div] +} + +// computeDistinct returns a Distinct using either the fixed- or +// reflect-oriented code path, depending on the size of the input. The input +// slice is assumed to already be sorted and de-duplicated. +func computeDistinct(kvs []KeyValue) Distinct { + iface := computeDistinctFixed(kvs) + if iface == nil { + iface = computeDistinctReflect(kvs) + } + return Distinct{ + iface: iface, + } +} + +// computeDistinctFixed computes a Distinct for small slices. It returns nil +// if the input is too large for this code path. +func computeDistinctFixed(kvs []KeyValue) interface{} { + switch len(kvs) { + case 1: + ptr := new([1]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 2: + ptr := new([2]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 3: + ptr := new([3]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 4: + ptr := new([4]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 5: + ptr := new([5]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 6: + ptr := new([6]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 7: + ptr := new([7]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 8: + ptr := new([8]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 9: + ptr := new([9]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 10: + ptr := new([10]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + default: + return nil + } +} + +// computeDistinctReflect computes a Distinct using reflection, works for any +// size input. +func computeDistinctReflect(kvs []KeyValue) interface{} { + at := reflect.New(reflect.ArrayOf(len(kvs), keyValueType)).Elem() + for i, keyValue := range kvs { + *(at.Index(i).Addr().Interface().(*KeyValue)) = keyValue + } + return at.Interface() +} + +// MarshalJSON returns the JSON encoding of the Set. +func (l *Set) MarshalJSON() ([]byte, error) { + return json.Marshal(l.equivalent.iface) +} + +// MarshalLog is the marshaling function used by the logging system to represent this Set. +func (l Set) MarshalLog() interface{} { + kvs := make(map[string]string) + for _, kv := range l.ToSlice() { + kvs[string(kv.Key)] = kv.Value.Emit() + } + return kvs +} + +// Len implements sort.Interface. +func (l *Sortable) Len() int { + return len(*l) +} + +// Swap implements sort.Interface. +func (l *Sortable) Swap(i, j int) { + (*l)[i], (*l)[j] = (*l)[j], (*l)[i] +} + +// Less implements sort.Interface. +func (l *Sortable) Less(i, j int) bool { + return (*l)[i].Key < (*l)[j].Key +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/type_string.go b/vendor/go.opentelemetry.io/otel/attribute/type_string.go new file mode 100644 index 000000000..e584b2477 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/type_string.go @@ -0,0 +1,31 @@ +// Code generated by "stringer -type=Type"; DO NOT EDIT. + +package attribute + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[INVALID-0] + _ = x[BOOL-1] + _ = x[INT64-2] + _ = x[FLOAT64-3] + _ = x[STRING-4] + _ = x[BOOLSLICE-5] + _ = x[INT64SLICE-6] + _ = x[FLOAT64SLICE-7] + _ = x[STRINGSLICE-8] +} + +const _Type_name = "INVALIDBOOLINT64FLOAT64STRINGBOOLSLICEINT64SLICEFLOAT64SLICESTRINGSLICE" + +var _Type_index = [...]uint8{0, 7, 11, 16, 23, 29, 38, 48, 60, 71} + +func (i Type) String() string { + if i < 0 || i >= Type(len(_Type_index)-1) { + return "Type(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _Type_name[_Type_index[i]:_Type_index[i+1]] +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/value.go b/vendor/go.opentelemetry.io/otel/attribute/value.go new file mode 100644 index 000000000..cb21dd5c0 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/value.go @@ -0,0 +1,270 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package attribute // import "go.opentelemetry.io/otel/attribute" + +import ( + "encoding/json" + "fmt" + "reflect" + "strconv" + + "go.opentelemetry.io/otel/internal" + "go.opentelemetry.io/otel/internal/attribute" +) + +//go:generate stringer -type=Type + +// Type describes the type of the data Value holds. +type Type int // nolint: revive // redefines builtin Type. + +// Value represents the value part in key-value pairs. +type Value struct { + vtype Type + numeric uint64 + stringly string + slice interface{} +} + +const ( + // INVALID is used for a Value with no value set. + INVALID Type = iota + // BOOL is a boolean Type Value. + BOOL + // INT64 is a 64-bit signed integral Type Value. + INT64 + // FLOAT64 is a 64-bit floating point Type Value. + FLOAT64 + // STRING is a string Type Value. + STRING + // BOOLSLICE is a slice of booleans Type Value. + BOOLSLICE + // INT64SLICE is a slice of 64-bit signed integral numbers Type Value. + INT64SLICE + // FLOAT64SLICE is a slice of 64-bit floating point numbers Type Value. + FLOAT64SLICE + // STRINGSLICE is a slice of strings Type Value. + STRINGSLICE +) + +// BoolValue creates a BOOL Value. +func BoolValue(v bool) Value { + return Value{ + vtype: BOOL, + numeric: internal.BoolToRaw(v), + } +} + +// BoolSliceValue creates a BOOLSLICE Value. +func BoolSliceValue(v []bool) Value { + return Value{vtype: BOOLSLICE, slice: attribute.BoolSliceValue(v)} +} + +// IntValue creates an INT64 Value. +func IntValue(v int) Value { + return Int64Value(int64(v)) +} + +// IntSliceValue creates an INTSLICE Value. +func IntSliceValue(v []int) Value { + var int64Val int64 + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(int64Val))) + for i, val := range v { + cp.Elem().Index(i).SetInt(int64(val)) + } + return Value{ + vtype: INT64SLICE, + slice: cp.Elem().Interface(), + } +} + +// Int64Value creates an INT64 Value. +func Int64Value(v int64) Value { + return Value{ + vtype: INT64, + numeric: internal.Int64ToRaw(v), + } +} + +// Int64SliceValue creates an INT64SLICE Value. +func Int64SliceValue(v []int64) Value { + return Value{vtype: INT64SLICE, slice: attribute.Int64SliceValue(v)} +} + +// Float64Value creates a FLOAT64 Value. +func Float64Value(v float64) Value { + return Value{ + vtype: FLOAT64, + numeric: internal.Float64ToRaw(v), + } +} + +// Float64SliceValue creates a FLOAT64SLICE Value. +func Float64SliceValue(v []float64) Value { + return Value{vtype: FLOAT64SLICE, slice: attribute.Float64SliceValue(v)} +} + +// StringValue creates a STRING Value. +func StringValue(v string) Value { + return Value{ + vtype: STRING, + stringly: v, + } +} + +// StringSliceValue creates a STRINGSLICE Value. +func StringSliceValue(v []string) Value { + return Value{vtype: STRINGSLICE, slice: attribute.StringSliceValue(v)} +} + +// Type returns a type of the Value. +func (v Value) Type() Type { + return v.vtype +} + +// AsBool returns the bool value. Make sure that the Value's type is +// BOOL. +func (v Value) AsBool() bool { + return internal.RawToBool(v.numeric) +} + +// AsBoolSlice returns the []bool value. Make sure that the Value's type is +// BOOLSLICE. +func (v Value) AsBoolSlice() []bool { + if v.vtype != BOOLSLICE { + return nil + } + return v.asBoolSlice() +} + +func (v Value) asBoolSlice() []bool { + return attribute.AsBoolSlice(v.slice) +} + +// AsInt64 returns the int64 value. Make sure that the Value's type is +// INT64. +func (v Value) AsInt64() int64 { + return internal.RawToInt64(v.numeric) +} + +// AsInt64Slice returns the []int64 value. Make sure that the Value's type is +// INT64SLICE. +func (v Value) AsInt64Slice() []int64 { + if v.vtype != INT64SLICE { + return nil + } + return v.asInt64Slice() +} + +func (v Value) asInt64Slice() []int64 { + return attribute.AsInt64Slice(v.slice) +} + +// AsFloat64 returns the float64 value. Make sure that the Value's +// type is FLOAT64. +func (v Value) AsFloat64() float64 { + return internal.RawToFloat64(v.numeric) +} + +// AsFloat64Slice returns the []float64 value. Make sure that the Value's type is +// FLOAT64SLICE. +func (v Value) AsFloat64Slice() []float64 { + if v.vtype != FLOAT64SLICE { + return nil + } + return v.asFloat64Slice() +} + +func (v Value) asFloat64Slice() []float64 { + return attribute.AsFloat64Slice(v.slice) +} + +// AsString returns the string value. Make sure that the Value's type +// is STRING. +func (v Value) AsString() string { + return v.stringly +} + +// AsStringSlice returns the []string value. Make sure that the Value's type is +// STRINGSLICE. +func (v Value) AsStringSlice() []string { + if v.vtype != STRINGSLICE { + return nil + } + return v.asStringSlice() +} + +func (v Value) asStringSlice() []string { + return attribute.AsStringSlice(v.slice) +} + +type unknownValueType struct{} + +// AsInterface returns Value's data as interface{}. +func (v Value) AsInterface() interface{} { + switch v.Type() { + case BOOL: + return v.AsBool() + case BOOLSLICE: + return v.asBoolSlice() + case INT64: + return v.AsInt64() + case INT64SLICE: + return v.asInt64Slice() + case FLOAT64: + return v.AsFloat64() + case FLOAT64SLICE: + return v.asFloat64Slice() + case STRING: + return v.stringly + case STRINGSLICE: + return v.asStringSlice() + } + return unknownValueType{} +} + +// Emit returns a string representation of Value's data. +func (v Value) Emit() string { + switch v.Type() { + case BOOLSLICE: + return fmt.Sprint(v.asBoolSlice()) + case BOOL: + return strconv.FormatBool(v.AsBool()) + case INT64SLICE: + return fmt.Sprint(v.asInt64Slice()) + case INT64: + return strconv.FormatInt(v.AsInt64(), 10) + case FLOAT64SLICE: + return fmt.Sprint(v.asFloat64Slice()) + case FLOAT64: + return fmt.Sprint(v.AsFloat64()) + case STRINGSLICE: + return fmt.Sprint(v.asStringSlice()) + case STRING: + return v.stringly + default: + return "unknown" + } +} + +// MarshalJSON returns the JSON encoding of the Value. +func (v Value) MarshalJSON() ([]byte, error) { + var jsonVal struct { + Type string + Value interface{} + } + jsonVal.Type = v.Type().String() + jsonVal.Value = v.AsInterface() + return json.Marshal(jsonVal) +} diff --git a/vendor/go.opentelemetry.io/otel/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/baggage/baggage.go new file mode 100644 index 000000000..7d27cf77d --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/baggage/baggage.go @@ -0,0 +1,744 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package baggage // import "go.opentelemetry.io/otel/baggage" + +import ( + "errors" + "fmt" + "net/url" + "strings" + + "go.opentelemetry.io/otel/internal/baggage" +) + +const ( + maxMembers = 180 + maxBytesPerMembers = 4096 + maxBytesPerBaggageString = 8192 + + listDelimiter = "," + keyValueDelimiter = "=" + propertyDelimiter = ";" +) + +var ( + errInvalidKey = errors.New("invalid key") + errInvalidValue = errors.New("invalid value") + errInvalidProperty = errors.New("invalid baggage list-member property") + errInvalidMember = errors.New("invalid baggage list-member") + errMemberNumber = errors.New("too many list-members in baggage-string") + errMemberBytes = errors.New("list-member too large") + errBaggageBytes = errors.New("baggage-string too large") +) + +// Property is an additional metadata entry for a baggage list-member. +type Property struct { + key, value string + + // hasValue indicates if a zero-value value means the property does not + // have a value or if it was the zero-value. + hasValue bool +} + +// NewKeyProperty returns a new Property for key. +// +// If key is invalid, an error will be returned. +func NewKeyProperty(key string) (Property, error) { + if !validateKey(key) { + return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key) + } + + p := Property{key: key} + return p, nil +} + +// NewKeyValueProperty returns a new Property for key with value. +// +// The passed key must be compliant with W3C Baggage specification. +// The passed value must be precent-encoded as defined in W3C Baggage specification. +// +// Notice: Consider using [NewKeyValuePropertyRaw] instead +// that does not require precent-encoding of the value. +func NewKeyValueProperty(key, value string) (Property, error) { + if !validateValue(value) { + return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value) + } + decodedValue, err := url.PathUnescape(value) + if err != nil { + return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value) + } + return NewKeyValuePropertyRaw(key, decodedValue) +} + +// NewKeyValuePropertyRaw returns a new Property for key with value. +// +// The passed key must be compliant with W3C Baggage specification. +func NewKeyValuePropertyRaw(key, value string) (Property, error) { + if !validateKey(key) { + return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key) + } + + p := Property{ + key: key, + value: value, + hasValue: true, + } + return p, nil +} + +func newInvalidProperty() Property { + return Property{} +} + +// parseProperty attempts to decode a Property from the passed string. It +// returns an error if the input is invalid according to the W3C Baggage +// specification. +func parseProperty(property string) (Property, error) { + if property == "" { + return newInvalidProperty(), nil + } + + p, ok := parsePropertyInternal(property) + if !ok { + return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidProperty, property) + } + + return p, nil +} + +// validate ensures p conforms to the W3C Baggage specification, returning an +// error otherwise. +func (p Property) validate() error { + errFunc := func(err error) error { + return fmt.Errorf("invalid property: %w", err) + } + + if !validateKey(p.key) { + return errFunc(fmt.Errorf("%w: %q", errInvalidKey, p.key)) + } + if !p.hasValue && p.value != "" { + return errFunc(errors.New("inconsistent value")) + } + return nil +} + +// Key returns the Property key. +func (p Property) Key() string { + return p.key +} + +// Value returns the Property value. Additionally, a boolean value is returned +// indicating if the returned value is the empty if the Property has a value +// that is empty or if the value is not set. +func (p Property) Value() (string, bool) { + return p.value, p.hasValue +} + +// String encodes Property into a header string compliant with the W3C Baggage +// specification. +func (p Property) String() string { + if p.hasValue { + return fmt.Sprintf("%s%s%v", p.key, keyValueDelimiter, valueEscape(p.value)) + } + return p.key +} + +type properties []Property + +func fromInternalProperties(iProps []baggage.Property) properties { + if len(iProps) == 0 { + return nil + } + + props := make(properties, len(iProps)) + for i, p := range iProps { + props[i] = Property{ + key: p.Key, + value: p.Value, + hasValue: p.HasValue, + } + } + return props +} + +func (p properties) asInternal() []baggage.Property { + if len(p) == 0 { + return nil + } + + iProps := make([]baggage.Property, len(p)) + for i, prop := range p { + iProps[i] = baggage.Property{ + Key: prop.key, + Value: prop.value, + HasValue: prop.hasValue, + } + } + return iProps +} + +func (p properties) Copy() properties { + if len(p) == 0 { + return nil + } + + props := make(properties, len(p)) + copy(props, p) + return props +} + +// validate ensures each Property in p conforms to the W3C Baggage +// specification, returning an error otherwise. +func (p properties) validate() error { + for _, prop := range p { + if err := prop.validate(); err != nil { + return err + } + } + return nil +} + +// String encodes properties into a header string compliant with the W3C Baggage +// specification. +func (p properties) String() string { + props := make([]string, len(p)) + for i, prop := range p { + props[i] = prop.String() + } + return strings.Join(props, propertyDelimiter) +} + +// Member is a list-member of a baggage-string as defined by the W3C Baggage +// specification. +type Member struct { + key, value string + properties properties + + // hasData indicates whether the created property contains data or not. + // Properties that do not contain data are invalid with no other check + // required. + hasData bool +} + +// NewMemberRaw returns a new Member from the passed arguments. +// +// The passed key must be compliant with W3C Baggage specification. +// The passed value must be precent-encoded as defined in W3C Baggage specification. +// +// Notice: Consider using [NewMemberRaw] instead +// that does not require precent-encoding of the value. +func NewMember(key, value string, props ...Property) (Member, error) { + if !validateValue(value) { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value) + } + decodedValue, err := url.PathUnescape(value) + if err != nil { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value) + } + return NewMemberRaw(key, decodedValue, props...) +} + +// NewMemberRaw returns a new Member from the passed arguments. +// +// The passed key must be compliant with W3C Baggage specification. +func NewMemberRaw(key, value string, props ...Property) (Member, error) { + m := Member{ + key: key, + value: value, + properties: properties(props).Copy(), + hasData: true, + } + if err := m.validate(); err != nil { + return newInvalidMember(), err + } + return m, nil +} + +func newInvalidMember() Member { + return Member{} +} + +// parseMember attempts to decode a Member from the passed string. It returns +// an error if the input is invalid according to the W3C Baggage +// specification. +func parseMember(member string) (Member, error) { + if n := len(member); n > maxBytesPerMembers { + return newInvalidMember(), fmt.Errorf("%w: %d", errMemberBytes, n) + } + + var props properties + keyValue, properties, found := strings.Cut(member, propertyDelimiter) + if found { + // Parse the member properties. + for _, pStr := range strings.Split(properties, propertyDelimiter) { + p, err := parseProperty(pStr) + if err != nil { + return newInvalidMember(), err + } + props = append(props, p) + } + } + // Parse the member key/value pair. + + // Take into account a value can contain equal signs (=). + k, v, found := strings.Cut(keyValue, keyValueDelimiter) + if !found { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidMember, member) + } + // "Leading and trailing whitespaces are allowed but MUST be trimmed + // when converting the header into a data structure." + key := strings.TrimSpace(k) + if !validateKey(key) { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidKey, key) + } + + val := strings.TrimSpace(v) + if !validateValue(val) { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, v) + } + + // Decode a precent-encoded value. + value, err := url.PathUnescape(val) + if err != nil { + return newInvalidMember(), fmt.Errorf("%w: %v", errInvalidValue, err) + } + return Member{key: key, value: value, properties: props, hasData: true}, nil +} + +// validate ensures m conforms to the W3C Baggage specification. +// A key must be an ASCII string, returning an error otherwise. +func (m Member) validate() error { + if !m.hasData { + return fmt.Errorf("%w: %q", errInvalidMember, m) + } + + if !validateKey(m.key) { + return fmt.Errorf("%w: %q", errInvalidKey, m.key) + } + return m.properties.validate() +} + +// Key returns the Member key. +func (m Member) Key() string { return m.key } + +// Value returns the Member value. +func (m Member) Value() string { return m.value } + +// Properties returns a copy of the Member properties. +func (m Member) Properties() []Property { return m.properties.Copy() } + +// String encodes Member into a header string compliant with the W3C Baggage +// specification. +func (m Member) String() string { + // A key is just an ASCII string. A value is restricted to be + // US-ASCII characters excluding CTLs, whitespace, + // DQUOTE, comma, semicolon, and backslash. + s := fmt.Sprintf("%s%s%s", m.key, keyValueDelimiter, valueEscape(m.value)) + if len(m.properties) > 0 { + s = fmt.Sprintf("%s%s%s", s, propertyDelimiter, m.properties.String()) + } + return s +} + +// Baggage is a list of baggage members representing the baggage-string as +// defined by the W3C Baggage specification. +type Baggage struct { //nolint:golint + list baggage.List +} + +// New returns a new valid Baggage. It returns an error if it results in a +// Baggage exceeding limits set in that specification. +// +// It expects all the provided members to have already been validated. +func New(members ...Member) (Baggage, error) { + if len(members) == 0 { + return Baggage{}, nil + } + + b := make(baggage.List) + for _, m := range members { + if !m.hasData { + return Baggage{}, errInvalidMember + } + + // OpenTelemetry resolves duplicates by last-one-wins. + b[m.key] = baggage.Item{ + Value: m.value, + Properties: m.properties.asInternal(), + } + } + + // Check member numbers after deduplication. + if len(b) > maxMembers { + return Baggage{}, errMemberNumber + } + + bag := Baggage{b} + if n := len(bag.String()); n > maxBytesPerBaggageString { + return Baggage{}, fmt.Errorf("%w: %d", errBaggageBytes, n) + } + + return bag, nil +} + +// Parse attempts to decode a baggage-string from the passed string. It +// returns an error if the input is invalid according to the W3C Baggage +// specification. +// +// If there are duplicate list-members contained in baggage, the last one +// defined (reading left-to-right) will be the only one kept. This diverges +// from the W3C Baggage specification which allows duplicate list-members, but +// conforms to the OpenTelemetry Baggage specification. +func Parse(bStr string) (Baggage, error) { + if bStr == "" { + return Baggage{}, nil + } + + if n := len(bStr); n > maxBytesPerBaggageString { + return Baggage{}, fmt.Errorf("%w: %d", errBaggageBytes, n) + } + + b := make(baggage.List) + for _, memberStr := range strings.Split(bStr, listDelimiter) { + m, err := parseMember(memberStr) + if err != nil { + return Baggage{}, err + } + // OpenTelemetry resolves duplicates by last-one-wins. + b[m.key] = baggage.Item{ + Value: m.value, + Properties: m.properties.asInternal(), + } + } + + // OpenTelemetry does not allow for duplicate list-members, but the W3C + // specification does. Now that we have deduplicated, ensure the baggage + // does not exceed list-member limits. + if len(b) > maxMembers { + return Baggage{}, errMemberNumber + } + + return Baggage{b}, nil +} + +// Member returns the baggage list-member identified by key. +// +// If there is no list-member matching the passed key the returned Member will +// be a zero-value Member. +// The returned member is not validated, as we assume the validation happened +// when it was added to the Baggage. +func (b Baggage) Member(key string) Member { + v, ok := b.list[key] + if !ok { + // We do not need to worry about distinguishing between the situation + // where a zero-valued Member is included in the Baggage because a + // zero-valued Member is invalid according to the W3C Baggage + // specification (it has an empty key). + return newInvalidMember() + } + + return Member{ + key: key, + value: v.Value, + properties: fromInternalProperties(v.Properties), + hasData: true, + } +} + +// Members returns all the baggage list-members. +// The order of the returned list-members does not have significance. +// +// The returned members are not validated, as we assume the validation happened +// when they were added to the Baggage. +func (b Baggage) Members() []Member { + if len(b.list) == 0 { + return nil + } + + members := make([]Member, 0, len(b.list)) + for k, v := range b.list { + members = append(members, Member{ + key: k, + value: v.Value, + properties: fromInternalProperties(v.Properties), + hasData: true, + }) + } + return members +} + +// SetMember returns a copy the Baggage with the member included. If the +// baggage contains a Member with the same key the existing Member is +// replaced. +// +// If member is invalid according to the W3C Baggage specification, an error +// is returned with the original Baggage. +func (b Baggage) SetMember(member Member) (Baggage, error) { + if !member.hasData { + return b, errInvalidMember + } + + n := len(b.list) + if _, ok := b.list[member.key]; !ok { + n++ + } + list := make(baggage.List, n) + + for k, v := range b.list { + // Do not copy if we are just going to overwrite. + if k == member.key { + continue + } + list[k] = v + } + + list[member.key] = baggage.Item{ + Value: member.value, + Properties: member.properties.asInternal(), + } + + return Baggage{list: list}, nil +} + +// DeleteMember returns a copy of the Baggage with the list-member identified +// by key removed. +func (b Baggage) DeleteMember(key string) Baggage { + n := len(b.list) + if _, ok := b.list[key]; ok { + n-- + } + list := make(baggage.List, n) + + for k, v := range b.list { + if k == key { + continue + } + list[k] = v + } + + return Baggage{list: list} +} + +// Len returns the number of list-members in the Baggage. +func (b Baggage) Len() int { + return len(b.list) +} + +// String encodes Baggage into a header string compliant with the W3C Baggage +// specification. +func (b Baggage) String() string { + members := make([]string, 0, len(b.list)) + for k, v := range b.list { + members = append(members, Member{ + key: k, + value: v.Value, + properties: fromInternalProperties(v.Properties), + }.String()) + } + return strings.Join(members, listDelimiter) +} + +// parsePropertyInternal attempts to decode a Property from the passed string. +// It follows the spec at https://www.w3.org/TR/baggage/#definition. +func parsePropertyInternal(s string) (p Property, ok bool) { + // For the entire function we will use " key = value " as an example. + // Attempting to parse the key. + // First skip spaces at the beginning "< >key = value " (they could be empty). + index := skipSpace(s, 0) + + // Parse the key: " = value ". + keyStart := index + keyEnd := index + for _, c := range s[keyStart:] { + if !validateKeyChar(c) { + break + } + keyEnd++ + } + + // If we couldn't find any valid key character, + // it means the key is either empty or invalid. + if keyStart == keyEnd { + return + } + + // Skip spaces after the key: " key< >= value ". + index = skipSpace(s, keyEnd) + + if index == len(s) { + // A key can have no value, like: " key ". + ok = true + p.key = s[keyStart:keyEnd] + return + } + + // If we have not reached the end and we can't find the '=' delimiter, + // it means the property is invalid. + if s[index] != keyValueDelimiter[0] { + return + } + + // Attempting to parse the value. + // Match: " key =< >value ". + index = skipSpace(s, index+1) + + // Match the value string: " key = ". + // A valid property can be: " key =". + // Therefore, we don't have to check if the value is empty. + valueStart := index + valueEnd := index + for _, c := range s[valueStart:] { + if !validateValueChar(c) { + break + } + valueEnd++ + } + + // Skip all trailing whitespaces: " key = value< >". + index = skipSpace(s, valueEnd) + + // If after looking for the value and skipping whitespaces + // we have not reached the end, it means the property is + // invalid, something like: " key = value value1". + if index != len(s) { + return + } + + // Decode a precent-encoded value. + value, err := url.PathUnescape(s[valueStart:valueEnd]) + if err != nil { + return + } + + ok = true + p.key = s[keyStart:keyEnd] + p.hasValue = true + + p.value = value + return +} + +func skipSpace(s string, offset int) int { + i := offset + for ; i < len(s); i++ { + c := s[i] + if c != ' ' && c != '\t' { + break + } + } + return i +} + +func validateKey(s string) bool { + if len(s) == 0 { + return false + } + + for _, c := range s { + if !validateKeyChar(c) { + return false + } + } + + return true +} + +func validateKeyChar(c int32) bool { + return (c >= 0x23 && c <= 0x27) || + (c >= 0x30 && c <= 0x39) || + (c >= 0x41 && c <= 0x5a) || + (c >= 0x5e && c <= 0x7a) || + c == 0x21 || + c == 0x2a || + c == 0x2b || + c == 0x2d || + c == 0x2e || + c == 0x7c || + c == 0x7e +} + +func validateValue(s string) bool { + for _, c := range s { + if !validateValueChar(c) { + return false + } + } + + return true +} + +func validateValueChar(c int32) bool { + return c == 0x21 || + (c >= 0x23 && c <= 0x2b) || + (c >= 0x2d && c <= 0x3a) || + (c >= 0x3c && c <= 0x5b) || + (c >= 0x5d && c <= 0x7e) +} + +// valueEscape escapes the string so it can be safely placed inside a baggage value, +// replacing special characters with %XX sequences as needed. +// +// The implementation is based on: +// https://github.com/golang/go/blob/f6509cf5cdbb5787061b784973782933c47f1782/src/net/url/url.go#L285. +func valueEscape(s string) string { + hexCount := 0 + for i := 0; i < len(s); i++ { + c := s[i] + if shouldEscape(c) { + hexCount++ + } + } + + if hexCount == 0 { + return s + } + + var buf [64]byte + var t []byte + + required := len(s) + 2*hexCount + if required <= len(buf) { + t = buf[:required] + } else { + t = make([]byte, required) + } + + j := 0 + for i := 0; i < len(s); i++ { + c := s[i] + if shouldEscape(s[i]) { + const upperhex = "0123456789ABCDEF" + t[j] = '%' + t[j+1] = upperhex[c>>4] + t[j+2] = upperhex[c&15] + j += 3 + } else { + t[j] = c + j++ + } + } + + return string(t) +} + +// shouldEscape returns true if the specified byte should be escaped when +// appearing in a baggage value string. +func shouldEscape(c byte) bool { + if c == '%' { + // The percent character must be encoded so that percent-encoding can work. + return true + } + return !validateValueChar(int32(c)) +} diff --git a/vendor/go.opentelemetry.io/otel/baggage/context.go b/vendor/go.opentelemetry.io/otel/baggage/context.go new file mode 100644 index 000000000..24b34b756 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/baggage/context.go @@ -0,0 +1,39 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package baggage // import "go.opentelemetry.io/otel/baggage" + +import ( + "context" + + "go.opentelemetry.io/otel/internal/baggage" +) + +// ContextWithBaggage returns a copy of parent with baggage. +func ContextWithBaggage(parent context.Context, b Baggage) context.Context { + // Delegate so any hooks for the OpenTracing bridge are handled. + return baggage.ContextWithList(parent, b.list) +} + +// ContextWithoutBaggage returns a copy of parent with no baggage. +func ContextWithoutBaggage(parent context.Context) context.Context { + // Delegate so any hooks for the OpenTracing bridge are handled. + return baggage.ContextWithList(parent, nil) +} + +// FromContext returns the baggage contained in ctx. +func FromContext(ctx context.Context) Baggage { + // Delegate so any hooks for the OpenTracing bridge are handled. + return Baggage{list: baggage.ListFromContext(ctx)} +} diff --git a/vendor/go.opentelemetry.io/otel/baggage/doc.go b/vendor/go.opentelemetry.io/otel/baggage/doc.go new file mode 100644 index 000000000..4545100df --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/baggage/doc.go @@ -0,0 +1,20 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package baggage provides functionality for storing and retrieving +baggage items in Go context. For propagating the baggage, see the +go.opentelemetry.io/otel/propagation package. +*/ +package baggage // import "go.opentelemetry.io/otel/baggage" diff --git a/vendor/go.opentelemetry.io/otel/codes/codes.go b/vendor/go.opentelemetry.io/otel/codes/codes.go new file mode 100644 index 000000000..587ebae4e --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/codes/codes.go @@ -0,0 +1,116 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package codes // import "go.opentelemetry.io/otel/codes" + +import ( + "encoding/json" + "fmt" + "strconv" +) + +const ( + // Unset is the default status code. + Unset Code = 0 + + // Error indicates the operation contains an error. + // + // NOTE: The error code in OTLP is 2. + // The value of this enum is only relevant to the internals + // of the Go SDK. + Error Code = 1 + + // Ok indicates operation has been validated by an Application developers + // or Operator to have completed successfully, or contain no error. + // + // NOTE: The Ok code in OTLP is 1. + // The value of this enum is only relevant to the internals + // of the Go SDK. + Ok Code = 2 + + maxCode = 3 +) + +// Code is an 32-bit representation of a status state. +type Code uint32 + +var codeToStr = map[Code]string{ + Unset: "Unset", + Error: "Error", + Ok: "Ok", +} + +var strToCode = map[string]Code{ + `"Unset"`: Unset, + `"Error"`: Error, + `"Ok"`: Ok, +} + +// String returns the Code as a string. +func (c Code) String() string { + return codeToStr[c] +} + +// UnmarshalJSON unmarshals b into the Code. +// +// This is based on the functionality in the gRPC codes package: +// https://github.com/grpc/grpc-go/blob/bb64fee312b46ebee26be43364a7a966033521b1/codes/codes.go#L218-L244 +func (c *Code) UnmarshalJSON(b []byte) error { + // From json.Unmarshaler: By convention, to approximate the behavior of + // Unmarshal itself, Unmarshalers implement UnmarshalJSON([]byte("null")) as + // a no-op. + if string(b) == "null" { + return nil + } + if c == nil { + return fmt.Errorf("nil receiver passed to UnmarshalJSON") + } + + var x interface{} + if err := json.Unmarshal(b, &x); err != nil { + return err + } + switch x.(type) { + case string: + if jc, ok := strToCode[string(b)]; ok { + *c = jc + return nil + } + return fmt.Errorf("invalid code: %q", string(b)) + case float64: + if ci, err := strconv.ParseUint(string(b), 10, 32); err == nil { + if ci >= maxCode { + return fmt.Errorf("invalid code: %q", ci) + } + + *c = Code(ci) + return nil + } + return fmt.Errorf("invalid code: %q", string(b)) + default: + return fmt.Errorf("invalid code: %q", string(b)) + } +} + +// MarshalJSON returns c as the JSON encoding of c. +func (c *Code) MarshalJSON() ([]byte, error) { + if c == nil { + return []byte("null"), nil + } + str, ok := codeToStr[*c] + if !ok { + return nil, fmt.Errorf("invalid code: %d", *c) + } + return []byte(fmt.Sprintf("%q", str)), nil +} diff --git a/vendor/go.opentelemetry.io/otel/codes/doc.go b/vendor/go.opentelemetry.io/otel/codes/doc.go new file mode 100644 index 000000000..4e328fbb4 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/codes/doc.go @@ -0,0 +1,21 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package codes defines the canonical error codes used by OpenTelemetry. + +It conforms to [the OpenTelemetry +specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/trace/api.md#set-status). +*/ +package codes // import "go.opentelemetry.io/otel/codes" diff --git a/vendor/go.opentelemetry.io/otel/doc.go b/vendor/go.opentelemetry.io/otel/doc.go new file mode 100644 index 000000000..36d7c24e8 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/doc.go @@ -0,0 +1,34 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package otel provides global access to the OpenTelemetry API. The subpackages of +the otel package provide an implementation of the OpenTelemetry API. + +The provided API is used to instrument code and measure data about that code's +performance and operation. The measured data, by default, is not processed or +transmitted anywhere. An implementation of the OpenTelemetry SDK, like the +default SDK implementation (go.opentelemetry.io/otel/sdk), and associated +exporters are used to process and transport this data. + +To read the getting started guide, see https://opentelemetry.io/docs/languages/go/getting-started/. + +To read more about tracing, see go.opentelemetry.io/otel/trace. + +To read more about metrics, see go.opentelemetry.io/otel/metric. + +To read more about propagation, see go.opentelemetry.io/otel/propagation and +go.opentelemetry.io/otel/baggage. +*/ +package otel // import "go.opentelemetry.io/otel" diff --git a/vendor/go.opentelemetry.io/otel/error_handler.go b/vendor/go.opentelemetry.io/otel/error_handler.go new file mode 100644 index 000000000..72fad8541 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/error_handler.go @@ -0,0 +1,38 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otel // import "go.opentelemetry.io/otel" + +// ErrorHandler handles irremediable events. +type ErrorHandler interface { + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Handle handles any error deemed irremediable by an OpenTelemetry + // component. + Handle(error) + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. +} + +// ErrorHandlerFunc is a convenience adapter to allow the use of a function +// as an ErrorHandler. +type ErrorHandlerFunc func(error) + +var _ ErrorHandler = ErrorHandlerFunc(nil) + +// Handle handles the irremediable error by calling the ErrorHandlerFunc itself. +func (f ErrorHandlerFunc) Handle(err error) { + f(err) +} diff --git a/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh b/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh new file mode 100644 index 000000000..9a58fb1d3 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -euo pipefail + +top_dir='.' +if [[ $# -gt 0 ]]; then + top_dir="${1}" +fi + +p=$(pwd) +mod_dirs=() + +# Note `mapfile` does not exist in older bash versions: +# https://stackoverflow.com/questions/41475261/need-alternative-to-readarray-mapfile-for-script-on-older-version-of-bash + +while IFS= read -r line; do + mod_dirs+=("$line") +done < <(find "${top_dir}" -type f -name 'go.mod' -exec dirname {} \; | sort) + +for mod_dir in "${mod_dirs[@]}"; do + cd "${mod_dir}" + + while IFS= read -r line; do + echo ".${line#${p}}" + done < <(go list --find -f '{{.Name}}|{{.Dir}}' ./... | grep '^main|' | cut -f 2- -d '|') + cd "${p}" +done diff --git a/vendor/go.opentelemetry.io/otel/handler.go b/vendor/go.opentelemetry.io/otel/handler.go new file mode 100644 index 000000000..4115fe3bb --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/handler.go @@ -0,0 +1,48 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otel // import "go.opentelemetry.io/otel" + +import ( + "go.opentelemetry.io/otel/internal/global" +) + +var ( + // Compile-time check global.ErrDelegator implements ErrorHandler. + _ ErrorHandler = (*global.ErrDelegator)(nil) + // Compile-time check global.ErrLogger implements ErrorHandler. + _ ErrorHandler = (*global.ErrLogger)(nil) +) + +// GetErrorHandler returns the global ErrorHandler instance. +// +// The default ErrorHandler instance returned will log all errors to STDERR +// until an override ErrorHandler is set with SetErrorHandler. All +// ErrorHandler returned prior to this will automatically forward errors to +// the set instance instead of logging. +// +// Subsequent calls to SetErrorHandler after the first will not forward errors +// to the new ErrorHandler for prior returned instances. +func GetErrorHandler() ErrorHandler { return global.GetErrorHandler() } + +// SetErrorHandler sets the global ErrorHandler to h. +// +// The first time this is called all ErrorHandler previously returned from +// GetErrorHandler will send errors to h instead of the default logging +// ErrorHandler. Subsequent calls will set the global ErrorHandler, but not +// delegate errors to h. +func SetErrorHandler(h ErrorHandler) { global.SetErrorHandler(h) } + +// Handle is a convenience function for ErrorHandler().Handle(err). +func Handle(err error) { global.Handle(err) } diff --git a/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go b/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go new file mode 100644 index 000000000..622c3ee3f --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go @@ -0,0 +1,111 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package attribute provide several helper functions for some commonly used +logic of processing attributes. +*/ +package attribute // import "go.opentelemetry.io/otel/internal/attribute" + +import ( + "reflect" +) + +// BoolSliceValue converts a bool slice into an array with same elements as slice. +func BoolSliceValue(v []bool) interface{} { + var zero bool + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))) + copy(cp.Elem().Slice(0, len(v)).Interface().([]bool), v) + return cp.Elem().Interface() +} + +// Int64SliceValue converts an int64 slice into an array with same elements as slice. +func Int64SliceValue(v []int64) interface{} { + var zero int64 + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))) + copy(cp.Elem().Slice(0, len(v)).Interface().([]int64), v) + return cp.Elem().Interface() +} + +// Float64SliceValue converts a float64 slice into an array with same elements as slice. +func Float64SliceValue(v []float64) interface{} { + var zero float64 + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))) + copy(cp.Elem().Slice(0, len(v)).Interface().([]float64), v) + return cp.Elem().Interface() +} + +// StringSliceValue converts a string slice into an array with same elements as slice. +func StringSliceValue(v []string) interface{} { + var zero string + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))) + copy(cp.Elem().Slice(0, len(v)).Interface().([]string), v) + return cp.Elem().Interface() +} + +// AsBoolSlice converts a bool array into a slice into with same elements as array. +func AsBoolSlice(v interface{}) []bool { + rv := reflect.ValueOf(v) + if rv.Type().Kind() != reflect.Array { + return nil + } + var zero bool + correctLen := rv.Len() + correctType := reflect.ArrayOf(correctLen, reflect.TypeOf(zero)) + cpy := reflect.New(correctType) + _ = reflect.Copy(cpy.Elem(), rv) + return cpy.Elem().Slice(0, correctLen).Interface().([]bool) +} + +// AsInt64Slice converts an int64 array into a slice into with same elements as array. +func AsInt64Slice(v interface{}) []int64 { + rv := reflect.ValueOf(v) + if rv.Type().Kind() != reflect.Array { + return nil + } + var zero int64 + correctLen := rv.Len() + correctType := reflect.ArrayOf(correctLen, reflect.TypeOf(zero)) + cpy := reflect.New(correctType) + _ = reflect.Copy(cpy.Elem(), rv) + return cpy.Elem().Slice(0, correctLen).Interface().([]int64) +} + +// AsFloat64Slice converts a float64 array into a slice into with same elements as array. +func AsFloat64Slice(v interface{}) []float64 { + rv := reflect.ValueOf(v) + if rv.Type().Kind() != reflect.Array { + return nil + } + var zero float64 + correctLen := rv.Len() + correctType := reflect.ArrayOf(correctLen, reflect.TypeOf(zero)) + cpy := reflect.New(correctType) + _ = reflect.Copy(cpy.Elem(), rv) + return cpy.Elem().Slice(0, correctLen).Interface().([]float64) +} + +// AsStringSlice converts a string array into a slice into with same elements as array. +func AsStringSlice(v interface{}) []string { + rv := reflect.ValueOf(v) + if rv.Type().Kind() != reflect.Array { + return nil + } + var zero string + correctLen := rv.Len() + correctType := reflect.ArrayOf(correctLen, reflect.TypeOf(zero)) + cpy := reflect.New(correctType) + _ = reflect.Copy(cpy.Elem(), rv) + return cpy.Elem().Slice(0, correctLen).Interface().([]string) +} diff --git a/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go new file mode 100644 index 000000000..b96e5408e --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go @@ -0,0 +1,43 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package baggage provides base types and functionality to store and retrieve +baggage in Go context. This package exists because the OpenTracing bridge to +OpenTelemetry needs to synchronize state whenever baggage for a context is +modified and that context contains an OpenTracing span. If it were not for +this need this package would not need to exist and the +`go.opentelemetry.io/otel/baggage` package would be the singular place where +W3C baggage is handled. +*/ +package baggage // import "go.opentelemetry.io/otel/internal/baggage" + +// List is the collection of baggage members. The W3C allows for duplicates, +// but OpenTelemetry does not, therefore, this is represented as a map. +type List map[string]Item + +// Item is the value and metadata properties part of a list-member. +type Item struct { + Value string + Properties []Property +} + +// Property is a metadata entry for a list-member. +type Property struct { + Key, Value string + + // HasValue indicates if a zero-value value means the property does not + // have a value or if it was the zero-value. + HasValue bool +} diff --git a/vendor/go.opentelemetry.io/otel/internal/baggage/context.go b/vendor/go.opentelemetry.io/otel/internal/baggage/context.go new file mode 100644 index 000000000..4469700d9 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/baggage/context.go @@ -0,0 +1,92 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package baggage // import "go.opentelemetry.io/otel/internal/baggage" + +import "context" + +type baggageContextKeyType int + +const baggageKey baggageContextKeyType = iota + +// SetHookFunc is a callback called when storing baggage in the context. +type SetHookFunc func(context.Context, List) context.Context + +// GetHookFunc is a callback called when getting baggage from the context. +type GetHookFunc func(context.Context, List) List + +type baggageState struct { + list List + + setHook SetHookFunc + getHook GetHookFunc +} + +// ContextWithSetHook returns a copy of parent with hook configured to be +// invoked every time ContextWithBaggage is called. +// +// Passing nil SetHookFunc creates a context with no set hook to call. +func ContextWithSetHook(parent context.Context, hook SetHookFunc) context.Context { + var s baggageState + if v, ok := parent.Value(baggageKey).(baggageState); ok { + s = v + } + + s.setHook = hook + return context.WithValue(parent, baggageKey, s) +} + +// ContextWithGetHook returns a copy of parent with hook configured to be +// invoked every time FromContext is called. +// +// Passing nil GetHookFunc creates a context with no get hook to call. +func ContextWithGetHook(parent context.Context, hook GetHookFunc) context.Context { + var s baggageState + if v, ok := parent.Value(baggageKey).(baggageState); ok { + s = v + } + + s.getHook = hook + return context.WithValue(parent, baggageKey, s) +} + +// ContextWithList returns a copy of parent with baggage. Passing nil list +// returns a context without any baggage. +func ContextWithList(parent context.Context, list List) context.Context { + var s baggageState + if v, ok := parent.Value(baggageKey).(baggageState); ok { + s = v + } + + s.list = list + ctx := context.WithValue(parent, baggageKey, s) + if s.setHook != nil { + ctx = s.setHook(ctx, list) + } + + return ctx +} + +// ListFromContext returns the baggage contained in ctx. +func ListFromContext(ctx context.Context) List { + switch v := ctx.Value(baggageKey).(type) { + case baggageState: + if v.getHook != nil { + return v.getHook(ctx, v.list) + } + return v.list + default: + return nil + } +} diff --git a/vendor/go.opentelemetry.io/otel/internal/gen.go b/vendor/go.opentelemetry.io/otel/internal/gen.go new file mode 100644 index 000000000..f532f07e9 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/gen.go @@ -0,0 +1,29 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package internal // import "go.opentelemetry.io/otel/internal" + +//go:generate gotmpl --body=./shared/matchers/expectation.go.tmpl "--data={}" --out=matchers/expectation.go +//go:generate gotmpl --body=./shared/matchers/expecter.go.tmpl "--data={}" --out=matchers/expecter.go +//go:generate gotmpl --body=./shared/matchers/temporal_matcher.go.tmpl "--data={}" --out=matchers/temporal_matcher.go + +//go:generate gotmpl --body=./shared/internaltest/alignment.go.tmpl "--data={}" --out=internaltest/alignment.go +//go:generate gotmpl --body=./shared/internaltest/env.go.tmpl "--data={}" --out=internaltest/env.go +//go:generate gotmpl --body=./shared/internaltest/env_test.go.tmpl "--data={}" --out=internaltest/env_test.go +//go:generate gotmpl --body=./shared/internaltest/errors.go.tmpl "--data={}" --out=internaltest/errors.go +//go:generate gotmpl --body=./shared/internaltest/harness.go.tmpl "--data={\"matchersImportPath\": \"go.opentelemetry.io/otel/internal/matchers\"}" --out=internaltest/harness.go +//go:generate gotmpl --body=./shared/internaltest/text_map_carrier.go.tmpl "--data={}" --out=internaltest/text_map_carrier.go +//go:generate gotmpl --body=./shared/internaltest/text_map_carrier_test.go.tmpl "--data={}" --out=internaltest/text_map_carrier_test.go +//go:generate gotmpl --body=./shared/internaltest/text_map_propagator.go.tmpl "--data={}" --out=internaltest/text_map_propagator.go +//go:generate gotmpl --body=./shared/internaltest/text_map_propagator_test.go.tmpl "--data={}" --out=internaltest/text_map_propagator_test.go diff --git a/vendor/go.opentelemetry.io/otel/internal/global/handler.go b/vendor/go.opentelemetry.io/otel/internal/global/handler.go new file mode 100644 index 000000000..5e9b83047 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/handler.go @@ -0,0 +1,102 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "log" + "os" + "sync/atomic" +) + +var ( + // GlobalErrorHandler provides an ErrorHandler that can be used + // throughout an OpenTelemetry instrumented project. When a user + // specified ErrorHandler is registered (`SetErrorHandler`) all calls to + // `Handle` and will be delegated to the registered ErrorHandler. + GlobalErrorHandler = defaultErrorHandler() + + // Compile-time check that delegator implements ErrorHandler. + _ ErrorHandler = (*ErrDelegator)(nil) + // Compile-time check that errLogger implements ErrorHandler. + _ ErrorHandler = (*ErrLogger)(nil) +) + +// ErrorHandler handles irremediable events. +type ErrorHandler interface { + // Handle handles any error deemed irremediable by an OpenTelemetry + // component. + Handle(error) +} + +type ErrDelegator struct { + delegate atomic.Pointer[ErrorHandler] +} + +func (d *ErrDelegator) Handle(err error) { + d.getDelegate().Handle(err) +} + +func (d *ErrDelegator) getDelegate() ErrorHandler { + return *d.delegate.Load() +} + +// setDelegate sets the ErrorHandler delegate. +func (d *ErrDelegator) setDelegate(eh ErrorHandler) { + d.delegate.Store(&eh) +} + +func defaultErrorHandler() *ErrDelegator { + d := &ErrDelegator{} + d.setDelegate(&ErrLogger{l: log.New(os.Stderr, "", log.LstdFlags)}) + return d +} + +// ErrLogger logs errors if no delegate is set, otherwise they are delegated. +type ErrLogger struct { + l *log.Logger +} + +// Handle logs err if no delegate is set, otherwise it is delegated. +func (h *ErrLogger) Handle(err error) { + h.l.Print(err) +} + +// GetErrorHandler returns the global ErrorHandler instance. +// +// The default ErrorHandler instance returned will log all errors to STDERR +// until an override ErrorHandler is set with SetErrorHandler. All +// ErrorHandler returned prior to this will automatically forward errors to +// the set instance instead of logging. +// +// Subsequent calls to SetErrorHandler after the first will not forward errors +// to the new ErrorHandler for prior returned instances. +func GetErrorHandler() ErrorHandler { + return GlobalErrorHandler +} + +// SetErrorHandler sets the global ErrorHandler to h. +// +// The first time this is called all ErrorHandler previously returned from +// GetErrorHandler will send errors to h instead of the default logging +// ErrorHandler. Subsequent calls will set the global ErrorHandler, but not +// delegate errors to h. +func SetErrorHandler(h ErrorHandler) { + GlobalErrorHandler.setDelegate(h) +} + +// Handle is a convenience function for ErrorHandler().Handle(err). +func Handle(err error) { + GetErrorHandler().Handle(err) +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/instruments.go b/vendor/go.opentelemetry.io/otel/internal/global/instruments.go new file mode 100644 index 000000000..ebb13c206 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/instruments.go @@ -0,0 +1,371 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "context" + "sync/atomic" + + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/embedded" +) + +// unwrapper unwraps to return the underlying instrument implementation. +type unwrapper interface { + Unwrap() metric.Observable +} + +type afCounter struct { + embedded.Float64ObservableCounter + metric.Float64Observable + + name string + opts []metric.Float64ObservableCounterOption + + delegate atomic.Value // metric.Float64ObservableCounter +} + +var ( + _ unwrapper = (*afCounter)(nil) + _ metric.Float64ObservableCounter = (*afCounter)(nil) +) + +func (i *afCounter) setDelegate(m metric.Meter) { + ctr, err := m.Float64ObservableCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *afCounter) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Float64ObservableCounter) + } + return nil +} + +type afUpDownCounter struct { + embedded.Float64ObservableUpDownCounter + metric.Float64Observable + + name string + opts []metric.Float64ObservableUpDownCounterOption + + delegate atomic.Value // metric.Float64ObservableUpDownCounter +} + +var ( + _ unwrapper = (*afUpDownCounter)(nil) + _ metric.Float64ObservableUpDownCounter = (*afUpDownCounter)(nil) +) + +func (i *afUpDownCounter) setDelegate(m metric.Meter) { + ctr, err := m.Float64ObservableUpDownCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *afUpDownCounter) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Float64ObservableUpDownCounter) + } + return nil +} + +type afGauge struct { + embedded.Float64ObservableGauge + metric.Float64Observable + + name string + opts []metric.Float64ObservableGaugeOption + + delegate atomic.Value // metric.Float64ObservableGauge +} + +var ( + _ unwrapper = (*afGauge)(nil) + _ metric.Float64ObservableGauge = (*afGauge)(nil) +) + +func (i *afGauge) setDelegate(m metric.Meter) { + ctr, err := m.Float64ObservableGauge(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *afGauge) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Float64ObservableGauge) + } + return nil +} + +type aiCounter struct { + embedded.Int64ObservableCounter + metric.Int64Observable + + name string + opts []metric.Int64ObservableCounterOption + + delegate atomic.Value // metric.Int64ObservableCounter +} + +var ( + _ unwrapper = (*aiCounter)(nil) + _ metric.Int64ObservableCounter = (*aiCounter)(nil) +) + +func (i *aiCounter) setDelegate(m metric.Meter) { + ctr, err := m.Int64ObservableCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *aiCounter) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Int64ObservableCounter) + } + return nil +} + +type aiUpDownCounter struct { + embedded.Int64ObservableUpDownCounter + metric.Int64Observable + + name string + opts []metric.Int64ObservableUpDownCounterOption + + delegate atomic.Value // metric.Int64ObservableUpDownCounter +} + +var ( + _ unwrapper = (*aiUpDownCounter)(nil) + _ metric.Int64ObservableUpDownCounter = (*aiUpDownCounter)(nil) +) + +func (i *aiUpDownCounter) setDelegate(m metric.Meter) { + ctr, err := m.Int64ObservableUpDownCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *aiUpDownCounter) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Int64ObservableUpDownCounter) + } + return nil +} + +type aiGauge struct { + embedded.Int64ObservableGauge + metric.Int64Observable + + name string + opts []metric.Int64ObservableGaugeOption + + delegate atomic.Value // metric.Int64ObservableGauge +} + +var ( + _ unwrapper = (*aiGauge)(nil) + _ metric.Int64ObservableGauge = (*aiGauge)(nil) +) + +func (i *aiGauge) setDelegate(m metric.Meter) { + ctr, err := m.Int64ObservableGauge(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *aiGauge) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Int64ObservableGauge) + } + return nil +} + +// Sync Instruments. +type sfCounter struct { + embedded.Float64Counter + + name string + opts []metric.Float64CounterOption + + delegate atomic.Value // metric.Float64Counter +} + +var _ metric.Float64Counter = (*sfCounter)(nil) + +func (i *sfCounter) setDelegate(m metric.Meter) { + ctr, err := m.Float64Counter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *sfCounter) Add(ctx context.Context, incr float64, opts ...metric.AddOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Float64Counter).Add(ctx, incr, opts...) + } +} + +type sfUpDownCounter struct { + embedded.Float64UpDownCounter + + name string + opts []metric.Float64UpDownCounterOption + + delegate atomic.Value // metric.Float64UpDownCounter +} + +var _ metric.Float64UpDownCounter = (*sfUpDownCounter)(nil) + +func (i *sfUpDownCounter) setDelegate(m metric.Meter) { + ctr, err := m.Float64UpDownCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *sfUpDownCounter) Add(ctx context.Context, incr float64, opts ...metric.AddOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Float64UpDownCounter).Add(ctx, incr, opts...) + } +} + +type sfHistogram struct { + embedded.Float64Histogram + + name string + opts []metric.Float64HistogramOption + + delegate atomic.Value // metric.Float64Histogram +} + +var _ metric.Float64Histogram = (*sfHistogram)(nil) + +func (i *sfHistogram) setDelegate(m metric.Meter) { + ctr, err := m.Float64Histogram(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *sfHistogram) Record(ctx context.Context, x float64, opts ...metric.RecordOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Float64Histogram).Record(ctx, x, opts...) + } +} + +type siCounter struct { + embedded.Int64Counter + + name string + opts []metric.Int64CounterOption + + delegate atomic.Value // metric.Int64Counter +} + +var _ metric.Int64Counter = (*siCounter)(nil) + +func (i *siCounter) setDelegate(m metric.Meter) { + ctr, err := m.Int64Counter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *siCounter) Add(ctx context.Context, x int64, opts ...metric.AddOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Int64Counter).Add(ctx, x, opts...) + } +} + +type siUpDownCounter struct { + embedded.Int64UpDownCounter + + name string + opts []metric.Int64UpDownCounterOption + + delegate atomic.Value // metric.Int64UpDownCounter +} + +var _ metric.Int64UpDownCounter = (*siUpDownCounter)(nil) + +func (i *siUpDownCounter) setDelegate(m metric.Meter) { + ctr, err := m.Int64UpDownCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *siUpDownCounter) Add(ctx context.Context, x int64, opts ...metric.AddOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Int64UpDownCounter).Add(ctx, x, opts...) + } +} + +type siHistogram struct { + embedded.Int64Histogram + + name string + opts []metric.Int64HistogramOption + + delegate atomic.Value // metric.Int64Histogram +} + +var _ metric.Int64Histogram = (*siHistogram)(nil) + +func (i *siHistogram) setDelegate(m metric.Meter) { + ctr, err := m.Int64Histogram(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *siHistogram) Record(ctx context.Context, x int64, opts ...metric.RecordOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Int64Histogram).Record(ctx, x, opts...) + } +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go new file mode 100644 index 000000000..c6f305a2b --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go @@ -0,0 +1,69 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "log" + "os" + "sync/atomic" + + "github.com/go-logr/logr" + "github.com/go-logr/stdr" +) + +// globalLogger is the logging interface used within the otel api and sdk provide details of the internals. +// +// The default logger uses stdr which is backed by the standard `log.Logger` +// interface. This logger will only show messages at the Error Level. +var globalLogger atomic.Pointer[logr.Logger] + +func init() { + SetLogger(stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile))) +} + +// SetLogger overrides the globalLogger with l. +// +// To see Warn messages use a logger with `l.V(1).Enabled() == true` +// To see Info messages use a logger with `l.V(4).Enabled() == true` +// To see Debug messages use a logger with `l.V(8).Enabled() == true`. +func SetLogger(l logr.Logger) { + globalLogger.Store(&l) +} + +func getLogger() logr.Logger { + return *globalLogger.Load() +} + +// Info prints messages about the general state of the API or SDK. +// This should usually be less than 5 messages a minute. +func Info(msg string, keysAndValues ...interface{}) { + getLogger().V(4).Info(msg, keysAndValues...) +} + +// Error prints messages about exceptional states of the API or SDK. +func Error(err error, msg string, keysAndValues ...interface{}) { + getLogger().Error(err, msg, keysAndValues...) +} + +// Debug prints messages about all internal changes in the API or SDK. +func Debug(msg string, keysAndValues ...interface{}) { + getLogger().V(8).Info(msg, keysAndValues...) +} + +// Warn prints messages about warnings in the API or SDK. +// Not an error but is likely more important than an informational event. +func Warn(msg string, keysAndValues ...interface{}) { + getLogger().V(1).Info(msg, keysAndValues...) +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/meter.go b/vendor/go.opentelemetry.io/otel/internal/global/meter.go new file mode 100644 index 000000000..7ed61c0e2 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/meter.go @@ -0,0 +1,356 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "container/list" + "sync" + "sync/atomic" + + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/embedded" +) + +// meterProvider is a placeholder for a configured SDK MeterProvider. +// +// All MeterProvider functionality is forwarded to a delegate once +// configured. +type meterProvider struct { + embedded.MeterProvider + + mtx sync.Mutex + meters map[il]*meter + + delegate metric.MeterProvider +} + +// setDelegate configures p to delegate all MeterProvider functionality to +// provider. +// +// All Meters provided prior to this function call are switched out to be +// Meters provided by provider. All instruments and callbacks are recreated and +// delegated. +// +// It is guaranteed by the caller that this happens only once. +func (p *meterProvider) setDelegate(provider metric.MeterProvider) { + p.mtx.Lock() + defer p.mtx.Unlock() + + p.delegate = provider + + if len(p.meters) == 0 { + return + } + + for _, meter := range p.meters { + meter.setDelegate(provider) + } + + p.meters = nil +} + +// Meter implements MeterProvider. +func (p *meterProvider) Meter(name string, opts ...metric.MeterOption) metric.Meter { + p.mtx.Lock() + defer p.mtx.Unlock() + + if p.delegate != nil { + return p.delegate.Meter(name, opts...) + } + + // At this moment it is guaranteed that no sdk is installed, save the meter in the meters map. + + c := metric.NewMeterConfig(opts...) + key := il{ + name: name, + version: c.InstrumentationVersion(), + } + + if p.meters == nil { + p.meters = make(map[il]*meter) + } + + if val, ok := p.meters[key]; ok { + return val + } + + t := &meter{name: name, opts: opts} + p.meters[key] = t + return t +} + +// meter is a placeholder for a metric.Meter. +// +// All Meter functionality is forwarded to a delegate once configured. +// Otherwise, all functionality is forwarded to a NoopMeter. +type meter struct { + embedded.Meter + + name string + opts []metric.MeterOption + + mtx sync.Mutex + instruments []delegatedInstrument + + registry list.List + + delegate atomic.Value // metric.Meter +} + +type delegatedInstrument interface { + setDelegate(metric.Meter) +} + +// setDelegate configures m to delegate all Meter functionality to Meters +// created by provider. +// +// All subsequent calls to the Meter methods will be passed to the delegate. +// +// It is guaranteed by the caller that this happens only once. +func (m *meter) setDelegate(provider metric.MeterProvider) { + meter := provider.Meter(m.name, m.opts...) + m.delegate.Store(meter) + + m.mtx.Lock() + defer m.mtx.Unlock() + + for _, inst := range m.instruments { + inst.setDelegate(meter) + } + + var n *list.Element + for e := m.registry.Front(); e != nil; e = n { + r := e.Value.(*registration) + r.setDelegate(meter) + n = e.Next() + m.registry.Remove(e) + } + + m.instruments = nil + m.registry.Init() +} + +func (m *meter) Int64Counter(name string, options ...metric.Int64CounterOption) (metric.Int64Counter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64Counter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &siCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Int64UpDownCounter(name string, options ...metric.Int64UpDownCounterOption) (metric.Int64UpDownCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64UpDownCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &siUpDownCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Int64Histogram(name string, options ...metric.Int64HistogramOption) (metric.Int64Histogram, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64Histogram(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &siHistogram{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Int64ObservableCounter(name string, options ...metric.Int64ObservableCounterOption) (metric.Int64ObservableCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64ObservableCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &aiCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Int64ObservableUpDownCounter(name string, options ...metric.Int64ObservableUpDownCounterOption) (metric.Int64ObservableUpDownCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64ObservableUpDownCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &aiUpDownCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Int64ObservableGauge(name string, options ...metric.Int64ObservableGaugeOption) (metric.Int64ObservableGauge, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64ObservableGauge(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &aiGauge{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64Counter(name string, options ...metric.Float64CounterOption) (metric.Float64Counter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64Counter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &sfCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64UpDownCounter(name string, options ...metric.Float64UpDownCounterOption) (metric.Float64UpDownCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64UpDownCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &sfUpDownCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64Histogram(name string, options ...metric.Float64HistogramOption) (metric.Float64Histogram, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64Histogram(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &sfHistogram{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64ObservableCounter(name string, options ...metric.Float64ObservableCounterOption) (metric.Float64ObservableCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64ObservableCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &afCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64ObservableUpDownCounter(name string, options ...metric.Float64ObservableUpDownCounterOption) (metric.Float64ObservableUpDownCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64ObservableUpDownCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &afUpDownCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64ObservableGauge(name string, options ...metric.Float64ObservableGaugeOption) (metric.Float64ObservableGauge, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64ObservableGauge(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &afGauge{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +// RegisterCallback captures the function that will be called during Collect. +func (m *meter) RegisterCallback(f metric.Callback, insts ...metric.Observable) (metric.Registration, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + insts = unwrapInstruments(insts) + return del.RegisterCallback(f, insts...) + } + + m.mtx.Lock() + defer m.mtx.Unlock() + + reg := ®istration{instruments: insts, function: f} + e := m.registry.PushBack(reg) + reg.unreg = func() error { + m.mtx.Lock() + _ = m.registry.Remove(e) + m.mtx.Unlock() + return nil + } + return reg, nil +} + +type wrapped interface { + unwrap() metric.Observable +} + +func unwrapInstruments(instruments []metric.Observable) []metric.Observable { + out := make([]metric.Observable, 0, len(instruments)) + + for _, inst := range instruments { + if in, ok := inst.(wrapped); ok { + out = append(out, in.unwrap()) + } else { + out = append(out, inst) + } + } + + return out +} + +type registration struct { + embedded.Registration + + instruments []metric.Observable + function metric.Callback + + unreg func() error + unregMu sync.Mutex +} + +func (c *registration) setDelegate(m metric.Meter) { + insts := unwrapInstruments(c.instruments) + + c.unregMu.Lock() + defer c.unregMu.Unlock() + + if c.unreg == nil { + // Unregister already called. + return + } + + reg, err := m.RegisterCallback(c.function, insts...) + if err != nil { + GetErrorHandler().Handle(err) + } + + c.unreg = reg.Unregister +} + +func (c *registration) Unregister() error { + c.unregMu.Lock() + defer c.unregMu.Unlock() + if c.unreg == nil { + // Unregister already called. + return nil + } + + var err error + err, c.unreg = c.unreg(), nil + return err +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/propagator.go b/vendor/go.opentelemetry.io/otel/internal/global/propagator.go new file mode 100644 index 000000000..06bac35c2 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/propagator.go @@ -0,0 +1,82 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "context" + "sync" + + "go.opentelemetry.io/otel/propagation" +) + +// textMapPropagator is a default TextMapPropagator that delegates calls to a +// registered delegate if one is set, otherwise it defaults to delegating the +// calls to a the default no-op propagation.TextMapPropagator. +type textMapPropagator struct { + mtx sync.Mutex + once sync.Once + delegate propagation.TextMapPropagator + noop propagation.TextMapPropagator +} + +// Compile-time guarantee that textMapPropagator implements the +// propagation.TextMapPropagator interface. +var _ propagation.TextMapPropagator = (*textMapPropagator)(nil) + +func newTextMapPropagator() *textMapPropagator { + return &textMapPropagator{ + noop: propagation.NewCompositeTextMapPropagator(), + } +} + +// SetDelegate sets a delegate propagation.TextMapPropagator that all calls are +// forwarded to. Delegation can only be performed once, all subsequent calls +// perform no delegation. +func (p *textMapPropagator) SetDelegate(delegate propagation.TextMapPropagator) { + if delegate == nil { + return + } + + p.mtx.Lock() + p.once.Do(func() { p.delegate = delegate }) + p.mtx.Unlock() +} + +// effectiveDelegate returns the current delegate of p if one is set, +// otherwise the default noop TextMapPropagator is returned. This method +// can be called concurrently. +func (p *textMapPropagator) effectiveDelegate() propagation.TextMapPropagator { + p.mtx.Lock() + defer p.mtx.Unlock() + if p.delegate != nil { + return p.delegate + } + return p.noop +} + +// Inject set cross-cutting concerns from the Context into the carrier. +func (p *textMapPropagator) Inject(ctx context.Context, carrier propagation.TextMapCarrier) { + p.effectiveDelegate().Inject(ctx, carrier) +} + +// Extract reads cross-cutting concerns from the carrier into a Context. +func (p *textMapPropagator) Extract(ctx context.Context, carrier propagation.TextMapCarrier) context.Context { + return p.effectiveDelegate().Extract(ctx, carrier) +} + +// Fields returns the keys whose values are set with Inject. +func (p *textMapPropagator) Fields() []string { + return p.effectiveDelegate().Fields() +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/state.go b/vendor/go.opentelemetry.io/otel/internal/global/state.go new file mode 100644 index 000000000..386c8bfdc --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/state.go @@ -0,0 +1,156 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "errors" + "sync" + "sync/atomic" + + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/propagation" + "go.opentelemetry.io/otel/trace" +) + +type ( + tracerProviderHolder struct { + tp trace.TracerProvider + } + + propagatorsHolder struct { + tm propagation.TextMapPropagator + } + + meterProviderHolder struct { + mp metric.MeterProvider + } +) + +var ( + globalTracer = defaultTracerValue() + globalPropagators = defaultPropagatorsValue() + globalMeterProvider = defaultMeterProvider() + + delegateTraceOnce sync.Once + delegateTextMapPropagatorOnce sync.Once + delegateMeterOnce sync.Once +) + +// TracerProvider is the internal implementation for global.TracerProvider. +func TracerProvider() trace.TracerProvider { + return globalTracer.Load().(tracerProviderHolder).tp +} + +// SetTracerProvider is the internal implementation for global.SetTracerProvider. +func SetTracerProvider(tp trace.TracerProvider) { + current := TracerProvider() + + if _, cOk := current.(*tracerProvider); cOk { + if _, tpOk := tp.(*tracerProvider); tpOk && current == tp { + // Do not assign the default delegating TracerProvider to delegate + // to itself. + Error( + errors.New("no delegate configured in tracer provider"), + "Setting tracer provider to its current value. No delegate will be configured", + ) + return + } + } + + delegateTraceOnce.Do(func() { + if def, ok := current.(*tracerProvider); ok { + def.setDelegate(tp) + } + }) + globalTracer.Store(tracerProviderHolder{tp: tp}) +} + +// TextMapPropagator is the internal implementation for global.TextMapPropagator. +func TextMapPropagator() propagation.TextMapPropagator { + return globalPropagators.Load().(propagatorsHolder).tm +} + +// SetTextMapPropagator is the internal implementation for global.SetTextMapPropagator. +func SetTextMapPropagator(p propagation.TextMapPropagator) { + current := TextMapPropagator() + + if _, cOk := current.(*textMapPropagator); cOk { + if _, pOk := p.(*textMapPropagator); pOk && current == p { + // Do not assign the default delegating TextMapPropagator to + // delegate to itself. + Error( + errors.New("no delegate configured in text map propagator"), + "Setting text map propagator to its current value. No delegate will be configured", + ) + return + } + } + + // For the textMapPropagator already returned by TextMapPropagator + // delegate to p. + delegateTextMapPropagatorOnce.Do(func() { + if def, ok := current.(*textMapPropagator); ok { + def.SetDelegate(p) + } + }) + // Return p when subsequent calls to TextMapPropagator are made. + globalPropagators.Store(propagatorsHolder{tm: p}) +} + +// MeterProvider is the internal implementation for global.MeterProvider. +func MeterProvider() metric.MeterProvider { + return globalMeterProvider.Load().(meterProviderHolder).mp +} + +// SetMeterProvider is the internal implementation for global.SetMeterProvider. +func SetMeterProvider(mp metric.MeterProvider) { + current := MeterProvider() + if _, cOk := current.(*meterProvider); cOk { + if _, mpOk := mp.(*meterProvider); mpOk && current == mp { + // Do not assign the default delegating MeterProvider to delegate + // to itself. + Error( + errors.New("no delegate configured in meter provider"), + "Setting meter provider to its current value. No delegate will be configured", + ) + return + } + } + + delegateMeterOnce.Do(func() { + if def, ok := current.(*meterProvider); ok { + def.setDelegate(mp) + } + }) + globalMeterProvider.Store(meterProviderHolder{mp: mp}) +} + +func defaultTracerValue() *atomic.Value { + v := &atomic.Value{} + v.Store(tracerProviderHolder{tp: &tracerProvider{}}) + return v +} + +func defaultPropagatorsValue() *atomic.Value { + v := &atomic.Value{} + v.Store(propagatorsHolder{tm: newTextMapPropagator()}) + return v +} + +func defaultMeterProvider() *atomic.Value { + v := &atomic.Value{} + v.Store(meterProviderHolder{mp: &meterProvider{}}) + return v +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/trace.go b/vendor/go.opentelemetry.io/otel/internal/global/trace.go new file mode 100644 index 000000000..3f61ec12a --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/trace.go @@ -0,0 +1,199 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package global // import "go.opentelemetry.io/otel/internal/global" + +/* +This file contains the forwarding implementation of the TracerProvider used as +the default global instance. Prior to initialization of an SDK, Tracers +returned by the global TracerProvider will provide no-op functionality. This +means that all Span created prior to initialization are no-op Spans. + +Once an SDK has been initialized, all provided no-op Tracers are swapped for +Tracers provided by the SDK defined TracerProvider. However, any Span started +prior to this initialization does not change its behavior. Meaning, the Span +remains a no-op Span. + +The implementation to track and swap Tracers locks all new Tracer creation +until the swap is complete. This assumes that this operation is not +performance-critical. If that assumption is incorrect, be sure to configure an +SDK prior to any Tracer creation. +*/ + +import ( + "context" + "sync" + "sync/atomic" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/trace" + "go.opentelemetry.io/otel/trace/embedded" +) + +// tracerProvider is a placeholder for a configured SDK TracerProvider. +// +// All TracerProvider functionality is forwarded to a delegate once +// configured. +type tracerProvider struct { + embedded.TracerProvider + + mtx sync.Mutex + tracers map[il]*tracer + delegate trace.TracerProvider +} + +// Compile-time guarantee that tracerProvider implements the TracerProvider +// interface. +var _ trace.TracerProvider = &tracerProvider{} + +// setDelegate configures p to delegate all TracerProvider functionality to +// provider. +// +// All Tracers provided prior to this function call are switched out to be +// Tracers provided by provider. +// +// It is guaranteed by the caller that this happens only once. +func (p *tracerProvider) setDelegate(provider trace.TracerProvider) { + p.mtx.Lock() + defer p.mtx.Unlock() + + p.delegate = provider + + if len(p.tracers) == 0 { + return + } + + for _, t := range p.tracers { + t.setDelegate(provider) + } + + p.tracers = nil +} + +// Tracer implements TracerProvider. +func (p *tracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.Tracer { + p.mtx.Lock() + defer p.mtx.Unlock() + + if p.delegate != nil { + return p.delegate.Tracer(name, opts...) + } + + // At this moment it is guaranteed that no sdk is installed, save the tracer in the tracers map. + + c := trace.NewTracerConfig(opts...) + key := il{ + name: name, + version: c.InstrumentationVersion(), + } + + if p.tracers == nil { + p.tracers = make(map[il]*tracer) + } + + if val, ok := p.tracers[key]; ok { + return val + } + + t := &tracer{name: name, opts: opts, provider: p} + p.tracers[key] = t + return t +} + +type il struct { + name string + version string +} + +// tracer is a placeholder for a trace.Tracer. +// +// All Tracer functionality is forwarded to a delegate once configured. +// Otherwise, all functionality is forwarded to a NoopTracer. +type tracer struct { + embedded.Tracer + + name string + opts []trace.TracerOption + provider *tracerProvider + + delegate atomic.Value +} + +// Compile-time guarantee that tracer implements the trace.Tracer interface. +var _ trace.Tracer = &tracer{} + +// setDelegate configures t to delegate all Tracer functionality to Tracers +// created by provider. +// +// All subsequent calls to the Tracer methods will be passed to the delegate. +// +// It is guaranteed by the caller that this happens only once. +func (t *tracer) setDelegate(provider trace.TracerProvider) { + t.delegate.Store(provider.Tracer(t.name, t.opts...)) +} + +// Start implements trace.Tracer by forwarding the call to t.delegate if +// set, otherwise it forwards the call to a NoopTracer. +func (t *tracer) Start(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span) { + delegate := t.delegate.Load() + if delegate != nil { + return delegate.(trace.Tracer).Start(ctx, name, opts...) + } + + s := nonRecordingSpan{sc: trace.SpanContextFromContext(ctx), tracer: t} + ctx = trace.ContextWithSpan(ctx, s) + return ctx, s +} + +// nonRecordingSpan is a minimal implementation of a Span that wraps a +// SpanContext. It performs no operations other than to return the wrapped +// SpanContext. +type nonRecordingSpan struct { + embedded.Span + + sc trace.SpanContext + tracer *tracer +} + +var _ trace.Span = nonRecordingSpan{} + +// SpanContext returns the wrapped SpanContext. +func (s nonRecordingSpan) SpanContext() trace.SpanContext { return s.sc } + +// IsRecording always returns false. +func (nonRecordingSpan) IsRecording() bool { return false } + +// SetStatus does nothing. +func (nonRecordingSpan) SetStatus(codes.Code, string) {} + +// SetError does nothing. +func (nonRecordingSpan) SetError(bool) {} + +// SetAttributes does nothing. +func (nonRecordingSpan) SetAttributes(...attribute.KeyValue) {} + +// End does nothing. +func (nonRecordingSpan) End(...trace.SpanEndOption) {} + +// RecordError does nothing. +func (nonRecordingSpan) RecordError(error, ...trace.EventOption) {} + +// AddEvent does nothing. +func (nonRecordingSpan) AddEvent(string, ...trace.EventOption) {} + +// SetName does nothing. +func (nonRecordingSpan) SetName(string) {} + +func (s nonRecordingSpan) TracerProvider() trace.TracerProvider { return s.tracer.provider } diff --git a/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go b/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go new file mode 100644 index 000000000..e07e79400 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go @@ -0,0 +1,55 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package internal // import "go.opentelemetry.io/otel/internal" + +import ( + "math" + "unsafe" +) + +func BoolToRaw(b bool) uint64 { // nolint:revive // b is not a control flag. + if b { + return 1 + } + return 0 +} + +func RawToBool(r uint64) bool { + return r != 0 +} + +func Int64ToRaw(i int64) uint64 { + return uint64(i) +} + +func RawToInt64(r uint64) int64 { + return int64(r) +} + +func Float64ToRaw(f float64) uint64 { + return math.Float64bits(f) +} + +func RawToFloat64(r uint64) float64 { + return math.Float64frombits(r) +} + +func RawPtrToFloat64Ptr(r *uint64) *float64 { + return (*float64)(unsafe.Pointer(r)) +} + +func RawPtrToInt64Ptr(r *uint64) *int64 { + return (*int64)(unsafe.Pointer(r)) +} diff --git a/vendor/go.opentelemetry.io/otel/internal_logging.go b/vendor/go.opentelemetry.io/otel/internal_logging.go new file mode 100644 index 000000000..c4f8acd5d --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal_logging.go @@ -0,0 +1,26 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otel // import "go.opentelemetry.io/otel" + +import ( + "github.com/go-logr/logr" + + "go.opentelemetry.io/otel/internal/global" +) + +// SetLogger configures the logger used internally to opentelemetry. +func SetLogger(logger logr.Logger) { + global.SetLogger(logger) +} diff --git a/vendor/go.opentelemetry.io/otel/metric.go b/vendor/go.opentelemetry.io/otel/metric.go new file mode 100644 index 000000000..f95517195 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric.go @@ -0,0 +1,53 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otel // import "go.opentelemetry.io/otel" + +import ( + "go.opentelemetry.io/otel/internal/global" + "go.opentelemetry.io/otel/metric" +) + +// Meter returns a Meter from the global MeterProvider. The name must be the +// name of the library providing instrumentation. This name may be the same as +// the instrumented code only if that code provides built-in instrumentation. +// If the name is empty, then a implementation defined default name will be +// used instead. +// +// If this is called before a global MeterProvider is registered the returned +// Meter will be a No-op implementation of a Meter. When a global MeterProvider +// is registered for the first time, the returned Meter, and all the +// instruments it has created or will create, are recreated automatically from +// the new MeterProvider. +// +// This is short for GetMeterProvider().Meter(name). +func Meter(name string, opts ...metric.MeterOption) metric.Meter { + return GetMeterProvider().Meter(name, opts...) +} + +// GetMeterProvider returns the registered global meter provider. +// +// If no global GetMeterProvider has been registered, a No-op GetMeterProvider +// implementation is returned. When a global GetMeterProvider is registered for +// the first time, the returned GetMeterProvider, and all the Meters it has +// created or will create, are recreated automatically from the new +// GetMeterProvider. +func GetMeterProvider() metric.MeterProvider { + return global.MeterProvider() +} + +// SetMeterProvider registers mp as the global MeterProvider. +func SetMeterProvider(mp metric.MeterProvider) { + global.SetMeterProvider(mp) +} diff --git a/vendor/go.opentelemetry.io/otel/metric/LICENSE b/vendor/go.opentelemetry.io/otel/metric/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go new file mode 100644 index 000000000..072baa8e8 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go @@ -0,0 +1,271 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/metric/embedded" +) + +// Float64Observable describes a set of instruments used asynchronously to +// record float64 measurements once per collection cycle. Observations of +// these instruments are only made within a callback. +// +// Warning: Methods may be added to this interface in minor releases. +type Float64Observable interface { + Observable + + float64Observable() +} + +// Float64ObservableCounter is an instrument used to asynchronously record +// increasing float64 measurements once per collection cycle. Observations are +// only made within a callback for this instrument. The value observed is +// assumed the to be the cumulative sum of the count. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for +// unimplemented methods. +type Float64ObservableCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64ObservableCounter + + Float64Observable +} + +// Float64ObservableCounterConfig contains options for asynchronous counter +// instruments that record int64 values. +type Float64ObservableCounterConfig struct { + description string + unit string + callbacks []Float64Callback +} + +// NewFloat64ObservableCounterConfig returns a new +// [Float64ObservableCounterConfig] with all opts applied. +func NewFloat64ObservableCounterConfig(opts ...Float64ObservableCounterOption) Float64ObservableCounterConfig { + var config Float64ObservableCounterConfig + for _, o := range opts { + config = o.applyFloat64ObservableCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Float64ObservableCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64ObservableCounterConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Float64ObservableCounterConfig) Callbacks() []Float64Callback { + return c.callbacks +} + +// Float64ObservableCounterOption applies options to a +// [Float64ObservableCounterConfig]. See [Float64ObservableOption] and +// [InstrumentOption] for other options that can be used as a +// Float64ObservableCounterOption. +type Float64ObservableCounterOption interface { + applyFloat64ObservableCounter(Float64ObservableCounterConfig) Float64ObservableCounterConfig +} + +// Float64ObservableUpDownCounter is an instrument used to asynchronously +// record float64 measurements once per collection cycle. Observations are only +// made within a callback for this instrument. The value observed is assumed +// the to be the cumulative sum of the count. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64ObservableUpDownCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64ObservableUpDownCounter + + Float64Observable +} + +// Float64ObservableUpDownCounterConfig contains options for asynchronous +// counter instruments that record int64 values. +type Float64ObservableUpDownCounterConfig struct { + description string + unit string + callbacks []Float64Callback +} + +// NewFloat64ObservableUpDownCounterConfig returns a new +// [Float64ObservableUpDownCounterConfig] with all opts applied. +func NewFloat64ObservableUpDownCounterConfig(opts ...Float64ObservableUpDownCounterOption) Float64ObservableUpDownCounterConfig { + var config Float64ObservableUpDownCounterConfig + for _, o := range opts { + config = o.applyFloat64ObservableUpDownCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Float64ObservableUpDownCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64ObservableUpDownCounterConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Float64ObservableUpDownCounterConfig) Callbacks() []Float64Callback { + return c.callbacks +} + +// Float64ObservableUpDownCounterOption applies options to a +// [Float64ObservableUpDownCounterConfig]. See [Float64ObservableOption] and +// [InstrumentOption] for other options that can be used as a +// Float64ObservableUpDownCounterOption. +type Float64ObservableUpDownCounterOption interface { + applyFloat64ObservableUpDownCounter(Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig +} + +// Float64ObservableGauge is an instrument used to asynchronously record +// instantaneous float64 measurements once per collection cycle. Observations +// are only made within a callback for this instrument. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64ObservableGauge interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64ObservableGauge + + Float64Observable +} + +// Float64ObservableGaugeConfig contains options for asynchronous counter +// instruments that record int64 values. +type Float64ObservableGaugeConfig struct { + description string + unit string + callbacks []Float64Callback +} + +// NewFloat64ObservableGaugeConfig returns a new [Float64ObservableGaugeConfig] +// with all opts applied. +func NewFloat64ObservableGaugeConfig(opts ...Float64ObservableGaugeOption) Float64ObservableGaugeConfig { + var config Float64ObservableGaugeConfig + for _, o := range opts { + config = o.applyFloat64ObservableGauge(config) + } + return config +} + +// Description returns the configured description. +func (c Float64ObservableGaugeConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64ObservableGaugeConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Float64ObservableGaugeConfig) Callbacks() []Float64Callback { + return c.callbacks +} + +// Float64ObservableGaugeOption applies options to a +// [Float64ObservableGaugeConfig]. See [Float64ObservableOption] and +// [InstrumentOption] for other options that can be used as a +// Float64ObservableGaugeOption. +type Float64ObservableGaugeOption interface { + applyFloat64ObservableGauge(Float64ObservableGaugeConfig) Float64ObservableGaugeConfig +} + +// Float64Observer is a recorder of float64 measurements. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64Observer interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64Observer + + // Observe records the float64 value. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Observe(value float64, options ...ObserveOption) +} + +// Float64Callback is a function registered with a Meter that makes +// observations for a Float64Observerable instrument it is registered with. +// Calls to the Float64Observer record measurement values for the +// Float64Observable. +// +// The function needs to complete in a finite amount of time and the deadline +// of the passed context is expected to be honored. +// +// The function needs to make unique observations across all registered +// Float64Callbacks. Meaning, it should not report measurements with the same +// attributes as another Float64Callbacks also registered for the same +// instrument. +// +// The function needs to be concurrent safe. +type Float64Callback func(context.Context, Float64Observer) error + +// Float64ObservableOption applies options to float64 Observer instruments. +type Float64ObservableOption interface { + Float64ObservableCounterOption + Float64ObservableUpDownCounterOption + Float64ObservableGaugeOption +} + +type float64CallbackOpt struct { + cback Float64Callback +} + +func (o float64CallbackOpt) applyFloat64ObservableCounter(cfg Float64ObservableCounterConfig) Float64ObservableCounterConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +func (o float64CallbackOpt) applyFloat64ObservableUpDownCounter(cfg Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +func (o float64CallbackOpt) applyFloat64ObservableGauge(cfg Float64ObservableGaugeConfig) Float64ObservableGaugeConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +// WithFloat64Callback adds callback to be called for an instrument. +func WithFloat64Callback(callback Float64Callback) Float64ObservableOption { + return float64CallbackOpt{callback} +} diff --git a/vendor/go.opentelemetry.io/otel/metric/asyncint64.go b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go new file mode 100644 index 000000000..9bd6ebf02 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go @@ -0,0 +1,269 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/metric/embedded" +) + +// Int64Observable describes a set of instruments used asynchronously to record +// int64 measurements once per collection cycle. Observations of these +// instruments are only made within a callback. +// +// Warning: Methods may be added to this interface in minor releases. +type Int64Observable interface { + Observable + + int64Observable() +} + +// Int64ObservableCounter is an instrument used to asynchronously record +// increasing int64 measurements once per collection cycle. Observations are +// only made within a callback for this instrument. The value observed is +// assumed the to be the cumulative sum of the count. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64ObservableCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64ObservableCounter + + Int64Observable +} + +// Int64ObservableCounterConfig contains options for asynchronous counter +// instruments that record int64 values. +type Int64ObservableCounterConfig struct { + description string + unit string + callbacks []Int64Callback +} + +// NewInt64ObservableCounterConfig returns a new [Int64ObservableCounterConfig] +// with all opts applied. +func NewInt64ObservableCounterConfig(opts ...Int64ObservableCounterOption) Int64ObservableCounterConfig { + var config Int64ObservableCounterConfig + for _, o := range opts { + config = o.applyInt64ObservableCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Int64ObservableCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64ObservableCounterConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Int64ObservableCounterConfig) Callbacks() []Int64Callback { + return c.callbacks +} + +// Int64ObservableCounterOption applies options to a +// [Int64ObservableCounterConfig]. See [Int64ObservableOption] and +// [InstrumentOption] for other options that can be used as an +// Int64ObservableCounterOption. +type Int64ObservableCounterOption interface { + applyInt64ObservableCounter(Int64ObservableCounterConfig) Int64ObservableCounterConfig +} + +// Int64ObservableUpDownCounter is an instrument used to asynchronously record +// int64 measurements once per collection cycle. Observations are only made +// within a callback for this instrument. The value observed is assumed the to +// be the cumulative sum of the count. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64ObservableUpDownCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64ObservableUpDownCounter + + Int64Observable +} + +// Int64ObservableUpDownCounterConfig contains options for asynchronous counter +// instruments that record int64 values. +type Int64ObservableUpDownCounterConfig struct { + description string + unit string + callbacks []Int64Callback +} + +// NewInt64ObservableUpDownCounterConfig returns a new +// [Int64ObservableUpDownCounterConfig] with all opts applied. +func NewInt64ObservableUpDownCounterConfig(opts ...Int64ObservableUpDownCounterOption) Int64ObservableUpDownCounterConfig { + var config Int64ObservableUpDownCounterConfig + for _, o := range opts { + config = o.applyInt64ObservableUpDownCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Int64ObservableUpDownCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64ObservableUpDownCounterConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Int64ObservableUpDownCounterConfig) Callbacks() []Int64Callback { + return c.callbacks +} + +// Int64ObservableUpDownCounterOption applies options to a +// [Int64ObservableUpDownCounterConfig]. See [Int64ObservableOption] and +// [InstrumentOption] for other options that can be used as an +// Int64ObservableUpDownCounterOption. +type Int64ObservableUpDownCounterOption interface { + applyInt64ObservableUpDownCounter(Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig +} + +// Int64ObservableGauge is an instrument used to asynchronously record +// instantaneous int64 measurements once per collection cycle. Observations are +// only made within a callback for this instrument. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64ObservableGauge interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64ObservableGauge + + Int64Observable +} + +// Int64ObservableGaugeConfig contains options for asynchronous counter +// instruments that record int64 values. +type Int64ObservableGaugeConfig struct { + description string + unit string + callbacks []Int64Callback +} + +// NewInt64ObservableGaugeConfig returns a new [Int64ObservableGaugeConfig] +// with all opts applied. +func NewInt64ObservableGaugeConfig(opts ...Int64ObservableGaugeOption) Int64ObservableGaugeConfig { + var config Int64ObservableGaugeConfig + for _, o := range opts { + config = o.applyInt64ObservableGauge(config) + } + return config +} + +// Description returns the configured description. +func (c Int64ObservableGaugeConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64ObservableGaugeConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Int64ObservableGaugeConfig) Callbacks() []Int64Callback { + return c.callbacks +} + +// Int64ObservableGaugeOption applies options to a +// [Int64ObservableGaugeConfig]. See [Int64ObservableOption] and +// [InstrumentOption] for other options that can be used as an +// Int64ObservableGaugeOption. +type Int64ObservableGaugeOption interface { + applyInt64ObservableGauge(Int64ObservableGaugeConfig) Int64ObservableGaugeConfig +} + +// Int64Observer is a recorder of int64 measurements. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64Observer interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64Observer + + // Observe records the int64 value. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Observe(value int64, options ...ObserveOption) +} + +// Int64Callback is a function registered with a Meter that makes observations +// for an Int64Observerable instrument it is registered with. Calls to the +// Int64Observer record measurement values for the Int64Observable. +// +// The function needs to complete in a finite amount of time and the deadline +// of the passed context is expected to be honored. +// +// The function needs to make unique observations across all registered +// Int64Callbacks. Meaning, it should not report measurements with the same +// attributes as another Int64Callbacks also registered for the same +// instrument. +// +// The function needs to be concurrent safe. +type Int64Callback func(context.Context, Int64Observer) error + +// Int64ObservableOption applies options to int64 Observer instruments. +type Int64ObservableOption interface { + Int64ObservableCounterOption + Int64ObservableUpDownCounterOption + Int64ObservableGaugeOption +} + +type int64CallbackOpt struct { + cback Int64Callback +} + +func (o int64CallbackOpt) applyInt64ObservableCounter(cfg Int64ObservableCounterConfig) Int64ObservableCounterConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +func (o int64CallbackOpt) applyInt64ObservableUpDownCounter(cfg Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +func (o int64CallbackOpt) applyInt64ObservableGauge(cfg Int64ObservableGaugeConfig) Int64ObservableGaugeConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +// WithInt64Callback adds callback to be called for an instrument. +func WithInt64Callback(callback Int64Callback) Int64ObservableOption { + return int64CallbackOpt{callback} +} diff --git a/vendor/go.opentelemetry.io/otel/metric/config.go b/vendor/go.opentelemetry.io/otel/metric/config.go new file mode 100644 index 000000000..778ad2d74 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/config.go @@ -0,0 +1,92 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import "go.opentelemetry.io/otel/attribute" + +// MeterConfig contains options for Meters. +type MeterConfig struct { + instrumentationVersion string + schemaURL string + attrs attribute.Set + + // Ensure forward compatibility by explicitly making this not comparable. + noCmp [0]func() //nolint: unused // This is indeed used. +} + +// InstrumentationVersion returns the version of the library providing +// instrumentation. +func (cfg MeterConfig) InstrumentationVersion() string { + return cfg.instrumentationVersion +} + +// InstrumentationAttributes returns the attributes associated with the library +// providing instrumentation. +func (cfg MeterConfig) InstrumentationAttributes() attribute.Set { + return cfg.attrs +} + +// SchemaURL is the schema_url of the library providing instrumentation. +func (cfg MeterConfig) SchemaURL() string { + return cfg.schemaURL +} + +// MeterOption is an interface for applying Meter options. +type MeterOption interface { + // applyMeter is used to set a MeterOption value of a MeterConfig. + applyMeter(MeterConfig) MeterConfig +} + +// NewMeterConfig creates a new MeterConfig and applies +// all the given options. +func NewMeterConfig(opts ...MeterOption) MeterConfig { + var config MeterConfig + for _, o := range opts { + config = o.applyMeter(config) + } + return config +} + +type meterOptionFunc func(MeterConfig) MeterConfig + +func (fn meterOptionFunc) applyMeter(cfg MeterConfig) MeterConfig { + return fn(cfg) +} + +// WithInstrumentationVersion sets the instrumentation version. +func WithInstrumentationVersion(version string) MeterOption { + return meterOptionFunc(func(config MeterConfig) MeterConfig { + config.instrumentationVersion = version + return config + }) +} + +// WithInstrumentationAttributes sets the instrumentation attributes. +// +// The passed attributes will be de-duplicated. +func WithInstrumentationAttributes(attr ...attribute.KeyValue) MeterOption { + return meterOptionFunc(func(config MeterConfig) MeterConfig { + config.attrs = attribute.NewSet(attr...) + return config + }) +} + +// WithSchemaURL sets the schema URL. +func WithSchemaURL(schemaURL string) MeterOption { + return meterOptionFunc(func(config MeterConfig) MeterConfig { + config.schemaURL = schemaURL + return config + }) +} diff --git a/vendor/go.opentelemetry.io/otel/metric/doc.go b/vendor/go.opentelemetry.io/otel/metric/doc.go new file mode 100644 index 000000000..54716e13b --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/doc.go @@ -0,0 +1,170 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package metric provides the OpenTelemetry API used to measure metrics about +source code operation. + +This API is separate from its implementation so the instrumentation built from +it is reusable. See [go.opentelemetry.io/otel/sdk/metric] for the official +OpenTelemetry implementation of this API. + +All measurements made with this package are made via instruments. These +instruments are created by a [Meter] which itself is created by a +[MeterProvider]. Applications need to accept a [MeterProvider] implementation +as a starting point when instrumenting. This can be done directly, or by using +the OpenTelemetry global MeterProvider via [GetMeterProvider]. Using an +appropriately named [Meter] from the accepted [MeterProvider], instrumentation +can then be built from the [Meter]'s instruments. + +# Instruments + +Each instrument is designed to make measurements of a particular type. Broadly, +all instruments fall into two overlapping logical categories: asynchronous or +synchronous, and int64 or float64. + +All synchronous instruments ([Int64Counter], [Int64UpDownCounter], +[Int64Histogram], [Float64Counter], [Float64UpDownCounter], and +[Float64Histogram]) are used to measure the operation and performance of source +code during the source code execution. These instruments only make measurements +when the source code they instrument is run. + +All asynchronous instruments ([Int64ObservableCounter], +[Int64ObservableUpDownCounter], [Int64ObservableGauge], +[Float64ObservableCounter], [Float64ObservableUpDownCounter], and +[Float64ObservableGauge]) are used to measure metrics outside of the execution +of source code. They are said to make "observations" via a callback function +called once every measurement collection cycle. + +Each instrument is also grouped by the value type it measures. Either int64 or +float64. The value being measured will dictate which instrument in these +categories to use. + +Outside of these two broad categories, instruments are described by the +function they are designed to serve. All Counters ([Int64Counter], +[Float64Counter], [Int64ObservableCounter], and [Float64ObservableCounter]) are +designed to measure values that never decrease in value, but instead only +incrementally increase in value. UpDownCounters ([Int64UpDownCounter], +[Float64UpDownCounter], [Int64ObservableUpDownCounter], and +[Float64ObservableUpDownCounter]) on the other hand, are designed to measure +values that can increase and decrease. When more information needs to be +conveyed about all the synchronous measurements made during a collection cycle, +a Histogram ([Int64Histogram] and [Float64Histogram]) should be used. Finally, +when just the most recent measurement needs to be conveyed about an +asynchronous measurement, a Gauge ([Int64ObservableGauge] and +[Float64ObservableGauge]) should be used. + +See the [OpenTelemetry documentation] for more information about instruments +and their intended use. + +# Measurements + +Measurements are made by recording values and information about the values with +an instrument. How these measurements are recorded depends on the instrument. + +Measurements for synchronous instruments ([Int64Counter], [Int64UpDownCounter], +[Int64Histogram], [Float64Counter], [Float64UpDownCounter], and +[Float64Histogram]) are recorded using the instrument methods directly. All +counter instruments have an Add method that is used to measure an increment +value, and all histogram instruments have a Record method to measure a data +point. + +Asynchronous instruments ([Int64ObservableCounter], +[Int64ObservableUpDownCounter], [Int64ObservableGauge], +[Float64ObservableCounter], [Float64ObservableUpDownCounter], and +[Float64ObservableGauge]) record measurements within a callback function. The +callback is registered with the Meter which ensures the callback is called once +per collection cycle. A callback can be registered two ways: during the +instrument's creation using an option, or later using the RegisterCallback +method of the [Meter] that created the instrument. + +If the following criteria are met, an option ([WithInt64Callback] or +[WithFloat64Callback]) can be used during the asynchronous instrument's +creation to register a callback ([Int64Callback] or [Float64Callback], +respectively): + + - The measurement process is known when the instrument is created + - Only that instrument will make a measurement within the callback + - The callback never needs to be unregistered + +If the criteria are not met, use the RegisterCallback method of the [Meter] that +created the instrument to register a [Callback]. + +# API Implementations + +This package does not conform to the standard Go versioning policy, all of its +interfaces may have methods added to them without a package major version bump. +This non-standard API evolution could surprise an uninformed implementation +author. They could unknowingly build their implementation in a way that would +result in a runtime panic for their users that update to the new API. + +The API is designed to help inform an instrumentation author about this +non-standard API evolution. It requires them to choose a default behavior for +unimplemented interface methods. There are three behavior choices they can +make: + + - Compilation failure + - Panic + - Default to another implementation + +All interfaces in this API embed a corresponding interface from +[go.opentelemetry.io/otel/metric/embedded]. If an author wants the default +behavior of their implementations to be a compilation failure, signaling to +their users they need to update to the latest version of that implementation, +they need to embed the corresponding interface from +[go.opentelemetry.io/otel/metric/embedded] in their implementation. For +example, + + import "go.opentelemetry.io/otel/metric/embedded" + + type MeterProvider struct { + embedded.MeterProvider + // ... + } + +If an author wants the default behavior of their implementations to a panic, +they need to embed the API interface directly. + + import "go.opentelemetry.io/otel/metric" + + type MeterProvider struct { + metric.MeterProvider + // ... + } + +This is not a recommended behavior as it could lead to publishing packages that +contain runtime panics when users update other package that use newer versions +of [go.opentelemetry.io/otel/metric]. + +Finally, an author can embed another implementation in theirs. The embedded +implementation will be used for methods not defined by the author. For example, +an author who wants to default to silently dropping the call can use +[go.opentelemetry.io/otel/metric/noop]: + + import "go.opentelemetry.io/otel/metric/noop" + + type MeterProvider struct { + noop.MeterProvider + // ... + } + +It is strongly recommended that authors only embed +[go.opentelemetry.io/otel/metric/noop] if they choose this default behavior. +That implementation is the only one OpenTelemetry authors can guarantee will +fully implement all the API interfaces when a user updates their API. + +[OpenTelemetry documentation]: https://opentelemetry.io/docs/concepts/signals/metrics/ +[GetMeterProvider]: https://pkg.go.dev/go.opentelemetry.io/otel#GetMeterProvider +*/ +package metric // import "go.opentelemetry.io/otel/metric" diff --git a/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go b/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go new file mode 100644 index 000000000..ae0bdbd2e --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go @@ -0,0 +1,234 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package embedded provides interfaces embedded within the [OpenTelemetry +// metric API]. +// +// Implementers of the [OpenTelemetry metric API] can embed the relevant type +// from this package into their implementation directly. Doing so will result +// in a compilation error for users when the [OpenTelemetry metric API] is +// extended (which is something that can happen without a major version bump of +// the API package). +// +// [OpenTelemetry metric API]: https://pkg.go.dev/go.opentelemetry.io/otel/metric +package embedded // import "go.opentelemetry.io/otel/metric/embedded" + +// MeterProvider is embedded in +// [go.opentelemetry.io/otel/metric.MeterProvider]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.MeterProvider] if you want users to +// experience a compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/metric.MeterProvider] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type MeterProvider interface{ meterProvider() } + +// Meter is embedded in [go.opentelemetry.io/otel/metric.Meter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Meter] if you want users to experience a +// compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/metric.Meter] interface +// is extended (which is something that can happen without a major version bump +// of the API package). +type Meter interface{ meter() } + +// Float64Observer is embedded in +// [go.opentelemetry.io/otel/metric.Float64Observer]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64Observer] if you want +// users to experience a compilation error, signaling they need to update to +// your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64Observer] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Float64Observer interface{ float64Observer() } + +// Int64Observer is embedded in +// [go.opentelemetry.io/otel/metric.Int64Observer]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64Observer] if you want users +// to experience a compilation error, signaling they need to update to your +// latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64Observer] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Int64Observer interface{ int64Observer() } + +// Observer is embedded in [go.opentelemetry.io/otel/metric.Observer]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Observer] if you want users to experience a +// compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/metric.Observer] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Observer interface{ observer() } + +// Registration is embedded in [go.opentelemetry.io/otel/metric.Registration]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Registration] if you want users to +// experience a compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/metric.Registration] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Registration interface{ registration() } + +// Float64Counter is embedded in +// [go.opentelemetry.io/otel/metric.Float64Counter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64Counter] if you want +// users to experience a compilation error, signaling they need to update to +// your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64Counter] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Float64Counter interface{ float64Counter() } + +// Float64Histogram is embedded in +// [go.opentelemetry.io/otel/metric.Float64Histogram]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64Histogram] if you want +// users to experience a compilation error, signaling they need to update to +// your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64Histogram] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Float64Histogram interface{ float64Histogram() } + +// Float64ObservableCounter is embedded in +// [go.opentelemetry.io/otel/metric.Float64ObservableCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64ObservableCounter] if you +// want users to experience a compilation error, signaling they need to update +// to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64ObservableCounter] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Float64ObservableCounter interface{ float64ObservableCounter() } + +// Float64ObservableGauge is embedded in +// [go.opentelemetry.io/otel/metric.Float64ObservableGauge]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64ObservableGauge] if you +// want users to experience a compilation error, signaling they need to update +// to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64ObservableGauge] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Float64ObservableGauge interface{ float64ObservableGauge() } + +// Float64ObservableUpDownCounter is embedded in +// [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter] +// if you want users to experience a compilation error, signaling they need to +// update to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Float64ObservableUpDownCounter interface{ float64ObservableUpDownCounter() } + +// Float64UpDownCounter is embedded in +// [go.opentelemetry.io/otel/metric.Float64UpDownCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64UpDownCounter] if you +// want users to experience a compilation error, signaling they need to update +// to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64UpDownCounter] interface +// is extended (which is something that can happen without a major version bump +// of the API package). +type Float64UpDownCounter interface{ float64UpDownCounter() } + +// Int64Counter is embedded in +// [go.opentelemetry.io/otel/metric.Int64Counter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64Counter] if you want users +// to experience a compilation error, signaling they need to update to your +// latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64Counter] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Int64Counter interface{ int64Counter() } + +// Int64Histogram is embedded in +// [go.opentelemetry.io/otel/metric.Int64Histogram]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64Histogram] if you want +// users to experience a compilation error, signaling they need to update to +// your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64Histogram] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Int64Histogram interface{ int64Histogram() } + +// Int64ObservableCounter is embedded in +// [go.opentelemetry.io/otel/metric.Int64ObservableCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64ObservableCounter] if you +// want users to experience a compilation error, signaling they need to update +// to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64ObservableCounter] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Int64ObservableCounter interface{ int64ObservableCounter() } + +// Int64ObservableGauge is embedded in +// [go.opentelemetry.io/otel/metric.Int64ObservableGauge]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64ObservableGauge] if you +// want users to experience a compilation error, signaling they need to update +// to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64ObservableGauge] interface +// is extended (which is something that can happen without a major version bump +// of the API package). +type Int64ObservableGauge interface{ int64ObservableGauge() } + +// Int64ObservableUpDownCounter is embedded in +// [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter] if +// you want users to experience a compilation error, signaling they need to +// update to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Int64ObservableUpDownCounter interface{ int64ObservableUpDownCounter() } + +// Int64UpDownCounter is embedded in +// [go.opentelemetry.io/otel/metric.Int64UpDownCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64UpDownCounter] if you want +// users to experience a compilation error, signaling they need to update to +// your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64UpDownCounter] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Int64UpDownCounter interface{ int64UpDownCounter() } diff --git a/vendor/go.opentelemetry.io/otel/metric/instrument.go b/vendor/go.opentelemetry.io/otel/metric/instrument.go new file mode 100644 index 000000000..be89cd533 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/instrument.go @@ -0,0 +1,357 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import "go.opentelemetry.io/otel/attribute" + +// Observable is used as a grouping mechanism for all instruments that are +// updated within a Callback. +type Observable interface { + observable() +} + +// InstrumentOption applies options to all instruments. +type InstrumentOption interface { + Int64CounterOption + Int64UpDownCounterOption + Int64HistogramOption + Int64ObservableCounterOption + Int64ObservableUpDownCounterOption + Int64ObservableGaugeOption + + Float64CounterOption + Float64UpDownCounterOption + Float64HistogramOption + Float64ObservableCounterOption + Float64ObservableUpDownCounterOption + Float64ObservableGaugeOption +} + +// HistogramOption applies options to histogram instruments. +type HistogramOption interface { + Int64HistogramOption + Float64HistogramOption +} + +type descOpt string + +func (o descOpt) applyFloat64Counter(c Float64CounterConfig) Float64CounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyFloat64UpDownCounter(c Float64UpDownCounterConfig) Float64UpDownCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64HistogramConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) Float64ObservableCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyFloat64ObservableUpDownCounter(c Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyFloat64ObservableGauge(c Float64ObservableGaugeConfig) Float64ObservableGaugeConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64Counter(c Int64CounterConfig) Int64CounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64UpDownCounter(c Int64UpDownCounterConfig) Int64UpDownCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int64ObservableCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64ObservableUpDownCounter(c Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64ObservableGauge(c Int64ObservableGaugeConfig) Int64ObservableGaugeConfig { + c.description = string(o) + return c +} + +// WithDescription sets the instrument description. +func WithDescription(desc string) InstrumentOption { return descOpt(desc) } + +type unitOpt string + +func (o unitOpt) applyFloat64Counter(c Float64CounterConfig) Float64CounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyFloat64UpDownCounter(c Float64UpDownCounterConfig) Float64UpDownCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64HistogramConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) Float64ObservableCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyFloat64ObservableUpDownCounter(c Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyFloat64ObservableGauge(c Float64ObservableGaugeConfig) Float64ObservableGaugeConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64Counter(c Int64CounterConfig) Int64CounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64UpDownCounter(c Int64UpDownCounterConfig) Int64UpDownCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int64ObservableCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64ObservableUpDownCounter(c Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64ObservableGauge(c Int64ObservableGaugeConfig) Int64ObservableGaugeConfig { + c.unit = string(o) + return c +} + +// WithUnit sets the instrument unit. +// +// The unit u should be defined using the appropriate [UCUM](https://ucum.org) case-sensitive code. +func WithUnit(u string) InstrumentOption { return unitOpt(u) } + +// WithExplicitBucketBoundaries sets the instrument explicit bucket boundaries. +// +// This option is considered "advisory", and may be ignored by API implementations. +func WithExplicitBucketBoundaries(bounds ...float64) HistogramOption { return bucketOpt(bounds) } + +type bucketOpt []float64 + +func (o bucketOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64HistogramConfig { + c.explicitBucketBoundaries = o + return c +} + +func (o bucketOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfig { + c.explicitBucketBoundaries = o + return c +} + +// AddOption applies options to an addition measurement. See +// [MeasurementOption] for other options that can be used as an AddOption. +type AddOption interface { + applyAdd(AddConfig) AddConfig +} + +// AddConfig contains options for an addition measurement. +type AddConfig struct { + attrs attribute.Set +} + +// NewAddConfig returns a new [AddConfig] with all opts applied. +func NewAddConfig(opts []AddOption) AddConfig { + config := AddConfig{attrs: *attribute.EmptySet()} + for _, o := range opts { + config = o.applyAdd(config) + } + return config +} + +// Attributes returns the configured attribute set. +func (c AddConfig) Attributes() attribute.Set { + return c.attrs +} + +// RecordOption applies options to an addition measurement. See +// [MeasurementOption] for other options that can be used as a RecordOption. +type RecordOption interface { + applyRecord(RecordConfig) RecordConfig +} + +// RecordConfig contains options for a recorded measurement. +type RecordConfig struct { + attrs attribute.Set +} + +// NewRecordConfig returns a new [RecordConfig] with all opts applied. +func NewRecordConfig(opts []RecordOption) RecordConfig { + config := RecordConfig{attrs: *attribute.EmptySet()} + for _, o := range opts { + config = o.applyRecord(config) + } + return config +} + +// Attributes returns the configured attribute set. +func (c RecordConfig) Attributes() attribute.Set { + return c.attrs +} + +// ObserveOption applies options to an addition measurement. See +// [MeasurementOption] for other options that can be used as a ObserveOption. +type ObserveOption interface { + applyObserve(ObserveConfig) ObserveConfig +} + +// ObserveConfig contains options for an observed measurement. +type ObserveConfig struct { + attrs attribute.Set +} + +// NewObserveConfig returns a new [ObserveConfig] with all opts applied. +func NewObserveConfig(opts []ObserveOption) ObserveConfig { + config := ObserveConfig{attrs: *attribute.EmptySet()} + for _, o := range opts { + config = o.applyObserve(config) + } + return config +} + +// Attributes returns the configured attribute set. +func (c ObserveConfig) Attributes() attribute.Set { + return c.attrs +} + +// MeasurementOption applies options to all instrument measurement. +type MeasurementOption interface { + AddOption + RecordOption + ObserveOption +} + +type attrOpt struct { + set attribute.Set +} + +// mergeSets returns the union of keys between a and b. Any duplicate keys will +// use the value associated with b. +func mergeSets(a, b attribute.Set) attribute.Set { + // NewMergeIterator uses the first value for any duplicates. + iter := attribute.NewMergeIterator(&b, &a) + merged := make([]attribute.KeyValue, 0, a.Len()+b.Len()) + for iter.Next() { + merged = append(merged, iter.Attribute()) + } + return attribute.NewSet(merged...) +} + +func (o attrOpt) applyAdd(c AddConfig) AddConfig { + switch { + case o.set.Len() == 0: + case c.attrs.Len() == 0: + c.attrs = o.set + default: + c.attrs = mergeSets(c.attrs, o.set) + } + return c +} + +func (o attrOpt) applyRecord(c RecordConfig) RecordConfig { + switch { + case o.set.Len() == 0: + case c.attrs.Len() == 0: + c.attrs = o.set + default: + c.attrs = mergeSets(c.attrs, o.set) + } + return c +} + +func (o attrOpt) applyObserve(c ObserveConfig) ObserveConfig { + switch { + case o.set.Len() == 0: + case c.attrs.Len() == 0: + c.attrs = o.set + default: + c.attrs = mergeSets(c.attrs, o.set) + } + return c +} + +// WithAttributeSet sets the attribute Set associated with a measurement is +// made with. +// +// If multiple WithAttributeSet or WithAttributes options are passed the +// attributes will be merged together in the order they are passed. Attributes +// with duplicate keys will use the last value passed. +func WithAttributeSet(attributes attribute.Set) MeasurementOption { + return attrOpt{set: attributes} +} + +// WithAttributes converts attributes into an attribute Set and sets the Set to +// be associated with a measurement. This is shorthand for: +// +// cp := make([]attribute.KeyValue, len(attributes)) +// copy(cp, attributes) +// WithAttributes(attribute.NewSet(cp...)) +// +// [attribute.NewSet] may modify the passed attributes so this will make a copy +// of attributes before creating a set in order to ensure this function is +// concurrent safe. This makes this option function less optimized in +// comparison to [WithAttributeSet]. Therefore, [WithAttributeSet] should be +// preferred for performance sensitive code. +// +// See [WithAttributeSet] for information about how multiple WithAttributes are +// merged. +func WithAttributes(attributes ...attribute.KeyValue) MeasurementOption { + cp := make([]attribute.KeyValue, len(attributes)) + copy(cp, attributes) + return attrOpt{set: attribute.NewSet(cp...)} +} diff --git a/vendor/go.opentelemetry.io/otel/metric/meter.go b/vendor/go.opentelemetry.io/otel/metric/meter.go new file mode 100644 index 000000000..2520bc74a --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/meter.go @@ -0,0 +1,212 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/metric/embedded" +) + +// MeterProvider provides access to named Meter instances, for instrumenting +// an application or package. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type MeterProvider interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.MeterProvider + + // Meter returns a new Meter with the provided name and configuration. + // + // A Meter should be scoped at most to a single package. The name needs to + // be unique so it does not collide with other names used by + // an application, nor other applications. To achieve this, the import path + // of the instrumentation package is recommended to be used as name. + // + // If the name is empty, then an implementation defined default name will + // be used instead. + Meter(name string, opts ...MeterOption) Meter +} + +// Meter provides access to instrument instances for recording metrics. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Meter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Meter + + // Int64Counter returns a new Int64Counter instrument identified by name + // and configured with options. The instrument is used to synchronously + // record increasing int64 measurements during a computational operation. + Int64Counter(name string, options ...Int64CounterOption) (Int64Counter, error) + // Int64UpDownCounter returns a new Int64UpDownCounter instrument + // identified by name and configured with options. The instrument is used + // to synchronously record int64 measurements during a computational + // operation. + Int64UpDownCounter(name string, options ...Int64UpDownCounterOption) (Int64UpDownCounter, error) + // Int64Histogram returns a new Int64Histogram instrument identified by + // name and configured with options. The instrument is used to + // synchronously record the distribution of int64 measurements during a + // computational operation. + Int64Histogram(name string, options ...Int64HistogramOption) (Int64Histogram, error) + // Int64ObservableCounter returns a new Int64ObservableCounter identified + // by name and configured with options. The instrument is used to + // asynchronously record increasing int64 measurements once per a + // measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithInt64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Int64ObservableCounter(name string, options ...Int64ObservableCounterOption) (Int64ObservableCounter, error) + // Int64ObservableUpDownCounter returns a new Int64ObservableUpDownCounter + // instrument identified by name and configured with options. The + // instrument is used to asynchronously record int64 measurements once per + // a measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithInt64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Int64ObservableUpDownCounter(name string, options ...Int64ObservableUpDownCounterOption) (Int64ObservableUpDownCounter, error) + // Int64ObservableGauge returns a new Int64ObservableGauge instrument + // identified by name and configured with options. The instrument is used + // to asynchronously record instantaneous int64 measurements once per a + // measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithInt64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Int64ObservableGauge(name string, options ...Int64ObservableGaugeOption) (Int64ObservableGauge, error) + + // Float64Counter returns a new Float64Counter instrument identified by + // name and configured with options. The instrument is used to + // synchronously record increasing float64 measurements during a + // computational operation. + Float64Counter(name string, options ...Float64CounterOption) (Float64Counter, error) + // Float64UpDownCounter returns a new Float64UpDownCounter instrument + // identified by name and configured with options. The instrument is used + // to synchronously record float64 measurements during a computational + // operation. + Float64UpDownCounter(name string, options ...Float64UpDownCounterOption) (Float64UpDownCounter, error) + // Float64Histogram returns a new Float64Histogram instrument identified by + // name and configured with options. The instrument is used to + // synchronously record the distribution of float64 measurements during a + // computational operation. + Float64Histogram(name string, options ...Float64HistogramOption) (Float64Histogram, error) + // Float64ObservableCounter returns a new Float64ObservableCounter + // instrument identified by name and configured with options. The + // instrument is used to asynchronously record increasing float64 + // measurements once per a measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithFloat64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Float64ObservableCounter(name string, options ...Float64ObservableCounterOption) (Float64ObservableCounter, error) + // Float64ObservableUpDownCounter returns a new + // Float64ObservableUpDownCounter instrument identified by name and + // configured with options. The instrument is used to asynchronously record + // float64 measurements once per a measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithFloat64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Float64ObservableUpDownCounter(name string, options ...Float64ObservableUpDownCounterOption) (Float64ObservableUpDownCounter, error) + // Float64ObservableGauge returns a new Float64ObservableGauge instrument + // identified by name and configured with options. The instrument is used + // to asynchronously record instantaneous float64 measurements once per a + // measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithFloat64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Float64ObservableGauge(name string, options ...Float64ObservableGaugeOption) (Float64ObservableGauge, error) + + // RegisterCallback registers f to be called during the collection of a + // measurement cycle. + // + // If Unregister of the returned Registration is called, f needs to be + // unregistered and not called during collection. + // + // The instruments f is registered with are the only instruments that f may + // observe values for. + // + // If no instruments are passed, f should not be registered nor called + // during collection. + // + // The function f needs to be concurrent safe. + RegisterCallback(f Callback, instruments ...Observable) (Registration, error) +} + +// Callback is a function registered with a Meter that makes observations for +// the set of instruments it is registered with. The Observer parameter is used +// to record measurement observations for these instruments. +// +// The function needs to complete in a finite amount of time and the deadline +// of the passed context is expected to be honored. +// +// The function needs to make unique observations across all registered +// Callbacks. Meaning, it should not report measurements for an instrument with +// the same attributes as another Callback will report. +// +// The function needs to be concurrent safe. +type Callback func(context.Context, Observer) error + +// Observer records measurements for multiple instruments in a Callback. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Observer interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Observer + + // ObserveFloat64 records the float64 value for obsrv. + ObserveFloat64(obsrv Float64Observable, value float64, opts ...ObserveOption) + // ObserveInt64 records the int64 value for obsrv. + ObserveInt64(obsrv Int64Observable, value int64, opts ...ObserveOption) +} + +// Registration is an token representing the unique registration of a callback +// for a set of instruments with a Meter. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Registration interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Registration + + // Unregister removes the callback registration from a Meter. + // + // This method needs to be idempotent and concurrent safe. + Unregister() error +} diff --git a/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go new file mode 100644 index 000000000..0a4825ae6 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go @@ -0,0 +1,185 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/metric/embedded" +) + +// Float64Counter is an instrument that records increasing float64 values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64Counter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64Counter + + // Add records a change to the counter. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Add(ctx context.Context, incr float64, options ...AddOption) +} + +// Float64CounterConfig contains options for synchronous counter instruments that +// record int64 values. +type Float64CounterConfig struct { + description string + unit string +} + +// NewFloat64CounterConfig returns a new [Float64CounterConfig] with all opts +// applied. +func NewFloat64CounterConfig(opts ...Float64CounterOption) Float64CounterConfig { + var config Float64CounterConfig + for _, o := range opts { + config = o.applyFloat64Counter(config) + } + return config +} + +// Description returns the configured description. +func (c Float64CounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64CounterConfig) Unit() string { + return c.unit +} + +// Float64CounterOption applies options to a [Float64CounterConfig]. See +// [InstrumentOption] for other options that can be used as a +// Float64CounterOption. +type Float64CounterOption interface { + applyFloat64Counter(Float64CounterConfig) Float64CounterConfig +} + +// Float64UpDownCounter is an instrument that records increasing or decreasing +// float64 values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64UpDownCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64UpDownCounter + + // Add records a change to the counter. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Add(ctx context.Context, incr float64, options ...AddOption) +} + +// Float64UpDownCounterConfig contains options for synchronous counter +// instruments that record int64 values. +type Float64UpDownCounterConfig struct { + description string + unit string +} + +// NewFloat64UpDownCounterConfig returns a new [Float64UpDownCounterConfig] +// with all opts applied. +func NewFloat64UpDownCounterConfig(opts ...Float64UpDownCounterOption) Float64UpDownCounterConfig { + var config Float64UpDownCounterConfig + for _, o := range opts { + config = o.applyFloat64UpDownCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Float64UpDownCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64UpDownCounterConfig) Unit() string { + return c.unit +} + +// Float64UpDownCounterOption applies options to a +// [Float64UpDownCounterConfig]. See [InstrumentOption] for other options that +// can be used as a Float64UpDownCounterOption. +type Float64UpDownCounterOption interface { + applyFloat64UpDownCounter(Float64UpDownCounterConfig) Float64UpDownCounterConfig +} + +// Float64Histogram is an instrument that records a distribution of float64 +// values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64Histogram interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64Histogram + + // Record adds an additional value to the distribution. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Record(ctx context.Context, incr float64, options ...RecordOption) +} + +// Float64HistogramConfig contains options for synchronous counter instruments +// that record int64 values. +type Float64HistogramConfig struct { + description string + unit string + explicitBucketBoundaries []float64 +} + +// NewFloat64HistogramConfig returns a new [Float64HistogramConfig] with all +// opts applied. +func NewFloat64HistogramConfig(opts ...Float64HistogramOption) Float64HistogramConfig { + var config Float64HistogramConfig + for _, o := range opts { + config = o.applyFloat64Histogram(config) + } + return config +} + +// Description returns the configured description. +func (c Float64HistogramConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64HistogramConfig) Unit() string { + return c.unit +} + +// ExplicitBucketBoundaries returns the configured explicit bucket boundaries. +func (c Float64HistogramConfig) ExplicitBucketBoundaries() []float64 { + return c.explicitBucketBoundaries +} + +// Float64HistogramOption applies options to a [Float64HistogramConfig]. See +// [InstrumentOption] for other options that can be used as a +// Float64HistogramOption. +type Float64HistogramOption interface { + applyFloat64Histogram(Float64HistogramConfig) Float64HistogramConfig +} diff --git a/vendor/go.opentelemetry.io/otel/metric/syncint64.go b/vendor/go.opentelemetry.io/otel/metric/syncint64.go new file mode 100644 index 000000000..56667d32f --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/syncint64.go @@ -0,0 +1,185 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/metric/embedded" +) + +// Int64Counter is an instrument that records increasing int64 values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64Counter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64Counter + + // Add records a change to the counter. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Add(ctx context.Context, incr int64, options ...AddOption) +} + +// Int64CounterConfig contains options for synchronous counter instruments that +// record int64 values. +type Int64CounterConfig struct { + description string + unit string +} + +// NewInt64CounterConfig returns a new [Int64CounterConfig] with all opts +// applied. +func NewInt64CounterConfig(opts ...Int64CounterOption) Int64CounterConfig { + var config Int64CounterConfig + for _, o := range opts { + config = o.applyInt64Counter(config) + } + return config +} + +// Description returns the configured description. +func (c Int64CounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64CounterConfig) Unit() string { + return c.unit +} + +// Int64CounterOption applies options to a [Int64CounterConfig]. See +// [InstrumentOption] for other options that can be used as an +// Int64CounterOption. +type Int64CounterOption interface { + applyInt64Counter(Int64CounterConfig) Int64CounterConfig +} + +// Int64UpDownCounter is an instrument that records increasing or decreasing +// int64 values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64UpDownCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64UpDownCounter + + // Add records a change to the counter. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Add(ctx context.Context, incr int64, options ...AddOption) +} + +// Int64UpDownCounterConfig contains options for synchronous counter +// instruments that record int64 values. +type Int64UpDownCounterConfig struct { + description string + unit string +} + +// NewInt64UpDownCounterConfig returns a new [Int64UpDownCounterConfig] with +// all opts applied. +func NewInt64UpDownCounterConfig(opts ...Int64UpDownCounterOption) Int64UpDownCounterConfig { + var config Int64UpDownCounterConfig + for _, o := range opts { + config = o.applyInt64UpDownCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Int64UpDownCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64UpDownCounterConfig) Unit() string { + return c.unit +} + +// Int64UpDownCounterOption applies options to a [Int64UpDownCounterConfig]. +// See [InstrumentOption] for other options that can be used as an +// Int64UpDownCounterOption. +type Int64UpDownCounterOption interface { + applyInt64UpDownCounter(Int64UpDownCounterConfig) Int64UpDownCounterConfig +} + +// Int64Histogram is an instrument that records a distribution of int64 +// values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64Histogram interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64Histogram + + // Record adds an additional value to the distribution. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Record(ctx context.Context, incr int64, options ...RecordOption) +} + +// Int64HistogramConfig contains options for synchronous counter instruments +// that record int64 values. +type Int64HistogramConfig struct { + description string + unit string + explicitBucketBoundaries []float64 +} + +// NewInt64HistogramConfig returns a new [Int64HistogramConfig] with all opts +// applied. +func NewInt64HistogramConfig(opts ...Int64HistogramOption) Int64HistogramConfig { + var config Int64HistogramConfig + for _, o := range opts { + config = o.applyInt64Histogram(config) + } + return config +} + +// Description returns the configured description. +func (c Int64HistogramConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64HistogramConfig) Unit() string { + return c.unit +} + +// ExplicitBucketBoundaries returns the configured explicit bucket boundaries. +func (c Int64HistogramConfig) ExplicitBucketBoundaries() []float64 { + return c.explicitBucketBoundaries +} + +// Int64HistogramOption applies options to a [Int64HistogramConfig]. See +// [InstrumentOption] for other options that can be used as an +// Int64HistogramOption. +type Int64HistogramOption interface { + applyInt64Histogram(Int64HistogramConfig) Int64HistogramConfig +} diff --git a/vendor/go.opentelemetry.io/otel/propagation.go b/vendor/go.opentelemetry.io/otel/propagation.go new file mode 100644 index 000000000..d29aaa32c --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/propagation.go @@ -0,0 +1,31 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otel // import "go.opentelemetry.io/otel" + +import ( + "go.opentelemetry.io/otel/internal/global" + "go.opentelemetry.io/otel/propagation" +) + +// GetTextMapPropagator returns the global TextMapPropagator. If none has been +// set, a No-Op TextMapPropagator is returned. +func GetTextMapPropagator() propagation.TextMapPropagator { + return global.TextMapPropagator() +} + +// SetTextMapPropagator sets propagator as the global TextMapPropagator. +func SetTextMapPropagator(propagator propagation.TextMapPropagator) { + global.SetTextMapPropagator(propagator) +} diff --git a/vendor/go.opentelemetry.io/otel/propagation/baggage.go b/vendor/go.opentelemetry.io/otel/propagation/baggage.go new file mode 100644 index 000000000..303cdf1cb --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/propagation/baggage.go @@ -0,0 +1,58 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package propagation // import "go.opentelemetry.io/otel/propagation" + +import ( + "context" + + "go.opentelemetry.io/otel/baggage" +) + +const baggageHeader = "baggage" + +// Baggage is a propagator that supports the W3C Baggage format. +// +// This propagates user-defined baggage associated with a trace. The complete +// specification is defined at https://www.w3.org/TR/baggage/. +type Baggage struct{} + +var _ TextMapPropagator = Baggage{} + +// Inject sets baggage key-values from ctx into the carrier. +func (b Baggage) Inject(ctx context.Context, carrier TextMapCarrier) { + bStr := baggage.FromContext(ctx).String() + if bStr != "" { + carrier.Set(baggageHeader, bStr) + } +} + +// Extract returns a copy of parent with the baggage from the carrier added. +func (b Baggage) Extract(parent context.Context, carrier TextMapCarrier) context.Context { + bStr := carrier.Get(baggageHeader) + if bStr == "" { + return parent + } + + bag, err := baggage.Parse(bStr) + if err != nil { + return parent + } + return baggage.ContextWithBaggage(parent, bag) +} + +// Fields returns the keys who's values are set with Inject. +func (b Baggage) Fields() []string { + return []string{baggageHeader} +} diff --git a/vendor/go.opentelemetry.io/otel/propagation/doc.go b/vendor/go.opentelemetry.io/otel/propagation/doc.go new file mode 100644 index 000000000..c119eb285 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/propagation/doc.go @@ -0,0 +1,24 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package propagation contains OpenTelemetry context propagators. + +OpenTelemetry propagators are used to extract and inject context data from and +into messages exchanged by applications. The propagator supported by this +package is the W3C Trace Context encoding +(https://www.w3.org/TR/trace-context/), and W3C Baggage +(https://www.w3.org/TR/baggage/). +*/ +package propagation // import "go.opentelemetry.io/otel/propagation" diff --git a/vendor/go.opentelemetry.io/otel/propagation/propagation.go b/vendor/go.opentelemetry.io/otel/propagation/propagation.go new file mode 100644 index 000000000..c94438f73 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/propagation/propagation.go @@ -0,0 +1,153 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package propagation // import "go.opentelemetry.io/otel/propagation" + +import ( + "context" + "net/http" +) + +// TextMapCarrier is the storage medium used by a TextMapPropagator. +type TextMapCarrier interface { + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Get returns the value associated with the passed key. + Get(key string) string + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Set stores the key-value pair. + Set(key string, value string) + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Keys lists the keys stored in this carrier. + Keys() []string + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. +} + +// MapCarrier is a TextMapCarrier that uses a map held in memory as a storage +// medium for propagated key-value pairs. +type MapCarrier map[string]string + +// Compile time check that MapCarrier implements the TextMapCarrier. +var _ TextMapCarrier = MapCarrier{} + +// Get returns the value associated with the passed key. +func (c MapCarrier) Get(key string) string { + return c[key] +} + +// Set stores the key-value pair. +func (c MapCarrier) Set(key, value string) { + c[key] = value +} + +// Keys lists the keys stored in this carrier. +func (c MapCarrier) Keys() []string { + keys := make([]string, 0, len(c)) + for k := range c { + keys = append(keys, k) + } + return keys +} + +// HeaderCarrier adapts http.Header to satisfy the TextMapCarrier interface. +type HeaderCarrier http.Header + +// Get returns the value associated with the passed key. +func (hc HeaderCarrier) Get(key string) string { + return http.Header(hc).Get(key) +} + +// Set stores the key-value pair. +func (hc HeaderCarrier) Set(key string, value string) { + http.Header(hc).Set(key, value) +} + +// Keys lists the keys stored in this carrier. +func (hc HeaderCarrier) Keys() []string { + keys := make([]string, 0, len(hc)) + for k := range hc { + keys = append(keys, k) + } + return keys +} + +// TextMapPropagator propagates cross-cutting concerns as key-value text +// pairs within a carrier that travels in-band across process boundaries. +type TextMapPropagator interface { + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Inject set cross-cutting concerns from the Context into the carrier. + Inject(ctx context.Context, carrier TextMapCarrier) + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Extract reads cross-cutting concerns from the carrier into a Context. + Extract(ctx context.Context, carrier TextMapCarrier) context.Context + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Fields returns the keys whose values are set with Inject. + Fields() []string + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. +} + +type compositeTextMapPropagator []TextMapPropagator + +func (p compositeTextMapPropagator) Inject(ctx context.Context, carrier TextMapCarrier) { + for _, i := range p { + i.Inject(ctx, carrier) + } +} + +func (p compositeTextMapPropagator) Extract(ctx context.Context, carrier TextMapCarrier) context.Context { + for _, i := range p { + ctx = i.Extract(ctx, carrier) + } + return ctx +} + +func (p compositeTextMapPropagator) Fields() []string { + unique := make(map[string]struct{}) + for _, i := range p { + for _, k := range i.Fields() { + unique[k] = struct{}{} + } + } + + fields := make([]string, 0, len(unique)) + for k := range unique { + fields = append(fields, k) + } + return fields +} + +// NewCompositeTextMapPropagator returns a unified TextMapPropagator from the +// group of passed TextMapPropagator. This allows different cross-cutting +// concerns to be propagates in a unified manner. +// +// The returned TextMapPropagator will inject and extract cross-cutting +// concerns in the order the TextMapPropagators were provided. Additionally, +// the Fields method will return a de-duplicated slice of the keys that are +// set with the Inject method. +func NewCompositeTextMapPropagator(p ...TextMapPropagator) TextMapPropagator { + return compositeTextMapPropagator(p) +} diff --git a/vendor/go.opentelemetry.io/otel/propagation/trace_context.go b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go new file mode 100644 index 000000000..63e5d6222 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go @@ -0,0 +1,167 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package propagation // import "go.opentelemetry.io/otel/propagation" + +import ( + "context" + "encoding/hex" + "fmt" + "strings" + + "go.opentelemetry.io/otel/trace" +) + +const ( + supportedVersion = 0 + maxVersion = 254 + traceparentHeader = "traceparent" + tracestateHeader = "tracestate" + delimiter = "-" +) + +// TraceContext is a propagator that supports the W3C Trace Context format +// (https://www.w3.org/TR/trace-context/) +// +// This propagator will propagate the traceparent and tracestate headers to +// guarantee traces are not broken. It is up to the users of this propagator +// to choose if they want to participate in a trace by modifying the +// traceparent header and relevant parts of the tracestate header containing +// their proprietary information. +type TraceContext struct{} + +var ( + _ TextMapPropagator = TraceContext{} + versionPart = fmt.Sprintf("%.2X", supportedVersion) +) + +// Inject set tracecontext from the Context into the carrier. +func (tc TraceContext) Inject(ctx context.Context, carrier TextMapCarrier) { + sc := trace.SpanContextFromContext(ctx) + if !sc.IsValid() { + return + } + + if ts := sc.TraceState().String(); ts != "" { + carrier.Set(tracestateHeader, ts) + } + + // Clear all flags other than the trace-context supported sampling bit. + flags := sc.TraceFlags() & trace.FlagsSampled + + var sb strings.Builder + sb.Grow(2 + 32 + 16 + 2 + 3) + _, _ = sb.WriteString(versionPart) + traceID := sc.TraceID() + spanID := sc.SpanID() + flagByte := [1]byte{byte(flags)} + var buf [32]byte + for _, src := range [][]byte{traceID[:], spanID[:], flagByte[:]} { + _ = sb.WriteByte(delimiter[0]) + n := hex.Encode(buf[:], src) + _, _ = sb.Write(buf[:n]) + } + carrier.Set(traceparentHeader, sb.String()) +} + +// Extract reads tracecontext from the carrier into a returned Context. +// +// The returned Context will be a copy of ctx and contain the extracted +// tracecontext as the remote SpanContext. If the extracted tracecontext is +// invalid, the passed ctx will be returned directly instead. +func (tc TraceContext) Extract(ctx context.Context, carrier TextMapCarrier) context.Context { + sc := tc.extract(carrier) + if !sc.IsValid() { + return ctx + } + return trace.ContextWithRemoteSpanContext(ctx, sc) +} + +func (tc TraceContext) extract(carrier TextMapCarrier) trace.SpanContext { + h := carrier.Get(traceparentHeader) + if h == "" { + return trace.SpanContext{} + } + + var ver [1]byte + if !extractPart(ver[:], &h, 2) { + return trace.SpanContext{} + } + version := int(ver[0]) + if version > maxVersion { + return trace.SpanContext{} + } + + var scc trace.SpanContextConfig + if !extractPart(scc.TraceID[:], &h, 32) { + return trace.SpanContext{} + } + if !extractPart(scc.SpanID[:], &h, 16) { + return trace.SpanContext{} + } + + var opts [1]byte + if !extractPart(opts[:], &h, 2) { + return trace.SpanContext{} + } + if version == 0 && (h != "" || opts[0] > 2) { + // version 0 not allow extra + // version 0 not allow other flag + return trace.SpanContext{} + } + + // Clear all flags other than the trace-context supported sampling bit. + scc.TraceFlags = trace.TraceFlags(opts[0]) & trace.FlagsSampled + + // Ignore the error returned here. Failure to parse tracestate MUST NOT + // affect the parsing of traceparent according to the W3C tracecontext + // specification. + scc.TraceState, _ = trace.ParseTraceState(carrier.Get(tracestateHeader)) + scc.Remote = true + + sc := trace.NewSpanContext(scc) + if !sc.IsValid() { + return trace.SpanContext{} + } + + return sc +} + +// upperHex detect hex is upper case Unicode characters. +func upperHex(v string) bool { + for _, c := range v { + if c >= 'A' && c <= 'F' { + return true + } + } + return false +} + +func extractPart(dst []byte, h *string, n int) bool { + part, left, _ := strings.Cut(*h, delimiter) + *h = left + // hex.Decode decodes unsupported upper-case characters, so exclude explicitly. + if len(part) != n || upperHex(part) { + return false + } + if p, err := hex.Decode(dst, []byte(part)); err != nil || p != n/2 { + return false + } + return true +} + +// Fields returns the keys who's values are set with Inject. +func (tc TraceContext) Fields() []string { + return []string{traceparentHeader, tracestateHeader} +} diff --git a/vendor/go.opentelemetry.io/otel/requirements.txt b/vendor/go.opentelemetry.io/otel/requirements.txt new file mode 100644 index 000000000..e0a43e138 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/requirements.txt @@ -0,0 +1 @@ +codespell==2.2.6 diff --git a/vendor/go.opentelemetry.io/otel/trace.go b/vendor/go.opentelemetry.io/otel/trace.go new file mode 100644 index 000000000..caf7249de --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace.go @@ -0,0 +1,47 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otel // import "go.opentelemetry.io/otel" + +import ( + "go.opentelemetry.io/otel/internal/global" + "go.opentelemetry.io/otel/trace" +) + +// Tracer creates a named tracer that implements Tracer interface. +// If the name is an empty string then provider uses default name. +// +// This is short for GetTracerProvider().Tracer(name, opts...) +func Tracer(name string, opts ...trace.TracerOption) trace.Tracer { + return GetTracerProvider().Tracer(name, opts...) +} + +// GetTracerProvider returns the registered global trace provider. +// If none is registered then an instance of NoopTracerProvider is returned. +// +// Use the trace provider to create a named tracer. E.g. +// +// tracer := otel.GetTracerProvider().Tracer("example.com/foo") +// +// or +// +// tracer := otel.Tracer("example.com/foo") +func GetTracerProvider() trace.TracerProvider { + return global.TracerProvider() +} + +// SetTracerProvider registers `tp` as the global trace provider. +func SetTracerProvider(tp trace.TracerProvider) { + global.SetTracerProvider(tp) +} diff --git a/vendor/go.opentelemetry.io/otel/trace/LICENSE b/vendor/go.opentelemetry.io/otel/trace/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/go.opentelemetry.io/otel/trace/config.go b/vendor/go.opentelemetry.io/otel/trace/config.go new file mode 100644 index 000000000..3aadc66cf --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/config.go @@ -0,0 +1,334 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/trace" + +import ( + "time" + + "go.opentelemetry.io/otel/attribute" +) + +// TracerConfig is a group of options for a Tracer. +type TracerConfig struct { + instrumentationVersion string + // Schema URL of the telemetry emitted by the Tracer. + schemaURL string + attrs attribute.Set +} + +// InstrumentationVersion returns the version of the library providing instrumentation. +func (t *TracerConfig) InstrumentationVersion() string { + return t.instrumentationVersion +} + +// InstrumentationAttributes returns the attributes associated with the library +// providing instrumentation. +func (t *TracerConfig) InstrumentationAttributes() attribute.Set { + return t.attrs +} + +// SchemaURL returns the Schema URL of the telemetry emitted by the Tracer. +func (t *TracerConfig) SchemaURL() string { + return t.schemaURL +} + +// NewTracerConfig applies all the options to a returned TracerConfig. +func NewTracerConfig(options ...TracerOption) TracerConfig { + var config TracerConfig + for _, option := range options { + config = option.apply(config) + } + return config +} + +// TracerOption applies an option to a TracerConfig. +type TracerOption interface { + apply(TracerConfig) TracerConfig +} + +type tracerOptionFunc func(TracerConfig) TracerConfig + +func (fn tracerOptionFunc) apply(cfg TracerConfig) TracerConfig { + return fn(cfg) +} + +// SpanConfig is a group of options for a Span. +type SpanConfig struct { + attributes []attribute.KeyValue + timestamp time.Time + links []Link + newRoot bool + spanKind SpanKind + stackTrace bool +} + +// Attributes describe the associated qualities of a Span. +func (cfg *SpanConfig) Attributes() []attribute.KeyValue { + return cfg.attributes +} + +// Timestamp is a time in a Span life-cycle. +func (cfg *SpanConfig) Timestamp() time.Time { + return cfg.timestamp +} + +// StackTrace checks whether stack trace capturing is enabled. +func (cfg *SpanConfig) StackTrace() bool { + return cfg.stackTrace +} + +// Links are the associations a Span has with other Spans. +func (cfg *SpanConfig) Links() []Link { + return cfg.links +} + +// NewRoot identifies a Span as the root Span for a new trace. This is +// commonly used when an existing trace crosses trust boundaries and the +// remote parent span context should be ignored for security. +func (cfg *SpanConfig) NewRoot() bool { + return cfg.newRoot +} + +// SpanKind is the role a Span has in a trace. +func (cfg *SpanConfig) SpanKind() SpanKind { + return cfg.spanKind +} + +// NewSpanStartConfig applies all the options to a returned SpanConfig. +// No validation is performed on the returned SpanConfig (e.g. no uniqueness +// checking or bounding of data), it is left to the SDK to perform this +// action. +func NewSpanStartConfig(options ...SpanStartOption) SpanConfig { + var c SpanConfig + for _, option := range options { + c = option.applySpanStart(c) + } + return c +} + +// NewSpanEndConfig applies all the options to a returned SpanConfig. +// No validation is performed on the returned SpanConfig (e.g. no uniqueness +// checking or bounding of data), it is left to the SDK to perform this +// action. +func NewSpanEndConfig(options ...SpanEndOption) SpanConfig { + var c SpanConfig + for _, option := range options { + c = option.applySpanEnd(c) + } + return c +} + +// SpanStartOption applies an option to a SpanConfig. These options are applicable +// only when the span is created. +type SpanStartOption interface { + applySpanStart(SpanConfig) SpanConfig +} + +type spanOptionFunc func(SpanConfig) SpanConfig + +func (fn spanOptionFunc) applySpanStart(cfg SpanConfig) SpanConfig { + return fn(cfg) +} + +// SpanEndOption applies an option to a SpanConfig. These options are +// applicable only when the span is ended. +type SpanEndOption interface { + applySpanEnd(SpanConfig) SpanConfig +} + +// EventConfig is a group of options for an Event. +type EventConfig struct { + attributes []attribute.KeyValue + timestamp time.Time + stackTrace bool +} + +// Attributes describe the associated qualities of an Event. +func (cfg *EventConfig) Attributes() []attribute.KeyValue { + return cfg.attributes +} + +// Timestamp is a time in an Event life-cycle. +func (cfg *EventConfig) Timestamp() time.Time { + return cfg.timestamp +} + +// StackTrace checks whether stack trace capturing is enabled. +func (cfg *EventConfig) StackTrace() bool { + return cfg.stackTrace +} + +// NewEventConfig applies all the EventOptions to a returned EventConfig. If no +// timestamp option is passed, the returned EventConfig will have a Timestamp +// set to the call time, otherwise no validation is performed on the returned +// EventConfig. +func NewEventConfig(options ...EventOption) EventConfig { + var c EventConfig + for _, option := range options { + c = option.applyEvent(c) + } + if c.timestamp.IsZero() { + c.timestamp = time.Now() + } + return c +} + +// EventOption applies span event options to an EventConfig. +type EventOption interface { + applyEvent(EventConfig) EventConfig +} + +// SpanOption are options that can be used at both the beginning and end of a span. +type SpanOption interface { + SpanStartOption + SpanEndOption +} + +// SpanStartEventOption are options that can be used at the start of a span, or with an event. +type SpanStartEventOption interface { + SpanStartOption + EventOption +} + +// SpanEndEventOption are options that can be used at the end of a span, or with an event. +type SpanEndEventOption interface { + SpanEndOption + EventOption +} + +type attributeOption []attribute.KeyValue + +func (o attributeOption) applySpan(c SpanConfig) SpanConfig { + c.attributes = append(c.attributes, []attribute.KeyValue(o)...) + return c +} +func (o attributeOption) applySpanStart(c SpanConfig) SpanConfig { return o.applySpan(c) } +func (o attributeOption) applyEvent(c EventConfig) EventConfig { + c.attributes = append(c.attributes, []attribute.KeyValue(o)...) + return c +} + +var _ SpanStartEventOption = attributeOption{} + +// WithAttributes adds the attributes related to a span life-cycle event. +// These attributes are used to describe the work a Span represents when this +// option is provided to a Span's start or end events. Otherwise, these +// attributes provide additional information about the event being recorded +// (e.g. error, state change, processing progress, system event). +// +// If multiple of these options are passed the attributes of each successive +// option will extend the attributes instead of overwriting. There is no +// guarantee of uniqueness in the resulting attributes. +func WithAttributes(attributes ...attribute.KeyValue) SpanStartEventOption { + return attributeOption(attributes) +} + +// SpanEventOption are options that can be used with an event or a span. +type SpanEventOption interface { + SpanOption + EventOption +} + +type timestampOption time.Time + +func (o timestampOption) applySpan(c SpanConfig) SpanConfig { + c.timestamp = time.Time(o) + return c +} +func (o timestampOption) applySpanStart(c SpanConfig) SpanConfig { return o.applySpan(c) } +func (o timestampOption) applySpanEnd(c SpanConfig) SpanConfig { return o.applySpan(c) } +func (o timestampOption) applyEvent(c EventConfig) EventConfig { + c.timestamp = time.Time(o) + return c +} + +var _ SpanEventOption = timestampOption{} + +// WithTimestamp sets the time of a Span or Event life-cycle moment (e.g. +// started, stopped, errored). +func WithTimestamp(t time.Time) SpanEventOption { + return timestampOption(t) +} + +type stackTraceOption bool + +func (o stackTraceOption) applyEvent(c EventConfig) EventConfig { + c.stackTrace = bool(o) + return c +} + +func (o stackTraceOption) applySpan(c SpanConfig) SpanConfig { + c.stackTrace = bool(o) + return c +} +func (o stackTraceOption) applySpanEnd(c SpanConfig) SpanConfig { return o.applySpan(c) } + +// WithStackTrace sets the flag to capture the error with stack trace (e.g. true, false). +func WithStackTrace(b bool) SpanEndEventOption { + return stackTraceOption(b) +} + +// WithLinks adds links to a Span. The links are added to the existing Span +// links, i.e. this does not overwrite. Links with invalid span context are ignored. +func WithLinks(links ...Link) SpanStartOption { + return spanOptionFunc(func(cfg SpanConfig) SpanConfig { + cfg.links = append(cfg.links, links...) + return cfg + }) +} + +// WithNewRoot specifies that the Span should be treated as a root Span. Any +// existing parent span context will be ignored when defining the Span's trace +// identifiers. +func WithNewRoot() SpanStartOption { + return spanOptionFunc(func(cfg SpanConfig) SpanConfig { + cfg.newRoot = true + return cfg + }) +} + +// WithSpanKind sets the SpanKind of a Span. +func WithSpanKind(kind SpanKind) SpanStartOption { + return spanOptionFunc(func(cfg SpanConfig) SpanConfig { + cfg.spanKind = kind + return cfg + }) +} + +// WithInstrumentationVersion sets the instrumentation version. +func WithInstrumentationVersion(version string) TracerOption { + return tracerOptionFunc(func(cfg TracerConfig) TracerConfig { + cfg.instrumentationVersion = version + return cfg + }) +} + +// WithInstrumentationAttributes sets the instrumentation attributes. +// +// The passed attributes will be de-duplicated. +func WithInstrumentationAttributes(attr ...attribute.KeyValue) TracerOption { + return tracerOptionFunc(func(config TracerConfig) TracerConfig { + config.attrs = attribute.NewSet(attr...) + return config + }) +} + +// WithSchemaURL sets the schema URL for the Tracer. +func WithSchemaURL(schemaURL string) TracerOption { + return tracerOptionFunc(func(cfg TracerConfig) TracerConfig { + cfg.schemaURL = schemaURL + return cfg + }) +} diff --git a/vendor/go.opentelemetry.io/otel/trace/context.go b/vendor/go.opentelemetry.io/otel/trace/context.go new file mode 100644 index 000000000..76f9a083c --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/context.go @@ -0,0 +1,61 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/trace" + +import "context" + +type traceContextKeyType int + +const currentSpanKey traceContextKeyType = iota + +// ContextWithSpan returns a copy of parent with span set as the current Span. +func ContextWithSpan(parent context.Context, span Span) context.Context { + return context.WithValue(parent, currentSpanKey, span) +} + +// ContextWithSpanContext returns a copy of parent with sc as the current +// Span. The Span implementation that wraps sc is non-recording and performs +// no operations other than to return sc as the SpanContext from the +// SpanContext method. +func ContextWithSpanContext(parent context.Context, sc SpanContext) context.Context { + return ContextWithSpan(parent, nonRecordingSpan{sc: sc}) +} + +// ContextWithRemoteSpanContext returns a copy of parent with rsc set explicly +// as a remote SpanContext and as the current Span. The Span implementation +// that wraps rsc is non-recording and performs no operations other than to +// return rsc as the SpanContext from the SpanContext method. +func ContextWithRemoteSpanContext(parent context.Context, rsc SpanContext) context.Context { + return ContextWithSpanContext(parent, rsc.WithRemote(true)) +} + +// SpanFromContext returns the current Span from ctx. +// +// If no Span is currently set in ctx an implementation of a Span that +// performs no operations is returned. +func SpanFromContext(ctx context.Context) Span { + if ctx == nil { + return noopSpan{} + } + if span, ok := ctx.Value(currentSpanKey).(Span); ok { + return span + } + return noopSpan{} +} + +// SpanContextFromContext returns the current Span's SpanContext. +func SpanContextFromContext(ctx context.Context) SpanContext { + return SpanFromContext(ctx).SpanContext() +} diff --git a/vendor/go.opentelemetry.io/otel/trace/doc.go b/vendor/go.opentelemetry.io/otel/trace/doc.go new file mode 100644 index 000000000..440f3d756 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/doc.go @@ -0,0 +1,130 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package trace provides an implementation of the tracing part of the +OpenTelemetry API. + +To participate in distributed traces a Span needs to be created for the +operation being performed as part of a traced workflow. In its simplest form: + + var tracer trace.Tracer + + func init() { + tracer = otel.Tracer("instrumentation/package/name") + } + + func operation(ctx context.Context) { + var span trace.Span + ctx, span = tracer.Start(ctx, "operation") + defer span.End() + // ... + } + +A Tracer is unique to the instrumentation and is used to create Spans. +Instrumentation should be designed to accept a TracerProvider from which it +can create its own unique Tracer. Alternatively, the registered global +TracerProvider from the go.opentelemetry.io/otel package can be used as +a default. + + const ( + name = "instrumentation/package/name" + version = "0.1.0" + ) + + type Instrumentation struct { + tracer trace.Tracer + } + + func NewInstrumentation(tp trace.TracerProvider) *Instrumentation { + if tp == nil { + tp = otel.TracerProvider() + } + return &Instrumentation{ + tracer: tp.Tracer(name, trace.WithInstrumentationVersion(version)), + } + } + + func operation(ctx context.Context, inst *Instrumentation) { + var span trace.Span + ctx, span = inst.tracer.Start(ctx, "operation") + defer span.End() + // ... + } + +# API Implementations + +This package does not conform to the standard Go versioning policy; all of its +interfaces may have methods added to them without a package major version bump. +This non-standard API evolution could surprise an uninformed implementation +author. They could unknowingly build their implementation in a way that would +result in a runtime panic for their users that update to the new API. + +The API is designed to help inform an instrumentation author about this +non-standard API evolution. It requires them to choose a default behavior for +unimplemented interface methods. There are three behavior choices they can +make: + + - Compilation failure + - Panic + - Default to another implementation + +All interfaces in this API embed a corresponding interface from +[go.opentelemetry.io/otel/trace/embedded]. If an author wants the default +behavior of their implementations to be a compilation failure, signaling to +their users they need to update to the latest version of that implementation, +they need to embed the corresponding interface from +[go.opentelemetry.io/otel/trace/embedded] in their implementation. For +example, + + import "go.opentelemetry.io/otel/trace/embedded" + + type TracerProvider struct { + embedded.TracerProvider + // ... + } + +If an author wants the default behavior of their implementations to panic, they +can embed the API interface directly. + + import "go.opentelemetry.io/otel/trace" + + type TracerProvider struct { + trace.TracerProvider + // ... + } + +This option is not recommended. It will lead to publishing packages that +contain runtime panics when users update to newer versions of +[go.opentelemetry.io/otel/trace], which may be done with a trasitive +dependency. + +Finally, an author can embed another implementation in theirs. The embedded +implementation will be used for methods not defined by the author. For example, +an author who wants to default to silently dropping the call can use +[go.opentelemetry.io/otel/trace/noop]: + + import "go.opentelemetry.io/otel/trace/noop" + + type TracerProvider struct { + noop.TracerProvider + // ... + } + +It is strongly recommended that authors only embed +[go.opentelemetry.io/otel/trace/noop] if they choose this default behavior. +That implementation is the only one OpenTelemetry authors can guarantee will +fully implement all the API interfaces when a user updates their API. +*/ +package trace // import "go.opentelemetry.io/otel/trace" diff --git a/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go b/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go new file mode 100644 index 000000000..898db5a75 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go @@ -0,0 +1,56 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package embedded provides interfaces embedded within the [OpenTelemetry +// trace API]. +// +// Implementers of the [OpenTelemetry trace API] can embed the relevant type +// from this package into their implementation directly. Doing so will result +// in a compilation error for users when the [OpenTelemetry trace API] is +// extended (which is something that can happen without a major version bump of +// the API package). +// +// [OpenTelemetry trace API]: https://pkg.go.dev/go.opentelemetry.io/otel/trace +package embedded // import "go.opentelemetry.io/otel/trace/embedded" + +// TracerProvider is embedded in +// [go.opentelemetry.io/otel/trace.TracerProvider]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/trace.TracerProvider] if you want users to +// experience a compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/trace.TracerProvider] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type TracerProvider interface{ tracerProvider() } + +// Tracer is embedded in [go.opentelemetry.io/otel/trace.Tracer]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/trace.Tracer] if you want users to experience a +// compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/trace.Tracer] interface +// is extended (which is something that can happen without a major version bump +// of the API package). +type Tracer interface{ tracer() } + +// Span is embedded in [go.opentelemetry.io/otel/trace.Span]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/trace.Span] if you want users to experience a +// compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/trace.Span] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Span interface{ span() } diff --git a/vendor/go.opentelemetry.io/otel/trace/nonrecording.go b/vendor/go.opentelemetry.io/otel/trace/nonrecording.go new file mode 100644 index 000000000..88fcb8161 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/nonrecording.go @@ -0,0 +1,27 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/trace" + +// nonRecordingSpan is a minimal implementation of a Span that wraps a +// SpanContext. It performs no operations other than to return the wrapped +// SpanContext. +type nonRecordingSpan struct { + noopSpan + + sc SpanContext +} + +// SpanContext returns the wrapped SpanContext. +func (s nonRecordingSpan) SpanContext() SpanContext { return s.sc } diff --git a/vendor/go.opentelemetry.io/otel/trace/noop.go b/vendor/go.opentelemetry.io/otel/trace/noop.go new file mode 100644 index 000000000..c125491ca --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/noop.go @@ -0,0 +1,93 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/trace" + +import ( + "context" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/trace/embedded" +) + +// NewNoopTracerProvider returns an implementation of TracerProvider that +// performs no operations. The Tracer and Spans created from the returned +// TracerProvider also perform no operations. +// +// Deprecated: Use [go.opentelemetry.io/otel/trace/noop.NewTracerProvider] +// instead. +func NewNoopTracerProvider() TracerProvider { + return noopTracerProvider{} +} + +type noopTracerProvider struct{ embedded.TracerProvider } + +var _ TracerProvider = noopTracerProvider{} + +// Tracer returns noop implementation of Tracer. +func (p noopTracerProvider) Tracer(string, ...TracerOption) Tracer { + return noopTracer{} +} + +// noopTracer is an implementation of Tracer that performs no operations. +type noopTracer struct{ embedded.Tracer } + +var _ Tracer = noopTracer{} + +// Start carries forward a non-recording Span, if one is present in the context, otherwise it +// creates a no-op Span. +func (t noopTracer) Start(ctx context.Context, name string, _ ...SpanStartOption) (context.Context, Span) { + span := SpanFromContext(ctx) + if _, ok := span.(nonRecordingSpan); !ok { + // span is likely already a noopSpan, but let's be sure + span = noopSpan{} + } + return ContextWithSpan(ctx, span), span +} + +// noopSpan is an implementation of Span that performs no operations. +type noopSpan struct{ embedded.Span } + +var _ Span = noopSpan{} + +// SpanContext returns an empty span context. +func (noopSpan) SpanContext() SpanContext { return SpanContext{} } + +// IsRecording always returns false. +func (noopSpan) IsRecording() bool { return false } + +// SetStatus does nothing. +func (noopSpan) SetStatus(codes.Code, string) {} + +// SetError does nothing. +func (noopSpan) SetError(bool) {} + +// SetAttributes does nothing. +func (noopSpan) SetAttributes(...attribute.KeyValue) {} + +// End does nothing. +func (noopSpan) End(...SpanEndOption) {} + +// RecordError does nothing. +func (noopSpan) RecordError(error, ...EventOption) {} + +// AddEvent does nothing. +func (noopSpan) AddEvent(string, ...EventOption) {} + +// SetName does nothing. +func (noopSpan) SetName(string) {} + +// TracerProvider returns a no-op TracerProvider. +func (noopSpan) TracerProvider() TracerProvider { return noopTracerProvider{} } diff --git a/vendor/go.opentelemetry.io/otel/trace/trace.go b/vendor/go.opentelemetry.io/otel/trace/trace.go new file mode 100644 index 000000000..26a4b2260 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/trace.go @@ -0,0 +1,577 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/trace" + +import ( + "bytes" + "context" + "encoding/hex" + "encoding/json" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/trace/embedded" +) + +const ( + // FlagsSampled is a bitmask with the sampled bit set. A SpanContext + // with the sampling bit set means the span is sampled. + FlagsSampled = TraceFlags(0x01) + + errInvalidHexID errorConst = "trace-id and span-id can only contain [0-9a-f] characters, all lowercase" + + errInvalidTraceIDLength errorConst = "hex encoded trace-id must have length equals to 32" + errNilTraceID errorConst = "trace-id can't be all zero" + + errInvalidSpanIDLength errorConst = "hex encoded span-id must have length equals to 16" + errNilSpanID errorConst = "span-id can't be all zero" +) + +type errorConst string + +func (e errorConst) Error() string { + return string(e) +} + +// TraceID is a unique identity of a trace. +// nolint:revive // revive complains about stutter of `trace.TraceID`. +type TraceID [16]byte + +var ( + nilTraceID TraceID + _ json.Marshaler = nilTraceID +) + +// IsValid checks whether the trace TraceID is valid. A valid trace ID does +// not consist of zeros only. +func (t TraceID) IsValid() bool { + return !bytes.Equal(t[:], nilTraceID[:]) +} + +// MarshalJSON implements a custom marshal function to encode TraceID +// as a hex string. +func (t TraceID) MarshalJSON() ([]byte, error) { + return json.Marshal(t.String()) +} + +// String returns the hex string representation form of a TraceID. +func (t TraceID) String() string { + return hex.EncodeToString(t[:]) +} + +// SpanID is a unique identity of a span in a trace. +type SpanID [8]byte + +var ( + nilSpanID SpanID + _ json.Marshaler = nilSpanID +) + +// IsValid checks whether the SpanID is valid. A valid SpanID does not consist +// of zeros only. +func (s SpanID) IsValid() bool { + return !bytes.Equal(s[:], nilSpanID[:]) +} + +// MarshalJSON implements a custom marshal function to encode SpanID +// as a hex string. +func (s SpanID) MarshalJSON() ([]byte, error) { + return json.Marshal(s.String()) +} + +// String returns the hex string representation form of a SpanID. +func (s SpanID) String() string { + return hex.EncodeToString(s[:]) +} + +// TraceIDFromHex returns a TraceID from a hex string if it is compliant with +// the W3C trace-context specification. See more at +// https://www.w3.org/TR/trace-context/#trace-id +// nolint:revive // revive complains about stutter of `trace.TraceIDFromHex`. +func TraceIDFromHex(h string) (TraceID, error) { + t := TraceID{} + if len(h) != 32 { + return t, errInvalidTraceIDLength + } + + if err := decodeHex(h, t[:]); err != nil { + return t, err + } + + if !t.IsValid() { + return t, errNilTraceID + } + return t, nil +} + +// SpanIDFromHex returns a SpanID from a hex string if it is compliant +// with the w3c trace-context specification. +// See more at https://www.w3.org/TR/trace-context/#parent-id +func SpanIDFromHex(h string) (SpanID, error) { + s := SpanID{} + if len(h) != 16 { + return s, errInvalidSpanIDLength + } + + if err := decodeHex(h, s[:]); err != nil { + return s, err + } + + if !s.IsValid() { + return s, errNilSpanID + } + return s, nil +} + +func decodeHex(h string, b []byte) error { + for _, r := range h { + switch { + case 'a' <= r && r <= 'f': + continue + case '0' <= r && r <= '9': + continue + default: + return errInvalidHexID + } + } + + decoded, err := hex.DecodeString(h) + if err != nil { + return err + } + + copy(b, decoded) + return nil +} + +// TraceFlags contains flags that can be set on a SpanContext. +type TraceFlags byte //nolint:revive // revive complains about stutter of `trace.TraceFlags`. + +// IsSampled returns if the sampling bit is set in the TraceFlags. +func (tf TraceFlags) IsSampled() bool { + return tf&FlagsSampled == FlagsSampled +} + +// WithSampled sets the sampling bit in a new copy of the TraceFlags. +func (tf TraceFlags) WithSampled(sampled bool) TraceFlags { // nolint:revive // sampled is not a control flag. + if sampled { + return tf | FlagsSampled + } + + return tf &^ FlagsSampled +} + +// MarshalJSON implements a custom marshal function to encode TraceFlags +// as a hex string. +func (tf TraceFlags) MarshalJSON() ([]byte, error) { + return json.Marshal(tf.String()) +} + +// String returns the hex string representation form of TraceFlags. +func (tf TraceFlags) String() string { + return hex.EncodeToString([]byte{byte(tf)}[:]) +} + +// SpanContextConfig contains mutable fields usable for constructing +// an immutable SpanContext. +type SpanContextConfig struct { + TraceID TraceID + SpanID SpanID + TraceFlags TraceFlags + TraceState TraceState + Remote bool +} + +// NewSpanContext constructs a SpanContext using values from the provided +// SpanContextConfig. +func NewSpanContext(config SpanContextConfig) SpanContext { + return SpanContext{ + traceID: config.TraceID, + spanID: config.SpanID, + traceFlags: config.TraceFlags, + traceState: config.TraceState, + remote: config.Remote, + } +} + +// SpanContext contains identifying trace information about a Span. +type SpanContext struct { + traceID TraceID + spanID SpanID + traceFlags TraceFlags + traceState TraceState + remote bool +} + +var _ json.Marshaler = SpanContext{} + +// IsValid returns if the SpanContext is valid. A valid span context has a +// valid TraceID and SpanID. +func (sc SpanContext) IsValid() bool { + return sc.HasTraceID() && sc.HasSpanID() +} + +// IsRemote indicates whether the SpanContext represents a remotely-created Span. +func (sc SpanContext) IsRemote() bool { + return sc.remote +} + +// WithRemote returns a copy of sc with the Remote property set to remote. +func (sc SpanContext) WithRemote(remote bool) SpanContext { + return SpanContext{ + traceID: sc.traceID, + spanID: sc.spanID, + traceFlags: sc.traceFlags, + traceState: sc.traceState, + remote: remote, + } +} + +// TraceID returns the TraceID from the SpanContext. +func (sc SpanContext) TraceID() TraceID { + return sc.traceID +} + +// HasTraceID checks if the SpanContext has a valid TraceID. +func (sc SpanContext) HasTraceID() bool { + return sc.traceID.IsValid() +} + +// WithTraceID returns a new SpanContext with the TraceID replaced. +func (sc SpanContext) WithTraceID(traceID TraceID) SpanContext { + return SpanContext{ + traceID: traceID, + spanID: sc.spanID, + traceFlags: sc.traceFlags, + traceState: sc.traceState, + remote: sc.remote, + } +} + +// SpanID returns the SpanID from the SpanContext. +func (sc SpanContext) SpanID() SpanID { + return sc.spanID +} + +// HasSpanID checks if the SpanContext has a valid SpanID. +func (sc SpanContext) HasSpanID() bool { + return sc.spanID.IsValid() +} + +// WithSpanID returns a new SpanContext with the SpanID replaced. +func (sc SpanContext) WithSpanID(spanID SpanID) SpanContext { + return SpanContext{ + traceID: sc.traceID, + spanID: spanID, + traceFlags: sc.traceFlags, + traceState: sc.traceState, + remote: sc.remote, + } +} + +// TraceFlags returns the flags from the SpanContext. +func (sc SpanContext) TraceFlags() TraceFlags { + return sc.traceFlags +} + +// IsSampled returns if the sampling bit is set in the SpanContext's TraceFlags. +func (sc SpanContext) IsSampled() bool { + return sc.traceFlags.IsSampled() +} + +// WithTraceFlags returns a new SpanContext with the TraceFlags replaced. +func (sc SpanContext) WithTraceFlags(flags TraceFlags) SpanContext { + return SpanContext{ + traceID: sc.traceID, + spanID: sc.spanID, + traceFlags: flags, + traceState: sc.traceState, + remote: sc.remote, + } +} + +// TraceState returns the TraceState from the SpanContext. +func (sc SpanContext) TraceState() TraceState { + return sc.traceState +} + +// WithTraceState returns a new SpanContext with the TraceState replaced. +func (sc SpanContext) WithTraceState(state TraceState) SpanContext { + return SpanContext{ + traceID: sc.traceID, + spanID: sc.spanID, + traceFlags: sc.traceFlags, + traceState: state, + remote: sc.remote, + } +} + +// Equal is a predicate that determines whether two SpanContext values are equal. +func (sc SpanContext) Equal(other SpanContext) bool { + return sc.traceID == other.traceID && + sc.spanID == other.spanID && + sc.traceFlags == other.traceFlags && + sc.traceState.String() == other.traceState.String() && + sc.remote == other.remote +} + +// MarshalJSON implements a custom marshal function to encode a SpanContext. +func (sc SpanContext) MarshalJSON() ([]byte, error) { + return json.Marshal(SpanContextConfig{ + TraceID: sc.traceID, + SpanID: sc.spanID, + TraceFlags: sc.traceFlags, + TraceState: sc.traceState, + Remote: sc.remote, + }) +} + +// Span is the individual component of a trace. It represents a single named +// and timed operation of a workflow that is traced. A Tracer is used to +// create a Span and it is then up to the operation the Span represents to +// properly end the Span when the operation itself ends. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Span interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Span + + // End completes the Span. The Span is considered complete and ready to be + // delivered through the rest of the telemetry pipeline after this method + // is called. Therefore, updates to the Span are not allowed after this + // method has been called. + End(options ...SpanEndOption) + + // AddEvent adds an event with the provided name and options. + AddEvent(name string, options ...EventOption) + + // IsRecording returns the recording state of the Span. It will return + // true if the Span is active and events can be recorded. + IsRecording() bool + + // RecordError will record err as an exception span event for this span. An + // additional call to SetStatus is required if the Status of the Span should + // be set to Error, as this method does not change the Span status. If this + // span is not being recorded or err is nil then this method does nothing. + RecordError(err error, options ...EventOption) + + // SpanContext returns the SpanContext of the Span. The returned SpanContext + // is usable even after the End method has been called for the Span. + SpanContext() SpanContext + + // SetStatus sets the status of the Span in the form of a code and a + // description, provided the status hasn't already been set to a higher + // value before (OK > Error > Unset). The description is only included in a + // status when the code is for an error. + SetStatus(code codes.Code, description string) + + // SetName sets the Span name. + SetName(name string) + + // SetAttributes sets kv as attributes of the Span. If a key from kv + // already exists for an attribute of the Span it will be overwritten with + // the value contained in kv. + SetAttributes(kv ...attribute.KeyValue) + + // TracerProvider returns a TracerProvider that can be used to generate + // additional Spans on the same telemetry pipeline as the current Span. + TracerProvider() TracerProvider +} + +// Link is the relationship between two Spans. The relationship can be within +// the same Trace or across different Traces. +// +// For example, a Link is used in the following situations: +// +// 1. Batch Processing: A batch of operations may contain operations +// associated with one or more traces/spans. Since there can only be one +// parent SpanContext, a Link is used to keep reference to the +// SpanContext of all operations in the batch. +// 2. Public Endpoint: A SpanContext for an in incoming client request on a +// public endpoint should be considered untrusted. In such a case, a new +// trace with its own identity and sampling decision needs to be created, +// but this new trace needs to be related to the original trace in some +// form. A Link is used to keep reference to the original SpanContext and +// track the relationship. +type Link struct { + // SpanContext of the linked Span. + SpanContext SpanContext + + // Attributes describe the aspects of the link. + Attributes []attribute.KeyValue +} + +// LinkFromContext returns a link encapsulating the SpanContext in the provided ctx. +func LinkFromContext(ctx context.Context, attrs ...attribute.KeyValue) Link { + return Link{ + SpanContext: SpanContextFromContext(ctx), + Attributes: attrs, + } +} + +// SpanKind is the role a Span plays in a Trace. +type SpanKind int + +// As a convenience, these match the proto definition, see +// https://github.com/open-telemetry/opentelemetry-proto/blob/30d237e1ff3ab7aa50e0922b5bebdd93505090af/opentelemetry/proto/trace/v1/trace.proto#L101-L129 +// +// The unspecified value is not a valid `SpanKind`. Use `ValidateSpanKind()` +// to coerce a span kind to a valid value. +const ( + // SpanKindUnspecified is an unspecified SpanKind and is not a valid + // SpanKind. SpanKindUnspecified should be replaced with SpanKindInternal + // if it is received. + SpanKindUnspecified SpanKind = 0 + // SpanKindInternal is a SpanKind for a Span that represents an internal + // operation within an application. + SpanKindInternal SpanKind = 1 + // SpanKindServer is a SpanKind for a Span that represents the operation + // of handling a request from a client. + SpanKindServer SpanKind = 2 + // SpanKindClient is a SpanKind for a Span that represents the operation + // of client making a request to a server. + SpanKindClient SpanKind = 3 + // SpanKindProducer is a SpanKind for a Span that represents the operation + // of a producer sending a message to a message broker. Unlike + // SpanKindClient and SpanKindServer, there is often no direct + // relationship between this kind of Span and a SpanKindConsumer kind. A + // SpanKindProducer Span will end once the message is accepted by the + // message broker which might not overlap with the processing of that + // message. + SpanKindProducer SpanKind = 4 + // SpanKindConsumer is a SpanKind for a Span that represents the operation + // of a consumer receiving a message from a message broker. Like + // SpanKindProducer Spans, there is often no direct relationship between + // this Span and the Span that produced the message. + SpanKindConsumer SpanKind = 5 +) + +// ValidateSpanKind returns a valid span kind value. This will coerce +// invalid values into the default value, SpanKindInternal. +func ValidateSpanKind(spanKind SpanKind) SpanKind { + switch spanKind { + case SpanKindInternal, + SpanKindServer, + SpanKindClient, + SpanKindProducer, + SpanKindConsumer: + // valid + return spanKind + default: + return SpanKindInternal + } +} + +// String returns the specified name of the SpanKind in lower-case. +func (sk SpanKind) String() string { + switch sk { + case SpanKindInternal: + return "internal" + case SpanKindServer: + return "server" + case SpanKindClient: + return "client" + case SpanKindProducer: + return "producer" + case SpanKindConsumer: + return "consumer" + default: + return "unspecified" + } +} + +// Tracer is the creator of Spans. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Tracer interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Tracer + + // Start creates a span and a context.Context containing the newly-created span. + // + // If the context.Context provided in `ctx` contains a Span then the newly-created + // Span will be a child of that span, otherwise it will be a root span. This behavior + // can be overridden by providing `WithNewRoot()` as a SpanOption, causing the + // newly-created Span to be a root span even if `ctx` contains a Span. + // + // When creating a Span it is recommended to provide all known span attributes using + // the `WithAttributes()` SpanOption as samplers will only have access to the + // attributes provided when a Span is created. + // + // Any Span that is created MUST also be ended. This is the responsibility of the user. + // Implementations of this API may leak memory or other resources if Spans are not ended. + Start(ctx context.Context, spanName string, opts ...SpanStartOption) (context.Context, Span) +} + +// TracerProvider provides Tracers that are used by instrumentation code to +// trace computational workflows. +// +// A TracerProvider is the collection destination of all Spans from Tracers it +// provides, it represents a unique telemetry collection pipeline. How that +// pipeline is defined, meaning how those Spans are collected, processed, and +// where they are exported, depends on its implementation. Instrumentation +// authors do not need to define this implementation, rather just use the +// provided Tracers to instrument code. +// +// Commonly, instrumentation code will accept a TracerProvider implementation +// at runtime from its users or it can simply use the globally registered one +// (see https://pkg.go.dev/go.opentelemetry.io/otel#GetTracerProvider). +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type TracerProvider interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.TracerProvider + + // Tracer returns a unique Tracer scoped to be used by instrumentation code + // to trace computational workflows. The scope and identity of that + // instrumentation code is uniquely defined by the name and options passed. + // + // The passed name needs to uniquely identify instrumentation code. + // Therefore, it is recommended that name is the Go package name of the + // library providing instrumentation (note: not the code being + // instrumented). Instrumentation libraries can have multiple versions, + // therefore, the WithInstrumentationVersion option should be used to + // distinguish these different codebases. Additionally, instrumentation + // libraries may sometimes use traces to communicate different domains of + // workflow data (i.e. using spans to communicate workflow events only). If + // this is the case, the WithScopeAttributes option should be used to + // uniquely identify Tracers that handle the different domains of workflow + // data. + // + // If the same name and options are passed multiple times, the same Tracer + // will be returned (it is up to the implementation if this will be the + // same underlying instance of that Tracer or not). It is not necessary to + // call this multiple times with the same name and options to get an + // up-to-date Tracer. All implementations will ensure any TracerProvider + // configuration changes are propagated to all provided Tracers. + // + // If name is empty, then an implementation defined default name will be + // used instead. + // + // This method is safe to call concurrently. + Tracer(name string, options ...TracerOption) Tracer +} diff --git a/vendor/go.opentelemetry.io/otel/trace/tracestate.go b/vendor/go.opentelemetry.io/otel/trace/tracestate.go new file mode 100644 index 000000000..db936ba5b --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/tracestate.go @@ -0,0 +1,331 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace // import "go.opentelemetry.io/otel/trace" + +import ( + "encoding/json" + "fmt" + "strings" +) + +const ( + maxListMembers = 32 + + listDelimiters = "," + memberDelimiter = "=" + + errInvalidKey errorConst = "invalid tracestate key" + errInvalidValue errorConst = "invalid tracestate value" + errInvalidMember errorConst = "invalid tracestate list-member" + errMemberNumber errorConst = "too many list-members in tracestate" + errDuplicate errorConst = "duplicate list-member in tracestate" +) + +type member struct { + Key string + Value string +} + +// according to (chr = %x20 / (nblk-char = %x21-2B / %x2D-3C / %x3E-7E) ) +// means (chr = %x20-2B / %x2D-3C / %x3E-7E) . +func checkValueChar(v byte) bool { + return v >= '\x20' && v <= '\x7e' && v != '\x2c' && v != '\x3d' +} + +// according to (nblk-chr = %x21-2B / %x2D-3C / %x3E-7E) . +func checkValueLast(v byte) bool { + return v >= '\x21' && v <= '\x7e' && v != '\x2c' && v != '\x3d' +} + +// based on the W3C Trace Context specification +// +// value = (0*255(chr)) nblk-chr +// nblk-chr = %x21-2B / %x2D-3C / %x3E-7E +// chr = %x20 / nblk-chr +// +// see https://www.w3.org/TR/trace-context-1/#value +func checkValue(val string) bool { + n := len(val) + if n == 0 || n > 256 { + return false + } + for i := 0; i < n-1; i++ { + if !checkValueChar(val[i]) { + return false + } + } + return checkValueLast(val[n-1]) +} + +func checkKeyRemain(key string) bool { + // ( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ) + for _, v := range key { + if isAlphaNum(byte(v)) { + continue + } + switch v { + case '_', '-', '*', '/': + continue + } + return false + } + return true +} + +// according to +// +// simple-key = lcalpha (0*255( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) +// system-id = lcalpha (0*13( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) +// +// param n is remain part length, should be 255 in simple-key or 13 in system-id. +func checkKeyPart(key string, n int) bool { + if len(key) == 0 { + return false + } + first := key[0] // key's first char + ret := len(key[1:]) <= n + ret = ret && first >= 'a' && first <= 'z' + return ret && checkKeyRemain(key[1:]) +} + +func isAlphaNum(c byte) bool { + if c >= 'a' && c <= 'z' { + return true + } + return c >= '0' && c <= '9' +} + +// according to +// +// tenant-id = ( lcalpha / DIGIT ) 0*240( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ) +// +// param n is remain part length, should be 240 exactly. +func checkKeyTenant(key string, n int) bool { + if len(key) == 0 { + return false + } + return isAlphaNum(key[0]) && len(key[1:]) <= n && checkKeyRemain(key[1:]) +} + +// based on the W3C Trace Context specification +// +// key = simple-key / multi-tenant-key +// simple-key = lcalpha (0*255( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) +// multi-tenant-key = tenant-id "@" system-id +// tenant-id = ( lcalpha / DIGIT ) (0*240( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) +// system-id = lcalpha (0*13( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) +// lcalpha = %x61-7A ; a-z +// +// see https://www.w3.org/TR/trace-context-1/#tracestate-header. +func checkKey(key string) bool { + tenant, system, ok := strings.Cut(key, "@") + if !ok { + return checkKeyPart(key, 255) + } + return checkKeyTenant(tenant, 240) && checkKeyPart(system, 13) +} + +func newMember(key, value string) (member, error) { + if !checkKey(key) { + return member{}, errInvalidKey + } + if !checkValue(value) { + return member{}, errInvalidValue + } + return member{Key: key, Value: value}, nil +} + +func parseMember(m string) (member, error) { + key, val, ok := strings.Cut(m, memberDelimiter) + if !ok { + return member{}, fmt.Errorf("%w: %s", errInvalidMember, m) + } + key = strings.TrimLeft(key, " \t") + val = strings.TrimRight(val, " \t") + result, e := newMember(key, val) + if e != nil { + return member{}, fmt.Errorf("%w: %s", errInvalidMember, m) + } + return result, nil +} + +// String encodes member into a string compliant with the W3C Trace Context +// specification. +func (m member) String() string { + return m.Key + "=" + m.Value +} + +// TraceState provides additional vendor-specific trace identification +// information across different distributed tracing systems. It represents an +// immutable list consisting of key/value pairs, each pair is referred to as a +// list-member. +// +// TraceState conforms to the W3C Trace Context specification +// (https://www.w3.org/TR/trace-context-1). All operations that create or copy +// a TraceState do so by validating all input and will only produce TraceState +// that conform to the specification. Specifically, this means that all +// list-member's key/value pairs are valid, no duplicate list-members exist, +// and the maximum number of list-members (32) is not exceeded. +type TraceState struct { //nolint:revive // revive complains about stutter of `trace.TraceState` + // list is the members in order. + list []member +} + +var _ json.Marshaler = TraceState{} + +// ParseTraceState attempts to decode a TraceState from the passed +// string. It returns an error if the input is invalid according to the W3C +// Trace Context specification. +func ParseTraceState(ts string) (TraceState, error) { + if ts == "" { + return TraceState{}, nil + } + + wrapErr := func(err error) error { + return fmt.Errorf("failed to parse tracestate: %w", err) + } + + var members []member + found := make(map[string]struct{}) + for ts != "" { + var memberStr string + memberStr, ts, _ = strings.Cut(ts, listDelimiters) + if len(memberStr) == 0 { + continue + } + + m, err := parseMember(memberStr) + if err != nil { + return TraceState{}, wrapErr(err) + } + + if _, ok := found[m.Key]; ok { + return TraceState{}, wrapErr(errDuplicate) + } + found[m.Key] = struct{}{} + + members = append(members, m) + if n := len(members); n > maxListMembers { + return TraceState{}, wrapErr(errMemberNumber) + } + } + + return TraceState{list: members}, nil +} + +// MarshalJSON marshals the TraceState into JSON. +func (ts TraceState) MarshalJSON() ([]byte, error) { + return json.Marshal(ts.String()) +} + +// String encodes the TraceState into a string compliant with the W3C +// Trace Context specification. The returned string will be invalid if the +// TraceState contains any invalid members. +func (ts TraceState) String() string { + if len(ts.list) == 0 { + return "" + } + var n int + n += len(ts.list) // member delimiters: '=' + n += len(ts.list) - 1 // list delimiters: ',' + for _, mem := range ts.list { + n += len(mem.Key) + n += len(mem.Value) + } + + var sb strings.Builder + sb.Grow(n) + _, _ = sb.WriteString(ts.list[0].Key) + _ = sb.WriteByte('=') + _, _ = sb.WriteString(ts.list[0].Value) + for i := 1; i < len(ts.list); i++ { + _ = sb.WriteByte(listDelimiters[0]) + _, _ = sb.WriteString(ts.list[i].Key) + _ = sb.WriteByte('=') + _, _ = sb.WriteString(ts.list[i].Value) + } + return sb.String() +} + +// Get returns the value paired with key from the corresponding TraceState +// list-member if it exists, otherwise an empty string is returned. +func (ts TraceState) Get(key string) string { + for _, member := range ts.list { + if member.Key == key { + return member.Value + } + } + + return "" +} + +// Insert adds a new list-member defined by the key/value pair to the +// TraceState. If a list-member already exists for the given key, that +// list-member's value is updated. The new or updated list-member is always +// moved to the beginning of the TraceState as specified by the W3C Trace +// Context specification. +// +// If key or value are invalid according to the W3C Trace Context +// specification an error is returned with the original TraceState. +// +// If adding a new list-member means the TraceState would have more members +// then is allowed, the new list-member will be inserted and the right-most +// list-member will be dropped in the returned TraceState. +func (ts TraceState) Insert(key, value string) (TraceState, error) { + m, err := newMember(key, value) + if err != nil { + return ts, err + } + n := len(ts.list) + found := n + for i := range ts.list { + if ts.list[i].Key == key { + found = i + } + } + cTS := TraceState{} + if found == n && n < maxListMembers { + cTS.list = make([]member, n+1) + } else { + cTS.list = make([]member, n) + } + cTS.list[0] = m + // When the number of members exceeds capacity, drop the "right-most". + copy(cTS.list[1:], ts.list[0:found]) + if found < n { + copy(cTS.list[1+found:], ts.list[found+1:]) + } + return cTS, nil +} + +// Delete returns a copy of the TraceState with the list-member identified by +// key removed. +func (ts TraceState) Delete(key string) TraceState { + members := make([]member, ts.Len()) + copy(members, ts.list) + for i, member := range ts.list { + if member.Key == key { + members = append(members[:i], members[i+1:]...) + // TraceState should contain no duplicate members. + break + } + } + return TraceState{list: members} +} + +// Len returns the number of list-members in the TraceState. +func (ts TraceState) Len() int { + return len(ts.list) +} diff --git a/vendor/go.opentelemetry.io/otel/verify_examples.sh b/vendor/go.opentelemetry.io/otel/verify_examples.sh new file mode 100644 index 000000000..dbb61a422 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/verify_examples.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -euo pipefail + +cd $(dirname $0) +TOOLS_DIR=$(pwd)/.tools + +if [ -z "${GOPATH}" ] ; then + printf "GOPATH is not defined.\n" + exit -1 +fi + +if [ ! -d "${GOPATH}" ] ; then + printf "GOPATH ${GOPATH} is invalid \n" + exit -1 +fi + +# Pre-requisites +if ! git diff --quiet; then \ + git status + printf "\n\nError: working tree is not clean\n" + exit -1 +fi + +if [ "$(git tag --contains $(git log -1 --pretty=format:"%H"))" = "" ] ; then + printf "$(git log -1)" + printf "\n\nError: HEAD is not pointing to a tagged version" +fi + +make ${TOOLS_DIR}/gojq + +DIR_TMP="${GOPATH}/src/oteltmp/" +rm -rf $DIR_TMP +mkdir -p $DIR_TMP + +printf "Copy examples to ${DIR_TMP}\n" +cp -a ./example ${DIR_TMP} + +# Update go.mod files +printf "Update go.mod: rename module and remove replace\n" + +PACKAGE_DIRS=$(find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; | egrep 'example' | sed 's/^\.\///' | sort) + +for dir in $PACKAGE_DIRS; do + printf " Update go.mod for $dir\n" + (cd "${DIR_TMP}/${dir}" && \ + # replaces is ("mod1" "mod2" …) + replaces=($(go mod edit -json | ${TOOLS_DIR}/gojq '.Replace[].Old.Path')) && \ + # strip double quotes + replaces=("${replaces[@]%\"}") && \ + replaces=("${replaces[@]#\"}") && \ + # make an array (-dropreplace=mod1 -dropreplace=mod2 …) + dropreplaces=("${replaces[@]/#/-dropreplace=}") && \ + go mod edit -module "oteltmp/${dir}" "${dropreplaces[@]}" && \ + go mod tidy) +done +printf "Update done:\n\n" + +# Build directories that contain main package. These directories are different than +# directories that contain go.mod files. +printf "Build examples:\n" +EXAMPLES=$(./get_main_pkgs.sh ./example) +for ex in $EXAMPLES; do + printf " Build $ex in ${DIR_TMP}/${ex}\n" + (cd "${DIR_TMP}/${ex}" && \ + go build .) +done + +# Cleanup +printf "Remove copied files.\n" +rm -rf $DIR_TMP diff --git a/vendor/go.opentelemetry.io/otel/version.go b/vendor/go.opentelemetry.io/otel/version.go new file mode 100644 index 000000000..7b2993a1f --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/version.go @@ -0,0 +1,20 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package otel // import "go.opentelemetry.io/otel" + +// Version is the current release version of OpenTelemetry in use. +func Version() string { + return "1.24.0" +} diff --git a/vendor/go.opentelemetry.io/otel/versions.yaml b/vendor/go.opentelemetry.io/otel/versions.yaml new file mode 100644 index 000000000..1b556e678 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/versions.yaml @@ -0,0 +1,56 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +module-sets: + stable-v1: + version: v1.24.0 + modules: + - go.opentelemetry.io/otel + - go.opentelemetry.io/otel/bridge/opencensus + - go.opentelemetry.io/otel/bridge/opencensus/test + - go.opentelemetry.io/otel/bridge/opentracing + - go.opentelemetry.io/otel/bridge/opentracing/test + - go.opentelemetry.io/otel/example/dice + - go.opentelemetry.io/otel/example/namedtracer + - go.opentelemetry.io/otel/example/opencensus + - go.opentelemetry.io/otel/example/otel-collector + - go.opentelemetry.io/otel/example/passthrough + - go.opentelemetry.io/otel/example/zipkin + - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc + - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp + - go.opentelemetry.io/otel/exporters/otlp/otlptrace + - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc + - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp + - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric + - go.opentelemetry.io/otel/exporters/stdout/stdouttrace + - go.opentelemetry.io/otel/exporters/zipkin + - go.opentelemetry.io/otel/metric + - go.opentelemetry.io/otel/sdk + - go.opentelemetry.io/otel/sdk/metric + - go.opentelemetry.io/otel/trace + experimental-metrics: + version: v0.46.0 + modules: + - go.opentelemetry.io/otel/example/prometheus + - go.opentelemetry.io/otel/exporters/prometheus + experimental-logs: + version: v0.0.1-alpha + modules: + - go.opentelemetry.io/otel/log + experimental-schema: + version: v0.0.7 + modules: + - go.opentelemetry.io/otel/schema +excluded-modules: + - go.opentelemetry.io/otel/internal/tools diff --git a/vendor/modules.txt b/vendor/modules.txt index b9f5d0252..03e10fe0f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -144,6 +144,9 @@ github.com/charithe/durationcheck # github.com/chavacava/garif v0.1.0 ## explicit; go 1.16 github.com/chavacava/garif +# github.com/cjlapao/common-go v0.0.39 +## explicit; go 1.19 +github.com/cjlapao/common-go/duration # github.com/ckaznocha/intrange v0.1.2 ## explicit; go 1.21 github.com/ckaznocha/intrange @@ -214,6 +217,13 @@ github.com/go-critic/go-critic/checkers/internal/astwalk github.com/go-critic/go-critic/checkers/internal/lintutil github.com/go-critic/go-critic/checkers/rulesdata github.com/go-critic/go-critic/linter +# github.com/go-logr/logr v1.4.1 +## explicit; go 1.18 +github.com/go-logr/logr +github.com/go-logr/logr/funcr +# github.com/go-logr/stdr v1.2.2 +## explicit; go 1.16 +github.com/go-logr/stdr # github.com/go-toolsmith/astcast v1.1.0 ## explicit; go 1.16 github.com/go-toolsmith/astcast @@ -255,6 +265,9 @@ github.com/gobwas/glob/util/strings # github.com/gofrs/flock v0.8.1 ## explicit github.com/gofrs/flock +# github.com/golang-jwt/jwt/v5 v5.2.1 +## explicit; go 1.18 +github.com/golang-jwt/jwt/v5 # github.com/golang/protobuf v1.5.4 ## explicit; go 1.17 github.com/golang/protobuf/proto @@ -624,6 +637,9 @@ github.com/julz/importas # github.com/karamaru-alpha/copyloopvar v1.1.0 ## explicit; go 1.21 github.com/karamaru-alpha/copyloopvar +# github.com/kfcampbell/ghinstallation v0.0.6 +## explicit; go 1.21.5 +github.com/kfcampbell/ghinstallation # github.com/kisielk/errcheck v1.7.0 ## explicit; go 1.18 github.com/kisielk/errcheck/errcheck @@ -694,6 +710,27 @@ github.com/mgechev/revive/internal/ifelse github.com/mgechev/revive/internal/typeparams github.com/mgechev/revive/lint github.com/mgechev/revive/rule +# github.com/microsoft/kiota-abstractions-go v1.6.0 +## explicit; go 1.18 +github.com/microsoft/kiota-abstractions-go +github.com/microsoft/kiota-abstractions-go/authentication +github.com/microsoft/kiota-abstractions-go/serialization +github.com/microsoft/kiota-abstractions-go/store +# github.com/microsoft/kiota-http-go v1.3.3 +## explicit; go 1.18 +github.com/microsoft/kiota-http-go +# github.com/microsoft/kiota-serialization-form-go v1.0.0 +## explicit; go 1.19 +github.com/microsoft/kiota-serialization-form-go +# github.com/microsoft/kiota-serialization-json-go v1.0.7 +## explicit; go 1.18 +github.com/microsoft/kiota-serialization-json-go +# github.com/microsoft/kiota-serialization-multipart-go v1.0.0 +## explicit; go 1.19 +github.com/microsoft/kiota-serialization-multipart-go +# github.com/microsoft/kiota-serialization-text-go v1.0.0 +## explicit; go 1.18 +github.com/microsoft/kiota-serialization-text-go # github.com/mitchellh/copystructure v1.2.0 ## explicit; go 1.15 github.com/mitchellh/copystructure @@ -740,6 +777,129 @@ github.com/nunnatsa/ginkgolinter/internal/reverseassertion github.com/nunnatsa/ginkgolinter/linter github.com/nunnatsa/ginkgolinter/types github.com/nunnatsa/ginkgolinter/version +# github.com/octokit/go-sdk v0.0.20 +## explicit; go 1.21.5 +github.com/octokit/go-sdk/pkg +github.com/octokit/go-sdk/pkg/authentication +github.com/octokit/go-sdk/pkg/github +github.com/octokit/go-sdk/pkg/github/advisories +github.com/octokit/go-sdk/pkg/github/app +github.com/octokit/go-sdk/pkg/github/applications +github.com/octokit/go-sdk/pkg/github/appmanifests +github.com/octokit/go-sdk/pkg/github/apps +github.com/octokit/go-sdk/pkg/github/assignments +github.com/octokit/go-sdk/pkg/github/classrooms +github.com/octokit/go-sdk/pkg/github/codes_of_conduct +github.com/octokit/go-sdk/pkg/github/emojis +github.com/octokit/go-sdk/pkg/github/enterprises +github.com/octokit/go-sdk/pkg/github/enterprises/item/dependabot/alerts +github.com/octokit/go-sdk/pkg/github/enterprises/item/secretscanning/alerts +github.com/octokit/go-sdk/pkg/github/events +github.com/octokit/go-sdk/pkg/github/feeds +github.com/octokit/go-sdk/pkg/github/gists +github.com/octokit/go-sdk/pkg/github/gitignore +github.com/octokit/go-sdk/pkg/github/installation +github.com/octokit/go-sdk/pkg/github/issues +github.com/octokit/go-sdk/pkg/github/licenses +github.com/octokit/go-sdk/pkg/github/markdown +github.com/octokit/go-sdk/pkg/github/marketplace_listing +github.com/octokit/go-sdk/pkg/github/marketplace_listing/plans/item/accounts +github.com/octokit/go-sdk/pkg/github/marketplace_listing/stubbed/plans/item/accounts +github.com/octokit/go-sdk/pkg/github/meta +github.com/octokit/go-sdk/pkg/github/models +github.com/octokit/go-sdk/pkg/github/networks +github.com/octokit/go-sdk/pkg/github/notifications +github.com/octokit/go-sdk/pkg/github/octocat +github.com/octokit/go-sdk/pkg/github/organizations +github.com/octokit/go-sdk/pkg/github/orgs +github.com/octokit/go-sdk/pkg/github/orgs/item/codescanning/alerts +github.com/octokit/go-sdk/pkg/github/orgs/item/codesecurity/configurations +github.com/octokit/go-sdk/pkg/github/orgs/item/dependabot/alerts +github.com/octokit/go-sdk/pkg/github/orgs/item/invitations +github.com/octokit/go-sdk/pkg/github/orgs/item/issues +github.com/octokit/go-sdk/pkg/github/orgs/item/members +github.com/octokit/go-sdk/pkg/github/orgs/item/migrations +github.com/octokit/go-sdk/pkg/github/orgs/item/migrations/item +github.com/octokit/go-sdk/pkg/github/orgs/item/outside_collaborators +github.com/octokit/go-sdk/pkg/github/orgs/item/packages +github.com/octokit/go-sdk/pkg/github/orgs/item/packages/item/item/versions +github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokenrequests +github.com/octokit/go-sdk/pkg/github/orgs/item/personalaccesstokens +github.com/octokit/go-sdk/pkg/github/orgs/item/projects +github.com/octokit/go-sdk/pkg/github/orgs/item/repos +github.com/octokit/go-sdk/pkg/github/orgs/item/rulesets/rulesuites +github.com/octokit/go-sdk/pkg/github/orgs/item/secretscanning/alerts +github.com/octokit/go-sdk/pkg/github/orgs/item/securityadvisories +github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions +github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/comments +github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/comments/item/reactions +github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/discussions/item/reactions +github.com/octokit/go-sdk/pkg/github/orgs/item/teams/item/members +github.com/octokit/go-sdk/pkg/github/projects +github.com/octokit/go-sdk/pkg/github/projects/columns/item/cards +github.com/octokit/go-sdk/pkg/github/projects/item/collaborators +github.com/octokit/go-sdk/pkg/github/rate_limit +github.com/octokit/go-sdk/pkg/github/repos +github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/caches +github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/runs +github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/runs/item/jobs +github.com/octokit/go-sdk/pkg/github/repos/item/item/actions/workflows/item/runs +github.com/octokit/go-sdk/pkg/github/repos/item/item/activity +github.com/octokit/go-sdk/pkg/github/repos/item/item/checksuites/item/checkruns +github.com/octokit/go-sdk/pkg/github/repos/item/item/codescanning/alerts +github.com/octokit/go-sdk/pkg/github/repos/item/item/codescanning/analyses +github.com/octokit/go-sdk/pkg/github/repos/item/item/collaborators +github.com/octokit/go-sdk/pkg/github/repos/item/item/comments/item/reactions +github.com/octokit/go-sdk/pkg/github/repos/item/item/commits/item/checkruns +github.com/octokit/go-sdk/pkg/github/repos/item/item/dependabot/alerts +github.com/octokit/go-sdk/pkg/github/repos/item/item/forks +github.com/octokit/go-sdk/pkg/github/repos/item/item/issues +github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/comments +github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/comments/item/reactions +github.com/octokit/go-sdk/pkg/github/repos/item/item/issues/item/reactions +github.com/octokit/go-sdk/pkg/github/repos/item/item/milestones +github.com/octokit/go-sdk/pkg/github/repos/item/item/projects +github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls +github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/comments +github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/comments/item/reactions +github.com/octokit/go-sdk/pkg/github/repos/item/item/pulls/item/comments +github.com/octokit/go-sdk/pkg/github/repos/item/item/releases/item/reactions +github.com/octokit/go-sdk/pkg/github/repos/item/item/rulesets/rulesuites +github.com/octokit/go-sdk/pkg/github/repos/item/item/secretscanning/alerts +github.com/octokit/go-sdk/pkg/github/repos/item/item/securityadvisories +github.com/octokit/go-sdk/pkg/github/repos/item/item/traffic/clones +github.com/octokit/go-sdk/pkg/github/repos/item/item/traffic/views +github.com/octokit/go-sdk/pkg/github/repositories +github.com/octokit/go-sdk/pkg/github/search +github.com/octokit/go-sdk/pkg/github/search/code +github.com/octokit/go-sdk/pkg/github/search/commits +github.com/octokit/go-sdk/pkg/github/search/issues +github.com/octokit/go-sdk/pkg/github/search/labels +github.com/octokit/go-sdk/pkg/github/search/repositories +github.com/octokit/go-sdk/pkg/github/search/users +github.com/octokit/go-sdk/pkg/github/teams +github.com/octokit/go-sdk/pkg/github/teams/item/discussions +github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/comments +github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/comments/item/reactions +github.com/octokit/go-sdk/pkg/github/teams/item/discussions/item/reactions +github.com/octokit/go-sdk/pkg/github/teams/item/members +github.com/octokit/go-sdk/pkg/github/user +github.com/octokit/go-sdk/pkg/github/user/issues +github.com/octokit/go-sdk/pkg/github/user/memberships/orgs +github.com/octokit/go-sdk/pkg/github/user/packages +github.com/octokit/go-sdk/pkg/github/user/packages/item/item/versions +github.com/octokit/go-sdk/pkg/github/user/repos +github.com/octokit/go-sdk/pkg/github/user/starred +github.com/octokit/go-sdk/pkg/github/users +github.com/octokit/go-sdk/pkg/github/users/item/hovercard +github.com/octokit/go-sdk/pkg/github/users/item/packages +github.com/octokit/go-sdk/pkg/github/users/item/projects +github.com/octokit/go-sdk/pkg/github/users/item/repos +github.com/octokit/go-sdk/pkg/github/users/item/starred +github.com/octokit/go-sdk/pkg/github/versions +github.com/octokit/go-sdk/pkg/github/zen +github.com/octokit/go-sdk/pkg/handlers +github.com/octokit/go-sdk/pkg/headers # github.com/oklog/run v1.0.0 ## explicit github.com/oklog/run @@ -901,6 +1061,9 @@ github.com/ssgreg/nlreturn/v2/pkg/nlreturn # github.com/stbenjam/no-sprintf-host-port v0.1.1 ## explicit; go 1.16 github.com/stbenjam/no-sprintf-host-port/pkg/analyzer +# github.com/std-uritemplate/std-uritemplate/go v0.0.55 +## explicit; go 1.20 +github.com/std-uritemplate/std-uritemplate/go # github.com/stretchr/objx v0.5.2 ## explicit; go 1.20 github.com/stretchr/objx @@ -995,6 +1158,25 @@ go-simpler.org/musttag # go-simpler.org/sloglint v0.7.1 ## explicit; go 1.21 go-simpler.org/sloglint +# go.opentelemetry.io/otel v1.24.0 +## explicit; go 1.20 +go.opentelemetry.io/otel +go.opentelemetry.io/otel/attribute +go.opentelemetry.io/otel/baggage +go.opentelemetry.io/otel/codes +go.opentelemetry.io/otel/internal +go.opentelemetry.io/otel/internal/attribute +go.opentelemetry.io/otel/internal/baggage +go.opentelemetry.io/otel/internal/global +go.opentelemetry.io/otel/propagation +# go.opentelemetry.io/otel/metric v1.24.0 +## explicit; go 1.20 +go.opentelemetry.io/otel/metric +go.opentelemetry.io/otel/metric/embedded +# go.opentelemetry.io/otel/trace v1.24.0 +## explicit; go 1.20 +go.opentelemetry.io/otel/trace +go.opentelemetry.io/otel/trace/embedded # go.uber.org/atomic v1.7.0 ## explicit; go 1.13 go.uber.org/atomic